add missing signature v2 query params (#9670)

This commit is contained in:
Harshavardhana
2020-05-21 18:51:23 -07:00
committed by GitHub
parent f1f414ca59
commit d15042470e
2 changed files with 22 additions and 9 deletions

View File

@@ -33,19 +33,15 @@ import (
"github.com/minio/minio/pkg/auth"
)
// Signature and API related constants.
const (
signV2Algorithm = "AWS"
)
// AWS S3 Signature V2 calculation rule is give here:
// http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#RESTAuthenticationStringToSign
// Whitelist resource list that will be used in query string for signature-V2 calculation.
// The list should be alphabetically sorted
//
// This list should be kept alphabetically sorted, do not hastily edit.
var resourceList = []string{
"acl",
"cors",
"delete",
"encryption",
"legal-hold",
"lifecycle",
"location",
"logging",
@@ -59,6 +55,10 @@ var resourceList = []string{
"response-content-language",
"response-content-type",
"response-expires",
"retention",
"select",
"select-type",
"tagging",
"torrent",
"uploadId",
"uploads",
@@ -68,6 +68,14 @@ var resourceList = []string{
"website",
}
// Signature and API related constants.
const (
signV2Algorithm = "AWS"
)
// AWS S3 Signature V2 calculation rule is give here:
// http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#RESTAuthenticationStringToSign
func doesPolicySignatureV2Match(formValues http.Header) APIErrorCode {
cred := globalActiveCred
accessKey := formValues.Get(xhttp.AmzAccessKeyID)