aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp
diff options
context:
space:
mode:
authorGravatar Alexander Polcyn <apolcyn@google.com>2018-07-13 18:22:38 -0700
committerGravatar Alexander Polcyn <apolcyn@google.com>2018-07-13 18:23:14 -0700
commitf3c3c55fade4a0f47145732a5b4a0a03f0ddfc83 (patch)
tree4c28011247ed63c7a1e741a3f0cdb104983dd868 /test/cpp
parent4ba4d18960ccc762d5228a314c574050afadddac (diff)
Allow choosing google default credentials in the C++ interop clients
Diffstat (limited to 'test/cpp')
-rw-r--r--test/cpp/util/test_credentials_provider.cc2
-rw-r--r--test/cpp/util/test_credentials_provider.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc
index c8b0ac73f4..0cf75f1e5f 100644
--- a/test/cpp/util/test_credentials_provider.cc
+++ b/test/cpp/util/test_credentials_provider.cc
@@ -63,6 +63,8 @@ class DefaultCredentialsProvider : public CredentialsProvider {
SslCredentialsOptions ssl_opts = {test_root_cert, "", ""};
args->SetSslTargetNameOverride("foo.test.google.fr");
return SslCredentials(ssl_opts);
+ } else if (type == grpc::testing::kGoogleDefaultCredentialsType) {
+ return grpc::GoogleDefaultCredentials();
} else {
std::unique_lock<std::mutex> lock(mu_);
auto it(std::find(added_secure_type_names_.begin(),
diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h
index b1d69e893d..0bc910dbc0 100644
--- a/test/cpp/util/test_credentials_provider.h
+++ b/test/cpp/util/test_credentials_provider.h
@@ -33,6 +33,7 @@ const char kInsecureCredentialsType[] = "INSECURE_CREDENTIALS";
// property "transport_security_type".
const char kTlsCredentialsType[] = "ssl";
const char kAltsCredentialsType[] = "alts";
+const char kGoogleDefaultCredentialsType[] = "google_default_credentials";
// Provide test credentials of a particular type.
class CredentialTypeProvider {