Conversation
…ing and list operations
|
Caution Review failedThe pull request is closed. WalkthroughExtends RateLimiter to support custom keying, proxy-aware IP resolution, and optional rate-limit headers with Retry-After. Updates documentation and examples accordingly, adds tests for new behaviors, bumps package version to 0.1.8, and adjusts a dev dependency version. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant ASGI as FastAPI
participant RL as RateLimiter
participant Store as In-memory Store
participant Resp as Response
Client->>ASGI: HTTP request
ASGI->>RL: __call__(Request, Response)
RL->>RL: Resolve key<br/>(key_func | X-Forwarded-For | client.host)
RL->>RL: Compute window (monotonic)
RL->>Store: Load/prune timestamps for key
alt Within limit
RL->>Store: Append current timestamp
RL-->>Resp: Optionally set X-RateLimit-* headers
ASGI-->>Client: 2xx response
else Exceeds limit
RL->>RL: Compute Retry-After
RL-->>Resp: Set Retry-After (and optional headers)
ASGI-->>Client: 429 Too Many Requests
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (6)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit