mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
sts: validate if iam subsystem initialized in handlers (#17796)
This commit is contained in:
@@ -39,7 +39,7 @@ func writeSTSErrorResponse(ctx context.Context, w http.ResponseWriter, errCode S
|
||||
stsErrorResponse.Error.Message = errCtxt.Error()
|
||||
}
|
||||
switch errCode {
|
||||
case ErrSTSInternalError, ErrSTSNotInitialized, ErrSTSUpstreamError:
|
||||
case ErrSTSInternalError, ErrSTSNotInitialized, ErrSTSUpstreamError, ErrSTSIAMNotInitialized:
|
||||
logger.LogIf(ctx, errCtxt, logger.Minio)
|
||||
}
|
||||
encodedErrorResponse := encodeResponse(stsErrorResponse)
|
||||
@@ -82,6 +82,7 @@ const (
|
||||
ErrSTSInsecureConnection
|
||||
ErrSTSInvalidClientCertificate
|
||||
ErrSTSNotInitialized
|
||||
ErrSTSIAMNotInitialized
|
||||
ErrSTSUpstreamError
|
||||
ErrSTSInternalError
|
||||
)
|
||||
@@ -149,6 +150,11 @@ var stsErrCodes = stsErrorCodeMap{
|
||||
Description: "STS API not initialized, please try again.",
|
||||
HTTPStatusCode: http.StatusServiceUnavailable,
|
||||
},
|
||||
ErrSTSIAMNotInitialized: {
|
||||
Code: "STSIAMNotInitialized",
|
||||
Description: "STS IAM not initialized, please try again.",
|
||||
HTTPStatusCode: http.StatusServiceUnavailable,
|
||||
},
|
||||
ErrSTSUpstreamError: {
|
||||
Code: "InternalError",
|
||||
Description: "An upstream service required for this operation failed - please try again or contact an administrator.",
|
||||
|
||||
Reference in New Issue
Block a user