From 0d60cd9ba4a5c18b01b6ef996434953071f0576e Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 1 Jul 2024 17:07:02 +0200 Subject: Pass Auth::TLS instance to serve and execute clients --- test/utils/remote_execution/bazel_action_creator.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/utils/remote_execution/bazel_action_creator.hpp') diff --git a/test/utils/remote_execution/bazel_action_creator.hpp b/test/utils/remote_execution/bazel_action_creator.hpp index a0423d69..b35b2325 100644 --- a/test/utils/remote_execution/bazel_action_creator.hpp +++ b/test/utils/remote_execution/bazel_action_creator.hpp @@ -18,10 +18,12 @@ #include // std::transform, std::copy #include #include +#include #include #include #include "gsl/gsl" +#include "src/buildtool/auth/authentication.hpp" #include "src/buildtool/common/bazel_types.hpp" #include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp" @@ -80,7 +82,12 @@ auto action_id = ArtifactDigest::Create(action_data); blobs.emplace_back(action_id, action_data, /*is_exec=*/false); - BazelCasClient cas_client(info->host, info->port); + std::optional auth = {}; + if (Auth::Instance().GetAuthMethod() == AuthMethod::kTLS) { + auth = Auth::TLS::Instance(); + } + + BazelCasClient cas_client(info->host, info->port, auth ? &*auth : nullptr); std::vector> blob_ptrs; blob_ptrs.reserve(blobs.size()); -- cgit v1.2.3