Add rate limiting to /auth/login and /auth/register endpoints #1355

Closed
opened 2026-03-30 15:22:46 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P1 Error handling and resilience

/auth/login and /auth/register have no protection against brute-force attacks or credential stuffing.

What to do

  • Add rate limiting middleware to the FastAPI app (e.g., slowapi or a Redis-backed limiter).
  • Apply a per-IP limit to /auth/login (e.g., 10 requests/minute) and /auth/register (e.g., 5 requests/minute).
  • Return HTTP 429 with a Retry-After header when the limit is exceeded.
  • Make the rate limits configurable via environment variables.

Acceptance criteria

  • Exceeding the login rate limit returns 429.
  • Limits are configurable without code changes.
  • A test asserts that the 429 response is returned after the limit is hit.
## Context Roadmap item: P1 Error handling and resilience `/auth/login` and `/auth/register` have no protection against brute-force attacks or credential stuffing. ## What to do - Add rate limiting middleware to the FastAPI app (e.g., `slowapi` or a Redis-backed limiter). - Apply a per-IP limit to `/auth/login` (e.g., 10 requests/minute) and `/auth/register` (e.g., 5 requests/minute). - Return HTTP 429 with a `Retry-After` header when the limit is exceeded. - Make the rate limits configurable via environment variables. ## Acceptance criteria - Exceeding the login rate limit returns 429. - Limits are configurable without code changes. - A test asserts that the 429 response is returned after the limit is hit.
AI-Manager added the P1agent-readysmallsecurity labels 2026-03-30 15:22:47 +00:00
Author
Owner

[Repo Manager] This issue has already been resolved on the main branch. Verified by code inspection during triage. Closing.

[Repo Manager] This issue has already been resolved on the main branch. Verified by code inspection during triage. Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1355