Repository navigation
[M2.3c4c2] Query members and effective resource roles within authorized scope - #92
Merged
Merged
Conversation
5 tasks done
samuelmbabhazi
force-pushed
the
feat/m2.3c4c1-resource-bindings
branch
from
November 5, 2026 14:52
90f1fb7 to
189c640
Compare
samuelmbabhazi
changed the base branch from
feat/m2.3c4c1-resource-bindings
to
main
November 5, 2026 14:52
samuelmbabhazi
force-pushed
the
feat/m2.3c4c2-membership-queries
branch
from
November 5, 2026 14:53
0855a32 to
80bd3bc
Compare
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 5, 2026
## Task M2.3d1, stacked on #92. Review in order; no automatic merge. The resource controllers and command-boundary token checks follow in M2.3d2–d4. ## What changed and why Routes without an explicit anonymous, account or tenant declaration now reject even valid credentials. Existing identity controllers declare account access. Tenant declarations resolve canonical organization/project/environment ancestry from path parameters and require live resource authorization for sessions. Account declarations reject tenant parameters. Bearer access remains opt-in and must match the route permission exactly. Authentication receives the resolved tenant target; request body/query fields cannot alter its scope. An inventory test checks every registered controller route for an access declaration. ## Validation - API lint, typecheck, build and 126 unit/HTTP tests pass. - All 90 identity PostgreSQL integration tests pass with the new route guard. - Malformed/missing/surplus ancestry, undeclared routes, revoked live authority, mismatched bearer permissions, CSRF and session fallback are covered. - The parent quota correction passed its five PostgreSQL tests and all eight Chromium browser scenarios; no quota limits were weakened. - Go tests and protobuf lint passed at the preceding application checkpoint; no Go/protobuf changes here. CI reruns the complete workspace and integration/browser suites. ## Security considerations A session alone no longer authorizes an undeclared route. Resource state is queried through the existing forced-RLS tenant boundary. Anonymous mutations retain Origin checks, session mutations retain CSRF and bearer authentication retains its quota. No new resource mutation endpoint, dependency, shell invocation or secret exposure path. ## Checklist - [x] M2.3d1 acceptance met and PLAN updated - [x] SPEC documents explicit declarations and path authority - [x] Relevant local lint, types, unit and integration checks pass - [x] No new state change requiring an audit event - [x] Human review required; do not merge automatically ## CI execution blocked GitHub Actions did not start the latest jobs. Its annotation reports failed recent account payments or an insufficient spending limit. No runner steps executed. The account owner must resolve Billing & plans and rerun the workflows; this is not a passing CI result. CodeQL remains separately disabled by repository configuration.
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.3c4c2, stacked on #91. This completes the application-layer M2.3c slice; HTTP authorization, project tokens and UI remain M2.3d/e/f. Review in order; no automatic merge.
What changed and why
Add the organization member directory and scope-authorized resource administration queries. Resource views distinguish organization authority, inherited project roles and direct environment overrides, including inactive members whose grants need cleanup. Project/environment administrators see only applicable authority; the full organization directory requires organization-level member management.
Effective bindings and pagination use one SQL snapshot, avoiding inconsistent results when a grant changes between membership and relation queries. Queries select only administration metadata and reuse the existing bounded, descending-UUID pagination helper.
CI also exposed an existing quota race: a later request could acquire the shared IP row before an earlier request, producing a spurious 429 even for quotas without progressive delay. Only progressive policies now check the next-allowed timestamp; count/window limits remain enforced. A PostgreSQL regression fails before the correction and passes afterward.
How it was tested
Security considerations
The actor's current account version and scope authority are checked within the query transaction. SQL binds every value and includes organization/project/environment predicates before pagination. Results include email/active status only for authorized administration; no credential fields are queried. No new mutation, dependency, shell invocation or secret exposure path.
Checklist
CI execution blocked
GitHub Actions did not start the latest jobs. Its annotation reports failed recent account payments or an insufficient spending limit. No runner steps executed. The account owner must resolve Billing & plans and rerun the workflows; this is not a passing CI result. CodeQL remains separately disabled by repository configuration.