The ironic.api.hooks Module¶
-
class
ironic.api.hooks.ConfigHook[source]¶ Bases:
pecan.hooks.PecanHookAttach the config object to the request so controllers can get to it.
-
class
ironic.api.hooks.ContextHook(public_api_routes)[source]¶ Bases:
pecan.hooks.PecanHookConfigures a request context and attaches it to the request.
The following HTTP request headers are used:
- X-User-Id or X-User:
- Used for context.user_id.
- X-Tenant-Id or X-Tenant:
- Used for context.tenant.
- X-Auth-Token:
- Used for context.auth_token.
- X-Roles:
- Used for setting context.is_admin flag to either True or False. The flag is set to True, if X-Roles contains either an administrator or admin substring. Otherwise it is set to False.
-
class
ironic.api.hooks.DBHook[source]¶ Bases:
pecan.hooks.PecanHookAttach the dbapi object to the request so controllers can get to it.
-
class
ironic.api.hooks.NoExceptionTracebackHook[source]¶ Bases:
pecan.hooks.PecanHookWorkaround rpc.common: deserialize_remote_exception.
deserialize_remote_exception builds rpc exception traceback into error message which is then sent to the client. Such behavior is a security concern so this hook is aimed to cut-off traceback from the error message.
-
class
ironic.api.hooks.PublicUrlHook[source]¶ Bases:
pecan.hooks.PecanHookAttach the right public_url to the request.
Attach the right public_url to the request so resources can create links even when the API service is behind a proxy or SSL terminator.
-
class
ironic.api.hooks.RPCHook[source]¶ Bases:
pecan.hooks.PecanHookAttach the rpcapi object to the request so controllers can get to it.