mirror of
https://github.com/minio/minio.git
synced 2025-11-28 13:09:09 -05:00
error: Signature errors should be returned with APIErrorCode.
The reasoning is that we can reply back with wide range of S3 error responses, which would provide more richer context to S3 client. Fixes #1267
This commit is contained in:
@@ -130,25 +130,9 @@ func isReqAuthenticated(r *http.Request) (s3Error APIErrorCode) {
|
||||
// Populate back the payload.
|
||||
r.Body = ioutil.NopCloser(bytes.NewReader(payload))
|
||||
if isRequestSignatureV4(r) {
|
||||
ok, err := doesSignatureMatch(hex.EncodeToString(sum256(payload)), r)
|
||||
if err != nil {
|
||||
errorIf(err.Trace(), "Signature verification failed.", nil)
|
||||
return ErrInternalError
|
||||
}
|
||||
if !ok {
|
||||
return ErrSignatureDoesNotMatch
|
||||
}
|
||||
return ErrNone
|
||||
return doesSignatureMatch(hex.EncodeToString(sum256(payload)), r)
|
||||
} else if isRequestPresignedSignatureV4(r) {
|
||||
ok, err := doesPresignedSignatureMatch(r)
|
||||
if err != nil {
|
||||
errorIf(err.Trace(), "Presigned signature verification failed.", nil)
|
||||
return ErrInternalError
|
||||
}
|
||||
if !ok {
|
||||
return ErrSignatureDoesNotMatch
|
||||
}
|
||||
return ErrNone
|
||||
return doesPresignedSignatureMatch(r)
|
||||
}
|
||||
return ErrAccessDenied
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user