mirror of
https://github.com/minio/minio.git
synced 2025-03-31 17:53:43 -04:00
try loading temp account if not in cache (#20266)
This commit is contained in:
parent
d8dfb57d5c
commit
4687c4616f
@ -1221,10 +1221,19 @@ func (sys *IAMSys) getServiceAccount(ctx context.Context, accessKey string) (Use
|
|||||||
|
|
||||||
// GetTemporaryAccount - wrapper method to get information about a temporary account
|
// GetTemporaryAccount - wrapper method to get information about a temporary account
|
||||||
func (sys *IAMSys) GetTemporaryAccount(ctx context.Context, accessKey string) (auth.Credentials, *policy.Policy, error) {
|
func (sys *IAMSys) GetTemporaryAccount(ctx context.Context, accessKey string) (auth.Credentials, *policy.Policy, error) {
|
||||||
|
if !sys.Initialized() {
|
||||||
|
return auth.Credentials{}, nil, errServerNotInitialized
|
||||||
|
}
|
||||||
tmpAcc, embeddedPolicy, err := sys.getTempAccount(ctx, accessKey)
|
tmpAcc, embeddedPolicy, err := sys.getTempAccount(ctx, accessKey)
|
||||||
|
if err != nil {
|
||||||
|
if err == errNoSuchTempAccount {
|
||||||
|
sys.store.LoadUser(ctx, accessKey)
|
||||||
|
tmpAcc, embeddedPolicy, err = sys.getTempAccount(ctx, accessKey)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return auth.Credentials{}, nil, err
|
return auth.Credentials{}, nil, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Hide secret & session keys
|
// Hide secret & session keys
|
||||||
tmpAcc.Credentials.SecretKey = ""
|
tmpAcc.Credentials.SecretKey = ""
|
||||||
tmpAcc.Credentials.SessionToken = ""
|
tmpAcc.Credentials.SessionToken = ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user