Credentials cleanup:
- Removing service_accounts credentials. These credentials just have
drawbacks compared to service_account_jwt_access credentials, notably
in terms for security.
- Renaming Google specific credentials with a Google prefix for C and
C++. This should be done as well for wrapped languages.
diff --git a/test/cpp/interop/client_helper.cc b/test/cpp/interop/client_helper.cc
index abc14ae..7093463 100644
--- a/test/cpp/interop/client_helper.cc
+++ b/test/cpp/interop/client_helper.cc
@@ -64,16 +64,6 @@
namespace grpc {
namespace testing {
-namespace {
-std::shared_ptr<Credentials> CreateServiceAccountCredentials() {
- GPR_ASSERT(FLAGS_enable_ssl);
- grpc::string json_key = GetServiceAccountJsonKey();
- std::chrono::seconds token_lifetime = std::chrono::hours(1);
- return ServiceAccountCredentials(json_key, FLAGS_oauth_scope,
- token_lifetime.count());
-}
-} // namespace
-
grpc::string GetServiceAccountJsonKey() {
static grpc::string json_key;
if (json_key.empty()) {
@@ -86,7 +76,7 @@
}
grpc::string GetOauth2AccessToken() {
- std::shared_ptr<Credentials> creds = CreateServiceAccountCredentials();
+ std::shared_ptr<Credentials> creds = GoogleComputeEngineCredentials();
SecureCredentials* secure_creds =
dynamic_cast<SecureCredentials*>(creds.get());
GPR_ASSERT(secure_creds != nullptr);
@@ -107,14 +97,10 @@
snprintf(host_port, host_port_buf_size, "%s:%d", FLAGS_server_host.c_str(),
FLAGS_server_port);
- if (test_case == "service_account_creds") {
- std::shared_ptr<Credentials> creds = CreateServiceAccountCredentials();
- return CreateTestChannel(host_port, FLAGS_server_host_override,
- FLAGS_enable_ssl, FLAGS_use_prod_roots, creds);
- } else if (test_case == "compute_engine_creds") {
+ if (test_case == "compute_engine_creds") {
std::shared_ptr<Credentials> creds;
GPR_ASSERT(FLAGS_enable_ssl);
- creds = ComputeEngineCredentials();
+ creds = GoogleComputeEngineCredentials();
return CreateTestChannel(host_port, FLAGS_server_host_override,
FLAGS_enable_ssl, FLAGS_use_prod_roots, creds);
} else if (test_case == "jwt_token_creds") {