Task Description
Implement a configurable API rate-limiting mechanism to protect backend services from abuse, excessive usage, and brute-force attacks. The solution should be middleware-based and reusable across multiple endpoints. It must support global limits as well as stricter limits for sensitive routes like authentication and user management. The implementation should be scalable and configurable through environment variables.
Key Outcomes:
- Middleware-based rate limiting for all APIs.
- Configurable request limits (per IP / per user).
- Stricter limits for sensitive endpoints (e.g., login).
- Proper
429 Too Many Requests error handling.
- Logging and monitoring support for rate-limit violations.
- Documentation on configuration and usage.
Task Description
Implement a configurable API rate-limiting mechanism to protect backend services from abuse, excessive usage, and brute-force attacks. The solution should be middleware-based and reusable across multiple endpoints. It must support global limits as well as stricter limits for sensitive routes like authentication and user management. The implementation should be scalable and configurable through environment variables.
Key Outcomes:
429 Too Many Requestserror handling.