bes Updated for version 3.20.13
CredentialsManager Class Reference
Collaboration diagram for CredentialsManager:
Collaboration graph

Public Member Functions

void add (const std::string &url, AccessCredentials *ac)
 
void clear ()
 
AccessCredentialsget (std::shared_ptr< http::url > &url)
 
bool hasNgapS3Credentials ()
 
void load_credentials ()
 
unsigned int size ()
 
 ~CredentialsManager ()
 

Static Public Member Functions

static CredentialsManagertheCM ()
 Returns the singleton instance of the CrednetialsManager.
 

Static Public Attributes

static const char * ENV_ACCESS_KEY = "CMAC_ACCESS_KEY"
 
static const char * ENV_BUCKET_KEY = "CMAC_BUCKET"
 
static const char * ENV_ID_KEY = "CMAC_ID"
 
static const char * ENV_REGION_KEY = "CMAC_REGION"
 
static const char * ENV_URL_KEY = "CMAC_URL"
 
static CredentialsManagertheMngr = nullptr
 
static const char * USE_ENV_CREDS_KEY_VALUE = "ENV_CREDS"
 

Detailed Description

Definition at line 40 of file CredentialsManager.h.

Constructor & Destructor Documentation

◆ ~CredentialsManager()

CredentialsManager::~CredentialsManager ( )

Destructo

Definition at line 132 of file CredentialsManager.cc.

Member Function Documentation

◆ add()

void CredentialsManager::add ( const std::string &  key,
AccessCredentials ac 
)

Add the passed set of AccessCredentials to the collection, filed under key.

Parameters
keyThe key (URL) to associated with these credentials
acThe credentials to use for access.

Definition at line 156 of file CredentialsManager.cc.

◆ clear()

void CredentialsManager::clear ( )
inline

Definition at line 73 of file CredentialsManager.h.

◆ get()

AccessCredentials * CredentialsManager::get ( std::shared_ptr< http::url > &  url)

Retrieve the AccessCredentials, if any, associated with the passed url (key).

Parameters
urlThe URL for which AccessCredentials are desired
Returns
If there are AccessCredentials associated with the URL/key then a point to them will be returned. Otherwise, NULL.

Definition at line 172 of file CredentialsManager.cc.

◆ hasNgapS3Credentials()

bool CredentialsManager::hasNgapS3Credentials ( )
inline

Definition at line 84 of file CredentialsManager.h.

◆ load_credentials()

void CredentialsManager::load_credentials ( )

This method loads credentials from a special file identified in the bes.conf chain by the key "CredentialsManager.config". If the key is missing from the bes.conf chain the method will return and no credentials will be loaded.

The credentials are stored as a map of maps where the key is the human readable name of the credentials. The map of maps is accomplished by the following formatting:

cloudydap=url:https://s3.amazonaws.com/cloudydap/ cloudydap+=id:------------------------— cloudydap+=key:************************** cloudydap+=region:us-east-1 cloudydap+=bucket:cloudydap

cloudyopendap=url:https://s3.amazonaws.com/cloudyopendap/ cloudyopendap+=id:------------------------— cloudyopendap+=key:************************** cloudyopendap+=region:us-east-1 cloudyopendap+=bucket:cloudyopendap

cname_02=url:https://ssotherone.org/login cname_02+=id:------------------------— cname_02+=key:************************** cname_02+=region:us-east-1 cname_02+=bucket:cloudyotherdap

Exceptions
BESInternalErrorif the file specified by the "CredentialsManager.config" key is missing.

Definition at line 279 of file CredentialsManager.cc.

◆ size()

unsigned int CredentialsManager::size ( )
inline

Definition at line 80 of file CredentialsManager.h.

◆ theCM()

CredentialsManager * CredentialsManager::theCM ( )
static

Returns the singleton instance of the CrednetialsManager.

Returns
Returns the singleton instance of the CredentialsManager

Definition at line 106 of file CredentialsManager.cc.

Member Data Documentation

◆ ENV_ACCESS_KEY

const char * CredentialsManager::ENV_ACCESS_KEY = "CMAC_ACCESS_KEY"
static

Definition at line 43 of file CredentialsManager.h.

◆ ENV_BUCKET_KEY

const char * CredentialsManager::ENV_BUCKET_KEY = "CMAC_BUCKET"
static

Definition at line 45 of file CredentialsManager.h.

◆ ENV_ID_KEY

const char * CredentialsManager::ENV_ID_KEY = "CMAC_ID"
static

Definition at line 42 of file CredentialsManager.h.

◆ ENV_REGION_KEY

const char * CredentialsManager::ENV_REGION_KEY = "CMAC_REGION"
static

Definition at line 44 of file CredentialsManager.h.

◆ ENV_URL_KEY

const char * CredentialsManager::ENV_URL_KEY = "CMAC_URL"
static

Definition at line 46 of file CredentialsManager.h.

◆ theMngr

CredentialsManager * CredentialsManager::theMngr = nullptr
static

Our singleton instance

Definition at line 65 of file CredentialsManager.h.

◆ USE_ENV_CREDS_KEY_VALUE

const char * CredentialsManager::USE_ENV_CREDS_KEY_VALUE = "ENV_CREDS"
static

Definition at line 47 of file CredentialsManager.h.


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