connexion.handlers

Module Contents

Classes

AuthErrorHandler

Wraps an error with authentication.

ResolverErrorHandler

Handler for responding to ResolverError.

Attributes

logger

RESOLVER_ERROR_ENDPOINT_RANDOM_DIGITS

connexion.handlers.logger
connexion.handlers.RESOLVER_ERROR_ENDPOINT_RANDOM_DIGITS = 6
class connexion.handlers.AuthErrorHandler(api, exception, security, security_definitions)

Bases: connexion.operations.secure.SecureOperation

Wraps an error with authentication.

property function(self)

Configured error auth handler.

handle(self, *args, **kwargs)

Actual handler for the execution after authentication.

property api(self)
property security(self)
property security_schemes(self)
property security_decorator(self)

Gets the security decorator for operation

From Swagger Specification:

Security Definitions Object

A declaration of the security schemes available to be used in the specification.

This does not enforce the security schemes on the operations and only serves to provide the relevant details for each scheme.

Operation Object -> security

A declaration of which security schemes are applied for this operation. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). This definition overrides any declared top-level security. To remove a top-level security declaration, an empty array can be used.

Security Requirement Object

Lists the required security schemes to execute this operation. The object can have multiple security schemes declared in it which are all required (that is, there is a logical AND between the schemes).

The name used for each property MUST correspond to a security scheme declared in the Security Definitions.

Return type

types.FunctionType

get_mimetype(self)
class connexion.handlers.ResolverErrorHandler(api, status_code, exception, security, security_definitions)

Bases: connexion.operations.secure.SecureOperation

Handler for responding to ResolverError.

property function(self)
handle(self, *args, **kwargs)
property operation_id(self)
property randomize_endpoint(self)
get_path_parameter_types(self)
property api(self)
property security(self)
property security_schemes(self)
property security_decorator(self)

Gets the security decorator for operation

From Swagger Specification:

Security Definitions Object

A declaration of the security schemes available to be used in the specification.

This does not enforce the security schemes on the operations and only serves to provide the relevant details for each scheme.

Operation Object -> security

A declaration of which security schemes are applied for this operation. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). This definition overrides any declared top-level security. To remove a top-level security declaration, an empty array can be used.

Security Requirement Object

Lists the required security schemes to execute this operation. The object can have multiple security schemes declared in it which are all required (that is, there is a logical AND between the schemes).

The name used for each property MUST correspond to a security scheme declared in the Security Definitions.

Return type

types.FunctionType

get_mimetype(self)