fix: LDAP authentication with groups only (#12283)

fixes #12282
This commit is contained in:
Harshavardhana
2021-05-12 21:25:07 -07:00
committed by GitHub
parent 57aed841dd
commit 5c0a7189c7
2 changed files with 20 additions and 14 deletions

View File

@@ -523,6 +523,7 @@ func (a adminAPIHandlers) AddServiceAccount(w http.ResponseWriter, r *http.Reque
return
}
// targerUser is set to bindDN at this point in time.
// targetGroups is set to the groups at this point in time.
} else {
if cred.IsServiceAccount() || cred.IsTemp() {
if cred.ParentUser == "" {
@@ -534,7 +535,10 @@ func (a adminAPIHandlers) AddServiceAccount(w http.ResponseWriter, r *http.Reque
targetUser = cred.ParentUser
}
}
targetGroups = cred.Groups
// targetGroups not yet set, so set this to cred.Groups
if len(targetGroups) == 0 {
targetGroups = cred.Groups
}
}
var sp *iampolicy.Policy