Fix user cache lookup filtering for service users (#849)

This commit is contained in:
pascal-fischer 2023-05-10 19:27:17 +02:00 committed by GitHub
parent 6f2c4078ef
commit e4c28f64fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -902,8 +902,10 @@ func (am *DefaultAccountManager) lookupUserInCacheByEmail(email string, accountI
func (am *DefaultAccountManager) lookupUserInCache(userID string, account *Account) (*idp.UserData, error) { func (am *DefaultAccountManager) lookupUserInCache(userID string, account *Account) (*idp.UserData, error) {
users := make(map[string]struct{}, len(account.Users)) users := make(map[string]struct{}, len(account.Users))
for _, user := range account.Users { for _, user := range account.Users {
if !user.IsServiceUser {
users[user.Id] = struct{}{} users[user.Id] = struct{}{}
} }
}
log.Debugf("looking up user %s of account %s in cache", userID, account.Id) log.Debugf("looking up user %s of account %s in cache", userID, account.Id)
userData, err := am.lookupCache(users, account.Id) userData, err := am.lookupCache(users, account.Id)
if err != nil { if err != nil {