aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-07-26 12:06:45 -0700
committerChris Lu <chris.lu@gmail.com>2020-07-26 12:06:45 -0700
commitea0180de4e35c2d1d856e153150f30915a712fc5 (patch)
treea5204a3f9d084cac34559359e1355724c0b34374
parent3faa0aa4482fbac89f090b0efef920f4ce84776e (diff)
downloadseaweedfs-ea0180de4e35c2d1d856e153150f30915a712fc5.tar.xz
seaweedfs-ea0180de4e35c2d1d856e153150f30915a712fc5.zip
auth for presigned put operation
-rw-r--r--weed/s3api/s3api_object_handlers.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go
index 0d287c4ff..29be4a7c2 100644
--- a/weed/s3api/s3api_object_handlers.go
+++ b/weed/s3api/s3api_object_handlers.go
@@ -45,8 +45,13 @@ func (s3a *S3ApiServer) PutObjectHandler(w http.ResponseWriter, r *http.Request)
rAuthType := getRequestAuthType(r)
dataReader := r.Body
var s3ErrCode ErrorCode
- if rAuthType == authTypeStreamingSigned {
+ switch rAuthType {
+ case authTypeStreamingSigned:
dataReader, s3ErrCode = s3a.iam.newSignV4ChunkedReader(r)
+ case authTypeSignedV2, authTypePresignedV2:
+ _, s3ErrCode = s3a.iam.isReqAuthenticatedV2(r)
+ case authTypePresigned, authTypeSigned:
+ _, s3ErrCode = s3a.iam.reqSignatureV4Verify(r)
}
if s3ErrCode != ErrNone {
writeErrorResponse(w, s3ErrCode, r.URL)