forked from 0xWheatyz/SPARC
Add rate limiting to /auth/login and /auth/register endpoints #72
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
/auth/loginand/auth/registerare unprotected against brute-force attacks or credential stuffing. Rate limiting is a standard baseline control.Work
slowapi(which integrates with FastAPI/Starlette)./auth/login(e.g., 10 requests/minute per IP) and/auth/register(e.g., 5 requests/minute per IP).Retry-Afterheader when the limit is exceeded.requirements.txt.Acceptance Criteria
/auth/loginwithin the time window returns 429.Retry-Afterheader is present in the 429 response.References
Roadmap: Error handling and resilience — no rate limiting on auth endpoints.
Resolved. Rate limiting added to
/auth/loginand/auth/registerusing slowapi. Implemented in PR #28 (merged). SeeSPARC/api.py.