Skip to main content

Nova-specific rate-limit class for turnstile

Project description

This package provides the nova_limits Python module, which contains the nova_preprocess() preprocessor, the NovaClassLimit limit class, and the NovaTurnstileMiddleware replacement middleware class, all for use with Turnstile. These pieces work together to provide class-based rate limiting integration with nova. To use, you must configure the Turnstile middleware with the following configuration:

[filter:turnstile]
paste.filter_factory = turnstile.middleware:turnstile_filter
turnstile = nova_limits:NovaTurnstileMiddleware
preprocess = nova_limits:nova_preprocess
redis.host = <your Redis database host>

Then, simply use the nova_limits:NovaClassLimit rate limit class in your configuration.

Using NovaClassLimit

In addition to the other attributes provided by turnstile.limits:Limit, the NovaClassLimit limit class provides one additional required argument: the rate_class. Each tenant is associated with a given rate-limit class through the Redis database. (If no such association is present, the rate-limit class for a tenant is default.) Setting rate_class on NovaClassLimit restricts the limiting action to only those tenants in the given rate-limit class.

Also note that, for nova, the URIs used in configuring rate limiting must include the version identifier, i.e., “/v2/{tenant}/servers/detail”.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nova_limits-0.2.tar.gz (7.4 kB view details)

Uploaded Source

File details

Details for the file nova_limits-0.2.tar.gz.

File metadata

  • Download URL: nova_limits-0.2.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for nova_limits-0.2.tar.gz
Algorithm Hash digest
SHA256 3d0c56b141a91a0bdf92cec3f3074a782d5d399cf5c7f7ae5bc12e98cd006ac7
MD5 75c29ed30d1b34439c501aa0c0c8463c
BLAKE2b-256 95e9ae131e1ca10e8e4b52f753e34fd21602da2e42e94da0501d863725149874

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page