feat: add incremental OAuth service consent - #1683
Closed
AbigailDeng wants to merge 2 commits into
Closed
AbigailDeng wants to merge 2 commits into
AbigailDeng wants to merge 2 commits into
Conversation
📊 Code coverage
Gate: line coverage must stay at or above the threshold. Ratchet plan (W21): Backend → 55%, CLI → 50%, Frontend → 30% by quarter end. |
9 tasks done
Collaborator
|
superseded by #1718 |
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.
Summary
Applications that need additional NyxID services can currently replace or narrow the user's existing grant when requesting only the missing services. This adds explicit incremental consent: existing A/B plus approved C/D yields A/B/C/D in the authorization code, refresh chain, and broker binding, while an optional
resource=Cnarrows only the access token.service_access_mode=incrementaland repeated exactrequested_service_idsto authorize/PAR, preserving them through login and signed consent. Support ordinary account authorization without an external subject and updates to a selected binding using its validated hash. Ordinary review behavior remains available.Refs #1682. The NyxID implementation is complete in this PR. The issue remains open for the separate Aevatar Services button, callback/draft restoration, and cross-application integration acceptance (aevatarAI/aevatar#3678). The API, architecture, and OAuth guide document the caller contract and require the new backend/UI to be deployed before callers enable incremental mode.
Design reference
Approved prototype from #1682 (illustrative service data; not a production authorization screenshot):
Open original prototype
Test Plan
Backend tests use a dedicated MongoDB 8 replica set at
mongodb://127.0.0.1:27182/?directConnection=true;CARGO_TARGET_DIRreuses the existing local Cargo cache. Exact test commands from the repository root:Backend results: 156 passed across the seven filters (72 + 7 + 14 + 38 + 5 + 7 + 13); Clippy passed with warnings denied.
Coverage includes accumulated A/B/C/D refresh and binding authority with narrowed access, no-subject bindings, legacy records, existing all-services grants, optional additions, concurrent decisions, revoke/issuance overlap, binding rotation, tampered requests, expiry/cancel, and live organization membership with same-slug services.
Dependency-focused frontend validation, from
frontend/:Related frontend tests: 51 passed in 5 files. New test file explicitly run: 14 passed (also included in the related run). ESLint and Prettier passed. Scope selected with:
python3 /Users/abigaildeng/.codex/skills/frontend-incremental-pr/scripts/frontend_change_scope.py --repo . --base upstream/mainChanged Rust files passed:
The actual React page was rendered in the existing Chrome browser with local fixture data; its accessible content, sections, counts, and controls were inspected. No production authorization was submitted. Aevatar ↔ NyxID deployment/integration verification remains outstanding.
Full frontend test suite, lint, typecheck, and production build are delegated to GitHub CI by personal local-validation policy. The repository has no reliable affected typecheck target, so no local full typecheck was run.
Checklist