Skip to content

Implement Rate Limiting and Abuse Prevention #16

@yusuftomilola

Description

@yusuftomilola

Implement Rate Limiting on PDF Generation API

Details

  • Use middleware such as express-rate-limit or 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions