feat: persistent sessions and OIDC sign-in (auth M2 + M3)
Sessions and users (M2) - users and sessions tables in SQLite; only a digest of the session ID is stored - idle 30 min / absolute 8 h deadlines, UPDATE-only touch, per-user revoke by generation - emergency operator is a users row (issuer local:emergency); its sessions are bound to the operator hash fingerprint, so unsetting or rotating it ends them - CSRF derived from the session ID; GET /api/v1/me OIDC login (M3) - openidconnect 4.1: authorization code + PKCE S256, static redirect URI, no redirects - one-time login transactions bound to the browser by a Lax correlation cookie - identity is (issuer, subject); admin only from configured subjects/groups; a signed-in user without a grant gets 403 on management APIs - OIDC sessions are bound to the OIDC configuration fingerprint - SSO button, no-access page and fixed error codes in the web UI - tests against a mock IdP with signed and malformed tokens; rehearsed against Keycloak 26.1 in a real browser - rsa 0.9 advisory (RUSTSEC-2023-0071) excepted with a written reason: runtime code only verifies signatures with public keys Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,9 @@ admin/browser. Semua status/data job hanya di scope owner/admin yang berizin.
|
||||
| /api-doc/openapi.json | GET | public | — | — | schema tanpa config/secret |
|
||||
| /api/v1/operator/session | GET | public | — | current session | status, actor, CSRF sesi sendiri; no-store |
|
||||
| /api/v1/operator/session | DELETE | human | session.self | current session | tidak ada; CSRF wajib |
|
||||
| /api/v1/me | GET | human | session.self | current principal | id, kind, auth method, display name, capabilities; no-store |
|
||||
| /api/v1/auth/oidc/login | GET | public | — | OIDC configured | redirect to the IdP; sets one-time Lax correlation cookie; 404 when OIDC is off |
|
||||
| /api/v1/auth/oidc/callback | GET | public | — | login transaction + correlation cookie | redirect to `/`; session cookie only on success, fixed error code otherwise; no tokens |
|
||||
| /api/v1/operator/login | POST | public | — | emergency account | cookie opaque dan CSRF; limiter, no-store |
|
||||
| /api/v1/snapshots | GET | human | snapshot.read | orbit | metadata aman terfilter |
|
||||
| /api/v1/snapshots/:id | DELETE | human | snapshot.delete | snapshot→orbit | tidak ada; cek pin |
|
||||
|
||||
Reference in New Issue
Block a user