virgil_sdk.jwt.providers.caching_callback_provider module

class virgil_sdk.jwt.providers.caching_callback_provider.CachingCallbackProvider(renew_jwt_callback, token_ttl=5, initial_token=None)[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.