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> Kubernetes-commit: 916c7867f7ea766824728851a25b01ebbc600491
This commit is contained in:
		
							parent
							
								
									d750e2f2bf
								
							
						
					
					
						commit
						67dfc24d13
					
				|  | @ -352,7 +352,9 @@ type ClaimMappings struct { | |||
| 	// If username.expression uses 'claims.email', then 'claims.email_verified' must be used in
 | ||||
| 	// username.expression or extra[*].valueExpression or claimValidationRules[*].expression.
 | ||||
| 	// An example claim validation rule expression that matches the validation automatically
 | ||||
| 	// applied when username.claim is set to 'email' is 'claims.?email_verified.orValue(true)'.
 | ||||
| 	// applied when username.claim is set to 'email' is 'claims.?email_verified.orValue(true) == true'. 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.
 | ||||
| 	//
 | ||||
| 	// In the flag based approach, the --oidc-username-claim and --oidc-username-prefix are optional. If --oidc-username-claim is not set,
 | ||||
| 	// 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.
 | ||||
|  |  | |||
|  | @ -323,7 +323,9 @@ type ClaimMappings struct { | |||
| 	// If username.expression uses 'claims.email', then 'claims.email_verified' must be used in
 | ||||
| 	// username.expression or extra[*].valueExpression or claimValidationRules[*].expression.
 | ||||
| 	// An example claim validation rule expression that matches the validation automatically
 | ||||
| 	// applied when username.claim is set to 'email' is 'claims.?email_verified.orValue(true)'.
 | ||||
| 	// applied when username.claim is set to 'email' is 'claims.?email_verified.orValue(true) == true'. 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.
 | ||||
| 	//
 | ||||
| 	// In the flag based approach, the --oidc-username-claim and --oidc-username-prefix are optional. If --oidc-username-claim is not set,
 | ||||
| 	// 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.
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue