API Docs

Flask application factories

WSGI applications

Celery application factory

CLI application factory

Flask limiter functions

Flask Limiter functions.

invenio_app.limiter.set_rate_limit()[source]

Set rates for Flask limiter.

Returns:a rate limit string with the Flask-Limiter format.

For more information regarding the format you can see here.

The order in which the rate will be evaluated is the following:

1)Initially the endpoint is going to be evaluated against the whitelisted ones. If it has been marked as whitelisted then the custom limit for this endpoint will be the one to be returned.

2)If the endpoint is not whitelisted and the flask-security package is installed, it will evaluate if the user is logged in and if this is the case it will also check if there is an explicitly defined rate limit for them by comparing theire ID with the ones present in the `RATELIMIT_PER_USER` mapping. If it is present then the custom rate limit value will be returned, otherwise the one returned will be the `RATELIMIT_AUTHENTICATED_USER`

3)Finally if none of the above is our case then the `RATELIMIT_GUEST_USER` will be the one to be returned.

invenio_app.limiter.useragent_and_ip_limit_key()[source]

Create key for the rate limiting.