1 #ifndef CondCore_CondDB_CredentialStore_h
2 #define CondCore_CondDB_CredentialStore_h
12 #include "CoralBase/MessageStream.h"
16 class AuthenticationCredentials;
17 class IAuthenticationCredentials;
25 std::transform(str.begin(), str.end(), str.begin(), [](
unsigned char c) {
return std::tolower(
c); });
29 namespace coral_bridge {
67 const std::map<std::pair<std::string, std::string>, coral::AuthenticationCredentials*>&
data()
const;
73 std::map<std::pair<std::string, std::string>, coral::AuthenticationCredentials*>
m_data;
129 bool forceUpdateConnection =
false);
std::pair< std::string, std::string > getUserCredentials(const std::string &connectionString, const std::string &role)
const std::string & keyPrincipalName()
std::map< std::pair< std::string, std::string >, coral::AuthenticationCredentials * > m_data
credentials for the specific roles
const edm::EventSetup & c
size_t unsetPermission(const std::string &principal, const std::string &role, const std::string &connectionString)
bool updatePrincipal(const std::string &principal, const std::string &principalKey, bool setAdmin=false)
CredentialStore()
Standard Constructor.
std::string m_principalKey
virtual ~AuthenticationCredentialSet()
Destructor.
bool removeConnection(const std::string &connectionLabel)
void openSession(const std::string &schemaName, const std::string &userName, const std::string &password, bool readMode)
bool resetAdmin(const std::string &userName, const std::string &password)
std::string m_authenticatedPrincipal
AuthenticationCredentialSet()
Constructor.
bool listConnections(std::map< std::string, std::pair< std::string, std::string > > &destination)
std::string to_lower(const std::string &s)
std::string m_serviceName
static const std::string serviceName
std::string principalName
void closeSession(bool commit=true)
void registerItem(const std::string &connectionString, const std::string &itemName, const std::string &itemValue)
std::string connectionString
const std::map< std::pair< std::string, std::string >, coral::AuthenticationCredentials * > & data() const
void startSession(bool readMode)
bool updateConnection(const std::string &connectionLabel, const std::string &userName, const std::string &password)
bool createSchema(const std::string &connectionString, const std::string &userName, const std::string &password)
bool exportAll(coral_bridge::AuthenticationCredentialSet &data)
std::string schemaLabel(const std::string &serviceName, const std::string &userName)
bool listPrincipals(std::vector< std::string > &destination)
std::string setUpForConnectionString(const std::string &connectionString, const std::string &authPath)
std::string setUpForService(const std::string &serviceName, const std::string &authPath)
Sets the initialization parameters.
bool importForPrincipal(const std::string &principal, const coral_bridge::AuthenticationCredentialSet &data, bool forceUpdateConnection=false)
import data
bool setPermission(const std::string &principal, const std::string &role, const std::string &connectionString, const std::string &connectionLabel)
virtual ~CredentialStore()
Standard Destructor.
bool selectForUser(coral_bridge::AuthenticationCredentialSet &destinationData)
bool removePrincipal(const std::string &principal)
const std::string & serviceName()
void startSuperSession(const std::string &connectionString, const std::string &userName, const std::string &password)
bool selectPermissions(const std::string &principalName, const std::string &role, const std::string &connectionString, std::vector< Permission > &destination)
static const std::string DEFAULT_DATA_SOURCE
std::shared_ptr< coral::ISession > m_session
void registerCredentials(const std::string &connectionString, const std::string &userName, const std::string &password)
std::pair< std::string, std::string > openConnection(const std::string &connectionString)
char data[epos_bytes_allocation]
std::shared_ptr< coral::IConnection > m_connection
bool drop(const std::string &connectionString, const std::string &userName, const std::string &password)
std::string connectionLabel
const auth::ServiceCredentials * m_serviceData