nat.front_ends.fastapi.auth_flow_handlers.websocket_flow_handler#
Attributes#
Classes#
Handles front-end specifc flows for authentication clients. |
Module Contents#
- logger#
- class FlowState#
- future: asyncio.Future#
- class WebSocketAuthenticationFlowHandler(
- add_flow_cb: collections.abc.Callable[[str, FlowState], collections.abc.Awaitable[None]],
- remove_flow_cb: collections.abc.Callable[[str], collections.abc.Awaitable[None]],
- web_socket_message_handler: nat.front_ends.fastapi.message_handler.WebSocketMessageHandler,
Bases:
nat.authentication.interfaces.FlowHandlerBaseHandles front-end specifc flows for authentication clients.
Each front end will define a FlowHandler that will implement the authenticate method.
The
authenticatemethod will be stored as the callback in the ContextState.user_auth_callback- _add_flow_cb: collections.abc.Callable[[str, FlowState], collections.abc.Awaitable[None]]#
- _remove_flow_cb: collections.abc.Callable[[str], collections.abc.Awaitable[None]]#
- _web_socket_message_handler: nat.front_ends.fastapi.message_handler.WebSocketMessageHandler#
- async authenticate(
- config: nat.authentication.oauth2.oauth2_auth_code_flow_provider_config.OAuth2AuthCodeFlowProviderConfig,
- method: nat.data_models.authentication.AuthFlowType,
Perform the authentication process for the client.
This method handles the necessary steps to authenticate the client with the target API service, which may include obtaining tokens, refreshing credentials, or completing multistep authentication flows.
- Raises:
NotImplementedError: Must be implemented by subclasses.
- create_oauth_client(
- config: nat.authentication.oauth2.oauth2_auth_code_flow_provider_config.OAuth2AuthCodeFlowProviderConfig,
- async _handle_oauth2_auth_code_flow(
- config: nat.authentication.oauth2.oauth2_auth_code_flow_provider_config.OAuth2AuthCodeFlowProviderConfig,