Skip to content

Commit fe381f8

Browse files
Atlantic777Volodymyr YurchenkojgrosseoTimoWilken
authored
Use JAliEn credentials in CCDB API (#5826)
* Use libjalien to load the certificate and CAs Signed-off-by: Nikola Hardi <nhardi@cern.ch> * Add the credentials manager * JAliEn credentials manager improvements * Enable redirection on upload in CcdbApi * Include clang-format formattig updates * Add new methods to header This should fix compilation errors. * Fix more build errors Co-authored-by: Volodymyr Yurchenko <volodymyr.yurchenko@cern.ch> Co-authored-by: jgrosseo <jgrosseo@cern.ch> Co-authored-by: Timo Wilken <timo.wilken@cern.ch>
1 parent 677912f commit fe381f8

File tree

5 files changed

+330
-2
lines changed

5 files changed

+330
-2
lines changed

CCDB/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ o2_add_library(CCDB
1919
ROOT::Hist
2020
O2::CommonUtils
2121
FairMQ::FairMQ
22+
libjalien::libjalienO2
2223
TARGETVARNAME targetName)
2324

2425
o2_target_root_dictionary(CCDB

CCDB/include/CCDB/CcdbApi.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
#include <TMessage.h>
2626
#include "CCDB/CcdbObjectInfo.h"
2727

28+
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
29+
#include <TJAlienCredentials.h>
30+
#else
31+
class TJAlienCredentials;
32+
#endif
33+
2834
class TFile;
2935
class TGrid;
3036

@@ -277,6 +283,19 @@ class CcdbApi //: public DatabaseInterface
277283
constexpr static const char* CCDBMETA_ENTRY = "ccdb_meta";
278284
constexpr static const char* CCDBOBJECT_ENTRY = "ccdb_object";
279285

286+
/**
287+
* Set curl SSL options. The client still will be able to connect to non-ssl endpoints
288+
* @param curl curl handler
289+
* @return
290+
*/
291+
static void curlSetSSLOptions(CURL* curl);
292+
293+
TObject* retrieve(std::string const& path, std::map<std::string, std::string> const& metadata, long timestamp) const;
294+
295+
TObject* retrieveFromTFile(std::string const& path, std::map<std::string, std::string> const& metadata, long timestamp,
296+
std::map<std::string, std::string>* headers, std::string const& etag,
297+
const std::string& createdNotAfter, const std::string& createdNotBefore) const;
298+
280299
private:
281300
/**
282301
* Initialize in local mode; Objects will be retrieved from snapshot
@@ -382,8 +401,9 @@ class CcdbApi //: public DatabaseInterface
382401
std::string mUrl{};
383402
std::string mSnapshotTopPath{};
384403
bool mInSnapshotMode = false;
385-
mutable TGrid* mAlienInstance = nullptr; // a cached connection to TGrid (needed for Alien locations)
386-
bool mHaveAlienToken = false; // stores if an alien token is available
404+
mutable TGrid* mAlienInstance = nullptr; // a cached connection to TGrid (needed for Alien locations)
405+
bool mHaveAlienToken = false; // stores if an alien token is available
406+
static std::unique_ptr<TJAlienCredentials> mJAlienCredentials; // access JAliEn credentials
387407

388408
ClassDefNV(CcdbApi, 1);
389409
};

0 commit comments

Comments
 (0)