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

Implementation of AccessTokenProviderInterface which provides generated JWTs. More...

#include <GeneratorJwtProvider.h>

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

Public Member Functions

 GeneratorJwtProvider (JwtGenerator jwtGenerator, std::string defaultIdentity, std::unordered_map< std::string, std::string > additionalData=std::unordered_map< std::string, std::string >())
 Constructor. More...
 
std::future< std::shared_ptr< interfaces::AccessTokenInterface > > getToken (const TokenContext &tokenContext)
 Provides new generated JWT. More...
 
const JwtGeneratorjwtGenerator () const
 Getter. More...
 
const std::string & defaultIdentity () const
 Getter. More...
 
const std::unordered_map< std::string, std::string > & additionalData () const
 Getter. More...
 
- Public Member Functions inherited from virgil::sdk::jwt::interfaces::AccessTokenProviderInterface
virtual ~AccessTokenProviderInterface ()=default
 Virtual destructor.
 

Detailed Description

Implementation of AccessTokenProviderInterface which provides generated JWTs.

Constructor & Destructor Documentation

virgil::sdk::jwt::providers::GeneratorJwtProvider::GeneratorJwtProvider ( JwtGenerator  jwtGenerator,
std::string  defaultIdentity,
std::unordered_map< std::string, std::string >  additionalData = std::unordered_map< std::string, std::string >() 
)

Constructor.

Parameters
jwtGeneratorJwtGenerator instance for generating new tokens
defaultIdentityidentity that will be used for generating token if tokenContext do not have it (e.g. for read operations)
additionalDatastd::unordered_map with additional data, that will be present in token
Warning
Do not create cards with defaultIdentity

Member Function Documentation

const std::unordered_map<std::string, std::string>& virgil::sdk::jwt::providers::GeneratorJwtProvider::additionalData ( ) const

Getter.

Returns
std::unordered_map with additional data, that added to generated tokens
const std::string& virgil::sdk::jwt::providers::GeneratorJwtProvider::defaultIdentity ( ) const

Getter.

Returns
identity that will be used for generating token if tokenContext do not have it (e.g. for read operations)
std::future<std::shared_ptr<interfaces::AccessTokenInterface> > virgil::sdk::jwt::providers::GeneratorJwtProvider::getToken ( const TokenContext tokenContext)
virtual

Provides new generated JWT.

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

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

const JwtGenerator& virgil::sdk::jwt::providers::GeneratorJwtProvider::jwtGenerator ( ) const

Getter.

Returns
JwtGenerator instance Provider uses for generating new tokens

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