pulsar-client-cpp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
pulsar::AuthToken Class Reference

#include <Authentication.h>

Inheritance diagram for pulsar::AuthToken:
pulsar::Authentication

Public Member Functions

 AuthToken (AuthenticationDataPtr &)
 
const std::string getAuthMethodName () const
 
Result getAuthData (AuthenticationDataPtr &authDataToken)
 
virtual const std::string getAuthMethodName () const =0
 
virtual Result getAuthData (AuthenticationDataPtr &authDataContent)
 

Static Public Member Functions

static AuthenticationPtr create (ParamMap &params)
 
static AuthenticationPtr create (const std::string &authParamsString)
 
static AuthenticationPtr createWithToken (const std::string &token)
 
static AuthenticationPtr create (const TokenSupplier &tokenSupplier)
 
- Static Public Member Functions inherited from pulsar::Authentication
static ParamMap parseDefaultFormatAuthParams (const std::string &authParamsString)
 

Additional Inherited Members

- Protected Attributes inherited from pulsar::Authentication
AuthenticationDataPtr authData_
 

Detailed Description

Token based implementation of Pulsar client authentication

Member Function Documentation

◆ create() [1/3]

static AuthenticationPtr pulsar::AuthToken::create ( const std::string &  authParamsString)
static

Create an AuthToken with an authentication parameter string

See also
Authentication::parseDefaultFormatAuthParams

◆ create() [2/3]

static AuthenticationPtr pulsar::AuthToken::create ( const TokenSupplier &  tokenSupplier)
static

Create an authentication provider for token based authentication

Parameters
tokenSuppliera supplier of the client auth token

◆ create() [3/3]

static AuthenticationPtr pulsar::AuthToken::create ( ParamMap &  params)
static

Create an AuthToken with a ParamMap

Parameters
parametersit must contain a key-value, where key means how to get the token and value means the token source

If the key is “token”, the value is the token

If the key is “file”, the value is the file that contains the token

If the key is “env”, the value is the environment variable whose value is the token

Otherwise, a std::runtime_error error is thrown.

See also
create(const std::string& authParamsString)

◆ createWithToken()

static AuthenticationPtr pulsar::AuthToken::createWithToken ( const std::string &  token)
static

Create an authentication provider for token based authentication

Parameters
tokena string containing the auth token

◆ getAuthData()

Result pulsar::AuthToken::getAuthData ( AuthenticationDataPtr &  authDataToken)
virtual

Get AuthenticationData from the current instance

Parameters
[out]authDataTokenthe shared pointer of AuthenticationData. The content of AuthenticationData is changed to the internal data of the current instance.
Returns
ResultOk

Reimplemented from pulsar::Authentication.

◆ getAuthMethodName()

const std::string pulsar::AuthToken::getAuthMethodName ( ) const
virtual
Returns
“token”

Implements pulsar::Authentication.


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