Merge pull request #15660 from reasonerjt/no-warning-groupclaim

Do not print warning message if group claim is empty
This commit is contained in:
Daniel Jiang 2021-09-24 18:23:05 +08:00 committed by GitHub
commit c3f92a748c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -383,7 +383,9 @@ func groupsFromClaims(gp claimsProvider, k string) ([]string, bool) {
}
g, ok := claimMap[k].([]interface{})
if !ok {
log.Warningf("Unable to get groups from claims, claims: %+v, groups claims key: %s", claimMap, k)
if len(strings.TrimSpace(k)) > 0 {
log.Warningf("Unable to get groups from claims, claims: %+v, groups claims key: %s", claimMap, k)
}
return res, false
}
for _, e := range g {