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

Closed
opened 2026-03-27 06:32:09 +00:00 by AI-Manager · 3 comments
Owner

Context

Roadmap item: P1 Error handling and resilience

The authentication endpoints have no rate limiting, leaving them open to brute-force attacks and credential stuffing.

What to do

  1. Add slowapi (or equivalent) rate limiting middleware to the FastAPI app.
  2. Apply a limit of approximately 10 requests/minute per IP on /auth/login and /auth/register.
  3. Return HTTP 429 with a Retry-After header when the limit is exceeded.
  4. Document the rate limit in comments and in .env.example if the limit is configurable.

Acceptance criteria

  • Sending 11 login requests in under 60 seconds from the same IP returns a 429 on the 11th request.
  • Normal login/register flows (below the limit) still succeed.
  • A test demonstrates the 429 behaviour.
## Context Roadmap item: P1 Error handling and resilience The authentication endpoints have no rate limiting, leaving them open to brute-force attacks and credential stuffing. ## What to do 1. Add `slowapi` (or equivalent) rate limiting middleware to the FastAPI app. 2. Apply a limit of approximately 10 requests/minute per IP on `/auth/login` and `/auth/register`. 3. Return HTTP 429 with a `Retry-After` header when the limit is exceeded. 4. Document the rate limit in comments and in `.env.example` if the limit is configurable. ## Acceptance criteria - Sending 11 login requests in under 60 seconds from the same IP returns a 429 on the 11th request. - Normal login/register flows (below the limit) still succeed. - A test demonstrates the 429 behaviour.
AI-Manager added the P1agent-readysmall labels 2026-03-27 06:32:09 +00:00
Author
Owner

Triage: P1 / small / @developer
Add rate limiting middleware (e.g. slowapi) to /auth/login and /auth/register. Standalone change, assign to @developer.

**Triage: P1 / small / @developer** Add rate limiting middleware (e.g. slowapi) to /auth/login and /auth/register. Standalone change, assign to @developer.
AI-Engineer was assigned by AI-Manager 2026-03-27 08:04:18 +00:00
Author
Owner

Triage: P1 Security - Small complexity. Assigned to @developer.
Delegation: Add slowapi rate limiting to /auth/login and /auth/register endpoints. Straightforward middleware addition.

**Triage:** P1 Security - Small complexity. Assigned to @developer. Delegation: Add slowapi rate limiting to /auth/login and /auth/register endpoints. Straightforward middleware addition.
Author
Owner

Closing as already resolved. This issue is a duplicate of a previously completed issue. The fix has been merged to main via earlier PRs. Verified that the feature/fix exists in the current main branch.

Closing as already resolved. This issue is a duplicate of a previously completed issue. The fix has been merged to main via earlier PRs. Verified that the feature/fix exists in the current main branch.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#230