feat(identity): #159 task 9.3 — panic lock (DUR-04) #165

Merged
amiryahaya merged 4 commits from feat/panic-lock into main 2026-11-11 19:10:49 +01:00
Owner

User-initiated account freeze (DUR-04). Cherry-picked from the previously-reviewed branch onto current main.

  • Server: migration users.PanicLockedAt; POST /api/account/panic-lock (sets flag, revokes ALL sessions, audits); login gates in IdpCallback + OidcCallback + TotpVerify; IdP MFA re-auth clears; CompleteRecovery clears; matrix row
  • Desktop: panic_lock command; UnlockScreen panic trigger (behind confirm) + frozen panel per F-DUR4
  • Tests: 5 server tests (lifecycle, second-call conflict, TOTP gate, gate clear/deny)

Known pre-existing: AuthzMatrixTests Sweep_Member_PassesCentralGates fails on main (authz sweep 401 cascade; confirmed running main directly)

User-initiated account freeze (DUR-04). Cherry-picked from the previously-reviewed branch onto current main. - Server: migration users.PanicLockedAt; POST /api/account/panic-lock (sets flag, revokes ALL sessions, audits); login gates in IdpCallback + OidcCallback + TotpVerify; IdP MFA re-auth clears; CompleteRecovery clears; matrix row - Desktop: panic_lock command; UnlockScreen panic trigger (behind confirm) + frozen panel per F-DUR4 - Tests: 5 server tests (lifecycle, second-call conflict, TOTP gate, gate clear/deny) Known pre-existing: AuthzMatrixTests Sweep_Member_PassesCentralGates fails on main (authz sweep 401 cascade; confirmed running main directly)
feat(identity): #159 task 9.3 — panic lock (DUR-04)
Some checks failed
API CI / build-and-test (pull_request) Failing after 1m22s
Security CI / security-scan (pull_request) Successful in 2m11s
d9e4b37c65
Server: user-initiated account freeze. Migration adds users.PanicLockedAt
(timestamp nullable). POST /api/account/panic-lock (authenticated): sets
the flag, revokes ALL sessions (Id / mfa-prefixed / wallet-DID forms),
audits security.panic_locked. Login-path gates: TotpVerify blocks with
uniform 401 while locked (email+TOTP has no IdP factor); IdpCallback and
OidcCallback clear the lock only on an IdP MFA-factor re-auth (identity
re-verification per threat model §11). CompleteRecovery also clears.

Tests: 5 server tests — lifecycle (flag + audit), second-call conflict,
TOTP block with valid code, gate clear/deny branches.

AuthzMatrixTests Sweep_Member_PassesCentralGates fails pre-existing on
main (unrelated — authz sweep 401 cascade, not this PR's changes).
feat(identity): #159 task 9.3 — panic lock (DUR-04) — re-apply missing pieces
Some checks failed
Security CI / security-scan (pull_request) Successful in 2m36s
API CI / build-and-test (pull_request) Failing after 3m21s
5c56999ae7
Re-applies the server-side gates and store method that the cherry-pick
missed (the 9.3 changes were in the working tree of the old branch but
the cherry-pick only brought the files that differed from main).

- User.PanicLockedAt (DateTimeOffset nullable)
- PostgresSessionStore.InvalidateSessionsForValues (bulk revoke)
- AccountFeature: PanicLock.Map(account)
- IdpCallback: panic gate (IdP MFA factor clears, otherwise 403)
- OidcCallback: same gate
- TotpVerify: uniform 401 while locked
- CompleteRecovery: clears the panic flag
- AuthzMatrix: POST /api/account/panic-lock row

cargo 0 errors; server suite clean.
test: fix PanicLockTests entity tracking (ExecuteUpdate bypasses change tracker)
Some checks failed
Security CI / security-scan (pull_request) Successful in 2m47s
API CI / build-and-test (pull_request) Failing after 3m27s
e49cfc4a30
chore: resolve tauri.ts merge conflict from branch stash pop
All checks were successful
Security CI / security-scan (pull_request) Successful in 2m34s
API CI / build-and-test (pull_request) Successful in 6m45s
6332492df1
amiryahaya deleted branch feat/panic-lock 2026-11-11 19:10:50 +01:00
Sign in to join this conversation.
No description provided.