Repository navigation
[M2.3c3c2] Filter resource catalogs before pagination - #88
Merged
Merged
Conversation
5 tasks done
samuelmbabhazi
force-pushed
the
feat/m2.3c3c1-project-environment-commands
branch
from
November 5, 2026 14:44
3aaebca to
7abed80
Compare
samuelmbabhazi
changed the base branch from
feat/m2.3c3c1-project-environment-commands
to
main
November 5, 2026 14:44
samuelmbabhazi
force-pushed
the
feat/m2.3c3c2-resource-catalogs
branch
from
November 5, 2026 14:47
d89cbee to
9530152
Compare
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 5, 2026
…ials (#89) ## Task M2.3c4a, stacked on #88. Review in order; no automatic merge. ## What changed and why Add an identity boundary for privilege changes that locks the actor and affected account in canonical UUID order before organization locks. Fresh password/configured MFA proof is required. Changed privileges invalidate the affected account's sessions and version-bound API tokens in the same transaction as the role/audit writes; self-changes return a rotated session. Another administrator's session remains valid. No-ops preserve credentials but audit proof confirmation, since an MFA counter/recovery code may still be consumed. Proof explicitly expires when its callback ends, including inherited detached asynchronous work. The internal verified-account directory returns only account id/email/active state for authorized membership commands. Membership and role-binding commands follow in M2.3c4b/c. Callers must enter this boundary before holding any account or organization lock and repeat resource authorization under its locks. ## How it was tested - All 177 real-PostgreSQL integration tests pass. - Twelve targeted identity-boundary tests pass with 100% statement, branch and function coverage. - A real PostgreSQL row-lock barrier forces reciprocal administrator changes to overlap: one succeeds, the other rejects its stale identity, without deadlock. - Tests cover affected-token/session invalidation, caller-session preservation, self-rotation, no-ops, invalid targets/proof, directory filtering, audit rollback, MFA consumption rollback and detached proof expiry. - API lint, typecheck, 103 unit tests and production build pass. Web/domain, Go and protobuf checks passed in preceding slices; CI reruns them. ## Security considerations Callbacks never receive password hashes or MFA material. Role mutations, proof consumption, audit and security-version changes share one transaction. A failed identity audit restores the business write and credentials. No new dependency, shell invocation or credential logging path. CodeQL remains skipped by repository configuration; enabled security checks run in CI. ## Checklist - [x] M2.3c4a acceptance met; PLAN/SPEC updated - [x] Local checks and full PostgreSQL suite pass - [x] Concurrent changes, stale callers and rollback covered - [x] New identity state changes and proof-only no-ops audited - [x] No secrets or generated artifacts edited manually
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.3c3c2, stacked on #87. Review in order; do not merge automatically.
What changed and why
Add account-bound organization discovery, tenant-filtered project/environment catalogs and authorized detail queries. Membership and resource grants are filtered in SQL before the page limit: a member with access only to the oldest environment still sees its parent project on the first page. Environment-only access never exposes siblings.
Queries recheck active/verified account and security version under the account lock. Catalogs use descending UUID order, exclusive range cursors and a maximum/default page size of 100. Arbitrary cursors never trigger a cross-tenant existence lookup. Detail queries apply the same live authority and ancestry rules as commands.
How it was tested
Security considerations
Every resource predicate includes its tenant and environment parent. Filtering happens before pagination; no credential or membership detail is returned. Account and tenant RLS modes stay mutually exclusive and context is cleared before pooled connection reuse. This read-only slice adds no state mutation, shell invocation or dependency. CodeQL remains skipped by repository configuration; enabled security checks run in CI.
Checklist