feat(security): T13 implement bcrypt password hashing

- Add password hashing with bcrypt (12 rounds)
- Implement verify_password with timing-safe comparison
- Add validate_password_strength with comprehensive rules
  - Min 12 chars, uppercase, lowercase, digit, special char
- 19 comprehensive tests with 100% coverage
- Handle TypeError for non-string inputs
This commit is contained in:
Luca Sacchi Ricciardi
2026-04-07 12:06:38 +02:00
parent 2fdd9d16fd
commit 54e81162df
3 changed files with 376 additions and 3 deletions

View File

@@ -52,9 +52,9 @@
- [x] T10: Creare model ApiToken (SQLAlchemy) - ✅ Completato (2026-04-07 11:15)
- [x] T11: Setup Alembic e creare migrazione iniziale - ✅ Completato (2026-04-07 11:20)
### 🔐 Servizi di Sicurezza (T12-T16) - 0/5 completati
- [ ] T12: Implementare EncryptionService (AES-256) - 🟡 In progress
- [ ] T13: Implementare password hashing (bcrypt)
### 🔐 Servizi di Sicurezza (T12-T16) - 1/5 completati
- [x] T12: Implementare EncryptionService (AES-256) - ✅ Completato (2026-04-07 12:00, commit: 2fdd9d1)
- [ ] T13: Implementare password hashing (bcrypt) - 🟡 In progress
- [ ] T14: Implementare JWT utilities
- [ ] T15: Implementare API token generation
- [ ] T16: Scrivere test per servizi di encryption