Skip to content

[M2.3d3a] Expose scoped organization resource catalog endpoints - #102

Merged
samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.3d3a-resource-read-http
Nov 5, 2026
Merged

samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.3d3a-resource-read-http

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

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

  • M2.3d3a acceptance met; PLAN/SPEC updated
  • Generated contract and client committed without manual edits
  • Local checks and HTTP/tenant acceptance pass
  • No new business mutation requiring audit
  • Human review required; do not merge automatically

@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3d2b-resource-token-authority branch from 32f3990 to 6186b55 Compare November 5, 2026 14:57
@samuelmbabhazi
samuelmbabhazi changed the base branch from feat/m2.3d2b-resource-token-authority to main November 5, 2026 14:58
@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3d3a-resource-read-http branch from 4215823 to 2b6bed4 Compare November 5, 2026 14:59
@samuelmbabhazi
samuelmbabhazi merged commit c03f412 into main Nov 5, 2026
2 of 11 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/m2.3d3a-resource-read-http branch November 5, 2026 14:59
samuelmbabhazi added a commit that referenced this pull request Nov 5, 2026
## Task

M2.3d3b, stacked on #102. Review in order; no automatic merge.
Creation/settings controllers follow in M2.3d3c.

## What changed and why

Extend encrypted retries to a closed set of canonical
organization/project/environment creation/settings paths. Expose the
identity HTTP interceptor through its module so resource controllers
reuse the existing transactional request/result store.

Authenticated fingerprints now distinguish sessions from API tokens and
bind the exact token id. Before returning a cached resource result,
recheck the account version, exact credential and current route
permission. This happens after any wait for retry storage and only on
replay, preserving the actor/subject lock ordering inside
privilege-changing commands.

## Validation

- API lint, typecheck, build and 155 unit/HTTP tests pass, including 28
allowed/malformed retry-route cases.
- 24 PostgreSQL retry/identity/MFA/token HTTP tests pass; the six new
resource-retry scenarios were rerun after adjusting the test handler
metadata.
- New cases cover concurrent execution once, encrypted snapshots,
body/credential-kind/token-id conflicts, revocation, live role loss for
both sessions and tokens, account-version invalidation, undeclared
retries and resource/audit rollback on retry persistence failure.
- Semgrep reports zero findings across all five changed retry
implementation/test files, with complete parsing.
- Parent checkpoint passed 207 integration tests, eight Chromium
scenarios, Go tests and protobuf lint; resource read HTTP acceptance
passed in #102.

## Security considerations

No cached response bypasses current resource authority. Route
allowlisting excludes deletion and arbitrary paths. The resource
command, audit and encrypted snapshot share one transaction. An
unsuccessful transaction sends no result cookie. No new dependency,
shell invocation or plaintext credential storage.

## CI execution blocked

GitHub 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.3d3b acceptance met; PLAN/SPEC updated
- [x] Local checks and real PostgreSQL acceptance pass
- [x] Concurrency, credential boundaries and rollback covered
- [x] Human review required; do not merge automatically
samuelmbabhazi added a commit that referenced this pull request Nov 5, 2026
… enrollment errors (#109)

## Task

Review follow-ups for #90, #91 and #102, plus two rule-audit items. Refs
#22

## What changed

**No directory oracle (#90, #91)**
- `AccountMutationAuthority.confirmPassword()` checks the caller's
password without locks.
- `MembershipCommands.add` and `BindingCommands.assign` call it before
answering `resource_not_found` for an unknown address. An unknown
account and a wrong password now give the same 401, so these commands
cannot list the instance's verified accounts or an organization's
members. The success path still pays one Argon2id verification.

**Environment overrides (#91)**
- An administrator of a single environment can no longer create or
remove an environment override for a member who administers the whole
project. Before, the project admin could not undo such a restriction.
- Project admins and organization owners/admins are unaffected.

**Explicit response fields (#102)**
- `resourceDto` spread whole store rows into responses. It is replaced
by `organizationDto`, `projectDto`, `environmentDto`, `memberViewDto`
and `bindingViewDto`, which list every field. A future column cannot
reach session or bearer clients without a DTO change.
- The HTTP test asserts the exact key sets for project and environment
details.

**Rule audit items**
- The agent's enrollment error keeps its gRPC code (wrapped with `%w`)
and still drops the remote text. Its test fails without the fix
(`Unknown`).
- An `eslint-disable` gains its justification.
- SPEC: directory lookup ordering, the environment-override rule
(section 7), and bearer status codes (401 for bad tokens or token-less
routes, 403 for scope gaps checked before any lookup, so nothing leaks).

## How it was tested

- Local gate on the branch: lint, typecheck, unit tests and build for
all projects; go vet, go test and golangci-lint; no generated-code
drift; Semgrep and Prettier.
- New integration tests: same 401 for unknown and existing accounts on
membership add and binding assign; environment admin refused on a
project admin, owner allowed.
- CI is unavailable (account spending limit), so integration tests did
not run.

## Checklist

- [x] Local gate passes
- [x] Tests added
- [x] No new shell invocation and no new secret exposure path
- [x] Audit events unchanged (refused commands write nothing)
- [x] SPEC updated
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