api.integration

Classes

ApiApp

A Morepath-based application object.

Functions

get_api_endpoints(→ list[str])

Module Contents

class api.integration.ApiApp[source]

Bases: morepath.App

A Morepath-based application object.

You subclass App to create a morepath application class. You can then configure this class using Morepath decorator directives.

An application can extend one or more other applications, if desired, by subclassing them. By subclassing App itself, you get the base configuration of the Morepath framework itself.

Conflicting configuration within an app is automatically rejected. An subclass app cannot conflict with the apps it is subclassing however; instead configuration is overridden.

You can turn your app class into a WSGI application by instantiating it. You can then call it with the environ and start_response arguments.

Subclasses from dectate.App, which provides the dectate.App.directive() decorator that lets you register new directives.

configure_api(**cfg: Any) None[source]

Configures the API.

The following configuration options are accepted:

Rate_limit:

A tuple with number of request per expiration time in seconds.

Since providing an API is not our main focus, we keep the rate limit rather low (<10 requests per minute) while still allowing small crawl bursts by default.

property rate_limit_cache: onegov.core.cache.RedisCacheRegion[source]

A cache for rate limits.

api.integration.get_api_endpoints() list[str][source]