Skip to content

Conversation

@borfast
Copy link
Contributor

@borfast borfast commented Nov 13, 2025

This pull request introduces a rate limiting system for the application, using Redis for tracking requests.

  • Uses Redis for tracking requests
  • Hashes IP addresses for GDPR compliance
  • Supports per-route and per-method limits
  • Adds rate limit headers to responses

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_URL and NUXT_RATE_LIMITER_REDIS_DB must 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.

@borfast borfast requested review from epipav and gaspergrom November 13, 2025 23:41
@borfast borfast self-assigned this Nov 13, 2025
Copilot AI review requested due to automatic review settings November 13, 2025 23:41
Copilot finished reviewing on behalf of borfast November 13, 2025 23:44
Copy link
Contributor

Copilot AI left a 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.

@borfast borfast force-pushed the feat/IN-803-add-rate-limiter branch 7 times, most recently from 642333a to 11c9c65 Compare November 14, 2025 00:19
@borfast borfast marked this pull request as draft November 14, 2025 00:25
@borfast borfast force-pushed the feat/IN-803-add-rate-limiter branch 4 times, most recently from 26b57f4 to 852529c Compare November 14, 2025 19:06
@borfast borfast marked this pull request as ready for review November 14, 2025 19:09
@borfast borfast requested review from epipav and gaspergrom November 14, 2025 19:09
@borfast borfast force-pushed the feat/IN-803-add-rate-limiter branch 2 times, most recently from f99d631 to e8fd9f9 Compare November 17, 2025 15:30
Signed-off-by: Raúl Santos <[email protected]>
@borfast borfast force-pushed the feat/IN-803-add-rate-limiter branch from e8fd9f9 to 0f32fd2 Compare November 17, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants