update auth for refresh tokens and token invalidation

This commit is contained in:
voltsrage
2026-06-26 04:32:01 +08:00
parent 9777a335c5
commit abb33de5c1
20 changed files with 1183 additions and 12 deletions
+4 -1
View File
@@ -464,10 +464,13 @@ Reject is allowed from `pending_verification` (verifier; separation of duties ap
**Description:** JWT auth with role claims. Every state transition writes a `DigitizationEvent`. Document access logged.
**Endpoints:**
- `POST /api/v1/auth/login`
- `POST /api/v1/auth/login` — returns access token (15 min), refresh token (7 days), and user profile
- `POST /api/v1/auth/refresh` — rotates refresh token and issues new access token
- `POST /api/v1/auth/logout` — revokes refresh token server-side
- `GET /api/v1/auth/me`
**Audit requirements:**
- Auth events (`USER_LOGOUT`, `TOKEN_REFRESHED`) persisted in `auth_audit_events`
- Who viewed a scan and when
- Who changed which draft field (field-level diff in event metadata on save)
- Who approved promotion and which live record IDs were created