Repository navigation
[M2.3d2b] Authorize scoped tokens at resource command boundaries - #100
Merged
Merged
Conversation
5 tasks done
samuelmbabhazi
force-pushed
the
feat/m2.3d2a-live-token-authority
branch
from
November 5, 2026 14:56
fad5372 to
611464c
Compare
samuelmbabhazi
changed the base branch from
feat/m2.3d2a-live-token-authority
to
main
November 5, 2026 14:56
samuelmbabhazi
force-pushed
the
feat/m2.3d2b-resource-token-authority
branch
from
November 5, 2026 14:57
32f3990 to
6186b55
Compare
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 5, 2026
## Task M2.3d3a, stacked on #100. Review in order; no automatic merge. Resource mutation retries and write endpoints follow in M2.3d3b/c. ## What changed and why Expose six GET endpoints for organization discovery and nested organization/project/environment catalogs and details. Session catalogs retain live SQL filtering before bounded cursor pagination. Detail endpoints additionally accept the matching scoped API token. Path DTOs require canonical UUIDv7 ancestry; collection queries reject unknown fields and malformed pagination. Responses contain explicit settings and ISO timestamps. OpenAPI and the TypeScript client are generated from the controllers. API quotas apply to session reads; bearer requests keep the quota already consumed by authentication instead of being counted twice. ## Validation - API lint, typecheck, build and 127 unit/HTTP tests pass, including the registered-route declaration inventory and single-consumption bearer quota regression. - Five restricted-PostgreSQL HTTP scenarios cover all six routes, pagination, environment-only parent navigation, sibling/foreign ancestry, missing authentication, forged query fields, scoped tokens, revocation and quota headers. - Generated API/client and web lint/typechecks pass; inspected OpenAPI distinguishes session-only collections from session-or-bearer details. - Semgrep reports zero findings across all new route/DTO/integration files and the quota guard, with complete parsing. - Parent checkpoint passed all 207 integration tests, eight Chromium scenarios, Go tests and protobuf lint. ## Security considerations Resource parameters come only from the validated route and are checked against current tenant state. Collection endpoints cannot broaden a bearer token's visibility. No resource mutation, new dependency, shell invocation or secret exposure path. ## CI execution blocked GitHub currently refuses to start jobs because of failed recent account payments or an insufficient spending limit. Resolve Billing & plans and rerun CI before treating remote validation as complete. CodeQL remains separately disabled by repository configuration. ## Checklist - [x] M2.3d3a acceptance met; PLAN/SPEC updated - [x] Generated contract and client committed without manual edits - [x] Local checks and HTTP/tenant acceptance pass - [x] No new business mutation requiring audit - [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.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
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