6 #include "CoralBase/AttributeList.h" 7 #include "CoralBase/Attribute.h" 8 #include "CoralKernel/Context.h" 9 #include "CoralCommon/URIParser.h" 10 #include "RelationalAccess/AuthenticationCredentials.h" 11 #include "RelationalAccess/IBulkOperation.h" 12 #include "RelationalAccess/IConnection.h" 13 #include "RelationalAccess/ISession.h" 14 #include "RelationalAccess/IRelationalService.h" 15 #include "RelationalAccess/IRelationalDomain.h" 16 #include "RelationalAccess/ITransaction.h" 17 #include "RelationalAccess/ISchema.h" 18 #include "RelationalAccess/ITable.h" 19 #include "RelationalAccess/TableDescription.h" 20 #include "RelationalAccess/ITableDataEditor.h" 21 #include "RelationalAccess/ITablePrivilegeManager.h" 22 #include "RelationalAccess/IQuery.h" 23 #include "RelationalAccess/ICursor.h" 25 #include "RelationalAccess/AuthenticationCredentials.h" 29 #include <boost/filesystem.hpp> 42 for (
std::map< std::pair<std::string,std::string>, coral::AuthenticationCredentials* >::iterator iData =
m_data.begin();
43 iData !=
m_data.end(); ++iData )
59 std::pair<std::string,std::string> connKey( connectionString, role );
60 std::map< std::pair<std::string,std::string>, coral::AuthenticationCredentials* >::iterator iData =
m_data.find( connKey );
61 if( iData ==
m_data.end() ){
62 iData =
m_data.insert( std::make_pair( connKey,
new coral::AuthenticationCredentials(
serviceName ) ) ).first;
64 iData =
m_data.insert( std::make_pair( connKey,
new coral::AuthenticationCredentials(
serviceName ) ) ).first;
65 iData->second->registerItem( itemName, itemValue );
80 std::pair<std::string,std::string> connKey( connectionString, role );
81 std::map< std::pair<std::string,std::string>, coral::AuthenticationCredentials* >::iterator iData =
m_data.find( connKey );
82 if( iData !=
m_data.end() ){
86 iData =
m_data.insert( std::make_pair( connKey,
new coral::AuthenticationCredentials(
serviceName ) ) ).first;
87 iData->second->registerItem( coral::IAuthenticationCredentials::userItem(), userName );
88 iData->second->registerItem( coral::IAuthenticationCredentials::passwordItem(), password );
92 for (
std::map< std::pair<std::string,std::string>, coral::AuthenticationCredentials* >::const_iterator iData = data.
m_data.begin();
93 iData != data.
m_data.end(); ++iData ){
94 registerCredentials( iData->first.first, iData->first.second, iData->second->valueForItem( coral::IAuthenticationCredentials::userItem() ),
95 iData->second->valueForItem( coral::IAuthenticationCredentials::passwordItem() ) );
99 const coral::IAuthenticationCredentials*
105 const coral::IAuthenticationCredentials*
108 const coral::IAuthenticationCredentials* ret =
nullptr;
109 std::pair<std::string,std::string> connKey( connectionString, role );
110 std::map< std::pair<std::string,std::string>, coral::AuthenticationCredentials* >::const_iterator iData =
m_data.find( connKey );
111 if ( iData !=
m_data.end() ){
156 if( !serviceName.empty() ){
164 parser.setURI( connectionString );
166 std::string schemaName = parser.databaseOrSchemaName();
175 m_store.closeSession(
false );
180 m_store.startSuperSession( connectionString, userName, password );
183 m_store.startSession( readOnly );
186 m_store.closeSession();
209 coral::AttributeList readBuff;
214 coral::AttributeList whereData;
218 query->defineOutput(readBuff);
223 query->setCondition( whereClause, whereData );
224 coral::ICursor& cursor =
query->execute();
226 if ( cursor.next() ) {
228 const coral::AttributeList& row = cursor.currentRow();
256 coral::AttributeList readBuff;
262 coral::AttributeList whereData;
266 query->defineOutput(readBuff);
272 query->setCondition( whereClause, whereData );
273 coral::ICursor& cursor =
query->execute();
275 if ( cursor.next() ) {
276 const coral::AttributeList& row = cursor.currentRow();
303 coral::AttributeList readBuff;
307 coral::AttributeList whereData;
311 whereData[
P_ID_COL ].data<
int>() = principalId;
314 std::stringstream whereClause;
318 query->defineOutput(readBuff);
322 query->setCondition( whereClause.str(), whereData );
323 coral::ICursor& cursor =
query->execute();
325 if ( cursor.next() ) {
326 const coral::AttributeList& row = cursor.currentRow();
340 query->limitReturnedRows( 1, 0 );
343 query->setForUpdate();
345 coral::AttributeList rowData;
347 rowData.begin()->data<
std::string >() = sequenceName;
348 query->setCondition( whereClause, rowData );
349 coral::ICursor& cursor =
query->execute();
350 if ( cursor.next() ) {
351 value = cursor.currentRow().begin()->data<
int>()+1;
357 coral::AttributeList updateData;
362 coral::AttributeList::iterator iAttribute = updateData.begin();
365 iAttribute->data<
int >() = value;
366 schema.tableHandle(
SEQUENCE_TABLE_NAME ).dataEditor().updateRows( setClause,whClause,updateData );
383 int principalId = princData.
id;
388 coral::AttributeList updateData;
397 std::stringstream setClause;
402 editor.updateRows( setClause.str(),whereClause, updateData );
405 principalKey = adminKey;
414 coral::AttributeList authData;
415 editor0.rowBuffer(authData);
421 editor0.insertRow( authData );
424 return std::make_pair(principalId,principalKey);
441 coral::AttributeList updateData;
446 updateData[
C_ID_COL ].data<
int>() = connectionId;
450 editor.updateRows( setCl,whereCl, updateData );
456 coral::AttributeList insertData;
464 insertData[
P_ID_COL ].data<
int>() = principalId;
468 insertData[
C_ID_COL ].data<
int>() = connectionId;
469 editor.insertRow( insertData );
482 int connId = credsData.
id;
492 if( verificationKey != connectionLabel ){
493 throwException(
"Decoding of connection key failed.",
"CredentialStore::updateConnection");
499 coral::AttributeList updateData;
506 std::stringstream setCl;
510 editor.updateRows( setCl.str(),whereCl, updateData );
525 coral::AttributeList insertData;
538 editor.insertRow( insertData );
541 return std::make_pair( connId, connectionKey );
550 if( m_session.get() ){
551 if(m_session->transaction().isActive()){
553 m_session->transaction().commit();
555 m_session->transaction().rollback();
558 m_session->endUserSession();
561 if( m_connection.get() ){
562 m_connection->disconnect();
564 m_connection.reset();
568 coral::IHandle<coral::IRelationalService> relationalService =
coral::Context::instance().query<coral::IRelationalService>();
569 if ( ! relationalService.isValid() ){
573 coral::IRelationalDomain& domain = relationalService->domainForConnection( connectionString );
574 std::pair<std::string,std::string> connTokens = domain.decodeUserConnectionString( connectionString );
575 m_connection.reset( domain.newConnection( connTokens.first ) );
576 m_connection->connect();
584 coral::AccessMode
accessMode = coral::ReadOnly;
585 if( !readMode ) accessMode = coral::Update;
586 m_session.reset( m_connection->newSession( schemaName, accessMode) );
587 m_session->startUserSession( userName, password );
589 m_session->transaction().start( readMode );
595 std::pair<std::string,std::string> connTokens = openConnection( connectionString );
596 openSession( connTokens.second, userName, password,
false );
602 throwException(
"The credential store has not been initialized.",
"cond::CredentialStore::openConnection" );
604 const std::string& storeConnectionString = m_serviceData->connectionString;
606 std::pair<std::string,std::string> connTokens = openConnection( storeConnectionString );
608 const std::string& userName = m_serviceData->userName;
609 const std::string& password = m_serviceData->password;
611 openSession( connTokens.second, userName, password,
true );
613 coral::ISchema&
schema = m_session->nominalSchema();
617 throwException(
"Credential database does not exists in \""+storeConnectionString+
"\"",
"CredentialStore::startSession");
620 const std::string& principalName = m_key.principalName();
623 if( !
selectPrincipal( m_session->nominalSchema(), principalName, princData ) ){
625 "CredentialStore::startSession");
629 if( verifStr != principalName ){
631 "CredentialStore::startSession");
634 m_principalId = princData.
id;
635 m_principalKey = cipher0.b64decrypt( princData.
principalKey );
641 if( adminKey != m_principalKey ){
643 throwException(
"Provided credentials does not allow admin operation.",
644 "CredentialStore::openSession");
648 std::unique_ptr<coral::IQuery>
query(schema.newQuery());
651 coral::AttributeList readBuff;
657 coral::AttributeList whereData;
661 whereData[
P_ID_COL ].data<
int>() = m_principalId;
664 std::stringstream whereClause;
669 query->defineOutput(readBuff);
675 query->setCondition( whereClause.str(), whereData );
676 coral::ICursor& cursor =
query->execute();
680 if ( cursor.next() ) {
681 const coral::AttributeList& row = cursor.currentRow();
689 if( cipher1.
b64decrypt( verificationKey ) != connLabel ){
690 throwException(
"Could not decrypt credentials.Provided key is invalid.",
691 "CredentialStore::startSession");
693 writeUserName = cipher1.
b64decrypt( encryptedUserName );
694 writePassword = cipher1.
b64decrypt( encryptedPassword );
698 throwException(
"Provided credentials are invalid for write access.",
699 "CredentialStore::openSession");
701 m_session->transaction().commit();
702 m_session->endUserSession();
703 openSession( connTokens.second, writeUserName, writePassword,
false );
725 if( serviceName.empty() ){
726 throwException(
"Service name has not been provided.",
"cond::CredentialStore::setUpConnection" );
731 if( authPath.empty() ){
732 throwException(
"The authentication Path has not been provided.",
"cond::CredentialStore::setUpForService" );
735 if(!boost::filesystem::exists(authPath) || !boost::filesystem::is_directory( authPath )){
736 throwException(
"Authentication Path is invalid.",
"cond::CredentialStore::setUpForService" );
743 std::map< std::string, auth::ServiceCredentials >::const_iterator iK =
m_key.
services().find( serviceName );
746 msg +=
"Service \""+serviceName+
"\" can't be open with the current key.";
757 coral::IHandle<coral::IRelationalService> relationalService =
coral::Context::instance().query<coral::IRelationalService>();
758 if ( ! relationalService.isValid() ){
762 coral::IRelationalDomain& domain = relationalService->domainForConnection( connectionString );
763 std::pair<std::string,std::string> connTokens = domain.decodeUserConnectionString( connectionString );
770 coral::AttributeList insertData;
773 coral::AttributeList::iterator iAttribute = insertData.begin();
776 iAttribute->data<
int >() = -1;
783 session.
startSuper( connectionString, userName, password );
787 throwException(
"Credential database, already exists.",
"CredentialStore::create");
790 coral::TableDescription dseq;
793 dseq.insertColumn(
SEQUENCE_NAME_COL, coral::AttributeSpecification::typeNameForType<std::string>() );
795 dseq.insertColumn(
SEQUENCE_VALUE_COL,coral::AttributeSpecification::typeNameForType<int>() );
798 schema.createTable( dseq );
800 int columnSize = 2000;
805 coral::TableDescription descr0;
807 descr0.insertColumn(
PRINCIPAL_ID_COL, coral::AttributeSpecification::typeNameForType<int>());
808 descr0.insertColumn(
PRINCIPAL_NAME_COL, coral::AttributeSpecification::typeNameForType<std::string>(),columnSize,
false);
809 descr0.insertColumn(
VERIFICATION_COL, coral::AttributeSpecification::typeNameForType<std::string>(),columnSize,
false);
810 descr0.insertColumn(
PRINCIPAL_KEY_COL, coral::AttributeSpecification::typeNameForType<std::string>(),columnSize,
false);
811 descr0.insertColumn(
ADMIN_KEY_COL, coral::AttributeSpecification::typeNameForType<std::string>(),columnSize,
false);
817 std::vector<std::string> columnsUnique;
819 descr0.setUniqueConstraint( columnsUnique );
820 std::vector<std::string> columnsForIndex;
822 descr0.setPrimaryKey( columnsForIndex );
823 schema.createTable( descr0 );
827 coral::TableDescription descr1;
829 descr1.insertColumn(
AUTH_ID_COL, coral::AttributeSpecification::typeNameForType<int>());
830 descr1.insertColumn(
P_ID_COL, coral::AttributeSpecification::typeNameForType<int>());
831 descr1.insertColumn(
ROLE_COL, coral::AttributeSpecification::typeNameForType<std::string>(),columnSize,
false);
832 descr1.insertColumn(
SCHEMA_COL, coral::AttributeSpecification::typeNameForType<std::string>(),columnSize,
false);
833 descr1.insertColumn(
AUTH_KEY_COL, coral::AttributeSpecification::typeNameForType<std::string>(),columnSize,
false);
834 descr1.insertColumn(
C_ID_COL, coral::AttributeSpecification::typeNameForType<int>());
836 descr1.setNotNullConstraint(
P_ID_COL );
837 descr1.setNotNullConstraint(
ROLE_COL );
840 descr1.setNotNullConstraint(
C_ID_COL );
841 columnsUnique.clear();
845 descr1.setUniqueConstraint( columnsUnique );
846 columnsForIndex.clear();
848 descr1.setPrimaryKey( columnsForIndex );
849 schema.createTable( descr1 );
853 coral::TableDescription descr2;
855 descr2.insertColumn(
CONNECTION_ID_COL, coral::AttributeSpecification::typeNameForType<int>());
856 descr2.insertColumn(
CONNECTION_LABEL_COL, coral::AttributeSpecification::typeNameForType<std::string>(),columnSize,
false);
857 descr2.insertColumn(
USERNAME_COL, coral::AttributeSpecification::typeNameForType<std::string>(),columnSize,
false);
858 descr2.insertColumn(
PASSWORD_COL, coral::AttributeSpecification::typeNameForType<std::string>(),columnSize,
false);
859 descr2.insertColumn(
VERIFICATION_KEY_COL, coral::AttributeSpecification::typeNameForType<std::string>(),columnSize,
false);
860 descr2.insertColumn(
CONNECTION_KEY_COL, coral::AttributeSpecification::typeNameForType<std::string>(),columnSize,
false);
867 columnsUnique.clear();
869 descr2.setUniqueConstraint( columnsUnique );
870 columnsForIndex.clear();
872 descr2.setPrimaryKey( columnsForIndex );
873 schema.createTable( descr2 );
895 session.
startSuper( connectionString, userName, password );
908 throwException(
"The credential store has not been initialized.",
"cond::CredentialStore::installAdmin" );
913 session.
startSuper( connectionString, userName, password );
921 msg += principalName +
"\" has not been found.";
1024 session.
start(
false );
1029 int princId = princData.first;
1032 std::vector<Permission> permissions;
1034 throwException(
"The current operating user is not admin user on the underlying Credential Store.",
"CredentialStore::updatePrincipal");
1036 std::string connLabel = permissions.front().connectionLabel;
1039 throwException(
"Credential Store connection has not been defined.",
"CredentialStore::updatePrincipal");
1053 session.
start(
false );
1061 std::string msg =
"Principal \"" + principal +
"\" does not exist in the database.";
1069 std::string msg =
"Connection named \"" + connectionLabel +
"\" does not exist in the database.";
1083 session.
start(
false );
1090 std::string msg =
"Principal \"" + principal +
"\" does not exist in the database.";
1095 coral::AttributeList deleteData;
1096 deleteData.extend<
int>(
P_ID_COL );
1099 deleteData[
P_ID_COL ].data<
int>() = princData.
id;
1102 std::stringstream whereClause;
1106 editor.deleteRows( whereClause.str(), deleteData );
1115 session.
start(
false );
1127 session.
start(
false );
1134 std::string msg =
"Principal \"" + principal +
"\" does not exist in the database.";
1140 coral::AttributeList deleteData0;
1141 deleteData0.extend<
int>(
P_ID_COL );
1142 deleteData0[
P_ID_COL ].data<
int>() = princData.
id;
1144 editor0.deleteRows( whereClause0 , deleteData0 );
1148 coral::AttributeList deleteData1;
1152 editor1.deleteRows( whereClause1 , deleteData1 );
1161 session.
start(
false );
1168 std::string msg =
"Connection named \"" + connectionLabel +
"\" does not exist in the database.";
1174 coral::AttributeList deleteData0;
1175 deleteData0.extend<
int>(
C_ID_COL );
1176 deleteData0[
C_ID_COL ].data<
int>() = credsData.
id;
1178 editor0.deleteRows( whereClause0 , deleteData0 );
1182 coral::AttributeList deleteData1;
1186 editor1.deleteRows( whereClause1 , deleteData1 );
1195 session.
start(
true );
1200 std::unique_ptr<coral::IQuery>
query(schema.newQuery());
1203 coral::AttributeList readBuff;
1211 coral::AttributeList whereData;
1214 std::stringstream whereClause;
1217 query->defineOutput(readBuff);
1225 query->setCondition( whereClause.str(), whereData );
1226 coral::ICursor& cursor =
query->execute();
1227 while ( cursor.next() ) {
1228 const coral::AttributeList& row = cursor.currentRow();
1238 if( connCipher.
b64decrypt( encryptedLabel ) == connectionLabel ){
1248 bool forceUpdateConnection ){
1250 session.
start(
false );
1257 std::string msg =
"Principal \"" + principal +
"\" does not exist in the database.";
1261 bool imported =
false;
1265 const std::map< std::pair<std::string,std::string>, coral::AuthenticationCredentials* >& creds = dataSource.
data();
1266 for(
std::map< std::pair<std::string,std::string>, coral::AuthenticationCredentials* >::const_iterator iConn = creds.begin(); iConn != creds.end(); ++iConn ){
1267 const std::string& connectionString = iConn->first.first;
1269 parser.setURI( connectionString );
1272 std::string userName = iConn->second->valueForItem( coral::IAuthenticationCredentials::userItem() );
1273 std::string password = iConn->second->valueForItem( coral::IAuthenticationCredentials::passwordItem());
1278 setPermissionData( schema, princData.
id, princKey, role, connectionString, conn.first, conn.second );
1288 session.
start(
true );
1292 coral::AttributeList readBuff;
1294 query->defineOutput(readBuff);
1296 coral::ICursor& cursor =
query->execute();
1298 while ( cursor.next() ) {
1300 const coral::AttributeList& row = cursor.currentRow();
1310 session.
start(
true );
1314 coral::AttributeList readBuff;
1320 query->defineOutput(readBuff);
1326 coral::ICursor& cursor =
query->execute();
1329 while ( cursor.next() ) {
1332 const coral::AttributeList& row = cursor.currentRow();
1339 if( verif == connLabel ){
1342 userName = cipher1.
b64decrypt( encryptedUserName );
1343 password = cipher1.
b64decrypt( encryptedPassword );
1345 destination.insert( std::make_pair( connLabel, std::make_pair( userName, password ) ) );
1357 session.
start(
true );
1359 std::unique_ptr<coral::IQuery>
query(schema.newQuery());
1363 coral::AttributeList readBuff;
1368 coral::AttributeList whereData;
1369 std::stringstream whereClause;
1372 if( !principalName.empty() ){
1377 if( !role.empty() ){
1382 if( !connectionString.empty() ){
1388 query->defineOutput(readBuff);
1393 query->setCondition( whereClause.str(), whereData );
1397 coral::ICursor& cursor =
query->execute();
1399 while ( cursor.next() ) {
1400 const coral::AttributeList& row = cursor.currentRow();
1401 destination.resize( destination.size()+1 );
1415 session.
start(
true );
1417 std::unique_ptr<coral::IQuery>
query(schema.newQuery());
1420 coral::AttributeList readBuff;
1428 coral::AttributeList whereData;
1429 std::stringstream whereClause;
1432 query->defineOutput(readBuff);
1440 query->setCondition( whereClause.str(), whereData );
1441 coral::ICursor& cursor =
query->execute();
1444 while ( cursor.next() ) {
1445 const coral::AttributeList& row = cursor.currentRow();
1456 if( verifKey == connectionLabel ){
1459 userName = cipher1.
b64decrypt( encryptedUserName );
1460 password = cipher1.
b64decrypt( encryptedPassword );
CSScopedSession(CredentialStore &store)
const std::string & keyPrincipalName()
std::pair< int, std::string > updatePrincipalData(coral::ISchema &schema, const std::string &authenticationKey, const std::string &principalName, const std::string &adminKey, bool init=false)
std::map< std::pair< std::string, std::string >, coral::AuthenticationCredentials * > m_data
credentials for the specific roles
void import(const AuthenticationCredentialSet &data)
static const std::string SEQUENCE_VALUE_COL("VALUE")
std::pair< int, std::string > updateConnectionData(coral::ISchema &schema, const std::string &adminKey, const std::string &connectionLabel, const std::string &userName, const std::string &password, bool forceUpdate)
bool updatePrincipal(const std::string &principal, const std::string &principalKey, bool setAdmin=false)
size_t init(const std::string &keyFileName, const std::string &password, bool readMode=true)
CredentialStore()
Standard Constructor.
static const std::string ROLE_COL("C_ROLE")
std::string m_principalKey
virtual ~AuthenticationCredentialSet()
Destructor.
static PFTauRenderPlugin instance
bool removeConnection(const std::string &connectionLabel)
void openSession(const std::string &schemaName, const std::string &userName, const std::string &password, bool readMode)
const std::map< std::string, ServiceCredentials > & services() const
bool resetAdmin(const std::string &userName, const std::string &password)
static const std::string SCHEMA_COL("C_SCHEMA")
AuthenticationCredentialSet()
Constructor.
bool listConnections(std::map< std::string, std::pair< std::string, std::string > > &destination)
bool getNextSequenceValue(coral::ISchema &schema, const std::string &sequenceName, int &value)
void start(bool readOnly=true)
static const std::string COND_AUTHENTICATION_TABLE("COND_AUTHENTICATION")
static const std::string SEQUENCE_TABLE_NAME("COND_CREDENTIAL_SEQUENCE")
static const std::string COND_AUTHORIZATION_TABLE("COND_AUTHORIZATION")
std::string m_serviceName
void startSuper(const std::string &connectionString, const std::string &userName, const std::string &password)
static const std::string serviceName
CredentialStore & m_store
void throwException(const std::string &message, const std::string &methodName)
static const std::string PASSWORD_COL("CRED5")
def query(query_str, verbose=False)
std::string connectionString
std::string principalName
static const std::string COND_CREDENTIAL_TABLE("COND_CREDENTIAL")
void closeSession(bool commit=true)
static const std::string CONNECTION_KEY_COL("CRED7")
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
static const std::string ADMIN_KEY_COL("CRED2")
std::string connectionKey
static const std::string VERIFICATION_KEY_COL("CRED6")
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)
static constexpr const char *const COND_ADMIN_ROLE
bool exportAll(coral_bridge::AuthenticationCredentialSet &data)
std::string schemaLabel(const std::string &serviceName, const std::string &userName)
static constexpr unsigned int COND_DB_KEY_SIZE
bool listPrincipals(std::vector< std::string > &destination)
bool selectConnection(coral::ISchema &schema, const std::string &connectionLabel, CredentialData &destination)
std::string setUpForConnectionString(const std::string &connectionString, const std::string &authPath)
static const std::string VERIFICATION_COL("CRED0")
static const std::string SEQUENCE_NAME_COL("NAME")
const std::string & principalName() const
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
static const std::string USERNAME_COL("CRED4")
def gen(fragment, howMuch)
Production test section ####.
bool selectPrincipal(coral::ISchema &schema, const std::string &principal, PrincipalData &destination)
bool setPermission(const std::string &principal, const std::string &role, const std::string &connectionString, const std::string &connectionLabel)
virtual ~CredentialStore()
Standard Destructor.
std::string schemaLabelForCredentialStore(const std::string &connectionString)
bool selectForUser(coral_bridge::AuthenticationCredentialSet &destinationData)
static const std::string CONNECTION_ID_COL("CONN_ID")
bool selectAuthorization(coral::ISchema &schema, int principalId, const std::string &role, const std::string &connectionString, AuthorizationData &destination)
bool removePrincipal(const std::string &principal)
void startSuperSession(const std::string &connectionString, const std::string &userName, const std::string &password)
static const std::string PRINCIPAL_ID_COL("P_ID")
std::string make(size_t keySize)
bool selectPermissions(const std::string &principalName, const std::string &role, const std::string &connectionString, std::vector< Permission > &destination)
std::string b64encrypt(const std::string &input)
std::shared_ptr< coral::ISession > m_session
static const std::string AUTH_ID_COL("AUTH_ID")
void registerCredentials(const std::string &connectionString, const std::string &userName, const std::string &password)
const std::string DEFAULT_DATA_SOURCE("Cond_Default_Authentication")
std::pair< std::string, std::string > openConnection(const std::string &connectionString)
char data[epos_bytes_allocation]
const coral::IAuthenticationCredentials * get(const std::string &connectionString) const
void addSequence(coral::ISchema &schema, const std::string &name)
bool drop(const std::string &connectionString, const std::string &userName, const std::string &password)
static const std::string PRINCIPAL_KEY_COL("CRED1")
std::string verificationKey
std::string connectionLabel
static const std::string P_ID_COL("P_ID")
static constexpr const char *const FILE_PATH
const std::string & principalKey() const
const auth::ServiceCredentials * m_serviceData
static const std::string CONNECTION_LABEL_COL("CONN_LABEL")
void throwException(const std::string &message, const std::string &methodName)
bool unsetPermission(const std::string &principal, const std::string &role, const std::string &connectionString)
static const std::string C_ID_COL("C_ID")
static constexpr const char *const COND_KEY
std::string b64decrypt(const std::string &input)
bool setPermissionData(coral::ISchema &schema, int principalId, const std::string &principalKey, const std::string &role, const std::string &connectionString, int connectionId, const std::string &connectionKey)
static const std::string AUTH_KEY_COL("CRED3")
static constexpr const char *const COND_DEFAULT_ROLE
static const std::string PRINCIPAL_NAME_COL("P_NAME")