Skip to content

[M2.3c4c2] Query members and effective resource roles within authorized scope - #92

Merged
samuelmbabhazi merged 2 commits into
mainfrom
feat/m2.3c4c2-membership-queries
Nov 5, 2026
Merged

samuelmbabhazi merged 2 commits into
mainfrom
feat/m2.3c4c2-membership-queries

Conversation

@samuelmbabhazi

@samuelmbabhazi samuelmbabhazi commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • All 196 real-PostgreSQL integration tests passed before the quota correction; the five authentication/quota tests pass afterward, including the new ordering regression.
  • Eleven targeted catalog/administration tests pass with 104 members, direct/inherited roles, explicit downgrades, scope denials, live changes and pooled-context cleanup.
  • New query/pagination application coverage: 100% statements/functions/lines, 95% branches.
  • API/web/domain lint, typechecks, tests and builds pass; Go tests and buf lint pass.
  • All eight Chromium/HTTPS/PostgreSQL browser scenarios pass after the quota correction.
  • Parent PR [M2.3c4c1] Manage scoped resource role bindings #91 passed all enabled CI/security and browser checks. CodeQL remains skipped by repository configuration.

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

  • M2.3c4c2 acceptance met; M2.3c marked complete in PLAN
  • SPEC documents scope visibility and effective-role fields
  • Full integration and local workspace checks pass
  • Read-only queries add no state mutation requiring audit
  • No secrets or generated artifacts edited manually

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.

@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3c4c1-resource-bindings branch from 90f1fb7 to 189c640 Compare November 5, 2026 14:52
@samuelmbabhazi
samuelmbabhazi changed the base branch from feat/m2.3c4c1-resource-bindings to main November 5, 2026 14:52
@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3c4c2-membership-queries branch from 0855a32 to 80bd3bc Compare November 5, 2026 14:53
@samuelmbabhazi
samuelmbabhazi merged commit 65c34f1 into main Nov 5, 2026
2 of 11 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/m2.3c4c2-membership-queries branch November 5, 2026 14:54
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant