Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 916c786

Browse filesBrowse files
committed
fix godoc for email_verified requirement when username contains claims.email
Using 'claims.?email_verified.orValue(true) == true' in the example validation rule. By explicitly comparing the value to true, we let type-checking see the result will be a boolean, and to make sure a non-boolean email_verified claim will be caught at runtime. Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
1 parent 917a556 commit 916c786
Copy full SHA for 916c786

File tree

Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed

‎staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go

Copy file name to clipboardExpand all lines: staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ type ClaimMappings struct {
352352
// If username.expression uses 'claims.email', then 'claims.email_verified' must be used in
353353
// username.expression or extra[*].valueExpression or claimValidationRules[*].expression.
354354
// An example claim validation rule expression that matches the validation automatically
355-
// applied when username.claim is set to 'email' is 'claims.?email_verified.orValue(true)'.
355+
// applied when username.claim is set to 'email' is 'claims.?email_verified.orValue(true) == true'. By explicitly comparing
356+
// the value to true, we let type-checking see the result will be a boolean, and to make sure a non-boolean email_verified
357+
// claim will be caught at runtime.
356358
//
357359
// In the flag based approach, the --oidc-username-claim and --oidc-username-prefix are optional. If --oidc-username-claim is not set,
358360
// the default value is "sub". For the authentication config, there is no defaulting for claim or prefix. The claim and prefix must be set explicitly.

‎staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/types.go

Copy file name to clipboardExpand all lines: staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/types.go
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,9 @@ type ClaimMappings struct {
323323
// If username.expression uses 'claims.email', then 'claims.email_verified' must be used in
324324
// username.expression or extra[*].valueExpression or claimValidationRules[*].expression.
325325
// An example claim validation rule expression that matches the validation automatically
326-
// applied when username.claim is set to 'email' is 'claims.?email_verified.orValue(true)'.
326+
// applied when username.claim is set to 'email' is 'claims.?email_verified.orValue(true) == true'. By explicitly comparing
327+
// the value to true, we let type-checking see the result will be a boolean, and to make sure a non-boolean email_verified
328+
// claim will be caught at runtime.
327329
//
328330
// In the flag based approach, the --oidc-username-claim and --oidc-username-prefix are optional. If --oidc-username-claim is not set,
329331
// the default value is "sub". For the authentication config, there is no defaulting for claim or prefix. The claim and prefix must be set explicitly.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.