feat: add Grant primitive XRD with polymorphic same-Org / cross-Org dispatch#8
Closed
patrickleet wants to merge 1 commit into
Closed
feat: add Grant primitive XRD with polymorphic same-Org / cross-Org dispatch#8patrickleet wants to merge 1 commit into
patrickleet wants to merge 1 commit into
Conversation
…ispatch
Second auth-group primitive that survives the "is it just a single-MR
wrapper?" test. Composes 1 or 2 underlying Zitadel MRs depending on
whether the user's home Org matches the project's enclosing Org.
Same-Org (spec.userOrgId == spec.projectOrgId): one MR
- user.zitadel.m.crossplane.io/Grant — the user's role assignment
within the project (no projectGrantId)
Cross-Org (spec.userOrgId != spec.projectOrgId): two MRs
- project.zitadel.m.crossplane.io/Grant — the cross-Org Project
Grant authorizing the role set for the user's home Org
- user.zitadel.m.crossplane.io/Grant — the user's role assignment
with projectGrantId pointing at the Project Grant, pulling roles
from the granted set
Multi-iter convergence: in cross-Org mode the user/Grant emits only
once the project/Grant's atProvider.id is observed (standard composition
gating per feedback_crossplane_composition_gates).
Schema takes flat IDs (userId + userOrgId + projectId + projectOrgId +
roles[]), matching the established convention from Tenant + MachineUser
— operator copies UUIDs from the relevant XR statuses or Zitadel UI.
Two examples (same-org + cross-org); 4 KCL CompositionTests covering
same-org, cross-org iter 1, multi-role, managementPolicies propagation.
Multi-iter convergence verified via observed-resources fixture.
21/21 KCL tests pass (13 AuthStack + 4 MachineUser + 4 Grant); all 8
examples render via make render:all.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Polymorphic dispatch over Zitadel's two role-assignment mechanisms. Same-Org (1 user/Grant MR) vs cross-Org (project/Grant + user/Grant with projectGrantId). Multi-iter gating on observed project/Grant.atProvider.id.
Stacked on top of PR #7 (MachineUser) — base is feat/machineuser-xrd so this PR's diff shows only Grant changes. Retarget to main once #7 merges.
21/21 KCL tests pass; 8/8 examples render.
🤖 Generated with Claude Code