Skip to content

Commit dbac10d

Browse files
authored
QC-1289 Possibility to use a token with BKP client (#2558)
Token is expected as an env var to avoid exposing it in QC configuration files. Still, it's not ideal, but I don't think we have a better option at the moment.
1 parent c3d178a commit dbac10d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Framework/src/Bookkeeping.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ void Bookkeeping::init(const std::string& url)
4343
}
4444

4545
try {
46-
mClient = BkpClientFactory::create(url);
46+
if (auto tokenEnv = std::getenv("QC_BKP_CLIENT_TOKEN"); tokenEnv != NULL) {
47+
mClient = BkpClientFactory::create(url, tokenEnv);
48+
} else {
49+
mClient = BkpClientFactory::create(url);
50+
}
4751
} catch (std::runtime_error& error) {
4852
ILOG(Warning, Support) << "Error connecting to Bookkeeping: " << error.what() << ENDM;
4953
return;

doc/Framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ Propagation can be enabled by adding the following key-value pair to Check/Aggre
595595

596596
Using it for Aggregators is discouraged, as the information on which exact Check failed is lost or at least obfuscated.
597597

598-
Also, make sure that the configuration file includes the Bookkeeping URL.
598+
Also, make sure that the configuration file includes the Bookkeeping URL and there is an env var `QC_BKP_CLIENT_TOKEN` with authentication token for setups external to P2.
599599

600600
Check results are converted into Flags, which are documented in [O2/DataFormats/QualityControl](https://github.com/AliceO2Group/AliceO2/tree/dev/DataFormats/QualityControl).
601601
Information about the object validity is preserved, which allows for time-based flagging of good/bad data.

0 commit comments

Comments
 (0)