forked from 0xWheatyz/SPARC
Add rate limiting to /auth/login and /auth/register endpoints #903
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?
Summary
The
/auth/loginand/auth/registerendpoints have no protection against brute-force attacks or credential-stuffing abuse.What to do
slowapi,fastapi-limiter, or a custom Redis/in-memory approach)./auth/login(e.g. 10 requests per minute per IP) and/auth/register(e.g. 5 requests per minute per IP).HTTP 429 Too Many Requestswith aRetry-Afterheader when the limit is exceeded.Acceptance criteria
Retry-After.Reference
ROADMAP.md — P1 Error handling and resilience — No rate limiting on auth endpoints
Triage: RESOLVED
This issue has been fully implemented in the fork main branch.
Evidence:
api.pyimports and configuresslowapi.Limiterwithget_remote_addressas the key function./auth/loginand/auth/registerendpoints.rate_limit_handler.tests/test_rate_limit.pyverifies the 429 response behavior.All acceptance criteria are met. Recommending closure.