mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
parent
41f75e6d1b
commit
1cf726348f
@ -82,6 +82,7 @@ const (
|
|||||||
ErrIncompleteBody
|
ErrIncompleteBody
|
||||||
ErrInternalError
|
ErrInternalError
|
||||||
ErrInvalidAccessKeyID
|
ErrInvalidAccessKeyID
|
||||||
|
ErrAccessKeyDisabled
|
||||||
ErrInvalidBucketName
|
ErrInvalidBucketName
|
||||||
ErrInvalidDigest
|
ErrInvalidDigest
|
||||||
ErrInvalidRange
|
ErrInvalidRange
|
||||||
@ -514,6 +515,11 @@ var errorCodes = errorCodeMap{
|
|||||||
Description: "The Access Key Id you provided does not exist in our records.",
|
Description: "The Access Key Id you provided does not exist in our records.",
|
||||||
HTTPStatusCode: http.StatusForbidden,
|
HTTPStatusCode: http.StatusForbidden,
|
||||||
},
|
},
|
||||||
|
ErrAccessKeyDisabled: {
|
||||||
|
Code: "InvalidAccessKeyId",
|
||||||
|
Description: "Your account is disabled; please contact your administrator.",
|
||||||
|
HTTPStatusCode: http.StatusForbidden,
|
||||||
|
},
|
||||||
ErrInvalidBucketName: {
|
ErrInvalidBucketName: {
|
||||||
Code: "InvalidBucketName",
|
Code: "InvalidBucketName",
|
||||||
Description: "The specified bucket is not valid.",
|
Description: "The specified bucket is not valid.",
|
||||||
@ -681,7 +687,7 @@ var errorCodes = errorCodeMap{
|
|||||||
},
|
},
|
||||||
ErrAllAccessDisabled: {
|
ErrAllAccessDisabled: {
|
||||||
Code: "AllAccessDisabled",
|
Code: "AllAccessDisabled",
|
||||||
Description: "All access to this bucket has been disabled.",
|
Description: "All access to this resource has been disabled.",
|
||||||
HTTPStatusCode: http.StatusForbidden,
|
HTTPStatusCode: http.StatusForbidden,
|
||||||
},
|
},
|
||||||
ErrMalformedPolicy: {
|
ErrMalformedPolicy: {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -154,6 +154,11 @@ func checkKeyValid(r *http.Request, accessKey string) (auth.Credentials, bool, A
|
|||||||
// Check if the access key is part of users credentials.
|
// Check if the access key is part of users credentials.
|
||||||
ucred, ok := globalIAMSys.GetUser(r.Context(), accessKey)
|
ucred, ok := globalIAMSys.GetUser(r.Context(), accessKey)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
// Credentials will be invalid but and disabled
|
||||||
|
// return a different error in such a scenario.
|
||||||
|
if ucred.Status == auth.AccountOff {
|
||||||
|
return cred, false, ErrAccessKeyDisabled
|
||||||
|
}
|
||||||
return cred, false, ErrInvalidAccessKeyID
|
return cred, false, ErrInvalidAccessKeyID
|
||||||
}
|
}
|
||||||
cred = ucred
|
cred = ucred
|
||||||
|
Loading…
Reference in New Issue
Block a user