summaryrefslogtreecommitdiff
path: root/src/buildtool/serve_api/remote
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/serve_api/remote')
-rw-r--r--src/buildtool/serve_api/remote/TARGETS6
-rw-r--r--src/buildtool/serve_api/remote/configuration_client.hpp6
-rw-r--r--src/buildtool/serve_api/remote/serve_api.hpp4
-rw-r--r--src/buildtool/serve_api/remote/source_tree_client.cpp5
-rw-r--r--src/buildtool/serve_api/remote/source_tree_client.hpp3
-rw-r--r--src/buildtool/serve_api/remote/target_client.cpp2
6 files changed, 16 insertions, 10 deletions
diff --git a/src/buildtool/serve_api/remote/TARGETS b/src/buildtool/serve_api/remote/TARGETS
index e6f03424..4af6387f 100644
--- a/src/buildtool/serve_api/remote/TARGETS
+++ b/src/buildtool/serve_api/remote/TARGETS
@@ -16,7 +16,8 @@
, "hdrs": ["source_tree_client.hpp"]
, "srcs": ["source_tree_client.cpp"]
, "deps":
- [ ["src/buildtool/auth", "auth"]
+ [ ["@", "gsl", "", "gsl"]
+ , ["src/buildtool/auth", "auth"]
, ["src/buildtool/common/remote", "port"]
, ["src/buildtool/file_system", "git_types"]
, ["src/buildtool/file_system/symlinks_map", "pragma_special"]
@@ -80,7 +81,8 @@
, "hdrs": ["configuration_client.hpp"]
, "srcs": ["configuration_client.cpp"]
, "deps":
- [ ["src/buildtool/auth", "auth"]
+ [ ["@", "gsl", "", "gsl"]
+ , ["src/buildtool/auth", "auth"]
, ["src/buildtool/common/remote", "port"]
, ["src/buildtool/logging", "logging"]
, ["src/buildtool/common/remote", "client_common"]
diff --git a/src/buildtool/serve_api/remote/configuration_client.hpp b/src/buildtool/serve_api/remote/configuration_client.hpp
index b7785315..3d0eb7ff 100644
--- a/src/buildtool/serve_api/remote/configuration_client.hpp
+++ b/src/buildtool/serve_api/remote/configuration_client.hpp
@@ -21,6 +21,7 @@
#include <utility>
#include <vector>
+#include "gsl/gsl"
#include "justbuild/just_serve/just_serve.grpc.pb.h"
#include "src/buildtool/auth/authentication.hpp"
#include "src/buildtool/common/remote/client_common.hpp"
@@ -32,8 +33,9 @@
/// src/buildtool/serve_api/serve_service/just_serve.proto
class ConfigurationClient {
public:
- explicit ConfigurationClient(ServerAddress address,
- Auth::TLS const* auth) noexcept
+ explicit ConfigurationClient(
+ ServerAddress address,
+ gsl::not_null<Auth const*> const& auth) noexcept
: client_serve_address_{std::move(address)},
stub_{justbuild::just_serve::Configuration::NewStub(
CreateChannelWithCredentials(client_serve_address_.host,
diff --git a/src/buildtool/serve_api/remote/serve_api.hpp b/src/buildtool/serve_api/remote/serve_api.hpp
index 9e4a29bf..3374e6aa 100644
--- a/src/buildtool/serve_api/remote/serve_api.hpp
+++ b/src/buildtool/serve_api/remote/serve_api.hpp
@@ -42,9 +42,9 @@ class ServeApi final {
public:
explicit ServeApi(ServerAddress const& address,
gsl::not_null<ApiBundle const*> const& apis) noexcept
- : stc_{address, apis->auth},
+ : stc_{address, &apis->auth},
tc_{address, apis},
- cc_{address, apis->auth} {}
+ cc_{address, &apis->auth} {}
~ServeApi() noexcept = default;
ServeApi(ServeApi const&) = delete;
diff --git a/src/buildtool/serve_api/remote/source_tree_client.cpp b/src/buildtool/serve_api/remote/source_tree_client.cpp
index 3070a44f..7a922671 100644
--- a/src/buildtool/serve_api/remote/source_tree_client.cpp
+++ b/src/buildtool/serve_api/remote/source_tree_client.cpp
@@ -59,8 +59,9 @@ auto PragmaSpecialToSymlinksResolve(
} // namespace
-SourceTreeClient::SourceTreeClient(ServerAddress const& address,
- Auth::TLS const* auth) noexcept {
+SourceTreeClient::SourceTreeClient(
+ ServerAddress const& address,
+ gsl::not_null<Auth const*> const& auth) noexcept {
stub_ = justbuild::just_serve::SourceTree::NewStub(
CreateChannelWithCredentials(address.host, address.port, auth));
}
diff --git a/src/buildtool/serve_api/remote/source_tree_client.hpp b/src/buildtool/serve_api/remote/source_tree_client.hpp
index 17eb0c57..e5001029 100644
--- a/src/buildtool/serve_api/remote/source_tree_client.hpp
+++ b/src/buildtool/serve_api/remote/source_tree_client.hpp
@@ -19,6 +19,7 @@
#include <string>
#include <unordered_map>
+#include "gsl/gsl"
#include "justbuild/just_serve/just_serve.grpc.pb.h"
#include "src/buildtool/auth/authentication.hpp"
#include "src/buildtool/common/remote/port.hpp"
@@ -33,7 +34,7 @@
class SourceTreeClient {
public:
explicit SourceTreeClient(ServerAddress const& address,
- Auth::TLS const* auth) noexcept;
+ gsl::not_null<Auth const*> const& auth) noexcept;
// An error + data union type
using result_t = expected<std::string, GitLookupError>;
diff --git a/src/buildtool/serve_api/remote/target_client.cpp b/src/buildtool/serve_api/remote/target_client.cpp
index d19ac26f..526121ab 100644
--- a/src/buildtool/serve_api/remote/target_client.cpp
+++ b/src/buildtool/serve_api/remote/target_client.cpp
@@ -31,7 +31,7 @@ TargetClient::TargetClient(ServerAddress const& address,
gsl::not_null<ApiBundle const*> const& apis) noexcept
: apis_{*apis} {
stub_ = justbuild::just_serve::Target::NewStub(
- CreateChannelWithCredentials(address.host, address.port, apis->auth));
+ CreateChannelWithCredentials(address.host, address.port, &apis->auth));
}
auto TargetClient::ServeTarget(const TargetCacheKey& key,