diff options
Diffstat (limited to 'src/buildtool/execution_api')
6 files changed, 13 insertions, 3 deletions
diff --git a/src/buildtool/execution_api/common/TARGETS b/src/buildtool/execution_api/common/TARGETS index a2063a70..b355641b 100644 --- a/src/buildtool/execution_api/common/TARGETS +++ b/src/buildtool/execution_api/common/TARGETS @@ -40,6 +40,7 @@ , "stage": ["src", "buildtool", "execution_api", "common"] , "deps": [ "common" + , ["src/buildtool/auth", "auth"] , ["src/buildtool/common", "config"] , ["src/buildtool/common/remote", "remote_common"] ] diff --git a/src/buildtool/execution_api/common/api_bundle.cpp b/src/buildtool/execution_api/common/api_bundle.cpp index 488fc25d..17e3d3af 100644 --- a/src/buildtool/execution_api/common/api_bundle.cpp +++ b/src/buildtool/execution_api/common/api_bundle.cpp @@ -19,8 +19,10 @@ #include "src/buildtool/execution_api/remote/bazel/bazel_api.hpp" ApiBundle::ApiBundle(RepositoryConfig const* repo_config, + Auth::TLS const* authentication, std::optional<ServerAddress> const& remote_address) - : local{std::make_shared<LocalApi>(repo_config)}, + : local{std::make_shared<LocalApi>(repo_config)}, // needed by remote + auth{authentication}, // needed by remote remote{CreateRemote(remote_address)} {} auto ApiBundle::CreateRemote(std::optional<ServerAddress> const& address) const @@ -29,7 +31,7 @@ auto ApiBundle::CreateRemote(std::optional<ServerAddress> const& address) const ExecutionConfiguration config; config.skip_cache_lookup = false; return std::make_shared<BazelApi>( - "remote-execution", address->host, address->port, config); + "remote-execution", address->host, address->port, auth, config); } return local; } diff --git a/src/buildtool/execution_api/common/api_bundle.hpp b/src/buildtool/execution_api/common/api_bundle.hpp index 53e59de2..72fdb687 100644 --- a/src/buildtool/execution_api/common/api_bundle.hpp +++ b/src/buildtool/execution_api/common/api_bundle.hpp @@ -19,6 +19,7 @@ #include <optional> #include "gsl/gsl" +#include "src/buildtool/auth/authentication.hpp" #include "src/buildtool/common/remote/remote_common.hpp" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/execution_api/common/execution_api.hpp" @@ -28,12 +29,14 @@ /// exactly the same instance that local api is (&*remote == & *local). struct ApiBundle final { explicit ApiBundle(RepositoryConfig const* repo_config, + Auth::TLS const* authentication, std::optional<ServerAddress> const& remote_address); [[nodiscard]] auto CreateRemote(std::optional<ServerAddress> const& address) const -> gsl::not_null<IExecutionApi::Ptr>; - gsl::not_null<IExecutionApi::Ptr> const local; + gsl::not_null<IExecutionApi::Ptr> const local; // needed by remote + Auth::TLS const* auth; // needed by remote gsl::not_null<IExecutionApi::Ptr> const remote; }; diff --git a/src/buildtool/execution_api/remote/TARGETS b/src/buildtool/execution_api/remote/TARGETS index f38990ac..466975ec 100644 --- a/src/buildtool/execution_api/remote/TARGETS +++ b/src/buildtool/execution_api/remote/TARGETS @@ -65,6 +65,7 @@ , "srcs": ["bazel/bazel_api.cpp"] , "deps": [ "config" + , ["src/buildtool/auth", "auth"] , ["src/buildtool/execution_api/common", "common"] , ["src/buildtool/execution_api/bazel_msg", "bazel_msg"] , ["@", "gsl", "", "gsl"] diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp index aea38ab4..dfd5dd6e 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp @@ -189,6 +189,7 @@ namespace { BazelApi::BazelApi(std::string const& instance_name, std::string const& host, Port port, + [[maybe_unused]] Auth::TLS const* auth, ExecutionConfiguration const& exec_config) noexcept { network_ = std::make_shared<BazelNetwork>(instance_name, host, port, exec_config); diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.hpp b/src/buildtool/execution_api/remote/bazel/bazel_api.hpp index 289cb19c..e87e6159 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_api.hpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_api.hpp @@ -24,6 +24,7 @@ #include <vector> #include "gsl/gsl" +#include "src/buildtool/auth/authentication.hpp" #include "src/buildtool/common/artifact.hpp" #include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/common/remote/port.hpp" @@ -42,6 +43,7 @@ class BazelApi final : public IExecutionApi { BazelApi(std::string const& instance_name, std::string const& host, Port port, + Auth::TLS const* auth, ExecutionConfiguration const& exec_config) noexcept; BazelApi(BazelApi const&) = delete; BazelApi(BazelApi&& other) noexcept; |