fix(entitlements-core): evaluate dynamically resolved tenant entitlements - #2707
Conversation
📊 Benchmark Results✅ All benchmarks passed
Updated: 2026-09-08T08:23:10.876Z · Commit: 93167e9 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b049aabf14
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important Approval pendingCodeRabbit has no unresolved comments, but it could not review the latest commit because the review limit was reached. Follow the review guidance in this comment to continue. 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 |
Summary
EntitlementGuard evaluates the framework Context or request tenant when principal and user tenant claims are absent, supporting organization switching. Conflicting tenant sources fail before entitlement lookup.
HTTP pipelines reject conflicting raw-request and HTTP-context tenants before invoking any configured guard, including AccessGuard-only routes. Existing HTTP tenant injection and request access from exception filters remain supported. Applications must validate tenant selection and organization membership before injecting these values.
Both affected packages have patch changesets. Public signatures and dependencies are unchanged.
Closes #2599
Validation
Elevated profile for authorization tenant resolution.
93167e9bca0153713c1fa38994bb9369db68fc0b. Normal pre-push tests and guarded typecheck also pass; all hooks completed successfully.pnpm check; the Problem registry passes with the original base pinned. The unpinned registry check sees newer trunk workflow codes as removals from this earlier branch. No registry files were changed to suppress that discrepancy.Base compatibility
Original validation base:
c2a26539a965065486813fda9462a0bae6d82212.Final assessed trunk:
cb1995eaa53eae734a28f234503867d34cc2c92c. The candidate below covers the earlier9d14704base.Cumulative drift changes billing order/webhook behavior, workflow Problems, package-role policy, and LLM metering. Inspection found no changed guard assumptions. The conflict-free candidate
d03334a65903cd4bc8c693a4316b1ab35d645ee3(treed50fd18076f4f589eac51e7da54513ae59605040) passes architecture policy across 122 packages and 6,170 imports. Earlier combined-base registry and public API checks remain applicable to their unchanged declarations and snapshots. Later drift adds optional text-tenant RLS SQL construction and aligns release promotion evidence with selected test lanes. Neither changes guard dependencies, runtime tenant context, or this PR’s validation assumptions. The cumulative drift companion passes; no further executable compatibility check was selected. No rebase was needed.CI
CI, review companion, and benchmark pass on the final head. All four required checks pass, including validate; coverage-security, generated-apps, package-artifacts, core-verification, and real-resource-tests also pass. Final review-state inspection found no requested changes, pending review requests, or unresolved threads. Ordinary squash merge is permitted by repository policy.