Direction:
Implement a Rate Limiting & Throttling module to protect APIs from abuse with per-user and per-IP limits backed by a distributed store (Redis) and middleware integration.
Key responsibilities:
- Middleware that enforces configurable rate limits (requests per minute/hour) per API key, user ID, or IP.
- Support for burst windows and leaky-bucket/token-bucket algorithms and distributed counters using Redis.
- Admin APIs to view/adjust limits and to whitelist/blacklist identifiers.
- Metrics and headers (Retry-After) and tests for limit enforcement and expiry semantics.
Acceptance criteria:
- Rate limit middleware applied to critical endpoints and respects configured policies.
- Counters work in multi-instance scenarios using Redis; tests simulate concurrent requests to verify correctness.
- Requests exceeding limits return appropriate status (429) and headers indicating retry timing.
- Admin endpoints to whitelist/blacklist exist and are protected by RBAC.
Direction:
Implement a Rate Limiting & Throttling module to protect APIs from abuse with per-user and per-IP limits backed by a distributed store (Redis) and middleware integration.
Key responsibilities:
Acceptance criteria: