Bootstrap takes the client IP, is limited per IP, and writes no audit line
once an admin exists. Creating, changing the role of or deleting a user now
needs a session with recent reauthentication; API tokens are refused.
/api/analyze and /api/update return fixed messages and log the detail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A global middleware wraps the router and its fallback: only PUBLIC_ROUTES
answer without a credential, and unknown paths look like protected ones.
Adds cookie sessions with per-session CSRF, scoped Bearer tokens, the
/api/auth and /api/admin handlers, Transport for client IP and Secure, and
pending-token enrollment re-checked inside one store update.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
reset_admin now sets a persisted must_change_password flag. While it is set,
login and confirm_mfa return PasswordChangeRequired, a ticket that only allows
change_required_password, instead of a session. confirm_mfa therefore returns
LoginStep. change_password clears the flag and refuses the current password
as the new one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds AuthService with single-use setup code, password login, TOTP and
recovery codes, enrollment, account management and local admin reset.
Attempts are reserved before Argon2 so parallel guesses cannot outrun the
per-account delay or the IP limit, and unknown usernames follow the same
schedule as real accounts. Passwords are NFC-normalized; repeated-character
and all-digit passwords are refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>