-
Notifications
You must be signed in to change notification settings - Fork 597
CNTRLPLANE-3010: Add API-side validation to enforce prefixPolicy is not set when username expression is used #2771
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
base: master
Are you sure you want to change the base?
Changes from all commits
9b96486
c795e9e
ef9ca32
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -618,6 +618,7 @@ type OIDCClientReference struct { | |
| // +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDC,rule="has(self.claim)",message="claim is required" | ||
| // +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUIDAndExtraClaimMappings,rule="has(self.claim)",message="claim is required" | ||
| // +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUpstreamParity,rule="has(self.claim) ? !has(self.expression) : has(self.expression)",message="precisely one of claim or expression must be set" | ||
| // +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUpstreamParity,rule="has(self.expression) && size(self.expression) > 0 ? !has(self.prefixPolicy) || self.prefixPolicy != 'Prefix' : true",message="prefixPolicy must not be set to 'Prefix' when expression is set" | ||
| type UsernameClaimMapping struct { | ||
| // claim is an optional field that configures the JWT token claim whose value is assigned to the cluster identity field associated with this mapping. | ||
| // claim is required when the ExternalOIDCWithUpstreamParity feature gate is not enabled. | ||
|
|
@@ -710,6 +711,7 @@ type UsernamePrefix struct { | |
|
|
||
| // PrefixedClaimMapping configures a claim mapping | ||
| // that allows for an optional prefix. | ||
| // +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUpstreamParity,rule="has(self.expression) && size(self.expression) > 0 ? self.prefix == \"\" : true",message="prefix must not be set when expression is set" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at this file in full, I think we have run into this type of problem before. Authentication.config.openshift.io "test-vfppn" is invalid: spec.oidcProviders[0].claimMappings.groups: Invalid value: "object": no such key: prefix evaluating rule: prefix must not be set when expression is setThe issue is likely with So, we need to change this expression to include Maybe something like
will fix the issue. :)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
| type PrefixedClaimMapping struct { | ||
| TokenClaimMapping `json:",inline"` | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.