Virgil Security C++ SDK
Public Member Functions | List of all members
virgil::sdk::jwt::providers::CachingJwtProvider Class Reference

Implementation of AccessTokenProvider which provides AccessToken using cache+renew callback. More...

#include <CachingJwtProvider.h>

Inheritance diagram for virgil::sdk::jwt::providers::CachingJwtProvider:
virgil::sdk::jwt::interfaces::AccessTokenProviderInterface

Public Member Functions

 CachingJwtProvider (std::function< std::future< std::string >(const TokenContext &)> renewJwtCallback)
 Constructor. More...
 
std::future< std::shared_ptr< interfaces::AccessTokenInterface > > getToken (const TokenContext &tokenContext)
 Provides access token using callback or cached token. More...
 
const std::function< std::future< std::string >const TokenContext &)> & renewJwtCallback () const
 Getter. More...
 
const std::shared_ptr< Jwt > & jwt () const
 Getter. More...
 
- Public Member Functions inherited from virgil::sdk::jwt::interfaces::AccessTokenProviderInterface
virtual ~AccessTokenProviderInterface ()=default
 Virtual destructor.
 

Detailed Description

Implementation of AccessTokenProvider which provides AccessToken using cache+renew callback.

Constructor & Destructor Documentation

virgil::sdk::jwt::providers::CachingJwtProvider::CachingJwtProvider ( std::function< std::future< std::string >(const TokenContext &)>  renewJwtCallback)

Constructor.

Parameters
renewJwtCallbackstd::function, which takes a TokenContext returns std::future with Jwt std::string

Member Function Documentation

std::future<std::shared_ptr<interfaces::AccessTokenInterface> > virgil::sdk::jwt::providers::CachingJwtProvider::getToken ( const TokenContext tokenContext)
virtual

Provides access token using callback or cached token.

Parameters
tokenContextTokenContext provides context explaining why token is needed
Returns
std::future with std::shared_ptr to Jwt

Implements virgil::sdk::jwt::interfaces::AccessTokenProviderInterface.

const std::shared_ptr<Jwt>& virgil::sdk::jwt::providers::CachingJwtProvider::jwt ( ) const

Getter.

Returns
cached Jwt
const std::function<std::future<std::string>const TokenContext&)>& virgil::sdk::jwt::providers::CachingJwtProvider::renewJwtCallback ( ) const

Getter.

Returns
callback provider uses to obtain token

The documentation for this class was generated from the following file: