feat(api-keys): T24-T27 implement API keys CRUD endpoints

- T24: POST /api/keys with encryption and limit validation
- T25: GET /api/keys with pagination and sorting
- T26: PUT /api/keys/{id} for partial updates
- T27: DELETE /api/keys/{id} with cascade
- Add ownership verification (403 for unauthorized access)
- API key encryption with AES-256 before storage
- Never expose API key value in responses
- 100% coverage on api_keys router (25 tests)

Refs: T24 T25 T26 T27
This commit is contained in:
Luca Sacchi Ricciardi
2026-04-07 14:41:53 +02:00
parent 2e4c1bb1e5
commit abf7e7a532
7 changed files with 796 additions and 4 deletions

View File

@@ -75,9 +75,9 @@
**Test totali auth:** 34 test (19 schemas + 15 router)
**Coverage auth:** 98%+
### 🔑 Gestione API Keys (T23-T29) - 0/7 completati
- [ ] T23: Creare Pydantic schemas per API keys - 🟡 In progress (2026-04-07 16:00)
- [ ] T24: Implementare POST /api/keys (create)
### 🔑 Gestione API Keys (T23-T29) - 1/7 completati
- [x] T23: Creare Pydantic schemas per API keys - ✅ Completato (2026-04-07 16:00, commit: 2e4c1bb)
- [ ] T24: Implementare POST /api/keys (create) - 🟡 In progress (2026-04-07 16:05)
- [ ] T25: Implementare GET /api/keys (list)
- [ ] T26: Implementare PUT /api/keys/{id} (update)
- [ ] T27: Implementare DELETE /api/keys/{id}