Skip to content

[M2.3d3b] Reauthorize encrypted resource retry results - #104

Merged
samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.3d3b-resource-retry-authority
Nov 5, 2026
Merged

samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.3d3b-resource-retry-authority

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

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 [M2.3d3a] Expose scoped organization resource catalog endpoints #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

  • M2.3d3b acceptance met; PLAN/SPEC updated
  • Local checks and real PostgreSQL acceptance pass
  • Concurrency, credential boundaries and rollback covered
  • Human review required; do not merge automatically

@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3d3a-resource-read-http branch from 4215823 to 2b6bed4 Compare November 5, 2026 14:59
@samuelmbabhazi
samuelmbabhazi changed the base branch from feat/m2.3d3a-resource-read-http to main November 5, 2026 14:59
@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3d3b-resource-retry-authority branch from 285bf96 to 69c7c35 Compare November 5, 2026 15:00
@samuelmbabhazi
samuelmbabhazi merged commit c4809e8 into main Nov 5, 2026
2 of 11 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/m2.3d3b-resource-retry-authority branch November 5, 2026 15:01
samuelmbabhazi added a commit that referenced this pull request Nov 5, 2026
## Task

M2.3d3c1, stacked on #104. Review in order; no automatic merge.
Project/environment write endpoints follow in M2.3d3c2.

## What changed and why

Expose session-only organization creation with fresh password/MFA proof
and atomic ownership/session rotation. Return organization and public
session metadata; credentials are delivered only through cookies.
Settings updates accept authorized sessions or explicitly scoped
organization-update tokens.

Both routes use the encrypted retry boundary. A small local interceptor
delegates to the exported identity instance so Nest resolves its private
storage/authentication providers within IdentityModule. Shared mutation
decorators document Origin/CSRF, quotas and idempotency consistently for
upcoming resource routes. OpenAPI and the TypeScript client are
regenerated.

## Validation

- API/web/client typechecks, tests and builds pass; lint passes after
tightening the test header types. API has 155 unit/HTTP tests.
- Five restricted-PostgreSQL HTTP scenarios pass: ownership/rotation and
metadata-only output, Origin/CSRF/password/MFA checks, scoped bearer
settings and replay conflicts, malformed settings/slug conflicts, and
full rollback with no cookies on audit or retry-storage failure.
- Real Nest module boot verifies the cross-module interceptor
delegation.
- Semgrep reports zero findings across the seven organization
interface/test files, with complete parsing.
- The prior full checkpoint passed 207 integration tests, eight Chromium
scenarios, Go tests and protobuf lint; subsequent read/retry slices
passed their focused suites.

## Security considerations

Organization creation invalidates prior sessions and version-bound API
tokens. Replays with a different account version conflict; clients
recover an uncertain creation through authenticated organization
discovery. Settings take ownership only from the path. Passwords/MFA
proof stay write-only, and failure assertions avoid printing cookie
values. No new dependency, shell invocation or destructive endpoint.

## 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.3d3c1 acceptance met; PLAN/SPEC updated
- [x] Generated contract/client committed without manual edits
- [x] Local checks and real HTTP/PostgreSQL acceptance pass
- [x] New state changes audited atomically with credentials/retries
- [x] Human review required; do not merge automatically
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