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

Public Member Functions

void add (const std::string &url, AccessCredentials *ac)
 
AccessCredentialsget (const std::string &url)
 
unsigned int size ()
 
 ~CredentialsManager ()
 

Static Public Member Functions

static void clear ()
 
static void load_credentials ()
 
static CredentialsManagertheCM ()
 

Static Public Attributes

static const std::string ENV_ACCESS_KEY ="CMAC_ACCESS_KEY"
 
static const std::string ENV_BUCKET_KEY ="CMAC_BUCKET"
 
static const std::string ENV_CREDS_KEY_VALUE ="ENV_CREDS"
 
static const std::string ENV_ID_KEY ="CMAC_ID"
 
static const std::string ENV_REGION_KEY ="CMAC_REGION"
 
static const std::string ENV_URL_KEY ="CMAC_URL"
 
static CredentialsManagertheMngr =0
 

Detailed Description

Definition at line 63 of file CredentialsManager.h.

Constructor & Destructor Documentation

◆ ~CredentialsManager()

CredentialsManager::~CredentialsManager ( )

Destructo

Definition at line 114 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 154 of file CredentialsManager.cc.

◆ get()

AccessCredentials * CredentialsManager::get ( const std::string &  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 166 of file CredentialsManager.cc.

◆ load_credentials()

void CredentialsManager::load_credentials ( )
static

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 269 of file CredentialsManager.cc.

Member Data Documentation

◆ theMngr

CredentialsManager * CredentialsManager::theMngr =0
static

Our singleton instance

Definition at line 81 of file CredentialsManager.h.


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