mirror of
https://github.com/pgsty/minio.git
synced 2026-07-21 13:10:22 +03:00
fix: assume parentUser correctly for serviceAccounts (#9504)
ListServiceAccounts/DeleteServiceAccount didn't work properly with STS credentials yet due to incorrect Parent user.
This commit is contained in:
+4
-5
@@ -889,11 +889,10 @@ func (sys *IAMSys) GetServiceAccountParent(ctx context.Context, accessKey string
|
||||
defer sys.store.runlock()
|
||||
|
||||
sa, ok := sys.iamUsersMap[accessKey]
|
||||
if !ok || !sa.IsServiceAccount() {
|
||||
return "", errNoSuchServiceAccount
|
||||
if ok && sa.IsServiceAccount() {
|
||||
return sa.ParentUser, nil
|
||||
}
|
||||
|
||||
return sa.ParentUser, nil
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// DeleteServiceAccount - delete a service account
|
||||
@@ -908,7 +907,7 @@ func (sys *IAMSys) DeleteServiceAccount(ctx context.Context, accessKey string) e
|
||||
|
||||
sa, ok := sys.iamUsersMap[accessKey]
|
||||
if !ok || !sa.IsServiceAccount() {
|
||||
return errNoSuchServiceAccount
|
||||
return nil
|
||||
}
|
||||
|
||||
// It is ok to ignore deletion error on the mapped policy
|
||||
|
||||
Reference in New Issue
Block a user