mirror of
https://github.com/pgsty/minio.git
synced 2026-10-18 07:26:10 +03:00
fix(iam): normalize bulk self access-key listings
Use the existing self-service authorization helper for policyless regular users and normalize explicit service-account and STS aliases to their parent. Keep explicit denials and cross-user authorization intact. Assert decrypted identity contents and negative boundaries in the existing handler tests. Adapted from commit 5d0b692d8cd387622a3219e72430dffaaf5a25ce. Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
@@ -1237,7 +1237,7 @@ func (a adminAPIHandlers) ListAccessKeysBulk(w http.ResponseWriter, r *http.Requ
|
||||
}
|
||||
}
|
||||
|
||||
if !globalIAMSys.IsAllowed(policy.Args{
|
||||
if !isAllowedServiceAccountAction(cred, policy.Args{
|
||||
AccountName: cred.AccessKey,
|
||||
Groups: cred.Groups,
|
||||
Action: policy.ListServiceAccountsAdminAction,
|
||||
@@ -1250,12 +1250,12 @@ func (a adminAPIHandlers) ListAccessKeysBulk(w http.ResponseWriter, r *http.Requ
|
||||
return
|
||||
}
|
||||
|
||||
if selfOnly && len(users) == 0 {
|
||||
if selfOnly {
|
||||
selfUser := cred.AccessKey
|
||||
if cred.ParentUser != "" {
|
||||
selfUser = cred.ParentUser
|
||||
}
|
||||
users = append(users, selfUser)
|
||||
users = []string{selfUser}
|
||||
}
|
||||
|
||||
var checkedUserList []string
|
||||
|
||||
Reference in New Issue
Block a user