Repository navigation
[M2.3d2a] Enforce live token authority inside command locks - #96
Merged
Merged
Conversation
5 tasks done
samuelmbabhazi
force-pushed
the
feat/m2.3d1-explicit-route-authority
branch
from
November 5, 2026 14:55
eb9661e to
4563504
Compare
samuelmbabhazi
changed the base branch from
feat/m2.3d1-explicit-route-authority
to
main
November 5, 2026 14:55
samuelmbabhazi
force-pushed
the
feat/m2.3d2a-live-token-authority
branch
from
November 5, 2026 14:56
fad5372 to
611464c
Compare
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 5, 2026
## Task M2.3d2b, stacked on #96. Completes the transactional token-authority slice; resource HTTP endpoints follow in M2.3d3. Review in order; no automatic merge. ## What changed and why Organization settings and project/environment creation/settings declare their own token permission and exact target at the account mutation boundary. The transport carries only the authenticated principal and a redacted credential; request-body identity fields are ignored. Audits identify the API token used. Individual resource reads support scoped tokens. Catalog and member/binding collections remain session-only because filtering by the owner's permissions alone would widen a narrow token's visible results. Organization creation and password/MFA privilege operations remain session-only. ## Validation - API/web/domain lint, typechecks, unit tests and builds pass; Go tests and protobuf lint pass. - All 207 PostgreSQL integration tests pass across 36 files. - Six restricted-PostgreSQL resource-token scenarios pass: all five settings commands and audit actors, read-only denial, scope isolation, collection denial, revocation between authentication and command, concurrent revocation blocked until the write/audit commits, and rollback on audit failure. - Eight Chromium/HTTPS/PostgreSQL browser scenarios pass. - Semgrep reports zero findings across all eight changed TypeScript files, with complete parsing. Generated OpenAPI remains unchanged. ## Security considerations The command determines permission and target, and checks the exact token under the owner account lock held through audit persistence. Revocation cannot pass that lock during a command; later use is denied. No token scope is broadened by owner privileges or collection filtering. No new dependency, shell invocation or secret exposure path. ## CI execution blocked GitHub refuses to start jobs because of failed recent account payments or an insufficient spending limit. The account owner must resolve Billing & plans and rerun CI. Local checks are recorded separately from this blocked remote validation. CodeQL remains separately disabled by repository configuration. ## Checklist - [x] M2.3d2b acceptance met; M2.3d2 completed in PLAN - [x] SPEC documents credential propagation, token audit actors and session-only collections - [x] Local workspace and browser checks pass - [x] Real PostgreSQL concurrency and rollback tested - [x] Human review required; do not merge automatically
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.
Task
M2.3d2a, stacked on #93. Review in order; no automatic merge. Resource-command opt-in and token actor auditing follow in M2.3d2b.
What changed and why
API-token creation, authentication and private creation replay now intersect scopes with live tenant membership, ancestry and environment protection. Account-only profile tokens retain their existing behavior.
The account mutation boundary accepts a token context only when the application command declares its required permission and target. It revalidates the exact credential and owner under the account lock held through the operation. Revocation after HTTP authentication therefore prevents command execution even when the account security version has not changed. Substituted principals are rejected before another account lock is acquired. Password/MFA privilege operations reject bearer contexts.
Validation
Security considerations
No permission cache, user-supplied role metadata or credential fallback. Existing token rows remain hash-only. Live tenant reads use restricted database credentials and forced RLS. No new dependency, shell invocation or secret exposure path. Resource controllers are not exposed by this slice.
CI execution blocked
GitHub currently refuses to start jobs because of failed recent account payments or an insufficient spending limit. The account owner must resolve Billing & plans and rerun CI. Local checks above are not a substitute for a passing GitHub run. CodeQL remains separately disabled by repository configuration.
Checklist