Skip to content

feat(authorization): hierarchical PDP, start-login helper, and PATs - #103

Open
seonghobae wants to merge 3 commits into
mainfrom
cursor/authorization-plane-8585
Open

feat(authorization): hierarchical PDP, start-login helper, and PATs#103
seonghobae wants to merge 3 commits into
mainfrom
cursor/authorization-plane-8585

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Buyer-facing Keyverse authorization slice on main. It makes these six capabilities real as issuer-side contracts plus tests and docs, without restacking on open PRs #83, #100, or #101:

  1. Software-unit ACL (which relying party a subject may use)
  2. Menu-level ABAC + RBAC attributes and decisions
  3. SSO combination scopes (one Keyverse session, selected RP set)
  4. Higher-permission inheritance down the org tree (most-specific wins; default deny)
  5. App start-login / IdP-discovery helper (kc_idp_hint, no metadata fetch)
  6. Programmable application tokens hashed at rest, software-unit and API scoped

Tracks #2. Implements #102. Does not close #2 (cross-system SSO epic still includes live federation acceptance and remaining P5 work).

Boundary decisions

  • Orgmetra remains employment / org-tree source of record. Keyverse consumes an assignment snapshot (keyverse_subject, org_path, optional assignment_record_id) and does not copy the Orgmetra tree.
  • ADR-0008 is unchanged. Keyverse is the issuer/PDP of attributes and decisions. Each RP remains the PEP and must still validate issuer, audience, signature, expiry, and subject.
  • ADR-0009 is reserved for the unmerged LineageWeave role / org / workspace profile on PR Add account-derived LineageWeave RP profile #100. Hierarchical names are group_company, legal_entity, business_unit, team, person, and org_path.
  • Secrets and PATs never inherit. PATs are not a password or WebAuthn substitute.
  • Portable realm is untouched. Application RPs stay runtime desired state (fix(realm): reconcile application RPs at runtime #83 direction consumed, not restacked).

ADRs

ADR Change
0001–0008 Unchanged
0009 Reserved in the index for PR #100
0010 Hierarchical authorization plane
0011 App start-login helper
0012 Programmable application tokens

Head

Current head: 44fb43428eab0075b9e5ee114a5ade56bb18eec2

Hosted CI

Exact-head product CI on this SHA is green (run 32092028160):

  • account-unification-tests job 95575987666 — success
  • realm-config-validates job 95575987605 — success
  • compose-config-validates job 95575987627 — success

Predecessor 363b26c failed in account-unification-tests job 95575377973 (run 32091826557) at Install locked dependencies. uv sync --locked refused uv.lock because it still recorded coverage 7.15.2 and setuptools 83.0.0 after pyproject.toml moved to 7.15.4 and 84.0.0. This head only resynchronizes the lock to those already-reviewed pins.

Operator / app next action

See docs/authorization-onboarding.md:

  • RP starts federation with POST /federation/identity-providers:start-login, then adds PKCE locally and redirects to start_login_url.
  • PAT is minted with POST /application-tokens, stored in the application secret manager, and presented only to POST /application-tokens:verify.

Evidence still required

This PR does not claim production federation, login, or downstream PEP acceptance. Those remain controlled runtime evidence after IdP apply, confidential secret placement, and RP token validation.

Safety

No password authenticator, no unverified-email merge, no portable-realm application clients, no RP-environment secrets, no restack of #83 / #100 / #101. Draft remains draft.

Open in Web Open in Cursor 

Issue software-unit ACL, menu ABAC/RBAC, SSO combination scopes, and
org-path inheritance from Orgmetra assignment snapshots without copying
employment truth. Add a Keyverse-owned start-login helper and hashed
programmable application tokens. ADR-0008 remains the RP PEP boundary;
ADR-0009 stays reserved for the unmerged LineageWeave claim profile.

Tracks #2. Implements #102.

Co-authored-by: Seongho Bae <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 23666238-932c-4a51-8bf8-4d5205fe6b45

📥 Commits

Reviewing files that changed from the base of the PR and between ce207df and 44fb434.

⛔ Files ignored due to path filters (1)
  • services/account_unification/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (36)
  • ARCHITECTURE.md
  • CHANGELOG.md
  • DOCUMENTATION.md
  • README.md
  • docs/ERD.md
  • docs/OPERABILITY.md
  • docs/PRD.md
  • docs/TEST_STRATEGY.md
  • docs/THREAT_MODEL.md
  • docs/TRACEABILITY.md
  • docs/TRD.md
  • docs/UML.md
  • docs/adr/0010-hierarchical-authorization-plane.md
  • docs/adr/0011-app-start-login-helper.md
  • docs/adr/0012-programmable-application-tokens.md
  • docs/adr/README.md
  • docs/authorization-onboarding.md
  • docs/doctoring/hierarchical-authorization-plane.md
  • docs/doctoring/programmable-application-tokens.md
  • docs/doctoring/start-login-helper.md
  • docs/federation-onboarding.md
  • docs/operations/authorization-plane.md
  • docs/papers/README.md
  • docs/papers/citations.bib
  • docs/rp-onboarding.md
  • services/account_unification/README.md
  • services/account_unification/app/application_tokens.py
  • services/account_unification/app/authorization_plane.py
  • services/account_unification/app/errors.py
  • services/account_unification/app/main.py
  • services/account_unification/app/org_authorization.py
  • services/account_unification/app/start_login.py
  • services/account_unification/tests/test_application_tokens.py
  • services/account_unification/tests/test_authorization_plane.py
  • services/account_unification/tests/test_org_authorization.py
  • services/account_unification/tests/test_start_login.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

cursoragent and others added 2 commits August 18, 2026 02:26
Cover omitted assignment snapshots, failed menu grant PUTs, and
policy errors on token verify so statement and branch coverage stay
at 100% on the authorization slice.

Co-authored-by: Seongho Bae <[email protected]>
Hosted account-unification-tests failed at uv sync --locked because
uv.lock still recorded coverage 7.15.2 and setuptools 83.0.0 after
pyproject.toml moved to 7.15.4 and 84.0.0. Refresh the lock metadata
only so CI can install the already-reviewed pins.

Co-authored-by: Seongho Bae <[email protected]>
@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@seonghobae
seonghobae marked this pull request as ready for review August 18, 2026 02:33
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 44fb43428eab0075b9e5ee114a5ade56bb18eec2.

  • Head SHA: 44fb43428eab0075b9e5ee114a5ade56bb18eec2

  • Workflow run: 32095234736

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (12 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (12 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs (21 files)"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs (21 files)"]
  R2 --> V2["docs review"]
  Evidence --> S3["Test (4 files)"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test (4 files)"]
  R3 --> V3["targeted test run"]
Loading

@opencode-agent

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 44fb43428eab0075b9e5ee114a5ade56bb18eec2
  • Workflow run: 32095234736
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 44fb43428eab0075b9e5ee114a5ade56bb18eec2.

  • Head SHA: 44fb43428eab0075b9e5ee114a5ade56bb18eec2

  • Workflow run: 32095234736

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (12 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (12 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs (21 files)"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs (21 files)"]
  R2 --> V2["docs review"]
  Evidence --> S3["Test (4 files)"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test (4 files)"]
  R3 --> V3["targeted test run"]
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cross-system SSO: keyverse central IdP + federate external IdPs

2 participants