3 #include "RelationalAccess/AuthenticationCredentials.h" 4 #include "RelationalAccess/AuthenticationServiceException.h" 8 #include "RelationalAccess/AuthenticationServiceException.h" 9 #include "CoralKernel/IPropertyManager.h" 10 #include "CoralKernel/Property.h" 11 #include "CoralKernel/Context.h" 18 #include <boost/filesystem.hpp> 19 #include <boost/version.hpp> 20 #include <boost/bind.hpp> 22 #include "CoralBase/MessageStream.h" 26 :
coral::
Service(key), m_authenticationPath(
""), m_db(), m_cache(), m_callbackID(0) {
27 boost::function1<void, std::string> cb(boost::bind(
30 coral::Property* pm =
dynamic_cast<coral::Property*
>(
46 const coral::IAuthenticationCredentials&
49 const coral::IAuthenticationCredentials* creds =
m_cache.
get(connectionString);
52 coral::MessageStream
log(
"cond::RelationalAuthenticationService::credentials");
53 log <<
coral::Debug <<
"Connecting to the credential repository in \"" << credsStoreConn <<
"\" with principal \"" 60 msg += connectionString +
"\"";
61 msg +=
" with role \"COND_DEFAULT_ROLE\" is not available for ";
63 cond::throwException(msg,
"cond::RelationalAuthenticationService::RelationalAuthenticationService::credentials");
68 const coral::IAuthenticationCredentials&
71 const coral::IAuthenticationCredentials* creds =
m_cache.
get(connectionString, role);
74 coral::MessageStream
log(
"cond::RelationalAuthenticationService::credentials");
75 log <<
coral::Debug <<
"Connecting to the credential repository in \"" << credsStoreConn <<
"\" with principal \"" 82 msg += connectionString +
"\"";
83 msg +=
" with role \"" + role +
"\" is not available for ";
85 cond::throwException(msg,
"cond::RelationalAuthenticationService::RelationalAuthenticationService::credentials");
91 "COND/Services/RelationalAuthenticationService");
const std::string & keyPrincipalName()
coral::Property::CallbackID m_callbackID
static PFTauRenderPlugin instance
coral_bridge::AuthenticationCredentialSet m_cache
std::string m_authenticationPath
The input file with the data.
static constexpr const char *const COND_AUTH_PATH_PROPERTY
void throwException(const std::string &message, const std::string &methodName)
#define DEFINE_CORALSERVICE(type, name)
void setAuthenticationPath(const std::string &inputPath)
Sets the input file name.
std::string setUpForConnectionString(const std::string &connectionString, const std::string &authPath)
bool selectForUser(coral_bridge::AuthenticationCredentialSet &destinationData)
~RelationalAuthenticationService() override
Standard Destructor.
const coral::IAuthenticationCredentials * get(const std::string &connectionString) const
CredentialStore m_db
The service providing the authentication data.
const coral::IAuthenticationCredentials & credentials(const std::string &connectionString) const override
RelationalAuthenticationService(const std::string &name)
Standard Constructor.