Skip to content

Commit

Permalink
Add func docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jjngx committed May 8, 2023
1 parent 2cb2cd8 commit 156b6b6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/apis/configuration/validation/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,14 @@ var validOIDCScopeRanges = &unicode.RangeTable{
},
}

// https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims
// validateOIDCScope takes a scope representing OIDC scope tokens and
// checks if the scope is valid. OIDC scope must contain scope token
// "openid". Additionally, custom scope tokens can be added to the scope.
//
// Ref:
// - https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims
//
// Scope tokens must be separated by "+", and the "+" can't be a part of the token.
func validateOIDCScope(scope string, fieldPath *field.Path) field.ErrorList {
if !strings.Contains(scope, "openid") {
return field.ErrorList{field.Required(fieldPath, "openid is required")}
Expand Down

0 comments on commit 156b6b6

Please sign in to comment.