CBSAsyncAuthMixin Class

Mixin to handle sending and refreshing CBS auth tokens asynchronously.

Inheritance
CBSAsyncAuthMixin

Constructor

CBSAsyncAuthMixin()

Methods

close_authenticator_async

Close the CBS auth channel and session asynchronously.

create_authenticator_async

Create the async AMQP session and the CBS channel with which to negotiate the token.

handle_token_async

This coroutine is called periodically to check the status of the current token if there is one, and request a new one if needed. If the token request fails, it will be retried according to the retry policy. A token refresh will be attempted if the token will expire soon.

This function will return a tuple of two booleans. The first represents whether the token authentication has not completed within it's given timeout window. The second indicates whether the token negotiation is still in progress.

close_authenticator_async

Close the CBS auth channel and session asynchronously.

async close_authenticator_async()

create_authenticator_async

Create the async AMQP session and the CBS channel with which to negotiate the token.

async create_authenticator_async(connection, debug=False, loop=None, **kwargs)

Parameters

connection
ConnectionAsync
Required

The underlying AMQP connection on which to create the session.

debug
bool
default value: False

Whether to emit network trace logging events for the CBS session. Default is False. Logging events are set at INFO level.

loop
default value: None

Return type

handle_token_async

This coroutine is called periodically to check the status of the current token if there is one, and request a new one if needed. If the token request fails, it will be retried according to the retry policy. A token refresh will be attempted if the token will expire soon.

This function will return a tuple of two booleans. The first represents whether the token authentication has not completed within it's given timeout window. The second indicates whether the token negotiation is still in progress.

async handle_token_async()

Return type

Exceptions

uamqp.errors.AuthenticationException if the token authentication fails.
uamqp.errors.TokenExpired if the token has expired and cannot berefreshed.

Attributes

loop