Repository navigation
[M2.2d3] Expose protected MFA management endpoints - #56
Merged
Merged
Conversation
4 tasks done
samuelmbabhazi
force-pushed
the
feat/m2.2d2b-mfa-management
branch
from
November 5, 2026 12:33
a4c213c to
db1deb9
Compare
samuelmbabhazi
changed the base branch from
feat/m2.2d2b-mfa-management
to
main
November 5, 2026 12:33
samuelmbabhazi
force-pushed
the
feat/m2.2d3-mfa-http
branch
from
November 5, 2026 12:33
eaeddc4 to
f379748
Compare
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 5, 2026
API tokens now have a pure scope policy shared with the upcoming authorization matrix. Permissions form a closed vocabulary; wildcard and secret-value-read scopes are rejected. A token cannot span multiple organizations. Tenant scopes require an organization and can narrow to a project/environment without crossing that hierarchy. Profile read is the only account-level scope. Input scopes are bounded, copied, frozen and deduplicated before authorization. Labels reject control/format characters and are limited to 64 code points. Token expiry ranges from one minute to ninety days. The active-token cap is 50. Scope matching explicitly requires an additional live owner-permission check; this PR alone grants no API access. Validation: tests were written before implementation. Domain lint/typecheck/build and all 25 domain tests pass. The new policy has 100% statement, branch and function coverage; the full domain package remains above its 90% target. Tests cover unknown/wildcard scopes, malformed hierarchy, cross-tenant/resource attempts, input mutation, label injection and exact expiry boundaries. Security: pure functions, no framework, I/O or dependency added. Plan/spec updated; persistence and HTTP authentication remain M2.2d4b/c. Stacked on #56; no merge requested. - [x] M2.2d4a criteria met - [x] Domain tests and coverage target pass - [x] Default-deny scope rules and owner-policy intersection documented - [x] No state mutation, new shell invocation or secret exposure path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The API now exposes MFA status, setup, activation, disablement and recovery-code regeneration. Login accepts TOTP or recovery proof. Private provisioning data and new recovery codes are returned only at their explicit delivery boundary, with no-store responses; security changes set fresh session/CSRF cookies.
MFA writes require authenticated sessions, exact Origin and CSRF, current-password reauthentication, and persisted limits by user as well as IP. Authenticated retry snapshots now bind the user and security version, preventing another account from retrieving a secret-bearing response with the same key/body. Status exposes only enabled/pending state and remaining-code count.
Validation: API lint/typecheck, 94 unit tests, production build and all 64 PostgreSQL/TLS SMTP integration tests pass. Four new HTTP tests cover the full MFA lifecycle, password-only denial, one-use recovery login, old-session rejection, cross-account/version retry isolation, account limits across proxy IP changes, malformed proofs and audit rollback without cookies. OpenAPI and client regenerated.
Security: all factor values are validated and wrapped on entry. Origin/CSRF and rate guards precede replay. A changed security context conflicts; lost recovery-code responses can be replaced after TOTP login and reauthentication, as documented. Stacked on #55; no merge requested.