CNTRLPLANE-3010: Add API-side validation to enforce prefixPolicy is not set when username expression is used#2771
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@ShazaAldawamneh: This pull request references CNTRLPLANE-3010 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdded feature-gated XValidation annotations (featureGate=ExternalOIDCWithUpstreamParity) enforcing that when a claim-mapping ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Hello @ShazaAldawamneh! Some important instructions when contributing to openshift/api: |
|
@ShazaAldawamneh: This pull request references CNTRLPLANE-3010 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Hey @ShazaAldawamneh - I left one question of curiosity but besides that I don't have any concerns :) I will point out that you may need to manually trigger jobs stuck on |
|
/lgtm Changes look good to me. Tests are passing fine. Issue was resolved with However, I am unsure whether these other tests will run after the lgtm. I hope so, so that we can get a definitive response on the viability of this. :) |
|
Scheduling tests matching the |
|
/lgtm cancel |
|
noticed that bryce had some concerns. :) |
liouk
left a comment
There was a problem hiding this comment.
Just a couple of doc related observations.
65bd10d to
6567439
Compare
everettraven
left a comment
There was a problem hiding this comment.
A handful of minor changes needed, but for the most part this looks pretty good. Great job!
…when username expression is used Signed-off-by: Shaza Aldawamneh <shaza.aldawamneh@hotmail.com>
6567439 to
43a92bf
Compare
|
Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: everettraven The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest-required |
|
@ShazaAldawamneh: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/verified by @ShazaAldawamneh |
|
@ShazaAldawamneh: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Add a FeatureGateAwareXValidation rule to the UsernameClaimMapping type in the authentications.config.openshift.io CRD to reject configurations where prefixPolicy is set to Prefix when a username expression is also set.
Previously, this validation was only enforced at runtime in the CAO and HyperShift generation code. This change moves the validation to the API admission layer, providing stronger validation at resource creation/update time before the resource is persisted.
A prefixPolicy of Prefix is not applicable when using an expression-based username mapping since prefixes should be set directly within the expression itself if needed.
New test cases are added to the ExternalOIDCWithUpstreamParity CRD validation tests to cover: