fix: username replacements for aws:username must use parentUser (#16591)

This commit is contained in:
Harshavardhana authored and GitHub committed 2023-02-10 06:52:31 -08:00
1 parent 6b41f941b6
commit b363400587
2 files changed
+99

No files matched your search

+5
View File
@@ -75,6 +75,11 @@ func getConditionValues(r *http.Request, lc string, cred auth.Credentials) map[s
groups = cred.Groups
)
if cred.IsTemp() || cred.IsServiceAccount() {
// For derived credentials, check the parent user's permissions.
username = cred.ParentUser
}
principalType := "Anonymous"
if username != "" {
principalType = "User"