feat(openrouter): T28 implement API key validation service

- Add validate_api_key() function for OpenRouter key validation
- Add get_key_info() function to retrieve key metadata
- Implement proper error handling (timeout, network errors)
- Use httpx with 10s timeout
- Export from services/__init__.py
- 92% coverage on openrouter module (13 tests)

Refs: T28
This commit is contained in:
Luca Sacchi Ricciardi
2026-04-07 14:44:15 +02:00
parent abf7e7a532
commit 3824ce5169
4 changed files with 306 additions and 6 deletions

View File

@@ -75,13 +75,13 @@
**Test totali auth:** 34 test (19 schemas + 15 router)
**Coverage auth:** 98%+
### 🔑 Gestione API Keys (T23-T29) - 1/7 completati
### 🔑 Gestione API Keys (T23-T29) - 5/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}
- [ ] T28: Implementare servizio validazione key
- [x] T24: Implementare POST /api/keys (create) - ✅ Completato (2026-04-07 16:30, commit: abf7e7a)
- [x] T25: Implementare GET /api/keys (list) - ✅ Completato (2026-04-07 16:30, commit: abf7e7a)
- [x] T26: Implementare PUT /api/keys/{id} (update) - ✅ Completato (2026-04-07 16:30, commit: abf7e7a)
- [x] T27: Implementare DELETE /api/keys/{id} - ✅ Completato (2026-04-07 16:30, commit: abf7e7a)
- [ ] T28: Implementare servizio validazione key - 🟡 In progress (2026-04-07 17:00)
- [ ] T29: Scrivere test per API keys CRUD
### 📊 Dashboard & Statistiche (T30-T34) - 0/5 completati