History

Parse and return proper errors with x-amz-security-token (#6766)

This PR also simplifies the token and access key validation across our signature handling.

Harshavardhana committed 8 years ago

Commit bf414061 parent 88959ce9 files · +103 −148Browse files

Showing the changes to cmd/api-errors.go (1 of 9 files). Show all

Unified · Split

cmd/api-errors.go+13−0
@@ -150,6 +150,9 @@ const ( · 149 unmodified lines
150150 ErrKMSNotConfigured
151151 ErrKMSAuthFailure
152152
153+ ErrNoAccessKey
154+ ErrInvalidToken
155+
153156 // Bucket notification related errors.
154157 ErrEventNotification
155158 ErrARNNotification
@@ -806,6 +809,16 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 650 unmodified lines
806809 Description: "Server side encryption specified but KMS authorization failed",
807810 HTTPStatusCode: http.StatusBadRequest,
808811 },
812+ ErrNoAccessKey: {
813+ Code: "AccessDenied",
814+ Description: "No AWSAccessKey was presented",
815+ HTTPStatusCode: http.StatusForbidden,
816+ },
817+ ErrInvalidToken: {
818+ Code: "InvalidTokenId",
819+ Description: "The security token included in the request is invalid",
820+ HTTPStatusCode: http.StatusForbidden,
821+ },
809822
810823 /// S3 extensions.
811824 ErrContentSHA256Mismatch: {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t