Skip to content

[M2.3d3c2] Expose scoped project and environment mutations - #106

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

samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.3d3c2-resource-write-http

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

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

  • M2.3d3c2 acceptance and PLAN/SPEC updated
  • Generated contract/client committed without manual edits
  • Local checks and real HTTP/PostgreSQL acceptance pass
  • State changes audited atomically with retry storage
  • Human review required; no automatic merge

@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3d3c1-organization-write-http branch from 522b82f to f060e90 Compare November 5, 2026 15:02
@samuelmbabhazi
samuelmbabhazi changed the base branch from feat/m2.3d3c1-organization-write-http to main November 5, 2026 15:02
@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3d3c2-resource-write-http branch from 7e61086 to 11c79f3 Compare November 5, 2026 15:03
@samuelmbabhazi
samuelmbabhazi merged commit d0baa42 into main Nov 5, 2026
2 of 11 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/m2.3d3c2-resource-write-http branch November 5, 2026 15:04
samuelmbabhazi added a commit that referenced this pull request Nov 5, 2026
## Task

M2.3d4a, stacked on #106. Review in order; no automatic merge. This is
the final PR for this work session, at the maintainer's request.

## What changed and why

Expose the organization membership directory and project/environment
effective-role directories as session-only GET endpoints. Each route
requires current `member.manage` authority at its exact scope. Responses
include membership metadata, effective role/source, direct overrides and
inherited roles; credentials are never returned. Pagination uses the
existing bounded, exclusive UUID contract and authorization filters
precede pagination.

Add OpenAPI DTOs, regenerate the API/client contracts and document the
endpoints. Split the remaining M2.3d4 work in PLAN; only the directory
slice is complete. Membership/binding writes, the complete
registered-route matrix, project-owned tokens and administration screens
remain pending.

## Validation

- API, web and generated client lint, typechecks, tests and builds pass
(155 API tests and 51 web tests).
- Restricted-PostgreSQL HTTP acceptance covers all three routes against
eleven actor profiles, including explicit environment downgrades and
outsiders; exclusive pagination; metadata-only responses;
effective/inherited roles; disabled members; immediate role removal;
bearer denial; malformed input and mismatched ancestry.
- The administration query integration suite also passes.
- Generated OpenAPI explicitly declares session-only authentication for
all three routes and the expected response schemas.
- Semgrep: zero findings across all six changed TypeScript files, with
complete parsing. Staged whitespace check passes; commit hooks check
formatting and secrets.

## Security considerations

No new mutation endpoint, dependency or shell invocation. Reads delegate
to the existing account-locked application authorization and forced-RLS
tenant transactions. Scoped resource administrators cannot read the
organization directory or sibling resource grants. API tokens are
rejected even when they contain member-management scopes. Disabled
members remain visible only to authorized administrators for cleanup.

## 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 workflows before treating remote validation as complete. CodeQL
remains separately disabled by repository configuration.

## Checklist

- [x] M2.3d4a acceptance met and PLAN/SPEC updated
- [x] Generated contracts committed without manual edits
- [x] Local checks and real HTTP/PostgreSQL acceptance pass
- [x] No secret response or unaudited business mutation introduced
- [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