feat: Funcion de sistema tenants

This commit is contained in:
2026-02-23 13:01:24 -07:00
parent ceea67eb2b
commit 1ccc39732b
58 changed files with 1889 additions and 315 deletions

View File

@@ -56,6 +56,22 @@ backend/
- [x] TOTP 2FA implementation
- [x] Validation con Pydantic v2
### Rate limiting (login)
El endpoint `/{API_VERSION}/auth/login` incluye rate limiting (best-effort) usando Redis:
- Por IP: limita intentos totales por ventana
- Por identidad: limita por `(tenant_id, email)` por ventana
Responde `429 Too Many Requests` con header `Retry-After`.
Variables de entorno (ver `app/core/config.py`):
- `RATE_LIMIT_ENABLED` (default: `true`)
- `LOGIN_RATE_LIMIT_WINDOW_SECONDS` (default: `300`)
- `LOGIN_RATE_LIMIT_IP_MAX_ATTEMPTS` (default: `30`)
- `LOGIN_RATE_LIMIT_ID_MAX_ATTEMPTS` (default: `10`)
## Quick Start
```bash
@@ -157,8 +173,8 @@ Ver `.env.example` para todas las variables disponibles.
- [x] CORS restrictivo
- [x] Input validation con Pydantic
- [x] SQL injection protection (SQLAlchemy)
- [x] Rate limiting (TODO: implementar)
- [x] File upload validation (TODO: implementar)
- [x] Rate limiting (login)
- [x] File upload validation (extensión + firma básica + tamaño + streaming)
- [x] XSS protection (headers en nginx)
## Próximos pasos