1 #ifndef INCLUDE_COND_CREDENTIALSTORE_H
2 #define INCLUDE_COND_CREDENTAILSTORE_H
9 #include <boost/shared_ptr.hpp>
14 class AuthenticationCredentials;
15 class IAuthenticationCredentials;
21 namespace coral_bridge {
34 const std::string& itemName,
35 const std::string& itemValue );
39 const std::string& role,
40 const std::string& itemName,
41 const std::string& itemValue );
47 const std::string& userName,
48 const std::string& password );
54 const std::string& role,
55 const std::string& userName,
56 const std::string& password );
60 const coral::IAuthenticationCredentials*
get(
const std::string& connectionString )
const;
62 const coral::IAuthenticationCredentials*
get(
const std::string& connectionString,
const std::string& role )
const;
64 const std::map< std::pair<std::string,std::string>, coral::AuthenticationCredentials* >&
data()
const ;
70 std::map< std::pair<std::string,std::string>, coral::AuthenticationCredentials* >
m_data;
103 bool createSchema(
const std::string& connectionString,
const std::string& userName,
const std::string& password );
105 bool drop(
const std::string& connectionString,
const std::string& userName,
const std::string& password );
107 bool installAdmin(
const std::string& userName,
const std::string& password );
111 bool setPermission(
const std::string&
principal,
const std::string& role,
const std::string& connectionString,
const std::string& connectionLabel );
115 bool updateConnection(
const std::string& connectionLabel,
const std::string& userName,
const std::string& password );
136 bool selectPermissions(
const std::string& principalName,
const std::string& role,
const std::string& connectionString, std::vector<Permission>& destination );
146 std::pair<std::string,std::string>
openConnection(
const std::string& connectionString );
147 void openSession(
const std::string& schemaName,
const std::string& userName,
const std::string& password,
bool readMode );
148 void startSuperSession(
const std::string& connectionString,
const std::string& userName,
const std::string& password );
155 int addUser(
const std::string& principalName,
const std::string& authenticationKey,
const std::string& principalKey,
const std::string& adminKey );
157 bool setPermission(
int principalId,
const std::string& principalKey,
const std::string& role,
const std::string& connectionString,
int connectionId,
const std::string& connectionKey );
159 std::pair<int,std::string>
updateConnection(
const std::string& connectionLabel,
const std::string& userName,
const std::string& password,
bool forceUpdate );
const std::string & keyPrincipalName()
std::map< std::pair< std::string, std::string >, coral::AuthenticationCredentials * > m_data
credentials for the specific roles
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)
AuthenticationCredentialSet()
Constructor.
bool listConnections(std::map< std::string, std::pair< std::string, std::string > > &destination)
const ServiceCredentials * m_serviceData
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)
int addUser(const std::string &principalName, const std::string &authenticationKey, const std::string &principalKey, const std::string &adminKey)
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)
void startSuperSession(const std::string &connectionString, const std::string &userName, const std::string &password)
bool installAdmin(const std::string &userName, const std::string &password)
boost::shared_ptr< coral::ISession > m_session
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
boost::shared_ptr< coral::IConnection > m_connection
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]
bool drop(const std::string &connectionString, const std::string &userName, const std::string &password)
std::string connectionLabel
bool unsetPermission(const std::string &principal, const std::string &role, const std::string &connectionString)