mirror of
https://github.com/minio/minio.git
synced 2025-02-27 13:29:15 -05:00
do not change targetUser after permission validation
for service accounts make sure that targetUser is always the one that is presented/validated from the incoming request, not the parentUser.
This commit is contained in:
parent
af1b6e3458
commit
b8833c2947
@ -525,12 +525,10 @@ func (a adminAPIHandlers) AddServiceAccount(w http.ResponseWriter, r *http.Reque
|
||||
} else {
|
||||
if cred.IsServiceAccount() || cred.IsTemp() {
|
||||
if cred.ParentUser == "" {
|
||||
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, errors.New("service accounts cannot be generated for temporary credentials without parent")), r.URL)
|
||||
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx,
|
||||
errors.New("service accounts cannot be generated for temporary credentials without parent")), r.URL)
|
||||
return
|
||||
}
|
||||
targetUser = cred.ParentUser
|
||||
} else {
|
||||
targetUser = cred.AccessKey
|
||||
}
|
||||
targetGroups = cred.Groups
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user