latest.ipv8.REST.rest_manager
Module Contents
Classes
Middleware to check for authorized REST access. |
|
This class is responsible for managing the startup and closing of the HTTP API. |
Functions
|
Cross-origin resource sharing middleware. |
|
Middleware to catch call errors when handling requests. |
- class latest.ipv8.REST.rest_manager.ApiKeyMiddleware(api_key: str | None)
Middleware to check for authorized REST access.
- async __call__(request: aiohttp.abc.Request, handler: aiohttp.typedefs.Handler) aiohttp.web_response.StreamResponse | latest.ipv8.REST.base_endpoint.Response
Intercept requests that are not authorized.
- async latest.ipv8.REST.rest_manager.cors_middleware(request: aiohttp.abc.Request, handler: aiohttp.typedefs.Handler) latest.ipv8.REST.base_endpoint.Response | aiohttp.web_response.StreamResponse
Cross-origin resource sharing middleware.
- async latest.ipv8.REST.rest_manager.error_middleware(request: aiohttp.abc.Request, handler: aiohttp.typedefs.Handler) latest.ipv8.REST.base_endpoint.Response | aiohttp.web_response.StreamResponse
Middleware to catch call errors when handling requests.
- class latest.ipv8.REST.rest_manager.RESTManager(session: object, root_endpoint_class: type[latest.ipv8.REST.base_endpoint.BaseEndpoint] | None = None)
This class is responsible for managing the startup and closing of the HTTP API.
- async start(port: int = 8085, host: str = '127.0.0.1', api_key: str | None = None, ssl_context: aiohttp.connector.SSLContext | None = None) None
Starts the HTTP API with the listen port as specified in the session configuration.