slowapi
slowapi copied to clipboard
A rate limiter for Starlette and FastAPI
Endpoint with limiter does not show 429 as a possible answer on the documentation page
Test case for dynamic rate limiting added
Is it possible to change the rate limit of app or particular route after the app has started?
I would like to run an experiment with this repo. I am clearly not available enough to maintain this package at the pace I would like to, but it does...
The request object cannot be accessed easily in some of the limiter callbacks (`limit_value`, `exempt_when`). Support for this would be really useful. This already seems to work with `key_func` which...
Since FastAPI and Starlette are ASGI and are built on `asyncio`, it would be nice for slowapi to support `aioredis` as a storage backend. I imagine that it might require...
As suggested in [this comment](https://github.com/laurentS/slowapi/pull/19#discussion_r547876563) it should be possible to make the functionality available as a dependency for FastAPI. It looks like this would not be usable in Starlette, so...
As both starlette and FastAPI are fully async, there is no reason to keep this extension running synchronously. Going async should help save a few ms while fetching data from...
A default limit set as : ``` limiter = Limiter(key_func=default_identifier, default_limits="10/minute", headers_enabled=True, storage_uri=settings.RateLimit.redis_uri, in_memory_fallback_enabled=True, swallow_errors=True) app.state.limiter = limiter app.add_middleware(SlowAPIMiddleware) app.add_exception_handler(RateLimitExceeded, _rate_limit_exceeded_handler) ```` With routes that use the global limit, eg...
It would be nice if the paramter would be checked based on its type starlette.request.Request instead of the name, Which would allow something like this: ``` @router.get("/test") @limiter.limit("2/minute") async def...