-
Notifications
You must be signed in to change notification settings - Fork 16
feat: add rate limiter [IN-803] #1390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a Redis-based rate limiting system for the application to protect against excessive request volumes. The implementation uses IP address hashing for GDPR compliance and supports configurable per-route and per-method rate limits.
Key Changes:
- Added rate limiter middleware that intercepts requests and enforces configurable rate limits
- Implemented IP extraction and hashing logic for GDPR compliance
- Configured Redis client integration from the crowd.dev repository
- Added rate limit headers to API responses
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/setup/rate-limiter.ts | Defines rate limiter configuration with default and route-specific limits |
| frontend/server/utils/rate-limiter.ts | Core rate limiting logic including IP extraction, route matching, and Redis operations |
| frontend/server/types/rate-limiter.ts | TypeScript type definitions for rate limiter configuration and results |
| frontend/server/middleware/rate-limiter.ts | Middleware that applies rate limiting to incoming requests |
| frontend/package.json | Added Redis client dependencies |
| frontend/nuxt.config.ts | Integrated rate limiter config and fixed comment typo |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
642333a to
11c9c65
Compare
26b57f4 to
852529c
Compare
f99d631 to
e8fd9f9
Compare
Signed-off-by: Raúl Santos <[email protected]>
e8fd9f9 to
0f32fd2
Compare
This pull request introduces a rate limiting system for the application, using Redis for tracking requests.
Because for the frontend directory the dependencies have to be installed
--ignore-workspace, the existing Redis client package from the crowd.dev repository was not reused. Instead, a light version was created.The environment variables
NUXT_REDIS_URLandNUXT_RATE_LIMITER_REDIS_DBmust be present and care must be taken so that the rate limiter does not use a database that is being used by something else.Jira ticket here.