summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/execution_api/execution_service/TARGETS1
-rw-r--r--src/buildtool/execution_api/execution_service/server_implementation.cpp8
-rw-r--r--src/buildtool/serve_api/serve_service/TARGETS1
-rw-r--r--src/buildtool/serve_api/serve_service/serve_server_implementation.cpp8
4 files changed, 6 insertions, 12 deletions
diff --git a/src/buildtool/execution_api/execution_service/TARGETS b/src/buildtool/execution_api/execution_service/TARGETS
index e77fb6bf..8bf4dc79 100644
--- a/src/buildtool/execution_api/execution_service/TARGETS
+++ b/src/buildtool/execution_api/execution_service/TARGETS
@@ -81,7 +81,6 @@
, ["src/buildtool/execution_api/remote", "config"]
, ["src/buildtool/logging", "log_level"]
, ["src/buildtool/logging", "logging"]
- , ["src/buildtool/auth", "auth"]
, ["@", "json", "", "json"]
, ["@", "grpc", "", "grpc++"]
, ["src/buildtool/execution_api/remote", "config"]
diff --git a/src/buildtool/execution_api/execution_service/server_implementation.cpp b/src/buildtool/execution_api/execution_service/server_implementation.cpp
index 30974d4f..4a9f23cf 100644
--- a/src/buildtool/execution_api/execution_service/server_implementation.cpp
+++ b/src/buildtool/execution_api/execution_service/server_implementation.cpp
@@ -26,7 +26,6 @@
#include "fmt/core.h"
#include "grpcpp/grpcpp.h"
#include "nlohmann/json.hpp"
-#include "src/buildtool/auth/authentication.hpp"
#include "src/buildtool/common/remote/port.hpp"
#include "src/buildtool/compatibility/compatibility.hpp"
#include "src/buildtool/execution_api/execution_service/ac_server.hpp"
@@ -72,13 +71,12 @@ auto ServerImpl::Run(ApiBundle const& apis) -> bool {
.RegisterService(&op);
std::shared_ptr<grpc::ServerCredentials> creds;
- if (Auth::Instance().GetAuthMethod() == AuthMethod::kTLS) {
+ if (apis.auth != nullptr) {
auto tls_opts = grpc::SslServerCredentialsOptions{};
- tls_opts.pem_root_certs = Auth::TLS::Instance().CACert();
+ tls_opts.pem_root_certs = apis.auth->CACert();
grpc::SslServerCredentialsOptions::PemKeyCertPair keycert = {
- Auth::TLS::Instance().ServerKey(),
- Auth::TLS::Instance().ServerCert()};
+ apis.auth->ServerKey(), apis.auth->ServerCert()};
tls_opts.pem_key_cert_pairs.emplace_back(keycert);
diff --git a/src/buildtool/serve_api/serve_service/TARGETS b/src/buildtool/serve_api/serve_service/TARGETS
index 9349c53d..54148ee3 100644
--- a/src/buildtool/serve_api/serve_service/TARGETS
+++ b/src/buildtool/serve_api/serve_service/TARGETS
@@ -59,7 +59,6 @@
, ["@", "fmt", "", "fmt"]
, ["@", "grpc", "", "grpc++"]
, ["@", "json", "", "json"]
- , ["src/buildtool/auth", "auth"]
, ["src/buildtool/common/remote", "port"]
, ["src/buildtool/compatibility", "compatibility"]
, ["src/buildtool/logging", "log_level"]
diff --git a/src/buildtool/serve_api/serve_service/serve_server_implementation.cpp b/src/buildtool/serve_api/serve_service/serve_server_implementation.cpp
index 374e42ac..1d81ebb0 100644
--- a/src/buildtool/serve_api/serve_service/serve_server_implementation.cpp
+++ b/src/buildtool/serve_api/serve_service/serve_server_implementation.cpp
@@ -28,7 +28,6 @@
#include "fmt/core.h"
#include "grpcpp/grpcpp.h"
#include "nlohmann/json.hpp"
-#include "src/buildtool/auth/authentication.hpp"
#include "src/buildtool/common/remote/port.hpp"
#include "src/buildtool/compatibility/compatibility.hpp"
#include "src/buildtool/execution_api/execution_service/ac_server.hpp"
@@ -134,13 +133,12 @@ auto ServeServerImpl::Run(RemoteServeConfig const& serve_config,
}
std::shared_ptr<grpc::ServerCredentials> creds;
- if (Auth::Instance().GetAuthMethod() == AuthMethod::kTLS) {
+ if (apis.auth != nullptr) {
auto tls_opts = grpc::SslServerCredentialsOptions{};
- tls_opts.pem_root_certs = Auth::TLS::Instance().CACert();
+ tls_opts.pem_root_certs = apis.auth->CACert();
grpc::SslServerCredentialsOptions::PemKeyCertPair keycert = {
- Auth::TLS::Instance().ServerKey(),
- Auth::TLS::Instance().ServerCert()};
+ apis.auth->ServerKey(), apis.auth->ServerCert()};
tls_opts.pem_key_cert_pairs.emplace_back(keycert);