Skip to content

[M2.3c3b1] Reauthenticate account mutations and bind session rotation to proof - #85

Merged
samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.3c3b1-account-mutation-authority
Nov 5, 2026
Merged

samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.3c3b1-account-mutation-authority

Conversation

@samuelmbabhazi

@samuelmbabhazi samuelmbabhazi commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Resource commands need to recheck the caller under the same account lock as password resets and permission changes. This adds a public identity boundary for those commands, including password/MFA reauthentication and session rotation restricted to the same authenticated callback and security version.

The callback joins the existing transaction: a failed business write or audit rolls back proof consumption, session revocation and rotation together. No new HTTP endpoint is exposed. Organization commands follow in M2.3c3b2.

Base: #84. Please review in stack order; do not merge automatically.

Validation:

  • All 148 PostgreSQL integration tests pass, including five new restricted-role cases for stale/disabled callers, password-reset races, proof isolation and rollback.
  • The new application boundary has 100% statement, branch and function coverage in the targeted PostgreSQL run.
  • API lint, typecheck, unit tests and production build pass.
  • Existing full-workspace, Go and protobuf checks remain covered by the preceding stack and CI.

Security: no password hash or MFA secret is exposed to resource commands; rotation requires fresh proof bound to this request and account/version. No new shell invocation or credential logging path.

  • M2.3c3b1 acceptance and documentation updated.
  • New behavior and concurrency/rollback paths tested.
  • State changes retain the existing transactional audit path.
  • No secrets or generated artifacts edited manually.
  • Enabled CI/security checks complete (CodeQL remains skipped by repository configuration).

@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3c3a-resource-settings-policy branch from 7d52609 to 773de1a Compare November 5, 2026 12:47
@samuelmbabhazi
samuelmbabhazi changed the base branch from feat/m2.3c3a-resource-settings-policy to main November 5, 2026 12:47
@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.3c3b1-account-mutation-authority branch from 2c74fad to f7d7a56 Compare November 5, 2026 12:48
@samuelmbabhazi
samuelmbabhazi merged commit 9e977d3 into main Nov 5, 2026
10 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/m2.3c3b1-account-mutation-authority branch November 5, 2026 12:48
samuelmbabhazi added a commit that referenced this pull request Nov 5, 2026
…auditing (#86)

## Task

M2.3c3b2, stacked on #85. Review in order; no automatic merge.

## What changed and why

Creating an organization now requires fresh password/configured MFA
proof and commits its initial owner membership, ownership audit and
security-version/session rotation together. Live owners/admins can
update organization settings; removed memberships, outsiders and stale
sessions fail closed. Globally occupied slugs return a fixed conflict
without disclosing tenant metadata.

Preserve translated domain errors when a failed SQL statement also
prevents transaction-context cleanup. This keeps a rename collision a
stable conflict while rolling back its writes. Successful operations
still fail if context cleanup fails.

These are application commands. Protected HTTP routes and the
administration UI follow in M2.3d/f; no destructive resource endpoint is
introduced.

## How it was tested

- Six new real-PostgreSQL tests run under the restricted runtime role:
ownership/session rotation, invalid proof/input, role isolation,
concurrent slug creation, rename rollback and failures of both
ownership/session audits.
- Full PostgreSQL integration suite: 154 tests pass.
- New application commands: 100% statement/branch/function coverage;
commands plus repository: 94% statements, 83% branches, 100% functions.
- API/web/domain lint, typechecks, tests and builds pass; Go tests and
buf lint pass.
- HTTP unit tests require local sockets and pass with that permission;
their initial sandboxed attempt returned EPERM.

## Security considerations

Account locks serialize mutations against identity changes. Ownership
cannot be supplied through input. Row isolation and explicit tenant
predicates protect the commands. Audit or rotation failure rolls back
all related state. No new dependency, shell invocation or secret
exposure path. CodeQL remains skipped by repository configuration;
enabled security checks run in CI.

## Checklist

- [x] M2.3c3b2 acceptance met and PLAN/SPEC updated
- [x] Local lint, TypeScript/Go tests and buf lint pass
- [x] Invalid input, concurrency, tenant isolation and rollback tested
- [x] Every new mutation emits an atomic audit event
- [x] No secret or generated artifact 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