Skip to content

[M2.3c3c2] Filter resource catalogs before pagination - #88

Merged
samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.3c3c2-resource-catalogs
Nov 5, 2026
Merged

samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.3c3c2-resource-catalogs

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

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

  • Six real restricted-PostgreSQL acceptance tests pass with 101 projects: account discovery, owner/admin pagination, project/environment grants, parent navigation, role removal, wrong ancestry, stale/disabled accounts and malformed bounds.
  • Query application coverage: 97% statements, 90% branches, 100% functions and lines.
  • API lint, typecheck, 103 unit tests and production build pass.
  • Existing full integration, web/domain, Go and protobuf checks passed in preceding slices; CI runs the expanded full integration and browser suites.

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

  • M2.3c3c2 acceptance met; PLAN/SPEC updated
  • Local checks and new PostgreSQL acceptance pass
  • Cross-tenant, pagination and live-authority cases covered
  • No mutation needing an audit event
  • No secrets or generated artifacts edited manually

@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3c3c1-project-environment-commands branch from 3aaebca to 7abed80 Compare November 5, 2026 14:44
@samuelmbabhazi
samuelmbabhazi changed the base branch from feat/m2.3c3c1-project-environment-commands to main November 5, 2026 14:44
@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3c3c2-resource-catalogs branch from d89cbee to 9530152 Compare November 5, 2026 14:47
@samuelmbabhazi
samuelmbabhazi merged commit eb1a08c into main Nov 5, 2026
2 of 11 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/m2.3c3c2-resource-catalogs branch November 5, 2026 14:47
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
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