diff options
author | Julien Boeuf <jboeuf@google.com> | 2015-08-28 15:51:02 -0700 |
---|---|---|
committer | Julien Boeuf <jboeuf@google.com> | 2015-08-28 15:51:02 -0700 |
commit | 97cd4ae606a39a62c07b0d2ce2687af3ce812645 (patch) | |
tree | 563c81ba4d81c8dc0764ef3557b24dce9a7be5da /test/cpp/interop | |
parent | 68ff03a952d1b5395ef1f4ee326f810cd0b55912 (diff) | |
parent | 036bf58b281e4ff65ccc62ea68002a50ddb626cc (diff) |
Merge branch 'master' of github.com:grpc/grpc into cpp_auth_md_processor
Diffstat (limited to 'test/cpp/interop')
-rw-r--r-- | test/cpp/interop/client.cc | 8 | ||||
-rw-r--r-- | test/cpp/interop/client_helper.cc | 20 | ||||
-rw-r--r-- | test/cpp/interop/interop_client.cc | 18 | ||||
-rw-r--r-- | test/cpp/interop/interop_client.h | 3 |
4 files changed, 4 insertions, 45 deletions
diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index cb5232153b..20fe1c515f 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -68,7 +68,6 @@ DEFINE_string(test_case, "large_unary", "cancel_after_begin : cancel stream after starting it; " "cancel_after_first_response: cancel on first response; " "timeout_on_sleeping_server: deadline exceeds on stream; " - "service_account_creds : large_unary with service_account auth; " "compute_engine_creds: large_unary with compute engine auth; " "jwt_token_creds: large_unary with JWT token auth; " "oauth2_auth_token: raw oauth2 access token auth; " @@ -114,9 +113,6 @@ int main(int argc, char** argv) { client.DoCancelAfterFirstResponse(); } else if (FLAGS_test_case == "timeout_on_sleeping_server") { client.DoTimeoutOnSleepingServer(); - } else if (FLAGS_test_case == "service_account_creds") { - grpc::string json_key = GetServiceAccountJsonKey(); - client.DoServiceAccountCreds(json_key, FLAGS_oauth_scope); } else if (FLAGS_test_case == "compute_engine_creds") { client.DoComputeEngineCreds(FLAGS_default_service_account, FLAGS_oauth_scope); @@ -146,7 +142,6 @@ int main(int argc, char** argv) { // service_account_creds and jwt_token_creds can only run with ssl. if (FLAGS_enable_ssl) { grpc::string json_key = GetServiceAccountJsonKey(); - client.DoServiceAccountCreds(json_key, FLAGS_oauth_scope); client.DoJwtTokenCreds(json_key); client.DoOauth2AuthToken(json_key, FLAGS_oauth_scope); client.DoPerRpcCreds(json_key, FLAGS_oauth_scope); @@ -159,8 +154,7 @@ int main(int argc, char** argv) { "large_unary|large_compressed_unary|client_streaming|server_streaming|" "server_compressed_streaming|half_duplex|ping_pong|cancel_after_begin|" "cancel_after_first_response|timeout_on_sleeping_server|" - "service_account_creds|compute_engine_creds|jwt_token_creds|" - "oauth2_auth_token|per_rpc_creds", + "compute_engine_creds|jwt_token_creds|oauth2_auth_token|per_rpc_creds", FLAGS_test_case.c_str()); ret = 1; } diff --git a/test/cpp/interop/client_helper.cc b/test/cpp/interop/client_helper.cc index abc14aeb98..7093463fa8 100644 --- a/test/cpp/interop/client_helper.cc +++ b/test/cpp/interop/client_helper.cc @@ -64,16 +64,6 @@ DECLARE_string(oauth_scope); 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 GetServiceAccountJsonKey() { } 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 @@ std::shared_ptr<Channel> CreateChannelForTestCase( 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") { diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index ca13cdc53d..73d1a143c4 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -179,24 +179,6 @@ void InteropClient::DoComputeEngineCreds( gpr_log(GPR_INFO, "Large unary with compute engine creds done."); } -void InteropClient::DoServiceAccountCreds(const grpc::string& username, - const grpc::string& oauth_scope) { - gpr_log(GPR_INFO, - "Sending a large unary rpc with service account credentials ..."); - SimpleRequest request; - SimpleResponse response; - request.set_fill_username(true); - request.set_fill_oauth_scope(true); - request.set_response_type(PayloadType::COMPRESSABLE); - PerformLargeUnary(&request, &response); - GPR_ASSERT(!response.username().empty()); - GPR_ASSERT(!response.oauth_scope().empty()); - GPR_ASSERT(username.find(response.username()) != grpc::string::npos); - const char* oauth_scope_str = response.oauth_scope().c_str(); - GPR_ASSERT(oauth_scope.find(oauth_scope_str) != grpc::string::npos); - gpr_log(GPR_INFO, "Large unary with service account creds done."); -} - void InteropClient::DoOauth2AuthToken(const grpc::string& username, const grpc::string& oauth_scope) { gpr_log(GPR_INFO, diff --git a/test/cpp/interop/interop_client.h b/test/cpp/interop/interop_client.h index 5e26cc82e6..5a085c4c02 100644 --- a/test/cpp/interop/interop_client.h +++ b/test/cpp/interop/interop_client.h @@ -69,9 +69,6 @@ class InteropClient { void DoComputeEngineCreds(const grpc::string& default_service_account, const grpc::string& oauth_scope); // username is a string containing the user email - void DoServiceAccountCreds(const grpc::string& username, - const grpc::string& oauth_scope); - // username is a string containing the user email void DoOauth2AuthToken(const grpc::string& username, const grpc::string& oauth_scope); // username is a string containing the user email |