deckhand.control.middleware module¶
-
class
deckhand.control.middleware.
ContextMiddleware
[source]¶ Bases:
object
-
process_resource
(req, resp, resource, params)[source]¶ Handle the authentication needs of the routed request.
Parameters: - req –
falcon
request object that will be examined for method - resource –
falcon
resource class that will be examined for authentication needs by looking at the no_authentication_methods list of http methods. By default, this will assume that all requests need authentication unless noted in this array. Note that this does not bypass any authorization checks, which will fail if the user is not authenticated.
Raises: falcon.HTTPUnauthorized: when value of the ‘X-Identity-Status’ header is not ‘Confirmed’ and anonymous access is disallowed.
- req –
-
-
class
deckhand.control.middleware.
HookableMiddlewareMixin
[source]¶ Bases:
object
Provides methods to extract before and after hooks from WSGI Middleware Prior to falcon 0.2.0b1, it’s necessary to provide falcon with middleware as “hook” functions that are either invoked before (to process requests) or after (to process responses) the API endpoint code runs. This mixin allows the process_request and process_response methods from a typical WSGI middleware object to be extracted for use as these hooks, with the appropriate method signatures.
-
class
deckhand.control.middleware.
YAMLTranslator
[source]¶ Bases:
deckhand.control.middleware.HookableMiddlewareMixin
,object
Middleware for converting all responses (error and success) to YAML.
falcon
error exceptions use JSON formatting and headers by default. This middleware will intercept all responses and guarantee they are YAML format.Note
This does not include the 401 Unauthorized that is raised by
keystonemiddleware
which is executed in the pipeline beforefalcon
middleware.