Browse Source

auth for presigned put operation

pull/1479/head
Chris Lu 4 years ago
parent
commit
ea0180de4e
  1. 7
      weed/s3api/s3api_object_handlers.go

7
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)

Loading…
Cancel
Save