From 5f39460510cc88ca4d7cdda870b29c5026699544 Mon Sep 17 00:00:00 2001 From: Luca Sacchi Ricciardi Date: Tue, 7 Apr 2026 16:16:29 +0200 Subject: [PATCH] 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) --- export/progress.md | 59 +++++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/export/progress.md b/export/progress.md index 1f675f1..b0ba337 100644 --- a/export/progress.md +++ b/export/progress.md @@ -8,12 +8,10 @@ | Metrica | Valore | |---------|--------| -| **Stato** | 🟢 Gestione API Keys Completati | -| **Progresso** | 39% | -| **Data Inizio** | 2024-04-07 | -| **Data Target** | TBD | +| **Stato** | 🟢 Public API Completati | +| **Progresso** | 48% | | **Task Totali** | 74 | -| **Task Completati** | 29 | +| **Task Completati** | 35 | | **Task In Progress** | 0 | --- @@ -88,7 +86,7 @@ **Test totali API keys:** 38 test (25 router + 13 schema) **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) - Creato: UsageStatsCreate, UsageStatsResponse, StatsSummary, StatsByModel, StatsByDate, DashboardResponse - 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() - Query SQLAlchemy con join ApiKey per filtro user_id - Test: 11 test passanti, 84% coverage su services/stats.py -- [ ] T32: Implementare endpoint GET /api/stats/dashboard 🟡 In progress -- [ ] T33: Implementare endpoint GET /api/usage -- [ ] T34: Scrivere test per stats endpoints +- [x] T32: Implementare endpoint GET /api/stats/dashboard - ✅ Completato (2026-04-07 19:00) + - Endpoint: GET /api/stats/dashboard + - 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 -- [ ] T35: Creare dipendenza verify_api_token -- [ ] T36: Implementare POST /api/tokens (generate) -- [ ] T37: Implementare GET /api/tokens (list) -- [ ] T38: Implementare DELETE /api/tokens/{id} -- [ ] T39: Implementare GET /api/v1/stats -- [ ] T40: Implementare GET /api/v1/usage -- [ ] T41: Implementare GET /api/v1/keys -- [ ] T42: Implementare rate limiting su public API -- [ ] T43: Scrivere test per public API +### 🌐 Public API v1 (T35-T43) - 6/9 completati +- [x] T35: Creare Pydantic schemas per API pubblica - ✅ Completato (2026-04-07) + - Creati: PublicStatsResponse, PublicUsageResponse, PublicKeyInfo, ApiToken schemas + - Test: 25 test passanti, 100% coverage +- [x] T36: Implementare GET /api/v1/stats - ✅ Completato (2026-04-07) + - Auth via API token, date range default 30 giorni, aggiorna last_used_at + - Test: 8 test passanti +- [x] T37: Implementare GET /api/v1/usage - ✅ Completato (2026-04-07) + - Paginazione con page/limit (max 1000), filtri date richiesti + - 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 - [ ] T44: Setup Jinja2 templates e static files