THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class documentation
class RateLimitMiddleware: (source)
Constructor: RateLimitMiddleware(config, default_responses)
Undocumented
| Method | __init__ |
Initialize the middleware with the given rate-limit configuration. |
| Async Method | close |
Release an owned Redis connection pool during application shutdown. |
| Async Method | handle |
Enforce the sliding-window rate limit for the incoming request. |
| Method | is |
Report whether rate limiting is active for this application. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | __default |
Undocumented |
| Instance Variable | __rate |
Undocumented |
| Instance Variable | __rate |
Undocumented |
| Instance Variable | __rate |
Undocumented |
| Instance Variable | __retry |
Undocumented |
| Instance Variable | __store |
Undocumented |
Initialize the middleware with the given rate-limit configuration.
| Parameters | |
config:dict | A dictionary whose keys must match HTTPRateLimit fields. |
defaultIDefaultResponses | Predefined default responses for common HTTP errors. |
| Returns | |
None | Undocumented |
Release an owned Redis connection pool during application shutdown.
| Returns | |
None | Leave quota state intact while closing network resources. |
Enforce the sliding-window rate limit for the incoming request.
Skips enforcement when rate limiting is disabled or when the client IP cannot be resolved. Returns a 429 response on the first request that exceeds the configured quota, or None when the request is within the allowed limit.
| Parameters | |
adapter:TransportAdapter | Transport abstraction providing client IP and header negotiation helpers. |
| Returns | |
Response | None | A 429 HTTP response when the limit is exceeded, or None when the request is allowed to proceed. |
Report whether rate limiting is active for this application.
| Returns | |
bool | True when the limiter is enabled, False otherwise. |