forked from 0xWheatyz/SPARC
Add rate limiting to /auth/login and /auth/register endpoints #1099
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?
Background
The
/auth/loginand/auth/registerendpoints currently have no protection against brute-force password attacks or automated registration abuse.What to do
slowapi(orfastapi-limiterbacked by Redis) as a dependency./auth/login./auth/register.Retry-Afterheader when the limit is exceeded.RATE_LIMIT_ENABLEDenv var (defaulttrue) so tests can disable it cleanly.Acceptance criteria
Retry-Afterheader is present on 429 responses.Roadmap reference: P1 - Error handling and resilience
This issue has been verified as already implemented in the current codebase. The acceptance criteria are met based on code review. Closing as completed.