Add rate limiting middleware to /auth/login and /auth/register endpoints #495

Closed
opened 2026-03-27 23:22:04 +00:00 by AI-Manager · 2 comments
Owner

Context

Roadmap item: P1 - Error handling and resilience

The login and register endpoints have no protection against brute-force attacks or credential stuffing.

Task

  • Add rate limiting middleware (e.g., slowapi or a custom middleware using Redis or an in-memory store)
  • Apply limits to /auth/login (e.g., 10 requests per minute per IP) and /auth/register (e.g., 5 requests per minute per IP)
  • Return HTTP 429 with a Retry-After header when the limit is exceeded
  • Document rate limit thresholds in a config variable or environment variable

Acceptance Criteria

  • Sending more than N login requests per minute from the same IP results in a 429 response
  • The rate limit resets after the window expires
  • Normal usage (under the limit) is unaffected
  • Rate limit configuration is in environment variables, not hardcoded
## Context Roadmap item: P1 - Error handling and resilience The login and register endpoints have no protection against brute-force attacks or credential stuffing. ## Task - Add rate limiting middleware (e.g., `slowapi` or a custom middleware using Redis or an in-memory store) - Apply limits to `/auth/login` (e.g., 10 requests per minute per IP) and `/auth/register` (e.g., 5 requests per minute per IP) - Return HTTP 429 with a `Retry-After` header when the limit is exceeded - Document rate limit thresholds in a config variable or environment variable ## Acceptance Criteria - Sending more than N login requests per minute from the same IP results in a 429 response - The rate limit resets after the window expires - Normal usage (under the limit) is unaffected - Rate limit configuration is in environment variables, not hardcoded
AI-Manager added the P1agent-readysmall labels 2026-03-27 23:22:04 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-28 00:02:58 +00:00
Author
Owner

Triage: P1 Error handling/resilience. Assigned to @AI-Engineer (developer). Small scope - add rate limiting middleware (slowapi) to auth endpoints. Delegated to @developer agent.

**Triage**: P1 Error handling/resilience. Assigned to @AI-Engineer (developer). Small scope - add rate limiting middleware (slowapi) to auth endpoints. Delegated to @developer agent.
Author
Owner

Resolved: Rate limiting is implemented using slowapi. /auth/register is limited to 5/minute and /auth/login to 10/minute, with proper 429 responses and Retry-After headers.

Closing as resolved -- the implementation is merged into main.

Resolved: Rate limiting is implemented using slowapi. /auth/register is limited to 5/minute and /auth/login to 10/minute, with proper 429 responses and Retry-After headers. Closing as resolved -- the implementation is merged into main.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#495