-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
Description
Implement Rate Limiting on PDF Generation API
Details
- Use middleware such as
express-rate-limitor Redis-based limiter for distributed environments. - Configure limits as follows:
- Max 20 requests per minute per user/IP for PDF generation endpoint.
- On limit exceeded, respond with HTTP 429 Too Many Requests and a descriptive message.
- Log rate limit violations with user ID or IP address for audit purposes.
- Provide configurable limits via environment variables.
- Write tests simulating multiple rapid requests to verify enforcement.
Subtasks
- Implement rate limiting middleware configuration.
- Add logging for limit breaches.
- Add test cases for rate limiting.
Acceptance Criteria
- Rate limits enforced accurately per user or IP.
- Clients receive correct HTTP 429 status when limit is hit.
- Logs generated for abuse attempts.
- Tests validate limit enforcement.