Ligare.web.middleware.openapi

Connexion and OpenAPI-specific integrations for Ligare.web.

Functions

_get_correlation_id(request, response, log)

_get_correlation_id_from_headers(request, ...)

_log_all_api_requests(request, app, config, log)

_log_all_api_responses(request, response, ...)

_wrap_all_api_responses(response, config)

address_to_str(address)

decode_headers(headers)

encode_headers(headers, append_headers[, ...])

get_remote_address()

get_server_address()

headers_as_dict(request_response)

register_openapi_api_request_handlers(app)

register_openapi_api_response_handlers(app)

register_openapi_context_middleware(app)

Classes

FlaskContextMiddleware(app)

Connexion does not set Flask contexts in all cases they may be needed, like in middlewares that execute before ContextMiddleware.

RequestLoggerMiddleware(app)

ResponseLoggerMiddleware(app)

class Ligare.web.middleware.openapi.FlaskContextMiddleware(app)[source]

Connexion does not set Flask contexts in all cases they may be needed, like in middlewares that execute before ContextMiddleware. This middleware creates the Flask application, request, and session contexts if they are not currently set.

__init__(app)[source]
class Ligare.web.middleware.openapi.RequestLoggerMiddleware(app)[source]
__init__(app)[source]
class Ligare.web.middleware.openapi.ResponseLoggerMiddleware(app)[source]
__init__(app)[source]
Ligare.web.middleware.openapi.address_to_str(address)[source]
Ligare.web.middleware.openapi.decode_headers(headers)[source]
Ligare.web.middleware.openapi.encode_headers(headers, append_headers, encoding='utf-8')[source]
Ligare.web.middleware.openapi.get_remote_address()[source]
Return type:

Address

Ligare.web.middleware.openapi.get_server_address()[source]
Return type:

Address

Ligare.web.middleware.openapi.headers_as_dict(request_response)[source]
Return type:

dict[str, str]

Ligare.web.middleware.openapi.register_openapi_api_request_handlers(app)[source]
Ligare.web.middleware.openapi.register_openapi_api_response_handlers(app)[source]
Ligare.web.middleware.openapi.register_openapi_context_middleware(app)[source]

Modules

cors

Extensions for CORS middleware.