- Add docs/README.md as the index of all documentation. - Split the 52 DEC entries of decisioni-e-limiti.md into docs/adr/ADR-NN files (same numbers), add ADR-53 (audit log), TEMPLATE.md and an ADR index with a feature -> ADR table. - Rename decisioni-e-limiti.md to limiti-noti.md (LIM only) and rewrite all DEC-nn references as links to the ADRs. - Document the docs-first / SSOT / ADR rules in processo-di-modifica.md and map the docs in CLAUDE.md and README.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
20 lines
1.2 KiB
Markdown
20 lines
1.2 KiB
Markdown
# ADR-36 — Password con Argon2, sessioni con JWT HS256 da 24 ore, revocabili
|
|
|
|
- **Stato:** Accettata
|
|
- **Area:** Account, amministrazione e sicurezza
|
|
- **Fonte di verità per:** la scelta di progetto descritta qui sotto; i requisiti (`PREFISSO-NN`) che la attuano stanno nei documenti di dominio, indicati nelle *Conseguenze*.
|
|
|
|
## Decisione
|
|
|
|
**Password con Argon2, sessioni con JWT HS256 da 24 ore,
|
|
revocabili.** Il token porta la versione dell'account (`tv`); cambio password
|
|
e reset admin la incrementano e invalidano tutte le sessioni precedenti. Un
|
|
token senza `tv` vale come versione 0, così il rilascio non ha disconnesso
|
|
nessuno. Argon2 gira fuori dall'event loop.
|
|
- *Motivazione:* un reset per account compromesso deve buttare fuori subito
|
|
l'attaccante (B-34); Argon2 inline bloccava l'intero processo, attività in
|
|
background comprese (B-55).
|
|
|
|
*Codice:* `app/auth/security.py:create_access_token` · `app/auth/security.py:decode_access_token` · `app/auth/dependencies.py:get_current_user` · `app/auth/security.py:verify_password_async` ·
|
|
*Test:* `tests/unit/test_security.py`, `tests/unit/test_users.py::test_change_password_invalidates_the_old_token_but_not_the_new_one`
|