forked from 0xWheatyz/SPARC
Add rate limiting to /auth/login and /auth/register endpoints #642
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
/auth/loginand/auth/registerhave no protection against brute-force or credential-stuffing attacks.What to do
slowapior a customstarlettemiddleware)Retry-Afterheader when the limit is exceededconfig.pyor as environment variables so they can be adjusted without code changesAcceptance criteria
Closing as already implemented.
SPARC/api.pyusesslowapiwith@limiter.limit()decorators on/auth/register(5/min) and/auth/login(10/min). A custom 429 handler returns proper error responses.