forked from 0xWheatyz/SPARC
Security: Add rate limiting middleware to /auth/login and /auth/register #472
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Roadmap item: P1 - Error handling and resilience
Problem
The
/auth/loginand/auth/registerendpoints have no rate limiting. They are vulnerable to brute-force password attacks and registration abuse.Task
slowapior a Redis-backed limiter)./auth/login(e.g., 10 requests/minute per IP) and/auth/register(e.g., 5 requests/hour per IP).Retry-Afterheader when the limit is exceeded.Acceptance Criteria
/auth/loginreturns 429 after exceeding the configured threshold./auth/registerreturns 429 after exceeding the configured threshold.Already implemented. Rate limiting via
slowapiis integrated inSPARC/api.py(imported at line 14-16). Therequirements.txtincludes slowapi. Rate limit tests exist intests/test_rate_limit.py. Closing as completed.