diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-01 17:07:02 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-04 16:05:08 +0200 |
commit | 0d60cd9ba4a5c18b01b6ef996434953071f0576e (patch) | |
tree | e2d96536db33b8e36cfc417e548d0f60b2d1ed28 /test/utils/remote_execution/bazel_action_creator.hpp | |
parent | 217e31bf00c3437658033bd0829f31929f10a103 (diff) | |
download | justbuild-0d60cd9ba4a5c18b01b6ef996434953071f0576e.tar.gz |
Pass Auth::TLS instance to serve and execute clients
Diffstat (limited to 'test/utils/remote_execution/bazel_action_creator.hpp')
-rw-r--r-- | test/utils/remote_execution/bazel_action_creator.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
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 <algorithm> // std::transform, std::copy #include <map> #include <memory> +#include <optional> #include <string> #include <vector> #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<ObjectType::File>(action_data); blobs.emplace_back(action_id, action_data, /*is_exec=*/false); - BazelCasClient cas_client(info->host, info->port); + std::optional<Auth::TLS> auth = {}; + if (Auth::Instance().GetAuthMethod() == AuthMethod::kTLS) { + auth = Auth::TLS::Instance(); + } + + BazelCasClient cas_client(info->host, info->port, auth ? &*auth : nullptr); std::vector<gsl::not_null<BazelBlob const*>> blob_ptrs; blob_ptrs.reserve(blobs.size()); |