feat(security): add CSRF protection for all state-changing API routes
Build & Push Docker Image / build (push) Successful in 2m16s

- Synchronizer token stored in session; GET /auth/csrf to obtain it
- csrfProtection middleware requires X-CSRF-Token on non-safe methods
- customFetch injects the header via setCsrfTokenGetter
- toolrate boot loads token; reload after local login (session regenerate)
- OpenAPI GET /auth/csrf + CsrfToken schema, orval regenerated
This commit is contained in:
opencode
2026-08-03 10:30:13 +02:00
parent f851305d78
commit bcae59626f
15 changed files with 209 additions and 1 deletions
@@ -30,6 +30,10 @@ export interface AuthMode {
mode: AuthModeMode;
}
export interface CsrfToken {
token: string;
}
export interface LocalLoginInput {
username: string;
password: string;