aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-20 10:15:29 +0200
committerStefan Boberg <[email protected]>2021-09-20 10:15:29 +0200
commit09e7fd7ab4c1a67d1add0c7ecf13a693fe4b6710 (patch)
treedb2f91c454d70dba4a81df569daa609ad07cffc2
parentIt's not possible to compile out tests (diff)
parentTry authenticate with Jupiter instance when initializing upstream cache. (diff)
downloadzen-09e7fd7ab4c1a67d1add0c7ecf13a693fe4b6710.tar.xz
zen-09e7fd7ab4c1a67d1add0c7ecf13a693fe4b6710.zip
Merge branch 'main' of https://github.com/EpicGames/zen
-rw-r--r--zenserver/upstream/jupiter.cpp8
-rw-r--r--zenserver/upstream/jupiter.h1
-rw-r--r--zenserver/upstream/upstreamcache.cpp5
3 files changed, 12 insertions, 2 deletions
diff --git a/zenserver/upstream/jupiter.cpp b/zenserver/upstream/jupiter.cpp
index fbd945528..2e74602db 100644
--- a/zenserver/upstream/jupiter.cpp
+++ b/zenserver/upstream/jupiter.cpp
@@ -66,6 +66,14 @@ CloudCacheSession::~CloudCacheSession()
}
CloudCacheResult
+CloudCacheSession::Authenticate()
+{
+ std::string Auth;
+ const bool Success = m_CacheClient->AcquireAccessToken(Auth);
+ return {.Success = Success};
+}
+
+CloudCacheResult
CloudCacheSession::GetDerivedData(std::string_view BucketId, std::string_view Key)
{
std::string Auth;
diff --git a/zenserver/upstream/jupiter.h b/zenserver/upstream/jupiter.h
index 5535ba000..21217387c 100644
--- a/zenserver/upstream/jupiter.h
+++ b/zenserver/upstream/jupiter.h
@@ -61,6 +61,7 @@ public:
CloudCacheSession(CloudCacheClient* OuterClient);
~CloudCacheSession();
+ CloudCacheResult Authenticate();
CloudCacheResult GetDerivedData(std::string_view BucketId, std::string_view Key);
CloudCacheResult GetDerivedData(std::string_view BucketId, const IoHash& Key);
CloudCacheResult GetRef(std::string_view BucketId, const IoHash& Key, ZenContentType RefType);
diff --git a/zenserver/upstream/upstreamcache.cpp b/zenserver/upstream/upstreamcache.cpp
index e235db516..ecd540445 100644
--- a/zenserver/upstream/upstreamcache.cpp
+++ b/zenserver/upstream/upstreamcache.cpp
@@ -108,8 +108,9 @@ namespace detail {
virtual bool Initialize() override
{
- // TODO: Test and authenticate Jupiter client connection
- return !m_Client->ServiceUrl().empty();
+ zen::CloudCacheSession Session(m_Client);
+ const CloudCacheResult Result = Session.Authenticate();
+ return Result.Success;
}
virtual std::string_view DisplayName() const override { return m_DisplayName; }