Endpoints¶
App: src/endpoints/main.py. Unless noted, routes need X-Internal-Secret matching INTERNAL_SECRET.
Public / lightly gated¶
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | / |
Internal secret (middleware) | Root |
| GET | /health |
Internal secret | Health |
| GET | /api/validate-magic-link |
Public (token query) | Validate magic link; set cookie |
| GET | /docs, /openapi.json, /redoc |
Public | OpenAPI UI |
Cookie-protected¶
Require valid credentials_auth cookie from a validated magic link.
| Method | Path | Purpose |
|---|---|---|
| GET | /form |
Credential HTML form |
| POST | /api/submit-credentials |
Validate portal login, encrypt, upsert credentials |
| GET | /delete-account |
Deletion confirmation page |
| POST | /api/confirm-delete-account |
Delete user (+ cascaded credentials) |
Internal¶
| Method | Path | Purpose |
|---|---|---|
| POST | /api/magic-link |
Body { "email": "…" } → create hashed token, email link |
Header: X-Internal-Secret: <INTERNAL_SECRET>.
Submit credentials pipeline¶
- Rate limit (strict).
- Parse form: first/last name, username, password.
- Playwright portal login check.
- KMS
GenerateDataKey+ AES-GCM. - Upsert credential; clear
needs_password. - Admin alert + user confirmation email.