Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrects OIDC group parsing in case userinfo_endpoint is not OIDC compliant #19772

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/pkg/oidc/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ func groupsFromClaims(gp claimsProvider, k string) ([]string, bool) {
}
res = append(res, s)
}
// if remote.Groups is not a []string, but local.Groups is, this will create a fallback

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, given remote/local are not declared in this func, this chunk should also be moved out...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, given remote/local are not declared in this func, this chunk should also be moved out...

It makes sense, but IMO a comment in this location is necessary to explain this conditional.

What are your thoughts on changing the wording to something like

in case all elements of the groupClaim are invalid, this creates a fallback to the next groupClaim?

if len(res) == 0 {
return res, false
}
return res, true
}

Expand Down