virgil_sdk.jwt.providers package

Submodules

virgil_sdk.jwt.providers.caching_callback_provider module

class virgil_sdk.jwt.providers.caching_callback_provider.CachingCallbackProvider(renew_jwt_callback, token_ttl=5)[source]

Bases: virgil_sdk.jwt.abstractions.access_token_provider.AccessTokenProvider

The CachingCallbackProvider class provides an opportunity to get cached access token or renew it using callback mechanism.

TOKEN_TTL = 5
get_token(token_context)[source]

Gets access token from cache or renew by provided callback if expired.

Parameters:token_context – Access token context.
Returns:Instance of access token.

virgil_sdk.jwt.providers.callback_jwt_provider module

class virgil_sdk.jwt.providers.callback_jwt_provider.CallbackJwtProvider(get_token_callback)[source]

Bases: virgil_sdk.jwt.abstractions.access_token_provider.AccessTokenProvider

The CallbackJwtProvider class provides an opportunity to get access token using callback mechanism.

get_token(token_context)[source]

Gets access token by provided callback.

Parameters:token_context – Access token context.
Returns:Instance of access token.
Raises:ValueError – Token context empty.

virgil_sdk.jwt.providers.const_access_token_provider module

class virgil_sdk.jwt.providers.const_access_token_provider.ConstAccessTokenProvider(access_token)[source]

Bases: virgil_sdk.jwt.abstractions.access_token_provider.AccessTokenProvider

The ConstAccessTokenProvider class provides an opportunity to use constant access token.

get_token(context=None)[source]

Gets access token.

Parameters:context – TokenContext
Returns:Instance of access token.

Module contents