summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/fetch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/other_tools/just_mr/fetch.cpp')
-rw-r--r--src/other_tools/just_mr/fetch.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/other_tools/just_mr/fetch.cpp b/src/other_tools/just_mr/fetch.cpp
index d0018ba4..11ae3a01 100644
--- a/src/other_tools/just_mr/fetch.cpp
+++ b/src/other_tools/just_mr/fetch.cpp
@@ -20,6 +20,7 @@
#include "fmt/core.h"
#include "nlohmann/json.hpp"
+#include "src/buildtool/auth/authentication.hpp"
#include "src/buildtool/execution_api/common/api_bundle.hpp"
#include "src/buildtool/execution_api/common/execution_api.hpp"
#include "src/buildtool/logging/log_level.hpp"
@@ -394,16 +395,25 @@ auto MultiRepoFetch(std::shared_ptr<Configuration> const& config,
// setup the APIs for archive fetches; only happens if in native mode
JustMR::Utils::SetupRemoteConfig(common_args.remote_execution_address,
- common_args.remote_serve_address,
- auth_args);
+ common_args.remote_serve_address);
+
+ // setup authentication
+ JustMR::Utils::SetupAuthConfig(auth_args);
+ std::optional<Auth::TLS> auth = {};
+ if (Auth::Instance().GetAuthMethod() == AuthMethod::kTLS) {
+ auth = Auth::TLS::Instance();
+ }
+
+ ApiBundle const apis{/*repo_config=*/nullptr,
+ auth ? &*auth : nullptr,
+ RemoteExecutionConfig::RemoteAddress()};
- ApiBundle const apis{nullptr, RemoteExecutionConfig::RemoteAddress()};
bool const has_remote_api =
apis.local != apis.remote and not common_args.compatible;
// setup the API for serving roots
- auto serve_config = JustMR::Utils::CreateServeConfig(
- common_args.remote_serve_address, auth_args);
+ auto serve_config =
+ JustMR::Utils::CreateServeConfig(common_args.remote_serve_address);
if (not serve_config) {
return kExitConfigError;
}