#include <CredentialStore.h>
Classes | |
struct | Permission |
Public Member Functions | |
bool | createSchema (const std::string &connectionString, const std::string &userName, const std::string &password) |
CredentialStore () | |
Standard Constructor. More... | |
bool | drop (const std::string &connectionString, const std::string &userName, const std::string &password) |
bool | exportAll (coral_bridge::AuthenticationCredentialSet &data) |
bool | importForPrincipal (const std::string &principal, const coral_bridge::AuthenticationCredentialSet &data, bool forceUpdateConnection=false) |
import data More... | |
bool | installAdmin (const std::string &userName, const std::string &password) |
const std::string & | keyPrincipalName () |
bool | listConnections (std::map< std::string, std::pair< std::string, std::string > > &destination) |
bool | listPrincipals (std::vector< std::string > &destination) |
bool | removeConnection (const std::string &connectionLabel) |
bool | removePrincipal (const std::string &principal) |
bool | selectForUser (coral_bridge::AuthenticationCredentialSet &destinationData) |
bool | selectPermissions (const std::string &principalName, const std::string &role, const std::string &connectionString, std::vector< Permission > &destination) |
bool | setPermission (const std::string &principal, const std::string &role, const std::string &connectionString, const std::string &connectionLabel) |
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. More... | |
bool | unsetPermission (const std::string &principal, const std::string &role, const std::string &connectionString) |
bool | updateConnection (const std::string &connectionLabel, const std::string &userName, const std::string &password) |
bool | updatePrincipal (const std::string &principal, const std::string &principalKey, bool setAdmin=false) |
virtual | ~CredentialStore () |
Standard Destructor. More... | |
Static Public Attributes | |
static const std::string | DEFAULT_DATA_SOURCE |
Private Member Functions | |
int | addUser (const std::string &principalName, const std::string &authenticationKey, const std::string &principalKey, const std::string &adminKey) |
void | closeSession (bool commit=true) |
std::pair< std::string, std::string > | openConnection (const std::string &connectionString) |
void | openSession (const std::string &schemaName, const std::string &userName, const std::string &password, bool readMode) |
void | openSession (bool readOnly=true) |
bool | setPermission (int principalId, const std::string &principalKey, const std::string &role, const std::string &connectionString, int connectionId, const std::string &connectionKey) |
void | startSession (bool readMode) |
void | startSuperSession (const std::string &connectionString, const std::string &userName, const std::string &password) |
std::pair< int, std::string > | updateConnection (const std::string &connectionLabel, const std::string &userName, const std::string &password, bool forceUpdate) |
Private Attributes | |
boost::shared_ptr < coral::IConnection > | m_connection |
DecodingKey | m_key |
int | m_principalId |
std::string | m_principalKey |
const ServiceCredentials * | m_serviceData |
std::string | m_serviceName |
boost::shared_ptr < coral::ISession > | m_session |
Friends | |
class | CSScopedSession |
Definition at line 83 of file CredentialStore.h.
cond::CredentialStore::CredentialStore | ( | ) |
Standard Constructor.
Definition at line 648 of file CredentialStore.cc.
|
virtual |
|
private |
Definition at line 356 of file CredentialStore.cc.
References ADMIN_KEY_COL(), cond::Cipher::b64encrypt(), COND_AUTHENTICATION_TABLE(), ora::SequenceManager::getNextId(), PRINCIPAL_ID_COL(), PRINCIPAL_KEY_COL(), PRINCIPAL_NAME_COL(), python.IdGenerator::schema, SEQUENCE_TABLE_NAME(), AlCaHLTBitMon_QueryRunRegistry::string, and VERIFICATION_COL().
|
private |
Definition at line 337 of file CredentialStore.cc.
bool cond::CredentialStore::createSchema | ( | const std::string & | connectionString, |
const std::string & | userName, | ||
const std::string & | password | ||
) |
Definition at line 709 of file CredentialStore.cc.
References ADMIN_KEY_COL(), AUTH_ID_COL(), AUTH_KEY_COL(), C_ID_COL(), cond::CSScopedSession::close(), COND_AUTHENTICATION_TABLE(), COND_AUTHORIZATION_TABLE(), COND_CREDENTIAL_TABLE(), CONNECTION_ID_COL(), CONNECTION_KEY_COL(), CONNECTION_LABEL_COL(), ora::SequenceManager::create(), P_ID_COL(), PASSWORD_COL(), PRINCIPAL_ID_COL(), PRINCIPAL_KEY_COL(), PRINCIPAL_NAME_COL(), ROLE_COL(), python.IdGenerator::schema, SCHEMA_COL(), SEQUENCE_TABLE_NAME(), python.CommonUtils::session, cond::CSScopedSession::startSuper(), cond::throwException(), USERNAME_COL(), VERIFICATION_COL(), and VERIFICATION_KEY_COL().
bool cond::CredentialStore::drop | ( | const std::string & | connectionString, |
const std::string & | userName, | ||
const std::string & | password | ||
) |
Definition at line 797 of file CredentialStore.cc.
References cond::CSScopedSession::close(), COND_AUTHENTICATION_TABLE(), COND_AUTHORIZATION_TABLE(), COND_CREDENTIAL_TABLE(), python.IdGenerator::schema, SEQUENCE_TABLE_NAME(), python.CommonUtils::session, and cond::CSScopedSession::startSuper().
bool cond::CredentialStore::exportAll | ( | coral_bridge::AuthenticationCredentialSet & | data | ) |
Definition at line 1329 of file CredentialStore.cc.
References cond::Cipher::b64decrypt(), C_ID_COL(), cond::CSScopedSession::close(), COND_AUTHORIZATION_TABLE(), COND_CREDENTIAL_TABLE(), CONNECTION_ID_COL(), CONNECTION_KEY_COL(), CONNECTION_LABEL_COL(), newFWLiteAna::found, PASSWORD_COL(), o2o::query, coral_bridge::AuthenticationCredentialSet::registerCredentials(), ROLE_COL(), python.IdGenerator::schema, SCHEMA_COL(), python.CommonUtils::session, cond::CSScopedSession::start(), AlCaHLTBitMon_QueryRunRegistry::string, USERNAME_COL(), and VERIFICATION_KEY_COL().
bool cond::CredentialStore::importForPrincipal | ( | const std::string & | principal, |
const coral_bridge::AuthenticationCredentialSet & | data, | ||
bool | forceUpdateConnection = false |
||
) |
import data
Definition at line 1162 of file CredentialStore.cc.
References cond::PrincipalData::adminKey, cond::Cipher::b64decrypt(), cond::CSScopedSession::close(), results_mgr::conn, coral_bridge::AuthenticationCredentialSet::data(), newFWLiteAna::found, cond::PrincipalData::id, python.multivaluedict::map(), visualization-live-secondInstance_cfg::msg, geometryXMLtoCSV::parser, python.IdGenerator::schema, cond::schemaLabel(), cond::selectPrincipal(), serviceName, python.CommonUtils::session, cond::CSScopedSession::start(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::throwException().
bool cond::CredentialStore::installAdmin | ( | const std::string & | userName, |
const std::string & | password | ||
) |
Definition at line 810 of file CredentialStore.cc.
References ADMIN_KEY_COL(), AUTH_ID_COL(), AUTH_KEY_COL(), cond::Cipher::b64encrypt(), C_ID_COL(), cond::CSScopedSession::close(), cond::Auth::COND_ADMIN_ROLE, COND_AUTHENTICATION_TABLE(), COND_AUTHORIZATION_TABLE(), COND_CREDENTIAL_TABLE(), cond::Auth::COND_DB_KEY_SIZE, CONNECTION_ID_COL(), CONNECTION_KEY_COL(), CONNECTION_LABEL_COL(), newFWLiteAna::found, relval_steps::gen(), ora::SequenceManager::getNextId(), cond::KeyGenerator::make(), visualization-live-secondInstance_cfg::msg, P_ID_COL(), PASSWORD_COL(), PRINCIPAL_ID_COL(), PRINCIPAL_KEY_COL(), PRINCIPAL_NAME_COL(), ROLE_COL(), python.IdGenerator::schema, SCHEMA_COL(), cond::schemaLabelForCredentialStore(), cond::selectPrincipal(), SEQUENCE_TABLE_NAME(), python.CommonUtils::session, cond::CSScopedSession::startSuper(), AlCaHLTBitMon_QueryRunRegistry::string, cond::throwException(), USERNAME_COL(), VERIFICATION_COL(), and VERIFICATION_KEY_COL().
const std::string & cond::CredentialStore::keyPrincipalName | ( | ) |
Definition at line 1385 of file CredentialStore.cc.
bool cond::CredentialStore::listConnections | ( | std::map< std::string, std::pair< std::string, std::string > > & | destination | ) |
Definition at line 1224 of file CredentialStore.cc.
References cond::Cipher::b64decrypt(), cond::CSScopedSession::close(), COND_CREDENTIAL_TABLE(), CONNECTION_KEY_COL(), CONNECTION_LABEL_COL(), roll_playback::destination, newFWLiteAna::found, PASSWORD_COL(), o2o::query, python.IdGenerator::schema, python.CommonUtils::session, cond::CSScopedSession::start(), AlCaHLTBitMon_QueryRunRegistry::string, USERNAME_COL(), and VERIFICATION_KEY_COL().
bool cond::CredentialStore::listPrincipals | ( | std::vector< std::string > & | destination | ) |
Definition at line 1201 of file CredentialStore.cc.
References cond::CSScopedSession::close(), COND_AUTHENTICATION_TABLE(), newFWLiteAna::found, PRINCIPAL_NAME_COL(), o2o::query, python.IdGenerator::schema, python.CommonUtils::session, cond::CSScopedSession::start(), and AlCaHLTBitMon_QueryRunRegistry::string.
|
private |
Definition at line 378 of file CredentialStore.cc.
References instance.
|
private |
Definition at line 391 of file CredentialStore.cc.
|
private |
bool cond::CredentialStore::removeConnection | ( | const std::string & | connectionLabel | ) |
Definition at line 1075 of file CredentialStore.cc.
References C_ID_COL(), cond::CSScopedSession::close(), COND_AUTHORIZATION_TABLE(), COND_CREDENTIAL_TABLE(), CONNECTION_ID_COL(), newFWLiteAna::found, cond::CredentialData::id, visualization-live-secondInstance_cfg::msg, python.IdGenerator::schema, cond::selectConnection(), python.CommonUtils::session, cond::CSScopedSession::start(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::throwException().
bool cond::CredentialStore::removePrincipal | ( | const std::string & | principal | ) |
Definition at line 1041 of file CredentialStore.cc.
References cond::CSScopedSession::close(), COND_AUTHENTICATION_TABLE(), COND_AUTHORIZATION_TABLE(), newFWLiteAna::found, cond::PrincipalData::id, visualization-live-secondInstance_cfg::msg, P_ID_COL(), PRINCIPAL_ID_COL(), python.IdGenerator::schema, cond::selectPrincipal(), python.CommonUtils::session, cond::CSScopedSession::start(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::throwException().
bool cond::CredentialStore::selectForUser | ( | coral_bridge::AuthenticationCredentialSet & | destinationData | ) |
Definition at line 1109 of file CredentialStore.cc.
References AUTH_KEY_COL(), cond::Cipher::b64decrypt(), C_ID_COL(), cond::CSScopedSession::close(), COND_AUTHORIZATION_TABLE(), COND_CREDENTIAL_TABLE(), CONNECTION_ID_COL(), CONNECTION_LABEL_COL(), P_ID_COL(), PASSWORD_COL(), o2o::query, coral_bridge::AuthenticationCredentialSet::registerCredentials(), ROLE_COL(), python.IdGenerator::schema, SCHEMA_COL(), python.CommonUtils::session, cond::CSScopedSession::start(), AlCaHLTBitMon_QueryRunRegistry::string, USERNAME_COL(), and VERIFICATION_KEY_COL().
bool cond::CredentialStore::selectPermissions | ( | const std::string & | principalName, |
const std::string & | role, | ||
const std::string & | connectionString, | ||
std::vector< Permission > & | destination | ||
) |
Definition at line 1268 of file CredentialStore.cc.
References C_ID_COL(), cond::CSScopedSession::close(), COND_AUTHENTICATION_TABLE(), COND_AUTHORIZATION_TABLE(), COND_CREDENTIAL_TABLE(), CONNECTION_ID_COL(), CONNECTION_LABEL_COL(), cond::CredentialStore::Permission::connectionLabel, cond::CredentialStore::Permission::connectionString, newFWLiteAna::found, P_ID_COL(), PRINCIPAL_ID_COL(), PRINCIPAL_NAME_COL(), cond::CredentialStore::Permission::principalName, o2o::query, cond::CredentialStore::Permission::role, ROLE_COL(), python.IdGenerator::schema, SCHEMA_COL(), python.CommonUtils::session, cond::CSScopedSession::start(), and AlCaHLTBitMon_QueryRunRegistry::string.
bool cond::CredentialStore::setPermission | ( | const std::string & | principal, |
const std::string & | role, | ||
const std::string & | connectionString, | ||
const std::string & | connectionLabel | ||
) |
Definition at line 964 of file CredentialStore.cc.
References cond::PrincipalData::adminKey, cond::Cipher::b64decrypt(), cond::CSScopedSession::close(), cond::CredentialData::connectionKey, newFWLiteAna::found, cond::PrincipalData::id, cond::CredentialData::id, visualization-live-secondInstance_cfg::msg, run_regression::ret, python.IdGenerator::schema, cond::selectConnection(), cond::selectPrincipal(), python.CommonUtils::session, cond::CSScopedSession::start(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::throwException().
|
private |
Definition at line 514 of file CredentialStore.cc.
References AUTH_ID_COL(), AUTH_KEY_COL(), cond::Cipher::b64encrypt(), C_ID_COL(), COND_AUTHORIZATION_TABLE(), idDealer::editor, newFWLiteAna::found, ora::SequenceManager::getNextId(), cond::AuthorizationData::id, GetRecoTauVFromDQM_MC_cff::next, P_ID_COL(), ROLE_COL(), python.IdGenerator::schema, SCHEMA_COL(), cond::selectAuthorization(), SEQUENCE_TABLE_NAME(), and AlCaHLTBitMon_QueryRunRegistry::string.
std::string cond::CredentialStore::setUpForConnectionString | ( | const std::string & | connectionString, |
const std::string & | authPath | ||
) |
Definition at line 694 of file CredentialStore.cc.
References instance, serviceName, and AlCaHLTBitMon_QueryRunRegistry::string.
std::string cond::CredentialStore::setUpForService | ( | const std::string & | serviceName, |
const std::string & | authPath | ||
) |
Sets the initialization parameters.
Definition at line 662 of file CredentialStore.cc.
References cond::Auth::COND_KEY, mergeVDriftHistosByStation::file, cond::DecodingKey::FILE_PATH, contentValuesFiles::fullPath, visualization-live-secondInstance_cfg::msg, cmsHarvester::path, serviceName, AlCaHLTBitMon_QueryRunRegistry::string, and cond::throwException().
|
private |
Definition at line 406 of file CredentialStore.cc.
References cond::PrincipalData::adminKey, cond::Cipher::b64decrypt(), C_ID_COL(), COND_AUTHENTICATION_TABLE(), COND_AUTHORIZATION_TABLE(), COND_CREDENTIAL_TABLE(), CONNECTION_ID_COL(), CONNECTION_KEY_COL(), CONNECTION_LABEL_COL(), newFWLiteAna::found, cond::PrincipalData::id, P_ID_COL(), PASSWORD_COL(), cond::PrincipalData::principalKey, o2o::query, ROLE_COL(), python.IdGenerator::schema, SCHEMA_COL(), cond::selectPrincipal(), AlCaHLTBitMon_QueryRunRegistry::string, cond::persistency::throwException(), USERNAME_COL(), VERIFICATION_KEY_COL(), and cond::PrincipalData::verifKey.
|
private |
Definition at line 400 of file CredentialStore.cc.
bool cond::CredentialStore::unsetPermission | ( | const std::string & | principal, |
const std::string & | role, | ||
const std::string & | connectionString | ||
) |
Definition at line 995 of file CredentialStore.cc.
References cond::CSScopedSession::close(), COND_AUTHORIZATION_TABLE(), idDealer::editor, newFWLiteAna::found, cond::PrincipalData::id, visualization-live-secondInstance_cfg::msg, P_ID_COL(), ROLE_COL(), python.IdGenerator::schema, SCHEMA_COL(), cond::selectPrincipal(), python.CommonUtils::session, cond::CSScopedSession::start(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::throwException().
bool cond::CredentialStore::updateConnection | ( | const std::string & | connectionLabel, |
const std::string & | userName, | ||
const std::string & | password | ||
) |
Definition at line 1027 of file CredentialStore.cc.
References cond::CSScopedSession::close(), python.CommonUtils::session, and cond::CSScopedSession::start().
Referenced by Vispa.Gui.PortConnection.PointToPointConnection::paintEvent(), and Vispa.Gui.PortConnection.PointToPointConnection::updateTargetPoint().
|
private |
Definition at line 557 of file CredentialStore.cc.
References cond::Cipher::b64decrypt(), cond::Cipher::b64encrypt(), COND_CREDENTIAL_TABLE(), CONNECTION_ID_COL(), CONNECTION_KEY_COL(), CONNECTION_LABEL_COL(), cond::CredentialData::connectionKey, idDealer::editor, newFWLiteAna::found, relval_steps::gen(), ora::SequenceManager::getNextId(), cond::CredentialData::id, cond::KeyGenerator::make(), PASSWORD_COL(), python.IdGenerator::schema, cond::selectConnection(), SEQUENCE_TABLE_NAME(), AlCaHLTBitMon_QueryRunRegistry::string, cond::persistency::throwException(), USERNAME_COL(), VERIFICATION_KEY_COL(), and cond::CredentialData::verificationKey.
Referenced by Vispa.Gui.PortConnection.PointToPointConnection::paintEvent(), and Vispa.Gui.PortConnection.PointToPointConnection::updateTargetPoint().
bool cond::CredentialStore::updatePrincipal | ( | const std::string & | principal, |
const std::string & | principalKey, | ||
bool | setAdmin = false |
||
) |
Definition at line 891 of file CredentialStore.cc.
References ADMIN_KEY_COL(), cond::PrincipalData::adminKey, cond::Cipher::b64decrypt(), cond::Cipher::b64encrypt(), cond::CSScopedSession::close(), cond::Auth::COND_ADMIN_ROLE, COND_AUTHENTICATION_TABLE(), cond::Auth::COND_DB_KEY_SIZE, cond::CredentialData::connectionKey, idDealer::editor, newFWLiteAna::found, relval_steps::gen(), ora::SequenceManager::getNextId(), cond::PrincipalData::id, cond::CredentialData::id, cond::KeyGenerator::make(), PRINCIPAL_ID_COL(), PRINCIPAL_KEY_COL(), PRINCIPAL_NAME_COL(), python.IdGenerator::schema, cond::schemaLabelForCredentialStore(), cond::selectConnection(), cond::selectPrincipal(), SEQUENCE_TABLE_NAME(), python.CommonUtils::session, cond::CSScopedSession::start(), AlCaHLTBitMon_QueryRunRegistry::string, cond::throwException(), and VERIFICATION_COL().
|
friend |
Definition at line 144 of file CredentialStore.h.
|
static |
Definition at line 87 of file CredentialStore.h.
|
private |
Definition at line 163 of file CredentialStore.h.
|
private |
Definition at line 172 of file CredentialStore.h.
|
private |
Definition at line 166 of file CredentialStore.h.
|
private |
Definition at line 167 of file CredentialStore.h.
|
private |
Definition at line 170 of file CredentialStore.h.
|
private |
Definition at line 169 of file CredentialStore.h.
|
private |
Definition at line 164 of file CredentialStore.h.