{"categories":[{"label":"WWW/HTTP","url":"https://skillfed.io/packages/category/internet-www-http/6"}],"enrichment":{"capability":"An ASGI middleware that enforces rate limits on HTTP requests by user or group, with support for multiple time windows, regex-based routing, and pluggable backends like memory or Redis.","skillfed_tags":["asgi-middleware","rate-limiting","access-control"],"use_cases":["Protect API endpoints from abuse by limiting requests per user to a fixed rate per second or minute.","Implement tiered access where admin users get higher rate limits than regular users on the same endpoint.","Share rate-limit budgets across multiple related endpoints using the zone parameter.","Customize 429 responses with your own handler to return application-specific error messages.","Use Redis backend to enforce consistent rate limits across multiple application instances."],"what_it_does":"asgi-ratelimit is an ASGI middleware that sits between your web application and incoming requests, enforcing rate limits based on user identity and group membership. It lets you define rules that restrict how often a user can hit specific endpoints\u2014for example, allowing 1 request per second to one endpoint and 1 per minute to another\u2014with different limits for different user groups like admins. The middleware can use an in-memory backend for simple cases or Redis for distributed setups.\n\nYou configure it with regex patterns matching your routes and Rule objects specifying time windows (second, minute, day) and optional group names. When a user exceeds the limit, the middleware returns HTTP 429 and blocks further requests for a configurable period. It requires you to provide an authentication function that extracts the user ID and group from the ASGI scope\u2014the package includes built-in helpers for IP-based, session-based, and JWT-based identification.","worth_installing":"Yes, with conditions. Install if you need straightforward per-user rate limiting on an ASGI app and can accept that the package is no longer actively maintained (last release 2022-12-07). The low install friction, permissive license, and zero known vulnerabilities make it safe to add. However, verify compatibility with your specific ASGI framework version and Python release, and plan for potential maintenance burden if you need to patch it yourself."},"id":"asgi-ratelimit","links":{"html":"https://skillfed.io/packages/asgi-ratelimit","md":"https://skillfed.io/packages/asgi-ratelimit.md","pypi":"https://pypi.org/project/asgi-ratelimit/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2022-12-07","license_spdx":null,"license_treatment":"permissive","name":"asgi-ratelimit","python_support":"supports_current","summary":null},"popularity":{"monthly_downloads":127463,"position":11741,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.10.0"}
