Skip to content

[M2.3d3c1] Expose audited organization mutation endpoints - #105

Merged
samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.3d3c1-organization-write-http
Nov 5, 2026
Merged

samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.3d3c1-organization-write-http

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

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

  • M2.3d3c1 acceptance met; PLAN/SPEC updated
  • Generated contract/client committed without manual edits
  • Local checks and real HTTP/PostgreSQL acceptance pass
  • New state changes audited atomically with credentials/retries
  • Human review required; do not merge automatically

@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3d3b-resource-retry-authority branch from 285bf96 to 69c7c35 Compare November 5, 2026 15:00
@samuelmbabhazi
samuelmbabhazi changed the base branch from feat/m2.3d3b-resource-retry-authority to main November 5, 2026 15:01
@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3d3c1-organization-write-http branch from 522b82f to f060e90 Compare November 5, 2026 15:02
@samuelmbabhazi
samuelmbabhazi merged commit 68283bd into main Nov 5, 2026
2 of 11 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/m2.3d3c1-organization-write-http branch November 5, 2026 15:02
samuelmbabhazi added a commit that referenced this pull request Nov 5, 2026
## Task

M2.3d3c2, stacked on #105. Review in order; no automatic merge.

## What changed and why

Expose project/environment creation and settings through the existing
account-locked, audited commands. Each route requires its exact
permission and canonical path ancestry, for sessions and explicitly
scoped API tokens. Creation returns 201 and settings replacement returns
200. Omitted options retain the documented safe defaults; nulls,
ownership injection and malformed values are rejected.

All four routes share encrypted mutation retries, session Origin/CSRF
checks and single-count API quotas. Regenerate OpenAPI and the
TypeScript client, and mark the resource HTTP slice complete in PLAN.

## Validation

- API lint, typecheck, build and 155 unit/HTTP tests pass.
- Five restricted-PostgreSQL HTTP scenarios pass: defaults and retry
audit-once behavior; project/environment admin and viewer rights; scoped
bearer mutations and sibling denial; malformed input/ancestry/CSRF;
rollback of every write and audit when retry storage fails.
- Web and generated client lint/typechecks/tests/builds pass.
- Semgrep: zero findings, all four changed TypeScript files fully
parsed.
- Prior full checkpoint: 207 PostgreSQL integration tests, eight browser
scenarios, Go tests and protobuf lint passed. Later HTTP/retry slices
have focused acceptance coverage.

## Security considerations

Ownership comes only from the validated path. Commands recheck current
authority under the account lock, and audits identify the authenticated
user or exact API token. No destructive resource endpoint, new
dependency, shell invocation or secret response is introduced.

## CI execution blocked

GitHub currently refuses to start jobs because of failed recent account
payments or an insufficient spending limit. Billing & plans must be
resolved and workflows rerun before remote validation is complete.
CodeQL is separately disabled by repository configuration.

## Checklist

- [x] M2.3d3c2 acceptance and PLAN/SPEC updated
- [x] Generated contract/client committed without manual edits
- [x] Local checks and real HTTP/PostgreSQL acceptance pass
- [x] State changes audited atomically with retry storage
- [x] Human review required; no automatic merge
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