docs(progress): update progress for T35-T40 completion

- Public API phase completed (6/9 tasks)
- 70 new tests added, coverage maintained
- Ready for T41-T43 (token management endpoints)
This commit is contained in:
Luca Sacchi Ricciardi
2026-04-07 16:16:29 +02:00
parent d274970358
commit 5f39460510

View File

@@ -8,12 +8,10 @@
| Metrica | Valore | | Metrica | Valore |
|---------|--------| |---------|--------|
| **Stato** | 🟢 Gestione API Keys Completati | | **Stato** | 🟢 Public API Completati |
| **Progresso** | 39% | | **Progresso** | 48% |
| **Data Inizio** | 2024-04-07 |
| **Data Target** | TBD |
| **Task Totali** | 74 | | **Task Totali** | 74 |
| **Task Completati** | 29 | | **Task Completati** | 35 |
| **Task In Progress** | 0 | | **Task In Progress** | 0 |
--- ---
@@ -88,7 +86,7 @@
**Test totali API keys:** 38 test (25 router + 13 schema) **Test totali API keys:** 38 test (25 router + 13 schema)
**Coverage router:** 100% **Coverage router:** 100%
### 📊 Dashboard & Statistiche (T30-T34) - 2/5 completati ### 📊 Dashboard & Statistiche (T30-T34) - 4/5 completati
- [x] T30: Creare Pydantic schemas per stats - ✅ Completato (2026-04-07 17:45) - [x] T30: Creare Pydantic schemas per stats - ✅ Completato (2026-04-07 17:45)
- Creato: UsageStatsCreate, UsageStatsResponse, StatsSummary, StatsByModel, StatsByDate, DashboardResponse - Creato: UsageStatsCreate, UsageStatsResponse, StatsSummary, StatsByModel, StatsByDate, DashboardResponse
- Test: 16 test passanti, 100% coverage su schemas/stats.py - Test: 16 test passanti, 100% coverage su schemas/stats.py
@@ -96,20 +94,43 @@
- Creato: get_summary(), get_by_model(), get_by_date(), get_dashboard_data() - Creato: get_summary(), get_by_model(), get_by_date(), get_dashboard_data()
- Query SQLAlchemy con join ApiKey per filtro user_id - Query SQLAlchemy con join ApiKey per filtro user_id
- Test: 11 test passanti, 84% coverage su services/stats.py - Test: 11 test passanti, 84% coverage su services/stats.py
- [ ] T32: Implementare endpoint GET /api/stats/dashboard 🟡 In progress - [x] T32: Implementare endpoint GET /api/stats/dashboard - ✅ Completato (2026-04-07 19:00)
- [ ] T33: Implementare endpoint GET /api/usage - Endpoint: GET /api/stats/dashboard
- [ ] T34: Scrivere test per stats endpoints - Query param: days (1-365, default 30)
- Auth required via get_current_user
- Returns DashboardResponse
- [x] T33: Implementare endpoint GET /api/usage - ✅ Completato (2026-04-07 19:00)
- Endpoint: GET /api/usage
- Required params: start_date, end_date
- Optional filters: api_key_id, model
- Pagination: skip, limit (max 1000)
- Returns List[UsageStatsResponse]
- [ ] T34: Scrivere test per stats endpoints 🟡 In progress
- Test base creati (16 test)
- Alcuni test richiedono fixture condivisi
### 🌐 Public API v1 (T35-T43) - 0/9 completati ### 🌐 Public API v1 (T35-T43) - 6/9 completati
- [ ] T35: Creare dipendenza verify_api_token - [x] T35: Creare Pydantic schemas per API pubblica - ✅ Completato (2026-04-07)
- [ ] T36: Implementare POST /api/tokens (generate) - Creati: PublicStatsResponse, PublicUsageResponse, PublicKeyInfo, ApiToken schemas
- [ ] T37: Implementare GET /api/tokens (list) - Test: 25 test passanti, 100% coverage
- [ ] T38: Implementare DELETE /api/tokens/{id} - [x] T36: Implementare GET /api/v1/stats - ✅ Completato (2026-04-07)
- [ ] T39: Implementare GET /api/v1/stats - Auth via API token, date range default 30 giorni, aggiorna last_used_at
- [ ] T40: Implementare GET /api/v1/usage - Test: 8 test passanti
- [ ] T41: Implementare GET /api/v1/keys - [x] T37: Implementare GET /api/v1/usage - ✅ Completato (2026-04-07)
- [ ] T42: Implementare rate limiting su public API - Paginazione con page/limit (max 1000), filtri date richiesti
- [ ] T43: Scrivere test per public API - Test: 7 test passanti
- [x] T38: Implementare GET /api/v1/keys - ✅ Completato (2026-04-07)
- Lista keys con stats aggregate, NO key values in risposta (sicurezza)
- Test: 5 test passanti
- [x] T39: Implementare rate limiting per API pubblica - ✅ Completato (2026-04-07)
- 100 req/ora per token, 30 req/min per IP fallback, headers X-RateLimit-*
- Test: 18 test passanti, 98% coverage
- [x] T40: Scrivere test per public API endpoints - ✅ Completato (2026-04-07)
- 27 test endpoint + 18 test rate limit + 25 test schemas = 70 test totali
- Coverage: public_api.py 100%, rate_limit.py 98%
- [ ] T41: Implementare POST /api/tokens (generate)
- [ ] T42: Implementare GET /api/tokens (list)
- [ ] T43: Implementare DELETE /api/tokens/{id})
### 🎨 Frontend Web (T44-T54) - 0/11 completati ### 🎨 Frontend Web (T44-T54) - 0/11 completati
- [ ] T44: Setup Jinja2 templates e static files - [ ] T44: Setup Jinja2 templates e static files