Skip to content

Add rate limiting and lifespan HTTP clients#20

Merged
MyDrift-user merged 1 commit intomainfrom
preperation-for-release
Feb 15, 2026
Merged

Add rate limiting and lifespan HTTP clients#20
MyDrift-user merged 1 commit intomainfrom
preperation-for-release

Conversation

@MyDrift-user
Copy link
Member

Type of Change

  • Refactoring
  • Security patch

Description

  • Introduced login rate limiting with slowapi and central Limiter (src/mw_utils/limiter.py), expose LOGIN_RATE_LIMIT env var, and attach middleware/exception handler in app.
  • Refactored files and office_preview routes to use lifespan-managed httpx clients (init/close in app.lifespan) to improve connection pooling and resource cleanup.
  • Removed Postgres service and DB env vars from compose/.env.example and stop using a local DB connection; keep Redis config.
  • Add slowapi to requirements and update secure_auth.login to accept Request and apply the limiter decorator. Misc: remove unused imports and session cleanup task; ensure HTTP clients raise if not initialized.

- Introduced login rate limiting with slowapi and central Limiter (src/mw_utils/limiter.py), expose LOGIN_RATE_LIMIT env var, and attach middleware/exception handler in app.
- Refactored files and office_preview routes to use lifespan-managed httpx clients (init/close in app.lifespan) to improve connection pooling and resource cleanup.
- Removed Postgres service and DB env vars from compose/.env.example and stop using a local DB connection; keep Redis config.
- Add slowapi to requirements and update secure_auth.login to accept Request and apply the limiter decorator. Misc: remove unused imports and session cleanup task; ensure HTTP clients raise if not initialized.
@MyDrift-user MyDrift-user merged commit 126df8e into main Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant