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
150 ErrKMSNotConfigured150 ErrKMSNotConfigured
151 ErrKMSAuthFailure151 ErrKMSAuthFailure
152 152
153 ErrNoAccessKey
154 ErrInvalidToken
155
153 // Bucket notification related errors.156 // Bucket notification related errors.
154 ErrEventNotification157 ErrEventNotification
155 ErrARNNotification158 ErrARNNotification
@@ -806,6 +809,16 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 650 unmodified lines
806 Description: "Server side encryption specified but KMS authorization failed",809 Description: "Server side encryption specified but KMS authorization failed",
807 HTTPStatusCode: http.StatusBadRequest,810 HTTPStatusCode: http.StatusBadRequest,
808 },811 },
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 },
809 822
810 /// S3 extensions.823 /// S3 extensions.
811 ErrContentSHA256Mismatch: {824 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