CondCore
CondDB
plugins
CondDBPyBind11Wrappers.cc
Go to the documentation of this file.
1
#include "
CondCore/CondDB/interface/CredentialStore.h
"
2
#include "
CondCore/CondDB/interface/Auth.h
"
3
//
4
#include <cstdlib>
5
6
namespace
cond
{
7
8
std::pair<std::string, std::string>
getDbCredentials
(
const
std::string
&
connectionString
,
9
bool
updateMode,
10
const
std::string
&
authPath
) {
11
std::string
ap =
authPath
;
12
if
(ap.empty()) {
13
ap =
std::string
(std::getenv(
cond::auth::COND_AUTH_PATH
));
14
}
15
auto
ret
= std::make_pair(
std::string
(
""
),
std::string
(
""
));
16
if
(!ap.empty()) {
17
CredentialStore
credDb;
18
credDb.
setUpForConnectionString
(
connectionString
, ap);
19
std::string
role(
cond::auth::COND_READER_ROLE
);
20
if
(updateMode)
21
role =
cond::auth::COND_WRITER_ROLE
;
22
ret
= credDb.
getUserCredentials
(
connectionString
, role);
23
}
24
return
ret
;
25
}
26
27
}
// namespace cond
28
29
#include <pybind11/pybind11.h>
30
31
namespace
py
= pybind11;
32
33
PYBIND11_MODULE
(pluginCondDBPyBind11Interface,
m
) {
34
m
.def(
"get_db_credentials"
, &
cond::getDbCredentials
,
"Get db credentials for a connection string"
);
35
}
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition:
runTheMatrix.py:373
lumi_dqm_sourceclient-live_cfg.authPath
authPath
Definition:
lumi_dqm_sourceclient-live_cfg.py:33
cond::auth::COND_READER_ROLE
static constexpr const char *const COND_READER_ROLE
Definition:
Auth.h:18
PYBIND11_MODULE
PYBIND11_MODULE(pluginCondDBPyBind11Interface, m)
Definition:
CondDBPyBind11Wrappers.cc:33
multPhiCorr_741_25nsDY_cfi.py
py
Definition:
multPhiCorr_741_25nsDY_cfi.py:12
cond::auth::COND_WRITER_ROLE
static constexpr const char *const COND_WRITER_ROLE
Definition:
Auth.h:17
cond::CredentialStore::setUpForConnectionString
std::string setUpForConnectionString(const std::string &connectionString, const std::string &authPath)
Definition:
CredentialStore.cc:760
visualization-live-secondInstance_cfg.m
m
Definition:
visualization-live-secondInstance_cfg.py:72
cond::CredentialStore
Definition:
CredentialStore.h:78
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
cond
Definition:
plugin.cc:23
cond::CredentialStore::getUserCredentials
std::pair< std::string, std::string > getUserCredentials(const std::string &connectionString, const std::string &role)
Definition:
CredentialStore.cc:1239
cond::getDbCredentials
std::pair< std::string, std::string > getDbCredentials(const std::string &connectionString, bool updateMode, const std::string &authPath)
Definition:
CondDBPyBind11Wrappers.cc:8
CredentialStore.h
cond::auth::COND_AUTH_PATH
static constexpr const char *const COND_AUTH_PATH
Definition:
Auth.h:11
Auth.h
l1RCTOmdsFedVectorProducer_cfi.connectionString
connectionString
Definition:
l1RCTOmdsFedVectorProducer_cfi.py:4
Generated for CMSSW Reference Manual by
1.8.16