forked from 0xWheatyz/SPARC
Add rate limiting middleware to /auth/login and /auth/register endpoints #547
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
/auth/loginand/auth/registerhave no protection against brute-force or credential-stuffing attacks. Rate limiting needs to be applied to these endpoints.What to do
slowapi(built onlimits)./auth/loginto a reasonable threshold (e.g. 10 requests / minute per IP)./auth/registersimilarly (e.g. 5 requests / minute per IP).Retry-Afterheader when the limit is exceeded.Acceptance Criteria
Retry-Afterheader is present in the 429 response.Reference
Roadmap item: P1 - Error handling and resilience > No rate limiting on auth endpoints
Triage (Repo Manager): Assigned to AI-Engineer as @developer task. P1/medium -- add slowapi rate limiting middleware to auth endpoints. Well-scoped with clear library choice.
[Repo Manager] This issue is already resolved.
api.pyusesslowapirate limiter with5/minutelimit on auth endpoints. Closing as complete.