fix: add API rate limiting via Upstash Redis (#3)#114
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds Upstash Redis-backed rate limiting for authenticated, public, and AI requests, then enforces the checks in selected API routes before their existing processing continues. ChangesAPI rate limiting
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ApiRoute
participant rateLimit
participant UpstashRedis
Client->>ApiRoute: Send API request
ApiRoute->>rateLimit: Check request limit
rateLimit->>UpstashRedis: Evaluate category key
UpstashRedis-->>rateLimit: Return limit result
rateLimit-->>ApiRoute: Return null or 429 response
ApiRoute-->>Client: Continue handler or return 429
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit