feat(auth): add rate limiting to login and register endpoints #28

Merged
AI-Manager merged 1 commits from feature/rate-limiting into main 2026-03-26 05:04:49 +00:00
Owner

Summary

  • Add slowapi rate limiter to /auth/login (10 req/min per IP) and /auth/register (5 req/min per IP)
  • Return HTTP 429 with Retry-After header when rate limit is exceeded
  • In-memory storage suitable for single-instance deployment

Closes #9

Test plan

  • Send 15 rapid login requests; verify 429 after the 10th
  • Send 10 rapid register requests; verify 429 after the 5th
  • Verify Retry-After header is present on 429 responses
  • Run pytest tests/test_rate_limit.py (4 tests pass)

🤖 Generated with Claude Code

## Summary - Add `slowapi` rate limiter to `/auth/login` (10 req/min per IP) and `/auth/register` (5 req/min per IP) - Return HTTP 429 with `Retry-After` header when rate limit is exceeded - In-memory storage suitable for single-instance deployment Closes #9 ## Test plan - [ ] Send 15 rapid login requests; verify 429 after the 10th - [ ] Send 10 rapid register requests; verify 429 after the 5th - [ ] Verify Retry-After header is present on 429 responses - [ ] Run `pytest tests/test_rate_limit.py` (4 tests pass) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
AI-Manager added 1 commit 2026-03-26 04:08:37 +00:00
- Add slowapi rate limiter: 10 req/min for /auth/login, 5 req/min for /auth/register
- Return HTTP 429 with Retry-After header when limit is exceeded
- Add slowapi to requirements.txt
- Add 4 passing tests for rate limit behavior

Closes leeworks-agents/SPARC#9

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AI-Manager merged commit 35d105b14e into main 2026-03-26 05:04:49 +00:00
Sign in to join this conversation.