DevOps Engineer
f300e44c74
feat(HRT-80): API Token personnel + Webhook alertes (Pro)
...
- Nouveaux fichiers: api_tokens_db.py, api_v1/routes/user_tokens.py, api_v1/utils_webhook.py
- Migration DB idempotente: tables user_api_tokens + user_webhooks
- Endpoints POST/DELETE /api/v1/user/api-token (Pro only)
- Endpoints POST/DELETE /api/v1/user/webhook (Pro only, HTTPS requis)
- HMAC-SHA256 fire-and-forget dispatch webhook
- auth.py: validate_api_key() + X-API-Key fallback dans jwt_required_middleware
- saas_auth.py: import logging au niveau module, validate_api_key(), X-API-Key fallback
- api_v1/__init__.py: enregistrement user_tokens_bp
- 24 tests pytest — tous passent
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-29 17:25:30 +02:00
DevOps Engineer
701660ce83
fix(HRT-81): enregistrer history_bp dans api_v1/__init__.py
...
- Ajouter import de history_bp depuis .routes.history
- Ajouter app.register_blueprint(history_bp) dans register_api_v1()
- Corriger le docstring du module pour lister /api/v1/history
- Tests: 19/19 passed (GET /api/v1/history — auth, free/premium/pro, validation, pagination)
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-29 16:56:35 +02:00
DevOps Engineer
8604dc78b1
feat(HRT-79): alertes Telegram configurables Premium/Pro
...
- telegram_alerts.py: service envoi alertes via Bot API (send_pre_race_alerts,
build_race_alert, send_telegram_message) — gestion gracieuse TELEGRAM_BOT_TOKEN absent
- auth_db.py: migrate_telegram_columns() idempotente (ALTER TABLE + try/except OperationalError)
colonnes: telegram_chat_id, alert_value_bets, alert_top1, alert_quinte_only
- api_v1/routes/user.py: blueprint user_bp GET/POST /api/v1/user/telegram-config
protégé @jwt_required_middleware + @plan_required('premium','pro')
- api_v1/__init__.py: import + register user_bp
- turf_scheduler.py: run_telegram_alerts() + schedule_dynamic_telegram_alerts()
planifiées 30min avant course (même pattern que schedule_dynamic_scoring)
avec try/except Exception + fallback logger
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-29 16:42:15 +02:00
CTO H3R7Tech
d39c7d3319
fix(billing): JWT token incompatibility — use saas_auth require_auth + fix table names HRT-54
...
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-27 15:21:43 +02:00
DevOps Engineer
b8ef1ed35d
feat: Sprint 3-4 — Refacto API /v1/ (HRT-29)
...
- Blueprint Flask api_v1 avec prefix /api/v1/
- GET /api/v1/health — healthcheck public
- GET /api/v1/courses/today — courses du jour (paginé, filtré)
- GET /api/v1/courses/{id}/predictions — prédictions ML pour une course
- GET /api/v1/predictions/top3 — top 3 global (free tier)
- GET /api/v1/predictions/all — toutes prédictions (premium+)
- GET /api/v1/valuebets — value bets du jour (premium+)
- GET /api/v1/backtest — résultats backtest historiques (pro)
- GET /api/v1/export/csv — export CSV prédictions/paris (pro)
- GET /api/v1/metrics — métriques perf ML (premium+)
- Swagger/OpenAPI via flasgger à /api/v1/docs
- Erreurs uniformes {status, message, code}
- Pagination limit/offset sur toutes les listes
- 42 tests d'intégration passants
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-25 18:00:54 +02:00