@ -346,8 +351,8 @@ var errorCodeResponse = map[APIErrorCode]APIError{
HTTPStatusCode:http.StatusBadRequest,
},
ErrCredMalformed:{
Code:"CredentialMalformed",
Description:"Credential field malformed does not follow accessKeyID/credScope.",
Code:"AuthorizationQueryParametersError",
Description:"Error parsing the X-Amz-Credential parameter; the Credential is mal-formed; expecting \"<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request\".",
HTTPStatusCode:http.StatusBadRequest,
},
ErrMalformedDate:{
@ -355,19 +360,46 @@ var errorCodeResponse = map[APIErrorCode]APIError{
Description:"Invalid date format header, expected to be in ISO8601, RFC1123 or RFC1123Z time format.",
HTTPStatusCode:http.StatusBadRequest,
},
ErrMalformedPresignedDate:{
Code:"AuthorizationQueryParametersError",
Description:"X-Amz-Date must be in the ISO8601 Long Format \"yyyyMMdd'T'HHmmss'Z'\"",
HTTPStatusCode:http.StatusBadRequest,
},
// FIXME: Should contain the invalid param set as seen in https://github.com/minio/minio/issues/2385.
// right Description: "Error parsing the X-Amz-Credential parameter; incorrect date format \"%s\". This date in the credential must be in the format \"yyyyMMdd\".",
// Need changes to make sure variable messages can be constructed.
ErrMalformedCredentialDate:{
Code:"AuthorizationQueryParametersError",
Description:"Error parsing the X-Amz-Credential parameter; incorrect date format \"%s\". This date in the credential must be in the format \"yyyyMMdd\".",
HTTPStatusCode:http.StatusBadRequest,
},
// FIXME: Should contain the invalid param set as seen in https://github.com/minio/minio/issues/2385.
// right Description: "Error parsing the X-Amz-Credential parameter; the region 'us-east-' is wrong; expecting 'us-east-1'".
// Need changes to make sure variable messages can be constructed.
ErrMalformedCredentialRegion:{
Code:"AuthorizationQueryParametersError",
Description:"Error parsing the X-Amz-Credential parameter; the region is wrong;",
HTTPStatusCode:http.StatusBadRequest,
},
ErrInvalidRegion:{
Code:"InvalidRegion",
Description:"Region does not match.",
HTTPStatusCode:http.StatusBadRequest,
},
// FIXME: Should contain the invalid param set as seen in https://github.com/minio/minio/issues/2385.
// right Description: "Error parsing the X-Amz-Credential parameter; incorrect service \"s4\". This endpoint belongs to \"s3\".".
// Need changes to make sure variable messages can be constructed.
ErrInvalidService:{
Code:"AccessDenied",
Description:"Service scope should be of value 's3'.",
Code:"AuthorizationQueryParametersError",
Description:"Error parsing the X-Amz-Credential parameter; incorrect service. This endpoint belongs to \"s3\".",
HTTPStatusCode:http.StatusBadRequest,
},
// FIXME: Should contain the invalid param set as seen in https://github.com/minio/minio/issues/2385.
// Description: "Error parsing the X-Amz-Credential parameter; incorrect terminal "aws4_reque". This endpoint uses "aws4_request".
// Need changes to make sure variable messages can be constructed.
ErrInvalidRequestVersion:{
Code:"AccessDenied",
Description:"Request scope should be of value 'aws4_request'.",
Code:"AuthorizationQueryParametersError",
Description:"Error parsing the X-Amz-Credential parameter; incorrect terminal. This endpoint uses \"aws4_request\".",
HTTPStatusCode:http.StatusBadRequest,
},
ErrMissingSignTag:{
@ -386,8 +418,13 @@ var errorCodeResponse = map[APIErrorCode]APIError{
t.Errorf("Test %d: Expected date to be %v, but got %v",i+1,testCase.expectedPreSignValues.Date.UTC().Format(iso8601Format),parsedPreSign.Date.UTC().Format(iso8601Format))
// If the `expect` key exists in the signed headers then golang server would have stripped out the value, expecting the `expect` header set to `100-continue` in the result.