From e26e2b6b8be7402e70d49e2caf967ced273e58a5 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Mon, 29 Jul 2019 10:33:34 -0700 Subject: [PATCH 01/70] First Spiffe1 commit --- BUILD | 2 + build.yaml | 2 + include/grpcpp/security/credentials.h | 5 + include/grpcpp/security/credentials_impl.h | 5 + include/grpcpp/security/server_credentials.h | 6 ++ .../grpcpp/security/server_credentials_impl.h | 5 + .../grpcpp/security/tls_credentials_options.h | 94 +++++++++++++++++++ src/cpp/client/secure_credentials.cc | 7 ++ src/cpp/client/secure_credentials.h | 1 + src/cpp/common/tls_credentials_options.cc | 45 +++++++++ src/cpp/server/secure_server_credentials.cc | 7 ++ src/cpp/server/secure_server_credentials.h | 1 + 12 files changed, 180 insertions(+) create mode 100644 include/grpcpp/security/tls_credentials_options.h create mode 100644 src/cpp/common/tls_credentials_options.cc diff --git a/BUILD b/BUILD index 6b51f07b82f..dadc1550a9b 100644 --- a/BUILD +++ b/BUILD @@ -260,6 +260,7 @@ GRPCXX_PUBLIC_HDRS = [ "include/grpcpp/security/credentials_impl.h", "include/grpcpp/security/server_credentials.h", "include/grpcpp/security/server_credentials_impl.h", + "include/grpcpp/security/tls_credentials_options.h", "include/grpcpp/server.h", "include/grpcpp/server_impl.h", "include/grpcpp/server_builder.h", @@ -357,6 +358,7 @@ grpc_cc_library( "src/cpp/common/secure_auth_context.cc", "src/cpp/common/secure_channel_arguments.cc", "src/cpp/common/secure_create_auth_context.cc", + "src/cpp/common/tls_credentials_options.cc", "src/cpp/server/insecure_server_credentials.cc", "src/cpp/server/secure_server_credentials.cc", ], diff --git a/build.yaml b/build.yaml index f16a8f25d11..7c4a6cb37e4 100644 --- a/build.yaml +++ b/build.yaml @@ -1457,6 +1457,7 @@ filegroups: - include/grpcpp/security/credentials_impl.h - include/grpcpp/security/server_credentials.h - include/grpcpp/security/server_credentials_impl.h + - include/grpcpp/security/tls_credentials_options.h - include/grpcpp/server.h - include/grpcpp/server_builder.h - include/grpcpp/server_builder_impl.h @@ -1798,6 +1799,7 @@ libs: - src/cpp/common/secure_auth_context.cc - src/cpp/common/secure_channel_arguments.cc - src/cpp/common/secure_create_auth_context.cc + - src/cpp/common/tls_credentials_options.cc - src/cpp/server/insecure_server_credentials.cc - src/cpp/server/secure_server_credentials.cc deps: diff --git a/include/grpcpp/security/credentials.h b/include/grpcpp/security/credentials.h index 4df69f996f8..e38414df770 100644 --- a/include/grpcpp/security/credentials.h +++ b/include/grpcpp/security/credentials.h @@ -132,6 +132,11 @@ static inline std::shared_ptr LocalCredentials( return ::grpc_impl::experimental::LocalCredentials(type); } +static inline std::shared_ptr SpiffeCredentials( + const TlsCredentialsOptions& options) { + return ::grpc_impl::experimental::SpiffeCredentials(options); +} + } // namespace experimental } // namespace grpc diff --git a/include/grpcpp/security/credentials_impl.h b/include/grpcpp/security/credentials_impl.h index bd79f30ae12..4d7f83e4278 100644 --- a/include/grpcpp/security/credentials_impl.h +++ b/include/grpcpp/security/credentials_impl.h @@ -31,6 +31,7 @@ #include #include #include +#include struct grpc_call; @@ -336,6 +337,10 @@ std::shared_ptr AltsCredentials( std::shared_ptr LocalCredentials( grpc_local_connect_type type); +/// Builds SPIFFE Credentials given TLS options. +std::shared_ptr SpiffeCredentials( + const TlsCredentialsOptions& options); + } // namespace experimental } // namespace grpc_impl diff --git a/include/grpcpp/security/server_credentials.h b/include/grpcpp/security/server_credentials.h index 57f733886f4..b5b6b396664 100644 --- a/include/grpcpp/security/server_credentials.h +++ b/include/grpcpp/security/server_credentials.h @@ -79,6 +79,12 @@ static inline std::shared_ptr LocalServerCredentials( return ::grpc_impl::experimental::LocalServerCredentials(type); } +/// Builds SPIFFE ServerCredentials given TLS options. +static inline std::shared_ptr SpiffeServerCredentials( + const TlsCredentialsOptions& options) { + return ::grpc_impl::experimental::SpiffeServerCredentials(options); +} + } // namespace experimental } // namespace grpc diff --git a/include/grpcpp/security/server_credentials_impl.h b/include/grpcpp/security/server_credentials_impl.h index f08849097ad..3b9d24395c6 100644 --- a/include/grpcpp/security/server_credentials_impl.h +++ b/include/grpcpp/security/server_credentials_impl.h @@ -25,6 +25,7 @@ #include #include #include +#include struct grpc_server; @@ -79,6 +80,10 @@ std::shared_ptr AltsServerCredentials( std::shared_ptr LocalServerCredentials( grpc_local_connect_type type); +/// Builds SPIFFE ServerCredentials given TLS options. +std::shared_ptr SpiffeServerCredentials( + const TlsCredentialsOptions& options); + } // namespace experimental } // namespace grpc_impl diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h new file mode 100644 index 00000000000..b120cff42e5 --- /dev/null +++ b/include/grpcpp/security/tls_credentials_options.h @@ -0,0 +1,94 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef GRPCPP_TLS_CREDENTIALS_OPTIONS_H +#define GRPCPP_TLS_CREDENTIALS_OPTIONS_H + +#include +#include + +#include +#include + +#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" + +namespace grpc_impl { +namespace experimental { + +/** TLS key materials config, wrapper for grpc_tls_key_materials_config. **/ +class TlsKeyMaterialsConfig { + public: + struct PemKeyCertPair { + ::grpc::string private_key; + ::grpc::string cert_chain; + }; + + /** Getters for member fields. **/ + const ::grpc::string pem_root_certs() const { + return pem_root_certs_; + } + const ::std::vector& pem_key_cert_pair_list() const { + return pem_key_cert_pair_list_; + } + + /**Setter for member fields. **/ + void set_key_materials(::grpc::string pem_root_certs, + ::std::vector pem_key_cert_pair_list); + + /** Creates C struct for key materials. **/ + grpc_core::RefCountedPtr c_key_materials() const; + + private: + ::std::vector pem_key_cert_pair_list_; + ::grpc::string pem_root_certs_; +}; + +/** TLS credentials options, wrapper for grpc_tls_credentials_options. **/ +class TlsCredentialsOptions { + public: + /** Getters for member fields. **/ + grpc_ssl_client_certificate_request_type cert_request_type() const{ + return cert_request_type_; + } + std::shared_ptr key_materials_config() const { + return key_materials_config_; + } + + /** Setters for member fields. **/ + void set_cert_request_type( + const grpc_ssl_client_certificate_request_type type) { + cert_request_type_ = type; + } + + void set_key_materials_config( + std::shared_ptr config) { + key_materials_config_ = config; + } + + /** Creates C struct for TLS credential options. **/ + grpc_tls_credentials_options* c_credentials_options() const; + + private: + grpc_ssl_client_certificate_request_type cert_request_type_; + std::shared_ptr key_materials_config_; +}; + +} // namespace experimental +} // namespace grpc_impl +#endif /** GRPCPP_TLS_CREDENTIALS_OPTIONS_H **/ + diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index ebff8af3e5a..b3b2bf4b554 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -280,6 +280,13 @@ std::shared_ptr LocalCredentials( return WrapChannelCredentials(grpc_local_credentials_create(type)); } +// Builds SPIFFE Credentials given TLS options. +std::shared_ptr SpiffeCredentials( + const TlsCredentialsOptions& options) { + return WrapChannelCredentials(grpc_tls_spiffe_credentials_create( + options.c_credentials_options())); +} + } // namespace experimental // Builds credentials for use when running in GCE diff --git a/src/cpp/client/secure_credentials.h b/src/cpp/client/secure_credentials.h index ed14df4938e..1f3e667fe72 100644 --- a/src/cpp/client/secure_credentials.h +++ b/src/cpp/client/secure_credentials.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "src/core/lib/security/credentials/credentials.h" #include "src/cpp/server/thread_pool_interface.h" diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc new file mode 100644 index 00000000000..09d739d4ad5 --- /dev/null +++ b/src/cpp/common/tls_credentials_options.cc @@ -0,0 +1,45 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +namespace grpc_impl { +namespace experimental { + +/** gRPC TLS key materials config API implementation **/ +void TlsKeyMaterialsConfig::set_key_materials( + ::grpc::string pem_root_certs, + ::std::vector pem_key_cert_pair_list) { + pem_key_cert_pair_list_ = ::std::move(pem_key_cert_pair_list); + pem_root_certs_ = ::std::move(pem_root_certs); +} + +/** gRPC TLS credential options API implementation **/ +grpc_tls_credentials_options* TlsCredentialsOptions::c_credentials_options() const { + grpc_tls_credentials_options* c_options = grpc_tls_credentials_options_create(); + c_options->set_cert_request_type(cert_request_type_); + // TODO: put in C configs into functions below. + c_options->set_key_materials_config(nullptr); + c_options->set_credential_reload_config(nullptr); + c_options->set_server_authorization_check_config(nullptr); + return c_options; +} + +} // namespace experimental +} // namespace grpc_impl + diff --git a/src/cpp/server/secure_server_credentials.cc b/src/cpp/server/secure_server_credentials.cc index 93dc10f14ea..ddbdf9806f9 100644 --- a/src/cpp/server/secure_server_credentials.cc +++ b/src/cpp/server/secure_server_credentials.cc @@ -150,5 +150,12 @@ std::shared_ptr LocalServerCredentials( new SecureServerCredentials(grpc_local_server_credentials_create(type))); } +std::shared_ptr SpiffeServerCredentials( + const TlsCredentialsOptions& options) { + return std::shared_ptr( + new SecureServerCredentials(grpc_tls_spiffe_server_credentials_create( + options.c_credentials_options()))); +} + } // namespace experimental } // namespace grpc_impl diff --git a/src/cpp/server/secure_server_credentials.h b/src/cpp/server/secure_server_credentials.h index 24b133cf7f0..0b49ef9078f 100644 --- a/src/cpp/server/secure_server_credentials.h +++ b/src/cpp/server/secure_server_credentials.h @@ -22,6 +22,7 @@ #include #include +#include #include From 4cd2fdd7dfa03699a4cf9b2795ceab931abe3962 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Mon, 29 Jul 2019 10:43:38 -0700 Subject: [PATCH 02/70] First commit: autogenerated files --- BUILD.gn | 2 ++ CMakeLists.txt | 3 +++ Makefile | 4 ++++ gRPC-C++.podspec | 2 ++ grpc.gyp | 1 + tools/doxygen/Doxyfile.c++ | 1 + tools/doxygen/Doxyfile.c++.internal | 2 ++ tools/run_tests/generated/sources_and_headers.json | 3 +++ 8 files changed, 18 insertions(+) diff --git a/BUILD.gn b/BUILD.gn index 83cc1ec4bda..1ae9ebe14fc 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1126,6 +1126,7 @@ config("grpc_config") { "include/grpcpp/security/credentials_impl.h", "include/grpcpp/security/server_credentials.h", "include/grpcpp/security/server_credentials_impl.h", + "include/grpcpp/security/tls_credentials_options.h", "include/grpcpp/server.h", "include/grpcpp/server_builder.h", "include/grpcpp/server_builder_impl.h", @@ -1362,6 +1363,7 @@ config("grpc_config") { "src/cpp/common/secure_auth_context.h", "src/cpp/common/secure_channel_arguments.cc", "src/cpp/common/secure_create_auth_context.cc", + "src/cpp/common/tls_credentials_options.cc", "src/cpp/common/validate_service_config.cc", "src/cpp/common/version_cc.cc", "src/cpp/server/async_generic_service.cc", diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e0aab56815..fb863dc8416 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3065,6 +3065,7 @@ add_library(grpc++ src/cpp/common/secure_auth_context.cc src/cpp/common/secure_channel_arguments.cc src/cpp/common/secure_create_auth_context.cc + src/cpp/common/tls_credentials_options.cc src/cpp/server/insecure_server_credentials.cc src/cpp/server/secure_server_credentials.cc src/cpp/client/channel_cc.cc @@ -3231,6 +3232,7 @@ foreach(_hdr include/grpcpp/security/credentials_impl.h include/grpcpp/security/server_credentials.h include/grpcpp/security/server_credentials_impl.h + include/grpcpp/security/tls_credentials_options.h include/grpcpp/server.h include/grpcpp/server_builder.h include/grpcpp/server_builder_impl.h @@ -4309,6 +4311,7 @@ foreach(_hdr include/grpcpp/security/credentials_impl.h include/grpcpp/security/server_credentials.h include/grpcpp/security/server_credentials_impl.h + include/grpcpp/security/tls_credentials_options.h include/grpcpp/server.h include/grpcpp/server_builder.h include/grpcpp/server_builder_impl.h diff --git a/Makefile b/Makefile index 896287bb22e..e4eb3c51f60 100644 --- a/Makefile +++ b/Makefile @@ -5463,6 +5463,7 @@ LIBGRPC++_SRC = \ src/cpp/common/secure_auth_context.cc \ src/cpp/common/secure_channel_arguments.cc \ src/cpp/common/secure_create_auth_context.cc \ + src/cpp/common/tls_credentials_options.cc \ src/cpp/server/insecure_server_credentials.cc \ src/cpp/server/secure_server_credentials.cc \ src/cpp/client/channel_cc.cc \ @@ -5594,6 +5595,7 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ include/grpcpp/security/server_credentials_impl.h \ + include/grpcpp/security/tls_credentials_options.h \ include/grpcpp/server.h \ include/grpcpp/server_builder.h \ include/grpcpp/server_builder_impl.h \ @@ -6619,6 +6621,7 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ include/grpcpp/security/server_credentials_impl.h \ + include/grpcpp/security/tls_credentials_options.h \ include/grpcpp/server.h \ include/grpcpp/server_builder.h \ include/grpcpp/server_builder_impl.h \ @@ -22402,6 +22405,7 @@ src/cpp/common/auth_property_iterator.cc: $(OPENSSL_DEP) src/cpp/common/secure_auth_context.cc: $(OPENSSL_DEP) src/cpp/common/secure_channel_arguments.cc: $(OPENSSL_DEP) src/cpp/common/secure_create_auth_context.cc: $(OPENSSL_DEP) +src/cpp/common/tls_credentials_options.cc: $(OPENSSL_DEP) src/cpp/ext/proto_server_reflection.cc: $(OPENSSL_DEP) src/cpp/ext/proto_server_reflection_plugin.cc: $(OPENSSL_DEP) src/cpp/server/channelz/channelz_service.cc: $(OPENSSL_DEP) diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 56d6f5b3edb..7ff51fa08c9 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -121,6 +121,7 @@ Pod::Spec.new do |s| 'include/grpcpp/security/credentials_impl.h', 'include/grpcpp/security/server_credentials.h', 'include/grpcpp/security/server_credentials_impl.h', + 'include/grpcpp/security/tls_credentials_options.h', 'include/grpcpp/server.h', 'include/grpcpp/server_builder.h', 'include/grpcpp/server_builder_impl.h', @@ -233,6 +234,7 @@ Pod::Spec.new do |s| 'src/cpp/common/secure_auth_context.cc', 'src/cpp/common/secure_channel_arguments.cc', 'src/cpp/common/secure_create_auth_context.cc', + 'src/cpp/common/tls_credentials_options.cc', 'src/cpp/server/insecure_server_credentials.cc', 'src/cpp/server/secure_server_credentials.cc', 'src/cpp/client/channel_cc.cc', diff --git a/grpc.gyp b/grpc.gyp index 2f6eb8fbd40..b9a30012fed 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -1456,6 +1456,7 @@ 'src/cpp/common/secure_auth_context.cc', 'src/cpp/common/secure_channel_arguments.cc', 'src/cpp/common/secure_create_auth_context.cc', + 'src/cpp/common/tls_credentials_options.cc', 'src/cpp/server/insecure_server_credentials.cc', 'src/cpp/server/secure_server_credentials.cc', 'src/cpp/client/channel_cc.cc', diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index e85ae495546..114d5147eef 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -1022,6 +1022,7 @@ include/grpcpp/security/credentials.h \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ include/grpcpp/security/server_credentials_impl.h \ +include/grpcpp/security/tls_credentials_options.h \ include/grpcpp/server.h \ include/grpcpp/server_builder.h \ include/grpcpp/server_builder_impl.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 96da09eefc6..0e99b88a4db 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1024,6 +1024,7 @@ include/grpcpp/security/credentials.h \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ include/grpcpp/security/server_credentials_impl.h \ +include/grpcpp/security/tls_credentials_options.h \ include/grpcpp/server.h \ include/grpcpp/server_builder.h \ include/grpcpp/server_builder_impl.h \ @@ -1263,6 +1264,7 @@ src/cpp/common/secure_auth_context.cc \ src/cpp/common/secure_auth_context.h \ src/cpp/common/secure_channel_arguments.cc \ src/cpp/common/secure_create_auth_context.cc \ +src/cpp/common/tls_credentials_options.cc \ src/cpp/common/validate_service_config.cc \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 7cc164693e2..15f8d90b792 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -6914,6 +6914,7 @@ "src/cpp/common/secure_auth_context.h", "src/cpp/common/secure_channel_arguments.cc", "src/cpp/common/secure_create_auth_context.cc", + "src/cpp/common/tls_credentials_options.cc", "src/cpp/server/insecure_server_credentials.cc", "src/cpp/server/secure_server_credentials.cc", "src/cpp/server/secure_server_credentials.h" @@ -10630,6 +10631,7 @@ "include/grpcpp/security/credentials_impl.h", "include/grpcpp/security/server_credentials.h", "include/grpcpp/security/server_credentials_impl.h", + "include/grpcpp/security/tls_credentials_options.h", "include/grpcpp/server.h", "include/grpcpp/server_builder.h", "include/grpcpp/server_builder_impl.h", @@ -10763,6 +10765,7 @@ "include/grpcpp/security/credentials_impl.h", "include/grpcpp/security/server_credentials.h", "include/grpcpp/security/server_credentials_impl.h", + "include/grpcpp/security/tls_credentials_options.h", "include/grpcpp/server.h", "include/grpcpp/server_builder.h", "include/grpcpp/server_builder_impl.h", From 17e1acec0cf1907f367797731e462ec0da3378a6 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 30 Jul 2019 14:23:49 -0700 Subject: [PATCH 03/70] Fixed scope issue in credentials.h --- include/grpcpp/security/credentials.h | 2 +- include/grpcpp/security/server_credentials.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/grpcpp/security/credentials.h b/include/grpcpp/security/credentials.h index e38414df770..bf28b75ce1d 100644 --- a/include/grpcpp/security/credentials.h +++ b/include/grpcpp/security/credentials.h @@ -133,7 +133,7 @@ static inline std::shared_ptr LocalCredentials( } static inline std::shared_ptr SpiffeCredentials( - const TlsCredentialsOptions& options) { + const ::grpc_impl::experimental::TlsCredentialsOptions& options) { return ::grpc_impl::experimental::SpiffeCredentials(options); } diff --git a/include/grpcpp/security/server_credentials.h b/include/grpcpp/security/server_credentials.h index b5b6b396664..77edc83e0b7 100644 --- a/include/grpcpp/security/server_credentials.h +++ b/include/grpcpp/security/server_credentials.h @@ -81,7 +81,7 @@ static inline std::shared_ptr LocalServerCredentials( /// Builds SPIFFE ServerCredentials given TLS options. static inline std::shared_ptr SpiffeServerCredentials( - const TlsCredentialsOptions& options) { + const ::grpc_impl::experimental::TlsCredentialsOptions& options) { return ::grpc_impl::experimental::SpiffeServerCredentials(options); } From 22bf5894900d11c51c8b37b9221ac2f7dbc04097 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 30 Jul 2019 15:14:17 -0700 Subject: [PATCH 04/70] Fixed style of #define guard --- include/grpcpp/security/tls_credentials_options.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index b120cff42e5..b0ca167c734 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -16,8 +16,8 @@ * */ -#ifndef GRPCPP_TLS_CREDENTIALS_OPTIONS_H -#define GRPCPP_TLS_CREDENTIALS_OPTIONS_H +#ifndef GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H +#define GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H #include #include @@ -90,5 +90,5 @@ class TlsCredentialsOptions { } // namespace experimental } // namespace grpc_impl -#endif /** GRPCPP_TLS_CREDENTIALS_OPTIONS_H **/ +#endif /** GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H **/ From 64a8f132e779c8783a163989d5b1498dd7d42242 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 31 Jul 2019 09:09:25 -0700 Subject: [PATCH 05/70] "Modified some header inclusions" --- include/grpcpp/security/tls_credentials_options.h | 5 ++--- src/cpp/common/tls_credentials_options.cc | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index b0ca167c734..209b8f55d2d 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -23,9 +23,8 @@ #include #include -#include +#include -#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" namespace grpc_impl { namespace experimental { @@ -51,7 +50,7 @@ class TlsKeyMaterialsConfig { ::std::vector pem_key_cert_pair_list); /** Creates C struct for key materials. **/ - grpc_core::RefCountedPtr c_key_materials() const; + grpc_tls_key_materials_config* c_key_materials() const; private: ::std::vector pem_key_cert_pair_list_; diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 09d739d4ad5..b34c155a4e1 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -18,6 +18,8 @@ #include +#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" + namespace grpc_impl { namespace experimental { From bd8952b2145ca8b32b8195e09f86286147a7da68 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 31 Jul 2019 15:15:06 -0700 Subject: [PATCH 06/70] Added credential_reload and server_authorization_check API's. --- .../grpcpp/security/tls_credentials_options.h | 179 +++++++++++++++++- 1 file changed, 176 insertions(+), 3 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 209b8f55d2d..ba7ac469b8b 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -23,9 +23,9 @@ #include #include +#include #include - namespace grpc_impl { namespace experimental { @@ -57,6 +57,163 @@ class TlsKeyMaterialsConfig { ::grpc::string pem_root_certs_; }; +/** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ +typedef class TlsCredentialReloadArg TlsCredentialReloadArg; + +typedef void (*grpcpp_tls_on_credential_reload_done_cb)(TlsCredentialReloadArg* arg); + +class TlsCredentialReloadArg { + public: + /** Getters for member fields. **/ + grpcpp_tls_on_credential_reload_done_cb cb() const { + return cb_; + } + void* cb_user_data() const { + return cb_user_data_; + } + ::std::shared_ptr key_materials_config() const { + return key_materials_config_; + } + grpc_ssl_certificate_config_reload_status status() const { + return status_; + } + ::grpc::string error_details() const { + return error_details_; + } + + /** Setters for member fields. **/ + void set_cb(grpcpp_tls_on_credential_reload_done_cb cb); + void set_cb_user_data(void* cb_user_data); + void set_key_materials_config(::std::shared_ptr key_materials_config); + void set_status(grpc_ssl_certificate_config_reload_status status); + void set_error_details(::grpc::string error_details); + + /** Creates C struct for credential reload arg. **/ + grpc_tls_credential_reload_arg* c_credential_reload_arg() const; + + private: + grpcpp_tls_on_credential_reload_done_cb cb_; + void* cb_user_data_; + ::std::shared_ptr key_materials_config_; + grpc_ssl_certificate_config_reload_status status_; + ::grpc::string error_details_; +}; + +/** TLS credential reloag config, wraps grpc_tls_credential_reload_config. **/ +class TlsCredentialReloadConfig { + public: + TlsCredentialReloadConfig( + const void* config_user_data, + int (*schedule)(void* config_user_data, TlsCredentialReloadArg* arg), + void (*cancel)(void* config_user_data, TlsCredentialReloadArg* arg), + void (*destruct)(void* config_user_data)); + ~TlsCredentialReloadConfig(); + + int Schedule(TlsCredentialReloadArg* arg) const { + return schedule_(config_user_data_, arg); + } + + void Cancel(TlsCredentialReloadArg* arg) const { + if (cancel_ == nullptr) { + gpr_log(GPR_ERROR, "cancel API is nullptr"); + return; + } + cancel_(config_user_data_, arg); + } + +grpc_tls_credential_reload_config* c_credential_reload() const; + + private: + void* config_user_data_; + int (*schedule_)(void* config_user_data, TlsCredentialReloadArg* arg); + void (*cancel_)(void* config_user_data, TlsCredentialReloadArg* arg); + void (*destruct_)(void* config_user_data); +}; + +/** TLS server authorization check arguments, wraps + * grpc_tls_server_authorization_check_arg. **/ +typedef class TlsServerAuthorizationCheckArg TlsServerAuthorizationCheckArg; + +typedef void (*grpcpp_tls_on_server_authorization_check_done_cb)( + TlsServerAuthorizationCheckArg* arg); + +class TlsServerAuthorizationCheckArg { + public: + /** Getters for member fields. **/ + grpcpp_tls_on_server_authorization_check_done_cb cb() const { + return cb_; + } + void* cb_user_data() const { + return cb_user_data_; + } + int success() const { + return success_; + } + ::grpc::string peer_cert() const { + return peer_cert_; + } + grpc_status_code status() const { + return status_; + } + ::grpc::string error_details() const { + return error_details_; + } + + /** Setters for member fields. **/ + void set_cb(grpcpp_tls_on_server_authorization_check_done_cb cb); + void set_cb_user_data(void* cb_user_data); + void set_success(int success); + void set_peer_cert(::grpc::string peer_cert); + void set_status(grpc_status_code status); + void set_error_details(::grpc::string error_details); + + /** Creates C struct for credential reload arg. **/ + grpc_tls_credential_reload_arg* c_credential_reload_arg() const; + + private: + grpcpp_tls_on_server_authorization_check_done_cb cb_; + void* cb_user_data_; + int success_; + ::grpc::string target_name_; + ::grpc::string peer_cert_; + grpc_status_code status_; + ::grpc::string error_details_; +}; + + +/** TLS server authorization check config, wraps + * grps_tls_server_authorization_check_config. **/ +class TlsServerAuthorizationCheckConfig { + public: + TlsServerAuthorizationCheckConfig( + const void* config_user_data, + int (*schedule)(void* config_user_data, TlsServerAuthorizationCheckArg* arg), + void (*cancel)(void* config_user_data, TlsServerAuthorizationCheckArg* arg), + void (*destruct)(void* config_user_data)); + ~TlsServerAuthorizationCheckConfig(); + + int Schedule(TlsServerAuthorizationCheckArg* arg) const { + return schedule_(config_user_data_, arg); + } + + void Cancel(TlsServerAuthorizationCheckArg* arg) const { + if (cancel_ == nullptr) { + gpr_log(GPR_ERROR, "cancel API is nullptr"); + return; + } + cancel_(config_user_data_, arg); + } + + grpc_tls_server_authorization_check_config* c_server_authorization_check() const; + + private: + void* config_user_data_; + int (*schedule_)(void* config_user_data, TlsServerAuthorizationCheckArg* arg); + void (*cancel_)(void* config_user_data, TlsServerAuthorizationCheckArg* arg); + void (*destruct_)(void* config_user_data); +}; + + /** TLS credentials options, wrapper for grpc_tls_credentials_options. **/ class TlsCredentialsOptions { public: @@ -67,24 +224,40 @@ class TlsCredentialsOptions { std::shared_ptr key_materials_config() const { return key_materials_config_; } + ::std::shared_ptr credential_reload_config() const { + return credential_reload_config_; + } + ::std::shared_ptr server_authorization_check_config() const { + return server_authorization_check_config_; + } /** Setters for member fields. **/ void set_cert_request_type( const grpc_ssl_client_certificate_request_type type) { cert_request_type_ = type; } - void set_key_materials_config( std::shared_ptr config) { key_materials_config_ = config; } + void set_credential_reload_config( + ::std::shared_ptr config) { + credential_reload_config_ = config; + } + void set_server_authorization_check_config( + ::std::shared_ptr config) { + server_authorization_check_config_ = config; + } /** Creates C struct for TLS credential options. **/ grpc_tls_credentials_options* c_credentials_options() const; private: grpc_ssl_client_certificate_request_type cert_request_type_; - std::shared_ptr key_materials_config_; + ::std::shared_ptr key_materials_config_; + ::std::shared_ptr credential_reload_config_; + ::std::shared_ptr server_authorization_check_config_; + }; } // namespace experimental From 83302c759e6d816301af54932d184fb51258d686 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Thu, 1 Aug 2019 08:39:28 -0700 Subject: [PATCH 07/70] Added secure public header to grpc++_unsecure dependencies --- BUILD | 3 ++- CMakeLists.txt | 1 + Makefile | 1 + build.yaml | 4 ++++ tools/run_tests/generated/sources_and_headers.json | 8 ++++++-- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/BUILD b/BUILD index dadc1550a9b..af411526c31 100644 --- a/BUILD +++ b/BUILD @@ -388,6 +388,7 @@ grpc_cc_library( "src/cpp/server/insecure_server_credentials.cc", ], language = "c++", + public_hdrs= GRPC_SECURE_PUBLIC_HDRS, standalone = True, deps = [ "gpr", @@ -2013,7 +2014,7 @@ grpc_cc_library( srcs = GRPCXX_SRCS, hdrs = GRPCXX_HDRS, language = "c++", - public_hdrs = GRPCXX_PUBLIC_HDRS, + public_hdrs = GRPCXX_PUBLIC_HDRS + GRPC_SECURE_PUBLIC_HDRS, deps = [ "grpc++_codegen_base", "grpc_unsecure", diff --git a/CMakeLists.txt b/CMakeLists.txt index fb863dc8416..4e60b6f816d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4224,6 +4224,7 @@ target_link_libraries(grpc++_unsecure ) foreach(_hdr + include/grpc/grpc_security.h include/grpc++/alarm.h include/grpc++/channel.h include/grpc++/client_context.h diff --git a/Makefile b/Makefile index e4eb3c51f60..01f5e55c41d 100644 --- a/Makefile +++ b/Makefile @@ -6534,6 +6534,7 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/codegen/codegen_init.cc \ PUBLIC_HEADERS_CXX += \ + include/grpc/grpc_security.h \ include/grpc++/alarm.h \ include/grpc++/channel.h \ include/grpc++/client_context.h \ diff --git a/build.yaml b/build.yaml index 7c4a6cb37e4..bc97b03084b 100644 --- a/build.yaml +++ b/build.yaml @@ -257,6 +257,8 @@ filegroups: - grpc++_common - grpc++_codegen_base - name: grpc++_base_unsecure + public_headers: + - include/grpc/grpc_security.h deps: - grpc_unsecure uses: @@ -1953,6 +1955,8 @@ libs: - grpc++_base_unsecure - grpc++_codegen_base - grpc++_codegen_base_src + public headers: + - include/grpc/grpc_security.h secure: false - name: grpc_benchmark build: test diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 15f8d90b792..f91cbfe0814 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -8543,11 +8543,15 @@ "grpc++_common", "grpc_unsecure" ], - "headers": [], + "headers": [ + "include/grpc/grpc_security.h" + ], "is_filegroup": true, "language": "c", "name": "grpc++_base_unsecure", - "src": [], + "src": [ + "include/grpc/grpc_security.h" + ], "third_party": false, "type": "filegroup" }, From 5da4baa80daf58e1b4d9f9ad18ef174cadfea9a7 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Thu, 1 Aug 2019 08:55:36 -0700 Subject: [PATCH 08/70] Fixed typo in define guard --- include/grpcpp/security/tls_credentials_options.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index ba7ac469b8b..e7265143159 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -262,5 +262,6 @@ class TlsCredentialsOptions { } // namespace experimental } // namespace grpc_impl -#endif /** GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H **/ + +#endif // GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H From 5980d0d10d8ef6227886381206b93d54fce3c3e8 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Fri, 2 Aug 2019 09:38:35 -0700 Subject: [PATCH 09/70] Added unit tests and fixed some build problems --- include/grpcpp/security/credentials_impl.h | 2 +- .../grpcpp/security/server_credentials_impl.h | 2 +- .../grpcpp/security/tls_credentials_options.h | 129 ++++++++---------- src/cpp/client/secure_credentials.cc | 4 +- src/cpp/client/secure_credentials.h | 2 +- src/cpp/common/tls_credentials_options.cc | 92 ++++++++++++- test/cpp/client/credentials_test.cc | 108 +++++++++++++++ 7 files changed, 257 insertions(+), 82 deletions(-) diff --git a/include/grpcpp/security/credentials_impl.h b/include/grpcpp/security/credentials_impl.h index 4d7f83e4278..399c43b69ff 100644 --- a/include/grpcpp/security/credentials_impl.h +++ b/include/grpcpp/security/credentials_impl.h @@ -28,10 +28,10 @@ #include #include #include +#include #include #include #include -#include struct grpc_call; diff --git a/include/grpcpp/security/server_credentials_impl.h b/include/grpcpp/security/server_credentials_impl.h index 3b9d24395c6..eaf62cc88c7 100644 --- a/include/grpcpp/security/server_credentials_impl.h +++ b/include/grpcpp/security/server_credentials_impl.h @@ -24,8 +24,8 @@ #include #include -#include #include +#include struct grpc_server; diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index e7265143159..83d986260e8 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -19,12 +19,12 @@ #ifndef GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H #define GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H -#include #include +#include -#include -#include #include +#include +#include namespace grpc_impl { namespace experimental { @@ -38,9 +38,7 @@ class TlsKeyMaterialsConfig { }; /** Getters for member fields. **/ - const ::grpc::string pem_root_certs() const { - return pem_root_certs_; - } + const ::grpc::string pem_root_certs() const { return pem_root_certs_; } const ::std::vector& pem_key_cert_pair_list() const { return pem_key_cert_pair_list_; } @@ -60,31 +58,25 @@ class TlsKeyMaterialsConfig { /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ typedef class TlsCredentialReloadArg TlsCredentialReloadArg; -typedef void (*grpcpp_tls_on_credential_reload_done_cb)(TlsCredentialReloadArg* arg); +typedef void (*grpcpp_tls_on_credential_reload_done_cb)( + TlsCredentialReloadArg* arg); class TlsCredentialReloadArg { public: /** Getters for member fields. **/ - grpcpp_tls_on_credential_reload_done_cb cb() const { - return cb_; - } - void* cb_user_data() const { - return cb_user_data_; - } + grpcpp_tls_on_credential_reload_done_cb cb() const { return cb_; } + void* cb_user_data() const { return cb_user_data_; } ::std::shared_ptr key_materials_config() const { return key_materials_config_; } - grpc_ssl_certificate_config_reload_status status() const { - return status_; - } - ::grpc::string error_details() const { - return error_details_; - } + grpc_ssl_certificate_config_reload_status status() const { return status_; } + ::grpc::string error_details() const { return error_details_; } /** Setters for member fields. **/ void set_cb(grpcpp_tls_on_credential_reload_done_cb cb); void set_cb_user_data(void* cb_user_data); - void set_key_materials_config(::std::shared_ptr key_materials_config); + void set_key_materials_config( + ::std::shared_ptr key_materials_config); void set_status(grpc_ssl_certificate_config_reload_status status); void set_error_details(::grpc::string error_details); @@ -102,11 +94,12 @@ class TlsCredentialReloadArg { /** TLS credential reloag config, wraps grpc_tls_credential_reload_config. **/ class TlsCredentialReloadConfig { public: - TlsCredentialReloadConfig( - const void* config_user_data, - int (*schedule)(void* config_user_data, TlsCredentialReloadArg* arg), - void (*cancel)(void* config_user_data, TlsCredentialReloadArg* arg), - void (*destruct)(void* config_user_data)); + TlsCredentialReloadConfig(const void* config_user_data, + int (*schedule)(void* config_user_data, + TlsCredentialReloadArg* arg), + void (*cancel)(void* config_user_data, + TlsCredentialReloadArg* arg), + void (*destruct)(void* config_user_data)); ~TlsCredentialReloadConfig(); int Schedule(TlsCredentialReloadArg* arg) const { @@ -121,7 +114,7 @@ class TlsCredentialReloadConfig { cancel_(config_user_data_, arg); } -grpc_tls_credential_reload_config* c_credential_reload() const; + grpc_tls_credential_reload_config* c_credential_reload() const; private: void* config_user_data_; @@ -140,35 +133,26 @@ typedef void (*grpcpp_tls_on_server_authorization_check_done_cb)( class TlsServerAuthorizationCheckArg { public: /** Getters for member fields. **/ - grpcpp_tls_on_server_authorization_check_done_cb cb() const { - return cb_; - } - void* cb_user_data() const { - return cb_user_data_; - } - int success() const { - return success_; - } - ::grpc::string peer_cert() const { - return peer_cert_; - } - grpc_status_code status() const { - return status_; - } - ::grpc::string error_details() const { - return error_details_; - } + grpcpp_tls_on_server_authorization_check_done_cb cb() const { return cb_; } + void* cb_user_data() const { return cb_user_data_; } + int success() const { return success_; } + ::grpc::string peer_cert() const { return peer_cert_; } + grpc_status_code status() const { return status_; } + ::grpc::string error_details() const { return error_details_; } /** Setters for member fields. **/ - void set_cb(grpcpp_tls_on_server_authorization_check_done_cb cb); - void set_cb_user_data(void* cb_user_data); - void set_success(int success); - void set_peer_cert(::grpc::string peer_cert); - void set_status(grpc_status_code status); - void set_error_details(::grpc::string error_details); + void set_cb(grpcpp_tls_on_server_authorization_check_done_cb cb) { cb_ = cb; } + void set_cb_user_data(void* cb_user_data) { cb_user_data_ = cb_user_data; } + void set_success(int success) { success_ = success; } + void set_peer_cert(::grpc::string peer_cert) { peer_cert_ = peer_cert; } + void set_status(grpc_status_code status) { status_ = status; } + void set_error_details(::grpc::string error_details) { + error_details_ = error_details; + } - /** Creates C struct for credential reload arg. **/ - grpc_tls_credential_reload_arg* c_credential_reload_arg() const; + /** Creates C struct for server authorization check arg. **/ + grpc_tls_server_authorization_check_arg* c_server_authorization_check_arg() + const; private: grpcpp_tls_on_server_authorization_check_done_cb cb_; @@ -180,15 +164,16 @@ class TlsServerAuthorizationCheckArg { ::grpc::string error_details_; }; - /** TLS server authorization check config, wraps * grps_tls_server_authorization_check_config. **/ class TlsServerAuthorizationCheckConfig { public: TlsServerAuthorizationCheckConfig( const void* config_user_data, - int (*schedule)(void* config_user_data, TlsServerAuthorizationCheckArg* arg), - void (*cancel)(void* config_user_data, TlsServerAuthorizationCheckArg* arg), + int (*schedule)(void* config_user_data, + TlsServerAuthorizationCheckArg* arg), + void (*cancel)(void* config_user_data, + TlsServerAuthorizationCheckArg* arg), void (*destruct)(void* config_user_data)); ~TlsServerAuthorizationCheckConfig(); @@ -204,30 +189,32 @@ class TlsServerAuthorizationCheckConfig { cancel_(config_user_data_, arg); } - grpc_tls_server_authorization_check_config* c_server_authorization_check() const; + grpc_tls_server_authorization_check_config* c_server_authorization_check() + const; private: - void* config_user_data_; - int (*schedule_)(void* config_user_data, TlsServerAuthorizationCheckArg* arg); - void (*cancel_)(void* config_user_data, TlsServerAuthorizationCheckArg* arg); - void (*destruct_)(void* config_user_data); + void* config_user_data_; + int (*schedule_)(void* config_user_data, TlsServerAuthorizationCheckArg* arg); + void (*cancel_)(void* config_user_data, TlsServerAuthorizationCheckArg* arg); + void (*destruct_)(void* config_user_data); }; - /** TLS credentials options, wrapper for grpc_tls_credentials_options. **/ class TlsCredentialsOptions { public: /** Getters for member fields. **/ - grpc_ssl_client_certificate_request_type cert_request_type() const{ + grpc_ssl_client_certificate_request_type cert_request_type() const { return cert_request_type_; } std::shared_ptr key_materials_config() const { return key_materials_config_; } - ::std::shared_ptr credential_reload_config() const { + ::std::shared_ptr credential_reload_config() + const { return credential_reload_config_; } - ::std::shared_ptr server_authorization_check_config() const { + ::std::shared_ptr + server_authorization_check_config() const { return server_authorization_check_config_; } @@ -236,8 +223,7 @@ class TlsCredentialsOptions { const grpc_ssl_client_certificate_request_type type) { cert_request_type_ = type; } - void set_key_materials_config( - std::shared_ptr config) { + void set_key_materials_config(std::shared_ptr config) { key_materials_config_ = config; } void set_credential_reload_config( @@ -256,12 +242,11 @@ class TlsCredentialsOptions { grpc_ssl_client_certificate_request_type cert_request_type_; ::std::shared_ptr key_materials_config_; ::std::shared_ptr credential_reload_config_; - ::std::shared_ptr server_authorization_check_config_; - + ::std::shared_ptr + server_authorization_check_config_; }; -} // namespace experimental -} // namespace grpc_impl - -#endif // GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H +} // namespace experimental +} // namespace grpc_impl +#endif // GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index b3b2bf4b554..86971ff605c 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -283,8 +283,8 @@ std::shared_ptr LocalCredentials( // Builds SPIFFE Credentials given TLS options. std::shared_ptr SpiffeCredentials( const TlsCredentialsOptions& options) { - return WrapChannelCredentials(grpc_tls_spiffe_credentials_create( - options.c_credentials_options())); + return WrapChannelCredentials( + grpc_tls_spiffe_credentials_create(options.c_credentials_options())); } } // namespace experimental diff --git a/src/cpp/client/secure_credentials.h b/src/cpp/client/secure_credentials.h index 1f3e667fe72..2c817270ad9 100644 --- a/src/cpp/client/secure_credentials.h +++ b/src/cpp/client/secure_credentials.h @@ -23,8 +23,8 @@ #include #include -#include #include +#include #include "src/core/lib/security/credentials/credentials.h" #include "src/cpp/server/thread_pool_interface.h" diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index b34c155a4e1..6b26f47ff31 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -31,9 +31,92 @@ void TlsKeyMaterialsConfig::set_key_materials( pem_root_certs_ = ::std::move(pem_root_certs); } +grpc_tls_key_materials_config* TlsKeyMaterialsConfig::c_key_materials() const { + // TODO: implement. + return nullptr; +} + +/** gRPC TLS credential reload arg API implementation **/ +void TlsCredentialReloadArg::set_cb( + grpcpp_tls_on_credential_reload_done_cb cb) { + cb_ = cb; +} + +void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { + cb_user_data_ = cb_user_data; +} + +void TlsCredentialReloadArg::set_key_materials_config( + ::std::shared_ptr key_materials_config) { + key_materials_config_ = key_materials_config; +} + +void TlsCredentialReloadArg::set_status( + grpc_ssl_certificate_config_reload_status status) { + status_ = status; +} + +void TlsCredentialReloadArg::set_error_details(::grpc::string error_details) { + error_details_ = error_details; +} + +grpc_tls_credential_reload_arg* +TlsCredentialReloadArg::c_credential_reload_arg() const { + // TODO: implement. + return nullptr; +} + +/** gRPC TLS credential reload config API implementation **/ +TlsCredentialReloadConfig::TlsCredentialReloadConfig( + const void* config_user_data, + int (*schedule)(void* config_user_data, TlsCredentialReloadArg* arg), + void (*cancel)(void* config_user_data, TlsCredentialReloadArg* arg), + void (*destruct)(void* config_user_data)) + : config_user_data_(const_cast(config_user_data)), + schedule_(schedule), + cancel_(cancel), + destruct_(destruct) {} + +TlsCredentialReloadConfig::~TlsCredentialReloadConfig() {} + +grpc_tls_credential_reload_config* +TlsCredentialReloadConfig::c_credential_reload() const { + // TODO: implement + return nullptr; +} + +/** gRPC TLS server authorization check arg API implementation **/ +grpc_tls_server_authorization_check_arg* +TlsServerAuthorizationCheckArg::c_server_authorization_check_arg() const { + // TODO: implement + return nullptr; +} + +/** gRPC TLS server authorization check config API implementation **/ +TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( + const void* config_user_data, + int (*schedule)(void* config_user_data, + TlsServerAuthorizationCheckArg* arg), + void (*cancel)(void* config_user_data, TlsServerAuthorizationCheckArg* arg), + void (*destruct)(void* config_user_data)) + : config_user_data_(const_cast(config_user_data)), + schedule_(schedule), + cancel_(cancel), + destruct_(destruct) {} + +TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() {} + +grpc_tls_server_authorization_check_config* +TlsServerAuthorizationCheckConfig::c_server_authorization_check() const { + // TODO: implement + return nullptr; +} + /** gRPC TLS credential options API implementation **/ -grpc_tls_credentials_options* TlsCredentialsOptions::c_credentials_options() const { - grpc_tls_credentials_options* c_options = grpc_tls_credentials_options_create(); +grpc_tls_credentials_options* TlsCredentialsOptions::c_credentials_options() + const { + grpc_tls_credentials_options* c_options = + grpc_tls_credentials_options_create(); c_options->set_cert_request_type(cert_request_type_); // TODO: put in C configs into functions below. c_options->set_key_materials_config(nullptr); @@ -42,6 +125,5 @@ grpc_tls_credentials_options* TlsCredentialsOptions::c_credentials_options() con return c_options; } -} // namespace experimental -} // namespace grpc_impl - +} // namespace experimental +} // namespace grpc_impl diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index ba004efe0d9..a28328e1ab6 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -26,7 +26,9 @@ #include "src/core/lib/gpr/env.h" #include "src/core/lib/gpr/tmpfile.h" +#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" #include "src/cpp/client/secure_credentials.h" +#include "src/cpp/common/tls_credentials_options.cc" namespace grpc { namespace testing { @@ -196,6 +198,112 @@ TEST_F(CredentialsTest, StsCredentialsOptionsFromEnv) { gpr_unsetenv("STS_CREDENTIALS"); } +typedef class ::grpc_impl::experimental::TlsKeyMaterialsConfig + TlsKeyMaterialsConfig; + +TEST_F(CredentialsTest, TlsKeyMaterialsConfigCppToC) { + TlsKeyMaterialsConfig config; + struct TlsKeyMaterialsConfig::PemKeyCertPair pair = {"private_key", + "cert_chain"}; + ::std::vector pair_list = {pair}; + config.set_key_materials("pem_root_certs", pair_list); + grpc_tls_key_materials_config* c_config = config.c_key_materials(); + EXPECT_STREQ("pem_root_certs", c_config->pem_root_certs()); + EXPECT_EQ(1, static_cast(c_config->pem_key_cert_pair_list().size())); + EXPECT_STREQ(pair.private_key.c_str(), + c_config->pem_key_cert_pair_list()[0].private_key()); + EXPECT_STREQ(pair.cert_chain.c_str(), + c_config->pem_key_cert_pair_list()[0].cert_chain()); +} + +typedef class ::grpc_impl::experimental::TlsCredentialReloadArg + TlsCredentialReloadArg; +typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig + TlsCredentialReloadConfig; + +TEST_F(CredentialsTest, TlsCredentialReloadArgCppToC) { + TlsCredentialReloadArg arg; + // Only sync credential reload supported currently, + // so we use a nullptr call back function. + arg.set_cb(nullptr); + arg.set_cb_user_data(nullptr); + arg.set_key_materials_config(nullptr); + arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + arg.set_error_details("error_details"); + grpc_tls_credential_reload_arg* c_arg = arg.c_credential_reload_arg(); + EXPECT_NE(c_arg, nullptr); + EXPECT_EQ(c_arg->cb, nullptr); + EXPECT_EQ(c_arg->cb_user_data, nullptr); + EXPECT_EQ(c_arg->key_materials_config, nullptr); + EXPECT_EQ(c_arg->status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + EXPECT_STREQ(c_arg->error_details, "error_details"); +} + +TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { + TlsCredentialReloadConfig config = + TlsCredentialReloadConfig(nullptr, nullptr, nullptr, nullptr); + grpc_tls_credential_reload_config* c_config = config.c_credential_reload(); + EXPECT_NE(c_config, nullptr); + // TODO: add tests to compare schedule, cancel, destruct fields. +} + +typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckArg + TlsServerAuthorizationCheckArg; +typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckConfig + TlsServerAuthorizationCheckConfig; + +TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCppToC) { + TlsServerAuthorizationCheckArg arg; + // Only sync server authorization check supported currently, + // so we use a nullptr call back function. + arg.set_cb(nullptr); + arg.set_cb_user_data(nullptr); + arg.set_success(1); + arg.set_peer_cert("peer_cert"); + arg.set_status(GRPC_STATUS_OK); + arg.set_error_details("error_details"); + grpc_tls_server_authorization_check_arg* c_arg = + arg.c_server_authorization_check_arg(); + EXPECT_NE(c_arg, nullptr); + EXPECT_EQ(c_arg->cb, nullptr); + EXPECT_EQ(c_arg->cb_user_data, nullptr); + EXPECT_EQ(c_arg->success, 1); + EXPECT_STREQ(c_arg->peer_cert, "peer_cert"); + EXPECT_EQ(c_arg->status, GRPC_STATUS_OK); + EXPECT_STREQ(c_arg->error_details, "error_details"); +} + +TEST_F(CredentialsTest, TlsServerAuthorizationCheckCppToC) { + TlsServerAuthorizationCheckConfig config = + TlsServerAuthorizationCheckConfig(nullptr, nullptr, nullptr, nullptr); + grpc_tls_server_authorization_check_config* c_config = + config.c_server_authorization_check(); + EXPECT_NE(c_config, nullptr); + // TODO: add tests to compare schedule, cancel, destruct fields. +} + +typedef class ::grpc_impl::experimental::TlsCredentialsOptions + TlsCredentialsOptions; + +TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { + TlsCredentialsOptions options; + options.set_cert_request_type(GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY); + ::std::shared_ptr key_materials_config( + new TlsKeyMaterialsConfig()); + struct TlsKeyMaterialsConfig::PemKeyCertPair pair = {"private_key", + "cert_chain"}; + ::std::vector pair_list = {pair}; + key_materials_config->set_key_materials("pem_root_certs", pair_list); + options.set_key_materials_config(key_materials_config); + // TODO: add instances of credential reload and server authorization check to + // options. + grpc_tls_credentials_options* c_options = options.c_credentials_options(); + EXPECT_EQ(c_options->cert_request_type(), + GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY); + EXPECT_EQ(c_options->key_materials_config(), + key_materials_config->c_key_materials()); +} + } // namespace testing } // namespace grpc From c5acf9e3c73f1da1a5e1655fb70c09e2cad0e1ef Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Fri, 2 Aug 2019 10:31:53 -0700 Subject: [PATCH 10/70] Fixed undeclared dependency and added std::move in setter functions --- test/cpp/client/credentials_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index a28328e1ab6..26f8cdad386 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -17,6 +17,7 @@ */ #include +#include #include @@ -28,7 +29,6 @@ #include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" #include "src/cpp/client/secure_credentials.h" -#include "src/cpp/common/tls_credentials_options.cc" namespace grpc { namespace testing { From aa207510ce2101907c3612926ee2392db423f396 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 7 Aug 2019 15:53:26 -0700 Subject: [PATCH 11/70] Finished implementation of API's. --- .../grpcpp/security/tls_credentials_options.h | 25 ++- .../security/security_connector/ssl_utils.h | 16 +- src/cpp/common/tls_credentials_options.cc | 206 ++++++++++++++++-- test/cpp/client/credentials_test.cc | 2 +- 4 files changed, 223 insertions(+), 26 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 83d986260e8..0ff187d66a9 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -19,6 +19,7 @@ #ifndef GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H #define GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H +#include #include #include @@ -83,6 +84,9 @@ class TlsCredentialReloadArg { /** Creates C struct for credential reload arg. **/ grpc_tls_credential_reload_arg* c_credential_reload_arg() const; + /** Creates C callback function from C++ callback function. **/ + grpc_tls_on_credential_reload_done_cb c_callback() const; + private: grpcpp_tls_on_credential_reload_done_cb cb_; void* cb_user_data_; @@ -136,6 +140,7 @@ class TlsServerAuthorizationCheckArg { grpcpp_tls_on_server_authorization_check_done_cb cb() const { return cb_; } void* cb_user_data() const { return cb_user_data_; } int success() const { return success_; } + ::grpc::string target_name() const { return target_name_; } ::grpc::string peer_cert() const { return peer_cert_; } grpc_status_code status() const { return status_; } ::grpc::string error_details() const { return error_details_; } @@ -143,17 +148,25 @@ class TlsServerAuthorizationCheckArg { /** Setters for member fields. **/ void set_cb(grpcpp_tls_on_server_authorization_check_done_cb cb) { cb_ = cb; } void set_cb_user_data(void* cb_user_data) { cb_user_data_ = cb_user_data; } - void set_success(int success) { success_ = success; } - void set_peer_cert(::grpc::string peer_cert) { peer_cert_ = peer_cert; } + void set_success(int success) { success_ = success; }; + void set_target_name(::grpc::string target_name) { + target_name_ = target_name; + } + void set_peer_cert(::grpc::string peer_cert) { + peer_cert_ = ::std::move(peer_cert); + } void set_status(grpc_status_code status) { status_ = status; } void set_error_details(::grpc::string error_details) { - error_details_ = error_details; + error_details_ = ::std::move(error_details); } /** Creates C struct for server authorization check arg. **/ grpc_tls_server_authorization_check_arg* c_server_authorization_check_arg() const; + /** Creates C callback function from C++ callback function. **/ + grpc_tls_on_server_authorization_check_done_cb c_callback() const; + private: grpcpp_tls_on_server_authorization_check_done_cb cb_; void* cb_user_data_; @@ -224,15 +237,15 @@ class TlsCredentialsOptions { cert_request_type_ = type; } void set_key_materials_config(std::shared_ptr config) { - key_materials_config_ = config; + key_materials_config_ = ::std::move(config); } void set_credential_reload_config( ::std::shared_ptr config) { - credential_reload_config_ = config; + credential_reload_config_ = ::std::move(config); } void set_server_authorization_check_config( ::std::shared_ptr config) { - server_authorization_check_config_ = config; + server_authorization_check_config_ = ::std::move(config); } /** Creates C struct for TLS credential options. **/ diff --git a/src/core/lib/security/security_connector/ssl_utils.h b/src/core/lib/security/security_connector/ssl_utils.h index bf8c1de3aae..0277b06dfaf 100644 --- a/src/core/lib/security/security_connector/ssl_utils.h +++ b/src/core/lib/security/security_connector/ssl_utils.h @@ -149,9 +149,19 @@ class PemKeyCertPair { return *this; } - // Not copyable. - PemKeyCertPair(const PemKeyCertPair&) = delete; - PemKeyCertPair& operator=(const PemKeyCertPair&) = delete; + // Copyable. + PemKeyCertPair(const PemKeyCertPair& other) + : private_key_(gpr_strdup(other.private_key())), + cert_chain_(gpr_strdup(other.cert_chain())) {} + PemKeyCertPair& operator=(const PemKeyCertPair& other) { + auto private_key = + grpc_core::UniquePtr(gpr_strdup(other.private_key())); + auto cert_chain = + grpc_core::UniquePtr(gpr_strdup(other.cert_chain())); + private_key_ = std::move(private_key); + cert_chain_ = std::move(cert_chain); + return *this; + } char* private_key() const { return private_key_.get(); } char* cert_chain() const { return cert_chain_.get(); } diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 6b26f47ff31..535958cd50a 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -32,8 +32,53 @@ void TlsKeyMaterialsConfig::set_key_materials( } grpc_tls_key_materials_config* TlsKeyMaterialsConfig::c_key_materials() const { - // TODO: implement. - return nullptr; + grpc_tls_key_materials_config* c_config = + grpc_tls_key_materials_config_create(); + ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> + c_pem_key_cert_pair_list; + for (auto key_cert_pair = pem_key_cert_pair_list_.begin(); + key_cert_pair != pem_key_cert_pair_list_.end(); key_cert_pair++) { + grpc_ssl_pem_key_cert_pair p = {key_cert_pair->private_key.c_str(), + key_cert_pair->cert_chain.c_str()}; + ::grpc_core::PemKeyCertPair c_pem_key_cert_pair = + ::grpc_core::PemKeyCertPair(&p); + c_pem_key_cert_pair_list.push_back(::std::move(c_pem_key_cert_pair)); + } + ::grpc_core::UniquePtr c_pem_root_certs( + gpr_strdup(pem_root_certs_.c_str())); + c_config->set_key_materials(::std::move(c_pem_root_certs), + ::std::move(c_pem_key_cert_pair_list)); + return c_config; +} + +/** Creates smart pointer to a C++ version of the C key materials. **/ +::std::shared_ptr cpp_key_materials( + const grpc_tls_key_materials_config* config) { + ::std::shared_ptr cpp_config( + new TlsKeyMaterialsConfig()); + ::std::vector + cpp_pem_key_cert_pair_list; + /** for (auto key_cert_pair = config->pem_key_cert_pair_list().begin(); + key_cert_pair != config->pem_key_cert_pair_list().end(); key_cert_pair++) + { TlsKeyMaterialsConfig::PemKeyCertPair p = {key_cert_pair->private_key, + key_cert_pair->cert_chain}; + cpp_pem_key_cert_pair_list.push_back(::std::move(p)); + } + **/ + // TODO: add begin() and end() to InlinedVector so above for loop works + grpc_tls_key_materials_config::PemKeyCertPairList pem_key_cert_pair_list = + config->pem_key_cert_pair_list(); + for (size_t i = 0; i < pem_key_cert_pair_list.size(); i++) { + ::grpc_core::PemKeyCertPair key_cert_pair = pem_key_cert_pair_list[i]; + TlsKeyMaterialsConfig::PemKeyCertPair p = { + gpr_strdup(key_cert_pair.private_key()), + gpr_strdup(key_cert_pair.cert_chain())}; + cpp_pem_key_cert_pair_list.push_back(::std::move(p)); + } + cpp_config->set_key_materials( + ::std::move(gpr_strdup(config->pem_root_certs())), + ::std::move(cpp_pem_key_cert_pair_list)); + return cpp_config; } /** gRPC TLS credential reload arg API implementation **/ @@ -48,7 +93,7 @@ void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { void TlsCredentialReloadArg::set_key_materials_config( ::std::shared_ptr key_materials_config) { - key_materials_config_ = key_materials_config; + key_materials_config_ = ::std::move(key_materials_config); } void TlsCredentialReloadArg::set_status( @@ -57,13 +102,43 @@ void TlsCredentialReloadArg::set_status( } void TlsCredentialReloadArg::set_error_details(::grpc::string error_details) { - error_details_ = error_details; + error_details_ = ::std::move(error_details); +} + +/** Creates a smart pointer to a C++ version of the credential reload argument, + * with the callback function set to a nullptr. **/ +::std::unique_ptr tls_credential_reload_arg_c_to_cpp( + const grpc_tls_credential_reload_arg* arg) { + ::std::unique_ptr cpp_arg( + new TlsCredentialReloadArg()); + cpp_arg->set_cb(nullptr); + cpp_arg->set_cb_user_data(arg->cb_user_data); + cpp_arg->set_key_materials_config( + cpp_key_materials(arg->key_materials_config)); + cpp_arg->set_status(arg->status); + cpp_arg->set_error_details(arg->error_details); + return cpp_arg; +} + +grpc_tls_on_credential_reload_done_cb TlsCredentialReloadArg::c_callback() + const { + grpcpp_tls_on_credential_reload_done_cb cpp_cb = cb_; + std::function c_cb = + [cpp_cb](grpc_tls_credential_reload_arg* arg) { + return cpp_cb(tls_credential_reload_arg_c_to_cpp(arg).get()); + }; + return *(c_cb.target()); } grpc_tls_credential_reload_arg* TlsCredentialReloadArg::c_credential_reload_arg() const { - // TODO: implement. - return nullptr; + grpc_tls_credential_reload_arg* c_arg = new grpc_tls_credential_reload_arg(); + c_arg->cb = this->c_callback(); + c_arg->cb_user_data = cb_user_data_; + c_arg->key_materials_config = key_materials_config_->c_key_materials(); + c_arg->status = status_; + c_arg->error_details = gpr_strdup(error_details_.c_str()); + return c_arg; } /** gRPC TLS credential reload config API implementation **/ @@ -81,15 +156,79 @@ TlsCredentialReloadConfig::~TlsCredentialReloadConfig() {} grpc_tls_credential_reload_config* TlsCredentialReloadConfig::c_credential_reload() const { - // TODO: implement - return nullptr; + typedef int (*grpcpp_tls_credential_reload_schedule)( + void* config_user_data, TlsCredentialReloadArg* arg); + grpcpp_tls_credential_reload_schedule cpp_schedule = schedule_; + typedef int (*grpc_tls_credential_reload_schedule)( + void* config_user_data, grpc_tls_credential_reload_arg* arg); + std::function c_schedule = + [cpp_schedule](void* config_user_data, + grpc_tls_credential_reload_arg* arg) { + return cpp_schedule(config_user_data, + tls_credential_reload_arg_c_to_cpp(arg).get()); + }; + + typedef void (*grpcpp_tls_credential_reload_cancel)( + void* config_user_data, TlsCredentialReloadArg* arg); + grpcpp_tls_credential_reload_cancel cpp_cancel = cancel_; + typedef void (*grpc_tls_credential_reload_cancel)( + void* config_user_data, grpc_tls_credential_reload_arg* arg); + std::function c_cancel = + [cpp_cancel](void* config_user_data, + grpc_tls_credential_reload_arg* arg) { + return cpp_cancel(config_user_data, + tls_credential_reload_arg_c_to_cpp(arg).get()); + }; + + grpc_tls_credential_reload_config* c_config = + grpc_tls_credential_reload_config_create( + const_cast(config_user_data_), + *(c_schedule.target()), + *(c_cancel.target()), destruct_); + return c_config; } /** gRPC TLS server authorization check arg API implementation **/ + +/** Creates a smart pointer to a C++ version of the credential reload argument, + * with the callback function set to a nullptr. **/ +::std::unique_ptr +tls_server_authorization_check_arg_c_to_cpp( + const grpc_tls_server_authorization_check_arg* arg) { + ::std::unique_ptr cpp_arg( + new TlsServerAuthorizationCheckArg()); + cpp_arg->set_cb(nullptr); + cpp_arg->set_cb_user_data(arg->cb_user_data); + cpp_arg->set_success(arg->success); + cpp_arg->set_target_name(arg->target_name); + cpp_arg->set_peer_cert(arg->peer_cert); + cpp_arg->set_status(arg->status); + cpp_arg->set_error_details(arg->error_details); + return cpp_arg; +} + +grpc_tls_on_server_authorization_check_done_cb +TlsServerAuthorizationCheckArg::c_callback() const { + grpcpp_tls_on_server_authorization_check_done_cb cpp_cb = cb_; + std::function c_cb = + [cpp_cb](grpc_tls_server_authorization_check_arg* arg) { + return cpp_cb(tls_server_authorization_check_arg_c_to_cpp(arg).get()); + }; + return *(c_cb.target()); +} + grpc_tls_server_authorization_check_arg* TlsServerAuthorizationCheckArg::c_server_authorization_check_arg() const { - // TODO: implement - return nullptr; + grpc_tls_server_authorization_check_arg* c_arg = + new grpc_tls_server_authorization_check_arg(); + c_arg->cb = this->c_callback(); + c_arg->cb_user_data = cb_user_data_; + c_arg->success = success_; + c_arg->target_name = gpr_strdup(target_name_.c_str()); + c_arg->peer_cert = gpr_strdup(peer_cert_.c_str()); + c_arg->status = status_; + c_arg->error_details = gpr_strdup(error_details_.c_str()); + return c_arg; } /** gRPC TLS server authorization check config API implementation **/ @@ -108,8 +247,38 @@ TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() {} grpc_tls_server_authorization_check_config* TlsServerAuthorizationCheckConfig::c_server_authorization_check() const { - // TODO: implement - return nullptr; + typedef int (*grpcpp_tls_server_authorization_check_schedule)( + void* config_user_data, TlsServerAuthorizationCheckArg* arg); + grpcpp_tls_server_authorization_check_schedule cpp_schedule = schedule_; + typedef int (*grpc_tls_server_authorization_check_schedule)( + void* config_user_data, grpc_tls_server_authorization_check_arg* arg); + std::function + c_schedule = + [cpp_schedule](void* config_user_data, + grpc_tls_server_authorization_check_arg* arg) { + return cpp_schedule( + config_user_data, + tls_server_authorization_check_arg_c_to_cpp(arg).get()); + }; + typedef void (*grpcpp_tls_server_authorization_check_cancel)( + void* config_user_data, TlsServerAuthorizationCheckArg* arg); + grpcpp_tls_server_authorization_check_cancel cpp_cancel = cancel_; + typedef void (*grpc_tls_server_authorization_check_cancel)( + void* config_user_data, grpc_tls_server_authorization_check_arg* arg); + std::function + c_cancel = [cpp_cancel](void* config_user_data, + grpc_tls_server_authorization_check_arg* arg) { + return cpp_cancel( + config_user_data, + tls_server_authorization_check_arg_c_to_cpp(arg).get()); + }; + grpc_tls_server_authorization_check_config* c_config = + grpc_tls_server_authorization_check_config_create( + const_cast(config_user_data_), + *(c_schedule.target()), + *(c_cancel.target()), + destruct_); + return c_config; } /** gRPC TLS credential options API implementation **/ @@ -118,10 +287,15 @@ grpc_tls_credentials_options* TlsCredentialsOptions::c_credentials_options() grpc_tls_credentials_options* c_options = grpc_tls_credentials_options_create(); c_options->set_cert_request_type(cert_request_type_); - // TODO: put in C configs into functions below. - c_options->set_key_materials_config(nullptr); - c_options->set_credential_reload_config(nullptr); - c_options->set_server_authorization_check_config(nullptr); + c_options->set_key_materials_config( + ::grpc_core::RefCountedPtr( + key_materials_config_->c_key_materials())); + c_options->set_credential_reload_config( + ::grpc_core::RefCountedPtr( + credential_reload_config_->c_credential_reload())); + c_options->set_server_authorization_check_config( + ::grpc_core::RefCountedPtr( + server_authorization_check_config_->c_server_authorization_check())); return c_options; } diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 26f8cdad386..746ca6f525c 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -278,7 +278,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckCppToC) { TlsServerAuthorizationCheckConfig(nullptr, nullptr, nullptr, nullptr); grpc_tls_server_authorization_check_config* c_config = config.c_server_authorization_check(); - EXPECT_NE(c_config, nullptr); + EXPECT_EQ(c_config, nullptr); // Because c_server_authn_check not implemented // TODO: add tests to compare schedule, cancel, destruct fields. } From 094c35f87233a5c4280b76cfd5a14ccb293fcdeb Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Thu, 8 Aug 2019 22:54:06 -0700 Subject: [PATCH 12/70] Small changes to ssl_util.h, added comments, fixed error in key materials unit test --- XML_REPORT | 8 + XML_REPORT2 | 8 + XML_REPORT3 | 7 + XML_REPORT4 | 317 +++ XML_REPORT5 | 1929 +++++++++++++++++ .../grpcpp/security/tls_credentials_options.h | 18 +- ml | 7 + .../security/security_connector/ssl_utils.h | 4 + src/cpp/common/tls_credentials_options.cc | 28 +- test/cpp/client/credentials_test.cc | 55 +- 10 files changed, 2350 insertions(+), 31 deletions(-) create mode 100644 XML_REPORT create mode 100644 XML_REPORT2 create mode 100644 XML_REPORT3 create mode 100644 XML_REPORT4 create mode 100644 XML_REPORT5 create mode 100644 ml diff --git a/XML_REPORT b/XML_REPORT new file mode 100644 index 00000000000..8743f1be38f --- /dev/null +++ b/XML_REPORT @@ -0,0 +1,8 @@ + +Note: Google Test filter = CredentialsTest.TlsCredentialsOptionsCppToC +[==========] Running 1 test from 1 test case. +[----------] Global test environment set-up. +[----------] 1 test from CredentialsTest +[ RUN ] CredentialsTest.TlsCredentialsOptionsCppToC +free(): invalid pointer + \ No newline at end of file diff --git a/XML_REPORT2 b/XML_REPORT2 new file mode 100644 index 00000000000..f60b57dec56 --- /dev/null +++ b/XML_REPORT2 @@ -0,0 +1,8 @@ + +Note: Google Test filter = CredentialsTest.TlsKeyMaterialsConfigCppToC +[==========] Running 1 test from 1 test case. +[----------] Global test environment set-up. +[----------] 1 test from CredentialsTest +[ RUN ] CredentialsTest.TlsKeyMaterialsConfigCppToC +double free or corruption (out) + \ No newline at end of file diff --git a/XML_REPORT3 b/XML_REPORT3 new file mode 100644 index 00000000000..0d7f5f79e20 --- /dev/null +++ b/XML_REPORT3 @@ -0,0 +1,7 @@ + +Note: Google Test filter = CredentialsTest.TlsServerAuthorizationCheckCppToC +[==========] Running 1 test from 1 test case. +[----------] Global test environment set-up. +[----------] 1 test from CredentialsTest +[ RUN ] CredentialsTest.TlsServerAuthorizationCheckCppToC + \ No newline at end of file diff --git a/XML_REPORT4 b/XML_REPORT4 new file mode 100644 index 00000000000..cf8c00a461b --- /dev/null +++ b/XML_REPORT4 @@ -0,0 +1,317 @@ + +D0808 12:16:59.439965368 60382 ev_posix.cc:174] Using polling engine: poll +D0808 12:16:59.440103435 60382 dns_resolver_ares.cc:485] Using ares dns resolver + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. + +test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= + +test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): + File "test/cpp/naming/utils/dns_server.py", line 26, in <module> + import twisted +ImportError: No module named twisted + + +test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= +I0808 12:17:03.361937051 60382 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 + \ No newline at end of file diff --git a/XML_REPORT5 b/XML_REPORT5 new file mode 100644 index 00000000000..252ca68916b --- /dev/null +++ b/XML_REPORT5 @@ -0,0 +1,1929 @@ + +I0808 12:39:47.576792555 205590 ev_epoll1_linux.cc:116] grpc epoll fd: 3 +D0808 12:39:47.576928114 205590 ev_posix.cc:174] Using polling engine: epoll1 +D0808 12:39:47.577005168 205590 dns_resolver_ares.cc:485] Using ares dns resolver + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. + +test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= + +test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): + File "test/cpp/naming/utils/dns_server.py", line 26, in <module> + import twisted +ImportError: No module named twisted + + +test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= +I0808 12:39:51.471949290 205590 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 +Note: Google Test filter = CredentialsTest.TlsKeyMaterialsConfigCppToC +[==========] Running 1 test from 1 test case. +[----------] Global test environment set-up. +[----------] 1 test from CredentialsTest +[ RUN ] CredentialsTest.TlsKeyMaterialsConfigCppToC +free(): invalid size +D0808 13:08:09.009051003 209399 ev_posix.cc:174] Using polling engine: epollex +D0808 13:08:09.009199475 209399 dns_resolver_ares.cc:485] Using ares dns resolver + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. + +test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= + +test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): + File "test/cpp/naming/utils/dns_server.py", line 26, in <module> + import twisted +ImportError: No module named twisted + + +test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= +I0808 13:08:12.968479883 209399 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 +I0808 12:50:54.204121347 205404 grpclb_fallback_test.cc:258] Testing: +E0808 12:50:54.204261156 205404 grpclb_fallback_test.cc:272] Invalid test case: +D0808 12:39:47.883628014 206125 ev_posix.cc:174] Using polling engine: epollex +D0808 12:39:47.883874499 206125 dns_resolver_ares.cc:485] Using ares dns resolver + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. + +test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= + +test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): + File "test/cpp/naming/utils/dns_server.py", line 26, in <module> + import twisted +ImportError: No module named twisted + + +test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= +I0808 12:39:51.747517477 206125 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 +D0808 12:43:30.156117158 63878 ev_posix.cc:174] Using polling engine: epollex +D0808 12:43:30.156265819 63878 dns_resolver_ares.cc:485] Using ares dns resolver +2019-08-08 12:43:30 +Running bins/opt/bm_chttp2_transport +Run on (12 X 4500 MHz CPU s) +CPU Caches: + L1 Data 32K (x6) + L1 Instruction 32K (x6) + L2 Unified 1024K (x6) + L3 Unified 8448K (x1) +***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead. +D0808 12:50:40.655657256 201188 ev_posix.cc:174] Using polling engine: poll +D0808 12:50:40.655895634 201188 dns_resolver_ares.cc:485] Using ares dns resolver + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. + +test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= + +test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): + File "test/cpp/naming/utils/dns_server.py", line 26, in <module> + import twisted +ImportError: No module named twisted + + +test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= +I0808 12:50:44.660423630 201188 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 +I0808 13:20:19.460528718 95176 grpclb_fallback_test.cc:258] Testing: +E0808 13:20:19.460613245 95176 grpclb_fallback_test.cc:272] Invalid test case: +I0808 13:19:06.707675289 15650 grpclb_fallback_test.cc:258] Testing: +E0808 13:19:06.707884040 15650 grpclb_fallback_test.cc:272] Invalid test case: +D0808 13:30:21.952439902 156446 ev_posix.cc:174] Using polling engine: poll +D0808 13:30:21.952557775 156446 dns_resolver_ares.cc:485] Using ares dns resolver + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. + +test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= + +test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): + File "test/cpp/naming/utils/dns_server.py", line 26, in <module> + import twisted +ImportError: No module named twisted + + +test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= +I0808 13:30:25.881953250 156446 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 +Note: Google Test filter = CredentialsTest.TlsKeyMaterialsConfigCppToC +[==========] Running 1 test from 1 test case. +[----------] Global test environment set-up. +[----------] 1 test from CredentialsTest +[ RUN ] CredentialsTest.TlsKeyMaterialsConfigCppToC +free(): invalid size +Note: Google Test filter = CredentialsTest.TlsKeyMaterialsConfigCppToC +[==========] Running 1 test from 1 test case. +[----------] Global test environment set-up. +[----------] 1 test from CredentialsTest +[ RUN ] CredentialsTest.TlsKeyMaterialsConfigCppToC +free(): invalid size +I0808 12:54:18.832442312 242256 ev_epoll1_linux.cc:116] grpc epoll fd: 3 +D0808 12:54:18.832522636 242256 ev_posix.cc:174] Using polling engine: epoll1 +D0808 12:54:18.832594144 242256 dns_resolver_ares.cc:485] Using ares dns resolver + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. +Traceback (most recent call last): + File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> + main() + File "test/cpp/naming/utils/tcp_connect.py", line 35, in main + timeout=args.timeout) + File "/usr/lib/python2.7/socket.py", line 575, in create_connection + raise err +socket.error: [Errno 111] Connection refused + +test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. + +test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= + +test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): + File "test/cpp/naming/utils/dns_server.py", line 26, in <module> + import twisted +ImportError: No module named twisted + + +test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= +I0808 12:54:22.765265180 242256 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 + \ No newline at end of file diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 0ff187d66a9..add93d5c321 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -56,6 +56,10 @@ class TlsKeyMaterialsConfig { ::grpc::string pem_root_certs_; }; +/** Creates smart pointer to a C++ version of the C key materials. **/ +::std::shared_ptr tls_key_materials_c_to_cpp( + const grpc_tls_key_materials_config* config); + /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ typedef class TlsCredentialReloadArg TlsCredentialReloadArg; @@ -95,6 +99,11 @@ class TlsCredentialReloadArg { ::grpc::string error_details_; }; +/** Creates a smart pointer to a C++ version of the credential reload argument, + * with the callback function set to a nullptr. **/ +::std::unique_ptr tls_credential_reload_arg_c_to_cpp( + const grpc_tls_credential_reload_arg* arg); + /** TLS credential reloag config, wraps grpc_tls_credential_reload_config. **/ class TlsCredentialReloadConfig { public: @@ -117,7 +126,7 @@ class TlsCredentialReloadConfig { } cancel_(config_user_data_, arg); } - + /** Creates C struct for the credential reload config. **/ grpc_tls_credential_reload_config* c_credential_reload() const; private: @@ -177,6 +186,12 @@ class TlsServerAuthorizationCheckArg { ::grpc::string error_details_; }; +/** Creates a smart pointer to a C++ version of the server authorization check + * argument, with the callback function set to a nullptr. **/ +::std::unique_ptr +tls_server_authorization_check_arg_c_to_cpp( + const grpc_tls_server_authorization_check_arg* arg); + /** TLS server authorization check config, wraps * grps_tls_server_authorization_check_config. **/ class TlsServerAuthorizationCheckConfig { @@ -202,6 +217,7 @@ class TlsServerAuthorizationCheckConfig { cancel_(config_user_data_, arg); } + /** Creates C struct for the server authorization check config. **/ grpc_tls_server_authorization_check_config* c_server_authorization_check() const; diff --git a/ml b/ml new file mode 100644 index 00000000000..678284ae797 --- /dev/null +++ b/ml @@ -0,0 +1,7 @@ + +Note: Google Test filter = CredentialsTest.TlsServerAuthorizationCheckCppToC +[==========] Running 1 test from 1 test case. +[----------] Global test environment set-up. +[----------] 1 test from CredentialsTest +[ RUN ] CredentialsTest.TlsServerAuthorizationCheckCppToC + \ No newline at end of file diff --git a/src/core/lib/security/security_connector/ssl_utils.h b/src/core/lib/security/security_connector/ssl_utils.h index 0277b06dfaf..b9325ac0b1f 100644 --- a/src/core/lib/security/security_connector/ssl_utils.h +++ b/src/core/lib/security/security_connector/ssl_utils.h @@ -137,6 +137,10 @@ class PemKeyCertPair { cert_chain_(const_cast(pair->cert_chain)) { gpr_free(pair); } + // Construct directly from the two strings. + explicit PemKeyCertPair(const char* private_key, const char* cert_chain) + : private_key_(grpc_core::UniquePtr(gpr_strdup(private_key))), + cert_chain_(grpc_core::UniquePtr(gpr_strdup(cert_chain))) {} // Movable. PemKeyCertPair(PemKeyCertPair&& other) { diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 535958cd50a..809592239d9 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -38,10 +38,9 @@ grpc_tls_key_materials_config* TlsKeyMaterialsConfig::c_key_materials() const { c_pem_key_cert_pair_list; for (auto key_cert_pair = pem_key_cert_pair_list_.begin(); key_cert_pair != pem_key_cert_pair_list_.end(); key_cert_pair++) { - grpc_ssl_pem_key_cert_pair p = {key_cert_pair->private_key.c_str(), - key_cert_pair->cert_chain.c_str()}; ::grpc_core::PemKeyCertPair c_pem_key_cert_pair = - ::grpc_core::PemKeyCertPair(&p); + ::grpc_core::PemKeyCertPair(key_cert_pair->private_key.c_str(), + key_cert_pair->cert_chain.c_str()); c_pem_key_cert_pair_list.push_back(::std::move(c_pem_key_cert_pair)); } ::grpc_core::UniquePtr c_pem_root_certs( @@ -51,21 +50,12 @@ grpc_tls_key_materials_config* TlsKeyMaterialsConfig::c_key_materials() const { return c_config; } -/** Creates smart pointer to a C++ version of the C key materials. **/ -::std::shared_ptr cpp_key_materials( +::std::shared_ptr tls_key_materials_c_to_cpp( const grpc_tls_key_materials_config* config) { ::std::shared_ptr cpp_config( new TlsKeyMaterialsConfig()); ::std::vector cpp_pem_key_cert_pair_list; - /** for (auto key_cert_pair = config->pem_key_cert_pair_list().begin(); - key_cert_pair != config->pem_key_cert_pair_list().end(); key_cert_pair++) - { TlsKeyMaterialsConfig::PemKeyCertPair p = {key_cert_pair->private_key, - key_cert_pair->cert_chain}; - cpp_pem_key_cert_pair_list.push_back(::std::move(p)); - } - **/ - // TODO: add begin() and end() to InlinedVector so above for loop works grpc_tls_key_materials_config::PemKeyCertPairList pem_key_cert_pair_list = config->pem_key_cert_pair_list(); for (size_t i = 0; i < pem_key_cert_pair_list.size(); i++) { @@ -105,16 +95,15 @@ void TlsCredentialReloadArg::set_error_details(::grpc::string error_details) { error_details_ = ::std::move(error_details); } -/** Creates a smart pointer to a C++ version of the credential reload argument, - * with the callback function set to a nullptr. **/ ::std::unique_ptr tls_credential_reload_arg_c_to_cpp( const grpc_tls_credential_reload_arg* arg) { ::std::unique_ptr cpp_arg( new TlsCredentialReloadArg()); - cpp_arg->set_cb(nullptr); + cpp_arg->set_cb( + static_cast(nullptr)); cpp_arg->set_cb_user_data(arg->cb_user_data); cpp_arg->set_key_materials_config( - cpp_key_materials(arg->key_materials_config)); + tls_key_materials_c_to_cpp(arg->key_materials_config)); cpp_arg->set_status(arg->status); cpp_arg->set_error_details(arg->error_details); return cpp_arg; @@ -190,14 +179,13 @@ TlsCredentialReloadConfig::c_credential_reload() const { /** gRPC TLS server authorization check arg API implementation **/ -/** Creates a smart pointer to a C++ version of the credential reload argument, - * with the callback function set to a nullptr. **/ ::std::unique_ptr tls_server_authorization_check_arg_c_to_cpp( const grpc_tls_server_authorization_check_arg* arg) { ::std::unique_ptr cpp_arg( new TlsServerAuthorizationCheckArg()); - cpp_arg->set_cb(nullptr); + cpp_arg->set_cb( + static_cast(nullptr)); cpp_arg->set_cb_user_data(arg->cb_user_data); cpp_arg->set_success(arg->success); cpp_arg->set_target_name(arg->target_name); diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 746ca6f525c..994d3a0fa8e 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -214,36 +214,63 @@ TEST_F(CredentialsTest, TlsKeyMaterialsConfigCppToC) { c_config->pem_key_cert_pair_list()[0].private_key()); EXPECT_STREQ(pair.cert_chain.c_str(), c_config->pem_key_cert_pair_list()[0].cert_chain()); + gpr_free(c_config); +} + +TEST_F(CredentialsTest, TlsKeyMaterialsCtoCpp) { + grpc_tls_key_materials_config c_config; + ::grpc_core::PemKeyCertPair pem_key_cert_pair = + ::grpc_core::PemKeyCertPair("private_key", "cert_chain"); + ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> + pem_key_cert_pair_list; + pem_key_cert_pair_list.push_back(pem_key_cert_pair); + c_config.set_key_materials( + ::grpc_core::UniquePtr(gpr_strdup("pem_root_certs")), + pem_key_cert_pair_list); + ::std::shared_ptr cpp_config = + ::grpc_impl::experimental::tls_key_materials_c_to_cpp(&c_config); + EXPECT_STREQ("pem_root_certs", cpp_config->pem_root_certs().c_str()); + ::std::vector cpp_pair_list = + cpp_config->pem_key_cert_pair_list(); + EXPECT_EQ(1, static_cast(cpp_pair_list.size())); + EXPECT_STREQ("private_key", cpp_pair_list[0].private_key.c_str()); + EXPECT_STREQ("cert_chain", cpp_pair_list[0].cert_chain.c_str()); } typedef class ::grpc_impl::experimental::TlsCredentialReloadArg TlsCredentialReloadArg; typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig TlsCredentialReloadConfig; +typedef void (*grpcpp_tls_on_credential_reload_done_cb)( + TlsCredentialReloadArg* arg); TEST_F(CredentialsTest, TlsCredentialReloadArgCppToC) { TlsCredentialReloadArg arg; // Only sync credential reload supported currently, // so we use a nullptr call back function. - arg.set_cb(nullptr); + arg.set_cb(static_cast(nullptr)); arg.set_cb_user_data(nullptr); - arg.set_key_materials_config(nullptr); + arg.set_key_materials_config( + static_cast<::std::shared_ptr>(nullptr)); arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); arg.set_error_details("error_details"); grpc_tls_credential_reload_arg* c_arg = arg.c_credential_reload_arg(); - EXPECT_NE(c_arg, nullptr); - EXPECT_EQ(c_arg->cb, nullptr); + EXPECT_EQ(c_arg->cb, + static_cast(nullptr)); EXPECT_EQ(c_arg->cb_user_data, nullptr); - EXPECT_EQ(c_arg->key_materials_config, nullptr); + EXPECT_EQ(c_arg->key_materials_config, + static_cast<::std::shared_ptr>(nullptr)); EXPECT_EQ(c_arg->status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); EXPECT_STREQ(c_arg->error_details, "error_details"); } +/** TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { TlsCredentialReloadConfig config = TlsCredentialReloadConfig(nullptr, nullptr, nullptr, nullptr); grpc_tls_credential_reload_config* c_config = config.c_credential_reload(); - EXPECT_NE(c_config, nullptr); + EXPECT_EQ(c_config, nullptr); + // EXPECT_NE(c_config, nullptr); // TODO: add tests to compare schedule, cancel, destruct fields. } @@ -261,16 +288,22 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCppToC) { arg.set_success(1); arg.set_peer_cert("peer_cert"); arg.set_status(GRPC_STATUS_OK); + arg.set_target_name("target_name"); arg.set_error_details("error_details"); grpc_tls_server_authorization_check_arg* c_arg = arg.c_server_authorization_check_arg(); - EXPECT_NE(c_arg, nullptr); + // EXPECT_NE(c_arg, nullptr); EXPECT_EQ(c_arg->cb, nullptr); EXPECT_EQ(c_arg->cb_user_data, nullptr); - EXPECT_EQ(c_arg->success, 1); - EXPECT_STREQ(c_arg->peer_cert, "peer_cert"); + RecordProperty("TlsServerAuthorizationCheckArgCppToC::c_arg->success", +c_arg->success); EXPECT_EQ(c_arg->success, 1); + RecordProperty("TlsServerAuthorizationCheckArgCppToC::c_arg->peer_cert", +c_arg->peer_cert); EXPECT_STREQ(c_arg->peer_cert, "peer_cert"); + RecordProperty("TlsServerAuthorizationCheckArgCppToC::c_arg->target_name", +c_arg->target_name); EXPECT_STREQ(c_arg->target_name, "target_name"); EXPECT_EQ(c_arg->status, GRPC_STATUS_OK); - EXPECT_STREQ(c_arg->error_details, "error_details"); + RecordProperty("TlsServerAuthorizationCheckArgCppToC::c_arg->error_details", +c_arg->error_details); EXPECT_STREQ(c_arg->error_details, "error_details"); } TEST_F(CredentialsTest, TlsServerAuthorizationCheckCppToC) { @@ -302,7 +335,9 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY); EXPECT_EQ(c_options->key_materials_config(), key_materials_config->c_key_materials()); + gpr_free(c_options); } +**/ } // namespace testing } // namespace grpc From 1d32c79ee73481275fdf64428650858780ff76af Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Thu, 8 Aug 2019 22:56:13 -0700 Subject: [PATCH 13/70] Removed XML log files --- XML_REPORT | 8 - XML_REPORT2 | 8 - XML_REPORT3 | 7 - XML_REPORT4 | 317 --------- XML_REPORT5 | 1929 --------------------------------------------------- 5 files changed, 2269 deletions(-) delete mode 100644 XML_REPORT delete mode 100644 XML_REPORT2 delete mode 100644 XML_REPORT3 delete mode 100644 XML_REPORT4 delete mode 100644 XML_REPORT5 diff --git a/XML_REPORT b/XML_REPORT deleted file mode 100644 index 8743f1be38f..00000000000 --- a/XML_REPORT +++ /dev/null @@ -1,8 +0,0 @@ - -Note: Google Test filter = CredentialsTest.TlsCredentialsOptionsCppToC -[==========] Running 1 test from 1 test case. -[----------] Global test environment set-up. -[----------] 1 test from CredentialsTest -[ RUN ] CredentialsTest.TlsCredentialsOptionsCppToC -free(): invalid pointer - \ No newline at end of file diff --git a/XML_REPORT2 b/XML_REPORT2 deleted file mode 100644 index f60b57dec56..00000000000 --- a/XML_REPORT2 +++ /dev/null @@ -1,8 +0,0 @@ - -Note: Google Test filter = CredentialsTest.TlsKeyMaterialsConfigCppToC -[==========] Running 1 test from 1 test case. -[----------] Global test environment set-up. -[----------] 1 test from CredentialsTest -[ RUN ] CredentialsTest.TlsKeyMaterialsConfigCppToC -double free or corruption (out) - \ No newline at end of file diff --git a/XML_REPORT3 b/XML_REPORT3 deleted file mode 100644 index 0d7f5f79e20..00000000000 --- a/XML_REPORT3 +++ /dev/null @@ -1,7 +0,0 @@ - -Note: Google Test filter = CredentialsTest.TlsServerAuthorizationCheckCppToC -[==========] Running 1 test from 1 test case. -[----------] Global test environment set-up. -[----------] 1 test from CredentialsTest -[ RUN ] CredentialsTest.TlsServerAuthorizationCheckCppToC - \ No newline at end of file diff --git a/XML_REPORT4 b/XML_REPORT4 deleted file mode 100644 index cf8c00a461b..00000000000 --- a/XML_REPORT4 +++ /dev/null @@ -1,317 +0,0 @@ - -D0808 12:16:59.439965368 60382 ev_posix.cc:174] Using polling engine: poll -D0808 12:16:59.440103435 60382 dns_resolver_ares.cc:485] Using ares dns resolver - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. - -test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= - -test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): - File "test/cpp/naming/utils/dns_server.py", line 26, in <module> - import twisted -ImportError: No module named twisted - - -test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= -I0808 12:17:03.361937051 60382 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 - \ No newline at end of file diff --git a/XML_REPORT5 b/XML_REPORT5 deleted file mode 100644 index 252ca68916b..00000000000 --- a/XML_REPORT5 +++ /dev/null @@ -1,1929 +0,0 @@ - -I0808 12:39:47.576792555 205590 ev_epoll1_linux.cc:116] grpc epoll fd: 3 -D0808 12:39:47.576928114 205590 ev_posix.cc:174] Using polling engine: epoll1 -D0808 12:39:47.577005168 205590 dns_resolver_ares.cc:485] Using ares dns resolver - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. - -test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= - -test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): - File "test/cpp/naming/utils/dns_server.py", line 26, in <module> - import twisted -ImportError: No module named twisted - - -test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= -I0808 12:39:51.471949290 205590 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 -Note: Google Test filter = CredentialsTest.TlsKeyMaterialsConfigCppToC -[==========] Running 1 test from 1 test case. -[----------] Global test environment set-up. -[----------] 1 test from CredentialsTest -[ RUN ] CredentialsTest.TlsKeyMaterialsConfigCppToC -free(): invalid size -D0808 13:08:09.009051003 209399 ev_posix.cc:174] Using polling engine: epollex -D0808 13:08:09.009199475 209399 dns_resolver_ares.cc:485] Using ares dns resolver - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. - -test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= - -test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): - File "test/cpp/naming/utils/dns_server.py", line 26, in <module> - import twisted -ImportError: No module named twisted - - -test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= -I0808 13:08:12.968479883 209399 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 -I0808 12:50:54.204121347 205404 grpclb_fallback_test.cc:258] Testing: -E0808 12:50:54.204261156 205404 grpclb_fallback_test.cc:272] Invalid test case: -D0808 12:39:47.883628014 206125 ev_posix.cc:174] Using polling engine: epollex -D0808 12:39:47.883874499 206125 dns_resolver_ares.cc:485] Using ares dns resolver - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. - -test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= - -test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): - File "test/cpp/naming/utils/dns_server.py", line 26, in <module> - import twisted -ImportError: No module named twisted - - -test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= -I0808 12:39:51.747517477 206125 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 -D0808 12:43:30.156117158 63878 ev_posix.cc:174] Using polling engine: epollex -D0808 12:43:30.156265819 63878 dns_resolver_ares.cc:485] Using ares dns resolver -2019-08-08 12:43:30 -Running bins/opt/bm_chttp2_transport -Run on (12 X 4500 MHz CPU s) -CPU Caches: - L1 Data 32K (x6) - L1 Instruction 32K (x6) - L2 Unified 1024K (x6) - L3 Unified 8448K (x1) -***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead. -D0808 12:50:40.655657256 201188 ev_posix.cc:174] Using polling engine: poll -D0808 12:50:40.655895634 201188 dns_resolver_ares.cc:485] Using ares dns resolver - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. - -test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= - -test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): - File "test/cpp/naming/utils/dns_server.py", line 26, in <module> - import twisted -ImportError: No module named twisted - - -test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= -I0808 12:50:44.660423630 201188 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 -I0808 13:20:19.460528718 95176 grpclb_fallback_test.cc:258] Testing: -E0808 13:20:19.460613245 95176 grpclb_fallback_test.cc:272] Invalid test case: -I0808 13:19:06.707675289 15650 grpclb_fallback_test.cc:258] Testing: -E0808 13:19:06.707884040 15650 grpclb_fallback_test.cc:272] Invalid test case: -D0808 13:30:21.952439902 156446 ev_posix.cc:174] Using polling engine: poll -D0808 13:30:21.952557775 156446 dns_resolver_ares.cc:485] Using ares dns resolver - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. - -test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= - -test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): - File "test/cpp/naming/utils/dns_server.py", line 26, in <module> - import twisted -ImportError: No module named twisted - - -test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= -I0808 13:30:25.881953250 156446 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 -Note: Google Test filter = CredentialsTest.TlsKeyMaterialsConfigCppToC -[==========] Running 1 test from 1 test case. -[----------] Global test environment set-up. -[----------] 1 test from CredentialsTest -[ RUN ] CredentialsTest.TlsKeyMaterialsConfigCppToC -free(): invalid size -Note: Google Test filter = CredentialsTest.TlsKeyMaterialsConfigCppToC -[==========] Running 1 test from 1 test case. -[----------] Global test environment set-up. -[----------] 1 test from CredentialsTest -[ RUN ] CredentialsTest.TlsKeyMaterialsConfigCppToC -free(): invalid size -I0808 12:54:18.832442312 242256 ev_epoll1_linux.cc:116] grpc epoll fd: 3 -D0808 12:54:18.832522636 242256 ev_posix.cc:174] Using polling engine: epoll1 -D0808 12:54:18.832594144 242256 dns_resolver_ares.cc:485] Using ares dns resolver - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Health check: attempt to connect to DNS server over TCP. -Traceback (most recent call last): - File "test/cpp/naming/utils/tcp_connect.py", line 38, in <module> - main() - File "test/cpp/naming/utils/tcp_connect.py", line 35, in main - timeout=args.timeout) - File "/usr/lib/python2.7/socket.py", line 575, in create_connection - raise err -socket.error: [Errno 111] Connection refused - -test/cpp/naming/resolver_component_tests_runner.py: Failed to reach DNS server over TCP and/or UDP. Exitting without running tests. - -test/cpp/naming/resolver_component_tests_runner.py: ======= DNS server stdout (merged stdout and stderr) ============= - -test/cpp/naming/resolver_component_tests_runner.py: Traceback (most recent call last): - File "test/cpp/naming/utils/dns_server.py", line 26, in <module> - import twisted -ImportError: No module named twisted - - -test/cpp/naming/resolver_component_tests_runner.py: ======= end DNS server output========= -I0808 12:54:22.765265180 242256 resolver_component_tests_runner_invoker.cc:133] Resolver component test test-runner exited with code 1 - \ No newline at end of file From f169b4b28e320303f825286ebd12765bb6a25e39 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Fri, 9 Aug 2019 09:37:27 -0700 Subject: [PATCH 14/70] Update CredentialReloadArg unit test --- test/cpp/client/credentials_test.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 994d3a0fa8e..30e6dd1ca97 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -246,20 +246,26 @@ typedef void (*grpcpp_tls_on_credential_reload_done_cb)( TEST_F(CredentialsTest, TlsCredentialReloadArgCppToC) { TlsCredentialReloadArg arg; - // Only sync credential reload supported currently, - // so we use a nullptr call back function. arg.set_cb(static_cast(nullptr)); arg.set_cb_user_data(nullptr); - arg.set_key_materials_config( - static_cast<::std::shared_ptr>(nullptr)); + ::std::shared_ptr key_materials_config; + struct TlsKeyMaterialsConfig::PemKeyCertPair pair1 = {"private_key1", + "cert_chain1"}; + struct TlsKeyMaterialsConfig::PemKeyCertPair pair2 = {"private_key2", "cert_chain2"}; + ::std::vector pair_list = {pair1, pair2}; + key_materials_config->set_key_materials("pem_root_certs", pair_list); + arg.set_key_materials_config(key_materials_config); arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); arg.set_error_details("error_details"); grpc_tls_credential_reload_arg* c_arg = arg.c_credential_reload_arg(); EXPECT_EQ(c_arg->cb, static_cast(nullptr)); EXPECT_EQ(c_arg->cb_user_data, nullptr); - EXPECT_EQ(c_arg->key_materials_config, - static_cast<::std::shared_ptr>(nullptr)); + EXPECT_EQ(c_arg->key_materials_config->pem_root_certs(), "pem_root_certs"); + EXPECT_EQ(c_arg->key_materials_config->pem_key_cert_pair_list()[0].private_key(), "private_key1"); + EXPECT_EQ(c_arg->key_materials_config->pem_key_cert_pair_list()[1].private_key(), "private_key2"); + EXPECT_EQ(c_arg->key_materials_config->pem_key_cert_pair_list()[0].cert_chain(), "cert_chain1"); + EXPECT_EQ(c_arg->key_materials_config->pem_key_cert_pair_list()[1].cert_chain(), "cert_chain2"); EXPECT_EQ(c_arg->status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); EXPECT_STREQ(c_arg->error_details, "error_details"); } From 5a30c5309a05f5a779378f526df0df58d83d851e Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 13 Aug 2019 10:03:22 -0700 Subject: [PATCH 15/70] Test commit --- third_party/upb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/upb b/third_party/upb index 423ea5ca9ce..931bbecbd32 160000 --- a/third_party/upb +++ b/third_party/upb @@ -1 +1 @@ -Subproject commit 423ea5ca9ce8da69611e6e95559efcb3a1ba8ad8 +Subproject commit 931bbecbd3230ae7f22efa5d203639facc47f719 From 0b89954f7e096a20255eb4a030cc3b6955ae1c96 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 13 Aug 2019 10:06:59 -0700 Subject: [PATCH 16/70] Revert "Test commit" This reverts commit 5a30c5309a05f5a779378f526df0df58d83d851e. --- third_party/upb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/upb b/third_party/upb index 931bbecbd32..423ea5ca9ce 160000 --- a/third_party/upb +++ b/third_party/upb @@ -1 +1 @@ -Subproject commit 931bbecbd3230ae7f22efa5d203639facc47f719 +Subproject commit 423ea5ca9ce8da69611e6e95559efcb3a1ba8ad8 From f3f8bf05b25c738774baee3ebf953ee6374d5e93 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 13 Aug 2019 12:18:31 -0700 Subject: [PATCH 17/70] Fix conflicts with ssl_utils.h --- .../grpcpp/security/tls_credentials_options.h | 36 +++++++++---------- .../security/security_connector/ssl_utils.h | 8 ++--- src/cpp/common/tls_credentials_options.cc | 4 +-- test/cpp/client/credentials_test.cc | 24 +++++++++---- 4 files changed, 38 insertions(+), 34 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index add93d5c321..99d0d396b93 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -34,18 +34,18 @@ namespace experimental { class TlsKeyMaterialsConfig { public: struct PemKeyCertPair { - ::grpc::string private_key; - ::grpc::string cert_chain; + grpc::string private_key; + grpc::string cert_chain; }; /** Getters for member fields. **/ - const ::grpc::string pem_root_certs() const { return pem_root_certs_; } + const grpc::string pem_root_certs() const { return pem_root_certs_; } const ::std::vector& pem_key_cert_pair_list() const { return pem_key_cert_pair_list_; } /**Setter for member fields. **/ - void set_key_materials(::grpc::string pem_root_certs, + void set_key_materials(grpc::string pem_root_certs, ::std::vector pem_key_cert_pair_list); /** Creates C struct for key materials. **/ @@ -53,7 +53,7 @@ class TlsKeyMaterialsConfig { private: ::std::vector pem_key_cert_pair_list_; - ::grpc::string pem_root_certs_; + grpc::string pem_root_certs_; }; /** Creates smart pointer to a C++ version of the C key materials. **/ @@ -75,7 +75,7 @@ class TlsCredentialReloadArg { return key_materials_config_; } grpc_ssl_certificate_config_reload_status status() const { return status_; } - ::grpc::string error_details() const { return error_details_; } + grpc::string error_details() const { return error_details_; } /** Setters for member fields. **/ void set_cb(grpcpp_tls_on_credential_reload_done_cb cb); @@ -83,7 +83,7 @@ class TlsCredentialReloadArg { void set_key_materials_config( ::std::shared_ptr key_materials_config); void set_status(grpc_ssl_certificate_config_reload_status status); - void set_error_details(::grpc::string error_details); + void set_error_details(grpc::string error_details); /** Creates C struct for credential reload arg. **/ grpc_tls_credential_reload_arg* c_credential_reload_arg() const; @@ -96,7 +96,7 @@ class TlsCredentialReloadArg { void* cb_user_data_; ::std::shared_ptr key_materials_config_; grpc_ssl_certificate_config_reload_status status_; - ::grpc::string error_details_; + grpc::string error_details_; }; /** Creates a smart pointer to a C++ version of the credential reload argument, @@ -149,23 +149,21 @@ class TlsServerAuthorizationCheckArg { grpcpp_tls_on_server_authorization_check_done_cb cb() const { return cb_; } void* cb_user_data() const { return cb_user_data_; } int success() const { return success_; } - ::grpc::string target_name() const { return target_name_; } - ::grpc::string peer_cert() const { return peer_cert_; } + grpc::string target_name() const { return target_name_; } + grpc::string peer_cert() const { return peer_cert_; } grpc_status_code status() const { return status_; } - ::grpc::string error_details() const { return error_details_; } + grpc::string error_details() const { return error_details_; } /** Setters for member fields. **/ void set_cb(grpcpp_tls_on_server_authorization_check_done_cb cb) { cb_ = cb; } void set_cb_user_data(void* cb_user_data) { cb_user_data_ = cb_user_data; } void set_success(int success) { success_ = success; }; - void set_target_name(::grpc::string target_name) { - target_name_ = target_name; - } - void set_peer_cert(::grpc::string peer_cert) { + void set_target_name(grpc::string target_name) { target_name_ = target_name; } + void set_peer_cert(grpc::string peer_cert) { peer_cert_ = ::std::move(peer_cert); } void set_status(grpc_status_code status) { status_ = status; } - void set_error_details(::grpc::string error_details) { + void set_error_details(grpc::string error_details) { error_details_ = ::std::move(error_details); } @@ -180,10 +178,10 @@ class TlsServerAuthorizationCheckArg { grpcpp_tls_on_server_authorization_check_done_cb cb_; void* cb_user_data_; int success_; - ::grpc::string target_name_; - ::grpc::string peer_cert_; + grpc::string target_name_; + grpc::string peer_cert_; grpc_status_code status_; - ::grpc::string error_details_; + grpc::string error_details_; }; /** Creates a smart pointer to a C++ version of the server authorization check diff --git a/src/core/lib/security/security_connector/ssl_utils.h b/src/core/lib/security/security_connector/ssl_utils.h index b9325ac0b1f..3d3c436da3b 100644 --- a/src/core/lib/security/security_connector/ssl_utils.h +++ b/src/core/lib/security/security_connector/ssl_utils.h @@ -158,12 +158,8 @@ class PemKeyCertPair { : private_key_(gpr_strdup(other.private_key())), cert_chain_(gpr_strdup(other.cert_chain())) {} PemKeyCertPair& operator=(const PemKeyCertPair& other) { - auto private_key = - grpc_core::UniquePtr(gpr_strdup(other.private_key())); - auto cert_chain = - grpc_core::UniquePtr(gpr_strdup(other.cert_chain())); - private_key_ = std::move(private_key); - cert_chain_ = std::move(cert_chain); + private_key_ = grpc_core::UniquePtr(gpr_strdup(other.private_key())); + cert_chain_ = grpc_core::UniquePtr(gpr_strdup(other.cert_chain())); return *this; } diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 809592239d9..5539a9aa5c9 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -25,7 +25,7 @@ namespace experimental { /** gRPC TLS key materials config API implementation **/ void TlsKeyMaterialsConfig::set_key_materials( - ::grpc::string pem_root_certs, + grpc::string pem_root_certs, ::std::vector pem_key_cert_pair_list) { pem_key_cert_pair_list_ = ::std::move(pem_key_cert_pair_list); pem_root_certs_ = ::std::move(pem_root_certs); @@ -91,7 +91,7 @@ void TlsCredentialReloadArg::set_status( status_ = status; } -void TlsCredentialReloadArg::set_error_details(::grpc::string error_details) { +void TlsCredentialReloadArg::set_error_details(grpc::string error_details) { error_details_ = ::std::move(error_details); } diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 30e6dd1ca97..ee5e0a0c7ab 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -250,9 +250,11 @@ TEST_F(CredentialsTest, TlsCredentialReloadArgCppToC) { arg.set_cb_user_data(nullptr); ::std::shared_ptr key_materials_config; struct TlsKeyMaterialsConfig::PemKeyCertPair pair1 = {"private_key1", - "cert_chain1"}; - struct TlsKeyMaterialsConfig::PemKeyCertPair pair2 = {"private_key2", "cert_chain2"}; - ::std::vector pair_list = {pair1, pair2}; + "cert_chain1"}; + struct TlsKeyMaterialsConfig::PemKeyCertPair pair2 = {"private_key2", + "cert_chain2"}; + ::std::vector pair_list = {pair1, + pair2}; key_materials_config->set_key_materials("pem_root_certs", pair_list); arg.set_key_materials_config(key_materials_config); arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); @@ -262,10 +264,18 @@ TEST_F(CredentialsTest, TlsCredentialReloadArgCppToC) { static_cast(nullptr)); EXPECT_EQ(c_arg->cb_user_data, nullptr); EXPECT_EQ(c_arg->key_materials_config->pem_root_certs(), "pem_root_certs"); - EXPECT_EQ(c_arg->key_materials_config->pem_key_cert_pair_list()[0].private_key(), "private_key1"); - EXPECT_EQ(c_arg->key_materials_config->pem_key_cert_pair_list()[1].private_key(), "private_key2"); - EXPECT_EQ(c_arg->key_materials_config->pem_key_cert_pair_list()[0].cert_chain(), "cert_chain1"); - EXPECT_EQ(c_arg->key_materials_config->pem_key_cert_pair_list()[1].cert_chain(), "cert_chain2"); + EXPECT_EQ( + c_arg->key_materials_config->pem_key_cert_pair_list()[0].private_key(), + "private_key1"); + EXPECT_EQ( + c_arg->key_materials_config->pem_key_cert_pair_list()[1].private_key(), + "private_key2"); + EXPECT_EQ( + c_arg->key_materials_config->pem_key_cert_pair_list()[0].cert_chain(), + "cert_chain1"); + EXPECT_EQ( + c_arg->key_materials_config->pem_key_cert_pair_list()[1].cert_chain(), + "cert_chain2"); EXPECT_EQ(c_arg->status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); EXPECT_STREQ(c_arg->error_details, "error_details"); } From 1e46b38d66d80f140796302f361a3ab9cb3883e9 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 14 Aug 2019 13:11:27 -0700 Subject: [PATCH 18/70] Hid some key materials API's and refactored credential reload arg wrapper. --- .../grpcpp/security/tls_credentials_options.h | 47 +++-------- src/cpp/common/tls_credentials_options.cc | 80 +++++++++---------- test/cpp/client/credentials_test.cc | 20 +++-- 3 files changed, 63 insertions(+), 84 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 99d0d396b93..d505f1642a6 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -44,66 +44,39 @@ class TlsKeyMaterialsConfig { return pem_key_cert_pair_list_; } - /**Setter for member fields. **/ + /** Setter for key materials that will be called by the user. The setter + * transfers ownership of the arguments to the config. **/ void set_key_materials(grpc::string pem_root_certs, ::std::vector pem_key_cert_pair_list); - /** Creates C struct for key materials. **/ - grpc_tls_key_materials_config* c_key_materials() const; - private: ::std::vector pem_key_cert_pair_list_; grpc::string pem_root_certs_; }; -/** Creates smart pointer to a C++ version of the C key materials. **/ -::std::shared_ptr tls_key_materials_c_to_cpp( - const grpc_tls_key_materials_config* config); - /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ -typedef class TlsCredentialReloadArg TlsCredentialReloadArg; - -typedef void (*grpcpp_tls_on_credential_reload_done_cb)( - TlsCredentialReloadArg* arg); - class TlsCredentialReloadArg { public: - /** Getters for member fields. **/ - grpcpp_tls_on_credential_reload_done_cb cb() const { return cb_; } - void* cb_user_data() const { return cb_user_data_; } - ::std::shared_ptr key_materials_config() const { - return key_materials_config_; - } - grpc_ssl_certificate_config_reload_status status() const { return status_; } - grpc::string error_details() const { return error_details_; } + /** Getters for member fields. The callback function is not exposed. **/ + void* cb_user_data() const; + ::std::shared_ptr key_materials_config() const; + grpc_ssl_certificate_config_reload_status status() const; + grpc::string error_details() const; /** Setters for member fields. **/ - void set_cb(grpcpp_tls_on_credential_reload_done_cb cb); void set_cb_user_data(void* cb_user_data); void set_key_materials_config( ::std::shared_ptr key_materials_config); void set_status(grpc_ssl_certificate_config_reload_status status); void set_error_details(grpc::string error_details); - /** Creates C struct for credential reload arg. **/ - grpc_tls_credential_reload_arg* c_credential_reload_arg() const; - - /** Creates C callback function from C++ callback function. **/ - grpc_tls_on_credential_reload_done_cb c_callback() const; + /** Calls the C arg's callback function. **/ + void callback() ; private: - grpcpp_tls_on_credential_reload_done_cb cb_; - void* cb_user_data_; - ::std::shared_ptr key_materials_config_; - grpc_ssl_certificate_config_reload_status status_; - grpc::string error_details_; + grpc_tls_credential_reload_arg* c_arg_; }; -/** Creates a smart pointer to a C++ version of the credential reload argument, - * with the callback function set to a nullptr. **/ -::std::unique_ptr tls_credential_reload_arg_c_to_cpp( - const grpc_tls_credential_reload_arg* arg); - /** TLS credential reloag config, wraps grpc_tls_credential_reload_config. **/ class TlsCredentialReloadConfig { public: diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 5539a9aa5c9..c4bf2dfba6a 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -23,7 +23,7 @@ namespace grpc_impl { namespace experimental { -/** gRPC TLS key materials config API implementation **/ +/** TLS key materials config API implementation **/ void TlsKeyMaterialsConfig::set_key_materials( grpc::string pem_root_certs, ::std::vector pem_key_cert_pair_list) { @@ -31,25 +31,28 @@ void TlsKeyMaterialsConfig::set_key_materials( pem_root_certs_ = ::std::move(pem_root_certs); } -grpc_tls_key_materials_config* TlsKeyMaterialsConfig::c_key_materials() const { +namespace { +/** Creates a new C struct for the key materials. **/ +grpc_tls_key_materials_config* c_key_materials(::std::shared_ptr config) { grpc_tls_key_materials_config* c_config = grpc_tls_key_materials_config_create(); ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> c_pem_key_cert_pair_list; - for (auto key_cert_pair = pem_key_cert_pair_list_.begin(); - key_cert_pair != pem_key_cert_pair_list_.end(); key_cert_pair++) { + for (auto key_cert_pair = config->pem_key_cert_pair_list().begin(); + key_cert_pair != config->pem_key_cert_pair_list().end(); key_cert_pair++) { ::grpc_core::PemKeyCertPair c_pem_key_cert_pair = ::grpc_core::PemKeyCertPair(key_cert_pair->private_key.c_str(), key_cert_pair->cert_chain.c_str()); c_pem_key_cert_pair_list.push_back(::std::move(c_pem_key_cert_pair)); } ::grpc_core::UniquePtr c_pem_root_certs( - gpr_strdup(pem_root_certs_.c_str())); + gpr_strdup(config->pem_root_certs().c_str())); c_config->set_key_materials(::std::move(c_pem_root_certs), ::std::move(c_pem_key_cert_pair_list)); return c_config; } +/** Creates a new TlsKeyMaterialsConfig from a C struct config. **/ ::std::shared_ptr tls_key_materials_c_to_cpp( const grpc_tls_key_materials_config* config) { ::std::shared_ptr cpp_config( @@ -70,37 +73,51 @@ grpc_tls_key_materials_config* TlsKeyMaterialsConfig::c_key_materials() const { ::std::move(cpp_pem_key_cert_pair_list)); return cpp_config; } +} // namespace -/** gRPC TLS credential reload arg API implementation **/ -void TlsCredentialReloadArg::set_cb( - grpcpp_tls_on_credential_reload_done_cb cb) { - cb_ = cb; +/** TLS credential reload arg API implementation **/ +void* TlsCredentialReloadArg::cb_user_data() const { + return c_arg_->cb_user_data; +} + +/** This function creates a new TlsKeyMaterialsConfig instance whose fields are + * not shared with the corresponding key materials config fields of the + * TlsCredentialReloadArg instance. **/ +::std::shared_ptr TlsCredentialReloadArg::key_materials_config() const { + return tls_key_materials_c_to_cpp(c_arg_->key_materials_config); +} + +grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() const { + return c_arg_->status; +} + +grpc::string TlsCredentialReloadArg::error_details() const { + return static_cast(c_arg_->error_details); } void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { - cb_user_data_ = cb_user_data; + c_arg_->cb_user_data = cb_user_data; } void TlsCredentialReloadArg::set_key_materials_config( ::std::shared_ptr key_materials_config) { - key_materials_config_ = ::std::move(key_materials_config); + c_arg_->key_materials_config = c_key_materials(key_materials_config); } void TlsCredentialReloadArg::set_status( grpc_ssl_certificate_config_reload_status status) { - status_ = status; + c_arg_->status = status; } void TlsCredentialReloadArg::set_error_details(grpc::string error_details) { - error_details_ = ::std::move(error_details); + c_arg_->error_details = gpr_strdup(error_details.c_str()); } -::std::unique_ptr tls_credential_reload_arg_c_to_cpp( - const grpc_tls_credential_reload_arg* arg) { - ::std::unique_ptr cpp_arg( - new TlsCredentialReloadArg()); - cpp_arg->set_cb( - static_cast(nullptr)); +namespace { +/** Creates a smart pointer to a C++ version of the credential reload argument, + * with the callback function set to a nullptr. **/ +::std::unique_ptr tls_credential_reload_arg_c_to_cpp(const grpc_tls_credential_reload_arg* arg) { + ::std::unique_ptr cpp_arg(new TlsCredentialReloadArg()); cpp_arg->set_cb_user_data(arg->cb_user_data); cpp_arg->set_key_materials_config( tls_key_materials_c_to_cpp(arg->key_materials_config)); @@ -108,26 +125,10 @@ void TlsCredentialReloadArg::set_error_details(grpc::string error_details) { cpp_arg->set_error_details(arg->error_details); return cpp_arg; } +} // namespace -grpc_tls_on_credential_reload_done_cb TlsCredentialReloadArg::c_callback() - const { - grpcpp_tls_on_credential_reload_done_cb cpp_cb = cb_; - std::function c_cb = - [cpp_cb](grpc_tls_credential_reload_arg* arg) { - return cpp_cb(tls_credential_reload_arg_c_to_cpp(arg).get()); - }; - return *(c_cb.target()); -} - -grpc_tls_credential_reload_arg* -TlsCredentialReloadArg::c_credential_reload_arg() const { - grpc_tls_credential_reload_arg* c_arg = new grpc_tls_credential_reload_arg(); - c_arg->cb = this->c_callback(); - c_arg->cb_user_data = cb_user_data_; - c_arg->key_materials_config = key_materials_config_->c_key_materials(); - c_arg->status = status_; - c_arg->error_details = gpr_strdup(error_details_.c_str()); - return c_arg; +void TlsCredentialReloadArg::callback() { + c_arg_->cb(c_arg_); } /** gRPC TLS credential reload config API implementation **/ @@ -276,8 +277,7 @@ grpc_tls_credentials_options* TlsCredentialsOptions::c_credentials_options() grpc_tls_credentials_options_create(); c_options->set_cert_request_type(cert_request_type_); c_options->set_key_materials_config( - ::grpc_core::RefCountedPtr( - key_materials_config_->c_key_materials())); + ::grpc_core::RefCountedPtr(c_key_materials(key_materials_config_))); c_options->set_credential_reload_config( ::grpc_core::RefCountedPtr( credential_reload_config_->c_credential_reload())); diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index ee5e0a0c7ab..de195ff4e7c 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -198,6 +198,7 @@ TEST_F(CredentialsTest, StsCredentialsOptionsFromEnv) { gpr_unsetenv("STS_CREDENTIALS"); } +/** typedef class ::grpc_impl::experimental::TlsKeyMaterialsConfig TlsKeyMaterialsConfig; @@ -216,7 +217,9 @@ TEST_F(CredentialsTest, TlsKeyMaterialsConfigCppToC) { c_config->pem_key_cert_pair_list()[0].cert_chain()); gpr_free(c_config); } +**/ +/** TEST_F(CredentialsTest, TlsKeyMaterialsCtoCpp) { grpc_tls_key_materials_config c_config; ::grpc_core::PemKeyCertPair pem_key_cert_pair = @@ -236,17 +239,18 @@ TEST_F(CredentialsTest, TlsKeyMaterialsCtoCpp) { EXPECT_STREQ("private_key", cpp_pair_list[0].private_key.c_str()); EXPECT_STREQ("cert_chain", cpp_pair_list[0].cert_chain.c_str()); } +**/ -typedef class ::grpc_impl::experimental::TlsCredentialReloadArg - TlsCredentialReloadArg; -typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig - TlsCredentialReloadConfig; -typedef void (*grpcpp_tls_on_credential_reload_done_cb)( - TlsCredentialReloadArg* arg); +//typedef class ::grpc_impl::experimental::TlsCredentialReloadArg +// TlsCredentialReloadArg; +//typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig +// TlsCredentialReloadConfig; +//typedef void (*grpcpp_tls_on_credential_reload_done_cb)( +// TlsCredentialReloadArg* arg); +/** TEST_F(CredentialsTest, TlsCredentialReloadArgCppToC) { TlsCredentialReloadArg arg; - arg.set_cb(static_cast(nullptr)); arg.set_cb_user_data(nullptr); ::std::shared_ptr key_materials_config; struct TlsKeyMaterialsConfig::PemKeyCertPair pair1 = {"private_key1", @@ -280,6 +284,8 @@ TEST_F(CredentialsTest, TlsCredentialReloadArgCppToC) { EXPECT_STREQ(c_arg->error_details, "error_details"); } +**/ + /** TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { TlsCredentialReloadConfig config = From 791e9ffa32dd32edf90cee1a03df4d73e9236f73 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 20 Aug 2019 13:05:36 -0700 Subject: [PATCH 19/70] Restored tls_credentials_options.h --- .../grpcpp/security/tls_credentials_options.h | 106 ++++++++++-------- 1 file changed, 58 insertions(+), 48 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index d505f1642a6..83f4a202a1b 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -19,7 +19,6 @@ #ifndef GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H #define GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H -#include #include #include @@ -43,20 +42,35 @@ class TlsKeyMaterialsConfig { const ::std::vector& pem_key_cert_pair_list() const { return pem_key_cert_pair_list_; } + const int version() const { return version_; } /** Setter for key materials that will be called by the user. The setter * transfers ownership of the arguments to the config. **/ void set_key_materials(grpc::string pem_root_certs, ::std::vector pem_key_cert_pair_list); + void set_version(int version) { version_ = version;}; private: + int version_; ::std::vector pem_key_cert_pair_list_; grpc::string pem_root_certs_; }; +/** The following 2 functions are exposed for testing purposes. **/ +grpc_tls_key_materials_config* c_key_materials( + const ::std::shared_ptr& config); + +::std::shared_ptr tls_key_materials_c_to_cpp( + const grpc_tls_key_materials_config* config); + + /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ class TlsCredentialReloadArg { public: + TlsCredentialReloadArg(); + TlsCredentialReloadArg(grpc_tls_credential_reload_arg arg); + ~TlsCredentialReloadArg(); + /** Getters for member fields. The callback function is not exposed. **/ void* cb_user_data() const; ::std::shared_ptr key_materials_config() const; @@ -68,15 +82,21 @@ class TlsCredentialReloadArg { void set_key_materials_config( ::std::shared_ptr key_materials_config); void set_status(grpc_ssl_certificate_config_reload_status status); - void set_error_details(grpc::string error_details); + void set_error_details(const grpc::string& error_details); /** Calls the C arg's callback function. **/ void callback() ; private: - grpc_tls_credential_reload_arg* c_arg_; + grpc_tls_credential_reload_arg c_arg_; }; +// Exposed for testing purposes. +int tls_credential_reload_config_c_schedule( + void* config_user_data, grpc_tls_credential_reload_arg* arg); +void tls_credential_reload_config_c_cancel(void* config_user_data, + grpc_tls_credential_reload_arg* arg); + /** TLS credential reloag config, wraps grpc_tls_credential_reload_config. **/ class TlsCredentialReloadConfig { public: @@ -99,10 +119,13 @@ class TlsCredentialReloadConfig { } cancel_(config_user_data_, arg); } - /** Creates C struct for the credential reload config. **/ - grpc_tls_credential_reload_config* c_credential_reload() const; + /** Returns a C struct for the credential reload config. **/ + grpc_tls_credential_reload_config* c_credential_reload() const { + return c_config_; + } private: + grpc_tls_credential_reload_config* c_config_; void* config_user_data_; int (*schedule_)(void* config_user_data, TlsCredentialReloadArg* arg); void (*cancel_)(void* config_user_data, TlsCredentialReloadArg* arg); @@ -111,57 +134,42 @@ class TlsCredentialReloadConfig { /** TLS server authorization check arguments, wraps * grpc_tls_server_authorization_check_arg. **/ -typedef class TlsServerAuthorizationCheckArg TlsServerAuthorizationCheckArg; - -typedef void (*grpcpp_tls_on_server_authorization_check_done_cb)( - TlsServerAuthorizationCheckArg* arg); class TlsServerAuthorizationCheckArg { public: + TlsServerAuthorizationCheckArg(); + TlsServerAuthorizationCheckArg(grpc_tls_server_authorization_check_arg arg); + ~TlsServerAuthorizationCheckArg(); + /** Getters for member fields. **/ - grpcpp_tls_on_server_authorization_check_done_cb cb() const { return cb_; } - void* cb_user_data() const { return cb_user_data_; } - int success() const { return success_; } - grpc::string target_name() const { return target_name_; } - grpc::string peer_cert() const { return peer_cert_; } - grpc_status_code status() const { return status_; } - grpc::string error_details() const { return error_details_; } + void* cb_user_data() const; + int success() const; + grpc::string target_name() const; + grpc::string peer_cert() const; + grpc_status_code status() const; + grpc::string error_details() const; /** Setters for member fields. **/ - void set_cb(grpcpp_tls_on_server_authorization_check_done_cb cb) { cb_ = cb; } - void set_cb_user_data(void* cb_user_data) { cb_user_data_ = cb_user_data; } - void set_success(int success) { success_ = success; }; - void set_target_name(grpc::string target_name) { target_name_ = target_name; } - void set_peer_cert(grpc::string peer_cert) { - peer_cert_ = ::std::move(peer_cert); - } - void set_status(grpc_status_code status) { status_ = status; } - void set_error_details(grpc::string error_details) { - error_details_ = ::std::move(error_details); - } - - /** Creates C struct for server authorization check arg. **/ - grpc_tls_server_authorization_check_arg* c_server_authorization_check_arg() - const; + void set_cb_user_data(void* cb_user_data); + void set_success(int success); + void set_target_name(const grpc::string& target_name); + void set_peer_cert(const grpc::string& peer_cert); + void set_status(grpc_status_code status); + void set_error_details(const grpc::string& error_details); - /** Creates C callback function from C++ callback function. **/ - grpc_tls_on_server_authorization_check_done_cb c_callback() const; + /** Calls the C arg's callback function. **/ + void callback(); private: - grpcpp_tls_on_server_authorization_check_done_cb cb_; - void* cb_user_data_; - int success_; - grpc::string target_name_; - grpc::string peer_cert_; - grpc_status_code status_; - grpc::string error_details_; + grpc_tls_server_authorization_check_arg c_arg_; }; -/** Creates a smart pointer to a C++ version of the server authorization check - * argument, with the callback function set to a nullptr. **/ -::std::unique_ptr -tls_server_authorization_check_arg_c_to_cpp( - const grpc_tls_server_authorization_check_arg* arg); +// Exposed for testing purposes. +int tls_server_authorization_check_config_c_schedule( + void* config_user_data, grpc_tls_server_authorization_check_arg* arg); +void tls_server_authorization_check_config_c_cancel(void* config_user_data, + grpc_tls_server_authorization_check_arg* arg); + /** TLS server authorization check config, wraps * grps_tls_server_authorization_check_config. **/ @@ -188,11 +196,13 @@ class TlsServerAuthorizationCheckConfig { cancel_(config_user_data_, arg); } - /** Creates C struct for the server authorization check config. **/ - grpc_tls_server_authorization_check_config* c_server_authorization_check() - const; + /** Creates C struct for the credential reload config. **/ + grpc_tls_server_authorization_check_config* c_server_authorization_check() const { + return c_config_; + } private: + grpc_tls_server_authorization_check_arg* c_config_; void* config_user_data_; int (*schedule_)(void* config_user_data, TlsServerAuthorizationCheckArg* arg); void (*cancel_)(void* config_user_data, TlsServerAuthorizationCheckArg* arg); From 0e65b7a20ce18d9edd6e62ad6444b7c0fbece957 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 20 Aug 2019 13:26:57 -0700 Subject: [PATCH 20/70] Restored tls_credentials_options.cc --- src/cpp/common/tls_credentials_options.cc | 320 ++++++++++++---------- 1 file changed, 176 insertions(+), 144 deletions(-) diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index c4bf2dfba6a..162e15d92e7 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -33,22 +33,26 @@ void TlsKeyMaterialsConfig::set_key_materials( namespace { /** Creates a new C struct for the key materials. **/ -grpc_tls_key_materials_config* c_key_materials(::std::shared_ptr config) { +grpc_tls_key_materials_config* c_key_materials(const ::std::shared_ptr& config) { grpc_tls_key_materials_config* c_config = grpc_tls_key_materials_config_create(); ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> c_pem_key_cert_pair_list; for (auto key_cert_pair = config->pem_key_cert_pair_list().begin(); key_cert_pair != config->pem_key_cert_pair_list().end(); key_cert_pair++) { + grpc_ssl_pem_key_cert_pair* ssl_pair = + (grpc_ssl_pem_key_cert_pair*)gpr_malloc( + sizeof(grpc_ssl_pem_key_cert_pair)); + ssl_pair->private_key = gpr_strdup(key_cert_pair->private_key.c_str()); + ssl_pair->cert_chain = gpr_strdup(key_cert_pair->cert_chain.c_str()); ::grpc_core::PemKeyCertPair c_pem_key_cert_pair = - ::grpc_core::PemKeyCertPair(key_cert_pair->private_key.c_str(), - key_cert_pair->cert_chain.c_str()); + ::grpc_core::PemKeyCertPair(ssl_pair); c_pem_key_cert_pair_list.push_back(::std::move(c_pem_key_cert_pair)); } - ::grpc_core::UniquePtr c_pem_root_certs( - gpr_strdup(config->pem_root_certs().c_str())); + ::grpc_core::UniquePtr c_pem_root_certs(gpr_strdup(config->pem_root_certs().c_str())); c_config->set_key_materials(::std::move(c_pem_root_certs), ::std::move(c_pem_key_cert_pair_list)); + c_config->set_version(config->version()); return c_config; } @@ -71,204 +75,232 @@ grpc_tls_key_materials_config* c_key_materials(::std::shared_ptrset_key_materials( ::std::move(gpr_strdup(config->pem_root_certs())), ::std::move(cpp_pem_key_cert_pair_list)); + cpp_config->set_version(config->version()); return cpp_config; } } // namespace /** TLS credential reload arg API implementation **/ +TlsCredentialReloadArg::TlsCredentialReloadArg() {} + +TlsCredentialReloadArg::TlsCredentialReloadArg( + grpc_tls_credential_reload_arg arg) { + c_arg_ = arg; +} + +TlsCredentialReloadArg::~TlsCredentialReloadArg() {} + void* TlsCredentialReloadArg::cb_user_data() const { - return c_arg_->cb_user_data; + return c_arg_.cb_user_data; } /** This function creates a new TlsKeyMaterialsConfig instance whose fields are * not shared with the corresponding key materials config fields of the * TlsCredentialReloadArg instance. **/ ::std::shared_ptr TlsCredentialReloadArg::key_materials_config() const { - return tls_key_materials_c_to_cpp(c_arg_->key_materials_config); + return tls_key_materials_c_to_cpp(c_arg_.key_materials_config); } grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() const { - return c_arg_->status; + return c_arg_.status; } -grpc::string TlsCredentialReloadArg::error_details() const { - return static_cast(c_arg_->error_details); +::std::shared_ptr TlsCredentialReloadArg::error_details() const { + ::std::shared_ptr cpp_error_details(new grpc::string(c_arg_.error_details)); + return cpp_error_details; } void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { - c_arg_->cb_user_data = cb_user_data; + c_arg_.cb_user_data = cb_user_data; } void TlsCredentialReloadArg::set_key_materials_config( ::std::shared_ptr key_materials_config) { - c_arg_->key_materials_config = c_key_materials(key_materials_config); + c_arg_.key_materials_config = c_key_materials(key_materials_config); } void TlsCredentialReloadArg::set_status( grpc_ssl_certificate_config_reload_status status) { - c_arg_->status = status; + c_arg_.status = status; } void TlsCredentialReloadArg::set_error_details(grpc::string error_details) { - c_arg_->error_details = gpr_strdup(error_details.c_str()); + c_arg_.error_details = gpr_strdup(error_details.c_str()); } -namespace { -/** Creates a smart pointer to a C++ version of the credential reload argument, - * with the callback function set to a nullptr. **/ -::std::unique_ptr tls_credential_reload_arg_c_to_cpp(const grpc_tls_credential_reload_arg* arg) { - ::std::unique_ptr cpp_arg(new TlsCredentialReloadArg()); - cpp_arg->set_cb_user_data(arg->cb_user_data); - cpp_arg->set_key_materials_config( - tls_key_materials_c_to_cpp(arg->key_materials_config)); - cpp_arg->set_status(arg->status); - cpp_arg->set_error_details(arg->error_details); - return cpp_arg; +void TlsCredentialReloadArg::callback() { + c_arg_.cb(&c_arg_); } -} // namespace void TlsCredentialReloadArg::callback() { - c_arg_->cb(c_arg_); + c_arg_.cb(c_arg_); } +namespace { +/** The C schedule and cancel functions for the credential reload config. **/ +int tls_credential_reload_config_c_schedule( + void* config_user_data, grpc_tls_credential_reload_arg* arg) { + TlsCredentialReloadConfig* cpp_config = + static_cast(arg->config->context()); + TlsCredentialReloadArg cpp_arg(*arg); + int schedule_output = cpp_config->Schedule(&cpp_arg); + arg->cb_user_data = cpp_arg.cb_user_data(); + arg->key_materials_config = c_key_materials(cpp_arg.key_materials_config()); + arg->status = cpp_arg.status(); + arg->error_details = gpr_strdup(cpp_arg.error_details()->c_str()); + return schedule_output; +} + +void tls_credential_reload_config_c_cancel( + void* config_user_data, grpc_tls_credential_reload_arg* arg) { + TlsCredentialReloadConfig* cpp_config = + static_cast(arg->config->context()); + TlsCredentialReloadArg cpp_arg(*arg); + cpp_config->Cancel(&cpp_arg); + arg->cb_user_data = cpp_arg.cb_user_data(); + arg->key_materials_config = c_key_materials(cpp_arg.key_materials_config()); + arg->status = cpp_arg.status(); + arg->error_details = cpp_arg.error_details()->c_str(); +} +} // namespace + /** gRPC TLS credential reload config API implementation **/ TlsCredentialReloadConfig::TlsCredentialReloadConfig( const void* config_user_data, int (*schedule)(void* config_user_data, TlsCredentialReloadArg* arg), void (*cancel)(void* config_user_data, TlsCredentialReloadArg* arg), - void (*destruct)(void* config_user_data)) - : config_user_data_(const_cast(config_user_data)), - schedule_(schedule), - cancel_(cancel), - destruct_(destruct) {} + void (*destruct)(void* config_user_data)) { + config_user_data_ = const_cast(config_user_data); + schedule_ = schedule; + cancel_ = cancel; + destruct_ = destruct; + c_config_ = grpc_tls_credential_reload_config_create( + config_user_data_, &tls_credential_reload_config_c_schedule, + &tls_credential_reload_config_c_cancel, destruct_); + c_config_->set_context(static_cast(this)); +} TlsCredentialReloadConfig::~TlsCredentialReloadConfig() {} -grpc_tls_credential_reload_config* -TlsCredentialReloadConfig::c_credential_reload() const { - typedef int (*grpcpp_tls_credential_reload_schedule)( - void* config_user_data, TlsCredentialReloadArg* arg); - grpcpp_tls_credential_reload_schedule cpp_schedule = schedule_; - typedef int (*grpc_tls_credential_reload_schedule)( - void* config_user_data, grpc_tls_credential_reload_arg* arg); - std::function c_schedule = - [cpp_schedule](void* config_user_data, - grpc_tls_credential_reload_arg* arg) { - return cpp_schedule(config_user_data, - tls_credential_reload_arg_c_to_cpp(arg).get()); - }; - - typedef void (*grpcpp_tls_credential_reload_cancel)( - void* config_user_data, TlsCredentialReloadArg* arg); - grpcpp_tls_credential_reload_cancel cpp_cancel = cancel_; - typedef void (*grpc_tls_credential_reload_cancel)( - void* config_user_data, grpc_tls_credential_reload_arg* arg); - std::function c_cancel = - [cpp_cancel](void* config_user_data, - grpc_tls_credential_reload_arg* arg) { - return cpp_cancel(config_user_data, - tls_credential_reload_arg_c_to_cpp(arg).get()); - }; - - grpc_tls_credential_reload_config* c_config = - grpc_tls_credential_reload_config_create( - const_cast(config_user_data_), - *(c_schedule.target()), - *(c_cancel.target()), destruct_); - return c_config; +/** gRPC TLS server authorization check arg API implementation **/ +TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg() {} + +TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg( + grpc_tls_server_authorization_check_arg arg) { + c_arg_ = arg; } -/** gRPC TLS server authorization check arg API implementation **/ +TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() {} + +void* TlsServerAuthorizationCheckArg::cb_user_data() const { + return c_arg_.cb_user_data; +} + +int TlsServerAuthorizationCheckArg::success() const { return c_arg_.success; } + +::std::shared_ptr TlsServerAuthorizationCheckArg::target_name() + const { + ::std::shared_ptr cpp_target_name( + new grpc::string(c_arg_.target_name)); + return cpp_target_name; +} + +::std::shared_ptr TlsServerAuthorizationCheckArg::peer_cert() + const { + ::std::shared_ptr cpp_peer_cert( + new grpc::string(c_arg_.peer_cert)); + return cpp_peer_cert; +} -::std::unique_ptr -tls_server_authorization_check_arg_c_to_cpp( - const grpc_tls_server_authorization_check_arg* arg) { - ::std::unique_ptr cpp_arg( - new TlsServerAuthorizationCheckArg()); - cpp_arg->set_cb( - static_cast(nullptr)); - cpp_arg->set_cb_user_data(arg->cb_user_data); - cpp_arg->set_success(arg->success); - cpp_arg->set_target_name(arg->target_name); - cpp_arg->set_peer_cert(arg->peer_cert); - cpp_arg->set_status(arg->status); - cpp_arg->set_error_details(arg->error_details); - return cpp_arg; -} - -grpc_tls_on_server_authorization_check_done_cb -TlsServerAuthorizationCheckArg::c_callback() const { - grpcpp_tls_on_server_authorization_check_done_cb cpp_cb = cb_; - std::function c_cb = - [cpp_cb](grpc_tls_server_authorization_check_arg* arg) { - return cpp_cb(tls_server_authorization_check_arg_c_to_cpp(arg).get()); - }; - return *(c_cb.target()); -} - -grpc_tls_server_authorization_check_arg* -TlsServerAuthorizationCheckArg::c_server_authorization_check_arg() const { - grpc_tls_server_authorization_check_arg* c_arg = - new grpc_tls_server_authorization_check_arg(); - c_arg->cb = this->c_callback(); - c_arg->cb_user_data = cb_user_data_; - c_arg->success = success_; - c_arg->target_name = gpr_strdup(target_name_.c_str()); - c_arg->peer_cert = gpr_strdup(peer_cert_.c_str()); - c_arg->status = status_; - c_arg->error_details = gpr_strdup(error_details_.c_str()); - return c_arg; +grpc_status_code TlsServerAuthorizationCheckArg::status() const { + return c_arg_.status; } +::std::shared_ptr TlsServerAuthorizationCheckArg::error_details() + const { + ::std::shared_ptr cpp_error_details( +new grpc::string(c_arg_.error_details)); + return cpp_error_details; +} + +void TlsServerAuthorizationCheckArg::set_cb_user_data(void* cb_user_data) { + c_arg_.cb_user_data = cb_user_data; +} + +void TlsServerAuthorizationCheckArg::set_success(int success) { + c_arg_.success = success; +} + +void TlsServerAuthorizationCheckArg::set_target_name( + const grpc::string& target_name) { + c_arg_.target_name = gpr_strdup(target_name.c_str()); +} + +void TlsServerAuthorizationCheckArg::set_peer_cert( + const grpc::string& peer_cert) { + c_arg_.peer_cert = gpr_strdup(peer_cert.c_str()); +} + +void TlsServerAuthorizationCheckArg::set_status(grpc_status_code status) { + c_arg_.status = status; +} + +void TlsServerAuthorizationCheckArg::set_error_details( + const grpc::string& error_details) { + c_arg_.error_details = gpr_strdup(error_details.c_str()); +} + +namespace { +/** The C schedule and cancel functions for the credential reload config. **/ +int tls_server_authorization_check_config_c_schedule( + void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { + TlsServerAuthorizationCheckConfig* cpp_config = + static_cast(arg->config->context()); + TlsServerAuthorizationCheckArg cpp_arg(*arg); + int schedule_output = cpp_config->Schedule(&cpp_arg); + arg->cb_user_data = cpp_arg.cb_user_data(); + arg->success = cpp_arg.success(); + arg->target_name = gpr_strdup(cpp_arg.target_name()->c_str()); + arg->peer_cert = gpr_strdup(cpp_arg.peer_cert()->c_str()); + arg->status = cpp_arg.status(); + arg->error_details = gpr_strdup(cpp_arg.error_details()->c_str()); + return schedule_output; +} + +void tls_server_authorization_check_config_c_cancel( + void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { + TlsServerAuthorizationCheckConfig* cpp_config = + static_cast(arg->config->context()); + TlsServerAuthorizationCheckArg cpp_arg(*arg); + cpp_config->Cancel(&cpp_arg); + arg->cb_user_data = cpp_arg.cb_user_data(); + arg->success = cpp_arg.success(); + arg->target_name = gpr_strdup(cpp_arg.target_name()->c_str()); + arg->peer_cert = gpr_strdup(cpp_arg.peer_cert()->c_str()); + arg->status = cpp_arg.status(); + arg->error_details = gpr_strdup(cpp_arg.error_details()->c_str()); +} +} // namespace + /** gRPC TLS server authorization check config API implementation **/ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( const void* config_user_data, int (*schedule)(void* config_user_data, TlsServerAuthorizationCheckArg* arg), void (*cancel)(void* config_user_data, TlsServerAuthorizationCheckArg* arg), - void (*destruct)(void* config_user_data)) - : config_user_data_(const_cast(config_user_data)), - schedule_(schedule), - cancel_(cancel), - destruct_(destruct) {} + void (*destruct)(void* config_user_data)) { + config_user_data_ = const_cast(config_user_data); + schedule_ = schedule; + cancel_ = cancel; +destruct_ = destruct; + c_config_ = grpc_tls_server_authorization_check_config_create( + config_user_data_, &tls_server_authorization_check_config_c_schedule, + &tls_server_authorization_check_config_c_cancel, destruct_); + c_config_->set_context(static_cast(this)); +} -TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() {} -grpc_tls_server_authorization_check_config* -TlsServerAuthorizationCheckConfig::c_server_authorization_check() const { - typedef int (*grpcpp_tls_server_authorization_check_schedule)( - void* config_user_data, TlsServerAuthorizationCheckArg* arg); - grpcpp_tls_server_authorization_check_schedule cpp_schedule = schedule_; - typedef int (*grpc_tls_server_authorization_check_schedule)( - void* config_user_data, grpc_tls_server_authorization_check_arg* arg); - std::function - c_schedule = - [cpp_schedule](void* config_user_data, - grpc_tls_server_authorization_check_arg* arg) { - return cpp_schedule( - config_user_data, - tls_server_authorization_check_arg_c_to_cpp(arg).get()); - }; - typedef void (*grpcpp_tls_server_authorization_check_cancel)( - void* config_user_data, TlsServerAuthorizationCheckArg* arg); - grpcpp_tls_server_authorization_check_cancel cpp_cancel = cancel_; - typedef void (*grpc_tls_server_authorization_check_cancel)( - void* config_user_data, grpc_tls_server_authorization_check_arg* arg); - std::function - c_cancel = [cpp_cancel](void* config_user_data, - grpc_tls_server_authorization_check_arg* arg) { - return cpp_cancel( - config_user_data, - tls_server_authorization_check_arg_c_to_cpp(arg).get()); - }; - grpc_tls_server_authorization_check_config* c_config = - grpc_tls_server_authorization_check_config_create( - const_cast(config_user_data_), - *(c_schedule.target()), - *(c_cancel.target()), - destruct_); - return c_config; -} +TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() {} /** gRPC TLS credential options API implementation **/ grpc_tls_credentials_options* TlsCredentialsOptions::c_credentials_options() From 78e8fb731db1d1f488cb4b5c32c26d229713d38a Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 20 Aug 2019 13:42:53 -0700 Subject: [PATCH 21/70] Restored credentials_test.cc --- test/cpp/client/credentials_test.cc | 230 +++++++++++++++++++--------- 1 file changed, 154 insertions(+), 76 deletions(-) diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index de195ff4e7c..e2342552d46 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -30,6 +30,58 @@ #include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" #include "src/cpp/client/secure_credentials.h" +namespace { + +typedef class ::grpc_impl::experimental::TlsKeyMaterialsConfig + TlsKeyMaterialsConfig; +typedef class ::grpc_impl::experimental::TlsCredentialReloadArg + TlsCredentialReloadArg; +typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig + TlsCredentialReloadConfig; + +static void tls_credential_reload_callback( + grpc_tls_credential_reload_arg* arg) { + GPR_ASSERT(arg != nullptr); + arg->status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; +} + +static int tls_credential_reload_sync(void* config_user_data, + TlsCredentialReloadArg* arg) { + GPR_ASSERT(arg != nullptr); + struct TlsKeyMaterialsConfig::PemKeyCertPair pair3 = {"private_key3", + "cert_chain3"}; + ::std::shared_ptr key_materials_config = + arg->key_materials_config(); + ::std::vector pair_list = + key_materials_config->pem_key_cert_pair_list(); + pair_list.push_back(pair3); + key_materials_config->set_key_materials("new_pem_root_certs", pair_list); + arg->set_key_materials_config(key_materials_config); + arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + return 0; +} + +static void tls_credential_reload_cancel(void* config_user_data, + TlsCredentialReloadArg* arg) { + GPR_ASSERT(arg != nullptr); + arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); + arg->set_error_details("cancelled"); +} + +static void tls_server_authorization_check_callback( + grpc_tls_server_authorization_check_arg* arg) { + GPR_ASSERT(arg != nullptr); + char* cb_user_data = "cb_user_data"; + arg->set_cb_user_data(static_cast(gpr_strdup(cb_user_data))); + arg->set_success(1); + arg->set_target_name("callback_target_name"); + arg->set_peer_cert("callback_peer_cert"); + arg->set_status(GRPC_STATUS_OK); + arg->set_error_details("callback_error_details"); +} + +} // namespace + namespace grpc { namespace testing { @@ -198,7 +250,6 @@ TEST_F(CredentialsTest, StsCredentialsOptionsFromEnv) { gpr_unsetenv("STS_CREDENTIALS"); } -/** typedef class ::grpc_impl::experimental::TlsKeyMaterialsConfig TlsKeyMaterialsConfig; @@ -217,13 +268,18 @@ TEST_F(CredentialsTest, TlsKeyMaterialsConfigCppToC) { c_config->pem_key_cert_pair_list()[0].cert_chain()); gpr_free(c_config); } -**/ -/** TEST_F(CredentialsTest, TlsKeyMaterialsCtoCpp) { grpc_tls_key_materials_config c_config; + grpc::string test_private_key = "private_key"; + grpc::string test_cert_chain = "cert_chain"; + grpc_ssl_pem_key_cert_pair* ssl_pair = + (grpc_ssl_pem_key_cert_pair*)gpr_malloc( + sizeof(grpc_ssl_pem_key_cert_pair)); + ssl_pair->private_key = gpr_strdup(test_private_key.c_str()); + ssl_pair->cert_chain = gpr_strdup(test_cert_chain.c_str()); ::grpc_core::PemKeyCertPair pem_key_cert_pair = - ::grpc_core::PemKeyCertPair("private_key", "cert_chain"); + ::grpc_core::PemKeyCertPair(ssl_pair); ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> pem_key_cert_pair_list; pem_key_cert_pair_list.push_back(pem_key_cert_pair); @@ -239,20 +295,26 @@ TEST_F(CredentialsTest, TlsKeyMaterialsCtoCpp) { EXPECT_STREQ("private_key", cpp_pair_list[0].private_key.c_str()); EXPECT_STREQ("cert_chain", cpp_pair_list[0].cert_chain.c_str()); } -**/ -//typedef class ::grpc_impl::experimental::TlsCredentialReloadArg -// TlsCredentialReloadArg; -//typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig -// TlsCredentialReloadConfig; -//typedef void (*grpcpp_tls_on_credential_reload_done_cb)( -// TlsCredentialReloadArg* arg); +typedef class ::grpc_impl::experimental::TlsCredentialReloadArg TlsCredentialReloadArg; +typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig TlsCredentialReloadConfig; -/** -TEST_F(CredentialsTest, TlsCredentialReloadArgCppToC) { +TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { + grpc_tls_credential_reload_arg c_arg; + c_arg.cb = tls_credential_reload_callback; + TlsCredentialReloadArg arg = TlsCredentialReloadArg(c_arg); + arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + arg.callback(); + EXPECT_EQ(arg.status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED); +} + +TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { + TlsCredentialReloadConfig config(nullptr, &tls_credential_reload_sync, + nullptr, nullptr); TlsCredentialReloadArg arg; - arg.set_cb_user_data(nullptr); - ::std::shared_ptr key_materials_config; + arg.set_cb_user_data(static_cast(nullptr)); + ::std::shared_ptr key_materials_config( + new TlsKeyMaterialsConfig()); struct TlsKeyMaterialsConfig::PemKeyCertPair pair1 = {"private_key1", "cert_chain1"}; struct TlsKeyMaterialsConfig::PemKeyCertPair pair2 = {"private_key2", @@ -263,37 +325,71 @@ TEST_F(CredentialsTest, TlsCredentialReloadArgCppToC) { arg.set_key_materials_config(key_materials_config); arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); arg.set_error_details("error_details"); - grpc_tls_credential_reload_arg* c_arg = arg.c_credential_reload_arg(); - EXPECT_EQ(c_arg->cb, - static_cast(nullptr)); - EXPECT_EQ(c_arg->cb_user_data, nullptr); - EXPECT_EQ(c_arg->key_materials_config->pem_root_certs(), "pem_root_certs"); - EXPECT_EQ( - c_arg->key_materials_config->pem_key_cert_pair_list()[0].private_key(), - "private_key1"); - EXPECT_EQ( - c_arg->key_materials_config->pem_key_cert_pair_list()[1].private_key(), - "private_key2"); - EXPECT_EQ( - c_arg->key_materials_config->pem_key_cert_pair_list()[0].cert_chain(), - "cert_chain1"); - EXPECT_EQ( - c_arg->key_materials_config->pem_key_cert_pair_list()[1].cert_chain(), - "cert_chain2"); - EXPECT_EQ(c_arg->status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); - EXPECT_STREQ(c_arg->error_details, "error_details"); + int schedule_output = config.Schedule(&arg); + EXPECT_EQ(schedule_output, 0); + EXPECT_EQ(arg.cb_user_data(), nullptr); + EXPECT_STREQ(arg.key_materials_config()->pem_root_certs().c_str(), + "new_pem_root_certs"); + pair_list = arg.key_materials_config()->pem_key_cert_pair_list(); + EXPECT_EQ(static_cast(pair_list.size()), 3); + EXPECT_STREQ(pair_list[0].private_key.c_str(), "private_key1"); + EXPECT_STREQ(pair_list[0].cert_chain.c_str(), "cert_chain1"); + EXPECT_STREQ(pair_list[1].private_key.c_str(), "private_key2"); + EXPECT_STREQ(pair_list[1].cert_chain.c_str(), "cert_chain2"); + EXPECT_STREQ(pair_list[2].private_key.c_str(), "private_key3"); + EXPECT_STREQ(pair_list[2].cert_chain.c_str(), "cert_chain3"); + EXPECT_EQ(arg.status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + EXPECT_STREQ(arg.error_details()->c_str(), "error_details"); } -**/ - -/** TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { TlsCredentialReloadConfig config = - TlsCredentialReloadConfig(nullptr, nullptr, nullptr, nullptr); + TlsCredentialReloadConfig(nullptr, &tls_credential_reload_sync, + &tls_credential_reload_cancel, nullptr); + grpc_tls_credential_reload_arg c_arg; + c_arg.cb_user_data = static_cast(nullptr); + grpc_tls_key_materials_config c_key_materials; + grpc::string test_private_key = "private_key"; + grpc::string test_cert_chain = "cert_chain"; + grpc_ssl_pem_key_cert_pair* ssl_pair = + (grpc_ssl_pem_key_cert_pair*)gpr_malloc( + sizeof(grpc_ssl_pem_key_cert_pair)); + ssl_pair->private_key = gpr_strdup(test_private_key.c_str()); + ssl_pair->cert_chain = gpr_strdup(test_cert_chain.c_str()); + ::grpc_core::PemKeyCertPair pem_key_cert_pair = + ::grpc_core::PemKeyCertPair(ssl_pair); + ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> + pem_key_cert_pair_list; + pem_key_cert_pair_list.push_back(pem_key_cert_pair); + grpc::string test_pem_root_certs = "pem_root_certs"; + c_key_materials.set_key_materials( + ::grpc_core::UniquePtr(gpr_strdup(test_pem_root_certs.c_str())), + pem_key_cert_pair_list); + c_arg.key_materials_config = &c_key_materials; + c_arg.status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + grpc::string test_error_details = "error_details"; + c_arg.error_details = test_error_details.c_str(); + grpc_tls_credential_reload_config* c_config = config.c_credential_reload(); - EXPECT_EQ(c_config, nullptr); - // EXPECT_NE(c_config, nullptr); - // TODO: add tests to compare schedule, cancel, destruct fields. + c_arg.config = c_config; + int c_schedule_output = c_config->Schedule(&c_arg); + EXPECT_EQ(c_schedule_output, 0); + EXPECT_EQ(c_arg.cb_user_data, nullptr); + EXPECT_STREQ(c_arg.key_materials_config->pem_root_certs(), + "new_pem_root_certs"); + ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> pair_list = + c_arg.key_materials_config->pem_key_cert_pair_list(); + EXPECT_EQ(static_cast(pair_list.size()), 2); + EXPECT_STREQ(pair_list[0].private_key(), "private_key"); + EXPECT_STREQ(pair_list[0].cert_chain(), "cert_chain"); + EXPECT_STREQ(pair_list[1].private_key(), "private_key3"); + EXPECT_STREQ(pair_list[1].cert_chain(), "cert_chain3"); + EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + EXPECT_STREQ(c_arg.error_details, test_error_details.c_str()); + + c_config->(&c_arg); + EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); + EXPECT_STREQ(c_arg.error_details, "cancelled"); } typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckArg @@ -301,40 +397,23 @@ typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckArg typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckConfig TlsServerAuthorizationCheckConfig; -TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCppToC) { - TlsServerAuthorizationCheckArg arg; - // Only sync server authorization check supported currently, - // so we use a nullptr call back function. - arg.set_cb(nullptr); - arg.set_cb_user_data(nullptr); - arg.set_success(1); - arg.set_peer_cert("peer_cert"); - arg.set_status(GRPC_STATUS_OK); - arg.set_target_name("target_name"); - arg.set_error_details("error_details"); - grpc_tls_server_authorization_check_arg* c_arg = - arg.c_server_authorization_check_arg(); - // EXPECT_NE(c_arg, nullptr); - EXPECT_EQ(c_arg->cb, nullptr); - EXPECT_EQ(c_arg->cb_user_data, nullptr); - RecordProperty("TlsServerAuthorizationCheckArgCppToC::c_arg->success", -c_arg->success); EXPECT_EQ(c_arg->success, 1); - RecordProperty("TlsServerAuthorizationCheckArgCppToC::c_arg->peer_cert", -c_arg->peer_cert); EXPECT_STREQ(c_arg->peer_cert, "peer_cert"); - RecordProperty("TlsServerAuthorizationCheckArgCppToC::c_arg->target_name", -c_arg->target_name); EXPECT_STREQ(c_arg->target_name, "target_name"); - EXPECT_EQ(c_arg->status, GRPC_STATUS_OK); - RecordProperty("TlsServerAuthorizationCheckArgCppToC::c_arg->error_details", -c_arg->error_details); EXPECT_STREQ(c_arg->error_details, "error_details"); -} - -TEST_F(CredentialsTest, TlsServerAuthorizationCheckCppToC) { - TlsServerAuthorizationCheckConfig config = - TlsServerAuthorizationCheckConfig(nullptr, nullptr, nullptr, nullptr); - grpc_tls_server_authorization_check_config* c_config = - config.c_server_authorization_check(); - EXPECT_EQ(c_config, nullptr); // Because c_server_authn_check not implemented - // TODO: add tests to compare schedule, cancel, destruct fields. +TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { + grpc_tls_server_authorization_check_arg c_arg; + c_arg.cb = tls_server_authorization_check_callback; + c_arg.cb_user_data = nullptr; + c_arg.success = 0; + c_arg.target_name = "target_name"; + c_arg.peer_cert = "peer_cert"; + c_arg.status = GRPC_STATUS_UNAUTHENTICATED; + c_arg.error_details = "error_details"; + TlsServerAuthorizationCheckArg arg(c_arg); + arg.callback(); + EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); + EXPECT_EQ(arg.success(), 1); + EXPECT_STREQ(arg.target_name()->c_str(), "callback_target_name"); + EXPECT_STREQ(arg.peer_cert()->c_str(), "callback_peer_cert"); + EXPECT_EQ(arg.status(), GRPC_STATUS_OK); + EXPECT_STREQ(arg.error_details()->c_str(), "callback_error_details"); } typedef class ::grpc_impl::experimental::TlsCredentialsOptions @@ -359,7 +438,6 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { key_materials_config->c_key_materials()); gpr_free(c_options); } -**/ } // namespace testing } // namespace grpc From b95e70ee1b3ed989c2e40ad273210eae3c5fa85f Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 20 Aug 2019 13:47:25 -0700 Subject: [PATCH 22/70] Restored grpc_security, ssl_utils, grpc_tls_credentials_options.h --- .../credentials/tls/grpc_tls_credentials_options.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h index af4074138cf..e6399ba6ecd 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +++ b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h @@ -65,6 +65,9 @@ struct grpc_tls_credential_reload_config void (*destruct)(void* config_user_data)); ~grpc_tls_credential_reload_config(); + void* context() const { return context_; } + void set_context(void* context) { context_ = context; } + int Schedule(grpc_tls_credential_reload_arg* arg) const { return schedule_(config_user_data_, arg); } @@ -77,6 +80,7 @@ struct grpc_tls_credential_reload_config } private: + void* context_; /** config-specific, read-only user data that works for all channels created with a credential using the config. */ void* config_user_data_; @@ -113,6 +117,9 @@ struct grpc_tls_server_authorization_check_config void (*destruct)(void* config_user_data)); ~grpc_tls_server_authorization_check_config(); + void* context() const { return context_; } + void set_context(void* context) { context_ = context; } + int Schedule(grpc_tls_server_authorization_check_arg* arg) const { return schedule_(config_user_data_, arg); } @@ -125,6 +132,7 @@ struct grpc_tls_server_authorization_check_config } private: + void* context_; /** config-specific, read-only user data that works for all channels created with a Credential using the config. */ void* config_user_data_; From 853f95a7d59160aab64c0e766eabd63c5ec6b4f3 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 20 Aug 2019 13:48:23 -0700 Subject: [PATCH 23/70] Add files to previous restore commit --- include/grpc/grpc_security.h | 2 ++ include/grpcpp/security/tls_credentials_options.h | 10 +++++----- src/core/lib/security/security_connector/ssl_utils.h | 4 ---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index 794900b3b16..98657d53cfc 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -819,6 +819,7 @@ struct grpc_tls_credential_reload_arg { grpc_tls_key_materials_config* key_materials_config; grpc_ssl_certificate_config_reload_status status; const char* error_details; + grpc_tls_credential_reload_config* config; }; /** Create a grpc_tls_credential_reload_config instance. @@ -881,6 +882,7 @@ struct grpc_tls_server_authorization_check_arg { const char* peer_cert; grpc_status_code status; const char* error_details; + grpc_tls_server_authorization_check_arg* config; }; /** Create a grpc_tls_server_authorization_check_config instance. diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 83f4a202a1b..c5173b8524f 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -75,7 +75,7 @@ class TlsCredentialReloadArg { void* cb_user_data() const; ::std::shared_ptr key_materials_config() const; grpc_ssl_certificate_config_reload_status status() const; - grpc::string error_details() const; + ::std::shared_ptr error_details() const; /** Setters for member fields. **/ void set_cb_user_data(void* cb_user_data); @@ -144,10 +144,10 @@ class TlsServerAuthorizationCheckArg { /** Getters for member fields. **/ void* cb_user_data() const; int success() const; - grpc::string target_name() const; - grpc::string peer_cert() const; + ::std::shared_ptr target_name() const; + ::std::shared_ptr peer_cert() const; grpc_status_code status() const; - grpc::string error_details() const; + ::std::shared_ptr error_details() const; /** Setters for member fields. **/ void set_cb_user_data(void* cb_user_data); @@ -216,7 +216,7 @@ class TlsCredentialsOptions { grpc_ssl_client_certificate_request_type cert_request_type() const { return cert_request_type_; } - std::shared_ptr key_materials_config() const { + ::std::shared_ptr key_materials_config() const { return key_materials_config_; } ::std::shared_ptr credential_reload_config() diff --git a/src/core/lib/security/security_connector/ssl_utils.h b/src/core/lib/security/security_connector/ssl_utils.h index 3d3c436da3b..29366b309e8 100644 --- a/src/core/lib/security/security_connector/ssl_utils.h +++ b/src/core/lib/security/security_connector/ssl_utils.h @@ -137,10 +137,6 @@ class PemKeyCertPair { cert_chain_(const_cast(pair->cert_chain)) { gpr_free(pair); } - // Construct directly from the two strings. - explicit PemKeyCertPair(const char* private_key, const char* cert_chain) - : private_key_(grpc_core::UniquePtr(gpr_strdup(private_key))), - cert_chain_(grpc_core::UniquePtr(gpr_strdup(cert_chain))) {} // Movable. PemKeyCertPair(PemKeyCertPair&& other) { From 52b72c00f113f258d95bd3cb7f3783fd760bf15f Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 20 Aug 2019 14:23:08 -0700 Subject: [PATCH 24/70] Debugging after restores --- include/grpc/grpc_security.h | 2 +- .../grpcpp/security/tls_credentials_options.h | 50 ++++++++--------- src/cpp/common/tls_credentials_options.cc | 54 ++++++++----------- test/cpp/client/credentials_test.cc | 18 +++---- 4 files changed, 57 insertions(+), 67 deletions(-) diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index 98657d53cfc..d63802c9782 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -882,7 +882,7 @@ struct grpc_tls_server_authorization_check_arg { const char* peer_cert; grpc_status_code status; const char* error_details; - grpc_tls_server_authorization_check_arg* config; + grpc_tls_server_authorization_check_config* config; }; /** Create a grpc_tls_server_authorization_check_config instance. diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index c5173b8524f..7db070d7e8f 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -39,28 +39,28 @@ class TlsKeyMaterialsConfig { /** Getters for member fields. **/ const grpc::string pem_root_certs() const { return pem_root_certs_; } - const ::std::vector& pem_key_cert_pair_list() const { + const std::vector& pem_key_cert_pair_list() const { return pem_key_cert_pair_list_; } - const int version() const { return version_; } + int version() const { return version_; } /** Setter for key materials that will be called by the user. The setter * transfers ownership of the arguments to the config. **/ void set_key_materials(grpc::string pem_root_certs, - ::std::vector pem_key_cert_pair_list); + std::vector pem_key_cert_pair_list); void set_version(int version) { version_ = version;}; private: int version_; - ::std::vector pem_key_cert_pair_list_; + std::vector pem_key_cert_pair_list_; grpc::string pem_root_certs_; }; /** The following 2 functions are exposed for testing purposes. **/ grpc_tls_key_materials_config* c_key_materials( - const ::std::shared_ptr& config); + const std::shared_ptr& config); -::std::shared_ptr tls_key_materials_c_to_cpp( +std::shared_ptr tls_key_materials_c_to_cpp( const grpc_tls_key_materials_config* config); @@ -73,19 +73,19 @@ class TlsCredentialReloadArg { /** Getters for member fields. The callback function is not exposed. **/ void* cb_user_data() const; - ::std::shared_ptr key_materials_config() const; + std::shared_ptr key_materials_config() const; grpc_ssl_certificate_config_reload_status status() const; - ::std::shared_ptr error_details() const; + std::shared_ptr error_details() const; /** Setters for member fields. **/ void set_cb_user_data(void* cb_user_data); void set_key_materials_config( - ::std::shared_ptr key_materials_config); + std::shared_ptr key_materials_config); void set_status(grpc_ssl_certificate_config_reload_status status); void set_error_details(const grpc::string& error_details); /** Calls the C arg's callback function. **/ - void callback() ; + void callback(); private: grpc_tls_credential_reload_arg c_arg_; @@ -144,10 +144,10 @@ class TlsServerAuthorizationCheckArg { /** Getters for member fields. **/ void* cb_user_data() const; int success() const; - ::std::shared_ptr target_name() const; - ::std::shared_ptr peer_cert() const; + std::shared_ptr target_name() const; + std::shared_ptr peer_cert() const; grpc_status_code status() const; - ::std::shared_ptr error_details() const; + std::shared_ptr error_details() const; /** Setters for member fields. **/ void set_cb_user_data(void* cb_user_data); @@ -202,7 +202,7 @@ class TlsServerAuthorizationCheckConfig { } private: - grpc_tls_server_authorization_check_arg* c_config_; + grpc_tls_server_authorization_check_config* c_config_; void* config_user_data_; int (*schedule_)(void* config_user_data, TlsServerAuthorizationCheckArg* arg); void (*cancel_)(void* config_user_data, TlsServerAuthorizationCheckArg* arg); @@ -216,14 +216,14 @@ class TlsCredentialsOptions { grpc_ssl_client_certificate_request_type cert_request_type() const { return cert_request_type_; } - ::std::shared_ptr key_materials_config() const { + std::shared_ptr key_materials_config() const { return key_materials_config_; } - ::std::shared_ptr credential_reload_config() + std::shared_ptr credential_reload_config() const { return credential_reload_config_; } - ::std::shared_ptr + std::shared_ptr server_authorization_check_config() const { return server_authorization_check_config_; } @@ -234,15 +234,15 @@ class TlsCredentialsOptions { cert_request_type_ = type; } void set_key_materials_config(std::shared_ptr config) { - key_materials_config_ = ::std::move(config); + key_materials_config_ = std::move(config); } void set_credential_reload_config( - ::std::shared_ptr config) { - credential_reload_config_ = ::std::move(config); + std::shared_ptr config) { + credential_reload_config_ = std::move(config); } void set_server_authorization_check_config( - ::std::shared_ptr config) { - server_authorization_check_config_ = ::std::move(config); + std::shared_ptr config) { + server_authorization_check_config_ = std::move(config); } /** Creates C struct for TLS credential options. **/ @@ -250,9 +250,9 @@ class TlsCredentialsOptions { private: grpc_ssl_client_certificate_request_type cert_request_type_; - ::std::shared_ptr key_materials_config_; - ::std::shared_ptr credential_reload_config_; - ::std::shared_ptr + std::shared_ptr key_materials_config_; + std::shared_ptr credential_reload_config_; + std::shared_ptr server_authorization_check_config_; }; diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 162e15d92e7..a48e9f94ba6 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -26,14 +26,13 @@ namespace experimental { /** TLS key materials config API implementation **/ void TlsKeyMaterialsConfig::set_key_materials( grpc::string pem_root_certs, - ::std::vector pem_key_cert_pair_list) { - pem_key_cert_pair_list_ = ::std::move(pem_key_cert_pair_list); - pem_root_certs_ = ::std::move(pem_root_certs); + std::vector pem_key_cert_pair_list) { + pem_key_cert_pair_list_ = std::move(pem_key_cert_pair_list); + pem_root_certs_ = std::move(pem_root_certs); } -namespace { /** Creates a new C struct for the key materials. **/ -grpc_tls_key_materials_config* c_key_materials(const ::std::shared_ptr& config) { +grpc_tls_key_materials_config* c_key_materials(const std::shared_ptr& config) { grpc_tls_key_materials_config* c_config = grpc_tls_key_materials_config_create(); ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> @@ -50,18 +49,18 @@ grpc_tls_key_materials_config* c_key_materials(const ::std::shared_ptr c_pem_root_certs(gpr_strdup(config->pem_root_certs().c_str())); - c_config->set_key_materials(::std::move(c_pem_root_certs), - ::std::move(c_pem_key_cert_pair_list)); + c_config->set_key_materials(std::move(c_pem_root_certs), + std::move(c_pem_key_cert_pair_list)); c_config->set_version(config->version()); return c_config; } /** Creates a new TlsKeyMaterialsConfig from a C struct config. **/ -::std::shared_ptr tls_key_materials_c_to_cpp( +std::shared_ptr tls_key_materials_c_to_cpp( const grpc_tls_key_materials_config* config) { - ::std::shared_ptr cpp_config( + std::shared_ptr cpp_config( new TlsKeyMaterialsConfig()); - ::std::vector + std::vector cpp_pem_key_cert_pair_list; grpc_tls_key_materials_config::PemKeyCertPairList pem_key_cert_pair_list = config->pem_key_cert_pair_list(); @@ -73,12 +72,11 @@ grpc_tls_key_materials_config* c_key_materials(const ::std::shared_ptrset_key_materials( - ::std::move(gpr_strdup(config->pem_root_certs())), - ::std::move(cpp_pem_key_cert_pair_list)); + std::move(gpr_strdup(config->pem_root_certs())), + std::move(cpp_pem_key_cert_pair_list)); cpp_config->set_version(config->version()); return cpp_config; } -} // namespace /** TLS credential reload arg API implementation **/ TlsCredentialReloadArg::TlsCredentialReloadArg() {} @@ -97,7 +95,7 @@ void* TlsCredentialReloadArg::cb_user_data() const { /** This function creates a new TlsKeyMaterialsConfig instance whose fields are * not shared with the corresponding key materials config fields of the * TlsCredentialReloadArg instance. **/ -::std::shared_ptr TlsCredentialReloadArg::key_materials_config() const { +std::shared_ptr TlsCredentialReloadArg::key_materials_config() const { return tls_key_materials_c_to_cpp(c_arg_.key_materials_config); } @@ -105,8 +103,8 @@ grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() const return c_arg_.status; } -::std::shared_ptr TlsCredentialReloadArg::error_details() const { - ::std::shared_ptr cpp_error_details(new grpc::string(c_arg_.error_details)); +std::shared_ptr TlsCredentialReloadArg::error_details() const { + std::shared_ptr cpp_error_details(new grpc::string(c_arg_.error_details)); return cpp_error_details; } @@ -115,7 +113,7 @@ void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { } void TlsCredentialReloadArg::set_key_materials_config( - ::std::shared_ptr key_materials_config) { + std::shared_ptr key_materials_config) { c_arg_.key_materials_config = c_key_materials(key_materials_config); } @@ -124,7 +122,7 @@ void TlsCredentialReloadArg::set_status( c_arg_.status = status; } -void TlsCredentialReloadArg::set_error_details(grpc::string error_details) { +void TlsCredentialReloadArg::set_error_details(const grpc::string& error_details) { c_arg_.error_details = gpr_strdup(error_details.c_str()); } @@ -132,11 +130,6 @@ void TlsCredentialReloadArg::callback() { c_arg_.cb(&c_arg_); } -void TlsCredentialReloadArg::callback() { - c_arg_.cb(c_arg_); -} - -namespace { /** The C schedule and cancel functions for the credential reload config. **/ int tls_credential_reload_config_c_schedule( void* config_user_data, grpc_tls_credential_reload_arg* arg) { @@ -162,7 +155,6 @@ void tls_credential_reload_config_c_cancel( arg->status = cpp_arg.status(); arg->error_details = cpp_arg.error_details()->c_str(); } -} // namespace /** gRPC TLS credential reload config API implementation **/ TlsCredentialReloadConfig::TlsCredentialReloadConfig( @@ -198,16 +190,16 @@ void* TlsServerAuthorizationCheckArg::cb_user_data() const { int TlsServerAuthorizationCheckArg::success() const { return c_arg_.success; } -::std::shared_ptr TlsServerAuthorizationCheckArg::target_name() +std::shared_ptr TlsServerAuthorizationCheckArg::target_name() const { - ::std::shared_ptr cpp_target_name( + std::shared_ptr cpp_target_name( new grpc::string(c_arg_.target_name)); return cpp_target_name; } -::std::shared_ptr TlsServerAuthorizationCheckArg::peer_cert() +std::shared_ptr TlsServerAuthorizationCheckArg::peer_cert() const { - ::std::shared_ptr cpp_peer_cert( + std::shared_ptr cpp_peer_cert( new grpc::string(c_arg_.peer_cert)); return cpp_peer_cert; } @@ -216,9 +208,9 @@ grpc_status_code TlsServerAuthorizationCheckArg::status() const { return c_arg_.status; } -::std::shared_ptr TlsServerAuthorizationCheckArg::error_details() +std::shared_ptr TlsServerAuthorizationCheckArg::error_details() const { - ::std::shared_ptr cpp_error_details( + std::shared_ptr cpp_error_details( new grpc::string(c_arg_.error_details)); return cpp_error_details; } @@ -250,7 +242,6 @@ void TlsServerAuthorizationCheckArg::set_error_details( c_arg_.error_details = gpr_strdup(error_details.c_str()); } -namespace { /** The C schedule and cancel functions for the credential reload config. **/ int tls_server_authorization_check_config_c_schedule( void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { @@ -280,7 +271,6 @@ void tls_server_authorization_check_config_c_cancel( arg->status = cpp_arg.status(); arg->error_details = gpr_strdup(cpp_arg.error_details()->c_str()); } -} // namespace /** gRPC TLS server authorization check config API implementation **/ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index e2342552d46..93aa45e05c4 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -50,9 +50,9 @@ static int tls_credential_reload_sync(void* config_user_data, GPR_ASSERT(arg != nullptr); struct TlsKeyMaterialsConfig::PemKeyCertPair pair3 = {"private_key3", "cert_chain3"}; - ::std::shared_ptr key_materials_config = + std::shared_ptr key_materials_config = arg->key_materials_config(); - ::std::vector pair_list = + std::vector pair_list = key_materials_config->pem_key_cert_pair_list(); pair_list.push_back(pair3); key_materials_config->set_key_materials("new_pem_root_certs", pair_list); @@ -257,7 +257,7 @@ TEST_F(CredentialsTest, TlsKeyMaterialsConfigCppToC) { TlsKeyMaterialsConfig config; struct TlsKeyMaterialsConfig::PemKeyCertPair pair = {"private_key", "cert_chain"}; - ::std::vector pair_list = {pair}; + std::vector pair_list = {pair}; config.set_key_materials("pem_root_certs", pair_list); grpc_tls_key_materials_config* c_config = config.c_key_materials(); EXPECT_STREQ("pem_root_certs", c_config->pem_root_certs()); @@ -286,10 +286,10 @@ TEST_F(CredentialsTest, TlsKeyMaterialsCtoCpp) { c_config.set_key_materials( ::grpc_core::UniquePtr(gpr_strdup("pem_root_certs")), pem_key_cert_pair_list); - ::std::shared_ptr cpp_config = + std::shared_ptr cpp_config = ::grpc_impl::experimental::tls_key_materials_c_to_cpp(&c_config); EXPECT_STREQ("pem_root_certs", cpp_config->pem_root_certs().c_str()); - ::std::vector cpp_pair_list = + std::vector cpp_pair_list = cpp_config->pem_key_cert_pair_list(); EXPECT_EQ(1, static_cast(cpp_pair_list.size())); EXPECT_STREQ("private_key", cpp_pair_list[0].private_key.c_str()); @@ -313,13 +313,13 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { nullptr, nullptr); TlsCredentialReloadArg arg; arg.set_cb_user_data(static_cast(nullptr)); - ::std::shared_ptr key_materials_config( + std::shared_ptr key_materials_config( new TlsKeyMaterialsConfig()); struct TlsKeyMaterialsConfig::PemKeyCertPair pair1 = {"private_key1", "cert_chain1"}; struct TlsKeyMaterialsConfig::PemKeyCertPair pair2 = {"private_key2", "cert_chain2"}; - ::std::vector pair_list = {pair1, + std::vector pair_list = {pair1, pair2}; key_materials_config->set_key_materials("pem_root_certs", pair_list); arg.set_key_materials_config(key_materials_config); @@ -422,11 +422,11 @@ typedef class ::grpc_impl::experimental::TlsCredentialsOptions TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { TlsCredentialsOptions options; options.set_cert_request_type(GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY); - ::std::shared_ptr key_materials_config( + std::shared_ptr key_materials_config( new TlsKeyMaterialsConfig()); struct TlsKeyMaterialsConfig::PemKeyCertPair pair = {"private_key", "cert_chain"}; - ::std::vector pair_list = {pair}; + std::vector pair_list = {pair}; key_materials_config->set_key_materials("pem_root_certs", pair_list); options.set_key_materials_config(key_materials_config); // TODO: add instances of credential reload and server authorization check to From 9295e4ebb3ae5698fd6a13c7a1e96b79c19bc123 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 20 Aug 2019 14:41:38 -0700 Subject: [PATCH 25/70] Forgot to autogenerate files and run clang_format/tidy_code --- BUILD.gn | 141 +--- CMakeLists.txt | 558 +++++--------- Makefile | 729 +++++++----------- build_config.rb | 2 +- config.m4 | 75 +- config.w32 | 92 +-- gRPC-C++.podspec | 73 +- gRPC-Core.podspec | 173 ++--- gRPC-ProtoRPC.podspec | 2 +- gRPC-RxLibrary.podspec | 2 +- gRPC.podspec | 2 +- grpc.def | 2 - grpc.gemspec | 110 +-- grpc.gyp | 204 ++--- .../grpcpp/security/tls_credentials_options.h | 14 +- package.xml | 114 +-- src/core/lib/surface/version.cc | 4 +- .../plugin_registry/grpc_plugin_registry.cc | 4 - .../grpc_unsecure_plugin_registry.cc | 4 - src/cpp/common/tls_credentials_options.cc | 43 +- src/cpp/common/version_cc.cc | 2 +- src/csharp/Grpc.Core.Api/VersionInfo.cs | 6 +- src/csharp/build/dependencies.props | 2 +- src/csharp/build_unitypackage.bat | 2 +- .../!ProtoCompiler-gRPCCppPlugin.podspec | 2 +- .../!ProtoCompiler-gRPCPlugin.podspec | 2 +- src/objective-c/GRPCClient/private/version.h | 2 +- src/objective-c/tests/version.h | 4 +- src/php/composer.json | 2 +- src/php/ext/grpc/version.h | 2 +- src/python/grpcio/grpc/_grpcio_metadata.py | 2 +- src/python/grpcio/grpc_core_dependencies.py | 54 +- src/python/grpcio/grpc_version.py | 2 +- src/python/grpcio_channelz/grpc_version.py | 2 +- .../grpcio_health_checking/grpc_version.py | 2 +- src/python/grpcio_reflection/grpc_version.py | 2 +- src/python/grpcio_status/grpc_version.py | 2 +- src/python/grpcio_testing/grpc_version.py | 2 +- src/python/grpcio_tests/grpc_version.py | 2 +- src/ruby/ext/grpc/rb_grpc_imports.generated.c | 4 - src/ruby/ext/grpc/rb_grpc_imports.generated.h | 6 - src/ruby/lib/grpc/version.rb | 2 +- src/ruby/tools/version.rb | 2 +- .../core/surface/public_headers_must_be_c89.c | 2 - test/cpp/client/credentials_test.cc | 9 +- .../python/grpcio_tools/grpc_version.py | 2 +- tools/doxygen/Doxyfile.c++ | 3 +- tools/doxygen/Doxyfile.c++.internal | 26 +- tools/doxygen/Doxyfile.core | 2 +- tools/doxygen/Doxyfile.core.internal | 112 +-- tools/run_tests/generated/tests.json | 94 +-- 51 files changed, 827 insertions(+), 1881 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 9a30d1667e2..1ae9ebe14fc 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -33,6 +33,25 @@ config("grpc_config") { + source_set("health_proto") { + sources = [ + "src/core/ext/filters/client_channel/health/health.pb.c", + "src/core/ext/filters/client_channel/health/health.pb.h", + ] + deps = [ + ":nanopb", + ] + + public_configs = [ + ":grpc_config", + ] + include_dirs = [ + "third_party/nanopb", + ] + } + + + source_set("nanopb") { sources = [ "third_party/nanopb/pb.h", @@ -263,6 +282,12 @@ config("grpc_config") { "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc", "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c", + "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h", + "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c", + "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h", + "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c", + "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h", "src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc", "src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc", "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h", @@ -305,7 +330,6 @@ config("grpc_config") { "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc", "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h", "src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc", - "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc", "src/core/ext/filters/client_channel/resolver_factory.h", "src/core/ext/filters/client_channel/resolver_registry.cc", "src/core/ext/filters/client_channel/resolver_registry.h", @@ -405,76 +429,6 @@ config("grpc_config") { "src/core/ext/transport/inproc/inproc_plugin.cc", "src/core/ext/transport/inproc/inproc_transport.cc", "src/core/ext/transport/inproc/inproc_transport.h", - "src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h", - "src/core/ext/upb-generated/envoy/api/v2/cds.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/cds.upb.h", - "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h", - "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h", - "src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h", - "src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h", - "src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h", - "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h", - "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h", - "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h", - "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h", - "src/core/ext/upb-generated/envoy/api/v2/eds.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/eds.upb.h", - "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h", - "src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c", - "src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h", - "src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c", - "src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h", - "src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c", - "src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h", - "src/core/ext/upb-generated/envoy/type/percent.upb.c", - "src/core/ext/upb-generated/envoy/type/percent.upb.h", - "src/core/ext/upb-generated/envoy/type/range.upb.c", - "src/core/ext/upb-generated/envoy/type/range.upb.h", - "src/core/ext/upb-generated/gogoproto/gogo.upb.c", - "src/core/ext/upb-generated/gogoproto/gogo.upb.h", - "src/core/ext/upb-generated/google/api/annotations.upb.c", - "src/core/ext/upb-generated/google/api/annotations.upb.h", - "src/core/ext/upb-generated/google/api/http.upb.c", - "src/core/ext/upb-generated/google/api/http.upb.h", - "src/core/ext/upb-generated/google/protobuf/any.upb.c", - "src/core/ext/upb-generated/google/protobuf/any.upb.h", - "src/core/ext/upb-generated/google/protobuf/descriptor.upb.c", - "src/core/ext/upb-generated/google/protobuf/descriptor.upb.h", - "src/core/ext/upb-generated/google/protobuf/duration.upb.c", - "src/core/ext/upb-generated/google/protobuf/duration.upb.h", - "src/core/ext/upb-generated/google/protobuf/empty.upb.c", - "src/core/ext/upb-generated/google/protobuf/empty.upb.h", - "src/core/ext/upb-generated/google/protobuf/struct.upb.c", - "src/core/ext/upb-generated/google/protobuf/struct.upb.h", - "src/core/ext/upb-generated/google/protobuf/timestamp.upb.c", - "src/core/ext/upb-generated/google/protobuf/timestamp.upb.h", - "src/core/ext/upb-generated/google/protobuf/wrappers.upb.c", - "src/core/ext/upb-generated/google/protobuf/wrappers.upb.h", - "src/core/ext/upb-generated/google/rpc/status.upb.c", - "src/core/ext/upb-generated/google/rpc/status.upb.h", - "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c", - "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h", - "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c", - "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h", - "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c", - "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h", - "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c", - "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h", - "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c", - "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h", - "src/core/ext/upb-generated/validate/validate.upb.c", - "src/core/ext/upb-generated/validate/validate.upb.h", "src/core/lib/avl/avl.cc", "src/core/lib/avl/avl.h", "src/core/lib/backoff/backoff.cc", @@ -872,6 +826,10 @@ config("grpc_config") { "src/core/tsi/alts/frame_protector/frame_handler.h", "src/core/tsi/alts/handshaker/alts_handshaker_client.cc", "src/core/tsi/alts/handshaker/alts_handshaker_client.h", + "src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc", + "src/core/tsi/alts/handshaker/alts_handshaker_service_api.h", + "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc", + "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h", "src/core/tsi/alts/handshaker/alts_shared_resource.cc", "src/core/tsi/alts/handshaker/alts_shared_resource.h", "src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc", @@ -879,6 +837,12 @@ config("grpc_config") { "src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h", "src/core/tsi/alts/handshaker/alts_tsi_utils.cc", "src/core/tsi/alts/handshaker/alts_tsi_utils.h", + "src/core/tsi/alts/handshaker/altscontext.pb.c", + "src/core/tsi/alts/handshaker/altscontext.pb.h", + "src/core/tsi/alts/handshaker/handshaker.pb.c", + "src/core/tsi/alts/handshaker/handshaker.pb.h", + "src/core/tsi/alts/handshaker/transport_security_common.pb.c", + "src/core/tsi/alts/handshaker/transport_security_common.pb.h", "src/core/tsi/alts/handshaker/transport_security_common_api.cc", "src/core/tsi/alts/handshaker/transport_security_common_api.h", "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc", @@ -910,20 +874,6 @@ config("grpc_config") { "src/core/tsi/transport_security_grpc.cc", "src/core/tsi/transport_security_grpc.h", "src/core/tsi/transport_security_interface.h", - "third_party/upb/upb/decode.c", - "third_party/upb/upb/decode.h", - "third_party/upb/upb/encode.c", - "third_party/upb/upb/encode.h", - "third_party/upb/upb/generated_util.h", - "third_party/upb/upb/msg.c", - "third_party/upb/upb/msg.h", - "third_party/upb/upb/port.c", - "third_party/upb/upb/port_def.inc", - "third_party/upb/upb/port_undef.inc", - "third_party/upb/upb/table.c", - "third_party/upb/upb/table.int.h", - "third_party/upb/upb/upb.c", - "third_party/upb/upb/upb.h", ] deps = [ "//third_party/boringssl", @@ -931,6 +881,8 @@ config("grpc_config") { ":gpr", "//third_party/cares", ":address_sorting", + ":nanopb", + ":health_proto", ] public_configs = [ @@ -1124,7 +1076,6 @@ config("grpc_config") { "include/grpcpp/impl/codegen/core_codegen.h", "include/grpcpp/impl/codegen/core_codegen_interface.h", "include/grpcpp/impl/codegen/create_auth_context.h", - "include/grpcpp/impl/codegen/delegating_channel.h", "include/grpcpp/impl/codegen/grpc_library.h", "include/grpcpp/impl/codegen/intercepted_channel.h", "include/grpcpp/impl/codegen/interceptor.h", @@ -1211,8 +1162,6 @@ config("grpc_config") { "include/grpcpp/support/time.h", "include/grpcpp/support/validate_service_config.h", "src/core/ext/transport/inproc/inproc_transport.h", - "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c", - "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h", "src/core/lib/avl/avl.h", "src/core/lib/backoff/backoff.h", "src/core/lib/channel/channel_args.h", @@ -1443,26 +1392,14 @@ config("grpc_config") { "src/cpp/util/status.cc", "src/cpp/util/string_ref.cc", "src/cpp/util/time_cc.cc", - "third_party/upb/upb/decode.c", - "third_party/upb/upb/decode.h", - "third_party/upb/upb/encode.c", - "third_party/upb/upb/encode.h", - "third_party/upb/upb/generated_util.h", - "third_party/upb/upb/msg.c", - "third_party/upb/upb/msg.h", - "third_party/upb/upb/port.c", - "third_party/upb/upb/port_def.inc", - "third_party/upb/upb/port_undef.inc", - "third_party/upb/upb/table.c", - "third_party/upb/upb/table.int.h", - "third_party/upb/upb/upb.c", - "third_party/upb/upb/upb.h", ] deps = [ "//third_party/boringssl", "//third_party/protobuf:protobuf_lite", ":grpc", ":gpr", + ":nanopb", + ":health_proto", ] public_configs = [ diff --git a/CMakeLists.txt b/CMakeLists.txt index 53e6ad1d2e9..e0c20488d13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 3.5.1) set(PACKAGE_NAME "grpc") -set(PACKAGE_VERSION "1.24.0-dev") +set(PACKAGE_VERSION "1.23.0-dev") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") @@ -238,13 +238,13 @@ add_custom_target(tools_c grpc_create_jwt grpc_print_google_default_creds_token grpc_verify_jwt + gen_hpack_tables + gen_legal_metadata_characters + gen_percent_encoding_tables ) add_custom_target(tools_cxx DEPENDS - gen_hpack_tables - gen_legal_metadata_characters - gen_percent_encoding_tables ) add_custom_target(tools @@ -528,6 +528,7 @@ add_dependencies(buildtests_cxx alts_frame_handler_test) add_dependencies(buildtests_cxx alts_frame_protector_test) add_dependencies(buildtests_cxx alts_grpc_record_protocol_test) add_dependencies(buildtests_cxx alts_handshaker_client_test) +add_dependencies(buildtests_cxx alts_handshaker_service_api_test) add_dependencies(buildtests_cxx alts_iovec_record_protocol_test) add_dependencies(buildtests_cxx alts_security_connector_test) add_dependencies(buildtests_cxx alts_tsi_handshaker_test) @@ -595,9 +596,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx bm_pollset) endif() if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) -add_dependencies(buildtests_cxx bm_threadpool) -endif() -if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx bm_timer) endif() add_dependencies(buildtests_cxx byte_stream_test) @@ -627,7 +625,6 @@ add_dependencies(buildtests_cxx cxx_byte_buffer_test) add_dependencies(buildtests_cxx cxx_slice_test) add_dependencies(buildtests_cxx cxx_string_ref_test) add_dependencies(buildtests_cxx cxx_time_test) -add_dependencies(buildtests_cxx delegating_channel_test) add_dependencies(buildtests_cxx end2end_test) add_dependencies(buildtests_cxx error_details_test) add_dependencies(buildtests_cxx exception_test) @@ -641,7 +638,6 @@ add_dependencies(buildtests_cxx grpc_cli) add_dependencies(buildtests_cxx grpc_core_map_test) add_dependencies(buildtests_cxx grpc_fetch_oauth2) add_dependencies(buildtests_cxx grpc_linux_system_roots_test) -add_dependencies(buildtests_cxx grpc_spiffe_security_connector_test) add_dependencies(buildtests_cxx grpc_tool_test) add_dependencies(buildtests_cxx grpclb_api_test) add_dependencies(buildtests_cxx grpclb_end2end_test) @@ -1255,17 +1251,16 @@ add_library(grpc src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc + src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc + src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc src/core/tsi/alts/handshaker/alts_tsi_utils.cc src/core/tsi/alts/handshaker/transport_security_common_api.cc - src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c - src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c - src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c - third_party/upb/upb/decode.c - third_party/upb/upb/encode.c - third_party/upb/upb/msg.c - third_party/upb/upb/port.c - third_party/upb/upb/table.c - third_party/upb/upb/upb.c + src/core/tsi/alts/handshaker/altscontext.pb.c + src/core/tsi/alts/handshaker/handshaker.pb.c + src/core/tsi/alts/handshaker/transport_security_common.pb.c + third_party/nanopb/pb_common.c + third_party/nanopb/pb_decode.c + third_party/nanopb/pb_encode.c src/core/tsi/transport_security.cc src/core/ext/transport/chttp2/client/insecure/channel_create.cc src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc @@ -1298,7 +1293,7 @@ add_library(grpc src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + src/core/ext/filters/client_channel/health/health.pb.c src/core/tsi/fake_transport_security.cc src/core/tsi/local_transport_security.cc src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc @@ -1317,42 +1312,14 @@ add_library(grpc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc - src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c - src/core/ext/upb-generated/google/api/annotations.upb.c - src/core/ext/upb-generated/google/api/http.upb.c - src/core/ext/upb-generated/google/protobuf/any.upb.c - src/core/ext/upb-generated/google/protobuf/descriptor.upb.c - src/core/ext/upb-generated/google/protobuf/duration.upb.c - src/core/ext/upb-generated/google/protobuf/empty.upb.c - src/core/ext/upb-generated/google/protobuf/struct.upb.c - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c - src/core/ext/upb-generated/google/rpc/status.upb.c src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c src/core/ext/filters/client_channel/lb_policy/xds/xds.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc - src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c - src/core/ext/upb-generated/envoy/api/v2/cds.upb.c - src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c - src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c - src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c - src/core/ext/upb-generated/envoy/api/v2/eds.upb.c - src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c - src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c - src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c - src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c - src/core/ext/upb-generated/envoy/type/percent.upb.c - src/core/ext/upb-generated/envoy/type/range.upb.c - src/core/ext/upb-generated/gogoproto/gogo.upb.c - src/core/ext/upb-generated/validate/validate.upb.c src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -1368,7 +1335,6 @@ add_library(grpc src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc - src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc src/core/ext/filters/census/grpc_context.cc src/core/ext/filters/client_idle/client_idle_filter.cc src/core/ext/filters/max_age/max_age_filter.cc @@ -1700,13 +1666,10 @@ add_library(grpc_cronet src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c - third_party/upb/upb/decode.c - third_party/upb/upb/encode.c - third_party/upb/upb/msg.c - third_party/upb/upb/port.c - third_party/upb/upb/table.c - third_party/upb/upb/upb.c + src/core/ext/filters/client_channel/health/health.pb.c + third_party/nanopb/pb_common.c + third_party/nanopb/pb_decode.c + third_party/nanopb/pb_encode.c src/core/lib/http/httpcli_security_connector.cc src/core/lib/security/context/security_context.cc src/core/lib/security/credentials/alts/alts_credentials.cc @@ -1767,11 +1730,13 @@ add_library(grpc_cronet src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc + src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc + src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc src/core/tsi/alts/handshaker/alts_tsi_utils.cc src/core/tsi/alts/handshaker/transport_security_common_api.cc - src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c - src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c - src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c + src/core/tsi/alts/handshaker/altscontext.pb.c + src/core/tsi/alts/handshaker/handshaker.pb.c + src/core/tsi/alts/handshaker/transport_security_common.pb.c src/core/tsi/transport_security.cc src/core/ext/transport/chttp2/client/insecure/channel_create.cc src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc @@ -2093,13 +2058,10 @@ add_library(grpc_test_util src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c - third_party/upb/upb/decode.c - third_party/upb/upb/encode.c - third_party/upb/upb/msg.c - third_party/upb/upb/port.c - third_party/upb/upb/table.c - third_party/upb/upb/upb.c + src/core/ext/filters/client_channel/health/health.pb.c + third_party/nanopb/pb_common.c + third_party/nanopb/pb_decode.c + third_party/nanopb/pb_encode.c src/core/ext/transport/chttp2/transport/bin_decoder.cc src/core/ext/transport/chttp2/transport/bin_encoder.cc src/core/ext/transport/chttp2/transport/chttp2_plugin.cc @@ -2434,13 +2396,10 @@ add_library(grpc_test_util_unsecure src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c - third_party/upb/upb/decode.c - third_party/upb/upb/encode.c - third_party/upb/upb/msg.c - third_party/upb/upb/port.c - third_party/upb/upb/table.c - third_party/upb/upb/upb.c + src/core/ext/filters/client_channel/health/health.pb.c + third_party/nanopb/pb_common.c + third_party/nanopb/pb_decode.c + third_party/nanopb/pb_encode.c src/core/ext/transport/chttp2/transport/bin_decoder.cc src/core/ext/transport/chttp2/transport/bin_encoder.cc src/core/ext/transport/chttp2/transport/chttp2_plugin.cc @@ -2786,13 +2745,10 @@ add_library(grpc_unsecure src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c - third_party/upb/upb/decode.c - third_party/upb/upb/encode.c - third_party/upb/upb/msg.c - third_party/upb/upb/port.c - third_party/upb/upb/table.c - third_party/upb/upb/upb.c + src/core/ext/filters/client_channel/health/health.pb.c + third_party/nanopb/pb_common.c + third_party/nanopb/pb_decode.c + third_party/nanopb/pb_encode.c src/core/ext/transport/inproc/inproc_plugin.cc src/core/ext/transport/inproc/inproc_transport.cc src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -2809,47 +2765,18 @@ add_library(grpc_unsecure src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc - src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc - src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c - src/core/ext/upb-generated/google/api/annotations.upb.c - src/core/ext/upb-generated/google/api/http.upb.c - src/core/ext/upb-generated/google/protobuf/any.upb.c - src/core/ext/upb-generated/google/protobuf/descriptor.upb.c - src/core/ext/upb-generated/google/protobuf/duration.upb.c - src/core/ext/upb-generated/google/protobuf/empty.upb.c - src/core/ext/upb-generated/google/protobuf/struct.upb.c - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c - src/core/ext/upb-generated/google/rpc/status.upb.c + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c src/core/ext/filters/client_channel/lb_policy/xds/xds.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc - src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c - src/core/ext/upb-generated/envoy/api/v2/cds.upb.c - src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c - src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c - src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c - src/core/ext/upb-generated/envoy/api/v2/eds.upb.c - src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c - src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c - src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c - src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c - src/core/ext/upb-generated/envoy/type/percent.upb.c - src/core/ext/upb-generated/envoy/type/range.upb.c - src/core/ext/upb-generated/gogoproto/gogo.upb.c - src/core/ext/upb-generated/validate/validate.upb.c src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc src/core/ext/filters/census/grpc_context.cc @@ -3213,13 +3140,10 @@ add_library(grpc++ src/cpp/util/status.cc src/cpp/util/string_ref.cc src/cpp/util/time_cc.cc - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c - third_party/upb/upb/decode.c - third_party/upb/upb/encode.c - third_party/upb/upb/msg.c - third_party/upb/upb/port.c - third_party/upb/upb/table.c - third_party/upb/upb/upb.c + src/core/ext/filters/client_channel/health/health.pb.c + third_party/nanopb/pb_common.c + third_party/nanopb/pb_decode.c + third_party/nanopb/pb_encode.c src/cpp/codegen/codegen_init.cc ) @@ -3488,7 +3412,6 @@ foreach(_hdr include/grpcpp/impl/codegen/config.h include/grpcpp/impl/codegen/core_codegen_interface.h include/grpcpp/impl/codegen/create_auth_context.h - include/grpcpp/impl/codegen/delegating_channel.h include/grpcpp/impl/codegen/grpc_library.h include/grpcpp/impl/codegen/intercepted_channel.h include/grpcpp/impl/codegen/interceptor.h @@ -4007,7 +3930,6 @@ foreach(_hdr include/grpcpp/impl/codegen/config.h include/grpcpp/impl/codegen/core_codegen_interface.h include/grpcpp/impl/codegen/create_auth_context.h - include/grpcpp/impl/codegen/delegating_channel.h include/grpcpp/impl/codegen/grpc_library.h include/grpcpp/impl/codegen/intercepted_channel.h include/grpcpp/impl/codegen/interceptor.h @@ -4217,7 +4139,6 @@ foreach(_hdr include/grpcpp/impl/codegen/config.h include/grpcpp/impl/codegen/core_codegen_interface.h include/grpcpp/impl/codegen/create_auth_context.h - include/grpcpp/impl/codegen/delegating_channel.h include/grpcpp/impl/codegen/grpc_library.h include/grpcpp/impl/codegen/intercepted_channel.h include/grpcpp/impl/codegen/interceptor.h @@ -4323,13 +4244,10 @@ add_library(grpc++_unsecure src/cpp/util/status.cc src/cpp/util/string_ref.cc src/cpp/util/time_cc.cc - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c - third_party/upb/upb/decode.c - third_party/upb/upb/encode.c - third_party/upb/upb/msg.c - third_party/upb/upb/port.c - third_party/upb/upb/table.c - third_party/upb/upb/upb.c + src/core/ext/filters/client_channel/health/health.pb.c + third_party/nanopb/pb_common.c + third_party/nanopb/pb_decode.c + third_party/nanopb/pb_encode.c src/cpp/codegen/codegen_init.cc ) @@ -4598,7 +4516,6 @@ foreach(_hdr include/grpcpp/impl/codegen/config.h include/grpcpp/impl/codegen/core_codegen_interface.h include/grpcpp/impl/codegen/create_auth_context.h - include/grpcpp/impl/codegen/delegating_channel.h include/grpcpp/impl/codegen/grpc_library.h include/grpcpp/impl/codegen/intercepted_channel.h include/grpcpp/impl/codegen/interceptor.h @@ -11265,6 +11182,47 @@ target_link_libraries(alts_handshaker_client_test ) +endif (gRPC_BUILD_TESTS) +if (gRPC_BUILD_TESTS) + +add_executable(alts_handshaker_service_api_test + test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.cc + third_party/googletest/googletest/src/gtest-all.cc + third_party/googletest/googlemock/src/gmock-all.cc +) + + +target_include_directories(alts_handshaker_service_api_test + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE third_party/googletest/googletest/include + PRIVATE third_party/googletest/googletest + PRIVATE third_party/googletest/googlemock/include + PRIVATE third_party/googletest/googlemock + PRIVATE ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(alts_handshaker_service_api_test + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + alts_test_util + gpr + grpc + ${_gRPC_GFLAGS_LIBRARIES} +) + + endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) @@ -12552,54 +12510,6 @@ target_link_libraries(bm_pollset ) -endif() -endif (gRPC_BUILD_TESTS) -if (gRPC_BUILD_TESTS) -if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) - -add_executable(bm_threadpool - test/cpp/microbenchmarks/bm_threadpool.cc - third_party/googletest/googletest/src/gtest-all.cc - third_party/googletest/googlemock/src/gmock-all.cc -) - - -target_include_directories(bm_threadpool - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_UPB_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} - PRIVATE third_party/googletest/googletest/include - PRIVATE third_party/googletest/googletest - PRIVATE third_party/googletest/googlemock/include - PRIVATE third_party/googletest/googlemock - PRIVATE ${_gRPC_PROTO_GENS_DIR} -) - -target_link_libraries(bm_threadpool - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc_benchmark - ${_gRPC_BENCHMARK_LIBRARIES} - grpc++_test_util_unsecure - grpc_test_util_unsecure - grpc++_unsecure - grpc_unsecure - gpr - grpc++_test_config - ${_gRPC_GFLAGS_LIBRARIES} -) - - endif() endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) @@ -13831,49 +13741,6 @@ target_link_libraries(cxx_time_test ) -endif (gRPC_BUILD_TESTS) -if (gRPC_BUILD_TESTS) - -add_executable(delegating_channel_test - test/cpp/end2end/delegating_channel_test.cc - third_party/googletest/googletest/src/gtest-all.cc - third_party/googletest/googlemock/src/gmock-all.cc -) - - -target_include_directories(delegating_channel_test - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_UPB_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} - PRIVATE third_party/googletest/googletest/include - PRIVATE third_party/googletest/googletest - PRIVATE third_party/googletest/googlemock/include - PRIVATE third_party/googletest/googlemock - PRIVATE ${_gRPC_PROTO_GENS_DIR} -) - -target_link_libraries(delegating_channel_test - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc++_test_util - grpc_test_util - grpc++ - grpc - gpr - ${_gRPC_GFLAGS_LIBRARIES} -) - - endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) @@ -14052,95 +13919,6 @@ target_link_libraries(filter_end2end_test endif (gRPC_BUILD_TESTS) - -add_executable(gen_hpack_tables - tools/codegen/core/gen_hpack_tables.cc -) - - -target_include_directories(gen_hpack_tables - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_UPB_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTO_GENS_DIR} -) - -target_link_libraries(gen_hpack_tables - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - gpr - grpc -) - - - -add_executable(gen_legal_metadata_characters - tools/codegen/core/gen_legal_metadata_characters.cc -) - - -target_include_directories(gen_legal_metadata_characters - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_UPB_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTO_GENS_DIR} -) - -target_link_libraries(gen_legal_metadata_characters - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} -) - - - -add_executable(gen_percent_encoding_tables - tools/codegen/core/gen_percent_encoding_tables.cc -) - - -target_include_directories(gen_percent_encoding_tables - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_UPB_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTO_GENS_DIR} -) - -target_link_libraries(gen_percent_encoding_tables - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} -) - - if (gRPC_BUILD_TESTS) add_executable(generic_end2end_test @@ -14818,49 +14596,6 @@ endif() endif (gRPC_BUILD_CODEGEN) if (gRPC_BUILD_TESTS) -add_executable(grpc_spiffe_security_connector_test - test/core/security/spiffe_security_connector_test.cc - third_party/googletest/googletest/src/gtest-all.cc - third_party/googletest/googlemock/src/gmock-all.cc -) - - -target_include_directories(grpc_spiffe_security_connector_test - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_UPB_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} - PRIVATE third_party/googletest/googletest/include - PRIVATE third_party/googletest/googletest - PRIVATE third_party/googletest/googlemock/include - PRIVATE third_party/googletest/googlemock - PRIVATE ${_gRPC_PROTO_GENS_DIR} -) - -target_link_libraries(grpc_spiffe_security_connector_test - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc_test_util - grpc++_test_util - grpc++ - grpc - gpr - ${_gRPC_GFLAGS_LIBRARIES} -) - - -endif (gRPC_BUILD_TESTS) -if (gRPC_BUILD_TESTS) - add_executable(grpc_tool_test ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc @@ -17813,24 +17548,17 @@ endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) add_executable(xds_end2end_test - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/eds_for_test.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/eds_for_test.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/lrs_for_test.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/lrs_for_test.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.grpc.pb.h test/cpp/end2end/xds_end2end_test.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) protobuf_generate_grpc_cpp( - src/proto/grpc/lb/v2/eds_for_test.proto -) -protobuf_generate_grpc_cpp( - src/proto/grpc/lb/v2/lrs_for_test.proto + src/proto/grpc/lb/v1/load_balancer.proto ) target_include_directories(xds_end2end_test @@ -17898,6 +17626,89 @@ target_link_libraries(public_headers_must_be_c89 endif (gRPC_BUILD_TESTS) + +add_executable(gen_hpack_tables + tools/codegen/core/gen_hpack_tables.cc +) + + +target_include_directories(gen_hpack_tables + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} +) + +target_link_libraries(gen_hpack_tables + ${_gRPC_ALLTARGETS_LIBRARIES} + gpr + grpc +) + + + +add_executable(gen_legal_metadata_characters + tools/codegen/core/gen_legal_metadata_characters.cc +) + + +target_include_directories(gen_legal_metadata_characters + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} +) + +target_link_libraries(gen_legal_metadata_characters + ${_gRPC_ALLTARGETS_LIBRARIES} +) + + + +add_executable(gen_percent_encoding_tables + tools/codegen/core/gen_percent_encoding_tables.cc +) + + +target_include_directories(gen_percent_encoding_tables + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} +) + +target_link_libraries(gen_percent_encoding_tables + ${_gRPC_ALLTARGETS_LIBRARIES} +) + + if (gRPC_BUILD_TESTS) add_executable(bad_streaming_id_bad_client_test @@ -17929,6 +17740,7 @@ target_include_directories(bad_streaming_id_bad_client_test ) target_link_libraries(bad_streaming_id_bad_client_test + ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17971,6 +17783,7 @@ target_include_directories(badreq_bad_client_test ) target_link_libraries(badreq_bad_client_test + ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18013,6 +17826,7 @@ target_include_directories(connection_prefix_bad_client_test ) target_link_libraries(connection_prefix_bad_client_test + ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18055,6 +17869,7 @@ target_include_directories(duplicate_header_bad_client_test ) target_link_libraries(duplicate_header_bad_client_test + ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18097,6 +17912,7 @@ target_include_directories(head_of_line_blocking_bad_client_test ) target_link_libraries(head_of_line_blocking_bad_client_test + ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18139,6 +17955,7 @@ target_include_directories(headers_bad_client_test ) target_link_libraries(headers_bad_client_test + ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18181,6 +17998,7 @@ target_include_directories(initial_settings_frame_bad_client_test ) target_link_libraries(initial_settings_frame_bad_client_test + ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18223,6 +18041,7 @@ target_include_directories(large_metadata_bad_client_test ) target_link_libraries(large_metadata_bad_client_test + ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18265,6 +18084,7 @@ target_include_directories(out_of_bounds_bad_client_test ) target_link_libraries(out_of_bounds_bad_client_test + ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18307,6 +18127,7 @@ target_include_directories(server_registered_method_bad_client_test ) target_link_libraries(server_registered_method_bad_client_test + ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18349,6 +18170,7 @@ target_include_directories(simple_request_bad_client_test ) target_link_libraries(simple_request_bad_client_test + ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18391,6 +18213,7 @@ target_include_directories(unknown_frame_bad_client_test ) target_link_libraries(unknown_frame_bad_client_test + ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18433,6 +18256,7 @@ target_include_directories(window_overflow_bad_client_test ) target_link_libraries(window_overflow_bad_client_test + ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test diff --git a/Makefile b/Makefile index d4d61ca335b..d512e1cb9c9 100644 --- a/Makefile +++ b/Makefile @@ -348,7 +348,7 @@ CXXFLAGS += -stdlib=libc++ LDFLAGS += -framework CoreFoundation endif CXXFLAGS += -Wnon-virtual-dtor -CPPFLAGS += -g -Wall -Wextra -Werror -Wno-unknown-warning-option -Wno-long-long -Wno-unused-parameter -Wno-deprecated-declarations -Wno-sign-conversion -Wno-shadow -Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers -Wno-maybe-uninitialized -DPB_FIELD_32BIT -DOSATOMIC_USE_INLINED=1 -Ithird_party/nanopb -Ithird_party/upb -Isrc/core/ext/upb-generated +CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Wno-deprecated-declarations -Ithird_party/nanopb -DPB_FIELD_32BIT COREFLAGS += -fno-rtti -fno-exceptions LDFLAGS += -g @@ -454,9 +454,9 @@ E = @echo Q = @ endif -CORE_VERSION = 8.0.0 -CPP_VERSION = 1.24.0-dev -CSHARP_VERSION = 2.24.0-dev +CORE_VERSION = 7.0.0 +CPP_VERSION = 1.23.0-dev +CSHARP_VERSION = 1.23.0-dev CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) @@ -504,9 +504,9 @@ SHARED_EXT_CORE = dll SHARED_EXT_CPP = dll SHARED_EXT_CSHARP = dll SHARED_PREFIX = -SHARED_VERSION_CORE = -8 +SHARED_VERSION_CORE = -7 SHARED_VERSION_CPP = -1 -SHARED_VERSION_CSHARP = -2 +SHARED_VERSION_CSHARP = -1 else ifeq ($(SYSTEM),Darwin) EXECUTABLE_SUFFIX = SHARED_EXT_CORE = dylib @@ -1146,6 +1146,7 @@ alts_frame_handler_test: $(BINDIR)/$(CONFIG)/alts_frame_handler_test alts_frame_protector_test: $(BINDIR)/$(CONFIG)/alts_frame_protector_test alts_grpc_record_protocol_test: $(BINDIR)/$(CONFIG)/alts_grpc_record_protocol_test alts_handshaker_client_test: $(BINDIR)/$(CONFIG)/alts_handshaker_client_test +alts_handshaker_service_api_test: $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test alts_iovec_record_protocol_test: $(BINDIR)/$(CONFIG)/alts_iovec_record_protocol_test alts_security_connector_test: $(BINDIR)/$(CONFIG)/alts_security_connector_test alts_tsi_handshaker_test: $(BINDIR)/$(CONFIG)/alts_tsi_handshaker_test @@ -1174,7 +1175,6 @@ bm_fullstack_trickle: $(BINDIR)/$(CONFIG)/bm_fullstack_trickle bm_fullstack_unary_ping_pong: $(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong bm_metadata: $(BINDIR)/$(CONFIG)/bm_metadata bm_pollset: $(BINDIR)/$(CONFIG)/bm_pollset -bm_threadpool: $(BINDIR)/$(CONFIG)/bm_threadpool bm_timer: $(BINDIR)/$(CONFIG)/bm_timer byte_stream_test: $(BINDIR)/$(CONFIG)/byte_stream_test channel_arguments_test: $(BINDIR)/$(CONFIG)/channel_arguments_test @@ -1201,14 +1201,10 @@ cxx_byte_buffer_test: $(BINDIR)/$(CONFIG)/cxx_byte_buffer_test cxx_slice_test: $(BINDIR)/$(CONFIG)/cxx_slice_test cxx_string_ref_test: $(BINDIR)/$(CONFIG)/cxx_string_ref_test cxx_time_test: $(BINDIR)/$(CONFIG)/cxx_time_test -delegating_channel_test: $(BINDIR)/$(CONFIG)/delegating_channel_test end2end_test: $(BINDIR)/$(CONFIG)/end2end_test error_details_test: $(BINDIR)/$(CONFIG)/error_details_test exception_test: $(BINDIR)/$(CONFIG)/exception_test filter_end2end_test: $(BINDIR)/$(CONFIG)/filter_end2end_test -gen_hpack_tables: $(BINDIR)/$(CONFIG)/gen_hpack_tables -gen_legal_metadata_characters: $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters -gen_percent_encoding_tables: $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables generic_end2end_test: $(BINDIR)/$(CONFIG)/generic_end2end_test global_config_env_test: $(BINDIR)/$(CONFIG)/global_config_env_test global_config_test: $(BINDIR)/$(CONFIG)/global_config_test @@ -1225,7 +1221,6 @@ grpc_objective_c_plugin: $(BINDIR)/$(CONFIG)/grpc_objective_c_plugin grpc_php_plugin: $(BINDIR)/$(CONFIG)/grpc_php_plugin grpc_python_plugin: $(BINDIR)/$(CONFIG)/grpc_python_plugin grpc_ruby_plugin: $(BINDIR)/$(CONFIG)/grpc_ruby_plugin -grpc_spiffe_security_connector_test: $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test grpc_tool_test: $(BINDIR)/$(CONFIG)/grpc_tool_test grpclb_api_test: $(BINDIR)/$(CONFIG)/grpclb_api_test grpclb_end2end_test: $(BINDIR)/$(CONFIG)/grpclb_end2end_test @@ -1292,6 +1287,9 @@ transport_security_common_api_test: $(BINDIR)/$(CONFIG)/transport_security_commo writes_per_rpc_test: $(BINDIR)/$(CONFIG)/writes_per_rpc_test xds_end2end_test: $(BINDIR)/$(CONFIG)/xds_end2end_test public_headers_must_be_c89: $(BINDIR)/$(CONFIG)/public_headers_must_be_c89 +gen_hpack_tables: $(BINDIR)/$(CONFIG)/gen_hpack_tables +gen_legal_metadata_characters: $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters +gen_percent_encoding_tables: $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables boringssl_ssl_test: $(BINDIR)/$(CONFIG)/boringssl_ssl_test boringssl_crypto_test: $(BINDIR)/$(CONFIG)/boringssl_crypto_test bad_streaming_id_bad_client_test: $(BINDIR)/$(CONFIG)/bad_streaming_id_bad_client_test @@ -1410,7 +1408,7 @@ plugins: $(PROTOC_PLUGINS) privatelibs: privatelibs_c privatelibs_cxx -privatelibs_c: $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libcxxabi.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libares.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a +privatelibs_c: $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libcxxabi.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libupb.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libares.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc pc_c_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc @@ -1627,6 +1625,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/alts_frame_protector_test \ $(BINDIR)/$(CONFIG)/alts_grpc_record_protocol_test \ $(BINDIR)/$(CONFIG)/alts_handshaker_client_test \ + $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test \ $(BINDIR)/$(CONFIG)/alts_iovec_record_protocol_test \ $(BINDIR)/$(CONFIG)/alts_security_connector_test \ $(BINDIR)/$(CONFIG)/alts_tsi_handshaker_test \ @@ -1655,7 +1654,6 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong \ $(BINDIR)/$(CONFIG)/bm_metadata \ $(BINDIR)/$(CONFIG)/bm_pollset \ - $(BINDIR)/$(CONFIG)/bm_threadpool \ $(BINDIR)/$(CONFIG)/bm_timer \ $(BINDIR)/$(CONFIG)/byte_stream_test \ $(BINDIR)/$(CONFIG)/channel_arguments_test \ @@ -1682,7 +1680,6 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/cxx_slice_test \ $(BINDIR)/$(CONFIG)/cxx_string_ref_test \ $(BINDIR)/$(CONFIG)/cxx_time_test \ - $(BINDIR)/$(CONFIG)/delegating_channel_test \ $(BINDIR)/$(CONFIG)/end2end_test \ $(BINDIR)/$(CONFIG)/error_details_test \ $(BINDIR)/$(CONFIG)/exception_test \ @@ -1696,7 +1693,6 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/grpc_core_map_test \ $(BINDIR)/$(CONFIG)/grpc_fetch_oauth2 \ $(BINDIR)/$(CONFIG)/grpc_linux_system_roots_test \ - $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test \ $(BINDIR)/$(CONFIG)/grpc_tool_test \ $(BINDIR)/$(CONFIG)/grpclb_api_test \ $(BINDIR)/$(CONFIG)/grpclb_end2end_test \ @@ -1795,6 +1791,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/alts_frame_protector_test \ $(BINDIR)/$(CONFIG)/alts_grpc_record_protocol_test \ $(BINDIR)/$(CONFIG)/alts_handshaker_client_test \ + $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test \ $(BINDIR)/$(CONFIG)/alts_iovec_record_protocol_test \ $(BINDIR)/$(CONFIG)/alts_security_connector_test \ $(BINDIR)/$(CONFIG)/alts_tsi_handshaker_test \ @@ -1823,7 +1820,6 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong \ $(BINDIR)/$(CONFIG)/bm_metadata \ $(BINDIR)/$(CONFIG)/bm_pollset \ - $(BINDIR)/$(CONFIG)/bm_threadpool \ $(BINDIR)/$(CONFIG)/bm_timer \ $(BINDIR)/$(CONFIG)/byte_stream_test \ $(BINDIR)/$(CONFIG)/channel_arguments_test \ @@ -1850,7 +1846,6 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/cxx_slice_test \ $(BINDIR)/$(CONFIG)/cxx_string_ref_test \ $(BINDIR)/$(CONFIG)/cxx_time_test \ - $(BINDIR)/$(CONFIG)/delegating_channel_test \ $(BINDIR)/$(CONFIG)/end2end_test \ $(BINDIR)/$(CONFIG)/error_details_test \ $(BINDIR)/$(CONFIG)/exception_test \ @@ -1864,7 +1859,6 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/grpc_core_map_test \ $(BINDIR)/$(CONFIG)/grpc_fetch_oauth2 \ $(BINDIR)/$(CONFIG)/grpc_linux_system_roots_test \ - $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test \ $(BINDIR)/$(CONFIG)/grpc_tool_test \ $(BINDIR)/$(CONFIG)/grpclb_api_test \ $(BINDIR)/$(CONFIG)/grpclb_end2end_test \ @@ -2241,6 +2235,8 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/alts_grpc_record_protocol_test || ( echo test alts_grpc_record_protocol_test failed ; exit 1 ) $(E) "[RUN] Testing alts_handshaker_client_test" $(Q) $(BINDIR)/$(CONFIG)/alts_handshaker_client_test || ( echo test alts_handshaker_client_test failed ; exit 1 ) + $(E) "[RUN] Testing alts_handshaker_service_api_test" + $(Q) $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test || ( echo test alts_handshaker_service_api_test failed ; exit 1 ) $(E) "[RUN] Testing alts_iovec_record_protocol_test" $(Q) $(BINDIR)/$(CONFIG)/alts_iovec_record_protocol_test || ( echo test alts_iovec_record_protocol_test failed ; exit 1 ) $(E) "[RUN] Testing alts_security_connector_test" @@ -2297,8 +2293,6 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/bm_metadata || ( echo test bm_metadata failed ; exit 1 ) $(E) "[RUN] Testing bm_pollset" $(Q) $(BINDIR)/$(CONFIG)/bm_pollset || ( echo test bm_pollset failed ; exit 1 ) - $(E) "[RUN] Testing bm_threadpool" - $(Q) $(BINDIR)/$(CONFIG)/bm_threadpool || ( echo test bm_threadpool failed ; exit 1 ) $(E) "[RUN] Testing bm_timer" $(Q) $(BINDIR)/$(CONFIG)/bm_timer || ( echo test bm_timer failed ; exit 1 ) $(E) "[RUN] Testing byte_stream_test" @@ -2349,8 +2343,6 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/cxx_string_ref_test || ( echo test cxx_string_ref_test failed ; exit 1 ) $(E) "[RUN] Testing cxx_time_test" $(Q) $(BINDIR)/$(CONFIG)/cxx_time_test || ( echo test cxx_time_test failed ; exit 1 ) - $(E) "[RUN] Testing delegating_channel_test" - $(Q) $(BINDIR)/$(CONFIG)/delegating_channel_test || ( echo test delegating_channel_test failed ; exit 1 ) $(E) "[RUN] Testing end2end_test" $(Q) $(BINDIR)/$(CONFIG)/end2end_test || ( echo test end2end_test failed ; exit 1 ) $(E) "[RUN] Testing error_details_test" @@ -2373,8 +2365,6 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/grpc_core_map_test || ( echo test grpc_core_map_test failed ; exit 1 ) $(E) "[RUN] Testing grpc_linux_system_roots_test" $(Q) $(BINDIR)/$(CONFIG)/grpc_linux_system_roots_test || ( echo test grpc_linux_system_roots_test failed ; exit 1 ) - $(E) "[RUN] Testing grpc_spiffe_security_connector_test" - $(Q) $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test || ( echo test grpc_spiffe_security_connector_test failed ; exit 1 ) $(E) "[RUN] Testing grpc_tool_test" $(Q) $(BINDIR)/$(CONFIG)/grpc_tool_test || ( echo test grpc_tool_test failed ; exit 1 ) $(E) "[RUN] Testing grpclb_api_test" @@ -2530,9 +2520,9 @@ test_python: static_c tools: tools_c tools_cxx -tools_c: privatelibs_c $(BINDIR)/$(CONFIG)/check_epollexclusive $(BINDIR)/$(CONFIG)/grpc_create_jwt $(BINDIR)/$(CONFIG)/grpc_print_google_default_creds_token $(BINDIR)/$(CONFIG)/grpc_verify_jwt +tools_c: privatelibs_c $(BINDIR)/$(CONFIG)/check_epollexclusive $(BINDIR)/$(CONFIG)/grpc_create_jwt $(BINDIR)/$(CONFIG)/grpc_print_google_default_creds_token $(BINDIR)/$(CONFIG)/grpc_verify_jwt $(BINDIR)/$(CONFIG)/gen_hpack_tables $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables -tools_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/gen_hpack_tables $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables +tools_cxx: privatelibs_cxx buildbenchmarks: privatelibs $(BINDIR)/$(CONFIG)/low_level_ping_pong_benchmark @@ -2704,38 +2694,6 @@ $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc: src/proto/grpc/lb/v1/lo $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< endif -ifeq ($(NO_PROTOC),true) -$(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc: protoc_dep_error -$(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc: protoc_dep_error -else - -$(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc: src/proto/grpc/lb/v2/eds_for_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) - $(E) "[PROTOC] Generating protobuf CC file from $<" - $(Q) mkdir -p `dirname $@` - $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --cpp_out=$(GENDIR) $< - -$(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc: src/proto/grpc/lb/v2/eds_for_test.proto $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc $(PROTOBUF_DEP) $(PROTOC_PLUGINS) - $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" - $(Q) mkdir -p `dirname $@` - $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< -endif - -ifeq ($(NO_PROTOC),true) -$(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc: protoc_dep_error -$(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc: protoc_dep_error -else - -$(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc: src/proto/grpc/lb/v2/lrs_for_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc - $(E) "[PROTOC] Generating protobuf CC file from $<" - $(Q) mkdir -p `dirname $@` - $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --cpp_out=$(GENDIR) $< - -$(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc: src/proto/grpc/lb/v2/lrs_for_test.proto $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc - $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" - $(Q) mkdir -p `dirname $@` - $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< -endif - ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc: protoc_dep_error @@ -3125,7 +3083,7 @@ install-shared_c: shared_c strip-shared_c install-pkg-config_c ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libaddress_sorting.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libaddress_sorting.so.8 + $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libaddress_sorting.so.7 $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libaddress_sorting.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -3134,7 +3092,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgpr.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.8 + $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.7 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -3143,7 +3101,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.8 + $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.7 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -3152,7 +3110,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_cronet.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.8 + $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.7 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -3161,7 +3119,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_unsecure.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.8 + $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.7 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so endif ifneq ($(SYSTEM),MINGW32) @@ -3231,7 +3189,7 @@ install-shared_csharp: shared_csharp strip-shared_csharp ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP)-dll.a $(prefix)/lib/libgrpc_csharp_ext.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.2 + $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.1 $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so endif ifneq ($(SYSTEM),MINGW32) @@ -3322,8 +3280,8 @@ $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libaddress_sorting.so.8 -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so.8 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libaddress_sorting.so.7 -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so.7 $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so endif endif @@ -3518,8 +3476,8 @@ $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGPR_OB ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.8 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.8 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.7 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.7 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so endif endif @@ -3778,17 +3736,16 @@ LIBGRPC_SRC = \ src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc \ + src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc \ + src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc \ src/core/tsi/alts/handshaker/alts_tsi_utils.cc \ src/core/tsi/alts/handshaker/transport_security_common_api.cc \ - src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \ - src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \ - src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c \ - third_party/upb/upb/decode.c \ - third_party/upb/upb/encode.c \ - third_party/upb/upb/msg.c \ - third_party/upb/upb/port.c \ - third_party/upb/upb/table.c \ - third_party/upb/upb/upb.c \ + src/core/tsi/alts/handshaker/altscontext.pb.c \ + src/core/tsi/alts/handshaker/handshaker.pb.c \ + src/core/tsi/alts/handshaker/transport_security_common.pb.c \ + third_party/nanopb/pb_common.c \ + third_party/nanopb/pb_decode.c \ + third_party/nanopb/pb_encode.c \ src/core/tsi/transport_security.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ @@ -3821,7 +3778,7 @@ LIBGRPC_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + src/core/ext/filters/client_channel/health/health.pb.c \ src/core/tsi/fake_transport_security.cc \ src/core/tsi/local_transport_security.cc \ src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc \ @@ -3840,42 +3797,14 @@ LIBGRPC_SRC = \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ - src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ - src/core/ext/upb-generated/google/api/annotations.upb.c \ - src/core/ext/upb-generated/google/api/http.upb.c \ - src/core/ext/upb-generated/google/protobuf/any.upb.c \ - src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ - src/core/ext/upb-generated/google/protobuf/duration.upb.c \ - src/core/ext/upb-generated/google/protobuf/empty.upb.c \ - src/core/ext/upb-generated/google/protobuf/struct.upb.c \ - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ - src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \ + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \ + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc \ - src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c \ - src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c \ - src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ - src/core/ext/upb-generated/envoy/type/percent.upb.c \ - src/core/ext/upb-generated/envoy/type/range.upb.c \ - src/core/ext/upb-generated/gogoproto/gogo.upb.c \ - src/core/ext/upb-generated/validate/validate.upb.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ @@ -3891,7 +3820,6 @@ LIBGRPC_SRC = \ src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \ src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \ src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \ - src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \ src/core/ext/filters/census/grpc_context.cc \ src/core/ext/filters/client_idle/client_idle_filter.cc \ src/core/ext/filters/max_age/max_age_filter.cc \ @@ -3976,8 +3904,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGRPC_ ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.8 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.8 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.7 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.7 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so endif endif @@ -4211,13 +4139,10 @@ LIBGRPC_CRONET_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ - third_party/upb/upb/decode.c \ - third_party/upb/upb/encode.c \ - third_party/upb/upb/msg.c \ - third_party/upb/upb/port.c \ - third_party/upb/upb/table.c \ - third_party/upb/upb/upb.c \ + src/core/ext/filters/client_channel/health/health.pb.c \ + third_party/nanopb/pb_common.c \ + third_party/nanopb/pb_decode.c \ + third_party/nanopb/pb_encode.c \ src/core/lib/http/httpcli_security_connector.cc \ src/core/lib/security/context/security_context.cc \ src/core/lib/security/credentials/alts/alts_credentials.cc \ @@ -4278,11 +4203,13 @@ LIBGRPC_CRONET_SRC = \ src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc \ + src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc \ + src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc \ src/core/tsi/alts/handshaker/alts_tsi_utils.cc \ src/core/tsi/alts/handshaker/transport_security_common_api.cc \ - src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \ - src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \ - src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c \ + src/core/tsi/alts/handshaker/altscontext.pb.c \ + src/core/tsi/alts/handshaker/handshaker.pb.c \ + src/core/tsi/alts/handshaker/transport_security_common.pb.c \ src/core/tsi/transport_security.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ @@ -4360,8 +4287,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(L ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.8 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.8 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.7 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.7 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so endif endif @@ -4591,13 +4518,10 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ - third_party/upb/upb/decode.c \ - third_party/upb/upb/encode.c \ - third_party/upb/upb/msg.c \ - third_party/upb/upb/port.c \ - third_party/upb/upb/table.c \ - third_party/upb/upb/upb.c \ + src/core/ext/filters/client_channel/health/health.pb.c \ + third_party/nanopb/pb_common.c \ + third_party/nanopb/pb_decode.c \ + third_party/nanopb/pb_encode.c \ src/core/ext/transport/chttp2/transport/bin_decoder.cc \ src/core/ext/transport/chttp2/transport/bin_encoder.cc \ src/core/ext/transport/chttp2/transport/chttp2_plugin.cc \ @@ -4913,13 +4837,10 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ - third_party/upb/upb/decode.c \ - third_party/upb/upb/encode.c \ - third_party/upb/upb/msg.c \ - third_party/upb/upb/port.c \ - third_party/upb/upb/table.c \ - third_party/upb/upb/upb.c \ + src/core/ext/filters/client_channel/health/health.pb.c \ + third_party/nanopb/pb_common.c \ + third_party/nanopb/pb_decode.c \ + third_party/nanopb/pb_encode.c \ src/core/ext/transport/chttp2/transport/bin_decoder.cc \ src/core/ext/transport/chttp2/transport/bin_encoder.cc \ src/core/ext/transport/chttp2/transport/chttp2_plugin.cc \ @@ -5233,13 +5154,10 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ - third_party/upb/upb/decode.c \ - third_party/upb/upb/encode.c \ - third_party/upb/upb/msg.c \ - third_party/upb/upb/port.c \ - third_party/upb/upb/table.c \ - third_party/upb/upb/upb.c \ + src/core/ext/filters/client_channel/health/health.pb.c \ + third_party/nanopb/pb_common.c \ + third_party/nanopb/pb_decode.c \ + third_party/nanopb/pb_encode.c \ src/core/ext/transport/inproc/inproc_plugin.cc \ src/core/ext/transport/inproc/inproc_transport.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ @@ -5256,47 +5174,18 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \ src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ - src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ - src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ - src/core/ext/upb-generated/google/api/annotations.upb.c \ - src/core/ext/upb-generated/google/api/http.upb.c \ - src/core/ext/upb-generated/google/protobuf/any.upb.c \ - src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ - src/core/ext/upb-generated/google/protobuf/duration.upb.c \ - src/core/ext/upb-generated/google/protobuf/empty.upb.c \ - src/core/ext/upb-generated/google/protobuf/struct.upb.c \ - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ - src/core/ext/upb-generated/google/rpc/status.upb.c \ + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \ + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \ + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc \ - src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c \ - src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c \ - src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ - src/core/ext/upb-generated/envoy/type/percent.upb.c \ - src/core/ext/upb-generated/envoy/type/range.upb.c \ - src/core/ext/upb-generated/gogoproto/gogo.upb.c \ - src/core/ext/upb-generated/validate/validate.upb.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/census/grpc_context.cc \ @@ -5371,8 +5260,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $ ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.8 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.8 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.7 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.7 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so endif endif @@ -5606,13 +5495,10 @@ LIBGRPC++_SRC = \ src/cpp/util/status.cc \ src/cpp/util/string_ref.cc \ src/cpp/util/time_cc.cc \ - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ - third_party/upb/upb/decode.c \ - third_party/upb/upb/encode.c \ - third_party/upb/upb/msg.c \ - third_party/upb/upb/port.c \ - third_party/upb/upb/table.c \ - third_party/upb/upb/upb.c \ + src/core/ext/filters/client_channel/health/health.pb.c \ + third_party/nanopb/pb_common.c \ + third_party/nanopb/pb_decode.c \ + third_party/nanopb/pb_encode.c \ src/cpp/codegen/codegen_init.cc \ PUBLIC_HEADERS_CXX += \ @@ -5843,7 +5729,6 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/impl/codegen/config.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ - include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -6314,7 +6199,6 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/impl/codegen/config.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ - include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -6492,7 +6376,6 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/impl/codegen/config.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ - include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -6638,13 +6521,10 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/util/status.cc \ src/cpp/util/string_ref.cc \ src/cpp/util/time_cc.cc \ - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ - third_party/upb/upb/decode.c \ - third_party/upb/upb/encode.c \ - third_party/upb/upb/msg.c \ - third_party/upb/upb/port.c \ - third_party/upb/upb/table.c \ - third_party/upb/upb/upb.c \ + src/core/ext/filters/client_channel/health/health.pb.c \ + third_party/nanopb/pb_common.c \ + third_party/nanopb/pb_decode.c \ + third_party/nanopb/pb_encode.c \ src/cpp/codegen/codegen_init.cc \ PUBLIC_HEADERS_CXX += \ @@ -6876,7 +6756,6 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/impl/codegen/config.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ - include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -7616,8 +7495,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHA ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so.2 + $(Q) $(LD) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.1 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so.1 $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so endif endif @@ -8008,6 +7887,41 @@ ifneq ($(NO_DEPS),true) endif +LIBUPB_SRC = \ + third_party/upb/generated_for_cmake/google/protobuf/descriptor.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/def.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/handlers.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/msgfactory.c \ + third_party/upb/upb/sink.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ + +PUBLIC_HEADERS_C += \ + +LIBUPB_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBUPB_SRC)))) + +$(LIBUPB_OBJS): CFLAGS += -Wno-sign-conversion -Wno-shadow -Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers + +$(LIBDIR)/$(CONFIG)/libupb.a: $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(LIBUPB_OBJS) + $(E) "[AR] Creating $@" + $(Q) mkdir -p `dirname $@` + $(Q) rm -f $(LIBDIR)/$(CONFIG)/libupb.a + $(Q) $(AR) $(AROPTS) $(LIBDIR)/$(CONFIG)/libupb.a $(LIBUPB_OBJS) +ifeq ($(SYSTEM),Darwin) + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libupb.a +endif + + + + +ifneq ($(NO_DEPS),true) +-include $(LIBUPB_OBJS:.o=.dep) +endif + + LIBZ_SRC = \ third_party/zlib/adler32.c \ third_party/zlib/compress.c \ @@ -13669,6 +13583,49 @@ endif endif +ALTS_HANDSHAKER_SERVICE_API_TEST_SRC = \ + test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.cc \ + +ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ALTS_HANDSHAKER_SERVICE_API_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. + +$(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test: $(PROTOBUF_DEP) $(ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test + +endif + +endif + +$(OBJDIR)/$(CONFIG)/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.o: $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a + +deps_alts_handshaker_service_api_test: $(ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS:.o=.dep) +endif +endif + + ALTS_IOVEC_RECORD_PROTOCOL_TEST_SRC = \ test/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol_test.cc \ @@ -14892,50 +14849,6 @@ endif endif -BM_THREADPOOL_SRC = \ - test/cpp/microbenchmarks/bm_threadpool.cc \ - -BM_THREADPOOL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BM_THREADPOOL_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/bm_threadpool: openssl_dep_error - -else - - - - -ifeq ($(NO_PROTOBUF),true) - -# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. - -$(BINDIR)/$(CONFIG)/bm_threadpool: protobuf_dep_error - -else - -$(BINDIR)/$(CONFIG)/bm_threadpool: $(PROTOBUF_DEP) $(BM_THREADPOOL_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_THREADPOOL_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_threadpool - -endif - -endif - -$(BM_THREADPOOL_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_threadpool.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a - -deps_bm_threadpool: $(BM_THREADPOOL_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(BM_THREADPOOL_OBJS:.o=.dep) -endif -endif - - BM_TIMER_SRC = \ test/cpp/microbenchmarks/bm_timer.cc \ @@ -16125,49 +16038,6 @@ endif endif -DELEGATING_CHANNEL_TEST_SRC = \ - test/cpp/end2end/delegating_channel_test.cc \ - -DELEGATING_CHANNEL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(DELEGATING_CHANNEL_TEST_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/delegating_channel_test: openssl_dep_error - -else - - - - -ifeq ($(NO_PROTOBUF),true) - -# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. - -$(BINDIR)/$(CONFIG)/delegating_channel_test: protobuf_dep_error - -else - -$(BINDIR)/$(CONFIG)/delegating_channel_test: $(PROTOBUF_DEP) $(DELEGATING_CHANNEL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(DELEGATING_CHANNEL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/delegating_channel_test - -endif - -endif - -$(OBJDIR)/$(CONFIG)/test/cpp/end2end/delegating_channel_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a - -deps_delegating_channel_test: $(DELEGATING_CHANNEL_TEST_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(DELEGATING_CHANNEL_TEST_OBJS:.o=.dep) -endif -endif - - END2END_TEST_SRC = \ test/cpp/end2end/end2end_test.cc \ test/cpp/end2end/interceptors_util.cc \ @@ -16347,135 +16217,6 @@ endif endif -GEN_HPACK_TABLES_SRC = \ - tools/codegen/core/gen_hpack_tables.cc \ - -GEN_HPACK_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_HPACK_TABLES_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/gen_hpack_tables: openssl_dep_error - -else - - - - -ifeq ($(NO_PROTOBUF),true) - -# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. - -$(BINDIR)/$(CONFIG)/gen_hpack_tables: protobuf_dep_error - -else - -$(BINDIR)/$(CONFIG)/gen_hpack_tables: $(PROTOBUF_DEP) $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_hpack_tables - -endif - -endif - -$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_hpack_tables.o: $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a - -deps_gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(GEN_HPACK_TABLES_OBJS:.o=.dep) -endif -endif - - -GEN_LEGAL_METADATA_CHARACTERS_SRC = \ - tools/codegen/core/gen_legal_metadata_characters.cc \ - -GEN_LEGAL_METADATA_CHARACTERS_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_LEGAL_METADATA_CHARACTERS_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: openssl_dep_error - -else - - - - -ifeq ($(NO_PROTOBUF),true) - -# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. - -$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: protobuf_dep_error - -else - -$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: $(PROTOBUF_DEP) $(GEN_LEGAL_METADATA_CHARACTERS_OBJS) - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(GEN_LEGAL_METADATA_CHARACTERS_OBJS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters - -endif - -endif - -$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_legal_metadata_characters.o: - -deps_gen_legal_metadata_characters: $(GEN_LEGAL_METADATA_CHARACTERS_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(GEN_LEGAL_METADATA_CHARACTERS_OBJS:.o=.dep) -endif -endif - - -GEN_PERCENT_ENCODING_TABLES_SRC = \ - tools/codegen/core/gen_percent_encoding_tables.cc \ - -GEN_PERCENT_ENCODING_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_PERCENT_ENCODING_TABLES_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: openssl_dep_error - -else - - - - -ifeq ($(NO_PROTOBUF),true) - -# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. - -$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: protobuf_dep_error - -else - -$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: $(PROTOBUF_DEP) $(GEN_PERCENT_ENCODING_TABLES_OBJS) - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(GEN_PERCENT_ENCODING_TABLES_OBJS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables - -endif - -endif - -$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_percent_encoding_tables.o: - -deps_gen_percent_encoding_tables: $(GEN_PERCENT_ENCODING_TABLES_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(GEN_PERCENT_ENCODING_TABLES_OBJS:.o=.dep) -endif -endif - - GENERIC_END2END_TEST_SRC = \ test/cpp/end2end/generic_end2end_test.cc \ @@ -17084,49 +16825,6 @@ ifneq ($(NO_DEPS),true) endif -GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_SRC = \ - test/core/security/spiffe_security_connector_test.cc \ - -GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test: openssl_dep_error - -else - - - - -ifeq ($(NO_PROTOBUF),true) - -# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. - -$(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test: protobuf_dep_error - -else - -$(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test: $(PROTOBUF_DEP) $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test - -endif - -endif - -$(OBJDIR)/$(CONFIG)/test/core/security/spiffe_security_connector_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a - -deps_grpc_spiffe_security_connector_test: $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS:.o=.dep) -endif -endif - - GRPC_TOOL_TEST_SRC = \ $(GENDIR)/src/proto/grpc/testing/echo.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc \ @@ -19943,8 +19641,7 @@ endif XDS_END2END_TEST_SRC = \ - $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc \ - $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.pb.cc $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc \ test/cpp/end2end/xds_end2end_test.cc \ XDS_END2END_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(XDS_END2END_TEST_SRC)))) @@ -19976,9 +19673,7 @@ endif endif -$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v2/eds_for_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a - -$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v2/lrs_for_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v1/load_balancer.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/end2end/xds_end2end_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a @@ -19989,7 +19684,7 @@ ifneq ($(NO_DEPS),true) -include $(XDS_END2END_TEST_OBJS:.o=.dep) endif endif -$(OBJDIR)/$(CONFIG)/test/cpp/end2end/xds_end2end_test.o: $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/end2end/xds_end2end_test.o: $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.pb.cc $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc PUBLIC_HEADERS_MUST_BE_C89_SRC = \ @@ -20028,6 +19723,102 @@ endif endif +GEN_HPACK_TABLES_SRC = \ + tools/codegen/core/gen_hpack_tables.cc \ + +GEN_HPACK_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_HPACK_TABLES_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/gen_hpack_tables: openssl_dep_error + +else + + + +$(BINDIR)/$(CONFIG)/gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LD) $(LDFLAGS) $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_hpack_tables + +endif + +$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_hpack_tables.o: $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a + +deps_gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(GEN_HPACK_TABLES_OBJS:.o=.dep) +endif +endif + + +GEN_LEGAL_METADATA_CHARACTERS_SRC = \ + tools/codegen/core/gen_legal_metadata_characters.cc \ + +GEN_LEGAL_METADATA_CHARACTERS_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_LEGAL_METADATA_CHARACTERS_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: openssl_dep_error + +else + + + +$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: $(GEN_LEGAL_METADATA_CHARACTERS_OBJS) + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LD) $(LDFLAGS) $(GEN_LEGAL_METADATA_CHARACTERS_OBJS) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters + +endif + +$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_legal_metadata_characters.o: + +deps_gen_legal_metadata_characters: $(GEN_LEGAL_METADATA_CHARACTERS_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(GEN_LEGAL_METADATA_CHARACTERS_OBJS:.o=.dep) +endif +endif + + +GEN_PERCENT_ENCODING_TABLES_SRC = \ + tools/codegen/core/gen_percent_encoding_tables.cc \ + +GEN_PERCENT_ENCODING_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_PERCENT_ENCODING_TABLES_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: openssl_dep_error + +else + + + +$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: $(GEN_PERCENT_ENCODING_TABLES_OBJS) + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LD) $(LDFLAGS) $(GEN_PERCENT_ENCODING_TABLES_OBJS) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables + +endif + +$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_percent_encoding_tables.o: + +deps_gen_percent_encoding_tables: $(GEN_PERCENT_ENCODING_TABLES_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(GEN_PERCENT_ENCODING_TABLES_OBJS:.o=.dep) +endif +endif + + BORINGSSL_SSL_TEST_SRC = \ third_party/boringssl/crypto/test/gtest_main.cc \ third_party/boringssl/ssl/span_test.cc \ @@ -22528,9 +22319,6 @@ src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc: $(OPENSSL_ src/core/ext/transport/cronet/plugin_registry/grpc_cronet_plugin_registry.cc: $(OPENSSL_DEP) src/core/ext/transport/cronet/transport/cronet_api_dummy.cc: $(OPENSSL_DEP) src/core/ext/transport/cronet/transport/cronet_transport.cc: $(OPENSSL_DEP) -src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c: $(OPENSSL_DEP) -src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c: $(OPENSSL_DEP) -src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c: $(OPENSSL_DEP) src/core/lib/http/httpcli_security_connector.cc: $(OPENSSL_DEP) src/core/lib/security/context/security_context.cc: $(OPENSSL_DEP) src/core/lib/security/credentials/alts/alts_credentials.cc: $(OPENSSL_DEP) @@ -22585,9 +22373,14 @@ src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc: $(OPEN src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc: $(OPENSSL_DEP) src/core/tsi/alts/frame_protector/frame_handler.cc: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/alts_handshaker_client.cc: $(OPENSSL_DEP) +src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc: $(OPENSSL_DEP) +src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/alts_shared_resource.cc: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/alts_tsi_utils.cc: $(OPENSSL_DEP) +src/core/tsi/alts/handshaker/altscontext.pb.c: $(OPENSSL_DEP) +src/core/tsi/alts/handshaker/handshaker.pb.c: $(OPENSSL_DEP) +src/core/tsi/alts/handshaker/transport_security_common.pb.c: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/transport_security_common_api.cc: $(OPENSSL_DEP) src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc: $(OPENSSL_DEP) src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc: $(OPENSSL_DEP) diff --git a/build_config.rb b/build_config.rb index 7bd312cd2b6..ab06a137473 100644 --- a/build_config.rb +++ b/build_config.rb @@ -13,5 +13,5 @@ # limitations under the License. module GrpcBuildConfig - CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-8.dll' + CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-7.dll' end diff --git a/config.m4 b/config.m4 index 2a074768f57..71f4a323091 100644 --- a/config.m4 +++ b/config.m4 @@ -334,17 +334,16 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc \ + src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc \ + src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc \ src/core/tsi/alts/handshaker/alts_tsi_utils.cc \ src/core/tsi/alts/handshaker/transport_security_common_api.cc \ - src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \ - src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \ - src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c \ - third_party/upb/upb/decode.c \ - third_party/upb/upb/encode.c \ - third_party/upb/upb/msg.c \ - third_party/upb/upb/port.c \ - third_party/upb/upb/table.c \ - third_party/upb/upb/upb.c \ + src/core/tsi/alts/handshaker/altscontext.pb.c \ + src/core/tsi/alts/handshaker/handshaker.pb.c \ + src/core/tsi/alts/handshaker/transport_security_common.pb.c \ + third_party/nanopb/pb_common.c \ + third_party/nanopb/pb_decode.c \ + third_party/nanopb/pb_encode.c \ src/core/tsi/transport_security.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ @@ -377,7 +376,7 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + src/core/ext/filters/client_channel/health/health.pb.c \ src/core/tsi/fake_transport_security.cc \ src/core/tsi/local_transport_security.cc \ src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc \ @@ -396,42 +395,14 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ - src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ - src/core/ext/upb-generated/google/api/annotations.upb.c \ - src/core/ext/upb-generated/google/api/http.upb.c \ - src/core/ext/upb-generated/google/protobuf/any.upb.c \ - src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ - src/core/ext/upb-generated/google/protobuf/duration.upb.c \ - src/core/ext/upb-generated/google/protobuf/empty.upb.c \ - src/core/ext/upb-generated/google/protobuf/struct.upb.c \ - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ - src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \ + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \ + src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc \ - src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c \ - src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c \ - src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ - src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ - src/core/ext/upb-generated/envoy/type/percent.upb.c \ - src/core/ext/upb-generated/envoy/type/range.upb.c \ - src/core/ext/upb-generated/gogoproto/gogo.upb.c \ - src/core/ext/upb-generated/validate/validate.upb.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ @@ -447,7 +418,6 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \ src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \ src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \ - src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \ src/core/ext/filters/census/grpc_context.cc \ src/core/ext/filters/client_idle/client_idle_filter.cc \ src/core/ext/filters/max_age/max_age_filter.cc \ @@ -725,6 +695,8 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/health) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/pick_first) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/round_robin) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/xds) @@ -733,7 +705,6 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/native) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/fake) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/sockaddr) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/xds) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_idle) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/deadline) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http) @@ -752,22 +723,6 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/server/secure) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/transport) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/inproc) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2/auth) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2/cluster) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2/core) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2/endpoint) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/discovery/v2) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/load_stats/v2) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/type) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/gogoproto) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/google/api) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/google/protobuf) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/google/rpc) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/gcp) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/health/v1) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/lb/v1) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/validate) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/avl) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/backoff) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/channel) @@ -851,5 +806,5 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/x509v3) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/ssl) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/third_party/fiat) - PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/nanopb) fi diff --git a/config.w32 b/config.w32 index 065da74bfb9..3d8e30e5ad5 100644 --- a/config.w32 +++ b/config.w32 @@ -307,17 +307,16 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\security\\credentials\\alts\\grpc_alts_credentials_client_options.cc " + "src\\core\\lib\\security\\credentials\\alts\\grpc_alts_credentials_options.cc " + "src\\core\\lib\\security\\credentials\\alts\\grpc_alts_credentials_server_options.cc " + + "src\\core\\tsi\\alts\\handshaker\\alts_handshaker_service_api.cc " + + "src\\core\\tsi\\alts\\handshaker\\alts_handshaker_service_api_util.cc " + "src\\core\\tsi\\alts\\handshaker\\alts_tsi_utils.cc " + "src\\core\\tsi\\alts\\handshaker\\transport_security_common_api.cc " + - "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp\\altscontext.upb.c " + - "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp\\handshaker.upb.c " + - "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp\\transport_security_common.upb.c " + - "third_party\\upb\\upb\\decode.c " + - "third_party\\upb\\upb\\encode.c " + - "third_party\\upb\\upb\\msg.c " + - "third_party\\upb\\upb\\port.c " + - "third_party\\upb\\upb\\table.c " + - "third_party\\upb\\upb\\upb.c " + + "src\\core\\tsi\\alts\\handshaker\\altscontext.pb.c " + + "src\\core\\tsi\\alts\\handshaker\\handshaker.pb.c " + + "src\\core\\tsi\\alts\\handshaker\\transport_security_common.pb.c " + + "third_party\\nanopb\\pb_common.c " + + "third_party\\nanopb\\pb_decode.c " + + "third_party\\nanopb\\pb_encode.c " + "src\\core\\tsi\\transport_security.cc " + "src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create.cc " + "src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create_posix.cc " + @@ -350,7 +349,7 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\filters\\client_channel\\subchannel.cc " + "src\\core\\ext\\filters\\client_channel\\subchannel_pool_interface.cc " + "src\\core\\ext\\filters\\deadline\\deadline_filter.cc " + - "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health\\v1\\health.upb.c " + + "src\\core\\ext\\filters\\client_channel\\health\\health.pb.c " + "src\\core\\tsi\\fake_transport_security.cc " + "src\\core\\tsi\\local_transport_security.cc " + "src\\core\\tsi\\ssl\\session_cache\\ssl_session_boringssl.cc " + @@ -369,42 +368,14 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\grpclb_channel_secure.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\grpclb_client_stats.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\load_balancer_api.cc " + - "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb\\v1\\load_balancer.upb.c " + - "src\\core\\ext\\upb-generated\\google\\api\\annotations.upb.c " + - "src\\core\\ext\\upb-generated\\google\\api\\http.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\any.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\descriptor.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\duration.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\empty.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\struct.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\timestamp.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\wrappers.upb.c " + - "src\\core\\ext\\upb-generated\\google\\rpc\\status.upb.c " + "src\\core\\ext\\filters\\client_channel\\resolver\\fake\\fake_resolver.cc " + + "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google\\protobuf\\duration.pb.c " + + "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google\\protobuf\\timestamp.pb.c " + + "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\load_balancer.pb.c " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds_channel_secure.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds_client_stats.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds_load_balancer_api.cc " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\auth\\cert.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cds.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster\\circuit_breaker.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster\\outlier_detection.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\discovery.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\eds.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\endpoint\\endpoint.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\endpoint\\load_report.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\service\\discovery\\v2\\ads.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\service\\load_stats\\v2\\lrs.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\address.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\base.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\config_source.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\grpc_service.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\health_check.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\protocol.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\type\\percent.upb.c " + - "src\\core\\ext\\upb-generated\\envoy\\type\\range.upb.c " + - "src\\core\\ext\\upb-generated\\gogoproto\\gogo.upb.c " + - "src\\core\\ext\\upb-generated\\validate\\validate.upb.c " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first\\pick_first.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin\\round_robin.cc " + "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\dns_resolver_ares.cc " + @@ -420,7 +391,6 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\dns_resolver_selection.cc " + "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native\\dns_resolver.cc " + "src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr\\sockaddr_resolver.cc " + - "src\\core\\ext\\filters\\client_channel\\resolver\\xds\\xds_resolver.cc " + "src\\core\\ext\\filters\\census\\grpc_context.cc " + "src\\core\\ext\\filters\\client_idle\\client_idle_filter.cc " + "src\\core\\ext\\filters\\max_age\\max_age_filter.cc " + @@ -730,6 +700,12 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\health"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google\\protobuf"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\xds"); @@ -739,7 +715,6 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\fake"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\xds"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_idle"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\deadline"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http"); @@ -760,34 +735,6 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\server\\secure"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\transport"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\inproc"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2\\auth"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2\\endpoint"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\discovery"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\discovery\\v2"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\load_stats"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\load_stats\\v2"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\type"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\gogoproto"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google\\api"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google\\protobuf"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google\\rpc"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health\\v1"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb\\v1"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\validate"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\avl"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\backoff"); @@ -881,8 +828,7 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\ssl"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\third_party"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\third_party\\fiat"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\nanopb"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\zlib"); _build_dirs = new Array(); for (i = 0; i < build_dirs.length; i++) { diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 02af80f53c2..d8bfe7c9023 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-C++' # TODO (mxyan): use version that match gRPC version when pod is stabilized - # version = '1.24.0-dev' + # version = '1.23.0-dev' version = '0.0.9-dev' s.version = version s.summary = 'gRPC C++ library' @@ -31,7 +31,7 @@ Pod::Spec.new do |s| s.license = 'Apache License, Version 2.0' s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' } - grpc_version = '1.24.0-dev' + grpc_version = '1.23.0-dev' s.source = { :git => 'https://github.com/grpc/grpc.git', @@ -180,7 +180,6 @@ Pod::Spec.new do |s| 'include/grpcpp/impl/codegen/config.h', 'include/grpcpp/impl/codegen/core_codegen_interface.h', 'include/grpcpp/impl/codegen/create_auth_context.h', - 'include/grpcpp/impl/codegen/delegating_channel.h', 'include/grpcpp/impl/codegen/grpc_library.h', 'include/grpcpp/impl/codegen/intercepted_channel.h', 'include/grpcpp/impl/codegen/interceptor.h', @@ -229,10 +228,6 @@ Pod::Spec.new do |s| 'src/cpp/server/health/default_health_check_service.h', 'src/cpp/server/thread_pool_interface.h', 'src/cpp/thread_manager/thread_manager.h', - 'third_party/nanopb/pb.h', - 'third_party/nanopb/pb_common.h', - 'third_party/nanopb/pb_decode.h', - 'third_party/nanopb/pb_encode.h', 'src/cpp/client/insecure_credentials.cc', 'src/cpp/client/secure_credentials.cc', 'src/cpp/common/auth_property_iterator.cc', @@ -386,19 +381,13 @@ Pod::Spec.new do |s| 'src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h', 'src/core/lib/security/credentials/alts/check_gcp_environment.h', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h', + 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.h', + 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h', 'src/core/tsi/alts/handshaker/alts_tsi_utils.h', 'src/core/tsi/alts/handshaker/transport_security_common_api.h', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h', - 'third_party/upb/upb/decode.h', - 'third_party/upb/upb/encode.h', - 'third_party/upb/upb/generated_util.h', - 'third_party/upb/upb/msg.h', - 'third_party/upb/upb/port_def.inc', - 'third_party/upb/upb/port_undef.inc', - 'third_party/upb/upb/table.int.h', - 'third_party/upb/upb/upb.h', + 'src/core/tsi/alts/handshaker/altscontext.pb.h', + 'src/core/tsi/alts/handshaker/handshaker.pb.h', + 'src/core/tsi/alts/handshaker/transport_security_common.pb.h', 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', 'src/core/ext/transport/chttp2/client/authority.h', @@ -431,7 +420,7 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel_interface.h', 'src/core/ext/filters/client_channel/subchannel_pool_interface.h', 'src/core/ext/filters/deadline/deadline_filter.h', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h', + 'src/core/ext/filters/client_channel/health/health.pb.h', 'src/core/tsi/fake_transport_security.h', 'src/core/tsi/local_transport_security.h', 'src/core/tsi/ssl/session_cache/ssl_session.h', @@ -590,41 +579,13 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h', - 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h', - 'src/core/ext/upb-generated/google/api/annotations.upb.h', - 'src/core/ext/upb-generated/google/api/http.upb.h', - 'src/core/ext/upb-generated/google/protobuf/any.upb.h', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.h', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.h', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.h', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h', - 'src/core/ext/upb-generated/google/rpc/status.upb.h', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h', - 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h', - 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h', - 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h', - 'src/core/ext/upb-generated/envoy/type/percent.upb.h', - 'src/core/ext/upb-generated/envoy/type/range.upb.h', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.h', - 'src/core/ext/upb-generated/validate/validate.upb.h', 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h', @@ -821,16 +782,8 @@ Pod::Spec.new do |s| 'src/core/lib/transport/transport_impl.h', 'src/core/lib/uri/uri_parser.h', 'src/core/lib/debug/trace.h', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h', - 'third_party/upb/upb/decode.h', - 'third_party/upb/upb/encode.h', - 'third_party/upb/upb/generated_util.h', - 'third_party/upb/upb/msg.h', - 'third_party/upb/upb/port_def.inc', - 'third_party/upb/upb/port_undef.inc', - 'third_party/upb/upb/table.int.h', - 'third_party/upb/upb/upb.h', - 'src/core/ext/transport/inproc/inproc_transport.h' + 'src/core/ext/transport/inproc/inproc_transport.h', + 'src/core/ext/filters/client_channel/health/health.pb.h' end s.subspec 'Protobuf' do |ss| diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 3244e9d08f9..60253c9b20a 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -22,7 +22,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.24.0-dev' + version = '1.23.0-dev' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'https://grpc.io' @@ -336,19 +336,13 @@ Pod::Spec.new do |s| 'src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h', 'src/core/lib/security/credentials/alts/check_gcp_environment.h', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h', + 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.h', + 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h', 'src/core/tsi/alts/handshaker/alts_tsi_utils.h', 'src/core/tsi/alts/handshaker/transport_security_common_api.h', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h', - 'third_party/upb/upb/decode.h', - 'third_party/upb/upb/encode.h', - 'third_party/upb/upb/generated_util.h', - 'third_party/upb/upb/msg.h', - 'third_party/upb/upb/port_def.inc', - 'third_party/upb/upb/port_undef.inc', - 'third_party/upb/upb/table.int.h', - 'third_party/upb/upb/upb.h', + 'src/core/tsi/alts/handshaker/altscontext.pb.h', + 'src/core/tsi/alts/handshaker/handshaker.pb.h', + 'src/core/tsi/alts/handshaker/transport_security_common.pb.h', 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', 'src/core/ext/transport/chttp2/client/authority.h', @@ -381,7 +375,7 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel_interface.h', 'src/core/ext/filters/client_channel/subchannel_pool_interface.h', 'src/core/ext/filters/deadline/deadline_filter.h', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h', + 'src/core/ext/filters/client_channel/health/health.pb.h', 'src/core/tsi/fake_transport_security.h', 'src/core/tsi/local_transport_security.h', 'src/core/tsi/ssl/session_cache/ssl_session.h', @@ -540,41 +534,13 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h', - 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h', - 'src/core/ext/upb-generated/google/api/annotations.upb.h', - 'src/core/ext/upb-generated/google/api/http.upb.h', - 'src/core/ext/upb-generated/google/protobuf/any.upb.h', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.h', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.h', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.h', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h', - 'src/core/ext/upb-generated/google/rpc/status.upb.h', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h', - 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h', - 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h', - 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h', - 'src/core/ext/upb-generated/envoy/type/percent.upb.h', - 'src/core/ext/upb-generated/envoy/type/range.upb.h', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.h', - 'src/core/ext/upb-generated/validate/validate.upb.h', 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h', @@ -832,17 +798,13 @@ Pod::Spec.new do |s| 'src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc', + 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc', + 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc', 'src/core/tsi/alts/handshaker/alts_tsi_utils.cc', 'src/core/tsi/alts/handshaker/transport_security_common_api.cc', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c', - 'third_party/upb/upb/decode.c', - 'third_party/upb/upb/encode.c', - 'third_party/upb/upb/msg.c', - 'third_party/upb/upb/port.c', - 'third_party/upb/upb/table.c', - 'third_party/upb/upb/upb.c', + 'src/core/tsi/alts/handshaker/altscontext.pb.c', + 'src/core/tsi/alts/handshaker/handshaker.pb.c', + 'src/core/tsi/alts/handshaker/transport_security_common.pb.c', 'src/core/tsi/transport_security.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', @@ -875,7 +837,7 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', + 'src/core/ext/filters/client_channel/health/health.pb.c', 'src/core/tsi/fake_transport_security.cc', 'src/core/tsi/local_transport_security.cc', 'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc', @@ -894,42 +856,14 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', - 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', - 'src/core/ext/upb-generated/google/api/annotations.upb.c', - 'src/core/ext/upb-generated/google/api/http.upb.c', - 'src/core/ext/upb-generated/google/protobuf/any.upb.c', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', - 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc', - 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c', - 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c', - 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c', - 'src/core/ext/upb-generated/envoy/type/percent.upb.c', - 'src/core/ext/upb-generated/envoy/type/range.upb.c', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', - 'src/core/ext/upb-generated/validate/validate.upb.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', @@ -945,7 +879,6 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc', 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc', 'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc', - 'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc', 'src/core/ext/filters/census/grpc_context.cc', 'src/core/ext/filters/client_idle/client_idle_filter.cc', 'src/core/ext/filters/max_age/max_age_filter.cc', @@ -1062,19 +995,13 @@ Pod::Spec.new do |s| 'src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h', 'src/core/lib/security/credentials/alts/check_gcp_environment.h', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h', + 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.h', + 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h', 'src/core/tsi/alts/handshaker/alts_tsi_utils.h', 'src/core/tsi/alts/handshaker/transport_security_common_api.h', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h', - 'third_party/upb/upb/decode.h', - 'third_party/upb/upb/encode.h', - 'third_party/upb/upb/generated_util.h', - 'third_party/upb/upb/msg.h', - 'third_party/upb/upb/port_def.inc', - 'third_party/upb/upb/port_undef.inc', - 'third_party/upb/upb/table.int.h', - 'third_party/upb/upb/upb.h', + 'src/core/tsi/alts/handshaker/altscontext.pb.h', + 'src/core/tsi/alts/handshaker/handshaker.pb.h', + 'src/core/tsi/alts/handshaker/transport_security_common.pb.h', 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', 'src/core/ext/transport/chttp2/client/authority.h', @@ -1107,7 +1034,7 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel_interface.h', 'src/core/ext/filters/client_channel/subchannel_pool_interface.h', 'src/core/ext/filters/deadline/deadline_filter.h', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h', + 'src/core/ext/filters/client_channel/health/health.pb.h', 'src/core/tsi/fake_transport_security.h', 'src/core/tsi/local_transport_security.h', 'src/core/tsi/ssl/session_cache/ssl_session.h', @@ -1266,41 +1193,13 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h', - 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h', - 'src/core/ext/upb-generated/google/api/annotations.upb.h', - 'src/core/ext/upb-generated/google/api/http.upb.h', - 'src/core/ext/upb-generated/google/protobuf/any.upb.h', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.h', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.h', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.h', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h', - 'src/core/ext/upb-generated/google/rpc/status.upb.h', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h', - 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h', - 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h', - 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h', - 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h', - 'src/core/ext/upb-generated/envoy/type/percent.upb.h', - 'src/core/ext/upb-generated/envoy/type/range.upb.h', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.h', - 'src/core/ext/upb-generated/validate/validate.upb.h', 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h', @@ -1331,9 +1230,16 @@ Pod::Spec.new do |s| ss.source_files = 'src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc', 'src/core/ext/transport/cronet/transport/cronet_transport.cc', + 'third_party/nanopb/pb_common.c', + 'third_party/nanopb/pb_decode.c', + 'third_party/nanopb/pb_encode.c', 'src/core/ext/transport/cronet/client/secure/cronet_channel_create.h', 'src/core/ext/transport/cronet/transport/cronet_transport.h', - 'third_party/objective_c/Cronet/bidirectional_stream_c.h' + 'third_party/objective_c/Cronet/bidirectional_stream_c.h', + 'third_party/nanopb/pb.h', + 'third_party/nanopb/pb_common.h', + 'third_party/nanopb/pb_decode.h', + 'third_party/nanopb/pb_encode.h' end s.subspec 'Tests' do |ss| @@ -1370,6 +1276,9 @@ Pod::Spec.new do |s| 'test/core/util/tracer_util.cc', 'test/core/util/trickle_endpoint.cc', 'test/core/util/cmdline.cc', + 'third_party/nanopb/pb_common.c', + 'third_party/nanopb/pb_decode.c', + 'third_party/nanopb/pb_encode.c', 'test/core/end2end/data/ssl_test_data.h', 'test/core/security/oauth2_utils.h', 'test/core/end2end/cq_verifier.h', @@ -1394,6 +1303,10 @@ Pod::Spec.new do |s| 'test/core/util/tracer_util.h', 'test/core/util/trickle_endpoint.h', 'test/core/util/cmdline.h', + 'third_party/nanopb/pb.h', + 'third_party/nanopb/pb_common.h', + 'third_party/nanopb/pb_decode.h', + 'third_party/nanopb/pb_encode.h', 'test/core/end2end/end2end_tests.cc', 'test/core/end2end/end2end_test_utils.cc', 'test/core/end2end/tests/authority_not_supported.cc', diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 57dac5a10e5..62bff003934 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.24.0-dev' + version = '1.23.0-dev' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'https://grpc.io' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index 9666c3c1b98..e9a19ac65df 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.24.0-dev' + version = '1.23.0-dev' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'https://grpc.io' diff --git a/gRPC.podspec b/gRPC.podspec index 09baf1e3b4b..0374e525b0d 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.24.0-dev' + version = '1.23.0-dev' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'https://grpc.io' diff --git a/grpc.def b/grpc.def index fa4d73c9252..f451775dba6 100644 --- a/grpc.def +++ b/grpc.def @@ -141,8 +141,6 @@ EXPORTS grpc_tls_credentials_options_set_server_authorization_check_config grpc_tls_key_materials_config_create grpc_tls_key_materials_config_set_key_materials - grpc_tls_key_materials_config_set_version - grpc_tls_key_materials_config_get_version grpc_tls_credential_reload_config_create grpc_tls_server_authorization_check_config_create grpc_raw_byte_buffer_create diff --git a/grpc.gemspec b/grpc.gemspec index 5a29165c92d..eda96081c73 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -265,19 +265,17 @@ Gem::Specification.new do |s| s.files += %w( src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h ) s.files += %w( src/core/lib/security/credentials/alts/check_gcp_environment.h ) s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h ) + s.files += %w( src/core/tsi/alts/handshaker/alts_handshaker_service_api.h ) + s.files += %w( src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h ) s.files += %w( src/core/tsi/alts/handshaker/alts_tsi_utils.h ) s.files += %w( src/core/tsi/alts/handshaker/transport_security_common_api.h ) - s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h ) - s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h ) - s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h ) - s.files += %w( third_party/upb/upb/decode.h ) - s.files += %w( third_party/upb/upb/encode.h ) - s.files += %w( third_party/upb/upb/generated_util.h ) - s.files += %w( third_party/upb/upb/msg.h ) - s.files += %w( third_party/upb/upb/port_def.inc ) - s.files += %w( third_party/upb/upb/port_undef.inc ) - s.files += %w( third_party/upb/upb/table.int.h ) - s.files += %w( third_party/upb/upb/upb.h ) + s.files += %w( src/core/tsi/alts/handshaker/altscontext.pb.h ) + s.files += %w( src/core/tsi/alts/handshaker/handshaker.pb.h ) + s.files += %w( src/core/tsi/alts/handshaker/transport_security_common.pb.h ) + s.files += %w( third_party/nanopb/pb.h ) + s.files += %w( third_party/nanopb/pb_common.h ) + s.files += %w( third_party/nanopb/pb_decode.h ) + s.files += %w( third_party/nanopb/pb_encode.h ) s.files += %w( src/core/tsi/transport_security.h ) s.files += %w( src/core/tsi/transport_security_interface.h ) s.files += %w( src/core/ext/transport/chttp2/client/authority.h ) @@ -310,7 +308,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/subchannel_interface.h ) s.files += %w( src/core/ext/filters/client_channel/subchannel_pool_interface.h ) s.files += %w( src/core/ext/filters/deadline/deadline_filter.h ) - s.files += %w( src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h ) + s.files += %w( src/core/ext/filters/client_channel/health/health.pb.h ) s.files += %w( src/core/tsi/fake_transport_security.h ) s.files += %w( src/core/tsi/local_transport_security.h ) s.files += %w( src/core/tsi/ssl/session_cache/ssl_session.h ) @@ -469,41 +467,13 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h ) - s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/api/http.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.h ) s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h ) + s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h ) + s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h ) + s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cds.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/eds.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/type/percent.upb.h ) - s.files += %w( src/core/ext/upb-generated/envoy/type/range.upb.h ) - s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.h ) - s.files += %w( src/core/ext/upb-generated/validate/validate.upb.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/subchannel_list.h ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h ) @@ -761,17 +731,16 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc ) s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc ) s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc ) + s.files += %w( src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc ) + s.files += %w( src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc ) s.files += %w( src/core/tsi/alts/handshaker/alts_tsi_utils.cc ) s.files += %w( src/core/tsi/alts/handshaker/transport_security_common_api.cc ) - s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c ) - s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c ) - s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c ) - s.files += %w( third_party/upb/upb/decode.c ) - s.files += %w( third_party/upb/upb/encode.c ) - s.files += %w( third_party/upb/upb/msg.c ) - s.files += %w( third_party/upb/upb/port.c ) - s.files += %w( third_party/upb/upb/table.c ) - s.files += %w( third_party/upb/upb/upb.c ) + s.files += %w( src/core/tsi/alts/handshaker/altscontext.pb.c ) + s.files += %w( src/core/tsi/alts/handshaker/handshaker.pb.c ) + s.files += %w( src/core/tsi/alts/handshaker/transport_security_common.pb.c ) + s.files += %w( third_party/nanopb/pb_common.c ) + s.files += %w( third_party/nanopb/pb_decode.c ) + s.files += %w( third_party/nanopb/pb_encode.c ) s.files += %w( src/core/tsi/transport_security.cc ) s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.cc ) s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc ) @@ -804,7 +773,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/subchannel.cc ) s.files += %w( src/core/ext/filters/client_channel/subchannel_pool_interface.cc ) s.files += %w( src/core/ext/filters/deadline/deadline_filter.cc ) - s.files += %w( src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c ) + s.files += %w( src/core/ext/filters/client_channel/health/health.pb.c ) s.files += %w( src/core/tsi/fake_transport_security.cc ) s.files += %w( src/core/tsi/local_transport_security.cc ) s.files += %w( src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc ) @@ -823,42 +792,14 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc ) - s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/api/http.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.c ) s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc ) + s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c ) + s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c ) + s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cds.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/eds.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/type/percent.upb.c ) - s.files += %w( src/core/ext/upb-generated/envoy/type/range.upb.c ) - s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.c ) - s.files += %w( src/core/ext/upb-generated/validate/validate.upb.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc ) @@ -874,7 +815,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc ) s.files += %w( src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc ) - s.files += %w( src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc ) s.files += %w( src/core/ext/filters/census/grpc_context.cc ) s.files += %w( src/core/ext/filters/client_idle/client_idle_filter.cc ) s.files += %w( src/core/ext/filters/max_age/max_age_filter.cc ) diff --git a/grpc.gyp b/grpc.gyp index a0e34ca67df..b9a30012fed 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -55,22 +55,12 @@ '-Wall', '-Wextra', '-Werror', - '-Wno-unknown-warning-option', '-Wno-long-long', '-Wno-unused-parameter', - '-Wno-deprecated-declarations', - '-Wno-sign-conversion', - '-Wno-shadow', - '-Wno-conversion', - '-Wno-implicit-fallthrough', - '-Wno-sign-compare', - '-Wno-missing-field-initializers', - '-Wno-maybe-uninitialized', - '-DPB_FIELD_32BIT', '-DOSATOMIC_USE_INLINED=1', + '-Wno-deprecated-declarations', '-Ithird_party/nanopb', - '-Ithird_party/upb', - '-Isrc/core/ext/upb-generated', + '-DPB_FIELD_32BIT', ], 'ldflags': [ '-g', @@ -146,44 +136,24 @@ '-Wall', '-Wextra', '-Werror', - '-Wno-unknown-warning-option', '-Wno-long-long', '-Wno-unused-parameter', - '-Wno-deprecated-declarations', - '-Wno-sign-conversion', - '-Wno-shadow', - '-Wno-conversion', - '-Wno-implicit-fallthrough', - '-Wno-sign-compare', - '-Wno-missing-field-initializers', - '-Wno-maybe-uninitialized', - '-DPB_FIELD_32BIT', '-DOSATOMIC_USE_INLINED=1', + '-Wno-deprecated-declarations', '-Ithird_party/nanopb', - '-Ithird_party/upb', - '-Isrc/core/ext/upb-generated', + '-DPB_FIELD_32BIT', ], 'OTHER_CPLUSPLUSFLAGS': [ '-g', '-Wall', '-Wextra', '-Werror', - '-Wno-unknown-warning-option', '-Wno-long-long', '-Wno-unused-parameter', - '-Wno-deprecated-declarations', - '-Wno-sign-conversion', - '-Wno-shadow', - '-Wno-conversion', - '-Wno-implicit-fallthrough', - '-Wno-sign-compare', - '-Wno-missing-field-initializers', - '-Wno-maybe-uninitialized', - '-DPB_FIELD_32BIT', '-DOSATOMIC_USE_INLINED=1', + '-Wno-deprecated-declarations', '-Ithird_party/nanopb', - '-Ithird_party/upb', - '-Isrc/core/ext/upb-generated', + '-DPB_FIELD_32BIT', '-stdlib=libc++', '-std=c++11', '-Wno-error=deprecated-declarations', @@ -544,17 +514,16 @@ 'src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc', + 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc', + 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc', 'src/core/tsi/alts/handshaker/alts_tsi_utils.cc', 'src/core/tsi/alts/handshaker/transport_security_common_api.cc', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c', - 'third_party/upb/upb/decode.c', - 'third_party/upb/upb/encode.c', - 'third_party/upb/upb/msg.c', - 'third_party/upb/upb/port.c', - 'third_party/upb/upb/table.c', - 'third_party/upb/upb/upb.c', + 'src/core/tsi/alts/handshaker/altscontext.pb.c', + 'src/core/tsi/alts/handshaker/handshaker.pb.c', + 'src/core/tsi/alts/handshaker/transport_security_common.pb.c', + 'third_party/nanopb/pb_common.c', + 'third_party/nanopb/pb_decode.c', + 'third_party/nanopb/pb_encode.c', 'src/core/tsi/transport_security.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', @@ -587,7 +556,7 @@ 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', + 'src/core/ext/filters/client_channel/health/health.pb.c', 'src/core/tsi/fake_transport_security.cc', 'src/core/tsi/local_transport_security.cc', 'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc', @@ -606,42 +575,14 @@ 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', - 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', - 'src/core/ext/upb-generated/google/api/annotations.upb.c', - 'src/core/ext/upb-generated/google/api/http.upb.c', - 'src/core/ext/upb-generated/google/protobuf/any.upb.c', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', - 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc', - 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c', - 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c', - 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c', - 'src/core/ext/upb-generated/envoy/type/percent.upb.c', - 'src/core/ext/upb-generated/envoy/type/range.upb.c', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', - 'src/core/ext/upb-generated/validate/validate.upb.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', @@ -657,7 +598,6 @@ 'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc', 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc', 'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc', - 'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc', 'src/core/ext/filters/census/grpc_context.cc', 'src/core/ext/filters/client_idle/client_idle_filter.cc', 'src/core/ext/filters/max_age/max_age_filter.cc', @@ -891,13 +831,10 @@ 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', - 'third_party/upb/upb/decode.c', - 'third_party/upb/upb/encode.c', - 'third_party/upb/upb/msg.c', - 'third_party/upb/upb/port.c', - 'third_party/upb/upb/table.c', - 'third_party/upb/upb/upb.c', + 'src/core/ext/filters/client_channel/health/health.pb.c', + 'third_party/nanopb/pb_common.c', + 'third_party/nanopb/pb_decode.c', + 'third_party/nanopb/pb_encode.c', 'src/core/ext/transport/chttp2/transport/bin_decoder.cc', 'src/core/ext/transport/chttp2/transport/bin_encoder.cc', 'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc', @@ -1146,13 +1083,10 @@ 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', - 'third_party/upb/upb/decode.c', - 'third_party/upb/upb/encode.c', - 'third_party/upb/upb/msg.c', - 'third_party/upb/upb/port.c', - 'third_party/upb/upb/table.c', - 'third_party/upb/upb/upb.c', + 'src/core/ext/filters/client_channel/health/health.pb.c', + 'third_party/nanopb/pb_common.c', + 'third_party/nanopb/pb_decode.c', + 'third_party/nanopb/pb_encode.c', 'src/core/ext/transport/chttp2/transport/bin_decoder.cc', 'src/core/ext/transport/chttp2/transport/bin_encoder.cc', 'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc', @@ -1412,13 +1346,10 @@ 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', - 'third_party/upb/upb/decode.c', - 'third_party/upb/upb/encode.c', - 'third_party/upb/upb/msg.c', - 'third_party/upb/upb/port.c', - 'third_party/upb/upb/table.c', - 'third_party/upb/upb/upb.c', + 'src/core/ext/filters/client_channel/health/health.pb.c', + 'third_party/nanopb/pb_common.c', + 'third_party/nanopb/pb_decode.c', + 'third_party/nanopb/pb_encode.c', 'src/core/ext/transport/inproc/inproc_plugin.cc', 'src/core/ext/transport/inproc/inproc_transport.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', @@ -1435,47 +1366,18 @@ 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc', 'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', - 'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', - 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', - 'src/core/ext/upb-generated/google/api/annotations.upb.c', - 'src/core/ext/upb-generated/google/api/http.upb.c', - 'src/core/ext/upb-generated/google/protobuf/any.upb.c', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', - 'src/core/ext/upb-generated/google/rpc/status.upb.c', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc', - 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c', - 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c', - 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c', - 'src/core/ext/upb-generated/envoy/type/percent.upb.c', - 'src/core/ext/upb-generated/envoy/type/range.upb.c', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', - 'src/core/ext/upb-generated/validate/validate.upb.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/census/grpc_context.cc', @@ -1592,13 +1494,10 @@ 'src/cpp/util/status.cc', 'src/cpp/util/string_ref.cc', 'src/cpp/util/time_cc.cc', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', - 'third_party/upb/upb/decode.c', - 'third_party/upb/upb/encode.c', - 'third_party/upb/upb/msg.c', - 'third_party/upb/upb/port.c', - 'third_party/upb/upb/table.c', - 'third_party/upb/upb/upb.c', + 'src/core/ext/filters/client_channel/health/health.pb.c', + 'third_party/nanopb/pb_common.c', + 'third_party/nanopb/pb_decode.c', + 'third_party/nanopb/pb_encode.c', 'src/cpp/codegen/codegen_init.cc', ], }, @@ -1752,13 +1651,10 @@ 'src/cpp/util/status.cc', 'src/cpp/util/string_ref.cc', 'src/cpp/util/time_cc.cc', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', - 'third_party/upb/upb/decode.c', - 'third_party/upb/upb/encode.c', - 'third_party/upb/upb/msg.c', - 'third_party/upb/upb/port.c', - 'third_party/upb/upb/table.c', - 'third_party/upb/upb/upb.c', + 'src/core/ext/filters/client_channel/health/health.pb.c', + 'third_party/nanopb/pb_common.c', + 'third_party/nanopb/pb_decode.c', + 'third_party/nanopb/pb_encode.c', 'src/cpp/codegen/codegen_init.cc', ], }, @@ -2259,6 +2155,24 @@ 'third_party/benchmark/src/timers.cc', ], }, + { + 'target_name': 'upb', + 'type': 'static_library', + 'dependencies': [ + ], + 'sources': [ + 'third_party/upb/generated_for_cmake/google/protobuf/descriptor.upb.c', + 'third_party/upb/upb/decode.c', + 'third_party/upb/upb/def.c', + 'third_party/upb/upb/encode.c', + 'third_party/upb/upb/handlers.c', + 'third_party/upb/upb/msg.c', + 'third_party/upb/upb/msgfactory.c', + 'third_party/upb/upb/sink.c', + 'third_party/upb/upb/table.c', + 'third_party/upb/upb/upb.c', + ], + }, { 'target_name': 'z', 'type': 'static_library', diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 7db070d7e8f..e5038dee4b7 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -48,7 +48,7 @@ class TlsKeyMaterialsConfig { * transfers ownership of the arguments to the config. **/ void set_key_materials(grpc::string pem_root_certs, std::vector pem_key_cert_pair_list); - void set_version(int version) { version_ = version;}; + void set_version(int version) { version_ = version; }; private: int version_; @@ -63,7 +63,6 @@ grpc_tls_key_materials_config* c_key_materials( std::shared_ptr tls_key_materials_c_to_cpp( const grpc_tls_key_materials_config* config); - /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ class TlsCredentialReloadArg { public: @@ -167,9 +166,8 @@ class TlsServerAuthorizationCheckArg { // Exposed for testing purposes. int tls_server_authorization_check_config_c_schedule( void* config_user_data, grpc_tls_server_authorization_check_arg* arg); -void tls_server_authorization_check_config_c_cancel(void* config_user_data, - grpc_tls_server_authorization_check_arg* arg); - +void tls_server_authorization_check_config_c_cancel( + void* config_user_data, grpc_tls_server_authorization_check_arg* arg); /** TLS server authorization check config, wraps * grps_tls_server_authorization_check_config. **/ @@ -197,7 +195,8 @@ class TlsServerAuthorizationCheckConfig { } /** Creates C struct for the credential reload config. **/ - grpc_tls_server_authorization_check_config* c_server_authorization_check() const { + grpc_tls_server_authorization_check_config* c_server_authorization_check() + const { return c_config_; } @@ -219,8 +218,7 @@ class TlsCredentialsOptions { std::shared_ptr key_materials_config() const { return key_materials_config_; } - std::shared_ptr credential_reload_config() - const { + std::shared_ptr credential_reload_config() const { return credential_reload_config_; } std::shared_ptr diff --git a/package.xml b/package.xml index 196c6a6d7db..cb221ff932d 100644 --- a/package.xml +++ b/package.xml @@ -13,8 +13,8 @@ 2018-01-19 - 1.24.0dev - 1.24.0dev + 1.23.0dev + 1.23.0dev beta @@ -270,19 +270,17 @@ + + - - - - - - - - - - - + + + + + + + @@ -315,7 +313,7 @@ - + @@ -474,41 +472,13 @@ - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - @@ -766,17 +736,16 @@ + + - - - - - - - - - + + + + + + @@ -809,7 +778,7 @@ - + @@ -828,42 +797,14 @@ - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - @@ -879,7 +820,6 @@ - diff --git a/src/core/lib/surface/version.cc b/src/core/lib/surface/version.cc index 71eb89a1b42..848a49d1eff 100644 --- a/src/core/lib/surface/version.cc +++ b/src/core/lib/surface/version.cc @@ -23,6 +23,6 @@ #include -const char* grpc_version_string(void) { return "8.0.0"; } +const char* grpc_version_string(void) { return "7.0.0"; } -const char* grpc_g_stands_for(void) { return "ganges"; } +const char* grpc_g_stands_for(void) { return "gangnam"; } diff --git a/src/core/plugin_registry/grpc_plugin_registry.cc b/src/core/plugin_registry/grpc_plugin_registry.cc index ebe3def245a..9b011d8df0f 100644 --- a/src/core/plugin_registry/grpc_plugin_registry.cc +++ b/src/core/plugin_registry/grpc_plugin_registry.cc @@ -46,8 +46,6 @@ void grpc_resolver_dns_native_init(void); void grpc_resolver_dns_native_shutdown(void); void grpc_resolver_sockaddr_init(void); void grpc_resolver_sockaddr_shutdown(void); -void grpc_resolver_xds_init(void); -void grpc_resolver_xds_shutdown(void); void grpc_client_idle_filter_init(void); void grpc_client_idle_filter_shutdown(void); void grpc_max_age_filter_init(void); @@ -86,8 +84,6 @@ void grpc_register_built_in_plugins(void) { grpc_resolver_dns_native_shutdown); grpc_register_plugin(grpc_resolver_sockaddr_init, grpc_resolver_sockaddr_shutdown); - grpc_register_plugin(grpc_resolver_xds_init, - grpc_resolver_xds_shutdown); grpc_register_plugin(grpc_client_idle_filter_init, grpc_client_idle_filter_shutdown); grpc_register_plugin(grpc_max_age_filter_init, diff --git a/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc index 6668836f02f..055c3ccc134 100644 --- a/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc +++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc @@ -38,8 +38,6 @@ void grpc_resolver_sockaddr_init(void); void grpc_resolver_sockaddr_shutdown(void); void grpc_resolver_fake_init(void); void grpc_resolver_fake_shutdown(void); -void grpc_resolver_xds_init(void); -void grpc_resolver_xds_shutdown(void); void grpc_lb_policy_grpclb_init(void); void grpc_lb_policy_grpclb_shutdown(void); void grpc_lb_policy_xds_init(void); @@ -78,8 +76,6 @@ void grpc_register_built_in_plugins(void) { grpc_resolver_sockaddr_shutdown); grpc_register_plugin(grpc_resolver_fake_init, grpc_resolver_fake_shutdown); - grpc_register_plugin(grpc_resolver_xds_init, - grpc_resolver_xds_shutdown); grpc_register_plugin(grpc_lb_policy_grpclb_init, grpc_lb_policy_grpclb_shutdown); grpc_register_plugin(grpc_lb_policy_xds_init, diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index a48e9f94ba6..8d85d5a0ac7 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -32,13 +32,15 @@ void TlsKeyMaterialsConfig::set_key_materials( } /** Creates a new C struct for the key materials. **/ -grpc_tls_key_materials_config* c_key_materials(const std::shared_ptr& config) { +grpc_tls_key_materials_config* c_key_materials( + const std::shared_ptr& config) { grpc_tls_key_materials_config* c_config = grpc_tls_key_materials_config_create(); ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> c_pem_key_cert_pair_list; for (auto key_cert_pair = config->pem_key_cert_pair_list().begin(); - key_cert_pair != config->pem_key_cert_pair_list().end(); key_cert_pair++) { + key_cert_pair != config->pem_key_cert_pair_list().end(); + key_cert_pair++) { grpc_ssl_pem_key_cert_pair* ssl_pair = (grpc_ssl_pem_key_cert_pair*)gpr_malloc( sizeof(grpc_ssl_pem_key_cert_pair)); @@ -48,7 +50,8 @@ grpc_tls_key_materials_config* c_key_materials(const std::shared_ptr c_pem_root_certs(gpr_strdup(config->pem_root_certs().c_str())); + ::grpc_core::UniquePtr c_pem_root_certs( + gpr_strdup(config->pem_root_certs().c_str())); c_config->set_key_materials(std::move(c_pem_root_certs), std::move(c_pem_key_cert_pair_list)); c_config->set_version(config->version()); @@ -60,8 +63,7 @@ std::shared_ptr tls_key_materials_c_to_cpp( const grpc_tls_key_materials_config* config) { std::shared_ptr cpp_config( new TlsKeyMaterialsConfig()); - std::vector - cpp_pem_key_cert_pair_list; + std::vector cpp_pem_key_cert_pair_list; grpc_tls_key_materials_config::PemKeyCertPairList pem_key_cert_pair_list = config->pem_key_cert_pair_list(); for (size_t i = 0; i < pem_key_cert_pair_list.size(); i++) { @@ -71,9 +73,8 @@ std::shared_ptr tls_key_materials_c_to_cpp( gpr_strdup(key_cert_pair.cert_chain())}; cpp_pem_key_cert_pair_list.push_back(::std::move(p)); } - cpp_config->set_key_materials( - std::move(gpr_strdup(config->pem_root_certs())), - std::move(cpp_pem_key_cert_pair_list)); + cpp_config->set_key_materials(std::move(gpr_strdup(config->pem_root_certs())), + std::move(cpp_pem_key_cert_pair_list)); cpp_config->set_version(config->version()); return cpp_config; } @@ -95,16 +96,19 @@ void* TlsCredentialReloadArg::cb_user_data() const { /** This function creates a new TlsKeyMaterialsConfig instance whose fields are * not shared with the corresponding key materials config fields of the * TlsCredentialReloadArg instance. **/ -std::shared_ptr TlsCredentialReloadArg::key_materials_config() const { +std::shared_ptr +TlsCredentialReloadArg::key_materials_config() const { return tls_key_materials_c_to_cpp(c_arg_.key_materials_config); } -grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() const { +grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() + const { return c_arg_.status; } std::shared_ptr TlsCredentialReloadArg::error_details() const { - std::shared_ptr cpp_error_details(new grpc::string(c_arg_.error_details)); + std::shared_ptr cpp_error_details( + new grpc::string(c_arg_.error_details)); return cpp_error_details; } @@ -113,7 +117,7 @@ void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { } void TlsCredentialReloadArg::set_key_materials_config( - std::shared_ptr key_materials_config) { + const std::shared_ptr& key_materials_config) { c_arg_.key_materials_config = c_key_materials(key_materials_config); } @@ -122,13 +126,12 @@ void TlsCredentialReloadArg::set_status( c_arg_.status = status; } -void TlsCredentialReloadArg::set_error_details(const grpc::string& error_details) { +void TlsCredentialReloadArg::set_error_details( + const grpc::string& error_details) { c_arg_.error_details = gpr_strdup(error_details.c_str()); } -void TlsCredentialReloadArg::callback() { - c_arg_.cb(&c_arg_); -} +void TlsCredentialReloadArg::callback() { c_arg_.cb(&c_arg_); } /** The C schedule and cancel functions for the credential reload config. **/ int tls_credential_reload_config_c_schedule( @@ -211,7 +214,7 @@ grpc_status_code TlsServerAuthorizationCheckArg::status() const { std::shared_ptr TlsServerAuthorizationCheckArg::error_details() const { std::shared_ptr cpp_error_details( -new grpc::string(c_arg_.error_details)); + new grpc::string(c_arg_.error_details)); return cpp_error_details; } @@ -282,14 +285,13 @@ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( config_user_data_ = const_cast(config_user_data); schedule_ = schedule; cancel_ = cancel; -destruct_ = destruct; + destruct_ = destruct; c_config_ = grpc_tls_server_authorization_check_config_create( config_user_data_, &tls_server_authorization_check_config_c_schedule, &tls_server_authorization_check_config_c_cancel, destruct_); c_config_->set_context(static_cast(this)); } - TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() {} /** gRPC TLS credential options API implementation **/ @@ -299,7 +301,8 @@ grpc_tls_credentials_options* TlsCredentialsOptions::c_credentials_options() grpc_tls_credentials_options_create(); c_options->set_cert_request_type(cert_request_type_); c_options->set_key_materials_config( - ::grpc_core::RefCountedPtr(c_key_materials(key_materials_config_))); + ::grpc_core::RefCountedPtr( + c_key_materials(key_materials_config_))); c_options->set_credential_reload_config( ::grpc_core::RefCountedPtr( credential_reload_config_->c_credential_reload())); diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc index 71ddc6e5d71..7fb7823c9f2 100644 --- a/src/cpp/common/version_cc.cc +++ b/src/cpp/common/version_cc.cc @@ -22,5 +22,5 @@ #include namespace grpc { -grpc::string Version() { return "1.24.0-dev"; } +grpc::string Version() { return "1.23.0-dev"; } } // namespace grpc diff --git a/src/csharp/Grpc.Core.Api/VersionInfo.cs b/src/csharp/Grpc.Core.Api/VersionInfo.cs index f732af32ec3..6469aeb3f4b 100644 --- a/src/csharp/Grpc.Core.Api/VersionInfo.cs +++ b/src/csharp/Grpc.Core.Api/VersionInfo.cs @@ -28,16 +28,16 @@ namespace Grpc.Core /// /// Current AssemblyVersion attribute of gRPC C# assemblies /// - public const string CurrentAssemblyVersion = "2.0.0.0"; + public const string CurrentAssemblyVersion = "1.0.0.0"; /// /// Current AssemblyFileVersion of gRPC C# assemblies /// - public const string CurrentAssemblyFileVersion = "2.24.0.0"; + public const string CurrentAssemblyFileVersion = "1.23.0.0"; /// /// Current version of gRPC C# /// - public const string CurrentVersion = "2.24.0-dev"; + public const string CurrentVersion = "1.23.0-dev"; } } diff --git a/src/csharp/build/dependencies.props b/src/csharp/build/dependencies.props index d45d3b1b0eb..a91b5e19414 100644 --- a/src/csharp/build/dependencies.props +++ b/src/csharp/build/dependencies.props @@ -1,7 +1,7 @@ - 2.24.0-dev + 1.23.0-dev 3.8.0 diff --git a/src/csharp/build_unitypackage.bat b/src/csharp/build_unitypackage.bat index 9fade5c1dd0..3eab6886f3b 100644 --- a/src/csharp/build_unitypackage.bat +++ b/src/csharp/build_unitypackage.bat @@ -13,7 +13,7 @@ @rem limitations under the License. @rem Current package versions -set VERSION=2.24.0-dev +set VERSION=1.23.0-dev @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe diff --git a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec index 67faaeb2567..14ece66db61 100644 --- a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCCppPlugin' - v = '1.24.0-dev' + v = '1.23.0-dev' s.version = v s.summary = 'The gRPC ProtoC plugin generates C++ files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index f65086b6df5..1ac3b4d4685 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.24.0-dev' + v = '1.23.0-dev' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index fc6982c55d6..3b248db0148 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -22,4 +22,4 @@ // instead. This file can be regenerated from the template by running // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.24.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.23.0-dev" diff --git a/src/objective-c/tests/version.h b/src/objective-c/tests/version.h index 9182189f4c8..231ba1a9a9f 100644 --- a/src/objective-c/tests/version.h +++ b/src/objective-c/tests/version.h @@ -22,5 +22,5 @@ // instead. This file can be regenerated from the template by running // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.24.0-dev" -#define GRPC_C_VERSION_STRING @"8.0.0" +#define GRPC_OBJC_VERSION_STRING @"1.23.0-dev" +#define GRPC_C_VERSION_STRING @"7.0.0" diff --git a/src/php/composer.json b/src/php/composer.json index 6da1fd77d65..e29c9c33fde 100644 --- a/src/php/composer.json +++ b/src/php/composer.json @@ -2,7 +2,7 @@ "name": "grpc/grpc-dev", "description": "gRPC library for PHP - for Developement use only", "license": "Apache-2.0", - "version": "1.24.0", + "version": "1.23.0", "require": { "php": ">=5.5.0", "google/protobuf": "^v3.3.0" diff --git a/src/php/ext/grpc/version.h b/src/php/ext/grpc/version.h index 000508dd3f8..bb707f50a9f 100644 --- a/src/php/ext/grpc/version.h +++ b/src/php/ext/grpc/version.h @@ -20,6 +20,6 @@ #ifndef VERSION_H #define VERSION_H -#define PHP_GRPC_VERSION "1.24.0dev" +#define PHP_GRPC_VERSION "1.23.0dev" #endif /* VERSION_H */ diff --git a/src/python/grpcio/grpc/_grpcio_metadata.py b/src/python/grpcio/grpc/_grpcio_metadata.py index ff1b1a17d25..d2f8be43f34 100644 --- a/src/python/grpcio/grpc/_grpcio_metadata.py +++ b/src/python/grpcio/grpc/_grpcio_metadata.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!! -__version__ = """1.24.0.dev0""" +__version__ = """1.23.0.dev0""" diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 607235556e3..aab3768b02e 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -306,17 +306,16 @@ CORE_SOURCE_FILES = [ 'src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc', + 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc', + 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc', 'src/core/tsi/alts/handshaker/alts_tsi_utils.cc', 'src/core/tsi/alts/handshaker/transport_security_common_api.cc', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c', - 'third_party/upb/upb/decode.c', - 'third_party/upb/upb/encode.c', - 'third_party/upb/upb/msg.c', - 'third_party/upb/upb/port.c', - 'third_party/upb/upb/table.c', - 'third_party/upb/upb/upb.c', + 'src/core/tsi/alts/handshaker/altscontext.pb.c', + 'src/core/tsi/alts/handshaker/handshaker.pb.c', + 'src/core/tsi/alts/handshaker/transport_security_common.pb.c', + 'third_party/nanopb/pb_common.c', + 'third_party/nanopb/pb_decode.c', + 'third_party/nanopb/pb_encode.c', 'src/core/tsi/transport_security.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', @@ -349,7 +348,7 @@ CORE_SOURCE_FILES = [ 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', + 'src/core/ext/filters/client_channel/health/health.pb.c', 'src/core/tsi/fake_transport_security.cc', 'src/core/tsi/local_transport_security.cc', 'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc', @@ -368,42 +367,14 @@ CORE_SOURCE_FILES = [ 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', - 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', - 'src/core/ext/upb-generated/google/api/annotations.upb.c', - 'src/core/ext/upb-generated/google/api/http.upb.c', - 'src/core/ext/upb-generated/google/protobuf/any.upb.c', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', - 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc', - 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c', - 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c', - 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c', - 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c', - 'src/core/ext/upb-generated/envoy/type/percent.upb.c', - 'src/core/ext/upb-generated/envoy/type/range.upb.c', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', - 'src/core/ext/upb-generated/validate/validate.upb.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', @@ -419,7 +390,6 @@ CORE_SOURCE_FILES = [ 'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc', 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc', 'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc', - 'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc', 'src/core/ext/filters/census/grpc_context.cc', 'src/core/ext/filters/client_idle/client_idle_filter.cc', 'src/core/ext/filters/max_age/max_age_filter.cc', diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index e0280abaa7c..548d2810b5b 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION = '1.24.0.dev0' +VERSION = '1.23.0.dev0' diff --git a/src/python/grpcio_channelz/grpc_version.py b/src/python/grpcio_channelz/grpc_version.py index 93a448ecb64..f7029fff484 100644 --- a/src/python/grpcio_channelz/grpc_version.py +++ b/src/python/grpcio_channelz/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!! -VERSION = '1.24.0.dev0' +VERSION = '1.23.0.dev0' diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py index 2a1aa0c9359..d66daa473ed 100644 --- a/src/python/grpcio_health_checking/grpc_version.py +++ b/src/python/grpcio_health_checking/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! -VERSION = '1.24.0.dev0' +VERSION = '1.23.0.dev0' diff --git a/src/python/grpcio_reflection/grpc_version.py b/src/python/grpcio_reflection/grpc_version.py index 93c28ba9fac..97213872a91 100644 --- a/src/python/grpcio_reflection/grpc_version.py +++ b/src/python/grpcio_reflection/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! -VERSION = '1.24.0.dev0' +VERSION = '1.23.0.dev0' diff --git a/src/python/grpcio_status/grpc_version.py b/src/python/grpcio_status/grpc_version.py index a2b5a814b52..31921b4cc90 100644 --- a/src/python/grpcio_status/grpc_version.py +++ b/src/python/grpcio_status/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/grpc_version.py.template`!!! -VERSION = '1.24.0.dev0' +VERSION = '1.23.0.dev0' diff --git a/src/python/grpcio_testing/grpc_version.py b/src/python/grpcio_testing/grpc_version.py index 937e57da02f..5c8926cb6c8 100644 --- a/src/python/grpcio_testing/grpc_version.py +++ b/src/python/grpcio_testing/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!! -VERSION = '1.24.0.dev0' +VERSION = '1.23.0.dev0' diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py index a1e43215b09..a1fc87448a1 100644 --- a/src/python/grpcio_tests/grpc_version.py +++ b/src/python/grpcio_tests/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!! -VERSION = '1.24.0.dev0' +VERSION = '1.23.0.dev0' diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c index 6cb10c9126c..fa275c75419 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c @@ -164,8 +164,6 @@ grpc_tls_credentials_options_set_credential_reload_config_type grpc_tls_credenti grpc_tls_credentials_options_set_server_authorization_check_config_type grpc_tls_credentials_options_set_server_authorization_check_config_import; grpc_tls_key_materials_config_create_type grpc_tls_key_materials_config_create_import; grpc_tls_key_materials_config_set_key_materials_type grpc_tls_key_materials_config_set_key_materials_import; -grpc_tls_key_materials_config_set_version_type grpc_tls_key_materials_config_set_version_import; -grpc_tls_key_materials_config_get_version_type grpc_tls_key_materials_config_get_version_import; grpc_tls_credential_reload_config_create_type grpc_tls_credential_reload_config_create_import; grpc_tls_server_authorization_check_config_create_type grpc_tls_server_authorization_check_config_create_import; grpc_raw_byte_buffer_create_type grpc_raw_byte_buffer_create_import; @@ -437,8 +435,6 @@ void grpc_rb_load_imports(HMODULE library) { grpc_tls_credentials_options_set_server_authorization_check_config_import = (grpc_tls_credentials_options_set_server_authorization_check_config_type) GetProcAddress(library, "grpc_tls_credentials_options_set_server_authorization_check_config"); grpc_tls_key_materials_config_create_import = (grpc_tls_key_materials_config_create_type) GetProcAddress(library, "grpc_tls_key_materials_config_create"); grpc_tls_key_materials_config_set_key_materials_import = (grpc_tls_key_materials_config_set_key_materials_type) GetProcAddress(library, "grpc_tls_key_materials_config_set_key_materials"); - grpc_tls_key_materials_config_set_version_import = (grpc_tls_key_materials_config_set_version_type) GetProcAddress(library, "grpc_tls_key_materials_config_set_version"); - grpc_tls_key_materials_config_get_version_import = (grpc_tls_key_materials_config_get_version_type) GetProcAddress(library, "grpc_tls_key_materials_config_get_version"); grpc_tls_credential_reload_config_create_import = (grpc_tls_credential_reload_config_create_type) GetProcAddress(library, "grpc_tls_credential_reload_config_create"); grpc_tls_server_authorization_check_config_create_import = (grpc_tls_server_authorization_check_config_create_type) GetProcAddress(library, "grpc_tls_server_authorization_check_config_create"); grpc_raw_byte_buffer_create_import = (grpc_raw_byte_buffer_create_type) GetProcAddress(library, "grpc_raw_byte_buffer_create"); diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h index 46912af5f5a..1389c301728 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h @@ -467,12 +467,6 @@ extern grpc_tls_key_materials_config_create_type grpc_tls_key_materials_config_c typedef int(*grpc_tls_key_materials_config_set_key_materials_type)(grpc_tls_key_materials_config* config, const char* pem_root_certs, const grpc_ssl_pem_key_cert_pair** pem_key_cert_pairs, size_t num_key_cert_pairs); extern grpc_tls_key_materials_config_set_key_materials_type grpc_tls_key_materials_config_set_key_materials_import; #define grpc_tls_key_materials_config_set_key_materials grpc_tls_key_materials_config_set_key_materials_import -typedef int(*grpc_tls_key_materials_config_set_version_type)(grpc_tls_key_materials_config* config, int version); -extern grpc_tls_key_materials_config_set_version_type grpc_tls_key_materials_config_set_version_import; -#define grpc_tls_key_materials_config_set_version grpc_tls_key_materials_config_set_version_import -typedef int(*grpc_tls_key_materials_config_get_version_type)(grpc_tls_key_materials_config* config); -extern grpc_tls_key_materials_config_get_version_type grpc_tls_key_materials_config_get_version_import; -#define grpc_tls_key_materials_config_get_version grpc_tls_key_materials_config_get_version_import typedef grpc_tls_credential_reload_config*(*grpc_tls_credential_reload_config_create_type)(const void* config_user_data, int (*schedule)(void* config_user_data, grpc_tls_credential_reload_arg* arg), void (*cancel)(void* config_user_data, grpc_tls_credential_reload_arg* arg), void (*destruct)(void* config_user_data)); extern grpc_tls_credential_reload_config_create_type grpc_tls_credential_reload_config_create_import; #define grpc_tls_credential_reload_config_create grpc_tls_credential_reload_config_create_import diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index 43f08a0c87b..051bc067e55 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -14,5 +14,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '1.24.0.dev' + VERSION = '1.23.0.dev' end diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb index b08edb08478..e66a4a799fd 100644 --- a/src/ruby/tools/version.rb +++ b/src/ruby/tools/version.rb @@ -14,6 +14,6 @@ module GRPC module Tools - VERSION = '1.24.0.dev' + VERSION = '1.23.0.dev' end end diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c index f1f3c7a2745..e537e482936 100644 --- a/test/core/surface/public_headers_must_be_c89.c +++ b/test/core/surface/public_headers_must_be_c89.c @@ -201,8 +201,6 @@ int main(int argc, char **argv) { printf("%lx", (unsigned long) grpc_tls_credentials_options_set_server_authorization_check_config); printf("%lx", (unsigned long) grpc_tls_key_materials_config_create); printf("%lx", (unsigned long) grpc_tls_key_materials_config_set_key_materials); - printf("%lx", (unsigned long) grpc_tls_key_materials_config_set_version); - printf("%lx", (unsigned long) grpc_tls_key_materials_config_get_version); printf("%lx", (unsigned long) grpc_tls_credential_reload_config_create); printf("%lx", (unsigned long) grpc_tls_server_authorization_check_config_create); printf("%lx", (unsigned long) grpc_raw_byte_buffer_create); diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 93aa45e05c4..866d00e34f4 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -296,8 +296,10 @@ TEST_F(CredentialsTest, TlsKeyMaterialsCtoCpp) { EXPECT_STREQ("cert_chain", cpp_pair_list[0].cert_chain.c_str()); } -typedef class ::grpc_impl::experimental::TlsCredentialReloadArg TlsCredentialReloadArg; -typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig TlsCredentialReloadConfig; +typedef class ::grpc_impl::experimental::TlsCredentialReloadArg + TlsCredentialReloadArg; +typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig + TlsCredentialReloadConfig; TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { grpc_tls_credential_reload_arg c_arg; @@ -319,8 +321,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { "cert_chain1"}; struct TlsKeyMaterialsConfig::PemKeyCertPair pair2 = {"private_key2", "cert_chain2"}; - std::vector pair_list = {pair1, - pair2}; + std::vector pair_list = {pair1, pair2}; key_materials_config->set_key_materials("pem_root_certs", pair_list); arg.set_key_materials_config(key_materials_config); arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py index 184a0a9dda6..127d3c1f9bc 100644 --- a/tools/distrib/python/grpcio_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION = '1.24.0.dev0' +VERSION = '1.23.0.dev0' diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 63ee5f0ad20..114d5147eef 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.24.0-dev +PROJECT_NUMBER = 1.23.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -972,7 +972,6 @@ include/grpcpp/impl/codegen/config_protobuf.h \ include/grpcpp/impl/codegen/core_codegen.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ -include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index f1bc3c010e5..0e99b88a4db 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.24.0-dev +PROJECT_NUMBER = 1.23.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -974,7 +974,6 @@ include/grpcpp/impl/codegen/core_codegen.h \ include/grpcpp/impl/codegen/core_codegen.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ -include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -1060,9 +1059,9 @@ include/grpcpp/support/sync_stream.h \ include/grpcpp/support/sync_stream_impl.h \ include/grpcpp/support/time.h \ include/grpcpp/support/validate_service_config.h \ +src/core/ext/filters/client_channel/health/health.pb.c \ +src/core/ext/filters/client_channel/health/health.pb.h \ src/core/ext/transport/inproc/inproc_transport.h \ -src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ -src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h \ src/core/lib/avl/avl.h \ src/core/lib/backoff/backoff.h \ src/core/lib/channel/channel_args.h \ @@ -1295,23 +1294,12 @@ src/cpp/util/status.cc \ src/cpp/util/string_ref.cc \ src/cpp/util/time_cc.cc \ third_party/nanopb/pb.h \ +third_party/nanopb/pb_common.c \ third_party/nanopb/pb_common.h \ +third_party/nanopb/pb_decode.c \ third_party/nanopb/pb_decode.h \ -third_party/nanopb/pb_encode.h \ -third_party/upb/upb/decode.c \ -third_party/upb/upb/decode.h \ -third_party/upb/upb/encode.c \ -third_party/upb/upb/encode.h \ -third_party/upb/upb/generated_util.h \ -third_party/upb/upb/msg.c \ -third_party/upb/upb/msg.h \ -third_party/upb/upb/port.c \ -third_party/upb/upb/port_def.inc \ -third_party/upb/upb/port_undef.inc \ -third_party/upb/upb/table.c \ -third_party/upb/upb/table.int.h \ -third_party/upb/upb/upb.c \ -third_party/upb/upb/upb.h +third_party/nanopb/pb_encode.c \ +third_party/nanopb/pb_encode.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index f4533f240bd..2836412b031 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 8.0.0 +PROJECT_NUMBER = 7.0.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index e2900b2e701..6c1253f7ae8 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 8.0.0 +PROJECT_NUMBER = 7.0.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -889,6 +889,8 @@ src/core/ext/filters/client_channel/connector.cc \ src/core/ext/filters/client_channel/connector.h \ src/core/ext/filters/client_channel/global_subchannel_pool.cc \ src/core/ext/filters/client_channel/global_subchannel_pool.h \ +src/core/ext/filters/client_channel/health/health.pb.c \ +src/core/ext/filters/client_channel/health/health.pb.h \ src/core/ext/filters/client_channel/health/health_check_client.cc \ src/core/ext/filters/client_channel/health/health_check_client.h \ src/core/ext/filters/client_channel/http_connect_handshaker.cc \ @@ -907,6 +909,12 @@ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h \ +src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \ +src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h \ +src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \ +src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h \ +src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ +src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/client_channel/lb_policy/subchannel_list.h \ @@ -952,7 +960,6 @@ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h \ src/core/ext/filters/client_channel/resolver/sockaddr/README.md \ src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \ -src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \ src/core/ext/filters/client_channel/resolver_factory.h \ src/core/ext/filters/client_channel/resolver_registry.cc \ src/core/ext/filters/client_channel/resolver_registry.h \ @@ -1059,76 +1066,6 @@ src/core/ext/transport/chttp2/transport/writing.cc \ src/core/ext/transport/inproc/inproc_plugin.cc \ src/core/ext/transport/inproc/inproc_transport.cc \ src/core/ext/transport/inproc/inproc_transport.h \ -src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h \ -src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/cds.upb.h \ -src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h \ -src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h \ -src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h \ -src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h \ -src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h \ -src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h \ -src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h \ -src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h \ -src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h \ -src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/eds.upb.h \ -src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h \ -src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c \ -src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h \ -src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c \ -src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h \ -src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c \ -src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h \ -src/core/ext/upb-generated/envoy/type/percent.upb.c \ -src/core/ext/upb-generated/envoy/type/percent.upb.h \ -src/core/ext/upb-generated/envoy/type/range.upb.c \ -src/core/ext/upb-generated/envoy/type/range.upb.h \ -src/core/ext/upb-generated/gogoproto/gogo.upb.c \ -src/core/ext/upb-generated/gogoproto/gogo.upb.h \ -src/core/ext/upb-generated/google/api/annotations.upb.c \ -src/core/ext/upb-generated/google/api/annotations.upb.h \ -src/core/ext/upb-generated/google/api/http.upb.c \ -src/core/ext/upb-generated/google/api/http.upb.h \ -src/core/ext/upb-generated/google/protobuf/any.upb.c \ -src/core/ext/upb-generated/google/protobuf/any.upb.h \ -src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ -src/core/ext/upb-generated/google/protobuf/descriptor.upb.h \ -src/core/ext/upb-generated/google/protobuf/duration.upb.c \ -src/core/ext/upb-generated/google/protobuf/duration.upb.h \ -src/core/ext/upb-generated/google/protobuf/empty.upb.c \ -src/core/ext/upb-generated/google/protobuf/empty.upb.h \ -src/core/ext/upb-generated/google/protobuf/struct.upb.c \ -src/core/ext/upb-generated/google/protobuf/struct.upb.h \ -src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ -src/core/ext/upb-generated/google/protobuf/timestamp.upb.h \ -src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ -src/core/ext/upb-generated/google/protobuf/wrappers.upb.h \ -src/core/ext/upb-generated/google/rpc/status.upb.c \ -src/core/ext/upb-generated/google/rpc/status.upb.h \ -src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \ -src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h \ -src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \ -src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h \ -src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c \ -src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h \ -src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ -src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h \ -src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ -src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h \ -src/core/ext/upb-generated/validate/validate.upb.c \ -src/core/ext/upb-generated/validate/validate.upb.h \ src/core/lib/README.md \ src/core/lib/avl/avl.cc \ src/core/lib/avl/avl.h \ @@ -1605,6 +1542,10 @@ src/core/tsi/alts/frame_protector/frame_handler.cc \ src/core/tsi/alts/frame_protector/frame_handler.h \ src/core/tsi/alts/handshaker/alts_handshaker_client.cc \ src/core/tsi/alts/handshaker/alts_handshaker_client.h \ +src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc \ +src/core/tsi/alts/handshaker/alts_handshaker_service_api.h \ +src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc \ +src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h \ src/core/tsi/alts/handshaker/alts_shared_resource.cc \ src/core/tsi/alts/handshaker/alts_shared_resource.h \ src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc \ @@ -1612,6 +1553,12 @@ src/core/tsi/alts/handshaker/alts_tsi_handshaker.h \ src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h \ src/core/tsi/alts/handshaker/alts_tsi_utils.cc \ src/core/tsi/alts/handshaker/alts_tsi_utils.h \ +src/core/tsi/alts/handshaker/altscontext.pb.c \ +src/core/tsi/alts/handshaker/altscontext.pb.h \ +src/core/tsi/alts/handshaker/handshaker.pb.c \ +src/core/tsi/alts/handshaker/handshaker.pb.h \ +src/core/tsi/alts/handshaker/transport_security_common.pb.c \ +src/core/tsi/alts/handshaker/transport_security_common.pb.h \ src/core/tsi/alts/handshaker/transport_security_common_api.cc \ src/core/tsi/alts/handshaker/transport_security_common_api.h \ src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc \ @@ -1643,20 +1590,13 @@ src/core/tsi/transport_security.h \ src/core/tsi/transport_security_grpc.cc \ src/core/tsi/transport_security_grpc.h \ src/core/tsi/transport_security_interface.h \ -third_party/upb/upb/decode.c \ -third_party/upb/upb/decode.h \ -third_party/upb/upb/encode.c \ -third_party/upb/upb/encode.h \ -third_party/upb/upb/generated_util.h \ -third_party/upb/upb/msg.c \ -third_party/upb/upb/msg.h \ -third_party/upb/upb/port.c \ -third_party/upb/upb/port_def.inc \ -third_party/upb/upb/port_undef.inc \ -third_party/upb/upb/table.c \ -third_party/upb/upb/table.int.h \ -third_party/upb/upb/upb.c \ -third_party/upb/upb/upb.h +third_party/nanopb/pb.h \ +third_party/nanopb/pb_common.c \ +third_party/nanopb/pb_common.h \ +third_party/nanopb/pb_decode.c \ +third_party/nanopb/pb_decode.h \ +third_party/nanopb/pb_encode.c \ +third_party/nanopb/pb_encode.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 6dd3f1422e5..f6aac1d8cd0 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -3251,6 +3251,30 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": false, + "language": "c++", + "name": "alts_handshaker_service_api_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": true + }, { "args": [], "benchmark": false, @@ -3903,28 +3927,6 @@ ], "uses_polling": true }, - { - "args": [], - "benchmark": true, - "ci_platforms": [ - "linux", - "mac", - "posix" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": false, - "language": "c++", - "name": "bm_threadpool", - "platforms": [ - "linux", - "mac", - "posix" - ], - "uses_polling": false - }, { "args": [], "benchmark": true, @@ -4521,30 +4523,6 @@ ], "uses_polling": false }, - { - "args": [], - "benchmark": false, - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": true, - "language": "c++", - "name": "delegating_channel_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "uses_polling": true - }, { "args": [], "benchmark": false, @@ -4811,30 +4789,6 @@ ], "uses_polling": true }, - { - "args": [], - "benchmark": false, - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": true, - "language": "c++", - "name": "grpc_spiffe_security_connector_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "uses_polling": true - }, { "args": [], "benchmark": false, From 6189d347247583d22b64336ea152194840600722 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 20 Aug 2019 14:50:35 -0700 Subject: [PATCH 26/70] Revert "Forgot to autogenerate files and run clang_format/tidy_code" This reverts commit 9295e4ebb3ae5698fd6a13c7a1e96b79c19bc123. --- BUILD.gn | 141 +++- CMakeLists.txt | 558 +++++++++----- Makefile | 729 +++++++++++------- build_config.rb | 2 +- config.m4 | 75 +- config.w32 | 92 ++- gRPC-C++.podspec | 73 +- gRPC-Core.podspec | 173 +++-- gRPC-ProtoRPC.podspec | 2 +- gRPC-RxLibrary.podspec | 2 +- gRPC.podspec | 2 +- grpc.def | 2 + grpc.gemspec | 110 ++- grpc.gyp | 204 +++-- .../grpcpp/security/tls_credentials_options.h | 14 +- package.xml | 114 ++- src/core/lib/surface/version.cc | 4 +- .../plugin_registry/grpc_plugin_registry.cc | 4 + .../grpc_unsecure_plugin_registry.cc | 4 + src/cpp/common/tls_credentials_options.cc | 43 +- src/cpp/common/version_cc.cc | 2 +- src/csharp/Grpc.Core.Api/VersionInfo.cs | 6 +- src/csharp/build/dependencies.props | 2 +- src/csharp/build_unitypackage.bat | 2 +- .../!ProtoCompiler-gRPCCppPlugin.podspec | 2 +- .../!ProtoCompiler-gRPCPlugin.podspec | 2 +- src/objective-c/GRPCClient/private/version.h | 2 +- src/objective-c/tests/version.h | 4 +- src/php/composer.json | 2 +- src/php/ext/grpc/version.h | 2 +- src/python/grpcio/grpc/_grpcio_metadata.py | 2 +- src/python/grpcio/grpc_core_dependencies.py | 54 +- src/python/grpcio/grpc_version.py | 2 +- src/python/grpcio_channelz/grpc_version.py | 2 +- .../grpcio_health_checking/grpc_version.py | 2 +- src/python/grpcio_reflection/grpc_version.py | 2 +- src/python/grpcio_status/grpc_version.py | 2 +- src/python/grpcio_testing/grpc_version.py | 2 +- src/python/grpcio_tests/grpc_version.py | 2 +- src/ruby/ext/grpc/rb_grpc_imports.generated.c | 4 + src/ruby/ext/grpc/rb_grpc_imports.generated.h | 6 + src/ruby/lib/grpc/version.rb | 2 +- src/ruby/tools/version.rb | 2 +- .../core/surface/public_headers_must_be_c89.c | 2 + test/cpp/client/credentials_test.cc | 9 +- .../python/grpcio_tools/grpc_version.py | 2 +- tools/doxygen/Doxyfile.c++ | 3 +- tools/doxygen/Doxyfile.c++.internal | 26 +- tools/doxygen/Doxyfile.core | 2 +- tools/doxygen/Doxyfile.core.internal | 112 ++- tools/run_tests/generated/tests.json | 94 ++- 51 files changed, 1881 insertions(+), 827 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 1ae9ebe14fc..9a30d1667e2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -33,25 +33,6 @@ config("grpc_config") { - source_set("health_proto") { - sources = [ - "src/core/ext/filters/client_channel/health/health.pb.c", - "src/core/ext/filters/client_channel/health/health.pb.h", - ] - deps = [ - ":nanopb", - ] - - public_configs = [ - ":grpc_config", - ] - include_dirs = [ - "third_party/nanopb", - ] - } - - - source_set("nanopb") { sources = [ "third_party/nanopb/pb.h", @@ -282,12 +263,6 @@ config("grpc_config") { "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc", "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h", "src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc", "src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc", "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h", @@ -330,6 +305,7 @@ config("grpc_config") { "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc", "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h", "src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc", + "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc", "src/core/ext/filters/client_channel/resolver_factory.h", "src/core/ext/filters/client_channel/resolver_registry.cc", "src/core/ext/filters/client_channel/resolver_registry.h", @@ -429,6 +405,76 @@ config("grpc_config") { "src/core/ext/transport/inproc/inproc_plugin.cc", "src/core/ext/transport/inproc/inproc_transport.cc", "src/core/ext/transport/inproc/inproc_transport.h", + "src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/cds.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/cds.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/eds.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/eds.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h", + "src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c", + "src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h", + "src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c", + "src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h", + "src/core/ext/upb-generated/envoy/type/percent.upb.c", + "src/core/ext/upb-generated/envoy/type/percent.upb.h", + "src/core/ext/upb-generated/envoy/type/range.upb.c", + "src/core/ext/upb-generated/envoy/type/range.upb.h", + "src/core/ext/upb-generated/gogoproto/gogo.upb.c", + "src/core/ext/upb-generated/gogoproto/gogo.upb.h", + "src/core/ext/upb-generated/google/api/annotations.upb.c", + "src/core/ext/upb-generated/google/api/annotations.upb.h", + "src/core/ext/upb-generated/google/api/http.upb.c", + "src/core/ext/upb-generated/google/api/http.upb.h", + "src/core/ext/upb-generated/google/protobuf/any.upb.c", + "src/core/ext/upb-generated/google/protobuf/any.upb.h", + "src/core/ext/upb-generated/google/protobuf/descriptor.upb.c", + "src/core/ext/upb-generated/google/protobuf/descriptor.upb.h", + "src/core/ext/upb-generated/google/protobuf/duration.upb.c", + "src/core/ext/upb-generated/google/protobuf/duration.upb.h", + "src/core/ext/upb-generated/google/protobuf/empty.upb.c", + "src/core/ext/upb-generated/google/protobuf/empty.upb.h", + "src/core/ext/upb-generated/google/protobuf/struct.upb.c", + "src/core/ext/upb-generated/google/protobuf/struct.upb.h", + "src/core/ext/upb-generated/google/protobuf/timestamp.upb.c", + "src/core/ext/upb-generated/google/protobuf/timestamp.upb.h", + "src/core/ext/upb-generated/google/protobuf/wrappers.upb.c", + "src/core/ext/upb-generated/google/protobuf/wrappers.upb.h", + "src/core/ext/upb-generated/google/rpc/status.upb.c", + "src/core/ext/upb-generated/google/rpc/status.upb.h", + "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h", + "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h", + "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h", + "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h", + "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h", + "src/core/ext/upb-generated/validate/validate.upb.c", + "src/core/ext/upb-generated/validate/validate.upb.h", "src/core/lib/avl/avl.cc", "src/core/lib/avl/avl.h", "src/core/lib/backoff/backoff.cc", @@ -826,10 +872,6 @@ config("grpc_config") { "src/core/tsi/alts/frame_protector/frame_handler.h", "src/core/tsi/alts/handshaker/alts_handshaker_client.cc", "src/core/tsi/alts/handshaker/alts_handshaker_client.h", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api.h", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h", "src/core/tsi/alts/handshaker/alts_shared_resource.cc", "src/core/tsi/alts/handshaker/alts_shared_resource.h", "src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc", @@ -837,12 +879,6 @@ config("grpc_config") { "src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h", "src/core/tsi/alts/handshaker/alts_tsi_utils.cc", "src/core/tsi/alts/handshaker/alts_tsi_utils.h", - "src/core/tsi/alts/handshaker/altscontext.pb.c", - "src/core/tsi/alts/handshaker/altscontext.pb.h", - "src/core/tsi/alts/handshaker/handshaker.pb.c", - "src/core/tsi/alts/handshaker/handshaker.pb.h", - "src/core/tsi/alts/handshaker/transport_security_common.pb.c", - "src/core/tsi/alts/handshaker/transport_security_common.pb.h", "src/core/tsi/alts/handshaker/transport_security_common_api.cc", "src/core/tsi/alts/handshaker/transport_security_common_api.h", "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc", @@ -874,6 +910,20 @@ config("grpc_config") { "src/core/tsi/transport_security_grpc.cc", "src/core/tsi/transport_security_grpc.h", "src/core/tsi/transport_security_interface.h", + "third_party/upb/upb/decode.c", + "third_party/upb/upb/decode.h", + "third_party/upb/upb/encode.c", + "third_party/upb/upb/encode.h", + "third_party/upb/upb/generated_util.h", + "third_party/upb/upb/msg.c", + "third_party/upb/upb/msg.h", + "third_party/upb/upb/port.c", + "third_party/upb/upb/port_def.inc", + "third_party/upb/upb/port_undef.inc", + "third_party/upb/upb/table.c", + "third_party/upb/upb/table.int.h", + "third_party/upb/upb/upb.c", + "third_party/upb/upb/upb.h", ] deps = [ "//third_party/boringssl", @@ -881,8 +931,6 @@ config("grpc_config") { ":gpr", "//third_party/cares", ":address_sorting", - ":nanopb", - ":health_proto", ] public_configs = [ @@ -1076,6 +1124,7 @@ config("grpc_config") { "include/grpcpp/impl/codegen/core_codegen.h", "include/grpcpp/impl/codegen/core_codegen_interface.h", "include/grpcpp/impl/codegen/create_auth_context.h", + "include/grpcpp/impl/codegen/delegating_channel.h", "include/grpcpp/impl/codegen/grpc_library.h", "include/grpcpp/impl/codegen/intercepted_channel.h", "include/grpcpp/impl/codegen/interceptor.h", @@ -1162,6 +1211,8 @@ config("grpc_config") { "include/grpcpp/support/time.h", "include/grpcpp/support/validate_service_config.h", "src/core/ext/transport/inproc/inproc_transport.h", + "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h", "src/core/lib/avl/avl.h", "src/core/lib/backoff/backoff.h", "src/core/lib/channel/channel_args.h", @@ -1392,14 +1443,26 @@ config("grpc_config") { "src/cpp/util/status.cc", "src/cpp/util/string_ref.cc", "src/cpp/util/time_cc.cc", + "third_party/upb/upb/decode.c", + "third_party/upb/upb/decode.h", + "third_party/upb/upb/encode.c", + "third_party/upb/upb/encode.h", + "third_party/upb/upb/generated_util.h", + "third_party/upb/upb/msg.c", + "third_party/upb/upb/msg.h", + "third_party/upb/upb/port.c", + "third_party/upb/upb/port_def.inc", + "third_party/upb/upb/port_undef.inc", + "third_party/upb/upb/table.c", + "third_party/upb/upb/table.int.h", + "third_party/upb/upb/upb.c", + "third_party/upb/upb/upb.h", ] deps = [ "//third_party/boringssl", "//third_party/protobuf:protobuf_lite", ":grpc", ":gpr", - ":nanopb", - ":health_proto", ] public_configs = [ diff --git a/CMakeLists.txt b/CMakeLists.txt index e0c20488d13..53e6ad1d2e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 3.5.1) set(PACKAGE_NAME "grpc") -set(PACKAGE_VERSION "1.23.0-dev") +set(PACKAGE_VERSION "1.24.0-dev") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") @@ -238,13 +238,13 @@ add_custom_target(tools_c grpc_create_jwt grpc_print_google_default_creds_token grpc_verify_jwt - gen_hpack_tables - gen_legal_metadata_characters - gen_percent_encoding_tables ) add_custom_target(tools_cxx DEPENDS + gen_hpack_tables + gen_legal_metadata_characters + gen_percent_encoding_tables ) add_custom_target(tools @@ -528,7 +528,6 @@ add_dependencies(buildtests_cxx alts_frame_handler_test) add_dependencies(buildtests_cxx alts_frame_protector_test) add_dependencies(buildtests_cxx alts_grpc_record_protocol_test) add_dependencies(buildtests_cxx alts_handshaker_client_test) -add_dependencies(buildtests_cxx alts_handshaker_service_api_test) add_dependencies(buildtests_cxx alts_iovec_record_protocol_test) add_dependencies(buildtests_cxx alts_security_connector_test) add_dependencies(buildtests_cxx alts_tsi_handshaker_test) @@ -596,6 +595,9 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx bm_pollset) endif() if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) +add_dependencies(buildtests_cxx bm_threadpool) +endif() +if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx bm_timer) endif() add_dependencies(buildtests_cxx byte_stream_test) @@ -625,6 +627,7 @@ add_dependencies(buildtests_cxx cxx_byte_buffer_test) add_dependencies(buildtests_cxx cxx_slice_test) add_dependencies(buildtests_cxx cxx_string_ref_test) add_dependencies(buildtests_cxx cxx_time_test) +add_dependencies(buildtests_cxx delegating_channel_test) add_dependencies(buildtests_cxx end2end_test) add_dependencies(buildtests_cxx error_details_test) add_dependencies(buildtests_cxx exception_test) @@ -638,6 +641,7 @@ add_dependencies(buildtests_cxx grpc_cli) add_dependencies(buildtests_cxx grpc_core_map_test) add_dependencies(buildtests_cxx grpc_fetch_oauth2) add_dependencies(buildtests_cxx grpc_linux_system_roots_test) +add_dependencies(buildtests_cxx grpc_spiffe_security_connector_test) add_dependencies(buildtests_cxx grpc_tool_test) add_dependencies(buildtests_cxx grpclb_api_test) add_dependencies(buildtests_cxx grpclb_end2end_test) @@ -1251,16 +1255,17 @@ add_library(grpc src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc - src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc - src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc src/core/tsi/alts/handshaker/alts_tsi_utils.cc src/core/tsi/alts/handshaker/transport_security_common_api.cc - src/core/tsi/alts/handshaker/altscontext.pb.c - src/core/tsi/alts/handshaker/handshaker.pb.c - src/core/tsi/alts/handshaker/transport_security_common.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c + src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c + src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/core/tsi/transport_security.cc src/core/ext/transport/chttp2/client/insecure/channel_create.cc src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc @@ -1293,7 +1298,7 @@ add_library(grpc src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/filters/client_channel/health/health.pb.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c src/core/tsi/fake_transport_security.cc src/core/tsi/local_transport_security.cc src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc @@ -1312,14 +1317,42 @@ add_library(grpc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc + src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c + src/core/ext/upb-generated/google/api/annotations.upb.c + src/core/ext/upb-generated/google/api/http.upb.c + src/core/ext/upb-generated/google/protobuf/any.upb.c + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c + src/core/ext/upb-generated/google/protobuf/duration.upb.c + src/core/ext/upb-generated/google/protobuf/empty.upb.c + src/core/ext/upb-generated/google/protobuf/struct.upb.c + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c + src/core/ext/upb-generated/google/rpc/status.upb.c src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c src/core/ext/filters/client_channel/lb_policy/xds/xds.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc + src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c + src/core/ext/upb-generated/envoy/api/v2/cds.upb.c + src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c + src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c + src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c + src/core/ext/upb-generated/envoy/api/v2/eds.upb.c + src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c + src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c + src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c + src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c + src/core/ext/upb-generated/envoy/type/percent.upb.c + src/core/ext/upb-generated/envoy/type/range.upb.c + src/core/ext/upb-generated/gogoproto/gogo.upb.c + src/core/ext/upb-generated/validate/validate.upb.c src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -1335,6 +1368,7 @@ add_library(grpc src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc + src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc src/core/ext/filters/census/grpc_context.cc src/core/ext/filters/client_idle/client_idle_filter.cc src/core/ext/filters/max_age/max_age_filter.cc @@ -1666,10 +1700,13 @@ add_library(grpc_cronet src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/filters/client_channel/health/health.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/core/lib/http/httpcli_security_connector.cc src/core/lib/security/context/security_context.cc src/core/lib/security/credentials/alts/alts_credentials.cc @@ -1730,13 +1767,11 @@ add_library(grpc_cronet src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc - src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc - src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc src/core/tsi/alts/handshaker/alts_tsi_utils.cc src/core/tsi/alts/handshaker/transport_security_common_api.cc - src/core/tsi/alts/handshaker/altscontext.pb.c - src/core/tsi/alts/handshaker/handshaker.pb.c - src/core/tsi/alts/handshaker/transport_security_common.pb.c + src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c + src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c + src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c src/core/tsi/transport_security.cc src/core/ext/transport/chttp2/client/insecure/channel_create.cc src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc @@ -2058,10 +2093,13 @@ add_library(grpc_test_util src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/filters/client_channel/health/health.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/core/ext/transport/chttp2/transport/bin_decoder.cc src/core/ext/transport/chttp2/transport/bin_encoder.cc src/core/ext/transport/chttp2/transport/chttp2_plugin.cc @@ -2396,10 +2434,13 @@ add_library(grpc_test_util_unsecure src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/filters/client_channel/health/health.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/core/ext/transport/chttp2/transport/bin_decoder.cc src/core/ext/transport/chttp2/transport/bin_encoder.cc src/core/ext/transport/chttp2/transport/chttp2_plugin.cc @@ -2745,10 +2786,13 @@ add_library(grpc_unsecure src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/filters/client_channel/health/health.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/core/ext/transport/inproc/inproc_plugin.cc src/core/ext/transport/inproc/inproc_transport.cc src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -2765,18 +2809,47 @@ add_library(grpc_unsecure src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc + src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c + src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c + src/core/ext/upb-generated/google/api/annotations.upb.c + src/core/ext/upb-generated/google/api/http.upb.c + src/core/ext/upb-generated/google/protobuf/any.upb.c + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c + src/core/ext/upb-generated/google/protobuf/duration.upb.c + src/core/ext/upb-generated/google/protobuf/empty.upb.c + src/core/ext/upb-generated/google/protobuf/struct.upb.c + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c + src/core/ext/upb-generated/google/rpc/status.upb.c src/core/ext/filters/client_channel/lb_policy/xds/xds.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc + src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c + src/core/ext/upb-generated/envoy/api/v2/cds.upb.c + src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c + src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c + src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c + src/core/ext/upb-generated/envoy/api/v2/eds.upb.c + src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c + src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c + src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c + src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c + src/core/ext/upb-generated/envoy/type/percent.upb.c + src/core/ext/upb-generated/envoy/type/range.upb.c + src/core/ext/upb-generated/gogoproto/gogo.upb.c + src/core/ext/upb-generated/validate/validate.upb.c src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc src/core/ext/filters/census/grpc_context.cc @@ -3140,10 +3213,13 @@ add_library(grpc++ src/cpp/util/status.cc src/cpp/util/string_ref.cc src/cpp/util/time_cc.cc - src/core/ext/filters/client_channel/health/health.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/cpp/codegen/codegen_init.cc ) @@ -3412,6 +3488,7 @@ foreach(_hdr include/grpcpp/impl/codegen/config.h include/grpcpp/impl/codegen/core_codegen_interface.h include/grpcpp/impl/codegen/create_auth_context.h + include/grpcpp/impl/codegen/delegating_channel.h include/grpcpp/impl/codegen/grpc_library.h include/grpcpp/impl/codegen/intercepted_channel.h include/grpcpp/impl/codegen/interceptor.h @@ -3930,6 +4007,7 @@ foreach(_hdr include/grpcpp/impl/codegen/config.h include/grpcpp/impl/codegen/core_codegen_interface.h include/grpcpp/impl/codegen/create_auth_context.h + include/grpcpp/impl/codegen/delegating_channel.h include/grpcpp/impl/codegen/grpc_library.h include/grpcpp/impl/codegen/intercepted_channel.h include/grpcpp/impl/codegen/interceptor.h @@ -4139,6 +4217,7 @@ foreach(_hdr include/grpcpp/impl/codegen/config.h include/grpcpp/impl/codegen/core_codegen_interface.h include/grpcpp/impl/codegen/create_auth_context.h + include/grpcpp/impl/codegen/delegating_channel.h include/grpcpp/impl/codegen/grpc_library.h include/grpcpp/impl/codegen/intercepted_channel.h include/grpcpp/impl/codegen/interceptor.h @@ -4244,10 +4323,13 @@ add_library(grpc++_unsecure src/cpp/util/status.cc src/cpp/util/string_ref.cc src/cpp/util/time_cc.cc - src/core/ext/filters/client_channel/health/health.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/cpp/codegen/codegen_init.cc ) @@ -4516,6 +4598,7 @@ foreach(_hdr include/grpcpp/impl/codegen/config.h include/grpcpp/impl/codegen/core_codegen_interface.h include/grpcpp/impl/codegen/create_auth_context.h + include/grpcpp/impl/codegen/delegating_channel.h include/grpcpp/impl/codegen/grpc_library.h include/grpcpp/impl/codegen/intercepted_channel.h include/grpcpp/impl/codegen/interceptor.h @@ -11182,47 +11265,6 @@ target_link_libraries(alts_handshaker_client_test ) -endif (gRPC_BUILD_TESTS) -if (gRPC_BUILD_TESTS) - -add_executable(alts_handshaker_service_api_test - test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.cc - third_party/googletest/googletest/src/gtest-all.cc - third_party/googletest/googlemock/src/gmock-all.cc -) - - -target_include_directories(alts_handshaker_service_api_test - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_UPB_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} - PRIVATE third_party/googletest/googletest/include - PRIVATE third_party/googletest/googletest - PRIVATE third_party/googletest/googlemock/include - PRIVATE third_party/googletest/googlemock - PRIVATE ${_gRPC_PROTO_GENS_DIR} -) - -target_link_libraries(alts_handshaker_service_api_test - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - alts_test_util - gpr - grpc - ${_gRPC_GFLAGS_LIBRARIES} -) - - endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) @@ -12510,6 +12552,54 @@ target_link_libraries(bm_pollset ) +endif() +endif (gRPC_BUILD_TESTS) +if (gRPC_BUILD_TESTS) +if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) + +add_executable(bm_threadpool + test/cpp/microbenchmarks/bm_threadpool.cc + third_party/googletest/googletest/src/gtest-all.cc + third_party/googletest/googlemock/src/gmock-all.cc +) + + +target_include_directories(bm_threadpool + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE third_party/googletest/googletest/include + PRIVATE third_party/googletest/googletest + PRIVATE third_party/googletest/googlemock/include + PRIVATE third_party/googletest/googlemock + PRIVATE ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(bm_threadpool + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc_benchmark + ${_gRPC_BENCHMARK_LIBRARIES} + grpc++_test_util_unsecure + grpc_test_util_unsecure + grpc++_unsecure + grpc_unsecure + gpr + grpc++_test_config + ${_gRPC_GFLAGS_LIBRARIES} +) + + endif() endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) @@ -13741,6 +13831,49 @@ target_link_libraries(cxx_time_test ) +endif (gRPC_BUILD_TESTS) +if (gRPC_BUILD_TESTS) + +add_executable(delegating_channel_test + test/cpp/end2end/delegating_channel_test.cc + third_party/googletest/googletest/src/gtest-all.cc + third_party/googletest/googlemock/src/gmock-all.cc +) + + +target_include_directories(delegating_channel_test + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE third_party/googletest/googletest/include + PRIVATE third_party/googletest/googletest + PRIVATE third_party/googletest/googlemock/include + PRIVATE third_party/googletest/googlemock + PRIVATE ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(delegating_channel_test + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc++_test_util + grpc_test_util + grpc++ + grpc + gpr + ${_gRPC_GFLAGS_LIBRARIES} +) + + endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) @@ -13919,6 +14052,95 @@ target_link_libraries(filter_end2end_test endif (gRPC_BUILD_TESTS) + +add_executable(gen_hpack_tables + tools/codegen/core/gen_hpack_tables.cc +) + + +target_include_directories(gen_hpack_tables + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(gen_hpack_tables + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + gpr + grpc +) + + + +add_executable(gen_legal_metadata_characters + tools/codegen/core/gen_legal_metadata_characters.cc +) + + +target_include_directories(gen_legal_metadata_characters + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(gen_legal_metadata_characters + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} +) + + + +add_executable(gen_percent_encoding_tables + tools/codegen/core/gen_percent_encoding_tables.cc +) + + +target_include_directories(gen_percent_encoding_tables + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(gen_percent_encoding_tables + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} +) + + if (gRPC_BUILD_TESTS) add_executable(generic_end2end_test @@ -14596,6 +14818,49 @@ endif() endif (gRPC_BUILD_CODEGEN) if (gRPC_BUILD_TESTS) +add_executable(grpc_spiffe_security_connector_test + test/core/security/spiffe_security_connector_test.cc + third_party/googletest/googletest/src/gtest-all.cc + third_party/googletest/googlemock/src/gmock-all.cc +) + + +target_include_directories(grpc_spiffe_security_connector_test + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE third_party/googletest/googletest/include + PRIVATE third_party/googletest/googletest + PRIVATE third_party/googletest/googlemock/include + PRIVATE third_party/googletest/googlemock + PRIVATE ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(grpc_spiffe_security_connector_test + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc_test_util + grpc++_test_util + grpc++ + grpc + gpr + ${_gRPC_GFLAGS_LIBRARIES} +) + + +endif (gRPC_BUILD_TESTS) +if (gRPC_BUILD_TESTS) + add_executable(grpc_tool_test ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc @@ -17548,17 +17813,24 @@ endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) add_executable(xds_end2end_test - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/eds_for_test.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/eds_for_test.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/lrs_for_test.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/lrs_for_test.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.h test/cpp/end2end/xds_end2end_test.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) protobuf_generate_grpc_cpp( - src/proto/grpc/lb/v1/load_balancer.proto + src/proto/grpc/lb/v2/eds_for_test.proto +) +protobuf_generate_grpc_cpp( + src/proto/grpc/lb/v2/lrs_for_test.proto ) target_include_directories(xds_end2end_test @@ -17626,89 +17898,6 @@ target_link_libraries(public_headers_must_be_c89 endif (gRPC_BUILD_TESTS) - -add_executable(gen_hpack_tables - tools/codegen/core/gen_hpack_tables.cc -) - - -target_include_directories(gen_hpack_tables - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_UPB_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} -) - -target_link_libraries(gen_hpack_tables - ${_gRPC_ALLTARGETS_LIBRARIES} - gpr - grpc -) - - - -add_executable(gen_legal_metadata_characters - tools/codegen/core/gen_legal_metadata_characters.cc -) - - -target_include_directories(gen_legal_metadata_characters - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_UPB_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} -) - -target_link_libraries(gen_legal_metadata_characters - ${_gRPC_ALLTARGETS_LIBRARIES} -) - - - -add_executable(gen_percent_encoding_tables - tools/codegen/core/gen_percent_encoding_tables.cc -) - - -target_include_directories(gen_percent_encoding_tables - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_UPB_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} - PRIVATE ${_gRPC_UPB_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} -) - -target_link_libraries(gen_percent_encoding_tables - ${_gRPC_ALLTARGETS_LIBRARIES} -) - - if (gRPC_BUILD_TESTS) add_executable(bad_streaming_id_bad_client_test @@ -17740,7 +17929,6 @@ target_include_directories(bad_streaming_id_bad_client_test ) target_link_libraries(bad_streaming_id_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17783,7 +17971,6 @@ target_include_directories(badreq_bad_client_test ) target_link_libraries(badreq_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17826,7 +18013,6 @@ target_include_directories(connection_prefix_bad_client_test ) target_link_libraries(connection_prefix_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17869,7 +18055,6 @@ target_include_directories(duplicate_header_bad_client_test ) target_link_libraries(duplicate_header_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17912,7 +18097,6 @@ target_include_directories(head_of_line_blocking_bad_client_test ) target_link_libraries(head_of_line_blocking_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17955,7 +18139,6 @@ target_include_directories(headers_bad_client_test ) target_link_libraries(headers_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17998,7 +18181,6 @@ target_include_directories(initial_settings_frame_bad_client_test ) target_link_libraries(initial_settings_frame_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18041,7 +18223,6 @@ target_include_directories(large_metadata_bad_client_test ) target_link_libraries(large_metadata_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18084,7 +18265,6 @@ target_include_directories(out_of_bounds_bad_client_test ) target_link_libraries(out_of_bounds_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18127,7 +18307,6 @@ target_include_directories(server_registered_method_bad_client_test ) target_link_libraries(server_registered_method_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18170,7 +18349,6 @@ target_include_directories(simple_request_bad_client_test ) target_link_libraries(simple_request_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18213,7 +18391,6 @@ target_include_directories(unknown_frame_bad_client_test ) target_link_libraries(unknown_frame_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -18256,7 +18433,6 @@ target_include_directories(window_overflow_bad_client_test ) target_link_libraries(window_overflow_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test diff --git a/Makefile b/Makefile index d512e1cb9c9..d4d61ca335b 100644 --- a/Makefile +++ b/Makefile @@ -348,7 +348,7 @@ CXXFLAGS += -stdlib=libc++ LDFLAGS += -framework CoreFoundation endif CXXFLAGS += -Wnon-virtual-dtor -CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Wno-deprecated-declarations -Ithird_party/nanopb -DPB_FIELD_32BIT +CPPFLAGS += -g -Wall -Wextra -Werror -Wno-unknown-warning-option -Wno-long-long -Wno-unused-parameter -Wno-deprecated-declarations -Wno-sign-conversion -Wno-shadow -Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers -Wno-maybe-uninitialized -DPB_FIELD_32BIT -DOSATOMIC_USE_INLINED=1 -Ithird_party/nanopb -Ithird_party/upb -Isrc/core/ext/upb-generated COREFLAGS += -fno-rtti -fno-exceptions LDFLAGS += -g @@ -454,9 +454,9 @@ E = @echo Q = @ endif -CORE_VERSION = 7.0.0 -CPP_VERSION = 1.23.0-dev -CSHARP_VERSION = 1.23.0-dev +CORE_VERSION = 8.0.0 +CPP_VERSION = 1.24.0-dev +CSHARP_VERSION = 2.24.0-dev CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) @@ -504,9 +504,9 @@ SHARED_EXT_CORE = dll SHARED_EXT_CPP = dll SHARED_EXT_CSHARP = dll SHARED_PREFIX = -SHARED_VERSION_CORE = -7 +SHARED_VERSION_CORE = -8 SHARED_VERSION_CPP = -1 -SHARED_VERSION_CSHARP = -1 +SHARED_VERSION_CSHARP = -2 else ifeq ($(SYSTEM),Darwin) EXECUTABLE_SUFFIX = SHARED_EXT_CORE = dylib @@ -1146,7 +1146,6 @@ alts_frame_handler_test: $(BINDIR)/$(CONFIG)/alts_frame_handler_test alts_frame_protector_test: $(BINDIR)/$(CONFIG)/alts_frame_protector_test alts_grpc_record_protocol_test: $(BINDIR)/$(CONFIG)/alts_grpc_record_protocol_test alts_handshaker_client_test: $(BINDIR)/$(CONFIG)/alts_handshaker_client_test -alts_handshaker_service_api_test: $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test alts_iovec_record_protocol_test: $(BINDIR)/$(CONFIG)/alts_iovec_record_protocol_test alts_security_connector_test: $(BINDIR)/$(CONFIG)/alts_security_connector_test alts_tsi_handshaker_test: $(BINDIR)/$(CONFIG)/alts_tsi_handshaker_test @@ -1175,6 +1174,7 @@ bm_fullstack_trickle: $(BINDIR)/$(CONFIG)/bm_fullstack_trickle bm_fullstack_unary_ping_pong: $(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong bm_metadata: $(BINDIR)/$(CONFIG)/bm_metadata bm_pollset: $(BINDIR)/$(CONFIG)/bm_pollset +bm_threadpool: $(BINDIR)/$(CONFIG)/bm_threadpool bm_timer: $(BINDIR)/$(CONFIG)/bm_timer byte_stream_test: $(BINDIR)/$(CONFIG)/byte_stream_test channel_arguments_test: $(BINDIR)/$(CONFIG)/channel_arguments_test @@ -1201,10 +1201,14 @@ cxx_byte_buffer_test: $(BINDIR)/$(CONFIG)/cxx_byte_buffer_test cxx_slice_test: $(BINDIR)/$(CONFIG)/cxx_slice_test cxx_string_ref_test: $(BINDIR)/$(CONFIG)/cxx_string_ref_test cxx_time_test: $(BINDIR)/$(CONFIG)/cxx_time_test +delegating_channel_test: $(BINDIR)/$(CONFIG)/delegating_channel_test end2end_test: $(BINDIR)/$(CONFIG)/end2end_test error_details_test: $(BINDIR)/$(CONFIG)/error_details_test exception_test: $(BINDIR)/$(CONFIG)/exception_test filter_end2end_test: $(BINDIR)/$(CONFIG)/filter_end2end_test +gen_hpack_tables: $(BINDIR)/$(CONFIG)/gen_hpack_tables +gen_legal_metadata_characters: $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters +gen_percent_encoding_tables: $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables generic_end2end_test: $(BINDIR)/$(CONFIG)/generic_end2end_test global_config_env_test: $(BINDIR)/$(CONFIG)/global_config_env_test global_config_test: $(BINDIR)/$(CONFIG)/global_config_test @@ -1221,6 +1225,7 @@ grpc_objective_c_plugin: $(BINDIR)/$(CONFIG)/grpc_objective_c_plugin grpc_php_plugin: $(BINDIR)/$(CONFIG)/grpc_php_plugin grpc_python_plugin: $(BINDIR)/$(CONFIG)/grpc_python_plugin grpc_ruby_plugin: $(BINDIR)/$(CONFIG)/grpc_ruby_plugin +grpc_spiffe_security_connector_test: $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test grpc_tool_test: $(BINDIR)/$(CONFIG)/grpc_tool_test grpclb_api_test: $(BINDIR)/$(CONFIG)/grpclb_api_test grpclb_end2end_test: $(BINDIR)/$(CONFIG)/grpclb_end2end_test @@ -1287,9 +1292,6 @@ transport_security_common_api_test: $(BINDIR)/$(CONFIG)/transport_security_commo writes_per_rpc_test: $(BINDIR)/$(CONFIG)/writes_per_rpc_test xds_end2end_test: $(BINDIR)/$(CONFIG)/xds_end2end_test public_headers_must_be_c89: $(BINDIR)/$(CONFIG)/public_headers_must_be_c89 -gen_hpack_tables: $(BINDIR)/$(CONFIG)/gen_hpack_tables -gen_legal_metadata_characters: $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters -gen_percent_encoding_tables: $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables boringssl_ssl_test: $(BINDIR)/$(CONFIG)/boringssl_ssl_test boringssl_crypto_test: $(BINDIR)/$(CONFIG)/boringssl_crypto_test bad_streaming_id_bad_client_test: $(BINDIR)/$(CONFIG)/bad_streaming_id_bad_client_test @@ -1408,7 +1410,7 @@ plugins: $(PROTOC_PLUGINS) privatelibs: privatelibs_c privatelibs_cxx -privatelibs_c: $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libcxxabi.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libupb.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libares.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a +privatelibs_c: $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libcxxabi.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libares.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc pc_c_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc @@ -1625,7 +1627,6 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/alts_frame_protector_test \ $(BINDIR)/$(CONFIG)/alts_grpc_record_protocol_test \ $(BINDIR)/$(CONFIG)/alts_handshaker_client_test \ - $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test \ $(BINDIR)/$(CONFIG)/alts_iovec_record_protocol_test \ $(BINDIR)/$(CONFIG)/alts_security_connector_test \ $(BINDIR)/$(CONFIG)/alts_tsi_handshaker_test \ @@ -1654,6 +1655,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong \ $(BINDIR)/$(CONFIG)/bm_metadata \ $(BINDIR)/$(CONFIG)/bm_pollset \ + $(BINDIR)/$(CONFIG)/bm_threadpool \ $(BINDIR)/$(CONFIG)/bm_timer \ $(BINDIR)/$(CONFIG)/byte_stream_test \ $(BINDIR)/$(CONFIG)/channel_arguments_test \ @@ -1680,6 +1682,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/cxx_slice_test \ $(BINDIR)/$(CONFIG)/cxx_string_ref_test \ $(BINDIR)/$(CONFIG)/cxx_time_test \ + $(BINDIR)/$(CONFIG)/delegating_channel_test \ $(BINDIR)/$(CONFIG)/end2end_test \ $(BINDIR)/$(CONFIG)/error_details_test \ $(BINDIR)/$(CONFIG)/exception_test \ @@ -1693,6 +1696,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/grpc_core_map_test \ $(BINDIR)/$(CONFIG)/grpc_fetch_oauth2 \ $(BINDIR)/$(CONFIG)/grpc_linux_system_roots_test \ + $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test \ $(BINDIR)/$(CONFIG)/grpc_tool_test \ $(BINDIR)/$(CONFIG)/grpclb_api_test \ $(BINDIR)/$(CONFIG)/grpclb_end2end_test \ @@ -1791,7 +1795,6 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/alts_frame_protector_test \ $(BINDIR)/$(CONFIG)/alts_grpc_record_protocol_test \ $(BINDIR)/$(CONFIG)/alts_handshaker_client_test \ - $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test \ $(BINDIR)/$(CONFIG)/alts_iovec_record_protocol_test \ $(BINDIR)/$(CONFIG)/alts_security_connector_test \ $(BINDIR)/$(CONFIG)/alts_tsi_handshaker_test \ @@ -1820,6 +1823,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong \ $(BINDIR)/$(CONFIG)/bm_metadata \ $(BINDIR)/$(CONFIG)/bm_pollset \ + $(BINDIR)/$(CONFIG)/bm_threadpool \ $(BINDIR)/$(CONFIG)/bm_timer \ $(BINDIR)/$(CONFIG)/byte_stream_test \ $(BINDIR)/$(CONFIG)/channel_arguments_test \ @@ -1846,6 +1850,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/cxx_slice_test \ $(BINDIR)/$(CONFIG)/cxx_string_ref_test \ $(BINDIR)/$(CONFIG)/cxx_time_test \ + $(BINDIR)/$(CONFIG)/delegating_channel_test \ $(BINDIR)/$(CONFIG)/end2end_test \ $(BINDIR)/$(CONFIG)/error_details_test \ $(BINDIR)/$(CONFIG)/exception_test \ @@ -1859,6 +1864,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/grpc_core_map_test \ $(BINDIR)/$(CONFIG)/grpc_fetch_oauth2 \ $(BINDIR)/$(CONFIG)/grpc_linux_system_roots_test \ + $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test \ $(BINDIR)/$(CONFIG)/grpc_tool_test \ $(BINDIR)/$(CONFIG)/grpclb_api_test \ $(BINDIR)/$(CONFIG)/grpclb_end2end_test \ @@ -2235,8 +2241,6 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/alts_grpc_record_protocol_test || ( echo test alts_grpc_record_protocol_test failed ; exit 1 ) $(E) "[RUN] Testing alts_handshaker_client_test" $(Q) $(BINDIR)/$(CONFIG)/alts_handshaker_client_test || ( echo test alts_handshaker_client_test failed ; exit 1 ) - $(E) "[RUN] Testing alts_handshaker_service_api_test" - $(Q) $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test || ( echo test alts_handshaker_service_api_test failed ; exit 1 ) $(E) "[RUN] Testing alts_iovec_record_protocol_test" $(Q) $(BINDIR)/$(CONFIG)/alts_iovec_record_protocol_test || ( echo test alts_iovec_record_protocol_test failed ; exit 1 ) $(E) "[RUN] Testing alts_security_connector_test" @@ -2293,6 +2297,8 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/bm_metadata || ( echo test bm_metadata failed ; exit 1 ) $(E) "[RUN] Testing bm_pollset" $(Q) $(BINDIR)/$(CONFIG)/bm_pollset || ( echo test bm_pollset failed ; exit 1 ) + $(E) "[RUN] Testing bm_threadpool" + $(Q) $(BINDIR)/$(CONFIG)/bm_threadpool || ( echo test bm_threadpool failed ; exit 1 ) $(E) "[RUN] Testing bm_timer" $(Q) $(BINDIR)/$(CONFIG)/bm_timer || ( echo test bm_timer failed ; exit 1 ) $(E) "[RUN] Testing byte_stream_test" @@ -2343,6 +2349,8 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/cxx_string_ref_test || ( echo test cxx_string_ref_test failed ; exit 1 ) $(E) "[RUN] Testing cxx_time_test" $(Q) $(BINDIR)/$(CONFIG)/cxx_time_test || ( echo test cxx_time_test failed ; exit 1 ) + $(E) "[RUN] Testing delegating_channel_test" + $(Q) $(BINDIR)/$(CONFIG)/delegating_channel_test || ( echo test delegating_channel_test failed ; exit 1 ) $(E) "[RUN] Testing end2end_test" $(Q) $(BINDIR)/$(CONFIG)/end2end_test || ( echo test end2end_test failed ; exit 1 ) $(E) "[RUN] Testing error_details_test" @@ -2365,6 +2373,8 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/grpc_core_map_test || ( echo test grpc_core_map_test failed ; exit 1 ) $(E) "[RUN] Testing grpc_linux_system_roots_test" $(Q) $(BINDIR)/$(CONFIG)/grpc_linux_system_roots_test || ( echo test grpc_linux_system_roots_test failed ; exit 1 ) + $(E) "[RUN] Testing grpc_spiffe_security_connector_test" + $(Q) $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test || ( echo test grpc_spiffe_security_connector_test failed ; exit 1 ) $(E) "[RUN] Testing grpc_tool_test" $(Q) $(BINDIR)/$(CONFIG)/grpc_tool_test || ( echo test grpc_tool_test failed ; exit 1 ) $(E) "[RUN] Testing grpclb_api_test" @@ -2520,9 +2530,9 @@ test_python: static_c tools: tools_c tools_cxx -tools_c: privatelibs_c $(BINDIR)/$(CONFIG)/check_epollexclusive $(BINDIR)/$(CONFIG)/grpc_create_jwt $(BINDIR)/$(CONFIG)/grpc_print_google_default_creds_token $(BINDIR)/$(CONFIG)/grpc_verify_jwt $(BINDIR)/$(CONFIG)/gen_hpack_tables $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables +tools_c: privatelibs_c $(BINDIR)/$(CONFIG)/check_epollexclusive $(BINDIR)/$(CONFIG)/grpc_create_jwt $(BINDIR)/$(CONFIG)/grpc_print_google_default_creds_token $(BINDIR)/$(CONFIG)/grpc_verify_jwt -tools_cxx: privatelibs_cxx +tools_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/gen_hpack_tables $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables buildbenchmarks: privatelibs $(BINDIR)/$(CONFIG)/low_level_ping_pong_benchmark @@ -2694,6 +2704,38 @@ $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc: src/proto/grpc/lb/v1/lo $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< endif +ifeq ($(NO_PROTOC),true) +$(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc: protoc_dep_error +$(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc: protoc_dep_error +else + +$(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc: src/proto/grpc/lb/v2/eds_for_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) + $(E) "[PROTOC] Generating protobuf CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --cpp_out=$(GENDIR) $< + +$(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc: src/proto/grpc/lb/v2/eds_for_test.proto $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc $(PROTOBUF_DEP) $(PROTOC_PLUGINS) + $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< +endif + +ifeq ($(NO_PROTOC),true) +$(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc: protoc_dep_error +$(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc: protoc_dep_error +else + +$(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc: src/proto/grpc/lb/v2/lrs_for_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc + $(E) "[PROTOC] Generating protobuf CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --cpp_out=$(GENDIR) $< + +$(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc: src/proto/grpc/lb/v2/lrs_for_test.proto $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc + $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< +endif + ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc: protoc_dep_error @@ -3083,7 +3125,7 @@ install-shared_c: shared_c strip-shared_c install-pkg-config_c ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libaddress_sorting.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libaddress_sorting.so.7 + $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libaddress_sorting.so.8 $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libaddress_sorting.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -3092,7 +3134,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgpr.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.7 + $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.8 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -3101,7 +3143,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.7 + $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.8 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -3110,7 +3152,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_cronet.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.7 + $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.8 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -3119,7 +3161,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_unsecure.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.7 + $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.8 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so endif ifneq ($(SYSTEM),MINGW32) @@ -3189,7 +3231,7 @@ install-shared_csharp: shared_csharp strip-shared_csharp ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP)-dll.a $(prefix)/lib/libgrpc_csharp_ext.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.1 + $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so endif ifneq ($(SYSTEM),MINGW32) @@ -3280,8 +3322,8 @@ $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libaddress_sorting.so.7 -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so.7 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libaddress_sorting.so.8 -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so.8 $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so endif endif @@ -3476,8 +3518,8 @@ $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGPR_OB ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.7 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.7 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.8 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.8 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so endif endif @@ -3736,16 +3778,17 @@ LIBGRPC_SRC = \ src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc \ - src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc \ - src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc \ src/core/tsi/alts/handshaker/alts_tsi_utils.cc \ src/core/tsi/alts/handshaker/transport_security_common_api.cc \ - src/core/tsi/alts/handshaker/altscontext.pb.c \ - src/core/tsi/alts/handshaker/handshaker.pb.c \ - src/core/tsi/alts/handshaker/transport_security_common.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/core/tsi/transport_security.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ @@ -3778,7 +3821,7 @@ LIBGRPC_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ src/core/tsi/fake_transport_security.cc \ src/core/tsi/local_transport_security.cc \ src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc \ @@ -3797,14 +3840,42 @@ LIBGRPC_SRC = \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ + src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ + src/core/ext/upb-generated/google/api/annotations.upb.c \ + src/core/ext/upb-generated/google/api/http.upb.c \ + src/core/ext/upb-generated/google/protobuf/any.upb.c \ + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ + src/core/ext/upb-generated/google/protobuf/duration.upb.c \ + src/core/ext/upb-generated/google/protobuf/empty.upb.c \ + src/core/ext/upb-generated/google/protobuf/struct.upb.c \ + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ + src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc \ + src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c \ + src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c \ + src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ + src/core/ext/upb-generated/envoy/type/percent.upb.c \ + src/core/ext/upb-generated/envoy/type/range.upb.c \ + src/core/ext/upb-generated/gogoproto/gogo.upb.c \ + src/core/ext/upb-generated/validate/validate.upb.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ @@ -3820,6 +3891,7 @@ LIBGRPC_SRC = \ src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \ src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \ src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \ + src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \ src/core/ext/filters/census/grpc_context.cc \ src/core/ext/filters/client_idle/client_idle_filter.cc \ src/core/ext/filters/max_age/max_age_filter.cc \ @@ -3904,8 +3976,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGRPC_ ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.7 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.7 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.8 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.8 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so endif endif @@ -4139,10 +4211,13 @@ LIBGRPC_CRONET_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/core/lib/http/httpcli_security_connector.cc \ src/core/lib/security/context/security_context.cc \ src/core/lib/security/credentials/alts/alts_credentials.cc \ @@ -4203,13 +4278,11 @@ LIBGRPC_CRONET_SRC = \ src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc \ - src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc \ - src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc \ src/core/tsi/alts/handshaker/alts_tsi_utils.cc \ src/core/tsi/alts/handshaker/transport_security_common_api.cc \ - src/core/tsi/alts/handshaker/altscontext.pb.c \ - src/core/tsi/alts/handshaker/handshaker.pb.c \ - src/core/tsi/alts/handshaker/transport_security_common.pb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c \ src/core/tsi/transport_security.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ @@ -4287,8 +4360,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(L ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.7 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.7 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.8 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.8 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so endif endif @@ -4518,10 +4591,13 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/core/ext/transport/chttp2/transport/bin_decoder.cc \ src/core/ext/transport/chttp2/transport/bin_encoder.cc \ src/core/ext/transport/chttp2/transport/chttp2_plugin.cc \ @@ -4837,10 +4913,13 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/core/ext/transport/chttp2/transport/bin_decoder.cc \ src/core/ext/transport/chttp2/transport/bin_encoder.cc \ src/core/ext/transport/chttp2/transport/chttp2_plugin.cc \ @@ -5154,10 +5233,13 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/core/ext/transport/inproc/inproc_plugin.cc \ src/core/ext/transport/inproc/inproc_transport.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ @@ -5174,18 +5256,47 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \ src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ + src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ + src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ + src/core/ext/upb-generated/google/api/annotations.upb.c \ + src/core/ext/upb-generated/google/api/http.upb.c \ + src/core/ext/upb-generated/google/protobuf/any.upb.c \ + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ + src/core/ext/upb-generated/google/protobuf/duration.upb.c \ + src/core/ext/upb-generated/google/protobuf/empty.upb.c \ + src/core/ext/upb-generated/google/protobuf/struct.upb.c \ + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ + src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc \ + src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c \ + src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c \ + src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ + src/core/ext/upb-generated/envoy/type/percent.upb.c \ + src/core/ext/upb-generated/envoy/type/range.upb.c \ + src/core/ext/upb-generated/gogoproto/gogo.upb.c \ + src/core/ext/upb-generated/validate/validate.upb.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/census/grpc_context.cc \ @@ -5260,8 +5371,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $ ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.7 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.7 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.8 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.8 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so endif endif @@ -5495,10 +5606,13 @@ LIBGRPC++_SRC = \ src/cpp/util/status.cc \ src/cpp/util/string_ref.cc \ src/cpp/util/time_cc.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/cpp/codegen/codegen_init.cc \ PUBLIC_HEADERS_CXX += \ @@ -5729,6 +5843,7 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/impl/codegen/config.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ + include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -6199,6 +6314,7 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/impl/codegen/config.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ + include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -6376,6 +6492,7 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/impl/codegen/config.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ + include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -6521,10 +6638,13 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/util/status.cc \ src/cpp/util/string_ref.cc \ src/cpp/util/time_cc.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/cpp/codegen/codegen_init.cc \ PUBLIC_HEADERS_CXX += \ @@ -6756,6 +6876,7 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/impl/codegen/config.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ + include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -7495,8 +7616,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHA ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.1 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so.1 + $(Q) $(LD) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so endif endif @@ -7887,41 +8008,6 @@ ifneq ($(NO_DEPS),true) endif -LIBUPB_SRC = \ - third_party/upb/generated_for_cmake/google/protobuf/descriptor.upb.c \ - third_party/upb/upb/decode.c \ - third_party/upb/upb/def.c \ - third_party/upb/upb/encode.c \ - third_party/upb/upb/handlers.c \ - third_party/upb/upb/msg.c \ - third_party/upb/upb/msgfactory.c \ - third_party/upb/upb/sink.c \ - third_party/upb/upb/table.c \ - third_party/upb/upb/upb.c \ - -PUBLIC_HEADERS_C += \ - -LIBUPB_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBUPB_SRC)))) - -$(LIBUPB_OBJS): CFLAGS += -Wno-sign-conversion -Wno-shadow -Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers - -$(LIBDIR)/$(CONFIG)/libupb.a: $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(LIBUPB_OBJS) - $(E) "[AR] Creating $@" - $(Q) mkdir -p `dirname $@` - $(Q) rm -f $(LIBDIR)/$(CONFIG)/libupb.a - $(Q) $(AR) $(AROPTS) $(LIBDIR)/$(CONFIG)/libupb.a $(LIBUPB_OBJS) -ifeq ($(SYSTEM),Darwin) - $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libupb.a -endif - - - - -ifneq ($(NO_DEPS),true) --include $(LIBUPB_OBJS:.o=.dep) -endif - - LIBZ_SRC = \ third_party/zlib/adler32.c \ third_party/zlib/compress.c \ @@ -13583,49 +13669,6 @@ endif endif -ALTS_HANDSHAKER_SERVICE_API_TEST_SRC = \ - test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.cc \ - -ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ALTS_HANDSHAKER_SERVICE_API_TEST_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test: openssl_dep_error - -else - - - - -ifeq ($(NO_PROTOBUF),true) - -# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. - -$(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test: protobuf_dep_error - -else - -$(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test: $(PROTOBUF_DEP) $(ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test - -endif - -endif - -$(OBJDIR)/$(CONFIG)/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.o: $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a - -deps_alts_handshaker_service_api_test: $(ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS:.o=.dep) -endif -endif - - ALTS_IOVEC_RECORD_PROTOCOL_TEST_SRC = \ test/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol_test.cc \ @@ -14849,6 +14892,50 @@ endif endif +BM_THREADPOOL_SRC = \ + test/cpp/microbenchmarks/bm_threadpool.cc \ + +BM_THREADPOOL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BM_THREADPOOL_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/bm_threadpool: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. + +$(BINDIR)/$(CONFIG)/bm_threadpool: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/bm_threadpool: $(PROTOBUF_DEP) $(BM_THREADPOOL_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(BM_THREADPOOL_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_threadpool + +endif + +endif + +$(BM_THREADPOOL_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_threadpool.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a + +deps_bm_threadpool: $(BM_THREADPOOL_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(BM_THREADPOOL_OBJS:.o=.dep) +endif +endif + + BM_TIMER_SRC = \ test/cpp/microbenchmarks/bm_timer.cc \ @@ -16038,6 +16125,49 @@ endif endif +DELEGATING_CHANNEL_TEST_SRC = \ + test/cpp/end2end/delegating_channel_test.cc \ + +DELEGATING_CHANNEL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(DELEGATING_CHANNEL_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/delegating_channel_test: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. + +$(BINDIR)/$(CONFIG)/delegating_channel_test: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/delegating_channel_test: $(PROTOBUF_DEP) $(DELEGATING_CHANNEL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(DELEGATING_CHANNEL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/delegating_channel_test + +endif + +endif + +$(OBJDIR)/$(CONFIG)/test/cpp/end2end/delegating_channel_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_delegating_channel_test: $(DELEGATING_CHANNEL_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(DELEGATING_CHANNEL_TEST_OBJS:.o=.dep) +endif +endif + + END2END_TEST_SRC = \ test/cpp/end2end/end2end_test.cc \ test/cpp/end2end/interceptors_util.cc \ @@ -16217,6 +16347,135 @@ endif endif +GEN_HPACK_TABLES_SRC = \ + tools/codegen/core/gen_hpack_tables.cc \ + +GEN_HPACK_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_HPACK_TABLES_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/gen_hpack_tables: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. + +$(BINDIR)/$(CONFIG)/gen_hpack_tables: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/gen_hpack_tables: $(PROTOBUF_DEP) $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_hpack_tables + +endif + +endif + +$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_hpack_tables.o: $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a + +deps_gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(GEN_HPACK_TABLES_OBJS:.o=.dep) +endif +endif + + +GEN_LEGAL_METADATA_CHARACTERS_SRC = \ + tools/codegen/core/gen_legal_metadata_characters.cc \ + +GEN_LEGAL_METADATA_CHARACTERS_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_LEGAL_METADATA_CHARACTERS_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. + +$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: $(PROTOBUF_DEP) $(GEN_LEGAL_METADATA_CHARACTERS_OBJS) + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(GEN_LEGAL_METADATA_CHARACTERS_OBJS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters + +endif + +endif + +$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_legal_metadata_characters.o: + +deps_gen_legal_metadata_characters: $(GEN_LEGAL_METADATA_CHARACTERS_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(GEN_LEGAL_METADATA_CHARACTERS_OBJS:.o=.dep) +endif +endif + + +GEN_PERCENT_ENCODING_TABLES_SRC = \ + tools/codegen/core/gen_percent_encoding_tables.cc \ + +GEN_PERCENT_ENCODING_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_PERCENT_ENCODING_TABLES_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. + +$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: $(PROTOBUF_DEP) $(GEN_PERCENT_ENCODING_TABLES_OBJS) + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(GEN_PERCENT_ENCODING_TABLES_OBJS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables + +endif + +endif + +$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_percent_encoding_tables.o: + +deps_gen_percent_encoding_tables: $(GEN_PERCENT_ENCODING_TABLES_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(GEN_PERCENT_ENCODING_TABLES_OBJS:.o=.dep) +endif +endif + + GENERIC_END2END_TEST_SRC = \ test/cpp/end2end/generic_end2end_test.cc \ @@ -16825,6 +17084,49 @@ ifneq ($(NO_DEPS),true) endif +GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_SRC = \ + test/core/security/spiffe_security_connector_test.cc \ + +GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. + +$(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test: $(PROTOBUF_DEP) $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test + +endif + +endif + +$(OBJDIR)/$(CONFIG)/test/core/security/spiffe_security_connector_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_grpc_spiffe_security_connector_test: $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS:.o=.dep) +endif +endif + + GRPC_TOOL_TEST_SRC = \ $(GENDIR)/src/proto/grpc/testing/echo.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc \ @@ -19641,7 +19943,8 @@ endif XDS_END2END_TEST_SRC = \ - $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.pb.cc $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc \ test/cpp/end2end/xds_end2end_test.cc \ XDS_END2END_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(XDS_END2END_TEST_SRC)))) @@ -19673,7 +19976,9 @@ endif endif -$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v1/load_balancer.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v2/eds_for_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + +$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v2/lrs_for_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/end2end/xds_end2end_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a @@ -19684,7 +19989,7 @@ ifneq ($(NO_DEPS),true) -include $(XDS_END2END_TEST_OBJS:.o=.dep) endif endif -$(OBJDIR)/$(CONFIG)/test/cpp/end2end/xds_end2end_test.o: $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.pb.cc $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/end2end/xds_end2end_test.o: $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc PUBLIC_HEADERS_MUST_BE_C89_SRC = \ @@ -19723,102 +20028,6 @@ endif endif -GEN_HPACK_TABLES_SRC = \ - tools/codegen/core/gen_hpack_tables.cc \ - -GEN_HPACK_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_HPACK_TABLES_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/gen_hpack_tables: openssl_dep_error - -else - - - -$(BINDIR)/$(CONFIG)/gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LD) $(LDFLAGS) $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_hpack_tables - -endif - -$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_hpack_tables.o: $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a - -deps_gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(GEN_HPACK_TABLES_OBJS:.o=.dep) -endif -endif - - -GEN_LEGAL_METADATA_CHARACTERS_SRC = \ - tools/codegen/core/gen_legal_metadata_characters.cc \ - -GEN_LEGAL_METADATA_CHARACTERS_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_LEGAL_METADATA_CHARACTERS_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: openssl_dep_error - -else - - - -$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: $(GEN_LEGAL_METADATA_CHARACTERS_OBJS) - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LD) $(LDFLAGS) $(GEN_LEGAL_METADATA_CHARACTERS_OBJS) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters - -endif - -$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_legal_metadata_characters.o: - -deps_gen_legal_metadata_characters: $(GEN_LEGAL_METADATA_CHARACTERS_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(GEN_LEGAL_METADATA_CHARACTERS_OBJS:.o=.dep) -endif -endif - - -GEN_PERCENT_ENCODING_TABLES_SRC = \ - tools/codegen/core/gen_percent_encoding_tables.cc \ - -GEN_PERCENT_ENCODING_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_PERCENT_ENCODING_TABLES_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: openssl_dep_error - -else - - - -$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: $(GEN_PERCENT_ENCODING_TABLES_OBJS) - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LD) $(LDFLAGS) $(GEN_PERCENT_ENCODING_TABLES_OBJS) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables - -endif - -$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_percent_encoding_tables.o: - -deps_gen_percent_encoding_tables: $(GEN_PERCENT_ENCODING_TABLES_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(GEN_PERCENT_ENCODING_TABLES_OBJS:.o=.dep) -endif -endif - - BORINGSSL_SSL_TEST_SRC = \ third_party/boringssl/crypto/test/gtest_main.cc \ third_party/boringssl/ssl/span_test.cc \ @@ -22319,6 +22528,9 @@ src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc: $(OPENSSL_ src/core/ext/transport/cronet/plugin_registry/grpc_cronet_plugin_registry.cc: $(OPENSSL_DEP) src/core/ext/transport/cronet/transport/cronet_api_dummy.cc: $(OPENSSL_DEP) src/core/ext/transport/cronet/transport/cronet_transport.cc: $(OPENSSL_DEP) +src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c: $(OPENSSL_DEP) +src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c: $(OPENSSL_DEP) +src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c: $(OPENSSL_DEP) src/core/lib/http/httpcli_security_connector.cc: $(OPENSSL_DEP) src/core/lib/security/context/security_context.cc: $(OPENSSL_DEP) src/core/lib/security/credentials/alts/alts_credentials.cc: $(OPENSSL_DEP) @@ -22373,14 +22585,9 @@ src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc: $(OPEN src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc: $(OPENSSL_DEP) src/core/tsi/alts/frame_protector/frame_handler.cc: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/alts_handshaker_client.cc: $(OPENSSL_DEP) -src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc: $(OPENSSL_DEP) -src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/alts_shared_resource.cc: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/alts_tsi_utils.cc: $(OPENSSL_DEP) -src/core/tsi/alts/handshaker/altscontext.pb.c: $(OPENSSL_DEP) -src/core/tsi/alts/handshaker/handshaker.pb.c: $(OPENSSL_DEP) -src/core/tsi/alts/handshaker/transport_security_common.pb.c: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/transport_security_common_api.cc: $(OPENSSL_DEP) src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc: $(OPENSSL_DEP) src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc: $(OPENSSL_DEP) diff --git a/build_config.rb b/build_config.rb index ab06a137473..7bd312cd2b6 100644 --- a/build_config.rb +++ b/build_config.rb @@ -13,5 +13,5 @@ # limitations under the License. module GrpcBuildConfig - CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-7.dll' + CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-8.dll' end diff --git a/config.m4 b/config.m4 index 71f4a323091..2a074768f57 100644 --- a/config.m4 +++ b/config.m4 @@ -334,16 +334,17 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc \ - src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc \ - src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc \ src/core/tsi/alts/handshaker/alts_tsi_utils.cc \ src/core/tsi/alts/handshaker/transport_security_common_api.cc \ - src/core/tsi/alts/handshaker/altscontext.pb.c \ - src/core/tsi/alts/handshaker/handshaker.pb.c \ - src/core/tsi/alts/handshaker/transport_security_common.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/core/tsi/transport_security.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ @@ -376,7 +377,7 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ src/core/tsi/fake_transport_security.cc \ src/core/tsi/local_transport_security.cc \ src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc \ @@ -395,14 +396,42 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ + src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ + src/core/ext/upb-generated/google/api/annotations.upb.c \ + src/core/ext/upb-generated/google/api/http.upb.c \ + src/core/ext/upb-generated/google/protobuf/any.upb.c \ + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ + src/core/ext/upb-generated/google/protobuf/duration.upb.c \ + src/core/ext/upb-generated/google/protobuf/empty.upb.c \ + src/core/ext/upb-generated/google/protobuf/struct.upb.c \ + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ + src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc \ + src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c \ + src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c \ + src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ + src/core/ext/upb-generated/envoy/type/percent.upb.c \ + src/core/ext/upb-generated/envoy/type/range.upb.c \ + src/core/ext/upb-generated/gogoproto/gogo.upb.c \ + src/core/ext/upb-generated/validate/validate.upb.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ @@ -418,6 +447,7 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \ src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \ src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \ + src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \ src/core/ext/filters/census/grpc_context.cc \ src/core/ext/filters/client_idle/client_idle_filter.cc \ src/core/ext/filters/max_age/max_age_filter.cc \ @@ -695,8 +725,6 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/health) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/pick_first) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/round_robin) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/xds) @@ -705,6 +733,7 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/native) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/fake) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/sockaddr) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/xds) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_idle) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/deadline) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http) @@ -723,6 +752,22 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/server/secure) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/transport) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/inproc) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2/auth) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2/cluster) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2/core) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2/endpoint) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/discovery/v2) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/load_stats/v2) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/type) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/gogoproto) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/google/api) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/google/protobuf) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/google/rpc) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/gcp) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/health/v1) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/lb/v1) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/validate) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/avl) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/backoff) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/channel) @@ -806,5 +851,5 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/x509v3) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/ssl) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/third_party/fiat) - PHP_ADD_BUILD_DIR($ext_builddir/third_party/nanopb) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb) fi diff --git a/config.w32 b/config.w32 index 3d8e30e5ad5..065da74bfb9 100644 --- a/config.w32 +++ b/config.w32 @@ -307,16 +307,17 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\security\\credentials\\alts\\grpc_alts_credentials_client_options.cc " + "src\\core\\lib\\security\\credentials\\alts\\grpc_alts_credentials_options.cc " + "src\\core\\lib\\security\\credentials\\alts\\grpc_alts_credentials_server_options.cc " + - "src\\core\\tsi\\alts\\handshaker\\alts_handshaker_service_api.cc " + - "src\\core\\tsi\\alts\\handshaker\\alts_handshaker_service_api_util.cc " + "src\\core\\tsi\\alts\\handshaker\\alts_tsi_utils.cc " + "src\\core\\tsi\\alts\\handshaker\\transport_security_common_api.cc " + - "src\\core\\tsi\\alts\\handshaker\\altscontext.pb.c " + - "src\\core\\tsi\\alts\\handshaker\\handshaker.pb.c " + - "src\\core\\tsi\\alts\\handshaker\\transport_security_common.pb.c " + - "third_party\\nanopb\\pb_common.c " + - "third_party\\nanopb\\pb_decode.c " + - "third_party\\nanopb\\pb_encode.c " + + "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp\\altscontext.upb.c " + + "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp\\handshaker.upb.c " + + "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp\\transport_security_common.upb.c " + + "third_party\\upb\\upb\\decode.c " + + "third_party\\upb\\upb\\encode.c " + + "third_party\\upb\\upb\\msg.c " + + "third_party\\upb\\upb\\port.c " + + "third_party\\upb\\upb\\table.c " + + "third_party\\upb\\upb\\upb.c " + "src\\core\\tsi\\transport_security.cc " + "src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create.cc " + "src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create_posix.cc " + @@ -349,7 +350,7 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\filters\\client_channel\\subchannel.cc " + "src\\core\\ext\\filters\\client_channel\\subchannel_pool_interface.cc " + "src\\core\\ext\\filters\\deadline\\deadline_filter.cc " + - "src\\core\\ext\\filters\\client_channel\\health\\health.pb.c " + + "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health\\v1\\health.upb.c " + "src\\core\\tsi\\fake_transport_security.cc " + "src\\core\\tsi\\local_transport_security.cc " + "src\\core\\tsi\\ssl\\session_cache\\ssl_session_boringssl.cc " + @@ -368,14 +369,42 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\grpclb_channel_secure.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\grpclb_client_stats.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\load_balancer_api.cc " + + "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb\\v1\\load_balancer.upb.c " + + "src\\core\\ext\\upb-generated\\google\\api\\annotations.upb.c " + + "src\\core\\ext\\upb-generated\\google\\api\\http.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\any.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\descriptor.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\duration.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\empty.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\struct.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\timestamp.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\wrappers.upb.c " + + "src\\core\\ext\\upb-generated\\google\\rpc\\status.upb.c " + "src\\core\\ext\\filters\\client_channel\\resolver\\fake\\fake_resolver.cc " + - "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google\\protobuf\\duration.pb.c " + - "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google\\protobuf\\timestamp.pb.c " + - "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\load_balancer.pb.c " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds_channel_secure.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds_client_stats.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds_load_balancer_api.cc " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\auth\\cert.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cds.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster\\circuit_breaker.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster\\outlier_detection.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\discovery.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\eds.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\endpoint\\endpoint.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\endpoint\\load_report.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\service\\discovery\\v2\\ads.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\service\\load_stats\\v2\\lrs.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\address.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\base.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\config_source.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\grpc_service.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\health_check.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\protocol.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\type\\percent.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\type\\range.upb.c " + + "src\\core\\ext\\upb-generated\\gogoproto\\gogo.upb.c " + + "src\\core\\ext\\upb-generated\\validate\\validate.upb.c " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first\\pick_first.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin\\round_robin.cc " + "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\dns_resolver_ares.cc " + @@ -391,6 +420,7 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\dns_resolver_selection.cc " + "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native\\dns_resolver.cc " + "src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr\\sockaddr_resolver.cc " + + "src\\core\\ext\\filters\\client_channel\\resolver\\xds\\xds_resolver.cc " + "src\\core\\ext\\filters\\census\\grpc_context.cc " + "src\\core\\ext\\filters\\client_idle\\client_idle_filter.cc " + "src\\core\\ext\\filters\\max_age\\max_age_filter.cc " + @@ -700,12 +730,6 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\health"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google\\protobuf"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\xds"); @@ -715,6 +739,7 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\fake"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\xds"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_idle"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\deadline"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http"); @@ -735,6 +760,34 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\server\\secure"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\transport"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\inproc"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2\\auth"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2\\endpoint"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\discovery"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\discovery\\v2"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\load_stats"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\load_stats\\v2"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\type"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\gogoproto"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google\\api"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google\\protobuf"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google\\rpc"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health\\v1"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb\\v1"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\validate"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\avl"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\backoff"); @@ -828,7 +881,8 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\ssl"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\third_party"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\third_party\\fiat"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\nanopb"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\zlib"); _build_dirs = new Array(); for (i = 0; i < build_dirs.length; i++) { diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index d8bfe7c9023..02af80f53c2 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-C++' # TODO (mxyan): use version that match gRPC version when pod is stabilized - # version = '1.23.0-dev' + # version = '1.24.0-dev' version = '0.0.9-dev' s.version = version s.summary = 'gRPC C++ library' @@ -31,7 +31,7 @@ Pod::Spec.new do |s| s.license = 'Apache License, Version 2.0' s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' } - grpc_version = '1.23.0-dev' + grpc_version = '1.24.0-dev' s.source = { :git => 'https://github.com/grpc/grpc.git', @@ -180,6 +180,7 @@ Pod::Spec.new do |s| 'include/grpcpp/impl/codegen/config.h', 'include/grpcpp/impl/codegen/core_codegen_interface.h', 'include/grpcpp/impl/codegen/create_auth_context.h', + 'include/grpcpp/impl/codegen/delegating_channel.h', 'include/grpcpp/impl/codegen/grpc_library.h', 'include/grpcpp/impl/codegen/intercepted_channel.h', 'include/grpcpp/impl/codegen/interceptor.h', @@ -228,6 +229,10 @@ Pod::Spec.new do |s| 'src/cpp/server/health/default_health_check_service.h', 'src/cpp/server/thread_pool_interface.h', 'src/cpp/thread_manager/thread_manager.h', + 'third_party/nanopb/pb.h', + 'third_party/nanopb/pb_common.h', + 'third_party/nanopb/pb_decode.h', + 'third_party/nanopb/pb_encode.h', 'src/cpp/client/insecure_credentials.cc', 'src/cpp/client/secure_credentials.cc', 'src/cpp/common/auth_property_iterator.cc', @@ -381,13 +386,19 @@ Pod::Spec.new do |s| 'src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h', 'src/core/lib/security/credentials/alts/check_gcp_environment.h', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.h', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h', 'src/core/tsi/alts/handshaker/alts_tsi_utils.h', 'src/core/tsi/alts/handshaker/transport_security_common_api.h', - 'src/core/tsi/alts/handshaker/altscontext.pb.h', - 'src/core/tsi/alts/handshaker/handshaker.pb.h', - 'src/core/tsi/alts/handshaker/transport_security_common.pb.h', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h', + 'third_party/upb/upb/decode.h', + 'third_party/upb/upb/encode.h', + 'third_party/upb/upb/generated_util.h', + 'third_party/upb/upb/msg.h', + 'third_party/upb/upb/port_def.inc', + 'third_party/upb/upb/port_undef.inc', + 'third_party/upb/upb/table.int.h', + 'third_party/upb/upb/upb.h', 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', 'src/core/ext/transport/chttp2/client/authority.h', @@ -420,7 +431,7 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel_interface.h', 'src/core/ext/filters/client_channel/subchannel_pool_interface.h', 'src/core/ext/filters/deadline/deadline_filter.h', - 'src/core/ext/filters/client_channel/health/health.pb.h', + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h', 'src/core/tsi/fake_transport_security.h', 'src/core/tsi/local_transport_security.h', 'src/core/tsi/ssl/session_cache/ssl_session.h', @@ -579,13 +590,41 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h', + 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h', + 'src/core/ext/upb-generated/google/api/annotations.upb.h', + 'src/core/ext/upb-generated/google/api/http.upb.h', + 'src/core/ext/upb-generated/google/protobuf/any.upb.h', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.h', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.h', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.h', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h', + 'src/core/ext/upb-generated/google/rpc/status.upb.h', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h', + 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h', + 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h', + 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h', + 'src/core/ext/upb-generated/envoy/type/percent.upb.h', + 'src/core/ext/upb-generated/envoy/type/range.upb.h', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.h', + 'src/core/ext/upb-generated/validate/validate.upb.h', 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h', @@ -782,8 +821,16 @@ Pod::Spec.new do |s| 'src/core/lib/transport/transport_impl.h', 'src/core/lib/uri/uri_parser.h', 'src/core/lib/debug/trace.h', - 'src/core/ext/transport/inproc/inproc_transport.h', - 'src/core/ext/filters/client_channel/health/health.pb.h' + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h', + 'third_party/upb/upb/decode.h', + 'third_party/upb/upb/encode.h', + 'third_party/upb/upb/generated_util.h', + 'third_party/upb/upb/msg.h', + 'third_party/upb/upb/port_def.inc', + 'third_party/upb/upb/port_undef.inc', + 'third_party/upb/upb/table.int.h', + 'third_party/upb/upb/upb.h', + 'src/core/ext/transport/inproc/inproc_transport.h' end s.subspec 'Protobuf' do |ss| diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 60253c9b20a..3244e9d08f9 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -22,7 +22,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.23.0-dev' + version = '1.24.0-dev' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'https://grpc.io' @@ -336,13 +336,19 @@ Pod::Spec.new do |s| 'src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h', 'src/core/lib/security/credentials/alts/check_gcp_environment.h', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.h', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h', 'src/core/tsi/alts/handshaker/alts_tsi_utils.h', 'src/core/tsi/alts/handshaker/transport_security_common_api.h', - 'src/core/tsi/alts/handshaker/altscontext.pb.h', - 'src/core/tsi/alts/handshaker/handshaker.pb.h', - 'src/core/tsi/alts/handshaker/transport_security_common.pb.h', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h', + 'third_party/upb/upb/decode.h', + 'third_party/upb/upb/encode.h', + 'third_party/upb/upb/generated_util.h', + 'third_party/upb/upb/msg.h', + 'third_party/upb/upb/port_def.inc', + 'third_party/upb/upb/port_undef.inc', + 'third_party/upb/upb/table.int.h', + 'third_party/upb/upb/upb.h', 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', 'src/core/ext/transport/chttp2/client/authority.h', @@ -375,7 +381,7 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel_interface.h', 'src/core/ext/filters/client_channel/subchannel_pool_interface.h', 'src/core/ext/filters/deadline/deadline_filter.h', - 'src/core/ext/filters/client_channel/health/health.pb.h', + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h', 'src/core/tsi/fake_transport_security.h', 'src/core/tsi/local_transport_security.h', 'src/core/tsi/ssl/session_cache/ssl_session.h', @@ -534,13 +540,41 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h', + 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h', + 'src/core/ext/upb-generated/google/api/annotations.upb.h', + 'src/core/ext/upb-generated/google/api/http.upb.h', + 'src/core/ext/upb-generated/google/protobuf/any.upb.h', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.h', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.h', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.h', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h', + 'src/core/ext/upb-generated/google/rpc/status.upb.h', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h', + 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h', + 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h', + 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h', + 'src/core/ext/upb-generated/envoy/type/percent.upb.h', + 'src/core/ext/upb-generated/envoy/type/range.upb.h', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.h', + 'src/core/ext/upb-generated/validate/validate.upb.h', 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h', @@ -798,13 +832,17 @@ Pod::Spec.new do |s| 'src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc', 'src/core/tsi/alts/handshaker/alts_tsi_utils.cc', 'src/core/tsi/alts/handshaker/transport_security_common_api.cc', - 'src/core/tsi/alts/handshaker/altscontext.pb.c', - 'src/core/tsi/alts/handshaker/handshaker.pb.c', - 'src/core/tsi/alts/handshaker/transport_security_common.pb.c', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c', + 'third_party/upb/upb/decode.c', + 'third_party/upb/upb/encode.c', + 'third_party/upb/upb/msg.c', + 'third_party/upb/upb/port.c', + 'third_party/upb/upb/table.c', + 'third_party/upb/upb/upb.c', 'src/core/tsi/transport_security.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', @@ -837,7 +875,7 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/filters/client_channel/health/health.pb.c', + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', 'src/core/tsi/fake_transport_security.cc', 'src/core/tsi/local_transport_security.cc', 'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc', @@ -856,14 +894,42 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', + 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', + 'src/core/ext/upb-generated/google/api/annotations.upb.c', + 'src/core/ext/upb-generated/google/api/http.upb.c', + 'src/core/ext/upb-generated/google/protobuf/any.upb.c', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', + 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc', + 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c', + 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c', + 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c', + 'src/core/ext/upb-generated/envoy/type/percent.upb.c', + 'src/core/ext/upb-generated/envoy/type/range.upb.c', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', + 'src/core/ext/upb-generated/validate/validate.upb.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', @@ -879,6 +945,7 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc', 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc', 'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc', + 'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc', 'src/core/ext/filters/census/grpc_context.cc', 'src/core/ext/filters/client_idle/client_idle_filter.cc', 'src/core/ext/filters/max_age/max_age_filter.cc', @@ -995,13 +1062,19 @@ Pod::Spec.new do |s| 'src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h', 'src/core/lib/security/credentials/alts/check_gcp_environment.h', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.h', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h', 'src/core/tsi/alts/handshaker/alts_tsi_utils.h', 'src/core/tsi/alts/handshaker/transport_security_common_api.h', - 'src/core/tsi/alts/handshaker/altscontext.pb.h', - 'src/core/tsi/alts/handshaker/handshaker.pb.h', - 'src/core/tsi/alts/handshaker/transport_security_common.pb.h', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h', + 'third_party/upb/upb/decode.h', + 'third_party/upb/upb/encode.h', + 'third_party/upb/upb/generated_util.h', + 'third_party/upb/upb/msg.h', + 'third_party/upb/upb/port_def.inc', + 'third_party/upb/upb/port_undef.inc', + 'third_party/upb/upb/table.int.h', + 'third_party/upb/upb/upb.h', 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', 'src/core/ext/transport/chttp2/client/authority.h', @@ -1034,7 +1107,7 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel_interface.h', 'src/core/ext/filters/client_channel/subchannel_pool_interface.h', 'src/core/ext/filters/deadline/deadline_filter.h', - 'src/core/ext/filters/client_channel/health/health.pb.h', + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h', 'src/core/tsi/fake_transport_security.h', 'src/core/tsi/local_transport_security.h', 'src/core/tsi/ssl/session_cache/ssl_session.h', @@ -1193,13 +1266,41 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h', + 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h', + 'src/core/ext/upb-generated/google/api/annotations.upb.h', + 'src/core/ext/upb-generated/google/api/http.upb.h', + 'src/core/ext/upb-generated/google/protobuf/any.upb.h', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.h', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.h', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.h', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h', + 'src/core/ext/upb-generated/google/rpc/status.upb.h', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h', + 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h', + 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h', + 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h', + 'src/core/ext/upb-generated/envoy/type/percent.upb.h', + 'src/core/ext/upb-generated/envoy/type/range.upb.h', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.h', + 'src/core/ext/upb-generated/validate/validate.upb.h', 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h', @@ -1230,16 +1331,9 @@ Pod::Spec.new do |s| ss.source_files = 'src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc', 'src/core/ext/transport/cronet/transport/cronet_transport.cc', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', 'src/core/ext/transport/cronet/client/secure/cronet_channel_create.h', 'src/core/ext/transport/cronet/transport/cronet_transport.h', - 'third_party/objective_c/Cronet/bidirectional_stream_c.h', - 'third_party/nanopb/pb.h', - 'third_party/nanopb/pb_common.h', - 'third_party/nanopb/pb_decode.h', - 'third_party/nanopb/pb_encode.h' + 'third_party/objective_c/Cronet/bidirectional_stream_c.h' end s.subspec 'Tests' do |ss| @@ -1276,9 +1370,6 @@ Pod::Spec.new do |s| 'test/core/util/tracer_util.cc', 'test/core/util/trickle_endpoint.cc', 'test/core/util/cmdline.cc', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', 'test/core/end2end/data/ssl_test_data.h', 'test/core/security/oauth2_utils.h', 'test/core/end2end/cq_verifier.h', @@ -1303,10 +1394,6 @@ Pod::Spec.new do |s| 'test/core/util/tracer_util.h', 'test/core/util/trickle_endpoint.h', 'test/core/util/cmdline.h', - 'third_party/nanopb/pb.h', - 'third_party/nanopb/pb_common.h', - 'third_party/nanopb/pb_decode.h', - 'third_party/nanopb/pb_encode.h', 'test/core/end2end/end2end_tests.cc', 'test/core/end2end/end2end_test_utils.cc', 'test/core/end2end/tests/authority_not_supported.cc', diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 62bff003934..57dac5a10e5 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.23.0-dev' + version = '1.24.0-dev' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'https://grpc.io' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index e9a19ac65df..9666c3c1b98 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.23.0-dev' + version = '1.24.0-dev' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'https://grpc.io' diff --git a/gRPC.podspec b/gRPC.podspec index 0374e525b0d..09baf1e3b4b 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.23.0-dev' + version = '1.24.0-dev' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'https://grpc.io' diff --git a/grpc.def b/grpc.def index f451775dba6..fa4d73c9252 100644 --- a/grpc.def +++ b/grpc.def @@ -141,6 +141,8 @@ EXPORTS grpc_tls_credentials_options_set_server_authorization_check_config grpc_tls_key_materials_config_create grpc_tls_key_materials_config_set_key_materials + grpc_tls_key_materials_config_set_version + grpc_tls_key_materials_config_get_version grpc_tls_credential_reload_config_create grpc_tls_server_authorization_check_config_create grpc_raw_byte_buffer_create diff --git a/grpc.gemspec b/grpc.gemspec index eda96081c73..5a29165c92d 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -265,17 +265,19 @@ Gem::Specification.new do |s| s.files += %w( src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h ) s.files += %w( src/core/lib/security/credentials/alts/check_gcp_environment.h ) s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h ) - s.files += %w( src/core/tsi/alts/handshaker/alts_handshaker_service_api.h ) - s.files += %w( src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h ) s.files += %w( src/core/tsi/alts/handshaker/alts_tsi_utils.h ) s.files += %w( src/core/tsi/alts/handshaker/transport_security_common_api.h ) - s.files += %w( src/core/tsi/alts/handshaker/altscontext.pb.h ) - s.files += %w( src/core/tsi/alts/handshaker/handshaker.pb.h ) - s.files += %w( src/core/tsi/alts/handshaker/transport_security_common.pb.h ) - s.files += %w( third_party/nanopb/pb.h ) - s.files += %w( third_party/nanopb/pb_common.h ) - s.files += %w( third_party/nanopb/pb_decode.h ) - s.files += %w( third_party/nanopb/pb_encode.h ) + s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h ) + s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h ) + s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h ) + s.files += %w( third_party/upb/upb/decode.h ) + s.files += %w( third_party/upb/upb/encode.h ) + s.files += %w( third_party/upb/upb/generated_util.h ) + s.files += %w( third_party/upb/upb/msg.h ) + s.files += %w( third_party/upb/upb/port_def.inc ) + s.files += %w( third_party/upb/upb/port_undef.inc ) + s.files += %w( third_party/upb/upb/table.int.h ) + s.files += %w( third_party/upb/upb/upb.h ) s.files += %w( src/core/tsi/transport_security.h ) s.files += %w( src/core/tsi/transport_security_interface.h ) s.files += %w( src/core/ext/transport/chttp2/client/authority.h ) @@ -308,7 +310,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/subchannel_interface.h ) s.files += %w( src/core/ext/filters/client_channel/subchannel_pool_interface.h ) s.files += %w( src/core/ext/filters/deadline/deadline_filter.h ) - s.files += %w( src/core/ext/filters/client_channel/health/health.pb.h ) + s.files += %w( src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h ) s.files += %w( src/core/tsi/fake_transport_security.h ) s.files += %w( src/core/tsi/local_transport_security.h ) s.files += %w( src/core/tsi/ssl/session_cache/ssl_session.h ) @@ -467,13 +469,41 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h ) + s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/api/http.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.h ) s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h ) - s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h ) - s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h ) - s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cds.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/eds.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/type/percent.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/type/range.upb.h ) + s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.h ) + s.files += %w( src/core/ext/upb-generated/validate/validate.upb.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/subchannel_list.h ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h ) @@ -731,16 +761,17 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc ) s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc ) s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc ) - s.files += %w( src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc ) - s.files += %w( src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc ) s.files += %w( src/core/tsi/alts/handshaker/alts_tsi_utils.cc ) s.files += %w( src/core/tsi/alts/handshaker/transport_security_common_api.cc ) - s.files += %w( src/core/tsi/alts/handshaker/altscontext.pb.c ) - s.files += %w( src/core/tsi/alts/handshaker/handshaker.pb.c ) - s.files += %w( src/core/tsi/alts/handshaker/transport_security_common.pb.c ) - s.files += %w( third_party/nanopb/pb_common.c ) - s.files += %w( third_party/nanopb/pb_decode.c ) - s.files += %w( third_party/nanopb/pb_encode.c ) + s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c ) + s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c ) + s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c ) + s.files += %w( third_party/upb/upb/decode.c ) + s.files += %w( third_party/upb/upb/encode.c ) + s.files += %w( third_party/upb/upb/msg.c ) + s.files += %w( third_party/upb/upb/port.c ) + s.files += %w( third_party/upb/upb/table.c ) + s.files += %w( third_party/upb/upb/upb.c ) s.files += %w( src/core/tsi/transport_security.cc ) s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.cc ) s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc ) @@ -773,7 +804,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/subchannel.cc ) s.files += %w( src/core/ext/filters/client_channel/subchannel_pool_interface.cc ) s.files += %w( src/core/ext/filters/deadline/deadline_filter.cc ) - s.files += %w( src/core/ext/filters/client_channel/health/health.pb.c ) + s.files += %w( src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c ) s.files += %w( src/core/tsi/fake_transport_security.cc ) s.files += %w( src/core/tsi/local_transport_security.cc ) s.files += %w( src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc ) @@ -792,14 +823,42 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc ) + s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/api/http.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.c ) s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc ) - s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c ) - s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c ) - s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cds.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/eds.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/type/percent.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/type/range.upb.c ) + s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.c ) + s.files += %w( src/core/ext/upb-generated/validate/validate.upb.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc ) @@ -815,6 +874,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc ) s.files += %w( src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc ) + s.files += %w( src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc ) s.files += %w( src/core/ext/filters/census/grpc_context.cc ) s.files += %w( src/core/ext/filters/client_idle/client_idle_filter.cc ) s.files += %w( src/core/ext/filters/max_age/max_age_filter.cc ) diff --git a/grpc.gyp b/grpc.gyp index b9a30012fed..a0e34ca67df 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -55,12 +55,22 @@ '-Wall', '-Wextra', '-Werror', + '-Wno-unknown-warning-option', '-Wno-long-long', '-Wno-unused-parameter', - '-DOSATOMIC_USE_INLINED=1', '-Wno-deprecated-declarations', - '-Ithird_party/nanopb', + '-Wno-sign-conversion', + '-Wno-shadow', + '-Wno-conversion', + '-Wno-implicit-fallthrough', + '-Wno-sign-compare', + '-Wno-missing-field-initializers', + '-Wno-maybe-uninitialized', '-DPB_FIELD_32BIT', + '-DOSATOMIC_USE_INLINED=1', + '-Ithird_party/nanopb', + '-Ithird_party/upb', + '-Isrc/core/ext/upb-generated', ], 'ldflags': [ '-g', @@ -136,24 +146,44 @@ '-Wall', '-Wextra', '-Werror', + '-Wno-unknown-warning-option', '-Wno-long-long', '-Wno-unused-parameter', - '-DOSATOMIC_USE_INLINED=1', '-Wno-deprecated-declarations', - '-Ithird_party/nanopb', + '-Wno-sign-conversion', + '-Wno-shadow', + '-Wno-conversion', + '-Wno-implicit-fallthrough', + '-Wno-sign-compare', + '-Wno-missing-field-initializers', + '-Wno-maybe-uninitialized', '-DPB_FIELD_32BIT', + '-DOSATOMIC_USE_INLINED=1', + '-Ithird_party/nanopb', + '-Ithird_party/upb', + '-Isrc/core/ext/upb-generated', ], 'OTHER_CPLUSPLUSFLAGS': [ '-g', '-Wall', '-Wextra', '-Werror', + '-Wno-unknown-warning-option', '-Wno-long-long', '-Wno-unused-parameter', - '-DOSATOMIC_USE_INLINED=1', '-Wno-deprecated-declarations', - '-Ithird_party/nanopb', + '-Wno-sign-conversion', + '-Wno-shadow', + '-Wno-conversion', + '-Wno-implicit-fallthrough', + '-Wno-sign-compare', + '-Wno-missing-field-initializers', + '-Wno-maybe-uninitialized', '-DPB_FIELD_32BIT', + '-DOSATOMIC_USE_INLINED=1', + '-Ithird_party/nanopb', + '-Ithird_party/upb', + '-Isrc/core/ext/upb-generated', '-stdlib=libc++', '-std=c++11', '-Wno-error=deprecated-declarations', @@ -514,16 +544,17 @@ 'src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc', 'src/core/tsi/alts/handshaker/alts_tsi_utils.cc', 'src/core/tsi/alts/handshaker/transport_security_common_api.cc', - 'src/core/tsi/alts/handshaker/altscontext.pb.c', - 'src/core/tsi/alts/handshaker/handshaker.pb.c', - 'src/core/tsi/alts/handshaker/transport_security_common.pb.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c', + 'third_party/upb/upb/decode.c', + 'third_party/upb/upb/encode.c', + 'third_party/upb/upb/msg.c', + 'third_party/upb/upb/port.c', + 'third_party/upb/upb/table.c', + 'third_party/upb/upb/upb.c', 'src/core/tsi/transport_security.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', @@ -556,7 +587,7 @@ 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/filters/client_channel/health/health.pb.c', + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', 'src/core/tsi/fake_transport_security.cc', 'src/core/tsi/local_transport_security.cc', 'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc', @@ -575,14 +606,42 @@ 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', + 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', + 'src/core/ext/upb-generated/google/api/annotations.upb.c', + 'src/core/ext/upb-generated/google/api/http.upb.c', + 'src/core/ext/upb-generated/google/protobuf/any.upb.c', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', + 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc', + 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c', + 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c', + 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c', + 'src/core/ext/upb-generated/envoy/type/percent.upb.c', + 'src/core/ext/upb-generated/envoy/type/range.upb.c', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', + 'src/core/ext/upb-generated/validate/validate.upb.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', @@ -598,6 +657,7 @@ 'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc', 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc', 'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc', + 'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc', 'src/core/ext/filters/census/grpc_context.cc', 'src/core/ext/filters/client_idle/client_idle_filter.cc', 'src/core/ext/filters/max_age/max_age_filter.cc', @@ -831,10 +891,13 @@ 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/filters/client_channel/health/health.pb.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', + 'third_party/upb/upb/decode.c', + 'third_party/upb/upb/encode.c', + 'third_party/upb/upb/msg.c', + 'third_party/upb/upb/port.c', + 'third_party/upb/upb/table.c', + 'third_party/upb/upb/upb.c', 'src/core/ext/transport/chttp2/transport/bin_decoder.cc', 'src/core/ext/transport/chttp2/transport/bin_encoder.cc', 'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc', @@ -1083,10 +1146,13 @@ 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/filters/client_channel/health/health.pb.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', + 'third_party/upb/upb/decode.c', + 'third_party/upb/upb/encode.c', + 'third_party/upb/upb/msg.c', + 'third_party/upb/upb/port.c', + 'third_party/upb/upb/table.c', + 'third_party/upb/upb/upb.c', 'src/core/ext/transport/chttp2/transport/bin_decoder.cc', 'src/core/ext/transport/chttp2/transport/bin_encoder.cc', 'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc', @@ -1346,10 +1412,13 @@ 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/filters/client_channel/health/health.pb.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', + 'third_party/upb/upb/decode.c', + 'third_party/upb/upb/encode.c', + 'third_party/upb/upb/msg.c', + 'third_party/upb/upb/port.c', + 'third_party/upb/upb/table.c', + 'third_party/upb/upb/upb.c', 'src/core/ext/transport/inproc/inproc_plugin.cc', 'src/core/ext/transport/inproc/inproc_transport.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', @@ -1366,18 +1435,47 @@ 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc', 'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', + 'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', + 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', + 'src/core/ext/upb-generated/google/api/annotations.upb.c', + 'src/core/ext/upb-generated/google/api/http.upb.c', + 'src/core/ext/upb-generated/google/protobuf/any.upb.c', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', + 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc', + 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c', + 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c', + 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c', + 'src/core/ext/upb-generated/envoy/type/percent.upb.c', + 'src/core/ext/upb-generated/envoy/type/range.upb.c', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', + 'src/core/ext/upb-generated/validate/validate.upb.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/census/grpc_context.cc', @@ -1494,10 +1592,13 @@ 'src/cpp/util/status.cc', 'src/cpp/util/string_ref.cc', 'src/cpp/util/time_cc.cc', - 'src/core/ext/filters/client_channel/health/health.pb.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', + 'third_party/upb/upb/decode.c', + 'third_party/upb/upb/encode.c', + 'third_party/upb/upb/msg.c', + 'third_party/upb/upb/port.c', + 'third_party/upb/upb/table.c', + 'third_party/upb/upb/upb.c', 'src/cpp/codegen/codegen_init.cc', ], }, @@ -1651,10 +1752,13 @@ 'src/cpp/util/status.cc', 'src/cpp/util/string_ref.cc', 'src/cpp/util/time_cc.cc', - 'src/core/ext/filters/client_channel/health/health.pb.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', + 'third_party/upb/upb/decode.c', + 'third_party/upb/upb/encode.c', + 'third_party/upb/upb/msg.c', + 'third_party/upb/upb/port.c', + 'third_party/upb/upb/table.c', + 'third_party/upb/upb/upb.c', 'src/cpp/codegen/codegen_init.cc', ], }, @@ -2155,24 +2259,6 @@ 'third_party/benchmark/src/timers.cc', ], }, - { - 'target_name': 'upb', - 'type': 'static_library', - 'dependencies': [ - ], - 'sources': [ - 'third_party/upb/generated_for_cmake/google/protobuf/descriptor.upb.c', - 'third_party/upb/upb/decode.c', - 'third_party/upb/upb/def.c', - 'third_party/upb/upb/encode.c', - 'third_party/upb/upb/handlers.c', - 'third_party/upb/upb/msg.c', - 'third_party/upb/upb/msgfactory.c', - 'third_party/upb/upb/sink.c', - 'third_party/upb/upb/table.c', - 'third_party/upb/upb/upb.c', - ], - }, { 'target_name': 'z', 'type': 'static_library', diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index e5038dee4b7..7db070d7e8f 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -48,7 +48,7 @@ class TlsKeyMaterialsConfig { * transfers ownership of the arguments to the config. **/ void set_key_materials(grpc::string pem_root_certs, std::vector pem_key_cert_pair_list); - void set_version(int version) { version_ = version; }; + void set_version(int version) { version_ = version;}; private: int version_; @@ -63,6 +63,7 @@ grpc_tls_key_materials_config* c_key_materials( std::shared_ptr tls_key_materials_c_to_cpp( const grpc_tls_key_materials_config* config); + /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ class TlsCredentialReloadArg { public: @@ -166,8 +167,9 @@ class TlsServerAuthorizationCheckArg { // Exposed for testing purposes. int tls_server_authorization_check_config_c_schedule( void* config_user_data, grpc_tls_server_authorization_check_arg* arg); -void tls_server_authorization_check_config_c_cancel( - void* config_user_data, grpc_tls_server_authorization_check_arg* arg); +void tls_server_authorization_check_config_c_cancel(void* config_user_data, + grpc_tls_server_authorization_check_arg* arg); + /** TLS server authorization check config, wraps * grps_tls_server_authorization_check_config. **/ @@ -195,8 +197,7 @@ class TlsServerAuthorizationCheckConfig { } /** Creates C struct for the credential reload config. **/ - grpc_tls_server_authorization_check_config* c_server_authorization_check() - const { + grpc_tls_server_authorization_check_config* c_server_authorization_check() const { return c_config_; } @@ -218,7 +219,8 @@ class TlsCredentialsOptions { std::shared_ptr key_materials_config() const { return key_materials_config_; } - std::shared_ptr credential_reload_config() const { + std::shared_ptr credential_reload_config() + const { return credential_reload_config_; } std::shared_ptr diff --git a/package.xml b/package.xml index cb221ff932d..196c6a6d7db 100644 --- a/package.xml +++ b/package.xml @@ -13,8 +13,8 @@ 2018-01-19 - 1.23.0dev - 1.23.0dev + 1.24.0dev + 1.24.0dev beta @@ -270,17 +270,19 @@ - - - - - - - - - + + + + + + + + + + + @@ -313,7 +315,7 @@ - + @@ -472,13 +474,41 @@ + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + @@ -736,16 +766,17 @@ - - - - - - - - + + + + + + + + + @@ -778,7 +809,7 @@ - + @@ -797,14 +828,42 @@ + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + @@ -820,6 +879,7 @@ + diff --git a/src/core/lib/surface/version.cc b/src/core/lib/surface/version.cc index 848a49d1eff..71eb89a1b42 100644 --- a/src/core/lib/surface/version.cc +++ b/src/core/lib/surface/version.cc @@ -23,6 +23,6 @@ #include -const char* grpc_version_string(void) { return "7.0.0"; } +const char* grpc_version_string(void) { return "8.0.0"; } -const char* grpc_g_stands_for(void) { return "gangnam"; } +const char* grpc_g_stands_for(void) { return "ganges"; } diff --git a/src/core/plugin_registry/grpc_plugin_registry.cc b/src/core/plugin_registry/grpc_plugin_registry.cc index 9b011d8df0f..ebe3def245a 100644 --- a/src/core/plugin_registry/grpc_plugin_registry.cc +++ b/src/core/plugin_registry/grpc_plugin_registry.cc @@ -46,6 +46,8 @@ void grpc_resolver_dns_native_init(void); void grpc_resolver_dns_native_shutdown(void); void grpc_resolver_sockaddr_init(void); void grpc_resolver_sockaddr_shutdown(void); +void grpc_resolver_xds_init(void); +void grpc_resolver_xds_shutdown(void); void grpc_client_idle_filter_init(void); void grpc_client_idle_filter_shutdown(void); void grpc_max_age_filter_init(void); @@ -84,6 +86,8 @@ void grpc_register_built_in_plugins(void) { grpc_resolver_dns_native_shutdown); grpc_register_plugin(grpc_resolver_sockaddr_init, grpc_resolver_sockaddr_shutdown); + grpc_register_plugin(grpc_resolver_xds_init, + grpc_resolver_xds_shutdown); grpc_register_plugin(grpc_client_idle_filter_init, grpc_client_idle_filter_shutdown); grpc_register_plugin(grpc_max_age_filter_init, diff --git a/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc index 055c3ccc134..6668836f02f 100644 --- a/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc +++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc @@ -38,6 +38,8 @@ void grpc_resolver_sockaddr_init(void); void grpc_resolver_sockaddr_shutdown(void); void grpc_resolver_fake_init(void); void grpc_resolver_fake_shutdown(void); +void grpc_resolver_xds_init(void); +void grpc_resolver_xds_shutdown(void); void grpc_lb_policy_grpclb_init(void); void grpc_lb_policy_grpclb_shutdown(void); void grpc_lb_policy_xds_init(void); @@ -76,6 +78,8 @@ void grpc_register_built_in_plugins(void) { grpc_resolver_sockaddr_shutdown); grpc_register_plugin(grpc_resolver_fake_init, grpc_resolver_fake_shutdown); + grpc_register_plugin(grpc_resolver_xds_init, + grpc_resolver_xds_shutdown); grpc_register_plugin(grpc_lb_policy_grpclb_init, grpc_lb_policy_grpclb_shutdown); grpc_register_plugin(grpc_lb_policy_xds_init, diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 8d85d5a0ac7..a48e9f94ba6 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -32,15 +32,13 @@ void TlsKeyMaterialsConfig::set_key_materials( } /** Creates a new C struct for the key materials. **/ -grpc_tls_key_materials_config* c_key_materials( - const std::shared_ptr& config) { +grpc_tls_key_materials_config* c_key_materials(const std::shared_ptr& config) { grpc_tls_key_materials_config* c_config = grpc_tls_key_materials_config_create(); ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> c_pem_key_cert_pair_list; for (auto key_cert_pair = config->pem_key_cert_pair_list().begin(); - key_cert_pair != config->pem_key_cert_pair_list().end(); - key_cert_pair++) { + key_cert_pair != config->pem_key_cert_pair_list().end(); key_cert_pair++) { grpc_ssl_pem_key_cert_pair* ssl_pair = (grpc_ssl_pem_key_cert_pair*)gpr_malloc( sizeof(grpc_ssl_pem_key_cert_pair)); @@ -50,8 +48,7 @@ grpc_tls_key_materials_config* c_key_materials( ::grpc_core::PemKeyCertPair(ssl_pair); c_pem_key_cert_pair_list.push_back(::std::move(c_pem_key_cert_pair)); } - ::grpc_core::UniquePtr c_pem_root_certs( - gpr_strdup(config->pem_root_certs().c_str())); + ::grpc_core::UniquePtr c_pem_root_certs(gpr_strdup(config->pem_root_certs().c_str())); c_config->set_key_materials(std::move(c_pem_root_certs), std::move(c_pem_key_cert_pair_list)); c_config->set_version(config->version()); @@ -63,7 +60,8 @@ std::shared_ptr tls_key_materials_c_to_cpp( const grpc_tls_key_materials_config* config) { std::shared_ptr cpp_config( new TlsKeyMaterialsConfig()); - std::vector cpp_pem_key_cert_pair_list; + std::vector + cpp_pem_key_cert_pair_list; grpc_tls_key_materials_config::PemKeyCertPairList pem_key_cert_pair_list = config->pem_key_cert_pair_list(); for (size_t i = 0; i < pem_key_cert_pair_list.size(); i++) { @@ -73,8 +71,9 @@ std::shared_ptr tls_key_materials_c_to_cpp( gpr_strdup(key_cert_pair.cert_chain())}; cpp_pem_key_cert_pair_list.push_back(::std::move(p)); } - cpp_config->set_key_materials(std::move(gpr_strdup(config->pem_root_certs())), - std::move(cpp_pem_key_cert_pair_list)); + cpp_config->set_key_materials( + std::move(gpr_strdup(config->pem_root_certs())), + std::move(cpp_pem_key_cert_pair_list)); cpp_config->set_version(config->version()); return cpp_config; } @@ -96,19 +95,16 @@ void* TlsCredentialReloadArg::cb_user_data() const { /** This function creates a new TlsKeyMaterialsConfig instance whose fields are * not shared with the corresponding key materials config fields of the * TlsCredentialReloadArg instance. **/ -std::shared_ptr -TlsCredentialReloadArg::key_materials_config() const { +std::shared_ptr TlsCredentialReloadArg::key_materials_config() const { return tls_key_materials_c_to_cpp(c_arg_.key_materials_config); } -grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() - const { +grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() const { return c_arg_.status; } std::shared_ptr TlsCredentialReloadArg::error_details() const { - std::shared_ptr cpp_error_details( - new grpc::string(c_arg_.error_details)); + std::shared_ptr cpp_error_details(new grpc::string(c_arg_.error_details)); return cpp_error_details; } @@ -117,7 +113,7 @@ void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { } void TlsCredentialReloadArg::set_key_materials_config( - const std::shared_ptr& key_materials_config) { + std::shared_ptr key_materials_config) { c_arg_.key_materials_config = c_key_materials(key_materials_config); } @@ -126,12 +122,13 @@ void TlsCredentialReloadArg::set_status( c_arg_.status = status; } -void TlsCredentialReloadArg::set_error_details( - const grpc::string& error_details) { +void TlsCredentialReloadArg::set_error_details(const grpc::string& error_details) { c_arg_.error_details = gpr_strdup(error_details.c_str()); } -void TlsCredentialReloadArg::callback() { c_arg_.cb(&c_arg_); } +void TlsCredentialReloadArg::callback() { + c_arg_.cb(&c_arg_); +} /** The C schedule and cancel functions for the credential reload config. **/ int tls_credential_reload_config_c_schedule( @@ -214,7 +211,7 @@ grpc_status_code TlsServerAuthorizationCheckArg::status() const { std::shared_ptr TlsServerAuthorizationCheckArg::error_details() const { std::shared_ptr cpp_error_details( - new grpc::string(c_arg_.error_details)); +new grpc::string(c_arg_.error_details)); return cpp_error_details; } @@ -285,13 +282,14 @@ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( config_user_data_ = const_cast(config_user_data); schedule_ = schedule; cancel_ = cancel; - destruct_ = destruct; +destruct_ = destruct; c_config_ = grpc_tls_server_authorization_check_config_create( config_user_data_, &tls_server_authorization_check_config_c_schedule, &tls_server_authorization_check_config_c_cancel, destruct_); c_config_->set_context(static_cast(this)); } + TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() {} /** gRPC TLS credential options API implementation **/ @@ -301,8 +299,7 @@ grpc_tls_credentials_options* TlsCredentialsOptions::c_credentials_options() grpc_tls_credentials_options_create(); c_options->set_cert_request_type(cert_request_type_); c_options->set_key_materials_config( - ::grpc_core::RefCountedPtr( - c_key_materials(key_materials_config_))); + ::grpc_core::RefCountedPtr(c_key_materials(key_materials_config_))); c_options->set_credential_reload_config( ::grpc_core::RefCountedPtr( credential_reload_config_->c_credential_reload())); diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc index 7fb7823c9f2..71ddc6e5d71 100644 --- a/src/cpp/common/version_cc.cc +++ b/src/cpp/common/version_cc.cc @@ -22,5 +22,5 @@ #include namespace grpc { -grpc::string Version() { return "1.23.0-dev"; } +grpc::string Version() { return "1.24.0-dev"; } } // namespace grpc diff --git a/src/csharp/Grpc.Core.Api/VersionInfo.cs b/src/csharp/Grpc.Core.Api/VersionInfo.cs index 6469aeb3f4b..f732af32ec3 100644 --- a/src/csharp/Grpc.Core.Api/VersionInfo.cs +++ b/src/csharp/Grpc.Core.Api/VersionInfo.cs @@ -28,16 +28,16 @@ namespace Grpc.Core /// /// Current AssemblyVersion attribute of gRPC C# assemblies /// - public const string CurrentAssemblyVersion = "1.0.0.0"; + public const string CurrentAssemblyVersion = "2.0.0.0"; /// /// Current AssemblyFileVersion of gRPC C# assemblies /// - public const string CurrentAssemblyFileVersion = "1.23.0.0"; + public const string CurrentAssemblyFileVersion = "2.24.0.0"; /// /// Current version of gRPC C# /// - public const string CurrentVersion = "1.23.0-dev"; + public const string CurrentVersion = "2.24.0-dev"; } } diff --git a/src/csharp/build/dependencies.props b/src/csharp/build/dependencies.props index a91b5e19414..d45d3b1b0eb 100644 --- a/src/csharp/build/dependencies.props +++ b/src/csharp/build/dependencies.props @@ -1,7 +1,7 @@ - 1.23.0-dev + 2.24.0-dev 3.8.0 diff --git a/src/csharp/build_unitypackage.bat b/src/csharp/build_unitypackage.bat index 3eab6886f3b..9fade5c1dd0 100644 --- a/src/csharp/build_unitypackage.bat +++ b/src/csharp/build_unitypackage.bat @@ -13,7 +13,7 @@ @rem limitations under the License. @rem Current package versions -set VERSION=1.23.0-dev +set VERSION=2.24.0-dev @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe diff --git a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec index 14ece66db61..67faaeb2567 100644 --- a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCCppPlugin' - v = '1.23.0-dev' + v = '1.24.0-dev' s.version = v s.summary = 'The gRPC ProtoC plugin generates C++ files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index 1ac3b4d4685..f65086b6df5 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.23.0-dev' + v = '1.24.0-dev' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index 3b248db0148..fc6982c55d6 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -22,4 +22,4 @@ // instead. This file can be regenerated from the template by running // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.23.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.24.0-dev" diff --git a/src/objective-c/tests/version.h b/src/objective-c/tests/version.h index 231ba1a9a9f..9182189f4c8 100644 --- a/src/objective-c/tests/version.h +++ b/src/objective-c/tests/version.h @@ -22,5 +22,5 @@ // instead. This file can be regenerated from the template by running // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.23.0-dev" -#define GRPC_C_VERSION_STRING @"7.0.0" +#define GRPC_OBJC_VERSION_STRING @"1.24.0-dev" +#define GRPC_C_VERSION_STRING @"8.0.0" diff --git a/src/php/composer.json b/src/php/composer.json index e29c9c33fde..6da1fd77d65 100644 --- a/src/php/composer.json +++ b/src/php/composer.json @@ -2,7 +2,7 @@ "name": "grpc/grpc-dev", "description": "gRPC library for PHP - for Developement use only", "license": "Apache-2.0", - "version": "1.23.0", + "version": "1.24.0", "require": { "php": ">=5.5.0", "google/protobuf": "^v3.3.0" diff --git a/src/php/ext/grpc/version.h b/src/php/ext/grpc/version.h index bb707f50a9f..000508dd3f8 100644 --- a/src/php/ext/grpc/version.h +++ b/src/php/ext/grpc/version.h @@ -20,6 +20,6 @@ #ifndef VERSION_H #define VERSION_H -#define PHP_GRPC_VERSION "1.23.0dev" +#define PHP_GRPC_VERSION "1.24.0dev" #endif /* VERSION_H */ diff --git a/src/python/grpcio/grpc/_grpcio_metadata.py b/src/python/grpcio/grpc/_grpcio_metadata.py index d2f8be43f34..ff1b1a17d25 100644 --- a/src/python/grpcio/grpc/_grpcio_metadata.py +++ b/src/python/grpcio/grpc/_grpcio_metadata.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!! -__version__ = """1.23.0.dev0""" +__version__ = """1.24.0.dev0""" diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index aab3768b02e..607235556e3 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -306,16 +306,17 @@ CORE_SOURCE_FILES = [ 'src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc', 'src/core/tsi/alts/handshaker/alts_tsi_utils.cc', 'src/core/tsi/alts/handshaker/transport_security_common_api.cc', - 'src/core/tsi/alts/handshaker/altscontext.pb.c', - 'src/core/tsi/alts/handshaker/handshaker.pb.c', - 'src/core/tsi/alts/handshaker/transport_security_common.pb.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c', + 'third_party/upb/upb/decode.c', + 'third_party/upb/upb/encode.c', + 'third_party/upb/upb/msg.c', + 'third_party/upb/upb/port.c', + 'third_party/upb/upb/table.c', + 'third_party/upb/upb/upb.c', 'src/core/tsi/transport_security.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', @@ -348,7 +349,7 @@ CORE_SOURCE_FILES = [ 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/filters/client_channel/health/health.pb.c', + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', 'src/core/tsi/fake_transport_security.cc', 'src/core/tsi/local_transport_security.cc', 'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc', @@ -367,14 +368,42 @@ CORE_SOURCE_FILES = [ 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', + 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', + 'src/core/ext/upb-generated/google/api/annotations.upb.c', + 'src/core/ext/upb-generated/google/api/http.upb.c', + 'src/core/ext/upb-generated/google/protobuf/any.upb.c', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', + 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc', + 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c', + 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c', + 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c', + 'src/core/ext/upb-generated/envoy/type/percent.upb.c', + 'src/core/ext/upb-generated/envoy/type/range.upb.c', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', + 'src/core/ext/upb-generated/validate/validate.upb.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', @@ -390,6 +419,7 @@ CORE_SOURCE_FILES = [ 'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc', 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc', 'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc', + 'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc', 'src/core/ext/filters/census/grpc_context.cc', 'src/core/ext/filters/client_idle/client_idle_filter.cc', 'src/core/ext/filters/max_age/max_age_filter.cc', diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index 548d2810b5b..e0280abaa7c 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/python/grpcio_channelz/grpc_version.py b/src/python/grpcio_channelz/grpc_version.py index f7029fff484..93a448ecb64 100644 --- a/src/python/grpcio_channelz/grpc_version.py +++ b/src/python/grpcio_channelz/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py index d66daa473ed..2a1aa0c9359 100644 --- a/src/python/grpcio_health_checking/grpc_version.py +++ b/src/python/grpcio_health_checking/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/python/grpcio_reflection/grpc_version.py b/src/python/grpcio_reflection/grpc_version.py index 97213872a91..93c28ba9fac 100644 --- a/src/python/grpcio_reflection/grpc_version.py +++ b/src/python/grpcio_reflection/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/python/grpcio_status/grpc_version.py b/src/python/grpcio_status/grpc_version.py index 31921b4cc90..a2b5a814b52 100644 --- a/src/python/grpcio_status/grpc_version.py +++ b/src/python/grpcio_status/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/python/grpcio_testing/grpc_version.py b/src/python/grpcio_testing/grpc_version.py index 5c8926cb6c8..937e57da02f 100644 --- a/src/python/grpcio_testing/grpc_version.py +++ b/src/python/grpcio_testing/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py index a1fc87448a1..a1e43215b09 100644 --- a/src/python/grpcio_tests/grpc_version.py +++ b/src/python/grpcio_tests/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c index fa275c75419..6cb10c9126c 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c @@ -164,6 +164,8 @@ grpc_tls_credentials_options_set_credential_reload_config_type grpc_tls_credenti grpc_tls_credentials_options_set_server_authorization_check_config_type grpc_tls_credentials_options_set_server_authorization_check_config_import; grpc_tls_key_materials_config_create_type grpc_tls_key_materials_config_create_import; grpc_tls_key_materials_config_set_key_materials_type grpc_tls_key_materials_config_set_key_materials_import; +grpc_tls_key_materials_config_set_version_type grpc_tls_key_materials_config_set_version_import; +grpc_tls_key_materials_config_get_version_type grpc_tls_key_materials_config_get_version_import; grpc_tls_credential_reload_config_create_type grpc_tls_credential_reload_config_create_import; grpc_tls_server_authorization_check_config_create_type grpc_tls_server_authorization_check_config_create_import; grpc_raw_byte_buffer_create_type grpc_raw_byte_buffer_create_import; @@ -435,6 +437,8 @@ void grpc_rb_load_imports(HMODULE library) { grpc_tls_credentials_options_set_server_authorization_check_config_import = (grpc_tls_credentials_options_set_server_authorization_check_config_type) GetProcAddress(library, "grpc_tls_credentials_options_set_server_authorization_check_config"); grpc_tls_key_materials_config_create_import = (grpc_tls_key_materials_config_create_type) GetProcAddress(library, "grpc_tls_key_materials_config_create"); grpc_tls_key_materials_config_set_key_materials_import = (grpc_tls_key_materials_config_set_key_materials_type) GetProcAddress(library, "grpc_tls_key_materials_config_set_key_materials"); + grpc_tls_key_materials_config_set_version_import = (grpc_tls_key_materials_config_set_version_type) GetProcAddress(library, "grpc_tls_key_materials_config_set_version"); + grpc_tls_key_materials_config_get_version_import = (grpc_tls_key_materials_config_get_version_type) GetProcAddress(library, "grpc_tls_key_materials_config_get_version"); grpc_tls_credential_reload_config_create_import = (grpc_tls_credential_reload_config_create_type) GetProcAddress(library, "grpc_tls_credential_reload_config_create"); grpc_tls_server_authorization_check_config_create_import = (grpc_tls_server_authorization_check_config_create_type) GetProcAddress(library, "grpc_tls_server_authorization_check_config_create"); grpc_raw_byte_buffer_create_import = (grpc_raw_byte_buffer_create_type) GetProcAddress(library, "grpc_raw_byte_buffer_create"); diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h index 1389c301728..46912af5f5a 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h @@ -467,6 +467,12 @@ extern grpc_tls_key_materials_config_create_type grpc_tls_key_materials_config_c typedef int(*grpc_tls_key_materials_config_set_key_materials_type)(grpc_tls_key_materials_config* config, const char* pem_root_certs, const grpc_ssl_pem_key_cert_pair** pem_key_cert_pairs, size_t num_key_cert_pairs); extern grpc_tls_key_materials_config_set_key_materials_type grpc_tls_key_materials_config_set_key_materials_import; #define grpc_tls_key_materials_config_set_key_materials grpc_tls_key_materials_config_set_key_materials_import +typedef int(*grpc_tls_key_materials_config_set_version_type)(grpc_tls_key_materials_config* config, int version); +extern grpc_tls_key_materials_config_set_version_type grpc_tls_key_materials_config_set_version_import; +#define grpc_tls_key_materials_config_set_version grpc_tls_key_materials_config_set_version_import +typedef int(*grpc_tls_key_materials_config_get_version_type)(grpc_tls_key_materials_config* config); +extern grpc_tls_key_materials_config_get_version_type grpc_tls_key_materials_config_get_version_import; +#define grpc_tls_key_materials_config_get_version grpc_tls_key_materials_config_get_version_import typedef grpc_tls_credential_reload_config*(*grpc_tls_credential_reload_config_create_type)(const void* config_user_data, int (*schedule)(void* config_user_data, grpc_tls_credential_reload_arg* arg), void (*cancel)(void* config_user_data, grpc_tls_credential_reload_arg* arg), void (*destruct)(void* config_user_data)); extern grpc_tls_credential_reload_config_create_type grpc_tls_credential_reload_config_create_import; #define grpc_tls_credential_reload_config_create grpc_tls_credential_reload_config_create_import diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index 051bc067e55..43f08a0c87b 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -14,5 +14,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '1.23.0.dev' + VERSION = '1.24.0.dev' end diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb index e66a4a799fd..b08edb08478 100644 --- a/src/ruby/tools/version.rb +++ b/src/ruby/tools/version.rb @@ -14,6 +14,6 @@ module GRPC module Tools - VERSION = '1.23.0.dev' + VERSION = '1.24.0.dev' end end diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c index e537e482936..f1f3c7a2745 100644 --- a/test/core/surface/public_headers_must_be_c89.c +++ b/test/core/surface/public_headers_must_be_c89.c @@ -201,6 +201,8 @@ int main(int argc, char **argv) { printf("%lx", (unsigned long) grpc_tls_credentials_options_set_server_authorization_check_config); printf("%lx", (unsigned long) grpc_tls_key_materials_config_create); printf("%lx", (unsigned long) grpc_tls_key_materials_config_set_key_materials); + printf("%lx", (unsigned long) grpc_tls_key_materials_config_set_version); + printf("%lx", (unsigned long) grpc_tls_key_materials_config_get_version); printf("%lx", (unsigned long) grpc_tls_credential_reload_config_create); printf("%lx", (unsigned long) grpc_tls_server_authorization_check_config_create); printf("%lx", (unsigned long) grpc_raw_byte_buffer_create); diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 866d00e34f4..93aa45e05c4 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -296,10 +296,8 @@ TEST_F(CredentialsTest, TlsKeyMaterialsCtoCpp) { EXPECT_STREQ("cert_chain", cpp_pair_list[0].cert_chain.c_str()); } -typedef class ::grpc_impl::experimental::TlsCredentialReloadArg - TlsCredentialReloadArg; -typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig - TlsCredentialReloadConfig; +typedef class ::grpc_impl::experimental::TlsCredentialReloadArg TlsCredentialReloadArg; +typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig TlsCredentialReloadConfig; TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { grpc_tls_credential_reload_arg c_arg; @@ -321,7 +319,8 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { "cert_chain1"}; struct TlsKeyMaterialsConfig::PemKeyCertPair pair2 = {"private_key2", "cert_chain2"}; - std::vector pair_list = {pair1, pair2}; + std::vector pair_list = {pair1, + pair2}; key_materials_config->set_key_materials("pem_root_certs", pair_list); arg.set_key_materials_config(key_materials_config); arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py index 127d3c1f9bc..184a0a9dda6 100644 --- a/tools/distrib/python/grpcio_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 114d5147eef..63ee5f0ad20 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.23.0-dev +PROJECT_NUMBER = 1.24.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -972,6 +972,7 @@ include/grpcpp/impl/codegen/config_protobuf.h \ include/grpcpp/impl/codegen/core_codegen.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ +include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 0e99b88a4db..f1bc3c010e5 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.23.0-dev +PROJECT_NUMBER = 1.24.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -974,6 +974,7 @@ include/grpcpp/impl/codegen/core_codegen.h \ include/grpcpp/impl/codegen/core_codegen.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ +include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -1059,9 +1060,9 @@ include/grpcpp/support/sync_stream.h \ include/grpcpp/support/sync_stream_impl.h \ include/grpcpp/support/time.h \ include/grpcpp/support/validate_service_config.h \ -src/core/ext/filters/client_channel/health/health.pb.c \ -src/core/ext/filters/client_channel/health/health.pb.h \ src/core/ext/transport/inproc/inproc_transport.h \ +src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ +src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h \ src/core/lib/avl/avl.h \ src/core/lib/backoff/backoff.h \ src/core/lib/channel/channel_args.h \ @@ -1294,12 +1295,23 @@ src/cpp/util/status.cc \ src/cpp/util/string_ref.cc \ src/cpp/util/time_cc.cc \ third_party/nanopb/pb.h \ -third_party/nanopb/pb_common.c \ third_party/nanopb/pb_common.h \ -third_party/nanopb/pb_decode.c \ third_party/nanopb/pb_decode.h \ -third_party/nanopb/pb_encode.c \ -third_party/nanopb/pb_encode.h +third_party/nanopb/pb_encode.h \ +third_party/upb/upb/decode.c \ +third_party/upb/upb/decode.h \ +third_party/upb/upb/encode.c \ +third_party/upb/upb/encode.h \ +third_party/upb/upb/generated_util.h \ +third_party/upb/upb/msg.c \ +third_party/upb/upb/msg.h \ +third_party/upb/upb/port.c \ +third_party/upb/upb/port_def.inc \ +third_party/upb/upb/port_undef.inc \ +third_party/upb/upb/table.c \ +third_party/upb/upb/table.int.h \ +third_party/upb/upb/upb.c \ +third_party/upb/upb/upb.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index 2836412b031..f4533f240bd 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 7.0.0 +PROJECT_NUMBER = 8.0.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 6c1253f7ae8..e2900b2e701 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 7.0.0 +PROJECT_NUMBER = 8.0.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -889,8 +889,6 @@ src/core/ext/filters/client_channel/connector.cc \ src/core/ext/filters/client_channel/connector.h \ src/core/ext/filters/client_channel/global_subchannel_pool.cc \ src/core/ext/filters/client_channel/global_subchannel_pool.h \ -src/core/ext/filters/client_channel/health/health.pb.c \ -src/core/ext/filters/client_channel/health/health.pb.h \ src/core/ext/filters/client_channel/health/health_check_client.cc \ src/core/ext/filters/client_channel/health/health_check_client.h \ src/core/ext/filters/client_channel/http_connect_handshaker.cc \ @@ -909,12 +907,6 @@ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h \ -src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \ -src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h \ -src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \ -src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h \ -src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ -src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/client_channel/lb_policy/subchannel_list.h \ @@ -960,6 +952,7 @@ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h \ src/core/ext/filters/client_channel/resolver/sockaddr/README.md \ src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \ +src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \ src/core/ext/filters/client_channel/resolver_factory.h \ src/core/ext/filters/client_channel/resolver_registry.cc \ src/core/ext/filters/client_channel/resolver_registry.h \ @@ -1066,6 +1059,76 @@ src/core/ext/transport/chttp2/transport/writing.cc \ src/core/ext/transport/inproc/inproc_plugin.cc \ src/core/ext/transport/inproc/inproc_transport.cc \ src/core/ext/transport/inproc/inproc_transport.h \ +src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/cds.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/eds.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h \ +src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c \ +src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h \ +src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c \ +src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h \ +src/core/ext/upb-generated/envoy/type/percent.upb.c \ +src/core/ext/upb-generated/envoy/type/percent.upb.h \ +src/core/ext/upb-generated/envoy/type/range.upb.c \ +src/core/ext/upb-generated/envoy/type/range.upb.h \ +src/core/ext/upb-generated/gogoproto/gogo.upb.c \ +src/core/ext/upb-generated/gogoproto/gogo.upb.h \ +src/core/ext/upb-generated/google/api/annotations.upb.c \ +src/core/ext/upb-generated/google/api/annotations.upb.h \ +src/core/ext/upb-generated/google/api/http.upb.c \ +src/core/ext/upb-generated/google/api/http.upb.h \ +src/core/ext/upb-generated/google/protobuf/any.upb.c \ +src/core/ext/upb-generated/google/protobuf/any.upb.h \ +src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ +src/core/ext/upb-generated/google/protobuf/descriptor.upb.h \ +src/core/ext/upb-generated/google/protobuf/duration.upb.c \ +src/core/ext/upb-generated/google/protobuf/duration.upb.h \ +src/core/ext/upb-generated/google/protobuf/empty.upb.c \ +src/core/ext/upb-generated/google/protobuf/empty.upb.h \ +src/core/ext/upb-generated/google/protobuf/struct.upb.c \ +src/core/ext/upb-generated/google/protobuf/struct.upb.h \ +src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ +src/core/ext/upb-generated/google/protobuf/timestamp.upb.h \ +src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ +src/core/ext/upb-generated/google/protobuf/wrappers.upb.h \ +src/core/ext/upb-generated/google/rpc/status.upb.c \ +src/core/ext/upb-generated/google/rpc/status.upb.h \ +src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \ +src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h \ +src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \ +src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h \ +src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c \ +src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h \ +src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ +src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h \ +src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ +src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h \ +src/core/ext/upb-generated/validate/validate.upb.c \ +src/core/ext/upb-generated/validate/validate.upb.h \ src/core/lib/README.md \ src/core/lib/avl/avl.cc \ src/core/lib/avl/avl.h \ @@ -1542,10 +1605,6 @@ src/core/tsi/alts/frame_protector/frame_handler.cc \ src/core/tsi/alts/frame_protector/frame_handler.h \ src/core/tsi/alts/handshaker/alts_handshaker_client.cc \ src/core/tsi/alts/handshaker/alts_handshaker_client.h \ -src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc \ -src/core/tsi/alts/handshaker/alts_handshaker_service_api.h \ -src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc \ -src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h \ src/core/tsi/alts/handshaker/alts_shared_resource.cc \ src/core/tsi/alts/handshaker/alts_shared_resource.h \ src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc \ @@ -1553,12 +1612,6 @@ src/core/tsi/alts/handshaker/alts_tsi_handshaker.h \ src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h \ src/core/tsi/alts/handshaker/alts_tsi_utils.cc \ src/core/tsi/alts/handshaker/alts_tsi_utils.h \ -src/core/tsi/alts/handshaker/altscontext.pb.c \ -src/core/tsi/alts/handshaker/altscontext.pb.h \ -src/core/tsi/alts/handshaker/handshaker.pb.c \ -src/core/tsi/alts/handshaker/handshaker.pb.h \ -src/core/tsi/alts/handshaker/transport_security_common.pb.c \ -src/core/tsi/alts/handshaker/transport_security_common.pb.h \ src/core/tsi/alts/handshaker/transport_security_common_api.cc \ src/core/tsi/alts/handshaker/transport_security_common_api.h \ src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc \ @@ -1590,13 +1643,20 @@ src/core/tsi/transport_security.h \ src/core/tsi/transport_security_grpc.cc \ src/core/tsi/transport_security_grpc.h \ src/core/tsi/transport_security_interface.h \ -third_party/nanopb/pb.h \ -third_party/nanopb/pb_common.c \ -third_party/nanopb/pb_common.h \ -third_party/nanopb/pb_decode.c \ -third_party/nanopb/pb_decode.h \ -third_party/nanopb/pb_encode.c \ -third_party/nanopb/pb_encode.h +third_party/upb/upb/decode.c \ +third_party/upb/upb/decode.h \ +third_party/upb/upb/encode.c \ +third_party/upb/upb/encode.h \ +third_party/upb/upb/generated_util.h \ +third_party/upb/upb/msg.c \ +third_party/upb/upb/msg.h \ +third_party/upb/upb/port.c \ +third_party/upb/upb/port_def.inc \ +third_party/upb/upb/port_undef.inc \ +third_party/upb/upb/table.c \ +third_party/upb/upb/table.int.h \ +third_party/upb/upb/upb.c \ +third_party/upb/upb/upb.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index f6aac1d8cd0..6dd3f1422e5 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -3251,30 +3251,6 @@ ], "uses_polling": true }, - { - "args": [], - "benchmark": false, - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": false, - "language": "c++", - "name": "alts_handshaker_service_api_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "uses_polling": true - }, { "args": [], "benchmark": false, @@ -3927,6 +3903,28 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": true, + "ci_platforms": [ + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": false, + "language": "c++", + "name": "bm_threadpool", + "platforms": [ + "linux", + "mac", + "posix" + ], + "uses_polling": false + }, { "args": [], "benchmark": true, @@ -4523,6 +4521,30 @@ ], "uses_polling": false }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "delegating_channel_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": true + }, { "args": [], "benchmark": false, @@ -4789,6 +4811,30 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "grpc_spiffe_security_connector_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": true + }, { "args": [], "benchmark": false, From d761619484803b39a563bf09ffec6398fa67f161 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 20 Aug 2019 16:08:10 -0700 Subject: [PATCH 27/70] Finished unit tests --- test/cpp/client/credentials_test.cc | 138 +++++++++++++++++++++++++--- 1 file changed, 126 insertions(+), 12 deletions(-) diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 93aa45e05c4..cd96738f6fa 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -71,13 +71,31 @@ static void tls_credential_reload_cancel(void* config_user_data, static void tls_server_authorization_check_callback( grpc_tls_server_authorization_check_arg* arg) { GPR_ASSERT(arg != nullptr); - char* cb_user_data = "cb_user_data"; - arg->set_cb_user_data(static_cast(gpr_strdup(cb_user_data))); + grpc::string cb_user_data = "cb_user_data"; + arg->cb_user_data(static_cast(gpr_strdup(cb_user_data.c_str()))); + arg->success(1); + arg->target_name("callback_target_name"); + arg->peer_cert("callback_peer_cert"); + arg->status(GRPC_STATUS_OK); + arg->error_details("callback_error_details"); +} + +static int tls_server_authorization_check_sync(void* config_user_data, TlsServerAuthorizationCheckArg* arg) { + GPR_ASSERT(arg != nullptr); + grpc::string cb_user_data = "cb_user_data"; + arg->set_cb_user_data(static_cast(gpr_strdup(cb_user_data.c_str()))); arg->set_success(1); - arg->set_target_name("callback_target_name"); - arg->set_peer_cert("callback_peer_cert"); + arg->set_target_name("sync_target_name"); + arg->set_peer_cert("sync_peer_cert"); arg->set_status(GRPC_STATUS_OK); - arg->set_error_details("callback_error_details"); + arg->set_error_details("sync_error_details"); + return 1; +} + +static void tls_server_authorization_check_cancel(void* config_user_data, TlsServerAuthorizationCheckArg* arg) { + GPR_ASSERT(arg != nullptr); + arg->set_status(GRPC_STATUS_PERMISSION_DENIED); + arg->set_error_details("cancelled"); } } // namespace @@ -254,12 +272,12 @@ typedef class ::grpc_impl::experimental::TlsKeyMaterialsConfig TlsKeyMaterialsConfig; TEST_F(CredentialsTest, TlsKeyMaterialsConfigCppToC) { - TlsKeyMaterialsConfig config; + std::shared_ptr config(new TlsKeyMaterialsConfig()); struct TlsKeyMaterialsConfig::PemKeyCertPair pair = {"private_key", "cert_chain"}; std::vector pair_list = {pair}; - config.set_key_materials("pem_root_certs", pair_list); - grpc_tls_key_materials_config* c_config = config.c_key_materials(); + config->set_key_materials("pem_root_certs", pair_list); + grpc_tls_key_materials_config* c_config = c_key_materials(config); EXPECT_STREQ("pem_root_certs", c_config->pem_root_certs()); EXPECT_EQ(1, static_cast(c_config->pem_key_cert_pair_list().size())); EXPECT_STREQ(pair.private_key.c_str(), @@ -416,6 +434,52 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { EXPECT_STREQ(arg.error_details()->c_str(), "callback_error_details"); } +TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { + TlsServerAuthorizationCheckConfig config = TlsServerAuthorizationCheckConfig(nullptr, &tls_server_authorization_check_sync, nullptr, nullptr); + TlsServerAuthorizationCheckArg arg; + arg.set_cb_user_data(nullptr); + arg.set_success(0); + arg.set_target_name("target_name"); + arg.set_peer_cert("peer_cert"); + arg.set_status(GRPC_STATUS_PERMISSION_DENIED); + arg.set_error_details("error_details"); + int schedule_output = config.Schedule(&arg); + EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); + EXPECT_EQ(arg.success(), 1); + EXPECT_STREQ(arg.target_name()->c_str(), "sync_target_name"); + EXPECT_STREQ(arg.peer_cert()->c_str(), "sync_peer_cert"); + EXPECT_EQ(arg.status(), GRPC_STATUS_OK); + EXPECT_STREQ(arg.error_details(), "sync_error_details"); +} + +TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { + TlsServerAuthorizationCheckConfig config = TlsServerAuthorizationCheckConfig( + nullptr, &tls_server_authorization_check_sync, &tls_server_authorization_check_cancel, nullptr); + grpc_tls_server_authorization_check_arg c_arg; + c_arg.cb = tls_server_authorization_check_callback; + c_arg.cb_user_data = nullptr; + c_arg.success = 0; + c_arg.target_name = "target_name"; + c_arg.peer_cert = "peer_cert"; + c_arg.status = GRPC_STATUS_UNAUTHENTICATED; + c_arg.error_details = "error_details"; + + grpc_tls_server_authorization_check_config* c_config = config.c_server_authorization_check(); + c_arg.config = c_config; + int c_schedule_output = c_config->Schedule(&c_arg); + EXPECT_EQ(c_schedule_output, 1); + EXPECT_STREQ(static_cast(c_arg.cb_user_data), "cb_user_data"); + EXPECT_EQ(c_arg.success, 1); + EXPECT_STREQ(c_arg.target_name, "sync_target_name"); + EXPECT_STREQ(c_arg.peer_cert, "sync_peer_cert"); + EXPECT_EQ(c_arg.status, GRPC_STATUS_OK); + EXPECT_STREQ(c_arg.error_details, "sync_error_details"); + + c_config->Cancel(&c_arg); + EXPECT_EQ(c_arg.status, GRPC_STATUS_PERMISSION_DENIED); + EXPECT_STREQ(c_arg.error_details, "cancelled"); +} + typedef class ::grpc_impl::experimental::TlsCredentialsOptions TlsCredentialsOptions; @@ -429,13 +493,63 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { std::vector pair_list = {pair}; key_materials_config->set_key_materials("pem_root_certs", pair_list); options.set_key_materials_config(key_materials_config); - // TODO: add instances of credential reload and server authorization check to - // options. + + std::shared_ptr credential_reload_config(new TlsCredentialReloadConfig( + nullptr, &tls_credential_reload_sync, &tls_credential_reload_cancel, nullptr)); + options.set_credential_reload_config(credential_reload_config); + + std::shared_ptr server_authorization_check_config(new TlsServerAuthorizationCheckConfig( + nullptr, &tls_server_authorization_check_sync, &tls_server_authorization_check_cancel, nullptr)); + options.set_server_authorization_check_config(server_authorization_check_config); + grpc_tls_credentials_options* c_options = options.c_credentials_options(); EXPECT_EQ(c_options->cert_request_type(), GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY); - EXPECT_EQ(c_options->key_materials_config(), - key_materials_config->c_key_materials()); + grpc_tls_key_materials_config* c_key_materials_config = c_options->key_materials_config(); + grpc_tls_credential_reload_config* c_credential_reload_config = c_options->credential_reload_config(); + grpc_tls_credential_reload_arg* c_credential_reload_arg; + c_credential_reload_arg.key_materials_config = c_key_materials_config; + c_credential_reload_arg.status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + grpc::string test_error_details = "error_details"; + c_credential_reload_arg.error_details = test_error_details.c_str(); + grpc_tls_server_authorization_check_config* c_server_authorization_check_config = c_options->server_authorization_check_config(); + grpc_tls_server_authorization_check_arg c_server_authorization_check_arg; + c_server_authorization_check_arg.cb = tls_server_authorization_check_callback; + c_server_authorization_check_arg.cb_user_data = nullptr; + c_server_authorization_check_arg.success = 0; + c_server_authorization_check_arg.target_name = "target_name"; + c_server_authorization_check_arg.peer_cert = "peer_cert"; + c_server_authorization_check_arg.status = GRPC_STATUS_UNAUTHENTICATED; + c_server_authorization_check_arg.error_details = "error_details"; + + EXPECT_STREQ(c_key_materials_config->pem_root_certs(), "pem_root_certs"); + EXPECT_EQ(static_cast(c_key_materials_config->pem_key_cert_pair_list().size()), 1); + EXPECT_STREQ(c_key_materials_config->pem_key_cert_pair_list()[0].private_key(), "private_key"); + EXPECT_STREQ(c_key_materials_config->pem_key_cert_pair_list()[0].cert_chain(), "cert_chain"); + + int c_credential_reload_schedule_output = c_credential_reload_config->Schedule(&c_credential_reload_arg); + EXPECT_EQ(c_credential_reload_schedule_output, 0); + EXPECT_EQ(c_credential_reload_arg.cb_user_data, nullptr); + EXPECT_STREQ(c_credential_reload_arg.key_materials_config->pem_root_certs(), "new_pem_root_certs"); + ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> pair_list = + c_credential_reload_arg.key_materials_config->pem_key_cert_pair_list(); + EXPECT_EQ(static_cast(pair_list.size()), 2); + EXPECT_STREQ(pair_list[0].private_key(), "private_key"); + EXPECT_STREQ(pair_list[0].cert_chain(), "cert_chain"); + EXPECT_STREQ(pair_list[1].private_key(), "private_key3"); + EXPECT_STREQ(pair_list[1].cert_chain(), "cert_chain3"); + EXPECT_EQ(c_credential_reload_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + EXPECT_STREQ(c_credential_reload_arg.error_details, test_error_details.c_str()); + + int c_server_authorization_check_schedule_output = c_server_authorization_check_config->Schedule(&c_server_authorization_check_arg); + EXPECT_EQ(c_server_authorization_check_schedule_output, 1); + EXPECT_STREQ(static_cast(c_server_authorization_check_arg.cb_user_data), "cb_user_data"); + EXPECT_EQ(c_server_authorization_check_arg.success, 1); + EXPECT_STREQ(c_server_authorization_check_arg.target_name, "sync_target_name"); + EXPECT_STREQ(c_server_authorization_check_arg.peer_cert, "sync_peer_cert"); + EXPECT_EQ(c_server_authorization_check_arg.status, GRPC_STATUS_OK); + EXPECT_STREQ(c_server_authorization_check_arg.error_details, "sync_error_details"); + gpr_free(c_options); } From e37836b0c771e1dc2ed84c457936e56a3668fa6d Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 21 Aug 2019 08:46:02 -0700 Subject: [PATCH 28/70] Fixed a few typos in unit tests --- test/cpp/client/credentials_test.cc | 35 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index cd96738f6fa..92d2782b9b4 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -36,8 +36,8 @@ typedef class ::grpc_impl::experimental::TlsKeyMaterialsConfig TlsKeyMaterialsConfig; typedef class ::grpc_impl::experimental::TlsCredentialReloadArg TlsCredentialReloadArg; -typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig - TlsCredentialReloadConfig; +typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckArg + TlsServerAuthorizationCheckArg; static void tls_credential_reload_callback( grpc_tls_credential_reload_arg* arg) { @@ -72,12 +72,12 @@ static void tls_server_authorization_check_callback( grpc_tls_server_authorization_check_arg* arg) { GPR_ASSERT(arg != nullptr); grpc::string cb_user_data = "cb_user_data"; - arg->cb_user_data(static_cast(gpr_strdup(cb_user_data.c_str()))); - arg->success(1); - arg->target_name("callback_target_name"); - arg->peer_cert("callback_peer_cert"); - arg->status(GRPC_STATUS_OK); - arg->error_details("callback_error_details"); + arg->cb_user_data = static_cast(gpr_strdup(cb_user_data.c_str())); + arg->success = 1; + arg->target_name = "callback_target_name"; + arg->peer_cert = "callback_peer_cert"; + arg->status = GRPC_STATUS_OK; + arg->error_details = "callback_error_details"; } static int tls_server_authorization_check_sync(void* config_user_data, TlsServerAuthorizationCheckArg* arg) { @@ -405,7 +405,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); EXPECT_STREQ(c_arg.error_details, test_error_details.c_str()); - c_config->(&c_arg); + c_config->Cancel(&c_arg); EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); EXPECT_STREQ(c_arg.error_details, "cancelled"); } @@ -444,12 +444,13 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { arg.set_status(GRPC_STATUS_PERMISSION_DENIED); arg.set_error_details("error_details"); int schedule_output = config.Schedule(&arg); + EXPECT_EQ(schedule_output, 0); EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); EXPECT_EQ(arg.success(), 1); EXPECT_STREQ(arg.target_name()->c_str(), "sync_target_name"); EXPECT_STREQ(arg.peer_cert()->c_str(), "sync_peer_cert"); EXPECT_EQ(arg.status(), GRPC_STATUS_OK); - EXPECT_STREQ(arg.error_details(), "sync_error_details"); + EXPECT_STREQ(arg.error_details()->c_str(), "sync_error_details"); } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { @@ -507,7 +508,7 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY); grpc_tls_key_materials_config* c_key_materials_config = c_options->key_materials_config(); grpc_tls_credential_reload_config* c_credential_reload_config = c_options->credential_reload_config(); - grpc_tls_credential_reload_arg* c_credential_reload_arg; + grpc_tls_credential_reload_arg c_credential_reload_arg; c_credential_reload_arg.key_materials_config = c_key_materials_config; c_credential_reload_arg.status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; grpc::string test_error_details = "error_details"; @@ -531,13 +532,13 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { EXPECT_EQ(c_credential_reload_schedule_output, 0); EXPECT_EQ(c_credential_reload_arg.cb_user_data, nullptr); EXPECT_STREQ(c_credential_reload_arg.key_materials_config->pem_root_certs(), "new_pem_root_certs"); - ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> pair_list = + ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> c_pair_list = c_credential_reload_arg.key_materials_config->pem_key_cert_pair_list(); - EXPECT_EQ(static_cast(pair_list.size()), 2); - EXPECT_STREQ(pair_list[0].private_key(), "private_key"); - EXPECT_STREQ(pair_list[0].cert_chain(), "cert_chain"); - EXPECT_STREQ(pair_list[1].private_key(), "private_key3"); - EXPECT_STREQ(pair_list[1].cert_chain(), "cert_chain3"); + EXPECT_EQ(static_cast(c_pair_list.size()), 2); + EXPECT_STREQ(c_pair_list[0].private_key(), "private_key"); + EXPECT_STREQ(c_pair_list[0].cert_chain(), "cert_chain"); + EXPECT_STREQ(c_pair_list[1].private_key(), "private_key3"); + EXPECT_STREQ(c_pair_list[1].cert_chain(), "cert_chain3"); EXPECT_EQ(c_credential_reload_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); EXPECT_STREQ(c_credential_reload_arg.error_details, test_error_details.c_str()); From 967b911f85c4259d047b90509522d718d1235337 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 21 Aug 2019 09:08:15 -0700 Subject: [PATCH 29/70] Add forgotten callback function for server authorization check. --- .../grpcpp/security/tls_credentials_options.h | 16 ++-- src/cpp/common/tls_credentials_options.cc | 45 +++++----- test/cpp/client/credentials_test.cc | 89 ++++++++++++------- 3 files changed, 91 insertions(+), 59 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 7db070d7e8f..9cba5aa27bc 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -48,7 +48,7 @@ class TlsKeyMaterialsConfig { * transfers ownership of the arguments to the config. **/ void set_key_materials(grpc::string pem_root_certs, std::vector pem_key_cert_pair_list); - void set_version(int version) { version_ = version;}; + void set_version(int version) { version_ = version; }; private: int version_; @@ -63,7 +63,6 @@ grpc_tls_key_materials_config* c_key_materials( std::shared_ptr tls_key_materials_c_to_cpp( const grpc_tls_key_materials_config* config); - /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ class TlsCredentialReloadArg { public: @@ -80,7 +79,7 @@ class TlsCredentialReloadArg { /** Setters for member fields. **/ void set_cb_user_data(void* cb_user_data); void set_key_materials_config( - std::shared_ptr key_materials_config); + const std::shared_ptr& key_materials_config); void set_status(grpc_ssl_certificate_config_reload_status status); void set_error_details(const grpc::string& error_details); @@ -167,9 +166,8 @@ class TlsServerAuthorizationCheckArg { // Exposed for testing purposes. int tls_server_authorization_check_config_c_schedule( void* config_user_data, grpc_tls_server_authorization_check_arg* arg); -void tls_server_authorization_check_config_c_cancel(void* config_user_data, - grpc_tls_server_authorization_check_arg* arg); - +void tls_server_authorization_check_config_c_cancel( + void* config_user_data, grpc_tls_server_authorization_check_arg* arg); /** TLS server authorization check config, wraps * grps_tls_server_authorization_check_config. **/ @@ -197,7 +195,8 @@ class TlsServerAuthorizationCheckConfig { } /** Creates C struct for the credential reload config. **/ - grpc_tls_server_authorization_check_config* c_server_authorization_check() const { + grpc_tls_server_authorization_check_config* c_server_authorization_check() + const { return c_config_; } @@ -219,8 +218,7 @@ class TlsCredentialsOptions { std::shared_ptr key_materials_config() const { return key_materials_config_; } - std::shared_ptr credential_reload_config() - const { + std::shared_ptr credential_reload_config() const { return credential_reload_config_; } std::shared_ptr diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index a48e9f94ba6..4d42affed07 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -32,13 +32,15 @@ void TlsKeyMaterialsConfig::set_key_materials( } /** Creates a new C struct for the key materials. **/ -grpc_tls_key_materials_config* c_key_materials(const std::shared_ptr& config) { +grpc_tls_key_materials_config* c_key_materials( + const std::shared_ptr& config) { grpc_tls_key_materials_config* c_config = grpc_tls_key_materials_config_create(); ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> c_pem_key_cert_pair_list; for (auto key_cert_pair = config->pem_key_cert_pair_list().begin(); - key_cert_pair != config->pem_key_cert_pair_list().end(); key_cert_pair++) { + key_cert_pair != config->pem_key_cert_pair_list().end(); + key_cert_pair++) { grpc_ssl_pem_key_cert_pair* ssl_pair = (grpc_ssl_pem_key_cert_pair*)gpr_malloc( sizeof(grpc_ssl_pem_key_cert_pair)); @@ -48,7 +50,8 @@ grpc_tls_key_materials_config* c_key_materials(const std::shared_ptr c_pem_root_certs(gpr_strdup(config->pem_root_certs().c_str())); + ::grpc_core::UniquePtr c_pem_root_certs( + gpr_strdup(config->pem_root_certs().c_str())); c_config->set_key_materials(std::move(c_pem_root_certs), std::move(c_pem_key_cert_pair_list)); c_config->set_version(config->version()); @@ -60,8 +63,7 @@ std::shared_ptr tls_key_materials_c_to_cpp( const grpc_tls_key_materials_config* config) { std::shared_ptr cpp_config( new TlsKeyMaterialsConfig()); - std::vector - cpp_pem_key_cert_pair_list; + std::vector cpp_pem_key_cert_pair_list; grpc_tls_key_materials_config::PemKeyCertPairList pem_key_cert_pair_list = config->pem_key_cert_pair_list(); for (size_t i = 0; i < pem_key_cert_pair_list.size(); i++) { @@ -71,9 +73,8 @@ std::shared_ptr tls_key_materials_c_to_cpp( gpr_strdup(key_cert_pair.cert_chain())}; cpp_pem_key_cert_pair_list.push_back(::std::move(p)); } - cpp_config->set_key_materials( - std::move(gpr_strdup(config->pem_root_certs())), - std::move(cpp_pem_key_cert_pair_list)); + cpp_config->set_key_materials(std::move(gpr_strdup(config->pem_root_certs())), + std::move(cpp_pem_key_cert_pair_list)); cpp_config->set_version(config->version()); return cpp_config; } @@ -95,16 +96,19 @@ void* TlsCredentialReloadArg::cb_user_data() const { /** This function creates a new TlsKeyMaterialsConfig instance whose fields are * not shared with the corresponding key materials config fields of the * TlsCredentialReloadArg instance. **/ -std::shared_ptr TlsCredentialReloadArg::key_materials_config() const { +std::shared_ptr +TlsCredentialReloadArg::key_materials_config() const { return tls_key_materials_c_to_cpp(c_arg_.key_materials_config); } -grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() const { +grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() + const { return c_arg_.status; } std::shared_ptr TlsCredentialReloadArg::error_details() const { - std::shared_ptr cpp_error_details(new grpc::string(c_arg_.error_details)); + std::shared_ptr cpp_error_details( + new grpc::string(c_arg_.error_details)); return cpp_error_details; } @@ -113,7 +117,7 @@ void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { } void TlsCredentialReloadArg::set_key_materials_config( - std::shared_ptr key_materials_config) { + const std::shared_ptr& key_materials_config) { c_arg_.key_materials_config = c_key_materials(key_materials_config); } @@ -122,13 +126,12 @@ void TlsCredentialReloadArg::set_status( c_arg_.status = status; } -void TlsCredentialReloadArg::set_error_details(const grpc::string& error_details) { +void TlsCredentialReloadArg::set_error_details( + const grpc::string& error_details) { c_arg_.error_details = gpr_strdup(error_details.c_str()); } -void TlsCredentialReloadArg::callback() { - c_arg_.cb(&c_arg_); -} +void TlsCredentialReloadArg::callback() { c_arg_.cb(&c_arg_); } /** The C schedule and cancel functions for the credential reload config. **/ int tls_credential_reload_config_c_schedule( @@ -211,7 +214,7 @@ grpc_status_code TlsServerAuthorizationCheckArg::status() const { std::shared_ptr TlsServerAuthorizationCheckArg::error_details() const { std::shared_ptr cpp_error_details( -new grpc::string(c_arg_.error_details)); + new grpc::string(c_arg_.error_details)); return cpp_error_details; } @@ -242,6 +245,8 @@ void TlsServerAuthorizationCheckArg::set_error_details( c_arg_.error_details = gpr_strdup(error_details.c_str()); } +void TlsServerAuthorizationCheckArg::callback() { c_arg_.cb(&c_arg_); } + /** The C schedule and cancel functions for the credential reload config. **/ int tls_server_authorization_check_config_c_schedule( void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { @@ -282,14 +287,13 @@ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( config_user_data_ = const_cast(config_user_data); schedule_ = schedule; cancel_ = cancel; -destruct_ = destruct; + destruct_ = destruct; c_config_ = grpc_tls_server_authorization_check_config_create( config_user_data_, &tls_server_authorization_check_config_c_schedule, &tls_server_authorization_check_config_c_cancel, destruct_); c_config_->set_context(static_cast(this)); } - TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() {} /** gRPC TLS credential options API implementation **/ @@ -299,7 +303,8 @@ grpc_tls_credentials_options* TlsCredentialsOptions::c_credentials_options() grpc_tls_credentials_options_create(); c_options->set_cert_request_type(cert_request_type_); c_options->set_key_materials_config( - ::grpc_core::RefCountedPtr(c_key_materials(key_materials_config_))); + ::grpc_core::RefCountedPtr( + c_key_materials(key_materials_config_))); c_options->set_credential_reload_config( ::grpc_core::RefCountedPtr( credential_reload_config_->c_credential_reload())); diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 92d2782b9b4..e205f195aec 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -80,7 +80,8 @@ static void tls_server_authorization_check_callback( arg->error_details = "callback_error_details"; } -static int tls_server_authorization_check_sync(void* config_user_data, TlsServerAuthorizationCheckArg* arg) { +static int tls_server_authorization_check_sync( + void* config_user_data, TlsServerAuthorizationCheckArg* arg) { GPR_ASSERT(arg != nullptr); grpc::string cb_user_data = "cb_user_data"; arg->set_cb_user_data(static_cast(gpr_strdup(cb_user_data.c_str()))); @@ -92,7 +93,8 @@ static int tls_server_authorization_check_sync(void* config_user_data, TlsServer return 1; } -static void tls_server_authorization_check_cancel(void* config_user_data, TlsServerAuthorizationCheckArg* arg) { +static void tls_server_authorization_check_cancel( + void* config_user_data, TlsServerAuthorizationCheckArg* arg) { GPR_ASSERT(arg != nullptr); arg->set_status(GRPC_STATUS_PERMISSION_DENIED); arg->set_error_details("cancelled"); @@ -314,8 +316,10 @@ TEST_F(CredentialsTest, TlsKeyMaterialsCtoCpp) { EXPECT_STREQ("cert_chain", cpp_pair_list[0].cert_chain.c_str()); } -typedef class ::grpc_impl::experimental::TlsCredentialReloadArg TlsCredentialReloadArg; -typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig TlsCredentialReloadConfig; +typedef class ::grpc_impl::experimental::TlsCredentialReloadArg + TlsCredentialReloadArg; +typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig + TlsCredentialReloadConfig; TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { grpc_tls_credential_reload_arg c_arg; @@ -337,8 +341,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { "cert_chain1"}; struct TlsKeyMaterialsConfig::PemKeyCertPair pair2 = {"private_key2", "cert_chain2"}; - std::vector pair_list = {pair1, - pair2}; + std::vector pair_list = {pair1, pair2}; key_materials_config->set_key_materials("pem_root_certs", pair_list); arg.set_key_materials_config(key_materials_config); arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); @@ -435,7 +438,8 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { - TlsServerAuthorizationCheckConfig config = TlsServerAuthorizationCheckConfig(nullptr, &tls_server_authorization_check_sync, nullptr, nullptr); + TlsServerAuthorizationCheckConfig config = TlsServerAuthorizationCheckConfig( + nullptr, &tls_server_authorization_check_sync, nullptr, nullptr); TlsServerAuthorizationCheckArg arg; arg.set_cb_user_data(nullptr); arg.set_success(0); @@ -455,7 +459,8 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { TlsServerAuthorizationCheckConfig config = TlsServerAuthorizationCheckConfig( - nullptr, &tls_server_authorization_check_sync, &tls_server_authorization_check_cancel, nullptr); + nullptr, &tls_server_authorization_check_sync, + &tls_server_authorization_check_cancel, nullptr); grpc_tls_server_authorization_check_arg c_arg; c_arg.cb = tls_server_authorization_check_callback; c_arg.cb_user_data = nullptr; @@ -465,7 +470,8 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { c_arg.status = GRPC_STATUS_UNAUTHENTICATED; c_arg.error_details = "error_details"; - grpc_tls_server_authorization_check_config* c_config = config.c_server_authorization_check(); + grpc_tls_server_authorization_check_config* c_config = + config.c_server_authorization_check(); c_arg.config = c_config; int c_schedule_output = c_config->Schedule(&c_arg); EXPECT_EQ(c_schedule_output, 1); @@ -495,25 +501,33 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { key_materials_config->set_key_materials("pem_root_certs", pair_list); options.set_key_materials_config(key_materials_config); - std::shared_ptr credential_reload_config(new TlsCredentialReloadConfig( - nullptr, &tls_credential_reload_sync, &tls_credential_reload_cancel, nullptr)); + std::shared_ptr credential_reload_config( + new TlsCredentialReloadConfig(nullptr, &tls_credential_reload_sync, + &tls_credential_reload_cancel, nullptr)); options.set_credential_reload_config(credential_reload_config); - std::shared_ptr server_authorization_check_config(new TlsServerAuthorizationCheckConfig( - nullptr, &tls_server_authorization_check_sync, &tls_server_authorization_check_cancel, nullptr)); - options.set_server_authorization_check_config(server_authorization_check_config); + std::shared_ptr + server_authorization_check_config(new TlsServerAuthorizationCheckConfig( + nullptr, &tls_server_authorization_check_sync, + &tls_server_authorization_check_cancel, nullptr)); + options.set_server_authorization_check_config( + server_authorization_check_config); grpc_tls_credentials_options* c_options = options.c_credentials_options(); EXPECT_EQ(c_options->cert_request_type(), GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY); - grpc_tls_key_materials_config* c_key_materials_config = c_options->key_materials_config(); - grpc_tls_credential_reload_config* c_credential_reload_config = c_options->credential_reload_config(); + grpc_tls_key_materials_config* c_key_materials_config = + c_options->key_materials_config(); + grpc_tls_credential_reload_config* c_credential_reload_config = + c_options->credential_reload_config(); grpc_tls_credential_reload_arg c_credential_reload_arg; c_credential_reload_arg.key_materials_config = c_key_materials_config; c_credential_reload_arg.status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; grpc::string test_error_details = "error_details"; c_credential_reload_arg.error_details = test_error_details.c_str(); - grpc_tls_server_authorization_check_config* c_server_authorization_check_config = c_options->server_authorization_check_config(); + grpc_tls_server_authorization_check_config* + c_server_authorization_check_config = + c_options->server_authorization_check_config(); grpc_tls_server_authorization_check_arg c_server_authorization_check_arg; c_server_authorization_check_arg.cb = tls_server_authorization_check_callback; c_server_authorization_check_arg.cb_user_data = nullptr; @@ -524,14 +538,21 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { c_server_authorization_check_arg.error_details = "error_details"; EXPECT_STREQ(c_key_materials_config->pem_root_certs(), "pem_root_certs"); - EXPECT_EQ(static_cast(c_key_materials_config->pem_key_cert_pair_list().size()), 1); - EXPECT_STREQ(c_key_materials_config->pem_key_cert_pair_list()[0].private_key(), "private_key"); - EXPECT_STREQ(c_key_materials_config->pem_key_cert_pair_list()[0].cert_chain(), "cert_chain"); - - int c_credential_reload_schedule_output = c_credential_reload_config->Schedule(&c_credential_reload_arg); + EXPECT_EQ( + static_cast(c_key_materials_config->pem_key_cert_pair_list().size()), + 1); + EXPECT_STREQ( + c_key_materials_config->pem_key_cert_pair_list()[0].private_key(), + "private_key"); + EXPECT_STREQ(c_key_materials_config->pem_key_cert_pair_list()[0].cert_chain(), + "cert_chain"); + + int c_credential_reload_schedule_output = + c_credential_reload_config->Schedule(&c_credential_reload_arg); EXPECT_EQ(c_credential_reload_schedule_output, 0); EXPECT_EQ(c_credential_reload_arg.cb_user_data, nullptr); - EXPECT_STREQ(c_credential_reload_arg.key_materials_config->pem_root_certs(), "new_pem_root_certs"); + EXPECT_STREQ(c_credential_reload_arg.key_materials_config->pem_root_certs(), + "new_pem_root_certs"); ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> c_pair_list = c_credential_reload_arg.key_materials_config->pem_key_cert_pair_list(); EXPECT_EQ(static_cast(c_pair_list.size()), 2); @@ -539,17 +560,25 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { EXPECT_STREQ(c_pair_list[0].cert_chain(), "cert_chain"); EXPECT_STREQ(c_pair_list[1].private_key(), "private_key3"); EXPECT_STREQ(c_pair_list[1].cert_chain(), "cert_chain3"); - EXPECT_EQ(c_credential_reload_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); - EXPECT_STREQ(c_credential_reload_arg.error_details, test_error_details.c_str()); - - int c_server_authorization_check_schedule_output = c_server_authorization_check_config->Schedule(&c_server_authorization_check_arg); + EXPECT_EQ(c_credential_reload_arg.status, + GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + EXPECT_STREQ(c_credential_reload_arg.error_details, + test_error_details.c_str()); + + int c_server_authorization_check_schedule_output = + c_server_authorization_check_config->Schedule( + &c_server_authorization_check_arg); EXPECT_EQ(c_server_authorization_check_schedule_output, 1); - EXPECT_STREQ(static_cast(c_server_authorization_check_arg.cb_user_data), "cb_user_data"); + EXPECT_STREQ( + static_cast(c_server_authorization_check_arg.cb_user_data), + "cb_user_data"); EXPECT_EQ(c_server_authorization_check_arg.success, 1); - EXPECT_STREQ(c_server_authorization_check_arg.target_name, "sync_target_name"); + EXPECT_STREQ(c_server_authorization_check_arg.target_name, + "sync_target_name"); EXPECT_STREQ(c_server_authorization_check_arg.peer_cert, "sync_peer_cert"); EXPECT_EQ(c_server_authorization_check_arg.status, GRPC_STATUS_OK); - EXPECT_STREQ(c_server_authorization_check_arg.error_details, "sync_error_details"); + EXPECT_STREQ(c_server_authorization_check_arg.error_details, + "sync_error_details"); gpr_free(c_options); } From 3b9e7d9a3a29eb034c1ed701d8615caf7029e033 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 21 Aug 2019 12:27:33 -0700 Subject: [PATCH 30/70] Fixed credential options unit test --- test/cpp/client/credentials_test.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index e205f195aec..eea4b1a3da6 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -448,7 +448,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { arg.set_status(GRPC_STATUS_PERMISSION_DENIED); arg.set_error_details("error_details"); int schedule_output = config.Schedule(&arg); - EXPECT_EQ(schedule_output, 0); + EXPECT_EQ(schedule_output, 1); EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); EXPECT_EQ(arg.success(), 1); EXPECT_STREQ(arg.target_name()->c_str(), "sync_target_name"); @@ -521,14 +521,16 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { grpc_tls_credential_reload_config* c_credential_reload_config = c_options->credential_reload_config(); grpc_tls_credential_reload_arg c_credential_reload_arg; + c_credential_reload_arg.config = c_credential_reload_config; + c_credential_reload_arg.cb_user_data = nullptr; c_credential_reload_arg.key_materials_config = c_key_materials_config; c_credential_reload_arg.status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; grpc::string test_error_details = "error_details"; c_credential_reload_arg.error_details = test_error_details.c_str(); - grpc_tls_server_authorization_check_config* - c_server_authorization_check_config = + grpc_tls_server_authorization_check_config* c_server_authorization_check_config = c_options->server_authorization_check_config(); grpc_tls_server_authorization_check_arg c_server_authorization_check_arg; + c_server_authorization_check_arg.config = c_server_authorization_check_config; c_server_authorization_check_arg.cb = tls_server_authorization_check_callback; c_server_authorization_check_arg.cb_user_data = nullptr; c_server_authorization_check_arg.success = 0; @@ -547,8 +549,7 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { EXPECT_STREQ(c_key_materials_config->pem_key_cert_pair_list()[0].cert_chain(), "cert_chain"); - int c_credential_reload_schedule_output = - c_credential_reload_config->Schedule(&c_credential_reload_arg); + int c_credential_reload_schedule_output = c_credential_reload_config->Schedule(&c_credential_reload_arg); EXPECT_EQ(c_credential_reload_schedule_output, 0); EXPECT_EQ(c_credential_reload_arg.cb_user_data, nullptr); EXPECT_STREQ(c_credential_reload_arg.key_materials_config->pem_root_certs(), @@ -579,7 +580,6 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { EXPECT_EQ(c_server_authorization_check_arg.status, GRPC_STATUS_OK); EXPECT_STREQ(c_server_authorization_check_arg.error_details, "sync_error_details"); - gpr_free(c_options); } From 5c135da2af00e6a971c476c2bf053f319f5c07af Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 21 Aug 2019 15:11:28 -0700 Subject: [PATCH 31/70] Removed public headers from grpc++_unsecure library --- BUILD | 1 - build.yaml | 2 -- 2 files changed, 3 deletions(-) diff --git a/BUILD b/BUILD index 2aab90ce373..6f1393e9317 100644 --- a/BUILD +++ b/BUILD @@ -387,7 +387,6 @@ grpc_cc_library( "src/cpp/server/insecure_server_credentials.cc", ], language = "c++", - public_hdrs= GRPC_SECURE_PUBLIC_HDRS, standalone = True, deps = [ "gpr", diff --git a/build.yaml b/build.yaml index 4ea8c1020fc..fda350e8527 100644 --- a/build.yaml +++ b/build.yaml @@ -1986,8 +1986,6 @@ libs: - grpc++_base_unsecure - grpc++_codegen_base - grpc++_codegen_base_src - public headers: - - include/grpc/grpc_security.h secure: false - name: grpc_benchmark build: test From e8b28dd27b79e8006a86faccc785049d889d7f9c Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 21 Aug 2019 15:28:15 -0700 Subject: [PATCH 32/70] Autogenerated files --- BUILD.gn | 1 - CMakeLists.txt | 3 --- Makefile | 2 -- gRPC-C++.podspec | 1 - test/cpp/client/credentials_test.cc | 6 ++++-- tools/doxygen/Doxyfile.c++ | 1 - tools/doxygen/Doxyfile.c++.internal | 1 - 7 files changed, 4 insertions(+), 11 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 4f21afe4b1f..5e4e364931b 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1151,7 +1151,6 @@ config("grpc_config") { "include/grpcpp/security/credentials_impl.h", "include/grpcpp/security/server_credentials.h", "include/grpcpp/security/server_credentials_impl.h", - "include/grpcpp/security/tls_credentials_options.h", "include/grpcpp/server.h", "include/grpcpp/server_builder.h", "include/grpcpp/server_builder_impl.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 637faf60042..05c310104e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3335,7 +3335,6 @@ foreach(_hdr include/grpcpp/security/credentials_impl.h include/grpcpp/security/server_credentials.h include/grpcpp/security/server_credentials_impl.h - include/grpcpp/security/tls_credentials_options.h include/grpcpp/server.h include/grpcpp/server_builder.h include/grpcpp/server_builder_impl.h @@ -4437,7 +4436,6 @@ foreach(_hdr include/grpcpp/security/credentials_impl.h include/grpcpp/security/server_credentials.h include/grpcpp/security/server_credentials_impl.h - include/grpcpp/security/tls_credentials_options.h include/grpcpp/server.h include/grpcpp/server_builder.h include/grpcpp/server_builder_impl.h @@ -17374,7 +17372,6 @@ target_include_directories(timer_test PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} PRIVATE ${_gRPC_SSL_INCLUDE_DIR} PRIVATE ${_gRPC_UPB_GENERATED_DIR} diff --git a/Makefile b/Makefile index 822595adc74..b3d4ffacd46 100644 --- a/Makefile +++ b/Makefile @@ -5712,7 +5712,6 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ include/grpcpp/security/server_credentials_impl.h \ - include/grpcpp/security/tls_credentials_options.h \ include/grpcpp/server.h \ include/grpcpp/server_builder.h \ include/grpcpp/server_builder_impl.h \ @@ -6745,7 +6744,6 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ include/grpcpp/security/server_credentials_impl.h \ - include/grpcpp/security/tls_credentials_options.h \ include/grpcpp/server.h \ include/grpcpp/server_builder.h \ include/grpcpp/server_builder_impl.h \ diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index f34891abf75..c1ccee402ab 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -121,7 +121,6 @@ Pod::Spec.new do |s| 'include/grpcpp/security/credentials_impl.h', 'include/grpcpp/security/server_credentials.h', 'include/grpcpp/security/server_credentials_impl.h', - 'include/grpcpp/security/tls_credentials_options.h', 'include/grpcpp/server.h', 'include/grpcpp/server_builder.h', 'include/grpcpp/server_builder_impl.h', diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index eea4b1a3da6..5be6654d1c5 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -527,7 +527,8 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { c_credential_reload_arg.status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; grpc::string test_error_details = "error_details"; c_credential_reload_arg.error_details = test_error_details.c_str(); - grpc_tls_server_authorization_check_config* c_server_authorization_check_config = + grpc_tls_server_authorization_check_config* + c_server_authorization_check_config = c_options->server_authorization_check_config(); grpc_tls_server_authorization_check_arg c_server_authorization_check_arg; c_server_authorization_check_arg.config = c_server_authorization_check_config; @@ -549,7 +550,8 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { EXPECT_STREQ(c_key_materials_config->pem_key_cert_pair_list()[0].cert_chain(), "cert_chain"); - int c_credential_reload_schedule_output = c_credential_reload_config->Schedule(&c_credential_reload_arg); + int c_credential_reload_schedule_output = + c_credential_reload_config->Schedule(&c_credential_reload_arg); EXPECT_EQ(c_credential_reload_schedule_output, 0); EXPECT_EQ(c_credential_reload_arg.cb_user_data, nullptr); EXPECT_STREQ(c_credential_reload_arg.key_materials_config->pem_root_certs(), diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 63ee5f0ad20..168e6c8d770 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -1023,7 +1023,6 @@ include/grpcpp/security/credentials.h \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ include/grpcpp/security/server_credentials_impl.h \ -include/grpcpp/security/tls_credentials_options.h \ include/grpcpp/server.h \ include/grpcpp/server_builder.h \ include/grpcpp/server_builder_impl.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 3507e32592b..26861efac90 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1025,7 +1025,6 @@ include/grpcpp/security/credentials.h \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ include/grpcpp/security/server_credentials_impl.h \ -include/grpcpp/security/tls_credentials_options.h \ include/grpcpp/server.h \ include/grpcpp/server_builder.h \ include/grpcpp/server_builder_impl.h \ From 9da9c0786d50fe6a0304d5bc2cc448ea4ba02988 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Thu, 22 Aug 2019 09:50:09 -0700 Subject: [PATCH 33/70] Added a line in build.yaml and starting to clean up memory leaks in unit tests --- build.yaml | 1 + src/cpp/common/tls_credentials_options.cc | 5 ++++- test/cpp/client/credentials_test.cc | 12 ++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/build.yaml b/build.yaml index 842724f73ee..35ef7131e66 100644 --- a/build.yaml +++ b/build.yaml @@ -506,6 +506,7 @@ filegroups: - include/grpcpp/security/credentials_impl.h - include/grpcpp/security/server_credentials.h - include/grpcpp/security/server_credentials_impl.h + - include/grpcpp/security/tls_credentials_options.h - include/grpcpp/server.h - include/grpcpp/server_builder.h - include/grpcpp/server_builder_impl.h diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 4d42affed07..0bf024c609d 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -31,7 +31,10 @@ void TlsKeyMaterialsConfig::set_key_materials( pem_root_certs_ = std::move(pem_root_certs); } -/** Creates a new C struct for the key materials. **/ +/** Creates a new C struct for the key materials. Note that the user must free + * the underlying pointer to private key and cert chain duplicates; they are not + * freed when the UniquePtr member variables of PemKeyCertPair are unused. + * Similarly, the user must free the underlying pointer to c_pem_root_certs. **/ grpc_tls_key_materials_config* c_key_materials( const std::shared_ptr& config) { grpc_tls_key_materials_config* c_config = diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 5be6654d1c5..af920967de6 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -286,6 +286,9 @@ TEST_F(CredentialsTest, TlsKeyMaterialsConfigCppToC) { c_config->pem_key_cert_pair_list()[0].private_key()); EXPECT_STREQ(pair.cert_chain.c_str(), c_config->pem_key_cert_pair_list()[0].cert_chain()); + gpr_free(c_config->pem_key_cert_pair_list()[0].private_key()); + gpr_free(c_config->pem_key_cert_pair_list()[0].cert_chain()); + gpr_free(const_cast(c_config->pem_root_certs())); gpr_free(c_config); } @@ -411,6 +414,11 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { c_config->Cancel(&c_arg); EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); EXPECT_STREQ(c_arg.error_details, "cancelled"); + + gpr_free(const_cast(ssl_pair->private_key)); + gpr_free(const_cast(ssl_pair->cert_chain)); + gpr_free(ssl_pair); + gpr_free(c_config); } typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckArg @@ -430,6 +438,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { TlsServerAuthorizationCheckArg arg(c_arg); arg.callback(); EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); + gpr_free(arg.cb_user_data()); EXPECT_EQ(arg.success(), 1); EXPECT_STREQ(arg.target_name()->c_str(), "callback_target_name"); EXPECT_STREQ(arg.peer_cert()->c_str(), "callback_peer_cert"); @@ -450,6 +459,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { int schedule_output = config.Schedule(&arg); EXPECT_EQ(schedule_output, 1); EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); + gpr_free(arg.cb_user_data()); EXPECT_EQ(arg.success(), 1); EXPECT_STREQ(arg.target_name()->c_str(), "sync_target_name"); EXPECT_STREQ(arg.peer_cert()->c_str(), "sync_peer_cert"); @@ -476,6 +486,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { int c_schedule_output = c_config->Schedule(&c_arg); EXPECT_EQ(c_schedule_output, 1); EXPECT_STREQ(static_cast(c_arg.cb_user_data), "cb_user_data"); + gpr_free(c_arg.cb_user_data); EXPECT_EQ(c_arg.success, 1); EXPECT_STREQ(c_arg.target_name, "sync_target_name"); EXPECT_STREQ(c_arg.peer_cert, "sync_peer_cert"); @@ -575,6 +586,7 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { EXPECT_STREQ( static_cast(c_server_authorization_check_arg.cb_user_data), "cb_user_data"); + gpr_free(c_server_authorization_check_arg.cb_user_data); EXPECT_EQ(c_server_authorization_check_arg.success, 1); EXPECT_STREQ(c_server_authorization_check_arg.target_name, "sync_target_name"); From e87fc58b787e733a712e4eb23b7fd848bff41656 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Thu, 22 Aug 2019 09:58:54 -0700 Subject: [PATCH 34/70] Autogenerated files --- BUILD.gn | 1 + CMakeLists.txt | 2 ++ Makefile | 2 ++ gRPC-C++.podspec | 1 + tools/doxygen/Doxyfile.c++ | 1 + tools/doxygen/Doxyfile.c++.internal | 1 + 6 files changed, 8 insertions(+) diff --git a/BUILD.gn b/BUILD.gn index 5e4e364931b..4f21afe4b1f 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1151,6 +1151,7 @@ config("grpc_config") { "include/grpcpp/security/credentials_impl.h", "include/grpcpp/security/server_credentials.h", "include/grpcpp/security/server_credentials_impl.h", + "include/grpcpp/security/tls_credentials_options.h", "include/grpcpp/server.h", "include/grpcpp/server_builder.h", "include/grpcpp/server_builder_impl.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 05c310104e4..5c547b459a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3335,6 +3335,7 @@ foreach(_hdr include/grpcpp/security/credentials_impl.h include/grpcpp/security/server_credentials.h include/grpcpp/security/server_credentials_impl.h + include/grpcpp/security/tls_credentials_options.h include/grpcpp/server.h include/grpcpp/server_builder.h include/grpcpp/server_builder_impl.h @@ -4436,6 +4437,7 @@ foreach(_hdr include/grpcpp/security/credentials_impl.h include/grpcpp/security/server_credentials.h include/grpcpp/security/server_credentials_impl.h + include/grpcpp/security/tls_credentials_options.h include/grpcpp/server.h include/grpcpp/server_builder.h include/grpcpp/server_builder_impl.h diff --git a/Makefile b/Makefile index b3d4ffacd46..822595adc74 100644 --- a/Makefile +++ b/Makefile @@ -5712,6 +5712,7 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ include/grpcpp/security/server_credentials_impl.h \ + include/grpcpp/security/tls_credentials_options.h \ include/grpcpp/server.h \ include/grpcpp/server_builder.h \ include/grpcpp/server_builder_impl.h \ @@ -6744,6 +6745,7 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ include/grpcpp/security/server_credentials_impl.h \ + include/grpcpp/security/tls_credentials_options.h \ include/grpcpp/server.h \ include/grpcpp/server_builder.h \ include/grpcpp/server_builder_impl.h \ diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index c1ccee402ab..f34891abf75 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -121,6 +121,7 @@ Pod::Spec.new do |s| 'include/grpcpp/security/credentials_impl.h', 'include/grpcpp/security/server_credentials.h', 'include/grpcpp/security/server_credentials_impl.h', + 'include/grpcpp/security/tls_credentials_options.h', 'include/grpcpp/server.h', 'include/grpcpp/server_builder.h', 'include/grpcpp/server_builder_impl.h', diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 168e6c8d770..63ee5f0ad20 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -1023,6 +1023,7 @@ include/grpcpp/security/credentials.h \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ include/grpcpp/security/server_credentials_impl.h \ +include/grpcpp/security/tls_credentials_options.h \ include/grpcpp/server.h \ include/grpcpp/server_builder.h \ include/grpcpp/server_builder_impl.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 26861efac90..3507e32592b 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1025,6 +1025,7 @@ include/grpcpp/security/credentials.h \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ include/grpcpp/security/server_credentials_impl.h \ +include/grpcpp/security/tls_credentials_options.h \ include/grpcpp/server.h \ include/grpcpp/server_builder.h \ include/grpcpp/server_builder_impl.h \ From 4c26cc402f1a4c46c617023c27c2bec32e10757c Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Thu, 22 Aug 2019 10:27:48 -0700 Subject: [PATCH 35/70] Removed free statement from TlsCredentialReloadConfigCppToC test --- test/cpp/client/credentials_test.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index af920967de6..97ff84edd64 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -415,9 +415,6 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); EXPECT_STREQ(c_arg.error_details, "cancelled"); - gpr_free(const_cast(ssl_pair->private_key)); - gpr_free(const_cast(ssl_pair->cert_chain)); - gpr_free(ssl_pair); gpr_free(c_config); } From 94d3e95e8df543ba18ab1d047a687ccb8bc8ac2d Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Fri, 23 Aug 2019 11:22:12 -0700 Subject: [PATCH 36/70] Small changes to/for unit tests. --- src/cpp/common/tls_credentials_options.cc | 10 ++++--- test/cpp/client/credentials_test.cc | 32 ++++++++++++++--------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 0bf024c609d..026e85dcdfa 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -72,11 +72,12 @@ std::shared_ptr tls_key_materials_c_to_cpp( for (size_t i = 0; i < pem_key_cert_pair_list.size(); i++) { ::grpc_core::PemKeyCertPair key_cert_pair = pem_key_cert_pair_list[i]; TlsKeyMaterialsConfig::PemKeyCertPair p = { - gpr_strdup(key_cert_pair.private_key()), - gpr_strdup(key_cert_pair.cert_chain())}; + //gpr_strdup(key_cert_pair.private_key()), + //gpr_strdup(key_cert_pair.cert_chain())}; + key_cert_pair.private_key(), key_cert_pair.cert_chain()}; cpp_pem_key_cert_pair_list.push_back(::std::move(p)); } - cpp_config->set_key_materials(std::move(gpr_strdup(config->pem_root_certs())), + cpp_config->set_key_materials(std::move(config->pem_root_certs()), std::move(cpp_pem_key_cert_pair_list)); cpp_config->set_version(config->version()); return cpp_config; @@ -188,7 +189,8 @@ TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg( c_arg_ = arg; } -TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() {} +TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() { +} void* TlsServerAuthorizationCheckArg::cb_user_data() const { return c_arg_.cb_user_data; diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 97ff84edd64..fad93b9fee7 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -55,6 +55,8 @@ static int tls_credential_reload_sync(void* config_user_data, std::vector pair_list = key_materials_config->pem_key_cert_pair_list(); pair_list.push_back(pair3); + pair_list[0].private_key = "private_key01"; + pair_list[0].cert_chain = "cert_chain01"; key_materials_config->set_key_materials("new_pem_root_certs", pair_list); arg->set_key_materials_config(key_materials_config); arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); @@ -356,8 +358,8 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { "new_pem_root_certs"); pair_list = arg.key_materials_config()->pem_key_cert_pair_list(); EXPECT_EQ(static_cast(pair_list.size()), 3); - EXPECT_STREQ(pair_list[0].private_key.c_str(), "private_key1"); - EXPECT_STREQ(pair_list[0].cert_chain.c_str(), "cert_chain1"); + EXPECT_STREQ(pair_list[0].private_key.c_str(), "private_key01"); + EXPECT_STREQ(pair_list[0].cert_chain.c_str(), "cert_chain01"); EXPECT_STREQ(pair_list[1].private_key.c_str(), "private_key2"); EXPECT_STREQ(pair_list[1].cert_chain.c_str(), "cert_chain2"); EXPECT_STREQ(pair_list[2].private_key.c_str(), "private_key3"); @@ -404,8 +406,8 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> pair_list = c_arg.key_materials_config->pem_key_cert_pair_list(); EXPECT_EQ(static_cast(pair_list.size()), 2); - EXPECT_STREQ(pair_list[0].private_key(), "private_key"); - EXPECT_STREQ(pair_list[0].cert_chain(), "cert_chain"); + EXPECT_STREQ(pair_list[0].private_key(), "private_key01"); + EXPECT_STREQ(pair_list[0].cert_chain(), "cert_chain01"); EXPECT_STREQ(pair_list[1].private_key(), "private_key3"); EXPECT_STREQ(pair_list[1].cert_chain(), "cert_chain3"); EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); @@ -426,13 +428,19 @@ typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckConfig TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { grpc_tls_server_authorization_check_arg c_arg; c_arg.cb = tls_server_authorization_check_callback; - c_arg.cb_user_data = nullptr; - c_arg.success = 0; - c_arg.target_name = "target_name"; - c_arg.peer_cert = "peer_cert"; - c_arg.status = GRPC_STATUS_UNAUTHENTICATED; - c_arg.error_details = "error_details"; + //c_arg.cb_user_data = nullptr; + //c_arg.success = 0; + //c_arg.target_name = "target_name"; + //c_arg.peer_cert = "peer_cert"; + //c_arg.status = GRPC_STATUS_UNAUTHENTICATED; + //c_arg.error_details = "error_details"; TlsServerAuthorizationCheckArg arg(c_arg); + arg.set_cb_user_data(nullptr); + arg.set_success(0); + arg.set_target_name("target_name"); + arg.set_peer_cert("peer_cert"); + arg.set_status(GRPC_STATUS_UNAUTHENTICATED); + arg.set_error_details("error_details"); arg.callback(); EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); gpr_free(arg.cb_user_data()); @@ -567,8 +575,8 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> c_pair_list = c_credential_reload_arg.key_materials_config->pem_key_cert_pair_list(); EXPECT_EQ(static_cast(c_pair_list.size()), 2); - EXPECT_STREQ(c_pair_list[0].private_key(), "private_key"); - EXPECT_STREQ(c_pair_list[0].cert_chain(), "cert_chain"); + EXPECT_STREQ(c_pair_list[0].private_key(), "private_key01"); + EXPECT_STREQ(c_pair_list[0].cert_chain(), "cert_chain01"); EXPECT_STREQ(c_pair_list[1].private_key(), "private_key3"); EXPECT_STREQ(c_pair_list[1].cert_chain(), "cert_chain3"); EXPECT_EQ(c_credential_reload_arg.status, From c2fd3844dcec60de2accc4353f39d161941109ae Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Fri, 23 Aug 2019 16:20:19 -0700 Subject: [PATCH 37/70] Implemented Yihua's comments --- BUILD | 2 + BUILD.gn | 2 + CMakeLists.txt | 1 + Makefile | 2 + build.yaml | 2 + gRPC-C++.podspec | 3 + grpc.gyp | 1 + .../grpcpp/security/tls_credentials_options.h | 65 +++----- src/cpp/common/tls_credentials_options.cc | 154 +++--------------- .../common/tls_credentials_options_util.cc | 137 ++++++++++++++++ src/cpp/common/tls_credentials_options_util.h | 54 ++++++ test/cpp/client/credentials_test.cc | 41 +++-- tools/doxygen/Doxyfile.c++.internal | 2 + 13 files changed, 272 insertions(+), 194 deletions(-) create mode 100644 src/cpp/common/tls_credentials_options_util.cc create mode 100644 src/cpp/common/tls_credentials_options_util.h diff --git a/BUILD b/BUILD index 6f1393e9317..c3c0d2e5b5b 100644 --- a/BUILD +++ b/BUILD @@ -358,12 +358,14 @@ grpc_cc_library( "src/cpp/common/secure_channel_arguments.cc", "src/cpp/common/secure_create_auth_context.cc", "src/cpp/common/tls_credentials_options.cc", + "src/cpp/common/tls_credentials_options_util.cc", "src/cpp/server/insecure_server_credentials.cc", "src/cpp/server/secure_server_credentials.cc", ], hdrs = [ "src/cpp/client/secure_credentials.h", "src/cpp/common/secure_auth_context.h", + "src/cpp/common/tls_credentials_options_util.h", "src/cpp/server/secure_server_credentials.h", ], language = "c++", diff --git a/BUILD.gn b/BUILD.gn index 4f21afe4b1f..8b683121bf3 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1391,6 +1391,8 @@ config("grpc_config") { "src/cpp/common/secure_channel_arguments.cc", "src/cpp/common/secure_create_auth_context.cc", "src/cpp/common/tls_credentials_options.cc", + "src/cpp/common/tls_credentials_options_util.cc", + "src/cpp/common/tls_credentials_options_util.h", "src/cpp/common/validate_service_config.cc", "src/cpp/common/version_cc.cc", "src/cpp/server/async_generic_service.cc", diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c547b459a5..00c86bb2702 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3164,6 +3164,7 @@ add_library(grpc++ src/cpp/common/secure_channel_arguments.cc src/cpp/common/secure_create_auth_context.cc src/cpp/common/tls_credentials_options.cc + src/cpp/common/tls_credentials_options_util.cc src/cpp/server/insecure_server_credentials.cc src/cpp/server/secure_server_credentials.cc src/cpp/client/channel_cc.cc diff --git a/Makefile b/Makefile index 822595adc74..3a52fce658a 100644 --- a/Makefile +++ b/Makefile @@ -5578,6 +5578,7 @@ LIBGRPC++_SRC = \ src/cpp/common/secure_channel_arguments.cc \ src/cpp/common/secure_create_auth_context.cc \ src/cpp/common/tls_credentials_options.cc \ + src/cpp/common/tls_credentials_options_util.cc \ src/cpp/server/insecure_server_credentials.cc \ src/cpp/server/secure_server_credentials.cc \ src/cpp/client/channel_cc.cc \ @@ -22660,6 +22661,7 @@ src/cpp/common/secure_auth_context.cc: $(OPENSSL_DEP) src/cpp/common/secure_channel_arguments.cc: $(OPENSSL_DEP) src/cpp/common/secure_create_auth_context.cc: $(OPENSSL_DEP) src/cpp/common/tls_credentials_options.cc: $(OPENSSL_DEP) +src/cpp/common/tls_credentials_options_util.cc: $(OPENSSL_DEP) src/cpp/ext/proto_server_reflection.cc: $(OPENSSL_DEP) src/cpp/ext/proto_server_reflection_plugin.cc: $(OPENSSL_DEP) src/cpp/server/channelz/channelz_service.cc: $(OPENSSL_DEP) diff --git a/build.yaml b/build.yaml index 35ef7131e66..06595ff64f2 100644 --- a/build.yaml +++ b/build.yaml @@ -1811,6 +1811,7 @@ libs: - include/grpcpp/impl/codegen/core_codegen.h - src/cpp/client/secure_credentials.h - src/cpp/common/secure_auth_context.h + - src/cpp/common/tls_credentials_options_util.h - src/cpp/server/secure_server_credentials.h src: - src/cpp/client/insecure_credentials.cc @@ -1820,6 +1821,7 @@ libs: - src/cpp/common/secure_channel_arguments.cc - src/cpp/common/secure_create_auth_context.cc - src/cpp/common/tls_credentials_options.cc + - src/cpp/common/tls_credentials_options_util.cc - src/cpp/server/insecure_server_credentials.cc - src/cpp/server/secure_server_credentials.cc deps: diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index f34891abf75..5ca7cc23861 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -220,6 +220,7 @@ Pod::Spec.new do |s| ss.source_files = 'include/grpcpp/impl/codegen/core_codegen.h', 'src/cpp/client/secure_credentials.h', 'src/cpp/common/secure_auth_context.h', + 'src/cpp/common/tls_credentials_options_util.h', 'src/cpp/server/secure_server_credentials.h', 'src/cpp/client/create_channel_internal.h', 'src/cpp/common/channel_filter.h', @@ -235,6 +236,7 @@ Pod::Spec.new do |s| 'src/cpp/common/secure_channel_arguments.cc', 'src/cpp/common/secure_create_auth_context.cc', 'src/cpp/common/tls_credentials_options.cc', + 'src/cpp/common/tls_credentials_options_util.cc', 'src/cpp/server/insecure_server_credentials.cc', 'src/cpp/server/secure_server_credentials.cc', 'src/cpp/client/channel_cc.cc', @@ -278,6 +280,7 @@ Pod::Spec.new do |s| ss.private_header_files = 'include/grpcpp/impl/codegen/core_codegen.h', 'src/cpp/client/secure_credentials.h', 'src/cpp/common/secure_auth_context.h', + 'src/cpp/common/tls_credentials_options_util.h', 'src/cpp/server/secure_server_credentials.h', 'src/cpp/client/create_channel_internal.h', 'src/cpp/common/channel_filter.h', diff --git a/grpc.gyp b/grpc.gyp index 8b1c189ed3b..0ef62d6f789 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -1551,6 +1551,7 @@ 'src/cpp/common/secure_channel_arguments.cc', 'src/cpp/common/secure_create_auth_context.cc', 'src/cpp/common/tls_credentials_options.cc', + 'src/cpp/common/tls_credentials_options_util.cc', 'src/cpp/server/insecure_server_credentials.cc', 'src/cpp/server/secure_server_credentials.cc', 'src/cpp/client/channel_cc.cc', diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 9cba5aa27bc..8b19a9b873d 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -51,32 +51,29 @@ class TlsKeyMaterialsConfig { void set_version(int version) { version_ = version; }; private: - int version_; + int version_ = 0; std::vector pem_key_cert_pair_list_; grpc::string pem_root_certs_; }; -/** The following 2 functions are exposed for testing purposes. **/ -grpc_tls_key_materials_config* c_key_materials( - const std::shared_ptr& config); - -std::shared_ptr tls_key_materials_c_to_cpp( - const grpc_tls_key_materials_config* config); - /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ class TlsCredentialReloadArg { public: - TlsCredentialReloadArg(); + // TlsCredentialReloadArg(); TlsCredentialReloadArg(grpc_tls_credential_reload_arg arg); ~TlsCredentialReloadArg(); - /** Getters for member fields. The callback function is not exposed. **/ + /** Getters for member fields. The callback function is not exposed. + * They return the corresponding fields of the underlying C arg. In the case + * of the key materials config, it creates a new instance of the C++ key + * materials config from the underlying C grpc_tls_key_materials_config. **/ void* cb_user_data() const; std::shared_ptr key_materials_config() const; grpc_ssl_certificate_config_reload_status status() const; - std::shared_ptr error_details() const; + grpc::string error_details() const; - /** Setters for member fields. **/ + /** Setters for member fields. They modify the fields of the underlying C arg. + * **/ void set_cb_user_data(void* cb_user_data); void set_key_materials_config( const std::shared_ptr& key_materials_config); @@ -84,18 +81,12 @@ class TlsCredentialReloadArg { void set_error_details(const grpc::string& error_details); /** Calls the C arg's callback function. **/ - void callback(); + void OnCredentialReloadDoneCallback(); private: grpc_tls_credential_reload_arg c_arg_; }; -// Exposed for testing purposes. -int tls_credential_reload_config_c_schedule( - void* config_user_data, grpc_tls_credential_reload_arg* arg); -void tls_credential_reload_config_c_cancel(void* config_user_data, - grpc_tls_credential_reload_arg* arg); - /** TLS credential reloag config, wraps grpc_tls_credential_reload_config. **/ class TlsCredentialReloadConfig { public: @@ -108,6 +99,10 @@ class TlsCredentialReloadConfig { ~TlsCredentialReloadConfig(); int Schedule(TlsCredentialReloadArg* arg) const { + if (schedule_ == nullptr) { + gpr_log(GPR_ERROR, "schedule API is nullptr"); + return 1; + } return schedule_(config_user_data_, arg); } @@ -118,10 +113,9 @@ class TlsCredentialReloadConfig { } cancel_(config_user_data_, arg); } + /** Returns a C struct for the credential reload config. **/ - grpc_tls_credential_reload_config* c_credential_reload() const { - return c_config_; - } + grpc_tls_credential_reload_config* c_config() const { return c_config_; } private: grpc_tls_credential_reload_config* c_config_; @@ -136,19 +130,21 @@ class TlsCredentialReloadConfig { class TlsServerAuthorizationCheckArg { public: - TlsServerAuthorizationCheckArg(); + // TlsServerAuthorizationCheckArg(); TlsServerAuthorizationCheckArg(grpc_tls_server_authorization_check_arg arg); ~TlsServerAuthorizationCheckArg(); - /** Getters for member fields. **/ + /** Getters for member fields. They return the corresponding fields of the + * underlying C arg.**/ void* cb_user_data() const; int success() const; - std::shared_ptr target_name() const; - std::shared_ptr peer_cert() const; + grpc::string target_name() const; + grpc::string peer_cert() const; grpc_status_code status() const; - std::shared_ptr error_details() const; + grpc::string error_details() const; - /** Setters for member fields. **/ + /** Setters for member fields. They modify the fields of the underlying C arg. + * **/ void set_cb_user_data(void* cb_user_data); void set_success(int success); void set_target_name(const grpc::string& target_name); @@ -157,18 +153,12 @@ class TlsServerAuthorizationCheckArg { void set_error_details(const grpc::string& error_details); /** Calls the C arg's callback function. **/ - void callback(); + void OnServerAuthorizationCheckDoneCallback(); private: grpc_tls_server_authorization_check_arg c_arg_; }; -// Exposed for testing purposes. -int tls_server_authorization_check_config_c_schedule( - void* config_user_data, grpc_tls_server_authorization_check_arg* arg); -void tls_server_authorization_check_config_c_cancel( - void* config_user_data, grpc_tls_server_authorization_check_arg* arg); - /** TLS server authorization check config, wraps * grps_tls_server_authorization_check_config. **/ class TlsServerAuthorizationCheckConfig { @@ -194,9 +184,8 @@ class TlsServerAuthorizationCheckConfig { cancel_(config_user_data_, arg); } - /** Creates C struct for the credential reload config. **/ - grpc_tls_server_authorization_check_config* c_server_authorization_check() - const { + /** Creates C struct for the server authorization check config. **/ + grpc_tls_server_authorization_check_config* c_config() const { return c_config_; } diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 026e85dcdfa..2f4a95384b9 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -19,6 +19,7 @@ #include #include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" +#include "src/cpp/common/tls_credentials_options_util.h" namespace grpc_impl { namespace experimental { @@ -31,61 +32,7 @@ void TlsKeyMaterialsConfig::set_key_materials( pem_root_certs_ = std::move(pem_root_certs); } -/** Creates a new C struct for the key materials. Note that the user must free - * the underlying pointer to private key and cert chain duplicates; they are not - * freed when the UniquePtr member variables of PemKeyCertPair are unused. - * Similarly, the user must free the underlying pointer to c_pem_root_certs. **/ -grpc_tls_key_materials_config* c_key_materials( - const std::shared_ptr& config) { - grpc_tls_key_materials_config* c_config = - grpc_tls_key_materials_config_create(); - ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> - c_pem_key_cert_pair_list; - for (auto key_cert_pair = config->pem_key_cert_pair_list().begin(); - key_cert_pair != config->pem_key_cert_pair_list().end(); - key_cert_pair++) { - grpc_ssl_pem_key_cert_pair* ssl_pair = - (grpc_ssl_pem_key_cert_pair*)gpr_malloc( - sizeof(grpc_ssl_pem_key_cert_pair)); - ssl_pair->private_key = gpr_strdup(key_cert_pair->private_key.c_str()); - ssl_pair->cert_chain = gpr_strdup(key_cert_pair->cert_chain.c_str()); - ::grpc_core::PemKeyCertPair c_pem_key_cert_pair = - ::grpc_core::PemKeyCertPair(ssl_pair); - c_pem_key_cert_pair_list.push_back(::std::move(c_pem_key_cert_pair)); - } - ::grpc_core::UniquePtr c_pem_root_certs( - gpr_strdup(config->pem_root_certs().c_str())); - c_config->set_key_materials(std::move(c_pem_root_certs), - std::move(c_pem_key_cert_pair_list)); - c_config->set_version(config->version()); - return c_config; -} - -/** Creates a new TlsKeyMaterialsConfig from a C struct config. **/ -std::shared_ptr tls_key_materials_c_to_cpp( - const grpc_tls_key_materials_config* config) { - std::shared_ptr cpp_config( - new TlsKeyMaterialsConfig()); - std::vector cpp_pem_key_cert_pair_list; - grpc_tls_key_materials_config::PemKeyCertPairList pem_key_cert_pair_list = - config->pem_key_cert_pair_list(); - for (size_t i = 0; i < pem_key_cert_pair_list.size(); i++) { - ::grpc_core::PemKeyCertPair key_cert_pair = pem_key_cert_pair_list[i]; - TlsKeyMaterialsConfig::PemKeyCertPair p = { - //gpr_strdup(key_cert_pair.private_key()), - //gpr_strdup(key_cert_pair.cert_chain())}; - key_cert_pair.private_key(), key_cert_pair.cert_chain()}; - cpp_pem_key_cert_pair_list.push_back(::std::move(p)); - } - cpp_config->set_key_materials(std::move(config->pem_root_certs()), - std::move(cpp_pem_key_cert_pair_list)); - cpp_config->set_version(config->version()); - return cpp_config; -} - /** TLS credential reload arg API implementation **/ -TlsCredentialReloadArg::TlsCredentialReloadArg() {} - TlsCredentialReloadArg::TlsCredentialReloadArg( grpc_tls_credential_reload_arg arg) { c_arg_ = arg; @@ -102,7 +49,7 @@ void* TlsCredentialReloadArg::cb_user_data() const { * TlsCredentialReloadArg instance. **/ std::shared_ptr TlsCredentialReloadArg::key_materials_config() const { - return tls_key_materials_c_to_cpp(c_arg_.key_materials_config); + return ConvertToCppKeyMaterialsConfig(c_arg_.key_materials_config); } grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() @@ -110,9 +57,8 @@ grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() return c_arg_.status; } -std::shared_ptr TlsCredentialReloadArg::error_details() const { - std::shared_ptr cpp_error_details( - new grpc::string(c_arg_.error_details)); +grpc::string TlsCredentialReloadArg::error_details() const { + grpc::string cpp_error_details(c_arg_.error_details); return cpp_error_details; } @@ -122,7 +68,8 @@ void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { void TlsCredentialReloadArg::set_key_materials_config( const std::shared_ptr& key_materials_config) { - c_arg_.key_materials_config = c_key_materials(key_materials_config); + c_arg_.key_materials_config = + ConvertToCKeyMaterialsConfig(key_materials_config); } void TlsCredentialReloadArg::set_status( @@ -135,32 +82,8 @@ void TlsCredentialReloadArg::set_error_details( c_arg_.error_details = gpr_strdup(error_details.c_str()); } -void TlsCredentialReloadArg::callback() { c_arg_.cb(&c_arg_); } - -/** The C schedule and cancel functions for the credential reload config. **/ -int tls_credential_reload_config_c_schedule( - void* config_user_data, grpc_tls_credential_reload_arg* arg) { - TlsCredentialReloadConfig* cpp_config = - static_cast(arg->config->context()); - TlsCredentialReloadArg cpp_arg(*arg); - int schedule_output = cpp_config->Schedule(&cpp_arg); - arg->cb_user_data = cpp_arg.cb_user_data(); - arg->key_materials_config = c_key_materials(cpp_arg.key_materials_config()); - arg->status = cpp_arg.status(); - arg->error_details = gpr_strdup(cpp_arg.error_details()->c_str()); - return schedule_output; -} - -void tls_credential_reload_config_c_cancel( - void* config_user_data, grpc_tls_credential_reload_arg* arg) { - TlsCredentialReloadConfig* cpp_config = - static_cast(arg->config->context()); - TlsCredentialReloadArg cpp_arg(*arg); - cpp_config->Cancel(&cpp_arg); - arg->cb_user_data = cpp_arg.cb_user_data(); - arg->key_materials_config = c_key_materials(cpp_arg.key_materials_config()); - arg->status = cpp_arg.status(); - arg->error_details = cpp_arg.error_details()->c_str(); +void TlsCredentialReloadArg::OnCredentialReloadDoneCallback() { + c_arg_.cb(&c_arg_); } /** gRPC TLS credential reload config API implementation **/ @@ -182,15 +105,12 @@ TlsCredentialReloadConfig::TlsCredentialReloadConfig( TlsCredentialReloadConfig::~TlsCredentialReloadConfig() {} /** gRPC TLS server authorization check arg API implementation **/ -TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg() {} - TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg( grpc_tls_server_authorization_check_arg arg) { c_arg_ = arg; } -TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() { -} +TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() {} void* TlsServerAuthorizationCheckArg::cb_user_data() const { return c_arg_.cb_user_data; @@ -198,17 +118,13 @@ void* TlsServerAuthorizationCheckArg::cb_user_data() const { int TlsServerAuthorizationCheckArg::success() const { return c_arg_.success; } -std::shared_ptr TlsServerAuthorizationCheckArg::target_name() - const { - std::shared_ptr cpp_target_name( - new grpc::string(c_arg_.target_name)); +grpc::string TlsServerAuthorizationCheckArg::target_name() const { + grpc::string cpp_target_name(c_arg_.target_name); return cpp_target_name; } -std::shared_ptr TlsServerAuthorizationCheckArg::peer_cert() - const { - std::shared_ptr cpp_peer_cert( - new grpc::string(c_arg_.peer_cert)); +grpc::string TlsServerAuthorizationCheckArg::peer_cert() const { + grpc::string cpp_peer_cert(c_arg_.peer_cert); return cpp_peer_cert; } @@ -216,10 +132,8 @@ grpc_status_code TlsServerAuthorizationCheckArg::status() const { return c_arg_.status; } -std::shared_ptr TlsServerAuthorizationCheckArg::error_details() - const { - std::shared_ptr cpp_error_details( - new grpc::string(c_arg_.error_details)); +grpc::string TlsServerAuthorizationCheckArg::error_details() const { + grpc::string cpp_error_details(c_arg_.error_details); return cpp_error_details; } @@ -250,36 +164,8 @@ void TlsServerAuthorizationCheckArg::set_error_details( c_arg_.error_details = gpr_strdup(error_details.c_str()); } -void TlsServerAuthorizationCheckArg::callback() { c_arg_.cb(&c_arg_); } - -/** The C schedule and cancel functions for the credential reload config. **/ -int tls_server_authorization_check_config_c_schedule( - void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { - TlsServerAuthorizationCheckConfig* cpp_config = - static_cast(arg->config->context()); - TlsServerAuthorizationCheckArg cpp_arg(*arg); - int schedule_output = cpp_config->Schedule(&cpp_arg); - arg->cb_user_data = cpp_arg.cb_user_data(); - arg->success = cpp_arg.success(); - arg->target_name = gpr_strdup(cpp_arg.target_name()->c_str()); - arg->peer_cert = gpr_strdup(cpp_arg.peer_cert()->c_str()); - arg->status = cpp_arg.status(); - arg->error_details = gpr_strdup(cpp_arg.error_details()->c_str()); - return schedule_output; -} - -void tls_server_authorization_check_config_c_cancel( - void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { - TlsServerAuthorizationCheckConfig* cpp_config = - static_cast(arg->config->context()); - TlsServerAuthorizationCheckArg cpp_arg(*arg); - cpp_config->Cancel(&cpp_arg); - arg->cb_user_data = cpp_arg.cb_user_data(); - arg->success = cpp_arg.success(); - arg->target_name = gpr_strdup(cpp_arg.target_name()->c_str()); - arg->peer_cert = gpr_strdup(cpp_arg.peer_cert()->c_str()); - arg->status = cpp_arg.status(); - arg->error_details = gpr_strdup(cpp_arg.error_details()->c_str()); +void TlsServerAuthorizationCheckArg::OnServerAuthorizationCheckDoneCallback() { + c_arg_.cb(&c_arg_); } /** gRPC TLS server authorization check config API implementation **/ @@ -309,13 +195,13 @@ grpc_tls_credentials_options* TlsCredentialsOptions::c_credentials_options() c_options->set_cert_request_type(cert_request_type_); c_options->set_key_materials_config( ::grpc_core::RefCountedPtr( - c_key_materials(key_materials_config_))); + ConvertToCKeyMaterialsConfig(key_materials_config_))); c_options->set_credential_reload_config( ::grpc_core::RefCountedPtr( - credential_reload_config_->c_credential_reload())); + credential_reload_config_->c_config())); c_options->set_server_authorization_check_config( ::grpc_core::RefCountedPtr( - server_authorization_check_config_->c_server_authorization_check())); + server_authorization_check_config_->c_config())); return c_options; } diff --git a/src/cpp/common/tls_credentials_options_util.cc b/src/cpp/common/tls_credentials_options_util.cc new file mode 100644 index 00000000000..702f416d51a --- /dev/null +++ b/src/cpp/common/tls_credentials_options_util.cc @@ -0,0 +1,137 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "src/cpp/common/tls_credentials_options_util.h" +#include + +namespace grpc_impl { +namespace experimental { + +/** Creates a new C struct for the key materials. Note that the user must free + * the underlying pointer to private key and cert chain duplicates; they are not + * freed when the UniquePtr member variables of PemKeyCertPair are unused. + * Similarly, the user must free the underlying pointer to c_pem_root_certs. **/ +grpc_tls_key_materials_config* ConvertToCKeyMaterialsConfig( + const std::shared_ptr& config) { + grpc_tls_key_materials_config* c_config = + grpc_tls_key_materials_config_create(); + ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> + c_pem_key_cert_pair_list; + for (auto key_cert_pair = config->pem_key_cert_pair_list().begin(); + key_cert_pair != config->pem_key_cert_pair_list().end(); + key_cert_pair++) { + grpc_ssl_pem_key_cert_pair* ssl_pair = + (grpc_ssl_pem_key_cert_pair*)gpr_malloc( + sizeof(grpc_ssl_pem_key_cert_pair)); + ssl_pair->private_key = gpr_strdup(key_cert_pair->private_key.c_str()); + ssl_pair->cert_chain = gpr_strdup(key_cert_pair->cert_chain.c_str()); + ::grpc_core::PemKeyCertPair c_pem_key_cert_pair = + ::grpc_core::PemKeyCertPair(ssl_pair); + c_pem_key_cert_pair_list.push_back(::std::move(c_pem_key_cert_pair)); + } + ::grpc_core::UniquePtr c_pem_root_certs( + gpr_strdup(config->pem_root_certs().c_str())); + c_config->set_key_materials(std::move(c_pem_root_certs), + std::move(c_pem_key_cert_pair_list)); + c_config->set_version(config->version()); + return c_config; +} + +/** Creates a new TlsKeyMaterialsConfig from a C struct config. **/ +std::shared_ptr ConvertToCppKeyMaterialsConfig( + const grpc_tls_key_materials_config* config) { + std::shared_ptr cpp_config( + new TlsKeyMaterialsConfig()); + std::vector cpp_pem_key_cert_pair_list; + grpc_tls_key_materials_config::PemKeyCertPairList pem_key_cert_pair_list = + config->pem_key_cert_pair_list(); + for (size_t i = 0; i < pem_key_cert_pair_list.size(); i++) { + ::grpc_core::PemKeyCertPair key_cert_pair = pem_key_cert_pair_list[i]; + TlsKeyMaterialsConfig::PemKeyCertPair p = { + // gpr_strdup(key_cert_pair.private_key()), + // gpr_strdup(key_cert_pair.cert_chain())}; + key_cert_pair.private_key(), key_cert_pair.cert_chain()}; + cpp_pem_key_cert_pair_list.push_back(::std::move(p)); + } + cpp_config->set_key_materials(std::move(config->pem_root_certs()), + std::move(cpp_pem_key_cert_pair_list)); + cpp_config->set_version(config->version()); + return cpp_config; +} + +/** The C schedule and cancel functions for the credential reload config. **/ +int tls_credential_reload_config_c_schedule( + void* config_user_data, grpc_tls_credential_reload_arg* arg) { + TlsCredentialReloadConfig* cpp_config = + static_cast(arg->config->context()); + TlsCredentialReloadArg cpp_arg(*arg); + int schedule_output = cpp_config->Schedule(&cpp_arg); + arg->cb_user_data = cpp_arg.cb_user_data(); + arg->key_materials_config = + ConvertToCKeyMaterialsConfig(cpp_arg.key_materials_config()); + arg->status = cpp_arg.status(); + arg->error_details = gpr_strdup(cpp_arg.error_details().c_str()); + return schedule_output; +} + +void tls_credential_reload_config_c_cancel( + void* config_user_data, grpc_tls_credential_reload_arg* arg) { + TlsCredentialReloadConfig* cpp_config = + static_cast(arg->config->context()); + TlsCredentialReloadArg cpp_arg(*arg); + cpp_config->Cancel(&cpp_arg); + arg->cb_user_data = cpp_arg.cb_user_data(); + arg->key_materials_config = + ConvertToCKeyMaterialsConfig(cpp_arg.key_materials_config()); + arg->status = cpp_arg.status(); + arg->error_details = gpr_strdup(cpp_arg.error_details().c_str()); +} + +/** The C schedule and cancel functions for the server authorization check + * config. **/ +int tls_server_authorization_check_config_c_schedule( + void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { + TlsServerAuthorizationCheckConfig* cpp_config = + static_cast(arg->config->context()); + TlsServerAuthorizationCheckArg cpp_arg(*arg); + int schedule_output = cpp_config->Schedule(&cpp_arg); + arg->cb_user_data = cpp_arg.cb_user_data(); + arg->success = cpp_arg.success(); + arg->target_name = gpr_strdup(cpp_arg.target_name().c_str()); + arg->peer_cert = gpr_strdup(cpp_arg.peer_cert().c_str()); + arg->status = cpp_arg.status(); + arg->error_details = gpr_strdup(cpp_arg.error_details().c_str()); + return schedule_output; +} + +void tls_server_authorization_check_config_c_cancel( + void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { + TlsServerAuthorizationCheckConfig* cpp_config = + static_cast(arg->config->context()); + TlsServerAuthorizationCheckArg cpp_arg(*arg); + cpp_config->Cancel(&cpp_arg); + arg->cb_user_data = cpp_arg.cb_user_data(); + arg->success = cpp_arg.success(); + arg->target_name = gpr_strdup(cpp_arg.target_name().c_str()); + arg->peer_cert = gpr_strdup(cpp_arg.peer_cert().c_str()); + arg->status = cpp_arg.status(); + arg->error_details = gpr_strdup(cpp_arg.error_details().c_str()); +} + +} // namespace experimental +} // namespace grpc_impl diff --git a/src/cpp/common/tls_credentials_options_util.h b/src/cpp/common/tls_credentials_options_util.h new file mode 100644 index 00000000000..8cdcf3bd851 --- /dev/null +++ b/src/cpp/common/tls_credentials_options_util.h @@ -0,0 +1,54 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef GRPC_INTERNAL_CPP_COMMON_TLS_CREDENTIALS_OPTIONS_UTIL_H +#define GRPC_INTERNAL_CPP_COMMON_TLS_CREDENTIALS_OPTIONS_UTIL_H + +#include +#include + +#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" + +namespace grpc_impl { +namespace experimental { + +/** The following 2 functions are exposed for testing purposes. **/ +grpc_tls_key_materials_config* ConvertToCKeyMaterialsConfig( + const std::shared_ptr& config); + +std::shared_ptr ConvertToCppKeyMaterialsConfig( + const grpc_tls_key_materials_config* config); + +/** The following 4 functions convert the user-provided schedule or cancel + * functions into C style schedule or cancel functions. **/ +int tls_credential_reload_config_c_schedule( + void* config_user_data, grpc_tls_credential_reload_arg* arg); + +void tls_credential_reload_config_c_cancel(void* config_user_data, + grpc_tls_credential_reload_arg* arg); + +int tls_server_authorization_check_config_c_schedule( + void* config_user_data, grpc_tls_server_authorization_check_arg* arg); + +void tls_server_authorization_check_config_c_cancel( + void* config_user_data, grpc_tls_server_authorization_check_arg* arg); + +} // namespace experimental +} // namespace grpc_impl + +#endif // GRPC_INTERNAL_CPP_COMMON_TLS_CREDENTIALS_OPTIONS_UTIL_H diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index fad93b9fee7..d5a4a827f9f 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -29,6 +29,7 @@ #include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" #include "src/cpp/client/secure_credentials.h" +#include "src/cpp/common/tls_credentials_options_util.h" namespace { @@ -281,7 +282,8 @@ TEST_F(CredentialsTest, TlsKeyMaterialsConfigCppToC) { "cert_chain"}; std::vector pair_list = {pair}; config->set_key_materials("pem_root_certs", pair_list); - grpc_tls_key_materials_config* c_config = c_key_materials(config); + grpc_tls_key_materials_config* c_config = + ConvertToCKeyMaterialsConfig(config); EXPECT_STREQ("pem_root_certs", c_config->pem_root_certs()); EXPECT_EQ(1, static_cast(c_config->pem_key_cert_pair_list().size())); EXPECT_STREQ(pair.private_key.c_str(), @@ -312,7 +314,7 @@ TEST_F(CredentialsTest, TlsKeyMaterialsCtoCpp) { ::grpc_core::UniquePtr(gpr_strdup("pem_root_certs")), pem_key_cert_pair_list); std::shared_ptr cpp_config = - ::grpc_impl::experimental::tls_key_materials_c_to_cpp(&c_config); + ::grpc_impl::experimental::ConvertToCppKeyMaterialsConfig(&c_config); EXPECT_STREQ("pem_root_certs", cpp_config->pem_root_certs().c_str()); std::vector cpp_pair_list = cpp_config->pem_key_cert_pair_list(); @@ -331,14 +333,15 @@ TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { c_arg.cb = tls_credential_reload_callback; TlsCredentialReloadArg arg = TlsCredentialReloadArg(c_arg); arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); - arg.callback(); + arg.OnCredentialReloadDoneCallback(); EXPECT_EQ(arg.status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED); } TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { TlsCredentialReloadConfig config(nullptr, &tls_credential_reload_sync, nullptr, nullptr); - TlsCredentialReloadArg arg; + grpc_tls_credential_reload_arg c_arg; + TlsCredentialReloadArg arg(c_arg); arg.set_cb_user_data(static_cast(nullptr)); std::shared_ptr key_materials_config( new TlsKeyMaterialsConfig()); @@ -365,7 +368,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { EXPECT_STREQ(pair_list[2].private_key.c_str(), "private_key3"); EXPECT_STREQ(pair_list[2].cert_chain.c_str(), "cert_chain3"); EXPECT_EQ(arg.status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); - EXPECT_STREQ(arg.error_details()->c_str(), "error_details"); + EXPECT_STREQ(arg.error_details().c_str(), "error_details"); } TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { @@ -396,7 +399,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { grpc::string test_error_details = "error_details"; c_arg.error_details = test_error_details.c_str(); - grpc_tls_credential_reload_config* c_config = config.c_credential_reload(); + grpc_tls_credential_reload_config* c_config = config.c_config(); c_arg.config = c_config; int c_schedule_output = c_config->Schedule(&c_arg); EXPECT_EQ(c_schedule_output, 0); @@ -428,12 +431,6 @@ typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckConfig TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { grpc_tls_server_authorization_check_arg c_arg; c_arg.cb = tls_server_authorization_check_callback; - //c_arg.cb_user_data = nullptr; - //c_arg.success = 0; - //c_arg.target_name = "target_name"; - //c_arg.peer_cert = "peer_cert"; - //c_arg.status = GRPC_STATUS_UNAUTHENTICATED; - //c_arg.error_details = "error_details"; TlsServerAuthorizationCheckArg arg(c_arg); arg.set_cb_user_data(nullptr); arg.set_success(0); @@ -441,20 +438,21 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { arg.set_peer_cert("peer_cert"); arg.set_status(GRPC_STATUS_UNAUTHENTICATED); arg.set_error_details("error_details"); - arg.callback(); + arg.OnServerAuthorizationCheckDoneCallback(); EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); gpr_free(arg.cb_user_data()); EXPECT_EQ(arg.success(), 1); - EXPECT_STREQ(arg.target_name()->c_str(), "callback_target_name"); - EXPECT_STREQ(arg.peer_cert()->c_str(), "callback_peer_cert"); + EXPECT_STREQ(arg.target_name().c_str(), "callback_target_name"); + EXPECT_STREQ(arg.peer_cert().c_str(), "callback_peer_cert"); EXPECT_EQ(arg.status(), GRPC_STATUS_OK); - EXPECT_STREQ(arg.error_details()->c_str(), "callback_error_details"); + EXPECT_STREQ(arg.error_details().c_str(), "callback_error_details"); } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { TlsServerAuthorizationCheckConfig config = TlsServerAuthorizationCheckConfig( nullptr, &tls_server_authorization_check_sync, nullptr, nullptr); - TlsServerAuthorizationCheckArg arg; + grpc_tls_server_authorization_check_arg c_arg; + TlsServerAuthorizationCheckArg arg(c_arg); arg.set_cb_user_data(nullptr); arg.set_success(0); arg.set_target_name("target_name"); @@ -466,10 +464,10 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); gpr_free(arg.cb_user_data()); EXPECT_EQ(arg.success(), 1); - EXPECT_STREQ(arg.target_name()->c_str(), "sync_target_name"); - EXPECT_STREQ(arg.peer_cert()->c_str(), "sync_peer_cert"); + EXPECT_STREQ(arg.target_name().c_str(), "sync_target_name"); + EXPECT_STREQ(arg.peer_cert().c_str(), "sync_peer_cert"); EXPECT_EQ(arg.status(), GRPC_STATUS_OK); - EXPECT_STREQ(arg.error_details()->c_str(), "sync_error_details"); + EXPECT_STREQ(arg.error_details().c_str(), "sync_error_details"); } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { @@ -485,8 +483,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { c_arg.status = GRPC_STATUS_UNAUTHENTICATED; c_arg.error_details = "error_details"; - grpc_tls_server_authorization_check_config* c_config = - config.c_server_authorization_check(); + grpc_tls_server_authorization_check_config* c_config = config.c_config(); c_arg.config = c_config; int c_schedule_output = c_config->Schedule(&c_arg); EXPECT_EQ(c_schedule_output, 1); diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 3507e32592b..8987ac77941 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1266,6 +1266,8 @@ src/cpp/common/secure_auth_context.h \ src/cpp/common/secure_channel_arguments.cc \ src/cpp/common/secure_create_auth_context.cc \ src/cpp/common/tls_credentials_options.cc \ +src/cpp/common/tls_credentials_options_util.cc \ +src/cpp/common/tls_credentials_options_util.h \ src/cpp/common/validate_service_config.cc \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ From 5d9297d0bc85289584b689611c7abb1939d3fce2 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Mon, 26 Aug 2019 14:31:16 -0700 Subject: [PATCH 38/70] Fixed some memory leaks --- .../grpcpp/security/tls_credentials_options.h | 11 ++++ src/cpp/common/tls_credentials_options.cc | 56 +++++++++++++++++-- test/cpp/client/credentials_test.cc | 6 +- 3 files changed, 66 insertions(+), 7 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 8b19a9b873d..d65d7278ed0 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -85,6 +85,7 @@ class TlsCredentialReloadArg { private: grpc_tls_credential_reload_arg c_arg_; + bool error_details_alloc_ = false; }; /** TLS credential reloag config, wraps grpc_tls_credential_reload_config. **/ @@ -157,6 +158,12 @@ class TlsServerAuthorizationCheckArg { private: grpc_tls_server_authorization_check_arg c_arg_; + /** These boolean variables record whether the corresponding field of the C + * arg was dynamically allocated. This occurs e.g. if one of the above setter functions was + * used, or if the C arg's callback function does so. **/ + bool target_name_alloc_ = false; + bool peer_cert_alloc_ = false; + bool error_details_alloc_ = false; }; /** TLS server authorization check config, wraps @@ -173,6 +180,10 @@ class TlsServerAuthorizationCheckConfig { ~TlsServerAuthorizationCheckConfig(); int Schedule(TlsServerAuthorizationCheckArg* arg) const { + if (schedule_ == nullptr) { + gpr_log(GPR_ERROR, "schedule API is nullptr"); + return 1; + } return schedule_(config_user_data_, arg); } diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 2f4a95384b9..760ae7f491b 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -21,6 +21,21 @@ #include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" #include "src/cpp/common/tls_credentials_options_util.h" +namespace { + /** This function returns True and frees old_string if old_string and + * new_string are different, and frees the memory allocated to old_string if it was dynamically allocated. + * Otherwise, it whether or not the old_string was dynamically allocated. **/ + bool cleanup_string(const char* old_string, const char* new_string, bool old_string_alloc) { + if (old_string != new_string) { + if (old_string_alloc) { + gpr_free(const_cast(old_string)); + } + return true; + } + return old_string_alloc; + } +} + namespace grpc_impl { namespace experimental { @@ -38,7 +53,7 @@ TlsCredentialReloadArg::TlsCredentialReloadArg( c_arg_ = arg; } -TlsCredentialReloadArg::~TlsCredentialReloadArg() {} +TlsCredentialReloadArg::~TlsCredentialReloadArg() { } void* TlsCredentialReloadArg::cb_user_data() const { return c_arg_.cb_user_data; @@ -79,11 +94,18 @@ void TlsCredentialReloadArg::set_status( void TlsCredentialReloadArg::set_error_details( const grpc::string& error_details) { + if (error_details_alloc_) { + gpr_free(const_cast(c_arg_.error_details)); + } + c_arg_.error_details = gpr_strdup(error_details.c_str()); + error_details_alloc_ = true; c_arg_.error_details = gpr_strdup(error_details.c_str()); } void TlsCredentialReloadArg::OnCredentialReloadDoneCallback() { + const char* error_details = c_arg_.error_details; c_arg_.cb(&c_arg_); + error_details_alloc_ = cleanup_string(error_details, c_arg_.error_details, error_details_alloc_); } /** gRPC TLS credential reload config API implementation **/ @@ -102,7 +124,9 @@ TlsCredentialReloadConfig::TlsCredentialReloadConfig( c_config_->set_context(static_cast(this)); } -TlsCredentialReloadConfig::~TlsCredentialReloadConfig() {} +TlsCredentialReloadConfig::~TlsCredentialReloadConfig() { + ::grpc_core::Delete(c_config_); +} /** gRPC TLS server authorization check arg API implementation **/ TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg( @@ -110,7 +134,11 @@ TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg( c_arg_ = arg; } -TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() {} +TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() { + if (target_name_alloc_) { gpr_free(const_cast(c_arg_.target_name)); } + if (peer_cert_alloc_) { gpr_free(const_cast(c_arg_.peer_cert)); } + if (error_details_alloc_) { gpr_free(const_cast(c_arg_.error_details)); } +} void* TlsServerAuthorizationCheckArg::cb_user_data() const { return c_arg_.cb_user_data; @@ -147,12 +175,20 @@ void TlsServerAuthorizationCheckArg::set_success(int success) { void TlsServerAuthorizationCheckArg::set_target_name( const grpc::string& target_name) { + if (target_name_alloc_) { + gpr_free(const_cast(c_arg_.target_name)); + } c_arg_.target_name = gpr_strdup(target_name.c_str()); + target_name_alloc_ = true; } void TlsServerAuthorizationCheckArg::set_peer_cert( const grpc::string& peer_cert) { + if (peer_cert_alloc_) { + gpr_free(const_cast(c_arg_.peer_cert)); + } c_arg_.peer_cert = gpr_strdup(peer_cert.c_str()); + peer_cert_alloc_ = true; } void TlsServerAuthorizationCheckArg::set_status(grpc_status_code status) { @@ -161,11 +197,21 @@ void TlsServerAuthorizationCheckArg::set_status(grpc_status_code status) { void TlsServerAuthorizationCheckArg::set_error_details( const grpc::string& error_details) { + if (error_details_alloc_) { + gpr_free(const_cast(c_arg_.error_details)); + } c_arg_.error_details = gpr_strdup(error_details.c_str()); + error_details_alloc_ = true; } void TlsServerAuthorizationCheckArg::OnServerAuthorizationCheckDoneCallback() { + const char* target_name = c_arg_.target_name; + const char* peer_cert = c_arg_.peer_cert; + const char* error_details = c_arg_.error_details; c_arg_.cb(&c_arg_); + target_name_alloc_ = cleanup_string(target_name, c_arg_.target_name, target_name_alloc_); + peer_cert_alloc_ = cleanup_string(peer_cert, c_arg_.peer_cert, peer_cert_alloc_); + error_details_alloc_ = cleanup_string(error_details, c_arg_.error_details, error_details_alloc_); } /** gRPC TLS server authorization check config API implementation **/ @@ -185,7 +231,9 @@ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( c_config_->set_context(static_cast(this)); } -TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() {} +TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() { + ::grpc_core::Delete(c_config_); +} /** gRPC TLS credential options API implementation **/ grpc_tls_credentials_options* TlsCredentialsOptions::c_credentials_options() diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index d5a4a827f9f..5257bc83051 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -77,10 +77,10 @@ static void tls_server_authorization_check_callback( grpc::string cb_user_data = "cb_user_data"; arg->cb_user_data = static_cast(gpr_strdup(cb_user_data.c_str())); arg->success = 1; - arg->target_name = "callback_target_name"; - arg->peer_cert = "callback_peer_cert"; + arg->target_name = gpr_strdup("callback_target_name"); + arg->peer_cert = gpr_strdup("callback_peer_cert"); arg->status = GRPC_STATUS_OK; - arg->error_details = "callback_error_details"; + arg->error_details = gpr_strdup("callback_error_details"); } static int tls_server_authorization_check_sync( From 90839c5e0fd9c66d73915c61a58d659fb377f08a Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Mon, 26 Aug 2019 14:40:37 -0700 Subject: [PATCH 39/70] Changed naming style of C schedule/cancel functions. --- src/cpp/common/tls_credentials_options.cc | 8 ++++---- src/cpp/common/tls_credentials_options_util.cc | 8 ++++---- src/cpp/common/tls_credentials_options_util.h | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 760ae7f491b..830c1a4c8dd 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -119,8 +119,8 @@ TlsCredentialReloadConfig::TlsCredentialReloadConfig( cancel_ = cancel; destruct_ = destruct; c_config_ = grpc_tls_credential_reload_config_create( - config_user_data_, &tls_credential_reload_config_c_schedule, - &tls_credential_reload_config_c_cancel, destruct_); + config_user_data_, &TlsCredentialReloadConfigCSchedule, + &TlsCredentialReloadConfigCCancel, destruct_); c_config_->set_context(static_cast(this)); } @@ -226,8 +226,8 @@ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( cancel_ = cancel; destruct_ = destruct; c_config_ = grpc_tls_server_authorization_check_config_create( - config_user_data_, &tls_server_authorization_check_config_c_schedule, - &tls_server_authorization_check_config_c_cancel, destruct_); + config_user_data_, &TlsServerAuthorizationCheckConfigCSchedule, + &TlsServerAuthorizationCheckConfigCCancel, destruct_); c_config_->set_context(static_cast(this)); } diff --git a/src/cpp/common/tls_credentials_options_util.cc b/src/cpp/common/tls_credentials_options_util.cc index 702f416d51a..14de025c075 100644 --- a/src/cpp/common/tls_credentials_options_util.cc +++ b/src/cpp/common/tls_credentials_options_util.cc @@ -75,7 +75,7 @@ std::shared_ptr ConvertToCppKeyMaterialsConfig( } /** The C schedule and cancel functions for the credential reload config. **/ -int tls_credential_reload_config_c_schedule( +int TlsCredentialReloadConfigCSchedule( void* config_user_data, grpc_tls_credential_reload_arg* arg) { TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); @@ -89,7 +89,7 @@ int tls_credential_reload_config_c_schedule( return schedule_output; } -void tls_credential_reload_config_c_cancel( +void TlsCredentialReloadConfigCCancel( void* config_user_data, grpc_tls_credential_reload_arg* arg) { TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); @@ -104,7 +104,7 @@ void tls_credential_reload_config_c_cancel( /** The C schedule and cancel functions for the server authorization check * config. **/ -int tls_server_authorization_check_config_c_schedule( +int TlsServerAuthorizationCheckConfigCSchedule( void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { TlsServerAuthorizationCheckConfig* cpp_config = static_cast(arg->config->context()); @@ -119,7 +119,7 @@ int tls_server_authorization_check_config_c_schedule( return schedule_output; } -void tls_server_authorization_check_config_c_cancel( +void TlsServerAuthorizationCheckConfigCCancel( void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { TlsServerAuthorizationCheckConfig* cpp_config = static_cast(arg->config->context()); diff --git a/src/cpp/common/tls_credentials_options_util.h b/src/cpp/common/tls_credentials_options_util.h index 8cdcf3bd851..6ce34be7ed8 100644 --- a/src/cpp/common/tls_credentials_options_util.h +++ b/src/cpp/common/tls_credentials_options_util.h @@ -36,16 +36,16 @@ std::shared_ptr ConvertToCppKeyMaterialsConfig( /** The following 4 functions convert the user-provided schedule or cancel * functions into C style schedule or cancel functions. **/ -int tls_credential_reload_config_c_schedule( +int TlsCredentialReloadConfigCSchedule( void* config_user_data, grpc_tls_credential_reload_arg* arg); -void tls_credential_reload_config_c_cancel(void* config_user_data, +void TlsCredentialReloadConfigCCancel(void* config_user_data, grpc_tls_credential_reload_arg* arg); -int tls_server_authorization_check_config_c_schedule( +int TlsServerAuthorizationCheckConfigCSchedule( void* config_user_data, grpc_tls_server_authorization_check_arg* arg); -void tls_server_authorization_check_config_c_cancel( +void TlsServerAuthorizationCheckConfigCCancel( void* config_user_data, grpc_tls_server_authorization_check_arg* arg); } // namespace experimental From 1735135b270dd3d4a8bd316897748405b3537b4e Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Mon, 26 Aug 2019 14:54:45 -0700 Subject: [PATCH 40/70] Deleted extra xml file, removed server authorization check memory leaks --- ml | 7 ------- test/cpp/client/credentials_test.cc | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) delete mode 100644 ml diff --git a/ml b/ml deleted file mode 100644 index 678284ae797..00000000000 --- a/ml +++ /dev/null @@ -1,7 +0,0 @@ - -Note: Google Test filter = CredentialsTest.TlsServerAuthorizationCheckCppToC -[==========] Running 1 test from 1 test case. -[----------] Global test environment set-up. -[----------] 1 test from CredentialsTest -[ RUN ] CredentialsTest.TlsServerAuthorizationCheckCppToC - \ No newline at end of file diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 5257bc83051..6b58e18e8da 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -415,11 +415,16 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { EXPECT_STREQ(pair_list[1].cert_chain(), "cert_chain3"); EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); EXPECT_STREQ(c_arg.error_details, test_error_details.c_str()); + const char* error_details_after_schedule = c_arg.error_details; c_config->Cancel(&c_arg); EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); EXPECT_STREQ(c_arg.error_details, "cancelled"); + // Must free the fields of the C arg afterwards, regardless + // of whether or not they were changed. + gpr_free(const_cast(c_arg.error_details)); + gpr_free(const_cast(error_details_after_schedule)); gpr_free(c_config); } @@ -495,9 +500,22 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { EXPECT_EQ(c_arg.status, GRPC_STATUS_OK); EXPECT_STREQ(c_arg.error_details, "sync_error_details"); + const char* target_name_after_schedule = c_arg.target_name; + const char* peer_cert_after_schedule = c_arg.peer_cert; + const char* error_details_after_schedule = c_arg.error_details; + c_config->Cancel(&c_arg); EXPECT_EQ(c_arg.status, GRPC_STATUS_PERMISSION_DENIED); EXPECT_STREQ(c_arg.error_details, "cancelled"); + + // Must free the fields of the C arg afterwards, regardless + // of whether or not they were changed. + gpr_free(const_cast(c_arg.target_name)); + gpr_free(const_cast(c_arg.peer_cert)); + gpr_free(const_cast(c_arg.error_details)); + gpr_free(const_cast(target_name_after_schedule)); + gpr_free(const_cast(peer_cert_after_schedule)); + gpr_free(const_cast(error_details_after_schedule)); } typedef class ::grpc_impl::experimental::TlsCredentialsOptions @@ -580,6 +598,7 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); EXPECT_STREQ(c_credential_reload_arg.error_details, test_error_details.c_str()); + gpr_free(const_cast(c_credential_reload_arg.error_details)); int c_server_authorization_check_schedule_output = c_server_authorization_check_config->Schedule( @@ -596,6 +615,10 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { EXPECT_EQ(c_server_authorization_check_arg.status, GRPC_STATUS_OK); EXPECT_STREQ(c_server_authorization_check_arg.error_details, "sync_error_details"); + gpr_free(const_cast(c_server_authorization_check_arg.target_name)); + gpr_free(const_cast(c_server_authorization_check_arg.peer_cert)); + gpr_free(const_cast(c_server_authorization_check_arg.error_details)); + gpr_free(c_options); } From 333cd930c3405c2975654c27dcee6cb12577e943 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Mon, 26 Aug 2019 14:59:32 -0700 Subject: [PATCH 41/70] Removed old Arg constructors as comments. --- include/grpcpp/security/tls_credentials_options.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index d65d7278ed0..a3bc60d6125 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -59,7 +59,6 @@ class TlsKeyMaterialsConfig { /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ class TlsCredentialReloadArg { public: - // TlsCredentialReloadArg(); TlsCredentialReloadArg(grpc_tls_credential_reload_arg arg); ~TlsCredentialReloadArg(); @@ -131,7 +130,6 @@ class TlsCredentialReloadConfig { class TlsServerAuthorizationCheckArg { public: - // TlsServerAuthorizationCheckArg(); TlsServerAuthorizationCheckArg(grpc_tls_server_authorization_check_arg arg); ~TlsServerAuthorizationCheckArg(); From 86f52e312a43ea12bf9a728e3742dad1d2666d22 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Mon, 26 Aug 2019 15:37:10 -0700 Subject: [PATCH 42/70] More work with memory leaks --- include/grpcpp/security/tls_credentials_options.h | 4 ++++ src/cpp/common/tls_credentials_options.cc | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index a3bc60d6125..87c97dbd217 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -84,6 +84,10 @@ class TlsCredentialReloadArg { private: grpc_tls_credential_reload_arg c_arg_; + /** These boolean variables record whether the corresponding field of the C + * arg was dynamically allocated. This occurs e.g. if one of the above setter functions was + * used, or if the C arg's callback function does so. **/ + bool key_materials_config_alloc_ = false; bool error_details_alloc_ = false; }; diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 830c1a4c8dd..5a446cd0354 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -53,7 +53,10 @@ TlsCredentialReloadArg::TlsCredentialReloadArg( c_arg_ = arg; } -TlsCredentialReloadArg::~TlsCredentialReloadArg() { } +TlsCredentialReloadArg::~TlsCredentialReloadArg() { + if (key_materials_config_alloc_) { gpr_free(c_arg_.key_materials_config); } + if (error_details_alloc_) { gpr_free(const_cast(c_arg_.error_details)); } +} void* TlsCredentialReloadArg::cb_user_data() const { return c_arg_.cb_user_data; @@ -83,8 +86,12 @@ void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { void TlsCredentialReloadArg::set_key_materials_config( const std::shared_ptr& key_materials_config) { + if (key_materials_config_alloc_) { + gpr_free(c_arg_.key_materials_config); + } c_arg_.key_materials_config = ConvertToCKeyMaterialsConfig(key_materials_config); + key_materials_config_alloc_ = true; } void TlsCredentialReloadArg::set_status( @@ -99,7 +106,6 @@ void TlsCredentialReloadArg::set_error_details( } c_arg_.error_details = gpr_strdup(error_details.c_str()); error_details_alloc_ = true; - c_arg_.error_details = gpr_strdup(error_details.c_str()); } void TlsCredentialReloadArg::OnCredentialReloadDoneCallback() { From c942282abc1592997ccb344925a8d76be61ba826 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 27 Aug 2019 14:57:02 -0700 Subject: [PATCH 43/70] Implemented Yihua's review comments --- .../grpcpp/security/tls_credentials_options.h | 47 ++---- src/cpp/common/tls_credentials_options.cc | 156 ++++++------------ .../common/tls_credentials_options_util.cc | 51 ++---- test/cpp/client/credentials_test.cc | 95 ++++++----- 4 files changed, 135 insertions(+), 214 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 87c97dbd217..f5c0545ea0c 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -59,7 +59,7 @@ class TlsKeyMaterialsConfig { /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ class TlsCredentialReloadArg { public: - TlsCredentialReloadArg(grpc_tls_credential_reload_arg arg); + TlsCredentialReloadArg(grpc_tls_credential_reload_arg* arg) : c_arg_(arg) { } ~TlsCredentialReloadArg(); /** Getters for member fields. The callback function is not exposed. @@ -83,12 +83,7 @@ class TlsCredentialReloadArg { void OnCredentialReloadDoneCallback(); private: - grpc_tls_credential_reload_arg c_arg_; - /** These boolean variables record whether the corresponding field of the C - * arg was dynamically allocated. This occurs e.g. if one of the above setter functions was - * used, or if the C arg's callback function does so. **/ - bool key_materials_config_alloc_ = false; - bool error_details_alloc_ = false; + grpc_tls_credential_reload_arg* c_arg_; }; /** TLS credential reloag config, wraps grpc_tls_credential_reload_config. **/ @@ -134,7 +129,7 @@ class TlsCredentialReloadConfig { class TlsServerAuthorizationCheckArg { public: - TlsServerAuthorizationCheckArg(grpc_tls_server_authorization_check_arg arg); + TlsServerAuthorizationCheckArg(grpc_tls_server_authorization_check_arg* arg) : c_arg_(arg) { } ~TlsServerAuthorizationCheckArg(); /** Getters for member fields. They return the corresponding fields of the @@ -159,13 +154,7 @@ class TlsServerAuthorizationCheckArg { void OnServerAuthorizationCheckDoneCallback(); private: - grpc_tls_server_authorization_check_arg c_arg_; - /** These boolean variables record whether the corresponding field of the C - * arg was dynamically allocated. This occurs e.g. if one of the above setter functions was - * used, or if the C arg's callback function does so. **/ - bool target_name_alloc_ = false; - bool peer_cert_alloc_ = false; - bool error_details_alloc_ = false; + grpc_tls_server_authorization_check_arg* c_arg_; }; /** TLS server authorization check config, wraps @@ -213,6 +202,12 @@ class TlsServerAuthorizationCheckConfig { /** TLS credentials options, wrapper for grpc_tls_credentials_options. **/ class TlsCredentialsOptions { public: + TlsCredentialsOptions(grpc_ssl_client_certificate_request_type cert_request_type, + std::shared_ptr key_materials_config, + std::shared_ptr credential_reload_config, + std::shared_ptr server_authorization_check_config); + ~TlsCredentialsOptions(); + /** Getters for member fields. **/ grpc_ssl_client_certificate_request_type cert_request_type() const { return cert_request_type_; @@ -227,26 +222,9 @@ class TlsCredentialsOptions { server_authorization_check_config() const { return server_authorization_check_config_; } - - /** Setters for member fields. **/ - void set_cert_request_type( - const grpc_ssl_client_certificate_request_type type) { - cert_request_type_ = type; - } - void set_key_materials_config(std::shared_ptr config) { - key_materials_config_ = std::move(config); + grpc_tls_credentials_options* c_credentials_options() const { + return c_credentials_options_; } - void set_credential_reload_config( - std::shared_ptr config) { - credential_reload_config_ = std::move(config); - } - void set_server_authorization_check_config( - std::shared_ptr config) { - server_authorization_check_config_ = std::move(config); - } - - /** Creates C struct for TLS credential options. **/ - grpc_tls_credentials_options* c_credentials_options() const; private: grpc_ssl_client_certificate_request_type cert_request_type_; @@ -254,6 +232,7 @@ class TlsCredentialsOptions { std::shared_ptr credential_reload_config_; std::shared_ptr server_authorization_check_config_; + grpc_tls_credentials_options* c_credentials_options_; }; } // namespace experimental diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 5a446cd0354..eb9f8e6fe98 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -21,21 +21,6 @@ #include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" #include "src/cpp/common/tls_credentials_options_util.h" -namespace { - /** This function returns True and frees old_string if old_string and - * new_string are different, and frees the memory allocated to old_string if it was dynamically allocated. - * Otherwise, it whether or not the old_string was dynamically allocated. **/ - bool cleanup_string(const char* old_string, const char* new_string, bool old_string_alloc) { - if (old_string != new_string) { - if (old_string_alloc) { - gpr_free(const_cast(old_string)); - } - return true; - } - return old_string_alloc; - } -} - namespace grpc_impl { namespace experimental { @@ -48,18 +33,10 @@ void TlsKeyMaterialsConfig::set_key_materials( } /** TLS credential reload arg API implementation **/ -TlsCredentialReloadArg::TlsCredentialReloadArg( - grpc_tls_credential_reload_arg arg) { - c_arg_ = arg; -} - -TlsCredentialReloadArg::~TlsCredentialReloadArg() { - if (key_materials_config_alloc_) { gpr_free(c_arg_.key_materials_config); } - if (error_details_alloc_) { gpr_free(const_cast(c_arg_.error_details)); } -} +TlsCredentialReloadArg::~TlsCredentialReloadArg() { } void* TlsCredentialReloadArg::cb_user_data() const { - return c_arg_.cb_user_data; + return c_arg_->cb_user_data; } /** This function creates a new TlsKeyMaterialsConfig instance whose fields are @@ -67,51 +44,41 @@ void* TlsCredentialReloadArg::cb_user_data() const { * TlsCredentialReloadArg instance. **/ std::shared_ptr TlsCredentialReloadArg::key_materials_config() const { - return ConvertToCppKeyMaterialsConfig(c_arg_.key_materials_config); + return ConvertToCppKeyMaterialsConfig(c_arg_->key_materials_config); } grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() const { - return c_arg_.status; + return c_arg_->status; } grpc::string TlsCredentialReloadArg::error_details() const { - grpc::string cpp_error_details(c_arg_.error_details); + grpc::string cpp_error_details(c_arg_->error_details); return cpp_error_details; } void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { - c_arg_.cb_user_data = cb_user_data; + c_arg_->cb_user_data = cb_user_data; } void TlsCredentialReloadArg::set_key_materials_config( const std::shared_ptr& key_materials_config) { - if (key_materials_config_alloc_) { - gpr_free(c_arg_.key_materials_config); - } - c_arg_.key_materials_config = + c_arg_->key_materials_config = ConvertToCKeyMaterialsConfig(key_materials_config); - key_materials_config_alloc_ = true; } void TlsCredentialReloadArg::set_status( grpc_ssl_certificate_config_reload_status status) { - c_arg_.status = status; + c_arg_->status = status; } void TlsCredentialReloadArg::set_error_details( const grpc::string& error_details) { - if (error_details_alloc_) { - gpr_free(const_cast(c_arg_.error_details)); - } - c_arg_.error_details = gpr_strdup(error_details.c_str()); - error_details_alloc_ = true; + c_arg_->error_details = gpr_strdup(error_details.c_str()); } void TlsCredentialReloadArg::OnCredentialReloadDoneCallback() { - const char* error_details = c_arg_.error_details; - c_arg_.cb(&c_arg_); - error_details_alloc_ = cleanup_string(error_details, c_arg_.error_details, error_details_alloc_); + c_arg_->cb(c_arg_); } /** gRPC TLS credential reload config API implementation **/ @@ -119,11 +86,10 @@ TlsCredentialReloadConfig::TlsCredentialReloadConfig( const void* config_user_data, int (*schedule)(void* config_user_data, TlsCredentialReloadArg* arg), void (*cancel)(void* config_user_data, TlsCredentialReloadArg* arg), - void (*destruct)(void* config_user_data)) { - config_user_data_ = const_cast(config_user_data); - schedule_ = schedule; - cancel_ = cancel; - destruct_ = destruct; + void (*destruct)(void* config_user_data)) : config_user_data_(const_cast(config_user_data)), + schedule_(schedule), + cancel_(cancel), + destruct_(destruct) { c_config_ = grpc_tls_credential_reload_config_create( config_user_data_, &TlsCredentialReloadConfigCSchedule, &TlsCredentialReloadConfigCCancel, destruct_); @@ -135,89 +101,63 @@ TlsCredentialReloadConfig::~TlsCredentialReloadConfig() { } /** gRPC TLS server authorization check arg API implementation **/ -TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg( - grpc_tls_server_authorization_check_arg arg) { - c_arg_ = arg; -} - TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() { - if (target_name_alloc_) { gpr_free(const_cast(c_arg_.target_name)); } - if (peer_cert_alloc_) { gpr_free(const_cast(c_arg_.peer_cert)); } - if (error_details_alloc_) { gpr_free(const_cast(c_arg_.error_details)); } } void* TlsServerAuthorizationCheckArg::cb_user_data() const { - return c_arg_.cb_user_data; + return c_arg_->cb_user_data; } -int TlsServerAuthorizationCheckArg::success() const { return c_arg_.success; } +int TlsServerAuthorizationCheckArg::success() const { return c_arg_->success; } grpc::string TlsServerAuthorizationCheckArg::target_name() const { - grpc::string cpp_target_name(c_arg_.target_name); + grpc::string cpp_target_name(c_arg_->target_name); return cpp_target_name; } grpc::string TlsServerAuthorizationCheckArg::peer_cert() const { - grpc::string cpp_peer_cert(c_arg_.peer_cert); + grpc::string cpp_peer_cert(c_arg_->peer_cert); return cpp_peer_cert; } grpc_status_code TlsServerAuthorizationCheckArg::status() const { - return c_arg_.status; + return c_arg_->status; } grpc::string TlsServerAuthorizationCheckArg::error_details() const { - grpc::string cpp_error_details(c_arg_.error_details); + grpc::string cpp_error_details(c_arg_->error_details); return cpp_error_details; } void TlsServerAuthorizationCheckArg::set_cb_user_data(void* cb_user_data) { - c_arg_.cb_user_data = cb_user_data; + c_arg_->cb_user_data = cb_user_data; } void TlsServerAuthorizationCheckArg::set_success(int success) { - c_arg_.success = success; + c_arg_->success = success; } void TlsServerAuthorizationCheckArg::set_target_name( const grpc::string& target_name) { - if (target_name_alloc_) { - gpr_free(const_cast(c_arg_.target_name)); - } - c_arg_.target_name = gpr_strdup(target_name.c_str()); - target_name_alloc_ = true; + c_arg_->target_name = gpr_strdup(target_name.c_str()); } void TlsServerAuthorizationCheckArg::set_peer_cert( const grpc::string& peer_cert) { - if (peer_cert_alloc_) { - gpr_free(const_cast(c_arg_.peer_cert)); - } - c_arg_.peer_cert = gpr_strdup(peer_cert.c_str()); - peer_cert_alloc_ = true; + c_arg_->peer_cert = gpr_strdup(peer_cert.c_str()); } void TlsServerAuthorizationCheckArg::set_status(grpc_status_code status) { - c_arg_.status = status; + c_arg_->status = status; } void TlsServerAuthorizationCheckArg::set_error_details( const grpc::string& error_details) { - if (error_details_alloc_) { - gpr_free(const_cast(c_arg_.error_details)); - } - c_arg_.error_details = gpr_strdup(error_details.c_str()); - error_details_alloc_ = true; + c_arg_->error_details = gpr_strdup(error_details.c_str()); } void TlsServerAuthorizationCheckArg::OnServerAuthorizationCheckDoneCallback() { - const char* target_name = c_arg_.target_name; - const char* peer_cert = c_arg_.peer_cert; - const char* error_details = c_arg_.error_details; - c_arg_.cb(&c_arg_); - target_name_alloc_ = cleanup_string(target_name, c_arg_.target_name, target_name_alloc_); - peer_cert_alloc_ = cleanup_string(peer_cert, c_arg_.peer_cert, peer_cert_alloc_); - error_details_alloc_ = cleanup_string(error_details, c_arg_.error_details, error_details_alloc_); + c_arg_->cb(c_arg_); } /** gRPC TLS server authorization check config API implementation **/ @@ -226,11 +166,10 @@ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( int (*schedule)(void* config_user_data, TlsServerAuthorizationCheckArg* arg), void (*cancel)(void* config_user_data, TlsServerAuthorizationCheckArg* arg), - void (*destruct)(void* config_user_data)) { - config_user_data_ = const_cast(config_user_data); - schedule_ = schedule; - cancel_ = cancel; - destruct_ = destruct; + void (*destruct)(void* config_user_data)) : config_user_data_(const_cast(config_user_data)), + schedule_(schedule), + cancel_(cancel), + destruct_(destruct) { c_config_ = grpc_tls_server_authorization_check_config_create( config_user_data_, &TlsServerAuthorizationCheckConfigCSchedule, &TlsServerAuthorizationCheckConfigCCancel, destruct_); @@ -242,21 +181,24 @@ TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() { } /** gRPC TLS credential options API implementation **/ -grpc_tls_credentials_options* TlsCredentialsOptions::c_credentials_options() - const { - grpc_tls_credentials_options* c_options = - grpc_tls_credentials_options_create(); - c_options->set_cert_request_type(cert_request_type_); - c_options->set_key_materials_config( - ::grpc_core::RefCountedPtr( - ConvertToCKeyMaterialsConfig(key_materials_config_))); - c_options->set_credential_reload_config( - ::grpc_core::RefCountedPtr( - credential_reload_config_->c_config())); - c_options->set_server_authorization_check_config( - ::grpc_core::RefCountedPtr( - server_authorization_check_config_->c_config())); - return c_options; +TlsCredentialsOptions::TlsCredentialsOptions(grpc_ssl_client_certificate_request_type cert_request_type, + std::shared_ptr key_materials_config, + std::shared_ptr credential_reload_config, + std::shared_ptr server_authorization_check_config) : + cert_request_type_(cert_request_type), + key_materials_config_(key_materials_config), + credential_reload_config_(credential_reload_config), + server_authorization_check_config_(server_authorization_check_config) { + c_credentials_options_ = grpc_tls_credentials_options_create(); + grpc_tls_credentials_options_set_cert_request_type(c_credentials_options_, cert_request_type_); + grpc_tls_credentials_options_set_key_materials_config(c_credentials_options_, ConvertToCKeyMaterialsConfig(key_materials_config_)); + grpc_tls_credentials_options_set_credential_reload_config(c_credentials_options_, credential_reload_config_->c_config()); + grpc_tls_credentials_options_set_server_authorization_check_config( + c_credentials_options_, server_authorization_check_config_->c_config()); +} + +TlsCredentialsOptions::~TlsCredentialsOptions() { + gpr_free(c_credentials_options_); } } // namespace experimental diff --git a/src/cpp/common/tls_credentials_options_util.cc b/src/cpp/common/tls_credentials_options_util.cc index 14de025c075..bb4538973ec 100644 --- a/src/cpp/common/tls_credentials_options_util.cc +++ b/src/cpp/common/tls_credentials_options_util.cc @@ -22,7 +22,8 @@ namespace grpc_impl { namespace experimental { -/** Creates a new C struct for the key materials. Note that the user must free +/** Converts the Cpp key materials to C key materials; this allocates memory for + * the C key materials. Note that the user must free * the underlying pointer to private key and cert chain duplicates; they are not * freed when the UniquePtr member variables of PemKeyCertPair are unused. * Similarly, the user must free the underlying pointer to c_pem_root_certs. **/ @@ -52,7 +53,8 @@ grpc_tls_key_materials_config* ConvertToCKeyMaterialsConfig( return c_config; } -/** Creates a new TlsKeyMaterialsConfig from a C struct config. **/ +/** Converts the C key materials config to a Cpp key materials config; it + * allocates memory for the Cpp config. **/ std::shared_ptr ConvertToCppKeyMaterialsConfig( const grpc_tls_key_materials_config* config) { std::shared_ptr cpp_config( @@ -63,8 +65,6 @@ std::shared_ptr ConvertToCppKeyMaterialsConfig( for (size_t i = 0; i < pem_key_cert_pair_list.size(); i++) { ::grpc_core::PemKeyCertPair key_cert_pair = pem_key_cert_pair_list[i]; TlsKeyMaterialsConfig::PemKeyCertPair p = { - // gpr_strdup(key_cert_pair.private_key()), - // gpr_strdup(key_cert_pair.cert_chain())}; key_cert_pair.private_key(), key_cert_pair.cert_chain()}; cpp_pem_key_cert_pair_list.push_back(::std::move(p)); } @@ -74,63 +74,42 @@ std::shared_ptr ConvertToCppKeyMaterialsConfig( return cpp_config; } -/** The C schedule and cancel functions for the credential reload config. **/ +/** The C schedule and cancel functions for the credential reload config. + * They populate a C credential reload arg with the result of a C++ credential + * reload schedule/cancel API. **/ int TlsCredentialReloadConfigCSchedule( void* config_user_data, grpc_tls_credential_reload_arg* arg) { TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); - TlsCredentialReloadArg cpp_arg(*arg); - int schedule_output = cpp_config->Schedule(&cpp_arg); - arg->cb_user_data = cpp_arg.cb_user_data(); - arg->key_materials_config = - ConvertToCKeyMaterialsConfig(cpp_arg.key_materials_config()); - arg->status = cpp_arg.status(); - arg->error_details = gpr_strdup(cpp_arg.error_details().c_str()); - return schedule_output; + TlsCredentialReloadArg cpp_arg(arg); + return cpp_config->Schedule(&cpp_arg); } void TlsCredentialReloadConfigCCancel( void* config_user_data, grpc_tls_credential_reload_arg* arg) { TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); - TlsCredentialReloadArg cpp_arg(*arg); + TlsCredentialReloadArg cpp_arg(arg); cpp_config->Cancel(&cpp_arg); - arg->cb_user_data = cpp_arg.cb_user_data(); - arg->key_materials_config = - ConvertToCKeyMaterialsConfig(cpp_arg.key_materials_config()); - arg->status = cpp_arg.status(); - arg->error_details = gpr_strdup(cpp_arg.error_details().c_str()); } /** The C schedule and cancel functions for the server authorization check - * config. **/ + * config. They populate a C server authorization check arg with the result + * of a C++ server authorization check schedule/cancel API. **/ int TlsServerAuthorizationCheckConfigCSchedule( void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { TlsServerAuthorizationCheckConfig* cpp_config = static_cast(arg->config->context()); - TlsServerAuthorizationCheckArg cpp_arg(*arg); - int schedule_output = cpp_config->Schedule(&cpp_arg); - arg->cb_user_data = cpp_arg.cb_user_data(); - arg->success = cpp_arg.success(); - arg->target_name = gpr_strdup(cpp_arg.target_name().c_str()); - arg->peer_cert = gpr_strdup(cpp_arg.peer_cert().c_str()); - arg->status = cpp_arg.status(); - arg->error_details = gpr_strdup(cpp_arg.error_details().c_str()); - return schedule_output; + TlsServerAuthorizationCheckArg cpp_arg(arg); + return cpp_config->Schedule(&cpp_arg); } void TlsServerAuthorizationCheckConfigCCancel( void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { TlsServerAuthorizationCheckConfig* cpp_config = static_cast(arg->config->context()); - TlsServerAuthorizationCheckArg cpp_arg(*arg); + TlsServerAuthorizationCheckArg cpp_arg(arg); cpp_config->Cancel(&cpp_arg); - arg->cb_user_data = cpp_arg.cb_user_data(); - arg->success = cpp_arg.success(); - arg->target_name = gpr_strdup(cpp_arg.target_name().c_str()); - arg->peer_cert = gpr_strdup(cpp_arg.peer_cert().c_str()); - arg->status = cpp_arg.status(); - arg->error_details = gpr_strdup(cpp_arg.error_details().c_str()); } } // namespace experimental diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 6b58e18e8da..efd87941f72 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -71,8 +71,7 @@ static void tls_credential_reload_cancel(void* config_user_data, arg->set_error_details("cancelled"); } -static void tls_server_authorization_check_callback( - grpc_tls_server_authorization_check_arg* arg) { +static void tls_server_authorization_check_callback(grpc_tls_server_authorization_check_arg* arg) { GPR_ASSERT(arg != nullptr); grpc::string cb_user_data = "cb_user_data"; arg->cb_user_data = static_cast(gpr_strdup(cb_user_data.c_str())); @@ -331,7 +330,7 @@ typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { grpc_tls_credential_reload_arg c_arg; c_arg.cb = tls_credential_reload_callback; - TlsCredentialReloadArg arg = TlsCredentialReloadArg(c_arg); + TlsCredentialReloadArg arg = TlsCredentialReloadArg(&c_arg); arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); arg.OnCredentialReloadDoneCallback(); EXPECT_EQ(arg.status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED); @@ -341,7 +340,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { TlsCredentialReloadConfig config(nullptr, &tls_credential_reload_sync, nullptr, nullptr); grpc_tls_credential_reload_arg c_arg; - TlsCredentialReloadArg arg(c_arg); + TlsCredentialReloadArg arg(&c_arg); arg.set_cb_user_data(static_cast(nullptr)); std::shared_ptr key_materials_config( new TlsKeyMaterialsConfig()); @@ -354,6 +353,9 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { arg.set_key_materials_config(key_materials_config); arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); arg.set_error_details("error_details"); + grpc_tls_key_materials_config* key_materials_config_before_schedule = c_arg.key_materials_config; + const char* error_details_before_schedule = c_arg.error_details; + int schedule_output = config.Schedule(&arg); EXPECT_EQ(schedule_output, 0); EXPECT_EQ(arg.cb_user_data(), nullptr); @@ -369,6 +371,11 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { EXPECT_STREQ(pair_list[2].cert_chain.c_str(), "cert_chain3"); EXPECT_EQ(arg.status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); EXPECT_STREQ(arg.error_details().c_str(), "error_details"); + + // Cleanup. + gpr_free(const_cast(error_details_before_schedule)); + ::grpc_core::Delete(key_materials_config_before_schedule); + ::grpc_core::Delete(c_arg.key_materials_config); } TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { @@ -415,17 +422,15 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { EXPECT_STREQ(pair_list[1].cert_chain(), "cert_chain3"); EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); EXPECT_STREQ(c_arg.error_details, test_error_details.c_str()); - const char* error_details_after_schedule = c_arg.error_details; + grpc_tls_key_materials_config* key_materials_config_after_schedule = c_arg.key_materials_config; c_config->Cancel(&c_arg); EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); EXPECT_STREQ(c_arg.error_details, "cancelled"); - // Must free the fields of the C arg afterwards, regardless - // of whether or not they were changed. + // Cleanup. + ::grpc_core::Delete(key_materials_config_after_schedule); gpr_free(const_cast(c_arg.error_details)); - gpr_free(const_cast(error_details_after_schedule)); - gpr_free(c_config); } typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckArg @@ -436,13 +441,17 @@ typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckConfig TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { grpc_tls_server_authorization_check_arg c_arg; c_arg.cb = tls_server_authorization_check_callback; - TlsServerAuthorizationCheckArg arg(c_arg); + TlsServerAuthorizationCheckArg arg(&c_arg); arg.set_cb_user_data(nullptr); arg.set_success(0); arg.set_target_name("target_name"); arg.set_peer_cert("peer_cert"); arg.set_status(GRPC_STATUS_UNAUTHENTICATED); arg.set_error_details("error_details"); + const char* target_name_before_callback = c_arg.target_name; + const char* peer_cert_before_callback = c_arg.peer_cert; + const char* error_details_before_callback = c_arg.error_details; + arg.OnServerAuthorizationCheckDoneCallback(); EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); gpr_free(arg.cb_user_data()); @@ -451,28 +460,49 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { EXPECT_STREQ(arg.peer_cert().c_str(), "callback_peer_cert"); EXPECT_EQ(arg.status(), GRPC_STATUS_OK); EXPECT_STREQ(arg.error_details().c_str(), "callback_error_details"); + + // Cleanup. + gpr_free(const_cast(target_name_before_callback)); + gpr_free(const_cast(peer_cert_before_callback)); + gpr_free(const_cast(error_details_before_callback)); + gpr_free(const_cast(c_arg.target_name)); + gpr_free(const_cast(c_arg.peer_cert)); + gpr_free(const_cast(c_arg.error_details)); } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { TlsServerAuthorizationCheckConfig config = TlsServerAuthorizationCheckConfig( nullptr, &tls_server_authorization_check_sync, nullptr, nullptr); grpc_tls_server_authorization_check_arg c_arg; - TlsServerAuthorizationCheckArg arg(c_arg); + TlsServerAuthorizationCheckArg arg(&c_arg); arg.set_cb_user_data(nullptr); arg.set_success(0); arg.set_target_name("target_name"); arg.set_peer_cert("peer_cert"); arg.set_status(GRPC_STATUS_PERMISSION_DENIED); arg.set_error_details("error_details"); + const char* target_name_before_schedule = c_arg.target_name; + const char* peer_cert_before_schedule = c_arg.peer_cert; + const char* error_details_before_schedule = c_arg.error_details; + int schedule_output = config.Schedule(&arg); EXPECT_EQ(schedule_output, 1); EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); - gpr_free(arg.cb_user_data()); EXPECT_EQ(arg.success(), 1); EXPECT_STREQ(arg.target_name().c_str(), "sync_target_name"); EXPECT_STREQ(arg.peer_cert().c_str(), "sync_peer_cert"); EXPECT_EQ(arg.status(), GRPC_STATUS_OK); EXPECT_STREQ(arg.error_details().c_str(), "sync_error_details"); + + // Cleanup. + gpr_free(arg.cb_user_data()); + gpr_free(const_cast(target_name_before_schedule)); + gpr_free(const_cast(peer_cert_before_schedule)); + gpr_free(const_cast(error_details_before_schedule)); + gpr_free(const_cast(c_arg.target_name)); + gpr_free(const_cast(c_arg.peer_cert)); + gpr_free(const_cast(c_arg.error_details)); + } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { @@ -487,13 +517,10 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { c_arg.peer_cert = "peer_cert"; c_arg.status = GRPC_STATUS_UNAUTHENTICATED; c_arg.error_details = "error_details"; - - grpc_tls_server_authorization_check_config* c_config = config.c_config(); - c_arg.config = c_config; - int c_schedule_output = c_config->Schedule(&c_arg); + c_arg.config = config.c_config(); + int c_schedule_output = (c_arg.config)->Schedule(&c_arg); EXPECT_EQ(c_schedule_output, 1); EXPECT_STREQ(static_cast(c_arg.cb_user_data), "cb_user_data"); - gpr_free(c_arg.cb_user_data); EXPECT_EQ(c_arg.success, 1); EXPECT_STREQ(c_arg.target_name, "sync_target_name"); EXPECT_STREQ(c_arg.peer_cert, "sync_peer_cert"); @@ -504,14 +531,12 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { const char* peer_cert_after_schedule = c_arg.peer_cert; const char* error_details_after_schedule = c_arg.error_details; - c_config->Cancel(&c_arg); + (c_arg.config)->Cancel(&c_arg); EXPECT_EQ(c_arg.status, GRPC_STATUS_PERMISSION_DENIED); EXPECT_STREQ(c_arg.error_details, "cancelled"); - // Must free the fields of the C arg afterwards, regardless - // of whether or not they were changed. - gpr_free(const_cast(c_arg.target_name)); - gpr_free(const_cast(c_arg.peer_cert)); + // Cleanup. + gpr_free(c_arg.cb_user_data); gpr_free(const_cast(c_arg.error_details)); gpr_free(const_cast(target_name_after_schedule)); gpr_free(const_cast(peer_cert_after_schedule)); @@ -522,31 +547,26 @@ typedef class ::grpc_impl::experimental::TlsCredentialsOptions TlsCredentialsOptions; TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { - TlsCredentialsOptions options; - options.set_cert_request_type(GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY); std::shared_ptr key_materials_config( new TlsKeyMaterialsConfig()); struct TlsKeyMaterialsConfig::PemKeyCertPair pair = {"private_key", "cert_chain"}; std::vector pair_list = {pair}; key_materials_config->set_key_materials("pem_root_certs", pair_list); - options.set_key_materials_config(key_materials_config); - std::shared_ptr credential_reload_config( new TlsCredentialReloadConfig(nullptr, &tls_credential_reload_sync, &tls_credential_reload_cancel, nullptr)); - options.set_credential_reload_config(credential_reload_config); std::shared_ptr server_authorization_check_config(new TlsServerAuthorizationCheckConfig( nullptr, &tls_server_authorization_check_sync, &tls_server_authorization_check_cancel, nullptr)); - options.set_server_authorization_check_config( - server_authorization_check_config); - + TlsCredentialsOptions options = TlsCredentialsOptions(GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, + key_materials_config, + credential_reload_config, + server_authorization_check_config); grpc_tls_credentials_options* c_options = options.c_credentials_options(); - EXPECT_EQ(c_options->cert_request_type(), - GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY); + EXPECT_EQ(c_options->cert_request_type(), GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY); grpc_tls_key_materials_config* c_key_materials_config = c_options->key_materials_config(); grpc_tls_credential_reload_config* c_credential_reload_config = @@ -554,7 +574,7 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { grpc_tls_credential_reload_arg c_credential_reload_arg; c_credential_reload_arg.config = c_credential_reload_config; c_credential_reload_arg.cb_user_data = nullptr; - c_credential_reload_arg.key_materials_config = c_key_materials_config; + c_credential_reload_arg.key_materials_config = c_options->key_materials_config(); c_credential_reload_arg.status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; grpc::string test_error_details = "error_details"; c_credential_reload_arg.error_details = test_error_details.c_str(); @@ -598,7 +618,6 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); EXPECT_STREQ(c_credential_reload_arg.error_details, test_error_details.c_str()); - gpr_free(const_cast(c_credential_reload_arg.error_details)); int c_server_authorization_check_schedule_output = c_server_authorization_check_config->Schedule( @@ -607,7 +626,6 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { EXPECT_STREQ( static_cast(c_server_authorization_check_arg.cb_user_data), "cb_user_data"); - gpr_free(c_server_authorization_check_arg.cb_user_data); EXPECT_EQ(c_server_authorization_check_arg.success, 1); EXPECT_STREQ(c_server_authorization_check_arg.target_name, "sync_target_name"); @@ -615,11 +633,14 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { EXPECT_EQ(c_server_authorization_check_arg.status, GRPC_STATUS_OK); EXPECT_STREQ(c_server_authorization_check_arg.error_details, "sync_error_details"); + + // Cleanup. + ::grpc_core::Delete(c_key_materials_config); + ::grpc_core::Delete(c_credential_reload_arg.key_materials_config); + gpr_free(c_server_authorization_check_arg.cb_user_data); gpr_free(const_cast(c_server_authorization_check_arg.target_name)); gpr_free(const_cast(c_server_authorization_check_arg.peer_cert)); gpr_free(const_cast(c_server_authorization_check_arg.error_details)); - - gpr_free(c_options); } } // namespace testing From 9457917ed141959c85788e52a1e361937bd18bd5 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 27 Aug 2019 15:19:43 -0700 Subject: [PATCH 44/70] Autogenerated files and clang format/tidy code --- .../grpcpp/security/tls_credentials_options.h | 15 +++--- src/cpp/common/tls_credentials_options.cc | 52 +++++++++++-------- .../common/tls_credentials_options_util.cc | 12 ++--- src/cpp/common/tls_credentials_options_util.h | 6 +-- test/cpp/client/credentials_test.cc | 23 ++++---- 5 files changed, 61 insertions(+), 47 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index f5c0545ea0c..52b354b1033 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -59,7 +59,7 @@ class TlsKeyMaterialsConfig { /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ class TlsCredentialReloadArg { public: - TlsCredentialReloadArg(grpc_tls_credential_reload_arg* arg) : c_arg_(arg) { } + TlsCredentialReloadArg(grpc_tls_credential_reload_arg* arg) : c_arg_(arg) {} ~TlsCredentialReloadArg(); /** Getters for member fields. The callback function is not exposed. @@ -129,7 +129,8 @@ class TlsCredentialReloadConfig { class TlsServerAuthorizationCheckArg { public: - TlsServerAuthorizationCheckArg(grpc_tls_server_authorization_check_arg* arg) : c_arg_(arg) { } + TlsServerAuthorizationCheckArg(grpc_tls_server_authorization_check_arg* arg) + : c_arg_(arg) {} ~TlsServerAuthorizationCheckArg(); /** Getters for member fields. They return the corresponding fields of the @@ -202,10 +203,12 @@ class TlsServerAuthorizationCheckConfig { /** TLS credentials options, wrapper for grpc_tls_credentials_options. **/ class TlsCredentialsOptions { public: - TlsCredentialsOptions(grpc_ssl_client_certificate_request_type cert_request_type, - std::shared_ptr key_materials_config, - std::shared_ptr credential_reload_config, - std::shared_ptr server_authorization_check_config); + TlsCredentialsOptions( + grpc_ssl_client_certificate_request_type cert_request_type, + std::shared_ptr key_materials_config, + std::shared_ptr credential_reload_config, + std::shared_ptr + server_authorization_check_config); ~TlsCredentialsOptions(); /** Getters for member fields. **/ diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index eb9f8e6fe98..21e3ce3548d 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -33,7 +33,7 @@ void TlsKeyMaterialsConfig::set_key_materials( } /** TLS credential reload arg API implementation **/ -TlsCredentialReloadArg::~TlsCredentialReloadArg() { } +TlsCredentialReloadArg::~TlsCredentialReloadArg() {} void* TlsCredentialReloadArg::cb_user_data() const { return c_arg_->cb_user_data; @@ -86,10 +86,11 @@ TlsCredentialReloadConfig::TlsCredentialReloadConfig( const void* config_user_data, int (*schedule)(void* config_user_data, TlsCredentialReloadArg* arg), void (*cancel)(void* config_user_data, TlsCredentialReloadArg* arg), - void (*destruct)(void* config_user_data)) : config_user_data_(const_cast(config_user_data)), - schedule_(schedule), - cancel_(cancel), - destruct_(destruct) { + void (*destruct)(void* config_user_data)) + : config_user_data_(const_cast(config_user_data)), + schedule_(schedule), + cancel_(cancel), + destruct_(destruct) { c_config_ = grpc_tls_credential_reload_config_create( config_user_data_, &TlsCredentialReloadConfigCSchedule, &TlsCredentialReloadConfigCCancel, destruct_); @@ -101,8 +102,7 @@ TlsCredentialReloadConfig::~TlsCredentialReloadConfig() { } /** gRPC TLS server authorization check arg API implementation **/ -TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() { -} +TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() {} void* TlsServerAuthorizationCheckArg::cb_user_data() const { return c_arg_->cb_user_data; @@ -166,10 +166,11 @@ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( int (*schedule)(void* config_user_data, TlsServerAuthorizationCheckArg* arg), void (*cancel)(void* config_user_data, TlsServerAuthorizationCheckArg* arg), - void (*destruct)(void* config_user_data)) : config_user_data_(const_cast(config_user_data)), - schedule_(schedule), - cancel_(cancel), - destruct_(destruct) { + void (*destruct)(void* config_user_data)) + : config_user_data_(const_cast(config_user_data)), + schedule_(schedule), + cancel_(cancel), + destruct_(destruct) { c_config_ = grpc_tls_server_authorization_check_config_create( config_user_data_, &TlsServerAuthorizationCheckConfigCSchedule, &TlsServerAuthorizationCheckConfigCCancel, destruct_); @@ -181,18 +182,25 @@ TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() { } /** gRPC TLS credential options API implementation **/ -TlsCredentialsOptions::TlsCredentialsOptions(grpc_ssl_client_certificate_request_type cert_request_type, - std::shared_ptr key_materials_config, - std::shared_ptr credential_reload_config, - std::shared_ptr server_authorization_check_config) : - cert_request_type_(cert_request_type), - key_materials_config_(key_materials_config), - credential_reload_config_(credential_reload_config), - server_authorization_check_config_(server_authorization_check_config) { +TlsCredentialsOptions::TlsCredentialsOptions( + grpc_ssl_client_certificate_request_type cert_request_type, + std::shared_ptr key_materials_config, + std::shared_ptr credential_reload_config, + std::shared_ptr + server_authorization_check_config) + : cert_request_type_(cert_request_type), + key_materials_config_(std::move(key_materials_config)), + credential_reload_config_(std::move(credential_reload_config)), + server_authorization_check_config_( + std::move(server_authorization_check_config)) { c_credentials_options_ = grpc_tls_credentials_options_create(); - grpc_tls_credentials_options_set_cert_request_type(c_credentials_options_, cert_request_type_); - grpc_tls_credentials_options_set_key_materials_config(c_credentials_options_, ConvertToCKeyMaterialsConfig(key_materials_config_)); - grpc_tls_credentials_options_set_credential_reload_config(c_credentials_options_, credential_reload_config_->c_config()); + grpc_tls_credentials_options_set_cert_request_type(c_credentials_options_, + cert_request_type_); + grpc_tls_credentials_options_set_key_materials_config( + c_credentials_options_, + ConvertToCKeyMaterialsConfig(key_materials_config_)); + grpc_tls_credentials_options_set_credential_reload_config( + c_credentials_options_, credential_reload_config_->c_config()); grpc_tls_credentials_options_set_server_authorization_check_config( c_credentials_options_, server_authorization_check_config_->c_config()); } diff --git a/src/cpp/common/tls_credentials_options_util.cc b/src/cpp/common/tls_credentials_options_util.cc index bb4538973ec..8879b44eaae 100644 --- a/src/cpp/common/tls_credentials_options_util.cc +++ b/src/cpp/common/tls_credentials_options_util.cc @@ -64,8 +64,8 @@ std::shared_ptr ConvertToCppKeyMaterialsConfig( config->pem_key_cert_pair_list(); for (size_t i = 0; i < pem_key_cert_pair_list.size(); i++) { ::grpc_core::PemKeyCertPair key_cert_pair = pem_key_cert_pair_list[i]; - TlsKeyMaterialsConfig::PemKeyCertPair p = { - key_cert_pair.private_key(), key_cert_pair.cert_chain()}; + TlsKeyMaterialsConfig::PemKeyCertPair p = {key_cert_pair.private_key(), + key_cert_pair.cert_chain()}; cpp_pem_key_cert_pair_list.push_back(::std::move(p)); } cpp_config->set_key_materials(std::move(config->pem_root_certs()), @@ -77,16 +77,16 @@ std::shared_ptr ConvertToCppKeyMaterialsConfig( /** The C schedule and cancel functions for the credential reload config. * They populate a C credential reload arg with the result of a C++ credential * reload schedule/cancel API. **/ -int TlsCredentialReloadConfigCSchedule( - void* config_user_data, grpc_tls_credential_reload_arg* arg) { +int TlsCredentialReloadConfigCSchedule(void* config_user_data, + grpc_tls_credential_reload_arg* arg) { TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); TlsCredentialReloadArg cpp_arg(arg); return cpp_config->Schedule(&cpp_arg); } -void TlsCredentialReloadConfigCCancel( - void* config_user_data, grpc_tls_credential_reload_arg* arg) { +void TlsCredentialReloadConfigCCancel(void* config_user_data, + grpc_tls_credential_reload_arg* arg) { TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); TlsCredentialReloadArg cpp_arg(arg); diff --git a/src/cpp/common/tls_credentials_options_util.h b/src/cpp/common/tls_credentials_options_util.h index 6ce34be7ed8..9d5b048ede4 100644 --- a/src/cpp/common/tls_credentials_options_util.h +++ b/src/cpp/common/tls_credentials_options_util.h @@ -36,11 +36,11 @@ std::shared_ptr ConvertToCppKeyMaterialsConfig( /** The following 4 functions convert the user-provided schedule or cancel * functions into C style schedule or cancel functions. **/ -int TlsCredentialReloadConfigCSchedule( - void* config_user_data, grpc_tls_credential_reload_arg* arg); +int TlsCredentialReloadConfigCSchedule(void* config_user_data, + grpc_tls_credential_reload_arg* arg); void TlsCredentialReloadConfigCCancel(void* config_user_data, - grpc_tls_credential_reload_arg* arg); + grpc_tls_credential_reload_arg* arg); int TlsServerAuthorizationCheckConfigCSchedule( void* config_user_data, grpc_tls_server_authorization_check_arg* arg); diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index efd87941f72..adc2865f226 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -71,7 +71,8 @@ static void tls_credential_reload_cancel(void* config_user_data, arg->set_error_details("cancelled"); } -static void tls_server_authorization_check_callback(grpc_tls_server_authorization_check_arg* arg) { +static void tls_server_authorization_check_callback( + grpc_tls_server_authorization_check_arg* arg) { GPR_ASSERT(arg != nullptr); grpc::string cb_user_data = "cb_user_data"; arg->cb_user_data = static_cast(gpr_strdup(cb_user_data.c_str())); @@ -353,7 +354,8 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { arg.set_key_materials_config(key_materials_config); arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); arg.set_error_details("error_details"); - grpc_tls_key_materials_config* key_materials_config_before_schedule = c_arg.key_materials_config; + grpc_tls_key_materials_config* key_materials_config_before_schedule = + c_arg.key_materials_config; const char* error_details_before_schedule = c_arg.error_details; int schedule_output = config.Schedule(&arg); @@ -422,7 +424,8 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { EXPECT_STREQ(pair_list[1].cert_chain(), "cert_chain3"); EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); EXPECT_STREQ(c_arg.error_details, test_error_details.c_str()); - grpc_tls_key_materials_config* key_materials_config_after_schedule = c_arg.key_materials_config; + grpc_tls_key_materials_config* key_materials_config_after_schedule = + c_arg.key_materials_config; c_config->Cancel(&c_arg); EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); @@ -502,7 +505,6 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { gpr_free(const_cast(c_arg.target_name)); gpr_free(const_cast(c_arg.peer_cert)); gpr_free(const_cast(c_arg.error_details)); - } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { @@ -561,12 +563,12 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { server_authorization_check_config(new TlsServerAuthorizationCheckConfig( nullptr, &tls_server_authorization_check_sync, &tls_server_authorization_check_cancel, nullptr)); - TlsCredentialsOptions options = TlsCredentialsOptions(GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, - key_materials_config, - credential_reload_config, - server_authorization_check_config); + TlsCredentialsOptions options = TlsCredentialsOptions( + GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, key_materials_config, + credential_reload_config, server_authorization_check_config); grpc_tls_credentials_options* c_options = options.c_credentials_options(); - EXPECT_EQ(c_options->cert_request_type(), GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY); + EXPECT_EQ(c_options->cert_request_type(), + GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY); grpc_tls_key_materials_config* c_key_materials_config = c_options->key_materials_config(); grpc_tls_credential_reload_config* c_credential_reload_config = @@ -574,7 +576,8 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { grpc_tls_credential_reload_arg c_credential_reload_arg; c_credential_reload_arg.config = c_credential_reload_config; c_credential_reload_arg.cb_user_data = nullptr; - c_credential_reload_arg.key_materials_config = c_options->key_materials_config(); + c_credential_reload_arg.key_materials_config = + c_options->key_materials_config(); c_credential_reload_arg.status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; grpc::string test_error_details = "error_details"; c_credential_reload_arg.error_details = test_error_details.c_str(); From 99058a2f093bef5dcacebaa4e8beacf1d692f8e6 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Fri, 30 Aug 2019 08:57:55 -0700 Subject: [PATCH 45/70] Implemented Yihua's proposed changes from Aug 29 --- include/grpcpp/security/tls_credentials_options.h | 14 ++++++++++++++ .../credentials/tls/grpc_tls_credentials_options.h | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 52b354b1033..8e8b883b8eb 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -59,6 +59,9 @@ class TlsKeyMaterialsConfig { /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ class TlsCredentialReloadArg { public: + /** TlsCredentialReloadArg does not take ownership of the C arg that is passed + * to the constructor. One must remember to free any memory allocated to the C + * arg after using the setter functions below. **/ TlsCredentialReloadArg(grpc_tls_credential_reload_arg* arg) : c_arg_(arg) {} ~TlsCredentialReloadArg(); @@ -72,6 +75,10 @@ class TlsCredentialReloadArg { grpc::string error_details() const; /** Setters for member fields. They modify the fields of the underlying C arg. + * The setters for the key_materials_config and the error_details allocate + * memory when modifying c_arg_, so one must remember to free c_arg_'s + * original key_materials_config or error_details after using the appropriate + * setter function. * **/ void set_cb_user_data(void* cb_user_data); void set_key_materials_config( @@ -129,6 +136,9 @@ class TlsCredentialReloadConfig { class TlsServerAuthorizationCheckArg { public: + /** TlsServerAuthorizationCheckArg does not take ownership of the C arg passed + * to the constructor. One must remember to free any memory allocated to the + * C arg after using the setter functions below. **/ TlsServerAuthorizationCheckArg(grpc_tls_server_authorization_check_arg* arg) : c_arg_(arg) {} ~TlsServerAuthorizationCheckArg(); @@ -143,6 +153,10 @@ class TlsServerAuthorizationCheckArg { grpc::string error_details() const; /** Setters for member fields. They modify the fields of the underlying C arg. + * The setters for target_name, peer_cert, and error_details allocate memory + * when modifying c_arg_, so one must remember to free c_arg_'s original + * target_name, peer_cert, or error_details after using the appropriate setter + * function. * **/ void set_cb_user_data(void* cb_user_data); void set_success(int success); diff --git a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h index e6399ba6ecd..78f32ab2479 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +++ b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h @@ -80,6 +80,10 @@ struct grpc_tls_credential_reload_config } private: + /** This is a pointer to the wrapped language implementation of + * grpc_tls_credential_reload_config. It is necessary to implement the C + * schedule and cancel functions, given the schedule or cancel function in a + * wrapped language. **/ void* context_; /** config-specific, read-only user data that works for all channels created with a credential using the config. */ @@ -132,6 +136,10 @@ struct grpc_tls_server_authorization_check_config } private: + /** This is a pointer to the wrapped language implementation of + * grpc_tls_server_authorization_check_config. It is necessary to implement + * the C schedule and cancel functions, given the schedule or cancel function + * in a wrapped language. **/ void* context_; /** config-specific, read-only user data that works for all channels created with a Credential using the config. */ From 82cbe2253298f7f82bc8f68d06bdbfd622e5845d Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 3 Sep 2019 09:06:23 -0700 Subject: [PATCH 46/70] Added comments in tls_credentials_options.h, per Yihua's comment. --- .../grpcpp/security/tls_credentials_options.h | 49 ++++++++++++++++--- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 8e8b883b8eb..2bdfe411289 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -29,7 +29,8 @@ namespace grpc_impl { namespace experimental { -/** TLS key materials config, wrapper for grpc_tls_key_materials_config. **/ +/** TLS key materials config, wrapper for grpc_tls_key_materials_config. It is + * used for experimental purposes for now and subject to change. **/ class TlsKeyMaterialsConfig { public: struct PemKeyCertPair { @@ -56,7 +57,14 @@ class TlsKeyMaterialsConfig { grpc::string pem_root_certs_; }; -/** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/ +/** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. It is + * used for experimental purposes for now and it is subject to change. + * + * The credential reload arg contains all the info necessary to schedule/cancel + * a credential reload request. The callback function must be called after + * finishing the schedule operation. See the description of the + * grpc_tls_credential_reload_arg struct in grpc_security.h for more details. + * **/ class TlsCredentialReloadArg { public: /** TlsCredentialReloadArg does not take ownership of the C arg that is passed @@ -93,7 +101,15 @@ class TlsCredentialReloadArg { grpc_tls_credential_reload_arg* c_arg_; }; -/** TLS credential reloag config, wraps grpc_tls_credential_reload_config. **/ +/** TLS credential reloag config, wraps grpc_tls_credential_reload_config. It is + * used for experimental purposes for now and it is subject to change. + * + * The config_user_data is read-only user data; schedule is a pointer to an + * application-provided callback that invokes the credential reload; cancel is a + * pointer to an application-provided callback that cancels a credential reload + * request; destruct is a pointer to an application-provided callback that + * cleans up any data associated to the config. See the description of the + * grpc_tls_credential_reload_config struct in grpc_security.h. **/ class TlsCredentialReloadConfig { public: TlsCredentialReloadConfig(const void* config_user_data, @@ -132,8 +148,14 @@ class TlsCredentialReloadConfig { }; /** TLS server authorization check arguments, wraps - * grpc_tls_server_authorization_check_arg. **/ - + * grpc_tls_server_authorization_check_arg. It is used for experimental + * purposes for now and it is subject to change. + * + * The server authorization check arg contains all the info necessary to + * schedule/cancel a server authorization check request. The callback function + * must be called after finishing the schedule operation. See the description + * of the grpc_tls_server_authorization_check_arg struct in grpc_security.h for + * more details. **/ class TlsServerAuthorizationCheckArg { public: /** TlsServerAuthorizationCheckArg does not take ownership of the C arg passed @@ -173,7 +195,17 @@ class TlsServerAuthorizationCheckArg { }; /** TLS server authorization check config, wraps - * grps_tls_server_authorization_check_config. **/ + * grps_tls_server_authorization_check_config. It is used for experimental + * purposes for now and it is subject to change. + * + * The config_user_data is read-only user data; schedule is a pointer to an + * application-provided callback that invokes the server authorization check; + * cancel is a pointer to an application-provided callback that cancels a + * server authorization check request; destruct is a pointer to an + * application-provided callback that cleans up any data associated to the + * config. See the description of the + * grpc_tls_server_authorization_check_config struct in grpc_security.h for + * more details. **/ class TlsServerAuthorizationCheckConfig { public: TlsServerAuthorizationCheckConfig( @@ -214,7 +246,10 @@ class TlsServerAuthorizationCheckConfig { void (*destruct_)(void* config_user_data); }; -/** TLS credentials options, wrapper for grpc_tls_credentials_options. **/ +/** TLS credentials options, wrapper for grpc_tls_credentials_options. It is + * used for experimental purposes for now and it is subject to change. See the + * description of the grpc_tls_credentials_options struct in grpc_security.h for + * more details. **/ class TlsCredentialsOptions { public: TlsCredentialsOptions( From ff9697acd756cfa3b75bb127d5566fcfe077cde1 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 3 Sep 2019 10:50:37 -0700 Subject: [PATCH 47/70] Changed SPIFFE credentials naming to TLS credentials, per Jiangtao's comments. --- include/grpcpp/security/credentials.h | 4 ++-- include/grpcpp/security/credentials_impl.h | 4 ++-- include/grpcpp/security/server_credentials.h | 6 +++--- include/grpcpp/security/server_credentials_impl.h | 4 ++-- src/cpp/client/secure_credentials.cc | 4 ++-- src/cpp/server/secure_server_credentials.cc | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/grpcpp/security/credentials.h b/include/grpcpp/security/credentials.h index bf28b75ce1d..0449017e77b 100644 --- a/include/grpcpp/security/credentials.h +++ b/include/grpcpp/security/credentials.h @@ -132,9 +132,9 @@ static inline std::shared_ptr LocalCredentials( return ::grpc_impl::experimental::LocalCredentials(type); } -static inline std::shared_ptr SpiffeCredentials( +static inline std::shared_ptr TlsCredentials( const ::grpc_impl::experimental::TlsCredentialsOptions& options) { - return ::grpc_impl::experimental::SpiffeCredentials(options); + return ::grpc_impl::experimental::TlsCredentials(options); } } // namespace experimental diff --git a/include/grpcpp/security/credentials_impl.h b/include/grpcpp/security/credentials_impl.h index 399c43b69ff..3e375d3c239 100644 --- a/include/grpcpp/security/credentials_impl.h +++ b/include/grpcpp/security/credentials_impl.h @@ -337,8 +337,8 @@ std::shared_ptr AltsCredentials( std::shared_ptr LocalCredentials( grpc_local_connect_type type); -/// Builds SPIFFE Credentials given TLS options. -std::shared_ptr SpiffeCredentials( +/// Builds TLS Credentials given TLS options. +std::shared_ptr TlsCredentials( const TlsCredentialsOptions& options); } // namespace experimental diff --git a/include/grpcpp/security/server_credentials.h b/include/grpcpp/security/server_credentials.h index 77edc83e0b7..f41c05d59f2 100644 --- a/include/grpcpp/security/server_credentials.h +++ b/include/grpcpp/security/server_credentials.h @@ -79,10 +79,10 @@ static inline std::shared_ptr LocalServerCredentials( return ::grpc_impl::experimental::LocalServerCredentials(type); } -/// Builds SPIFFE ServerCredentials given TLS options. -static inline std::shared_ptr SpiffeServerCredentials( +/// Builds TLS ServerCredentials given TLS options. +static inline std::shared_ptr TlsServerCredentials( const ::grpc_impl::experimental::TlsCredentialsOptions& options) { - return ::grpc_impl::experimental::SpiffeServerCredentials(options); + return ::grpc_impl::experimental::TlsServerCredentials(options); } } // namespace experimental diff --git a/include/grpcpp/security/server_credentials_impl.h b/include/grpcpp/security/server_credentials_impl.h index eaf62cc88c7..efd7cf66759 100644 --- a/include/grpcpp/security/server_credentials_impl.h +++ b/include/grpcpp/security/server_credentials_impl.h @@ -80,8 +80,8 @@ std::shared_ptr AltsServerCredentials( std::shared_ptr LocalServerCredentials( grpc_local_connect_type type); -/// Builds SPIFFE ServerCredentials given TLS options. -std::shared_ptr SpiffeServerCredentials( +/// Builds TLS ServerCredentials given TLS options. +std::shared_ptr TlsServerCredentials( const TlsCredentialsOptions& options); } // namespace experimental diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index c83ec3a94b5..ccc31ed1ae4 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -280,8 +280,8 @@ std::shared_ptr LocalCredentials( return WrapChannelCredentials(grpc_local_credentials_create(type)); } -// Builds SPIFFE Credentials given TLS options. -std::shared_ptr SpiffeCredentials( +// Builds TLS Credentials given TLS options. +std::shared_ptr TlsCredentials( const TlsCredentialsOptions& options) { return WrapChannelCredentials( grpc_tls_spiffe_credentials_create(options.c_credentials_options())); diff --git a/src/cpp/server/secure_server_credentials.cc b/src/cpp/server/secure_server_credentials.cc index ddbdf9806f9..4393e0861e9 100644 --- a/src/cpp/server/secure_server_credentials.cc +++ b/src/cpp/server/secure_server_credentials.cc @@ -150,7 +150,7 @@ std::shared_ptr LocalServerCredentials( new SecureServerCredentials(grpc_local_server_credentials_create(type))); } -std::shared_ptr SpiffeServerCredentials( +std::shared_ptr TlsServerCredentials( const TlsCredentialsOptions& options) { return std::shared_ptr( new SecureServerCredentials(grpc_tls_spiffe_server_credentials_create( From 6c32b805b14b8db044b31fe8152d395927b1467a Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Thu, 5 Sep 2019 13:22:35 -0700 Subject: [PATCH 48/70] Modified comments in grpc_security.h, per Sanjay's comments. --- include/grpc/grpc_security.h | 48 ++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index d63802c9782..3918e45aa0b 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -805,14 +805,19 @@ typedef struct grpc_tls_credential_reload_arg grpc_tls_credential_reload_arg; typedef void (*grpc_tls_on_credential_reload_done_cb)( grpc_tls_credential_reload_arg* arg); -/** A struct containing all information necessary to schedule/cancel - a credential reload request. cb and cb_user_data represent a gRPC-provided - callback and an argument passed to it. key_materials is an in/output - parameter containing currently used/newly reloaded credentials. If - credential reload does not result in a new credential, key_materials should - not be modified. status and error_details are used to hold information about - errors occurred when a credential reload request is scheduled/cancelled. It - is used for experimental purpose for now and subject to change. */ +/** A struct containing all information necessary to schedule/cancel a + credential reload request. + - cb and cb_user_data represent a gRPC-provided + callback and an argument passed to it. + - key_materials_config is an in/output parameter containing currently + used/newly reloaded credentials. If credential reload does not result + in a new credential, key_materials_config should not be modified. + - status and error_details are used to hold information about + errors occurred when a credential reload request is scheduled/cancelled. + - config is a pointer to the unique grpc_tls_credential_reload_config + instance that this argument corresponds to. + It is used for experimental purposes for now and subject to change. +*/ struct grpc_tls_credential_reload_arg { grpc_tls_on_credential_reload_done_cb cb; void* cb_user_data; @@ -864,16 +869,23 @@ typedef void (*grpc_tls_on_server_authorization_check_done_cb)( grpc_tls_server_authorization_check_arg* arg); /** A struct containing all information necessary to schedule/cancel a server - authorization check request. cb and cb_user_data represent a gRPC-provided - callback and an argument passed to it. success will store the result of - server authorization check. That is, if success returns a non-zero value, it - means the authorization check passes and if returning zero, it means the - check fails. target_name is the name of an endpoint the channel is connecting - to and certificate represents a complete certificate chain including both - signing and leaf certificates. status and error_details contain information - about errors occurred when a server authorization check request is - scheduled/cancelled. It is used for experimental purpose for now and subject - to change.*/ + authorization check request. + - cb and cb_user_data represent a gRPC-provided callback and an argument + passed to it. + - success will store the result of server authorization check. That is, + if success returns a non-zero value, it means the authorization check + passes and if returning zero, it means the check fails. + - target_name is the name of an endpoint the channel is connecting to. + - peer_cert represents a complete certificate chain including both + signing and leaf certificates. + - status and error_details contain information + about errors occurred when a server authorization check request is + scheduled/cancelled. + - config is a pointer to the unique + grpc_tls_server_authorization_check_config instance that this argument + corresponds to. + It is used for experimental purpose for now and subject to change. +*/ struct grpc_tls_server_authorization_check_arg { grpc_tls_on_server_authorization_check_done_cb cb; void* cb_user_data; From 282aef60315cb89ffb9d1c866e1aa2d0564a8258 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Mon, 16 Sep 2019 13:51:31 -0700 Subject: [PATCH 49/70] Minor fixes revealed from developping the end-to-end tests. --- .../tls/grpc_tls_credentials_options.h | 22 +++++++++ src/cpp/common/tls_credentials_options.cc | 45 ++++++++++++++----- .../common/tls_credentials_options_util.cc | 28 ++++++++++++ test/cpp/client/credentials_test.cc | 11 +++-- 4 files changed, 92 insertions(+), 14 deletions(-) diff --git a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h index 78f32ab2479..e27eca82d1b 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +++ b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h @@ -69,6 +69,13 @@ struct grpc_tls_credential_reload_config void set_context(void* context) { context_ = context; } int Schedule(grpc_tls_credential_reload_arg* arg) const { + if (schedule_ == nullptr) { + gpr_log(GPR_ERROR, "schedule API is nullptr"); + return 1; + } + if (arg != nullptr && context_ != nullptr) { + arg->config = const_cast(this); + } return schedule_(config_user_data_, arg); } void Cancel(grpc_tls_credential_reload_arg* arg) const { @@ -76,6 +83,9 @@ struct grpc_tls_credential_reload_config gpr_log(GPR_ERROR, "cancel API is nullptr."); return; } + if (arg != nullptr && context_ != nullptr) { + arg->config = const_cast(this); + } cancel_(config_user_data_, arg); } @@ -125,6 +135,14 @@ struct grpc_tls_server_authorization_check_config void set_context(void* context) { context_ = context; } int Schedule(grpc_tls_server_authorization_check_arg* arg) const { + if (schedule_ == nullptr) { + gpr_log(GPR_ERROR, "schedule API is nullptr"); + return 1; + } + if (arg != nullptr && context_ != nullptr) { + arg->config = + const_cast(this); + } return schedule_(config_user_data_, arg); } void Cancel(grpc_tls_server_authorization_check_arg* arg) const { @@ -132,6 +150,10 @@ struct grpc_tls_server_authorization_check_config gpr_log(GPR_ERROR, "cancel API is nullptr."); return; } + if (arg != nullptr && context_ != nullptr) { + arg->config = + const_cast(this); + } cancel_(config_user_data_, arg); } diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 21e3ce3548d..88b78dd1a2d 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -78,6 +78,10 @@ void TlsCredentialReloadArg::set_error_details( } void TlsCredentialReloadArg::OnCredentialReloadDoneCallback() { + if (c_arg_->cb == nullptr) { + gpr_log(GPR_ERROR, "credential reload arg callback API is nullptr"); + return; + } c_arg_->cb(c_arg_); } @@ -92,13 +96,17 @@ TlsCredentialReloadConfig::TlsCredentialReloadConfig( cancel_(cancel), destruct_(destruct) { c_config_ = grpc_tls_credential_reload_config_create( - config_user_data_, &TlsCredentialReloadConfigCSchedule, - &TlsCredentialReloadConfigCCancel, destruct_); + config_user_data_, + schedule != nullptr ? &TlsCredentialReloadConfigCSchedule : nullptr, + cancel != nullptr ? &TlsCredentialReloadConfigCCancel : nullptr, + destruct_); c_config_->set_context(static_cast(this)); } TlsCredentialReloadConfig::~TlsCredentialReloadConfig() { - ::grpc_core::Delete(c_config_); + if (destruct_ != nullptr) { + destruct_(config_user_data_); + } } /** gRPC TLS server authorization check arg API implementation **/ @@ -157,6 +165,10 @@ void TlsServerAuthorizationCheckArg::set_error_details( } void TlsServerAuthorizationCheckArg::OnServerAuthorizationCheckDoneCallback() { + if (c_arg_->cb == nullptr) { + gpr_log(GPR_ERROR, "server authorizaton check arg callback API is nullptr"); + return; + } c_arg_->cb(c_arg_); } @@ -172,13 +184,18 @@ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( cancel_(cancel), destruct_(destruct) { c_config_ = grpc_tls_server_authorization_check_config_create( - config_user_data_, &TlsServerAuthorizationCheckConfigCSchedule, - &TlsServerAuthorizationCheckConfigCCancel, destruct_); + config_user_data_, + schedule != nullptr ? &TlsServerAuthorizationCheckConfigCSchedule + : nullptr, + cancel != nullptr ? &TlsServerAuthorizationCheckConfigCCancel : nullptr, + destruct_); c_config_->set_context(static_cast(this)); } TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() { - ::grpc_core::Delete(c_config_); + if (destruct_ != nullptr) { + destruct_(config_user_data_); + } } /** gRPC TLS credential options API implementation **/ @@ -199,14 +216,20 @@ TlsCredentialsOptions::TlsCredentialsOptions( grpc_tls_credentials_options_set_key_materials_config( c_credentials_options_, ConvertToCKeyMaterialsConfig(key_materials_config_)); - grpc_tls_credentials_options_set_credential_reload_config( - c_credentials_options_, credential_reload_config_->c_config()); - grpc_tls_credentials_options_set_server_authorization_check_config( - c_credentials_options_, server_authorization_check_config_->c_config()); + if (credential_reload_config_ != nullptr) { + grpc_tls_credentials_options_set_credential_reload_config( + c_credentials_options_, credential_reload_config_->c_config()); + } + if (server_authorization_check_config_ != nullptr) { + grpc_tls_credentials_options_set_server_authorization_check_config( + c_credentials_options_, server_authorization_check_config_->c_config()); + } } TlsCredentialsOptions::~TlsCredentialsOptions() { - gpr_free(c_credentials_options_); + if (c_credentials_options_ != nullptr) { + gpr_free(c_credentials_options_); + } } } // namespace experimental diff --git a/src/cpp/common/tls_credentials_options_util.cc b/src/cpp/common/tls_credentials_options_util.cc index 8879b44eaae..680aad162e4 100644 --- a/src/cpp/common/tls_credentials_options_util.cc +++ b/src/cpp/common/tls_credentials_options_util.cc @@ -29,6 +29,9 @@ namespace experimental { * Similarly, the user must free the underlying pointer to c_pem_root_certs. **/ grpc_tls_key_materials_config* ConvertToCKeyMaterialsConfig( const std::shared_ptr& config) { + if (config == nullptr) { + return nullptr; + } grpc_tls_key_materials_config* c_config = grpc_tls_key_materials_config_create(); ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> @@ -57,6 +60,9 @@ grpc_tls_key_materials_config* ConvertToCKeyMaterialsConfig( * allocates memory for the Cpp config. **/ std::shared_ptr ConvertToCppKeyMaterialsConfig( const grpc_tls_key_materials_config* config) { + if (config == nullptr) { + return nullptr; + } std::shared_ptr cpp_config( new TlsKeyMaterialsConfig()); std::vector cpp_pem_key_cert_pair_list; @@ -79,6 +85,11 @@ std::shared_ptr ConvertToCppKeyMaterialsConfig( * reload schedule/cancel API. **/ int TlsCredentialReloadConfigCSchedule(void* config_user_data, grpc_tls_credential_reload_arg* arg) { + if (arg == nullptr || arg->config == nullptr || + arg->config->context() == nullptr) { + gpr_log(GPR_ERROR, "credential reload arg was not properly initialized"); + return 1; + } TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); TlsCredentialReloadArg cpp_arg(arg); @@ -87,6 +98,11 @@ int TlsCredentialReloadConfigCSchedule(void* config_user_data, void TlsCredentialReloadConfigCCancel(void* config_user_data, grpc_tls_credential_reload_arg* arg) { + if (arg == nullptr || arg->config == nullptr || + arg->config->context() == nullptr) { + gpr_log(GPR_ERROR, "credential reload arg was not properly initialized"); + return; + } TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); TlsCredentialReloadArg cpp_arg(arg); @@ -98,6 +114,12 @@ void TlsCredentialReloadConfigCCancel(void* config_user_data, * of a C++ server authorization check schedule/cancel API. **/ int TlsServerAuthorizationCheckConfigCSchedule( void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { + if (arg == nullptr || arg->config == nullptr || + arg->config->context() == nullptr) { + gpr_log(GPR_ERROR, + "server authorization check arg was not properly initialized"); + return 1; + } TlsServerAuthorizationCheckConfig* cpp_config = static_cast(arg->config->context()); TlsServerAuthorizationCheckArg cpp_arg(arg); @@ -106,6 +128,12 @@ int TlsServerAuthorizationCheckConfigCSchedule( void TlsServerAuthorizationCheckConfigCCancel( void* config_user_data, grpc_tls_server_authorization_check_arg* arg) { + if (arg == nullptr || arg->config == nullptr || + arg->config->context() == nullptr) { + gpr_log(GPR_ERROR, + "server authorization check arg was not properly initialized"); + return; + } TlsServerAuthorizationCheckConfig* cpp_config = static_cast(arg->config->context()); TlsServerAuthorizationCheckArg cpp_arg(arg); diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index adc2865f226..b5b7f563c21 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -53,6 +53,7 @@ static int tls_credential_reload_sync(void* config_user_data, "cert_chain3"}; std::shared_ptr key_materials_config = arg->key_materials_config(); + GPR_ASSERT(key_materials_config != nullptr); std::vector pair_list = key_materials_config->pem_key_cert_pair_list(); pair_list.push_back(pair3); @@ -378,6 +379,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { gpr_free(const_cast(error_details_before_schedule)); ::grpc_core::Delete(key_materials_config_before_schedule); ::grpc_core::Delete(c_arg.key_materials_config); + ::grpc_core::Delete(config.c_config()); } TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { @@ -434,6 +436,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { // Cleanup. ::grpc_core::Delete(key_materials_config_after_schedule); gpr_free(const_cast(c_arg.error_details)); + ::grpc_core::Delete(config.c_config()); } typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckArg @@ -505,6 +508,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { gpr_free(const_cast(c_arg.target_name)); gpr_free(const_cast(c_arg.peer_cert)); gpr_free(const_cast(c_arg.error_details)); + ::grpc_core::Delete(config.c_config()); } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { @@ -543,6 +547,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { gpr_free(const_cast(target_name_after_schedule)); gpr_free(const_cast(peer_cert_after_schedule)); gpr_free(const_cast(error_details_after_schedule)); + ::grpc_core::Delete(config.c_config()); } typedef class ::grpc_impl::experimental::TlsCredentialsOptions @@ -574,7 +579,6 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { grpc_tls_credential_reload_config* c_credential_reload_config = c_options->credential_reload_config(); grpc_tls_credential_reload_arg c_credential_reload_arg; - c_credential_reload_arg.config = c_credential_reload_config; c_credential_reload_arg.cb_user_data = nullptr; c_credential_reload_arg.key_materials_config = c_options->key_materials_config(); @@ -585,7 +589,6 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { c_server_authorization_check_config = c_options->server_authorization_check_config(); grpc_tls_server_authorization_check_arg c_server_authorization_check_arg; - c_server_authorization_check_arg.config = c_server_authorization_check_config; c_server_authorization_check_arg.cb = tls_server_authorization_check_callback; c_server_authorization_check_arg.cb_user_data = nullptr; c_server_authorization_check_arg.success = 0; @@ -593,7 +596,6 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { c_server_authorization_check_arg.peer_cert = "peer_cert"; c_server_authorization_check_arg.status = GRPC_STATUS_UNAUTHENTICATED; c_server_authorization_check_arg.error_details = "error_details"; - EXPECT_STREQ(c_key_materials_config->pem_root_certs(), "pem_root_certs"); EXPECT_EQ( static_cast(c_key_materials_config->pem_key_cert_pair_list().size()), @@ -604,6 +606,7 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { EXPECT_STREQ(c_key_materials_config->pem_key_cert_pair_list()[0].cert_chain(), "cert_chain"); + GPR_ASSERT(c_credential_reload_config != nullptr); int c_credential_reload_schedule_output = c_credential_reload_config->Schedule(&c_credential_reload_arg); EXPECT_EQ(c_credential_reload_schedule_output, 0); @@ -644,6 +647,8 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { gpr_free(const_cast(c_server_authorization_check_arg.target_name)); gpr_free(const_cast(c_server_authorization_check_arg.peer_cert)); gpr_free(const_cast(c_server_authorization_check_arg.error_details)); + ::grpc_core::Delete(c_credential_reload_config); + ::grpc_core::Delete(c_server_authorization_check_config); } } // namespace testing From 63bc2fb5aa7d611c11dec7229d80bf2295ef18c8 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 17 Sep 2019 09:14:38 -0700 Subject: [PATCH 50/70] Initialized context_ to nullptr in C core. --- .../security/credentials/tls/grpc_tls_credentials_options.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h index e27eca82d1b..d2b2a80ec1d 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +++ b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h @@ -94,7 +94,7 @@ struct grpc_tls_credential_reload_config * grpc_tls_credential_reload_config. It is necessary to implement the C * schedule and cancel functions, given the schedule or cancel function in a * wrapped language. **/ - void* context_; + void* context_ = nullptr; /** config-specific, read-only user data that works for all channels created with a credential using the config. */ void* config_user_data_; @@ -162,7 +162,7 @@ struct grpc_tls_server_authorization_check_config * grpc_tls_server_authorization_check_config. It is necessary to implement * the C schedule and cancel functions, given the schedule or cancel function * in a wrapped language. **/ - void* context_; + void* context_ = nullptr; /** config-specific, read-only user data that works for all channels created with a Credential using the config. */ void* config_user_data_; From 456e81d2eeac6a5b40e7131dcf20cd956d29ef16 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 18 Sep 2019 08:52:11 -0700 Subject: [PATCH 51/70] Small change to grpc++_base_unsecure library. --- BUILD | 2 +- CMakeLists.txt | 1 - Makefile | 1 - build.yaml | 2 -- 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/BUILD b/BUILD index 1412b4ab0f4..eb00c40038a 100644 --- a/BUILD +++ b/BUILD @@ -1971,7 +1971,7 @@ grpc_cc_library( srcs = GRPCXX_SRCS, hdrs = GRPCXX_HDRS, language = "c++", - public_hdrs = GRPCXX_PUBLIC_HDRS + GRPC_SECURE_PUBLIC_HDRS, + public_hdrs = GRPCXX_PUBLIC_HDRS, deps = [ "grpc++_codegen_base", "grpc_health_upb", diff --git a/CMakeLists.txt b/CMakeLists.txt index 080eeb929ab..ddeca03f468 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4338,7 +4338,6 @@ target_link_libraries(grpc++_unsecure ) foreach(_hdr - include/grpc/grpc_security.h include/grpc++/alarm.h include/grpc++/channel.h include/grpc++/client_context.h diff --git a/Makefile b/Makefile index 9b380df9a7a..dc9bb0efd4a 100644 --- a/Makefile +++ b/Makefile @@ -6729,7 +6729,6 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/codegen/codegen_init.cc \ PUBLIC_HEADERS_CXX += \ - include/grpc/grpc_security.h \ include/grpc++/alarm.h \ include/grpc++/channel.h \ include/grpc++/client_context.h \ diff --git a/build.yaml b/build.yaml index 6e5cabe3242..adcec3728d5 100644 --- a/build.yaml +++ b/build.yaml @@ -321,8 +321,6 @@ filegroups: - grpc++_common - grpc++_codegen_base - name: grpc++_base_unsecure - public_headers: - - include/grpc/grpc_security.h deps: - grpc_unsecure uses: From f25e9b881fbfa9e71ad5ba1e43607d63f511750a Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 18 Sep 2019 09:25:45 -0700 Subject: [PATCH 52/70] Another small build file change. --- BUILD | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/BUILD b/BUILD index 6e686f6d7bc..8b3ed2b31fe 100644 --- a/BUILD +++ b/BUILD @@ -263,7 +263,6 @@ GRPCXX_PUBLIC_HDRS = [ "include/grpcpp/security/credentials_impl.h", "include/grpcpp/security/server_credentials.h", "include/grpcpp/security/server_credentials_impl.h", - "include/grpcpp/security/tls_credentials_options.h", "include/grpcpp/server.h", "include/grpcpp/server_impl.h", "include/grpcpp/server_builder.h", @@ -301,6 +300,10 @@ GRPCXX_PUBLIC_HDRS = [ "include/grpcpp/support/validate_service_config.h", ] +GRPCXX_SECURE_PUBLIC_HDRS = [ + "include/grpcpp/security/tls_credentials_options.h", +] + grpc_cc_library( name = "gpr", language = "c++", @@ -373,7 +376,7 @@ grpc_cc_library( "src/cpp/server/secure_server_credentials.h", ], language = "c++", - public_hdrs = GRPCXX_PUBLIC_HDRS, + public_hdrs = GRPCXX_PUBLIC_HDRS + GRPCXX_SECURE_PUBLIC_HDRS, standalone = True, deps = [ "gpr", From 43f905856551f9db0afdb12c33b557e74c00f976 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 18 Sep 2019 11:26:50 -0700 Subject: [PATCH 53/70] Changed include orders to remove dependency of grpc++_base_unsecure library on grpc_security.h. --- BUILD | 8 +++----- include/grpcpp/security/tls_credentials_options.h | 12 +++++++++++- src/cpp/common/tls_credentials_options.cc | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/BUILD b/BUILD index 8b3ed2b31fe..3991fb550dc 100644 --- a/BUILD +++ b/BUILD @@ -263,6 +263,7 @@ GRPCXX_PUBLIC_HDRS = [ "include/grpcpp/security/credentials_impl.h", "include/grpcpp/security/server_credentials.h", "include/grpcpp/security/server_credentials_impl.h", + "include/grpcpp/security/tls_credentials_options.h", "include/grpcpp/server.h", "include/grpcpp/server_impl.h", "include/grpcpp/server_builder.h", @@ -300,10 +301,6 @@ GRPCXX_PUBLIC_HDRS = [ "include/grpcpp/support/validate_service_config.h", ] -GRPCXX_SECURE_PUBLIC_HDRS = [ - "include/grpcpp/security/tls_credentials_options.h", -] - grpc_cc_library( name = "gpr", language = "c++", @@ -376,11 +373,12 @@ grpc_cc_library( "src/cpp/server/secure_server_credentials.h", ], language = "c++", - public_hdrs = GRPCXX_PUBLIC_HDRS + GRPCXX_SECURE_PUBLIC_HDRS, + public_hdrs = GRPCXX_PUBLIC_HDRS, standalone = True, deps = [ "gpr", "grpc", + "grpc_secure", "grpc++_base", "grpc++_codegen_base", "grpc++_codegen_base_src", diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 2bdfe411289..8908c96f463 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -22,7 +22,7 @@ #include #include -#include +//#include #include #include @@ -57,6 +57,8 @@ class TlsKeyMaterialsConfig { grpc::string pem_root_certs_; }; +typedef struct grpc_tls_credential_reload_arg grpc_tls_credential_reload_arg; + /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. It is * used for experimental purposes for now and it is subject to change. * @@ -101,6 +103,8 @@ class TlsCredentialReloadArg { grpc_tls_credential_reload_arg* c_arg_; }; +typedef struct grpc_tls_credential_reload_config grpc_tls_credential_reload_config; + /** TLS credential reloag config, wraps grpc_tls_credential_reload_config. It is * used for experimental purposes for now and it is subject to change. * @@ -147,6 +151,8 @@ class TlsCredentialReloadConfig { void (*destruct_)(void* config_user_data); }; +typedef struct grpc_tls_server_authorization_check_arg grpc_tls_server_authorization_check_arg; + /** TLS server authorization check arguments, wraps * grpc_tls_server_authorization_check_arg. It is used for experimental * purposes for now and it is subject to change. @@ -194,6 +200,8 @@ class TlsServerAuthorizationCheckArg { grpc_tls_server_authorization_check_arg* c_arg_; }; +typedef struct grpc_tls_server_authorization_check_config grpc_tls_server_authorization_check_config; + /** TLS server authorization check config, wraps * grps_tls_server_authorization_check_config. It is used for experimental * purposes for now and it is subject to change. @@ -246,6 +254,8 @@ class TlsServerAuthorizationCheckConfig { void (*destruct_)(void* config_user_data); }; +typedef struct grpc_tls_credentials_options grpc_tls_credentials_options; + /** TLS credentials options, wrapper for grpc_tls_credentials_options. It is * used for experimental purposes for now and it is subject to change. See the * description of the grpc_tls_credentials_options struct in grpc_security.h for diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 88b78dd1a2d..74f36f6b984 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -16,9 +16,9 @@ * */ +#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" #include -#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" #include "src/cpp/common/tls_credentials_options_util.h" namespace grpc_impl { From 78e27bc1410a8b3c46b95eb0978f2fe0d18963c0 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 18 Sep 2019 13:32:53 -0700 Subject: [PATCH 54/70] Another attempt at fixing build issue. --- .../grpcpp/security/tls_credentials_options.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 8908c96f463..8dfff315a7b 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -26,6 +26,12 @@ #include #include +typedef struct grpc_tls_credential_reload_arg grpc_tls_credential_reload_arg; +typedef struct grpc_tls_credential_reload_config grpc_tls_credential_reload_config; +typedef struct grpc_tls_server_authorization_check_arg grpc_tls_server_authorization_check_arg; +typedef struct grpc_tls_server_authorization_check_config grpc_tls_server_authorization_check_config; +typedef struct grpc_tls_credentials_options grpc_tls_credentials_options; + namespace grpc_impl { namespace experimental { @@ -57,7 +63,7 @@ class TlsKeyMaterialsConfig { grpc::string pem_root_certs_; }; -typedef struct grpc_tls_credential_reload_arg grpc_tls_credential_reload_arg; +//typedef struct grpc_tls_credential_reload_arg grpc_tls_credential_reload_arg; /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. It is * used for experimental purposes for now and it is subject to change. @@ -103,7 +109,7 @@ class TlsCredentialReloadArg { grpc_tls_credential_reload_arg* c_arg_; }; -typedef struct grpc_tls_credential_reload_config grpc_tls_credential_reload_config; +//typedef struct grpc_tls_credential_reload_config grpc_tls_credential_reload_config; /** TLS credential reloag config, wraps grpc_tls_credential_reload_config. It is * used for experimental purposes for now and it is subject to change. @@ -151,7 +157,7 @@ class TlsCredentialReloadConfig { void (*destruct_)(void* config_user_data); }; -typedef struct grpc_tls_server_authorization_check_arg grpc_tls_server_authorization_check_arg; +//typedef struct grpc_tls_server_authorization_check_arg grpc_tls_server_authorization_check_arg; /** TLS server authorization check arguments, wraps * grpc_tls_server_authorization_check_arg. It is used for experimental @@ -200,7 +206,7 @@ class TlsServerAuthorizationCheckArg { grpc_tls_server_authorization_check_arg* c_arg_; }; -typedef struct grpc_tls_server_authorization_check_config grpc_tls_server_authorization_check_config; +//typedef struct ::grpc_tls_server_authorization_check_config grpc_tls_server_authorization_check_config; /** TLS server authorization check config, wraps * grps_tls_server_authorization_check_config. It is used for experimental @@ -254,7 +260,7 @@ class TlsServerAuthorizationCheckConfig { void (*destruct_)(void* config_user_data); }; -typedef struct grpc_tls_credentials_options grpc_tls_credentials_options; +//typedef struct ::grpc_tls_credentials_options grpc_tls_credentials_options; /** TLS credentials options, wrapper for grpc_tls_credentials_options. It is * used for experimental purposes for now and it is subject to change. See the From 65c9ece1398d73387f5a2314d88cf2e12d3efe82 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 18 Sep 2019 15:00:37 -0700 Subject: [PATCH 55/70] Forgot to run clang_format after previous build changes. --- .../grpcpp/security/tls_credentials_options.h | 22 ++++++++++++------- src/cpp/common/tls_credentials_options.cc | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 8dfff315a7b..dec1840010b 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -27,9 +27,12 @@ #include typedef struct grpc_tls_credential_reload_arg grpc_tls_credential_reload_arg; -typedef struct grpc_tls_credential_reload_config grpc_tls_credential_reload_config; -typedef struct grpc_tls_server_authorization_check_arg grpc_tls_server_authorization_check_arg; -typedef struct grpc_tls_server_authorization_check_config grpc_tls_server_authorization_check_config; +typedef struct grpc_tls_credential_reload_config + grpc_tls_credential_reload_config; +typedef struct grpc_tls_server_authorization_check_arg + grpc_tls_server_authorization_check_arg; +typedef struct grpc_tls_server_authorization_check_config + grpc_tls_server_authorization_check_config; typedef struct grpc_tls_credentials_options grpc_tls_credentials_options; namespace grpc_impl { @@ -63,7 +66,7 @@ class TlsKeyMaterialsConfig { grpc::string pem_root_certs_; }; -//typedef struct grpc_tls_credential_reload_arg grpc_tls_credential_reload_arg; +// typedef struct grpc_tls_credential_reload_arg grpc_tls_credential_reload_arg; /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. It is * used for experimental purposes for now and it is subject to change. @@ -109,7 +112,8 @@ class TlsCredentialReloadArg { grpc_tls_credential_reload_arg* c_arg_; }; -//typedef struct grpc_tls_credential_reload_config grpc_tls_credential_reload_config; +// typedef struct grpc_tls_credential_reload_config +// grpc_tls_credential_reload_config; /** TLS credential reloag config, wraps grpc_tls_credential_reload_config. It is * used for experimental purposes for now and it is subject to change. @@ -157,7 +161,8 @@ class TlsCredentialReloadConfig { void (*destruct_)(void* config_user_data); }; -//typedef struct grpc_tls_server_authorization_check_arg grpc_tls_server_authorization_check_arg; +// typedef struct grpc_tls_server_authorization_check_arg +// grpc_tls_server_authorization_check_arg; /** TLS server authorization check arguments, wraps * grpc_tls_server_authorization_check_arg. It is used for experimental @@ -206,7 +211,8 @@ class TlsServerAuthorizationCheckArg { grpc_tls_server_authorization_check_arg* c_arg_; }; -//typedef struct ::grpc_tls_server_authorization_check_config grpc_tls_server_authorization_check_config; +// typedef struct ::grpc_tls_server_authorization_check_config +// grpc_tls_server_authorization_check_config; /** TLS server authorization check config, wraps * grps_tls_server_authorization_check_config. It is used for experimental @@ -260,7 +266,7 @@ class TlsServerAuthorizationCheckConfig { void (*destruct_)(void* config_user_data); }; -//typedef struct ::grpc_tls_credentials_options grpc_tls_credentials_options; +// typedef struct ::grpc_tls_credentials_options grpc_tls_credentials_options; /** TLS credentials options, wrapper for grpc_tls_credentials_options. It is * used for experimental purposes for now and it is subject to change. See the diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 74f36f6b984..51f1d48944c 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -16,8 +16,8 @@ * */ -#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" #include +#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" #include "src/cpp/common/tls_credentials_options_util.h" From eafaf130830d32ae322b815d16b4b952e39e07d0 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 18 Sep 2019 15:22:56 -0700 Subject: [PATCH 56/70] Another small build fix. --- include/grpcpp/security/tls_credentials_options.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index dec1840010b..d57676f9b75 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -22,7 +22,8 @@ #include #include -//#include +#include +#include #include #include From 96c24347f7e45378ec81ddfcf420fee549de7ee2 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Thu, 19 Sep 2019 11:36:37 -0700 Subject: [PATCH 57/70] Refactored the configs, per Yang's suggestions. --- .../grpcpp/security/tls_credentials_options.h | 111 +++++-------- src/cpp/common/tls_credentials_options.cc | 50 ++---- test/cpp/client/credentials_test.cc | 157 +++++++++++------- 3 files changed, 151 insertions(+), 167 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index d57676f9b75..8b5382cd852 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -67,8 +67,6 @@ class TlsKeyMaterialsConfig { grpc::string pem_root_certs_; }; -// typedef struct grpc_tls_credential_reload_arg grpc_tls_credential_reload_arg; - /** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. It is * used for experimental purposes for now and it is subject to change. * @@ -113,58 +111,42 @@ class TlsCredentialReloadArg { grpc_tls_credential_reload_arg* c_arg_; }; -// typedef struct grpc_tls_credential_reload_config -// grpc_tls_credential_reload_config; +/** An interface that the application derives and uses to instantiate a + * TlsCredentialReloadConfig instance. All 3 methods must be defined. **/ +struct TlsCredentialReloadInterface { + /** An application-provided callback that invokes the credential reload. **/ + virtual int Schedule(TlsCredentialReloadArg* arg) = 0; + /** An application-provided callback that cancels a credential reload request. + * **/ + virtual void Cancel(TlsCredentialReloadArg* arg) = 0; + /** An application-provided callback that cleans up any data associated to the + * interface or the config. **/ + virtual void Release() = 0; +}; /** TLS credential reloag config, wraps grpc_tls_credential_reload_config. It is - * used for experimental purposes for now and it is subject to change. - * - * The config_user_data is read-only user data; schedule is a pointer to an - * application-provided callback that invokes the credential reload; cancel is a - * pointer to an application-provided callback that cancels a credential reload - * request; destruct is a pointer to an application-provided callback that - * cleans up any data associated to the config. See the description of the - * grpc_tls_credential_reload_config struct in grpc_security.h. **/ + * used for experimental purposes for now and it is subject to change. **/ class TlsCredentialReloadConfig { public: - TlsCredentialReloadConfig(const void* config_user_data, - int (*schedule)(void* config_user_data, - TlsCredentialReloadArg* arg), - void (*cancel)(void* config_user_data, - TlsCredentialReloadArg* arg), - void (*destruct)(void* config_user_data)); + /** The constructor takes ownership of the interface argument. **/ + TlsCredentialReloadConfig( + std::shared_ptr interface); ~TlsCredentialReloadConfig(); int Schedule(TlsCredentialReloadArg* arg) const { - if (schedule_ == nullptr) { - gpr_log(GPR_ERROR, "schedule API is nullptr"); - return 1; - } - return schedule_(config_user_data_, arg); + return interface_->Schedule(arg); } - void Cancel(TlsCredentialReloadArg* arg) const { - if (cancel_ == nullptr) { - gpr_log(GPR_ERROR, "cancel API is nullptr"); - return; - } - cancel_(config_user_data_, arg); - } + void Cancel(TlsCredentialReloadArg* arg) const { interface_->Cancel(arg); } /** Returns a C struct for the credential reload config. **/ grpc_tls_credential_reload_config* c_config() const { return c_config_; } private: grpc_tls_credential_reload_config* c_config_; - void* config_user_data_; - int (*schedule_)(void* config_user_data, TlsCredentialReloadArg* arg); - void (*cancel_)(void* config_user_data, TlsCredentialReloadArg* arg); - void (*destruct_)(void* config_user_data); + std::shared_ptr interface_; }; -// typedef struct grpc_tls_server_authorization_check_arg -// grpc_tls_server_authorization_check_arg; - /** TLS server authorization check arguments, wraps * grpc_tls_server_authorization_check_arg. It is used for experimental * purposes for now and it is subject to change. @@ -212,46 +194,38 @@ class TlsServerAuthorizationCheckArg { grpc_tls_server_authorization_check_arg* c_arg_; }; -// typedef struct ::grpc_tls_server_authorization_check_config -// grpc_tls_server_authorization_check_config; +/** An interface that the application derives and uses to instantiate a + * TlsServerAuthorizationCheckConfig instance. All 3 methods must be defined. + * **/ +struct TlsServerAuthorizationCheckInterface { + /** An application-provided callback that invokes the server authorization + * check. **/ + virtual int Schedule(TlsServerAuthorizationCheckArg* arg) = 0; + /** An application-provided callback that cancels a server authorization check + * request. + * **/ + virtual void Cancel(TlsServerAuthorizationCheckArg* arg) = 0; + /** An application-provided callback that cleans up any data associated to the + * interface or the config. **/ + virtual void Release() = 0; +}; /** TLS server authorization check config, wraps * grps_tls_server_authorization_check_config. It is used for experimental - * purposes for now and it is subject to change. - * - * The config_user_data is read-only user data; schedule is a pointer to an - * application-provided callback that invokes the server authorization check; - * cancel is a pointer to an application-provided callback that cancels a - * server authorization check request; destruct is a pointer to an - * application-provided callback that cleans up any data associated to the - * config. See the description of the - * grpc_tls_server_authorization_check_config struct in grpc_security.h for - * more details. **/ + * purposes for now and it is subject to change. **/ class TlsServerAuthorizationCheckConfig { public: + /** The constructor takess ownership of the interface argument. **/ TlsServerAuthorizationCheckConfig( - const void* config_user_data, - int (*schedule)(void* config_user_data, - TlsServerAuthorizationCheckArg* arg), - void (*cancel)(void* config_user_data, - TlsServerAuthorizationCheckArg* arg), - void (*destruct)(void* config_user_data)); + std::shared_ptr interface); ~TlsServerAuthorizationCheckConfig(); int Schedule(TlsServerAuthorizationCheckArg* arg) const { - if (schedule_ == nullptr) { - gpr_log(GPR_ERROR, "schedule API is nullptr"); - return 1; - } - return schedule_(config_user_data_, arg); + return interface_->Schedule(arg); } void Cancel(TlsServerAuthorizationCheckArg* arg) const { - if (cancel_ == nullptr) { - gpr_log(GPR_ERROR, "cancel API is nullptr"); - return; - } - cancel_(config_user_data_, arg); + interface_->Cancel(arg); } /** Creates C struct for the server authorization check config. **/ @@ -261,14 +235,9 @@ class TlsServerAuthorizationCheckConfig { private: grpc_tls_server_authorization_check_config* c_config_; - void* config_user_data_; - int (*schedule_)(void* config_user_data, TlsServerAuthorizationCheckArg* arg); - void (*cancel_)(void* config_user_data, TlsServerAuthorizationCheckArg* arg); - void (*destruct_)(void* config_user_data); + std::shared_ptr interface_; }; -// typedef struct ::grpc_tls_credentials_options grpc_tls_credentials_options; - /** TLS credentials options, wrapper for grpc_tls_credentials_options. It is * used for experimental purposes for now and it is subject to change. See the * description of the grpc_tls_credentials_options struct in grpc_security.h for diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 51f1d48944c..b5e58660233 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -87,26 +87,16 @@ void TlsCredentialReloadArg::OnCredentialReloadDoneCallback() { /** gRPC TLS credential reload config API implementation **/ TlsCredentialReloadConfig::TlsCredentialReloadConfig( - const void* config_user_data, - int (*schedule)(void* config_user_data, TlsCredentialReloadArg* arg), - void (*cancel)(void* config_user_data, TlsCredentialReloadArg* arg), - void (*destruct)(void* config_user_data)) - : config_user_data_(const_cast(config_user_data)), - schedule_(schedule), - cancel_(cancel), - destruct_(destruct) { + std::shared_ptr interface) + : interface_(std::move(interface)) { c_config_ = grpc_tls_credential_reload_config_create( - config_user_data_, - schedule != nullptr ? &TlsCredentialReloadConfigCSchedule : nullptr, - cancel != nullptr ? &TlsCredentialReloadConfigCCancel : nullptr, - destruct_); + nullptr, &TlsCredentialReloadConfigCSchedule, + &TlsCredentialReloadConfigCCancel, nullptr); c_config_->set_context(static_cast(this)); } TlsCredentialReloadConfig::~TlsCredentialReloadConfig() { - if (destruct_ != nullptr) { - destruct_(config_user_data_); - } + interface_->Release(); } /** gRPC TLS server authorization check arg API implementation **/ @@ -172,30 +162,18 @@ void TlsServerAuthorizationCheckArg::OnServerAuthorizationCheckDoneCallback() { c_arg_->cb(c_arg_); } -/** gRPC TLS server authorization check config API implementation **/ +/** gRPC TLS server authorization check config API implementation. **/ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( - const void* config_user_data, - int (*schedule)(void* config_user_data, - TlsServerAuthorizationCheckArg* arg), - void (*cancel)(void* config_user_data, TlsServerAuthorizationCheckArg* arg), - void (*destruct)(void* config_user_data)) - : config_user_data_(const_cast(config_user_data)), - schedule_(schedule), - cancel_(cancel), - destruct_(destruct) { + std::shared_ptr interface) + : interface_(std::move(interface)) { c_config_ = grpc_tls_server_authorization_check_config_create( - config_user_data_, - schedule != nullptr ? &TlsServerAuthorizationCheckConfigCSchedule - : nullptr, - cancel != nullptr ? &TlsServerAuthorizationCheckConfigCCancel : nullptr, - destruct_); + nullptr, &TlsServerAuthorizationCheckConfigCSchedule, + &TlsServerAuthorizationCheckConfigCCancel, nullptr); c_config_->set_context(static_cast(this)); } TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() { - if (destruct_ != nullptr) { - destruct_(config_user_data_); - } + interface_->Release(); } /** gRPC TLS credential options API implementation **/ @@ -226,11 +204,7 @@ TlsCredentialsOptions::TlsCredentialsOptions( } } -TlsCredentialsOptions::~TlsCredentialsOptions() { - if (c_credentials_options_ != nullptr) { - gpr_free(c_credentials_options_); - } -} +TlsCredentialsOptions::~TlsCredentialsOptions() {} } // namespace experimental } // namespace grpc_impl diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index b5b7f563c21..eeb073c80ab 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -37,8 +37,12 @@ typedef class ::grpc_impl::experimental::TlsKeyMaterialsConfig TlsKeyMaterialsConfig; typedef class ::grpc_impl::experimental::TlsCredentialReloadArg TlsCredentialReloadArg; +typedef struct ::grpc_impl::experimental::TlsCredentialReloadInterface + TlsCredentialReloadInterface; typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckArg TlsServerAuthorizationCheckArg; +typedef struct ::grpc_impl::experimental::TlsServerAuthorizationCheckInterface + TlsServerAuthorizationCheckInterface; static void tls_credential_reload_callback( grpc_tls_credential_reload_arg* arg) { @@ -46,31 +50,33 @@ static void tls_credential_reload_callback( arg->status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; } -static int tls_credential_reload_sync(void* config_user_data, - TlsCredentialReloadArg* arg) { - GPR_ASSERT(arg != nullptr); - struct TlsKeyMaterialsConfig::PemKeyCertPair pair3 = {"private_key3", - "cert_chain3"}; - std::shared_ptr key_materials_config = - arg->key_materials_config(); - GPR_ASSERT(key_materials_config != nullptr); - std::vector pair_list = - key_materials_config->pem_key_cert_pair_list(); - pair_list.push_back(pair3); - pair_list[0].private_key = "private_key01"; - pair_list[0].cert_chain = "cert_chain01"; - key_materials_config->set_key_materials("new_pem_root_certs", pair_list); - arg->set_key_materials_config(key_materials_config); - arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); - return 0; -} - -static void tls_credential_reload_cancel(void* config_user_data, - TlsCredentialReloadArg* arg) { - GPR_ASSERT(arg != nullptr); - arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); - arg->set_error_details("cancelled"); -} +class TestTlsCredentialReloadInterface : public TlsCredentialReloadInterface { + int Schedule(TlsCredentialReloadArg* arg) override { + GPR_ASSERT(arg != nullptr); + struct TlsKeyMaterialsConfig::PemKeyCertPair pair3 = {"private_key3", + "cert_chain3"}; + std::shared_ptr key_materials_config = + arg->key_materials_config(); + GPR_ASSERT(key_materials_config != nullptr); + std::vector pair_list = + key_materials_config->pem_key_cert_pair_list(); + pair_list.push_back(pair3); + pair_list[0].private_key = "private_key01"; + pair_list[0].cert_chain = "cert_chain01"; + key_materials_config->set_key_materials("new_pem_root_certs", pair_list); + arg->set_key_materials_config(key_materials_config); + arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + return 0; + } + + void Cancel(TlsCredentialReloadArg* arg) override { + GPR_ASSERT(arg != nullptr); + arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); + arg->set_error_details("cancelled"); + } + + void Release() override { return; } +}; static void tls_server_authorization_check_callback( grpc_tls_server_authorization_check_arg* arg) { @@ -84,25 +90,28 @@ static void tls_server_authorization_check_callback( arg->error_details = gpr_strdup("callback_error_details"); } -static int tls_server_authorization_check_sync( - void* config_user_data, TlsServerAuthorizationCheckArg* arg) { - GPR_ASSERT(arg != nullptr); - grpc::string cb_user_data = "cb_user_data"; - arg->set_cb_user_data(static_cast(gpr_strdup(cb_user_data.c_str()))); - arg->set_success(1); - arg->set_target_name("sync_target_name"); - arg->set_peer_cert("sync_peer_cert"); - arg->set_status(GRPC_STATUS_OK); - arg->set_error_details("sync_error_details"); - return 1; -} - -static void tls_server_authorization_check_cancel( - void* config_user_data, TlsServerAuthorizationCheckArg* arg) { - GPR_ASSERT(arg != nullptr); - arg->set_status(GRPC_STATUS_PERMISSION_DENIED); - arg->set_error_details("cancelled"); -} +class TestTlsServerAuthorizationCheckInterface + : public TlsServerAuthorizationCheckInterface { + int Schedule(TlsServerAuthorizationCheckArg* arg) override { + GPR_ASSERT(arg != nullptr); + grpc::string cb_user_data = "cb_user_data"; + arg->set_cb_user_data(static_cast(gpr_strdup(cb_user_data.c_str()))); + arg->set_success(1); + arg->set_target_name("sync_target_name"); + arg->set_peer_cert("sync_peer_cert"); + arg->set_status(GRPC_STATUS_OK); + arg->set_error_details("sync_error_details"); + return 1; + } + + void Cancel(TlsServerAuthorizationCheckArg* arg) override { + GPR_ASSERT(arg != nullptr); + arg->set_status(GRPC_STATUS_PERMISSION_DENIED); + arg->set_error_details("cancelled"); + } + + void Release() override { return; } +}; } // namespace @@ -339,8 +348,9 @@ TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { } TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { - TlsCredentialReloadConfig config(nullptr, &tls_credential_reload_sync, - nullptr, nullptr); + std::shared_ptr interface( + new TestTlsCredentialReloadInterface()); + TlsCredentialReloadConfig config(interface); grpc_tls_credential_reload_arg c_arg; TlsCredentialReloadArg arg(&c_arg); arg.set_cb_user_data(static_cast(nullptr)); @@ -383,9 +393,9 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { } TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { - TlsCredentialReloadConfig config = - TlsCredentialReloadConfig(nullptr, &tls_credential_reload_sync, - &tls_credential_reload_cancel, nullptr); + std::shared_ptr interface( + new TestTlsCredentialReloadInterface()); + TlsCredentialReloadConfig config = TlsCredentialReloadConfig(interface); grpc_tls_credential_reload_arg c_arg; c_arg.cb_user_data = static_cast(nullptr); grpc_tls_key_materials_config c_key_materials; @@ -477,8 +487,10 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { - TlsServerAuthorizationCheckConfig config = TlsServerAuthorizationCheckConfig( - nullptr, &tls_server_authorization_check_sync, nullptr, nullptr); + std::shared_ptr interface( + new TestTlsServerAuthorizationCheckInterface()); + TlsServerAuthorizationCheckConfig config = + TlsServerAuthorizationCheckConfig(interface); grpc_tls_server_authorization_check_arg c_arg; TlsServerAuthorizationCheckArg arg(&c_arg); arg.set_cb_user_data(nullptr); @@ -512,9 +524,10 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { - TlsServerAuthorizationCheckConfig config = TlsServerAuthorizationCheckConfig( - nullptr, &tls_server_authorization_check_sync, - &tls_server_authorization_check_cancel, nullptr); + std::shared_ptr interface( + new TestTlsServerAuthorizationCheckInterface()); + TlsServerAuthorizationCheckConfig config = + TlsServerAuthorizationCheckConfig(interface); grpc_tls_server_authorization_check_arg c_arg; c_arg.cb = tls_server_authorization_check_callback; c_arg.cb_user_data = nullptr; @@ -560,14 +573,19 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { "cert_chain"}; std::vector pair_list = {pair}; key_materials_config->set_key_materials("pem_root_certs", pair_list); + + std::shared_ptr credential_reload_interface( + new TestTlsCredentialReloadInterface()); std::shared_ptr credential_reload_config( - new TlsCredentialReloadConfig(nullptr, &tls_credential_reload_sync, - &tls_credential_reload_cancel, nullptr)); + new TlsCredentialReloadConfig(credential_reload_interface)); + std::shared_ptr + server_authorization_check_interface( + new TestTlsServerAuthorizationCheckInterface()); std::shared_ptr server_authorization_check_config(new TlsServerAuthorizationCheckConfig( - nullptr, &tls_server_authorization_check_sync, - &tls_server_authorization_check_cancel, nullptr)); + server_authorization_check_interface)); + TlsCredentialsOptions options = TlsCredentialsOptions( GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, key_materials_config, credential_reload_config, server_authorization_check_config); @@ -649,6 +667,29 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { gpr_free(const_cast(c_server_authorization_check_arg.error_details)); ::grpc_core::Delete(c_credential_reload_config); ::grpc_core::Delete(c_server_authorization_check_config); + gpr_free(c_options); +} + +// This test demonstrates how the SPIFFE credentials will be used. +TEST_F(CredentialsTest, LoadSpiffeChannelCredentials) { + std::shared_ptr credential_reload_interface( + new TestTlsCredentialReloadInterface()); + std::shared_ptr credential_reload_config( + new TlsCredentialReloadConfig(credential_reload_interface)); + + std::shared_ptr + server_authorization_check_interface( + new TestTlsServerAuthorizationCheckInterface()); + std::shared_ptr + server_authorization_check_config(new TlsServerAuthorizationCheckConfig( + server_authorization_check_interface)); + + TlsCredentialsOptions options = TlsCredentialsOptions( + GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, nullptr, + credential_reload_config, server_authorization_check_config); + std::shared_ptr channel_credentials = + grpc::experimental::TlsCredentials(options); + GPR_ASSERT(channel_credentials != nullptr); } } // namespace testing From 0a054cc6eaf7eba44e503395efd85f3377a15b45 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Fri, 20 Sep 2019 08:59:34 -0700 Subject: [PATCH 58/70] Implementing Yang's secound round of comments. --- .../grpcpp/security/tls_credentials_options.h | 73 +++++++++++-------- src/cpp/common/tls_credentials_options.cc | 14 ++-- test/cpp/client/credentials_test.cc | 38 ++++------ 3 files changed, 67 insertions(+), 58 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 8b5382cd852..92c7bab0487 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -112,39 +112,44 @@ class TlsCredentialReloadArg { }; /** An interface that the application derives and uses to instantiate a - * TlsCredentialReloadConfig instance. All 3 methods must be defined. **/ + * TlsCredentialReloadConfig instance. Refer to the definition of the + * grpc_tls_credential_reload_config in grpc_tls_credentials_options.h for more + * details on the expectations of the member functions of the interface. **/ struct TlsCredentialReloadInterface { - /** An application-provided callback that invokes the credential reload. **/ - virtual int Schedule(TlsCredentialReloadArg* arg) = 0; - /** An application-provided callback that cancels a credential reload request. - * **/ - virtual void Cancel(TlsCredentialReloadArg* arg) = 0; - /** An application-provided callback that cleans up any data associated to the - * interface or the config. **/ - virtual void Release() = 0; + virtual ~TlsCredentialReloadInterface() = default; + /** A callback that invokes the credential reload. **/ + virtual int Schedule(TlsCredentialReloadArg* arg) { return 1; } + /** A callback that cancels a credential reload request. **/ + virtual void Cancel(TlsCredentialReloadArg* arg) {} + /** A callback that cleans up any data associated to the + * interface or the config. It will be called when the config is no longer + * using the interface. **/ + virtual void Release() {} }; /** TLS credential reloag config, wraps grpc_tls_credential_reload_config. It is * used for experimental purposes for now and it is subject to change. **/ class TlsCredentialReloadConfig { public: - /** The constructor takes ownership of the interface argument. **/ - TlsCredentialReloadConfig( - std::shared_ptr interface); + /** The config takes ownership of the credential reload interface. **/ + TlsCredentialReloadConfig(std::unique_ptr + credential_reload_interface); ~TlsCredentialReloadConfig(); int Schedule(TlsCredentialReloadArg* arg) const { - return interface_->Schedule(arg); + return credential_reload_interface_->Schedule(arg); } - void Cancel(TlsCredentialReloadArg* arg) const { interface_->Cancel(arg); } + void Cancel(TlsCredentialReloadArg* arg) const { + credential_reload_interface_->Cancel(arg); + } /** Returns a C struct for the credential reload config. **/ grpc_tls_credential_reload_config* c_config() const { return c_config_; } private: grpc_tls_credential_reload_config* c_config_; - std::shared_ptr interface_; + std::unique_ptr credential_reload_interface_; }; /** TLS server authorization check arguments, wraps @@ -195,19 +200,20 @@ class TlsServerAuthorizationCheckArg { }; /** An interface that the application derives and uses to instantiate a - * TlsServerAuthorizationCheckConfig instance. All 3 methods must be defined. + * TlsServerAuthorizationCheckConfig instance. Refer to the definition of the + * grpc_tls_server_authorization_check_config in grpc_tls_credentials_options.h + * for more details on the expectations of the member functions of the + * interface. * **/ struct TlsServerAuthorizationCheckInterface { - /** An application-provided callback that invokes the server authorization - * check. **/ - virtual int Schedule(TlsServerAuthorizationCheckArg* arg) = 0; - /** An application-provided callback that cancels a server authorization check - * request. - * **/ - virtual void Cancel(TlsServerAuthorizationCheckArg* arg) = 0; - /** An application-provided callback that cleans up any data associated to the + virtual ~TlsServerAuthorizationCheckInterface() = default; + /** A callback that invokes the server authorization check. **/ + virtual int Schedule(TlsServerAuthorizationCheckArg* arg) { return 1; } + /** A callback that cancels a server authorization check request. **/ + virtual void Cancel(TlsServerAuthorizationCheckArg* arg){}; + /** A callback that cleans up any data associated to the * interface or the config. **/ - virtual void Release() = 0; + virtual void Release(){}; }; /** TLS server authorization check config, wraps @@ -215,17 +221,19 @@ struct TlsServerAuthorizationCheckInterface { * purposes for now and it is subject to change. **/ class TlsServerAuthorizationCheckConfig { public: - /** The constructor takess ownership of the interface argument. **/ + /** The config takes ownership of the server authorization check interface. + * **/ TlsServerAuthorizationCheckConfig( - std::shared_ptr interface); + std::unique_ptr + server_authorization_check_interface); ~TlsServerAuthorizationCheckConfig(); int Schedule(TlsServerAuthorizationCheckArg* arg) const { - return interface_->Schedule(arg); + return server_authorization_check_interface_->Schedule(arg); } void Cancel(TlsServerAuthorizationCheckArg* arg) const { - interface_->Cancel(arg); + server_authorization_check_interface_->Cancel(arg); } /** Creates C struct for the server authorization check config. **/ @@ -235,7 +243,8 @@ class TlsServerAuthorizationCheckConfig { private: grpc_tls_server_authorization_check_config* c_config_; - std::shared_ptr interface_; + std::unique_ptr + server_authorization_check_interface_; }; /** TLS credentials options, wrapper for grpc_tls_credentials_options. It is @@ -271,6 +280,10 @@ class TlsCredentialsOptions { } private: + /** The cert_request_type_ flag is only relevant when the + * TlsCredentialsOptions are used to instantiate server credentials; the flag + * goes unused when creating channel credentials, and the user can set it to + * GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE. **/ grpc_ssl_client_certificate_request_type cert_request_type_; std::shared_ptr key_materials_config_; std::shared_ptr credential_reload_config_; diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index b5e58660233..13b400b45bf 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -87,8 +87,8 @@ void TlsCredentialReloadArg::OnCredentialReloadDoneCallback() { /** gRPC TLS credential reload config API implementation **/ TlsCredentialReloadConfig::TlsCredentialReloadConfig( - std::shared_ptr interface) - : interface_(std::move(interface)) { + std::unique_ptr credential_reload_interface) + : credential_reload_interface_(std::move(credential_reload_interface)) { c_config_ = grpc_tls_credential_reload_config_create( nullptr, &TlsCredentialReloadConfigCSchedule, &TlsCredentialReloadConfigCCancel, nullptr); @@ -96,7 +96,7 @@ TlsCredentialReloadConfig::TlsCredentialReloadConfig( } TlsCredentialReloadConfig::~TlsCredentialReloadConfig() { - interface_->Release(); + credential_reload_interface_->Release(); } /** gRPC TLS server authorization check arg API implementation **/ @@ -164,8 +164,10 @@ void TlsServerAuthorizationCheckArg::OnServerAuthorizationCheckDoneCallback() { /** gRPC TLS server authorization check config API implementation. **/ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( - std::shared_ptr interface) - : interface_(std::move(interface)) { + std::unique_ptr + server_authorization_check_interface) + : server_authorization_check_interface_( + std::move(server_authorization_check_interface)) { c_config_ = grpc_tls_server_authorization_check_config_create( nullptr, &TlsServerAuthorizationCheckConfigCSchedule, &TlsServerAuthorizationCheckConfigCCancel, nullptr); @@ -173,7 +175,7 @@ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( } TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() { - interface_->Release(); + server_authorization_check_interface_->Release(); } /** gRPC TLS credential options API implementation **/ diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index eeb073c80ab..3e3b44ede2d 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -74,8 +74,6 @@ class TestTlsCredentialReloadInterface : public TlsCredentialReloadInterface { arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); arg->set_error_details("cancelled"); } - - void Release() override { return; } }; static void tls_server_authorization_check_callback( @@ -109,8 +107,6 @@ class TestTlsServerAuthorizationCheckInterface arg->set_status(GRPC_STATUS_PERMISSION_DENIED); arg->set_error_details("cancelled"); } - - void Release() override { return; } }; } // namespace @@ -348,9 +344,9 @@ TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { } TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { - std::shared_ptr interface( + std::unique_ptr interface( new TestTlsCredentialReloadInterface()); - TlsCredentialReloadConfig config(interface); + TlsCredentialReloadConfig config(std::move(interface)); grpc_tls_credential_reload_arg c_arg; TlsCredentialReloadArg arg(&c_arg); arg.set_cb_user_data(static_cast(nullptr)); @@ -393,9 +389,9 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { } TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { - std::shared_ptr interface( + std::unique_ptr interface( new TestTlsCredentialReloadInterface()); - TlsCredentialReloadConfig config = TlsCredentialReloadConfig(interface); + TlsCredentialReloadConfig config(std::move(interface)); grpc_tls_credential_reload_arg c_arg; c_arg.cb_user_data = static_cast(nullptr); grpc_tls_key_materials_config c_key_materials; @@ -487,10 +483,9 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { - std::shared_ptr interface( + std::unique_ptr interface( new TestTlsServerAuthorizationCheckInterface()); - TlsServerAuthorizationCheckConfig config = - TlsServerAuthorizationCheckConfig(interface); + TlsServerAuthorizationCheckConfig config(std::move(interface)); grpc_tls_server_authorization_check_arg c_arg; TlsServerAuthorizationCheckArg arg(&c_arg); arg.set_cb_user_data(nullptr); @@ -524,10 +519,9 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { - std::shared_ptr interface( + std::unique_ptr interface( new TestTlsServerAuthorizationCheckInterface()); - TlsServerAuthorizationCheckConfig config = - TlsServerAuthorizationCheckConfig(interface); + TlsServerAuthorizationCheckConfig config(std::move(interface)); grpc_tls_server_authorization_check_arg c_arg; c_arg.cb = tls_server_authorization_check_callback; c_arg.cb_user_data = nullptr; @@ -574,17 +568,17 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { std::vector pair_list = {pair}; key_materials_config->set_key_materials("pem_root_certs", pair_list); - std::shared_ptr credential_reload_interface( + std::unique_ptr credential_reload_interface( new TestTlsCredentialReloadInterface()); std::shared_ptr credential_reload_config( - new TlsCredentialReloadConfig(credential_reload_interface)); + new TlsCredentialReloadConfig(std::move(credential_reload_interface))); - std::shared_ptr + std::unique_ptr server_authorization_check_interface( new TestTlsServerAuthorizationCheckInterface()); std::shared_ptr server_authorization_check_config(new TlsServerAuthorizationCheckConfig( - server_authorization_check_interface)); + std::move(server_authorization_check_interface))); TlsCredentialsOptions options = TlsCredentialsOptions( GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, key_materials_config, @@ -672,17 +666,17 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { // This test demonstrates how the SPIFFE credentials will be used. TEST_F(CredentialsTest, LoadSpiffeChannelCredentials) { - std::shared_ptr credential_reload_interface( + std::unique_ptr credential_reload_interface( new TestTlsCredentialReloadInterface()); std::shared_ptr credential_reload_config( - new TlsCredentialReloadConfig(credential_reload_interface)); + new TlsCredentialReloadConfig(std::move(credential_reload_interface))); - std::shared_ptr + std::unique_ptr server_authorization_check_interface( new TestTlsServerAuthorizationCheckInterface()); std::shared_ptr server_authorization_check_config(new TlsServerAuthorizationCheckConfig( - server_authorization_check_interface)); + std::move(server_authorization_check_interface))); TlsCredentialsOptions options = TlsCredentialsOptions( GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, nullptr, From 8e09d8745db06ff0c6f374cc7be99712ac3f9924 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Fri, 20 Sep 2019 16:01:10 -0700 Subject: [PATCH 59/70] Implementing further comments by Yang. --- .../grpcpp/security/tls_credentials_options.h | 18 +-- src/cpp/common/tls_credentials_options.cc | 16 ++- .../common/tls_credentials_options_util.cc | 16 +-- test/cpp/client/credentials_test.cc | 117 +++++++++--------- 4 files changed, 87 insertions(+), 80 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 92c7bab0487..71472fd6b4e 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -118,9 +118,9 @@ class TlsCredentialReloadArg { struct TlsCredentialReloadInterface { virtual ~TlsCredentialReloadInterface() = default; /** A callback that invokes the credential reload. **/ - virtual int Schedule(TlsCredentialReloadArg* arg) { return 1; } + virtual int Schedule(std::unique_ptr& arg) = 0; /** A callback that cancels a credential reload request. **/ - virtual void Cancel(TlsCredentialReloadArg* arg) {} + virtual void Cancel(std::unique_ptr& arg) {} /** A callback that cleans up any data associated to the * interface or the config. It will be called when the config is no longer * using the interface. **/ @@ -136,11 +136,11 @@ class TlsCredentialReloadConfig { credential_reload_interface); ~TlsCredentialReloadConfig(); - int Schedule(TlsCredentialReloadArg* arg) const { + int Schedule(std::unique_ptr& arg) const { return credential_reload_interface_->Schedule(arg); } - void Cancel(TlsCredentialReloadArg* arg) const { + void Cancel(std::unique_ptr& arg) const { credential_reload_interface_->Cancel(arg); } @@ -208,12 +208,12 @@ class TlsServerAuthorizationCheckArg { struct TlsServerAuthorizationCheckInterface { virtual ~TlsServerAuthorizationCheckInterface() = default; /** A callback that invokes the server authorization check. **/ - virtual int Schedule(TlsServerAuthorizationCheckArg* arg) { return 1; } + virtual int Schedule(std::unique_ptr& arg) = 0; /** A callback that cancels a server authorization check request. **/ - virtual void Cancel(TlsServerAuthorizationCheckArg* arg){}; + virtual void Cancel(std::unique_ptr& arg) {} /** A callback that cleans up any data associated to the * interface or the config. **/ - virtual void Release(){}; + virtual void Release() {} }; /** TLS server authorization check config, wraps @@ -228,11 +228,11 @@ class TlsServerAuthorizationCheckConfig { server_authorization_check_interface); ~TlsServerAuthorizationCheckConfig(); - int Schedule(TlsServerAuthorizationCheckArg* arg) const { + int Schedule(std::unique_ptr& arg) const { return server_authorization_check_interface_->Schedule(arg); } - void Cancel(TlsServerAuthorizationCheckArg* arg) const { + void Cancel(std::unique_ptr& arg) const { server_authorization_check_interface_->Cancel(arg); } diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 13b400b45bf..3199317d030 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -96,7 +96,9 @@ TlsCredentialReloadConfig::TlsCredentialReloadConfig( } TlsCredentialReloadConfig::~TlsCredentialReloadConfig() { - credential_reload_interface_->Release(); + if (credential_reload_interface_ != nullptr) { + credential_reload_interface_->Release(); + } } /** gRPC TLS server authorization check arg API implementation **/ @@ -175,7 +177,9 @@ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( } TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() { - server_authorization_check_interface_->Release(); + if (server_authorization_check_interface_ != nullptr) { + server_authorization_check_interface_->Release(); + } } /** gRPC TLS credential options API implementation **/ @@ -193,9 +197,11 @@ TlsCredentialsOptions::TlsCredentialsOptions( c_credentials_options_ = grpc_tls_credentials_options_create(); grpc_tls_credentials_options_set_cert_request_type(c_credentials_options_, cert_request_type_); - grpc_tls_credentials_options_set_key_materials_config( - c_credentials_options_, - ConvertToCKeyMaterialsConfig(key_materials_config_)); + if (key_materials_config_ != nullptr) { + grpc_tls_credentials_options_set_key_materials_config( + c_credentials_options_, + ConvertToCKeyMaterialsConfig(key_materials_config_)); + } if (credential_reload_config_ != nullptr) { grpc_tls_credentials_options_set_credential_reload_config( c_credentials_options_, credential_reload_config_->c_config()); diff --git a/src/cpp/common/tls_credentials_options_util.cc b/src/cpp/common/tls_credentials_options_util.cc index 680aad162e4..90c2d73849d 100644 --- a/src/cpp/common/tls_credentials_options_util.cc +++ b/src/cpp/common/tls_credentials_options_util.cc @@ -92,8 +92,8 @@ int TlsCredentialReloadConfigCSchedule(void* config_user_data, } TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); - TlsCredentialReloadArg cpp_arg(arg); - return cpp_config->Schedule(&cpp_arg); + std::unique_ptr cpp_arg(new TlsCredentialReloadArg(arg)); + return cpp_config->Schedule(cpp_arg); } void TlsCredentialReloadConfigCCancel(void* config_user_data, @@ -105,8 +105,8 @@ void TlsCredentialReloadConfigCCancel(void* config_user_data, } TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); - TlsCredentialReloadArg cpp_arg(arg); - cpp_config->Cancel(&cpp_arg); + std::unique_ptr cpp_arg(new TlsCredentialReloadArg(arg)); + cpp_config->Cancel(cpp_arg); } /** The C schedule and cancel functions for the server authorization check @@ -122,8 +122,8 @@ int TlsServerAuthorizationCheckConfigCSchedule( } TlsServerAuthorizationCheckConfig* cpp_config = static_cast(arg->config->context()); - TlsServerAuthorizationCheckArg cpp_arg(arg); - return cpp_config->Schedule(&cpp_arg); + std::unique_ptr cpp_arg(new TlsServerAuthorizationCheckArg(arg)); + return cpp_config->Schedule(cpp_arg); } void TlsServerAuthorizationCheckConfigCCancel( @@ -136,8 +136,8 @@ void TlsServerAuthorizationCheckConfigCCancel( } TlsServerAuthorizationCheckConfig* cpp_config = static_cast(arg->config->context()); - TlsServerAuthorizationCheckArg cpp_arg(arg); - cpp_config->Cancel(&cpp_arg); + std::unique_ptr cpp_arg(new TlsServerAuthorizationCheckArg(arg)); + cpp_config->Cancel(cpp_arg); } } // namespace experimental diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 3e3b44ede2d..026212532b1 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -50,8 +50,8 @@ static void tls_credential_reload_callback( arg->status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; } -class TestTlsCredentialReloadInterface : public TlsCredentialReloadInterface { - int Schedule(TlsCredentialReloadArg* arg) override { +class TestTlsCredentialReload : public TlsCredentialReloadInterface { + int Schedule(std::unique_ptr& arg) override { GPR_ASSERT(arg != nullptr); struct TlsKeyMaterialsConfig::PemKeyCertPair pair3 = {"private_key3", "cert_chain3"}; @@ -69,7 +69,7 @@ class TestTlsCredentialReloadInterface : public TlsCredentialReloadInterface { return 0; } - void Cancel(TlsCredentialReloadArg* arg) override { + void Cancel(std::unique_ptr& arg) override { GPR_ASSERT(arg != nullptr); arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); arg->set_error_details("cancelled"); @@ -88,9 +88,9 @@ static void tls_server_authorization_check_callback( arg->error_details = gpr_strdup("callback_error_details"); } -class TestTlsServerAuthorizationCheckInterface +class TestTlsServerAuthorizationCheck : public TlsServerAuthorizationCheckInterface { - int Schedule(TlsServerAuthorizationCheckArg* arg) override { + int Schedule(std::unique_ptr& arg) override { GPR_ASSERT(arg != nullptr); grpc::string cb_user_data = "cb_user_data"; arg->set_cb_user_data(static_cast(gpr_strdup(cb_user_data.c_str()))); @@ -102,7 +102,7 @@ class TestTlsServerAuthorizationCheckInterface return 1; } - void Cancel(TlsServerAuthorizationCheckArg* arg) override { + void Cancel(std::unique_ptr& arg) override { GPR_ASSERT(arg != nullptr); arg->set_status(GRPC_STATUS_PERMISSION_DENIED); arg->set_error_details("cancelled"); @@ -344,12 +344,12 @@ TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { } TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { - std::unique_ptr interface( - new TestTlsCredentialReloadInterface()); - TlsCredentialReloadConfig config(std::move(interface)); + std::unique_ptr test_credential_reload( + new TestTlsCredentialReload()); + TlsCredentialReloadConfig config(std::move(test_credential_reload)); grpc_tls_credential_reload_arg c_arg; - TlsCredentialReloadArg arg(&c_arg); - arg.set_cb_user_data(static_cast(nullptr)); + std::unique_ptr arg( new TlsCredentialReloadArg(&c_arg)); + arg->set_cb_user_data(static_cast(nullptr)); std::shared_ptr key_materials_config( new TlsKeyMaterialsConfig()); struct TlsKeyMaterialsConfig::PemKeyCertPair pair1 = {"private_key1", @@ -358,19 +358,20 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { "cert_chain2"}; std::vector pair_list = {pair1, pair2}; key_materials_config->set_key_materials("pem_root_certs", pair_list); - arg.set_key_materials_config(key_materials_config); - arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); - arg.set_error_details("error_details"); + arg->set_key_materials_config(key_materials_config); + arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + arg->set_error_details("error_details"); grpc_tls_key_materials_config* key_materials_config_before_schedule = c_arg.key_materials_config; const char* error_details_before_schedule = c_arg.error_details; - int schedule_output = config.Schedule(&arg); + int schedule_output = config.Schedule(arg); + GPR_ASSERT(arg != nullptr); EXPECT_EQ(schedule_output, 0); - EXPECT_EQ(arg.cb_user_data(), nullptr); - EXPECT_STREQ(arg.key_materials_config()->pem_root_certs().c_str(), + EXPECT_EQ(arg->cb_user_data(), nullptr); + EXPECT_STREQ(arg->key_materials_config()->pem_root_certs().c_str(), "new_pem_root_certs"); - pair_list = arg.key_materials_config()->pem_key_cert_pair_list(); + pair_list = arg->key_materials_config()->pem_key_cert_pair_list(); EXPECT_EQ(static_cast(pair_list.size()), 3); EXPECT_STREQ(pair_list[0].private_key.c_str(), "private_key01"); EXPECT_STREQ(pair_list[0].cert_chain.c_str(), "cert_chain01"); @@ -378,8 +379,8 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { EXPECT_STREQ(pair_list[1].cert_chain.c_str(), "cert_chain2"); EXPECT_STREQ(pair_list[2].private_key.c_str(), "private_key3"); EXPECT_STREQ(pair_list[2].cert_chain.c_str(), "cert_chain3"); - EXPECT_EQ(arg.status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); - EXPECT_STREQ(arg.error_details().c_str(), "error_details"); + EXPECT_EQ(arg->status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + EXPECT_STREQ(arg->error_details().c_str(), "error_details"); // Cleanup. gpr_free(const_cast(error_details_before_schedule)); @@ -389,9 +390,9 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { } TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { - std::unique_ptr interface( - new TestTlsCredentialReloadInterface()); - TlsCredentialReloadConfig config(std::move(interface)); + std::unique_ptr test_credential_reload( + new TestTlsCredentialReload()); + TlsCredentialReloadConfig config(std::move(test_credential_reload)); grpc_tls_credential_reload_arg c_arg; c_arg.cb_user_data = static_cast(nullptr); grpc_tls_key_materials_config c_key_materials; @@ -483,32 +484,33 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { - std::unique_ptr interface( - new TestTlsServerAuthorizationCheckInterface()); - TlsServerAuthorizationCheckConfig config(std::move(interface)); + std::unique_ptr + test_server_authorization_check(new TestTlsServerAuthorizationCheck()); + TlsServerAuthorizationCheckConfig config( + std::move(test_server_authorization_check)); grpc_tls_server_authorization_check_arg c_arg; - TlsServerAuthorizationCheckArg arg(&c_arg); - arg.set_cb_user_data(nullptr); - arg.set_success(0); - arg.set_target_name("target_name"); - arg.set_peer_cert("peer_cert"); - arg.set_status(GRPC_STATUS_PERMISSION_DENIED); - arg.set_error_details("error_details"); + std::unique_ptr arg(new TlsServerAuthorizationCheckArg(&c_arg)); + arg->set_cb_user_data(nullptr); + arg->set_success(0); + arg->set_target_name("target_name"); + arg->set_peer_cert("peer_cert"); + arg->set_status(GRPC_STATUS_PERMISSION_DENIED); + arg->set_error_details("error_details"); const char* target_name_before_schedule = c_arg.target_name; const char* peer_cert_before_schedule = c_arg.peer_cert; const char* error_details_before_schedule = c_arg.error_details; - int schedule_output = config.Schedule(&arg); + int schedule_output = config.Schedule(arg); EXPECT_EQ(schedule_output, 1); - EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); - EXPECT_EQ(arg.success(), 1); - EXPECT_STREQ(arg.target_name().c_str(), "sync_target_name"); - EXPECT_STREQ(arg.peer_cert().c_str(), "sync_peer_cert"); - EXPECT_EQ(arg.status(), GRPC_STATUS_OK); - EXPECT_STREQ(arg.error_details().c_str(), "sync_error_details"); + EXPECT_STREQ(static_cast(arg->cb_user_data()), "cb_user_data"); + EXPECT_EQ(arg->success(), 1); + EXPECT_STREQ(arg->target_name().c_str(), "sync_target_name"); + EXPECT_STREQ(arg->peer_cert().c_str(), "sync_peer_cert"); + EXPECT_EQ(arg->status(), GRPC_STATUS_OK); + EXPECT_STREQ(arg->error_details().c_str(), "sync_error_details"); // Cleanup. - gpr_free(arg.cb_user_data()); + gpr_free(arg->cb_user_data()); gpr_free(const_cast(target_name_before_schedule)); gpr_free(const_cast(peer_cert_before_schedule)); gpr_free(const_cast(error_details_before_schedule)); @@ -519,9 +521,10 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { - std::unique_ptr interface( - new TestTlsServerAuthorizationCheckInterface()); - TlsServerAuthorizationCheckConfig config(std::move(interface)); + std::unique_ptr + test_server_authorization_check(new TestTlsServerAuthorizationCheck()); + TlsServerAuthorizationCheckConfig config( + std::move(test_server_authorization_check)); grpc_tls_server_authorization_check_arg c_arg; c_arg.cb = tls_server_authorization_check_callback; c_arg.cb_user_data = nullptr; @@ -568,17 +571,16 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { std::vector pair_list = {pair}; key_materials_config->set_key_materials("pem_root_certs", pair_list); - std::unique_ptr credential_reload_interface( - new TestTlsCredentialReloadInterface()); + std::unique_ptr test_credential_reload( + new TestTlsCredentialReload()); std::shared_ptr credential_reload_config( - new TlsCredentialReloadConfig(std::move(credential_reload_interface))); + new TlsCredentialReloadConfig(std::move(test_credential_reload))); - std::unique_ptr - server_authorization_check_interface( - new TestTlsServerAuthorizationCheckInterface()); + std::unique_ptr + test_server_authorization_check(new TestTlsServerAuthorizationCheck()); std::shared_ptr server_authorization_check_config(new TlsServerAuthorizationCheckConfig( - std::move(server_authorization_check_interface))); + std::move(test_server_authorization_check))); TlsCredentialsOptions options = TlsCredentialsOptions( GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, key_materials_config, @@ -666,17 +668,16 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { // This test demonstrates how the SPIFFE credentials will be used. TEST_F(CredentialsTest, LoadSpiffeChannelCredentials) { - std::unique_ptr credential_reload_interface( - new TestTlsCredentialReloadInterface()); + std::unique_ptr test_credential_reload( + new TestTlsCredentialReload()); std::shared_ptr credential_reload_config( - new TlsCredentialReloadConfig(std::move(credential_reload_interface))); + new TlsCredentialReloadConfig(std::move(test_credential_reload))); - std::unique_ptr - server_authorization_check_interface( - new TestTlsServerAuthorizationCheckInterface()); + std::unique_ptr + test_server_authorization_check(new TestTlsServerAuthorizationCheck()); std::shared_ptr server_authorization_check_config(new TlsServerAuthorizationCheckConfig( - std::move(server_authorization_check_interface))); + std::move(test_server_authorization_check))); TlsCredentialsOptions options = TlsCredentialsOptions( GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, nullptr, From 5639867c2bb3d957271d7f1498f9d8ad05be2930 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Fri, 20 Sep 2019 16:09:32 -0700 Subject: [PATCH 60/70] Clang changes. --- include/grpcpp/security/tls_credentials_options.h | 3 ++- src/cpp/common/tls_credentials_options_util.cc | 12 ++++++++---- test/cpp/client/credentials_test.cc | 6 ++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 71472fd6b4e..b93f3adea93 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -208,7 +208,8 @@ class TlsServerAuthorizationCheckArg { struct TlsServerAuthorizationCheckInterface { virtual ~TlsServerAuthorizationCheckInterface() = default; /** A callback that invokes the server authorization check. **/ - virtual int Schedule(std::unique_ptr& arg) = 0; + virtual int Schedule( + std::unique_ptr& arg) = 0; /** A callback that cancels a server authorization check request. **/ virtual void Cancel(std::unique_ptr& arg) {} /** A callback that cleans up any data associated to the diff --git a/src/cpp/common/tls_credentials_options_util.cc b/src/cpp/common/tls_credentials_options_util.cc index 90c2d73849d..3ef13930852 100644 --- a/src/cpp/common/tls_credentials_options_util.cc +++ b/src/cpp/common/tls_credentials_options_util.cc @@ -92,7 +92,8 @@ int TlsCredentialReloadConfigCSchedule(void* config_user_data, } TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); - std::unique_ptr cpp_arg(new TlsCredentialReloadArg(arg)); + std::unique_ptr cpp_arg( + new TlsCredentialReloadArg(arg)); return cpp_config->Schedule(cpp_arg); } @@ -105,7 +106,8 @@ void TlsCredentialReloadConfigCCancel(void* config_user_data, } TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); - std::unique_ptr cpp_arg(new TlsCredentialReloadArg(arg)); + std::unique_ptr cpp_arg( + new TlsCredentialReloadArg(arg)); cpp_config->Cancel(cpp_arg); } @@ -122,7 +124,8 @@ int TlsServerAuthorizationCheckConfigCSchedule( } TlsServerAuthorizationCheckConfig* cpp_config = static_cast(arg->config->context()); - std::unique_ptr cpp_arg(new TlsServerAuthorizationCheckArg(arg)); + std::unique_ptr cpp_arg( + new TlsServerAuthorizationCheckArg(arg)); return cpp_config->Schedule(cpp_arg); } @@ -136,7 +139,8 @@ void TlsServerAuthorizationCheckConfigCCancel( } TlsServerAuthorizationCheckConfig* cpp_config = static_cast(arg->config->context()); - std::unique_ptr cpp_arg(new TlsServerAuthorizationCheckArg(arg)); + std::unique_ptr cpp_arg( + new TlsServerAuthorizationCheckArg(arg)); cpp_config->Cancel(cpp_arg); } diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 026212532b1..efaa1f1e87d 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -348,7 +348,8 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { new TestTlsCredentialReload()); TlsCredentialReloadConfig config(std::move(test_credential_reload)); grpc_tls_credential_reload_arg c_arg; - std::unique_ptr arg( new TlsCredentialReloadArg(&c_arg)); + std::unique_ptr arg( + new TlsCredentialReloadArg(&c_arg)); arg->set_cb_user_data(static_cast(nullptr)); std::shared_ptr key_materials_config( new TlsKeyMaterialsConfig()); @@ -489,7 +490,8 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { TlsServerAuthorizationCheckConfig config( std::move(test_server_authorization_check)); grpc_tls_server_authorization_check_arg c_arg; - std::unique_ptr arg(new TlsServerAuthorizationCheckArg(&c_arg)); + std::unique_ptr arg( + new TlsServerAuthorizationCheckArg(&c_arg)); arg->set_cb_user_data(nullptr); arg->set_success(0); arg->set_target_name("target_name"); From 10a39b77c62aca84f1165e8b53c4825bb4b1b706 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 25 Sep 2019 10:46:13 -0700 Subject: [PATCH 61/70] Implemented changes outlined in addendum to design doc. --- include/grpc/grpc_security.h | 6 ++ .../grpcpp/security/tls_credentials_options.h | 29 +++----- src/cpp/common/tls_credentials_options.cc | 34 ++++++--- .../common/tls_credentials_options_util.cc | 34 ++++++--- src/cpp/common/tls_credentials_options_util.h | 4 +- test/cpp/client/credentials_test.cc | 74 ++++++++----------- 6 files changed, 96 insertions(+), 85 deletions(-) diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index 3918e45aa0b..4c1a2a02cbe 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -816,6 +816,8 @@ typedef void (*grpc_tls_on_credential_reload_done_cb)( errors occurred when a credential reload request is scheduled/cancelled. - config is a pointer to the unique grpc_tls_credential_reload_config instance that this argument corresponds to. + - context is a pointer to a wrapped language implementation of this + grpc_tls_credential_reload_arg instance. It is used for experimental purposes for now and subject to change. */ struct grpc_tls_credential_reload_arg { @@ -825,6 +827,7 @@ struct grpc_tls_credential_reload_arg { grpc_ssl_certificate_config_reload_status status; const char* error_details; grpc_tls_credential_reload_config* config; + void* context; }; /** Create a grpc_tls_credential_reload_config instance. @@ -884,6 +887,8 @@ typedef void (*grpc_tls_on_server_authorization_check_done_cb)( - config is a pointer to the unique grpc_tls_server_authorization_check_config instance that this argument corresponds to. + - context is a pointer to a wrapped language implementation of this + grpc_tls_server_authorization_check_arg instance. It is used for experimental purpose for now and subject to change. */ struct grpc_tls_server_authorization_check_arg { @@ -895,6 +900,7 @@ struct grpc_tls_server_authorization_check_arg { grpc_status_code status; const char* error_details; grpc_tls_server_authorization_check_config* config; + void* context; }; /** Create a grpc_tls_server_authorization_check_config instance. diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index b93f3adea93..24bfd2ccb8e 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -80,7 +80,7 @@ class TlsCredentialReloadArg { /** TlsCredentialReloadArg does not take ownership of the C arg that is passed * to the constructor. One must remember to free any memory allocated to the C * arg after using the setter functions below. **/ - TlsCredentialReloadArg(grpc_tls_credential_reload_arg* arg) : c_arg_(arg) {} + TlsCredentialReloadArg(grpc_tls_credential_reload_arg* arg); ~TlsCredentialReloadArg(); /** Getters for member fields. The callback function is not exposed. @@ -118,13 +118,9 @@ class TlsCredentialReloadArg { struct TlsCredentialReloadInterface { virtual ~TlsCredentialReloadInterface() = default; /** A callback that invokes the credential reload. **/ - virtual int Schedule(std::unique_ptr& arg) = 0; + virtual int Schedule(TlsCredentialReloadArg* arg) = 0; /** A callback that cancels a credential reload request. **/ - virtual void Cancel(std::unique_ptr& arg) {} - /** A callback that cleans up any data associated to the - * interface or the config. It will be called when the config is no longer - * using the interface. **/ - virtual void Release() {} + virtual void Cancel(TlsCredentialReloadArg* arg) {} }; /** TLS credential reloag config, wraps grpc_tls_credential_reload_config. It is @@ -136,11 +132,11 @@ class TlsCredentialReloadConfig { credential_reload_interface); ~TlsCredentialReloadConfig(); - int Schedule(std::unique_ptr& arg) const { + int Schedule(TlsCredentialReloadArg* arg) const { return credential_reload_interface_->Schedule(arg); } - void Cancel(std::unique_ptr& arg) const { + void Cancel(TlsCredentialReloadArg* arg) const { credential_reload_interface_->Cancel(arg); } @@ -166,8 +162,7 @@ class TlsServerAuthorizationCheckArg { /** TlsServerAuthorizationCheckArg does not take ownership of the C arg passed * to the constructor. One must remember to free any memory allocated to the * C arg after using the setter functions below. **/ - TlsServerAuthorizationCheckArg(grpc_tls_server_authorization_check_arg* arg) - : c_arg_(arg) {} + TlsServerAuthorizationCheckArg(grpc_tls_server_authorization_check_arg* arg); ~TlsServerAuthorizationCheckArg(); /** Getters for member fields. They return the corresponding fields of the @@ -208,13 +203,9 @@ class TlsServerAuthorizationCheckArg { struct TlsServerAuthorizationCheckInterface { virtual ~TlsServerAuthorizationCheckInterface() = default; /** A callback that invokes the server authorization check. **/ - virtual int Schedule( - std::unique_ptr& arg) = 0; + virtual int Schedule(TlsServerAuthorizationCheckArg* arg) = 0; /** A callback that cancels a server authorization check request. **/ - virtual void Cancel(std::unique_ptr& arg) {} - /** A callback that cleans up any data associated to the - * interface or the config. **/ - virtual void Release() {} + virtual void Cancel(TlsServerAuthorizationCheckArg* arg) {} }; /** TLS server authorization check config, wraps @@ -229,11 +220,11 @@ class TlsServerAuthorizationCheckConfig { server_authorization_check_interface); ~TlsServerAuthorizationCheckConfig(); - int Schedule(std::unique_ptr& arg) const { + int Schedule(TlsServerAuthorizationCheckArg* arg) const { return server_authorization_check_interface_->Schedule(arg); } - void Cancel(std::unique_ptr& arg) const { + void Cancel(TlsServerAuthorizationCheckArg* arg) const { server_authorization_check_interface_->Cancel(arg); } diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 3199317d030..6c77675bedb 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -33,7 +33,16 @@ void TlsKeyMaterialsConfig::set_key_materials( } /** TLS credential reload arg API implementation **/ -TlsCredentialReloadArg::~TlsCredentialReloadArg() {} +TlsCredentialReloadArg::TlsCredentialReloadArg( + grpc_tls_credential_reload_arg* arg) + : c_arg_(arg) { + if (c_arg_ != nullptr && c_arg_->context != nullptr) { + gpr_log(GPR_ERROR, "c_arg context has already been set"); + } + c_arg_->context = static_cast(this); +} + +TlsCredentialReloadArg::~TlsCredentialReloadArg() { c_arg_->context = nullptr; } void* TlsCredentialReloadArg::cb_user_data() const { return c_arg_->cb_user_data; @@ -95,14 +104,21 @@ TlsCredentialReloadConfig::TlsCredentialReloadConfig( c_config_->set_context(static_cast(this)); } -TlsCredentialReloadConfig::~TlsCredentialReloadConfig() { - if (credential_reload_interface_ != nullptr) { - credential_reload_interface_->Release(); +TlsCredentialReloadConfig::~TlsCredentialReloadConfig() {} + +/** gRPC TLS server authorization check arg API implementation **/ +TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg( + grpc_tls_server_authorization_check_arg* arg) + : c_arg_(arg) { + if (c_arg_ != nullptr && c_arg_->context != nullptr) { + gpr_log(GPR_ERROR, "c_arg context has already been set"); } + c_arg_->context = static_cast(this); } -/** gRPC TLS server authorization check arg API implementation **/ -TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() {} +TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() { + c_arg_->context = nullptr; +} void* TlsServerAuthorizationCheckArg::cb_user_data() const { return c_arg_->cb_user_data; @@ -176,11 +192,7 @@ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( c_config_->set_context(static_cast(this)); } -TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() { - if (server_authorization_check_interface_ != nullptr) { - server_authorization_check_interface_->Release(); - } -} +TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() {} /** gRPC TLS credential options API implementation **/ TlsCredentialsOptions::TlsCredentialsOptions( diff --git a/src/cpp/common/tls_credentials_options_util.cc b/src/cpp/common/tls_credentials_options_util.cc index 3ef13930852..d2cf845378b 100644 --- a/src/cpp/common/tls_credentials_options_util.cc +++ b/src/cpp/common/tls_credentials_options_util.cc @@ -92,9 +92,10 @@ int TlsCredentialReloadConfigCSchedule(void* config_user_data, } TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); - std::unique_ptr cpp_arg( - new TlsCredentialReloadArg(arg)); - return cpp_config->Schedule(cpp_arg); + TlsCredentialReloadArg* cpp_arg = new TlsCredentialReloadArg(arg); + int schedule_result = cpp_config->Schedule(cpp_arg); + delete cpp_arg; + return schedule_result; } void TlsCredentialReloadConfigCCancel(void* config_user_data, @@ -104,11 +105,16 @@ void TlsCredentialReloadConfigCCancel(void* config_user_data, gpr_log(GPR_ERROR, "credential reload arg was not properly initialized"); return; } + if (arg->context == nullptr) { + gpr_log(GPR_ERROR, "credential reload arg schedule has already completed"); + return; + } TlsCredentialReloadConfig* cpp_config = static_cast(arg->config->context()); - std::unique_ptr cpp_arg( - new TlsCredentialReloadArg(arg)); + TlsCredentialReloadArg* cpp_arg = + static_cast(arg->context); cpp_config->Cancel(cpp_arg); + delete cpp_arg; } /** The C schedule and cancel functions for the server authorization check @@ -124,9 +130,11 @@ int TlsServerAuthorizationCheckConfigCSchedule( } TlsServerAuthorizationCheckConfig* cpp_config = static_cast(arg->config->context()); - std::unique_ptr cpp_arg( - new TlsServerAuthorizationCheckArg(arg)); - return cpp_config->Schedule(cpp_arg); + TlsServerAuthorizationCheckArg* cpp_arg = + new TlsServerAuthorizationCheckArg(arg); + int schedule_result = cpp_config->Schedule(cpp_arg); + delete cpp_arg; + return schedule_result; } void TlsServerAuthorizationCheckConfigCCancel( @@ -137,11 +145,17 @@ void TlsServerAuthorizationCheckConfigCCancel( "server authorization check arg was not properly initialized"); return; } + if (arg->context == nullptr) { + gpr_log(GPR_ERROR, + "server authorization check arg schedule has already completed"); + return; + } TlsServerAuthorizationCheckConfig* cpp_config = static_cast(arg->config->context()); - std::unique_ptr cpp_arg( - new TlsServerAuthorizationCheckArg(arg)); + TlsServerAuthorizationCheckArg* cpp_arg = + static_cast(arg->context); cpp_config->Cancel(cpp_arg); + delete cpp_arg; } } // namespace experimental diff --git a/src/cpp/common/tls_credentials_options_util.h b/src/cpp/common/tls_credentials_options_util.h index 9d5b048ede4..5fadc83090b 100644 --- a/src/cpp/common/tls_credentials_options_util.h +++ b/src/cpp/common/tls_credentials_options_util.h @@ -35,7 +35,9 @@ std::shared_ptr ConvertToCppKeyMaterialsConfig( const grpc_tls_key_materials_config* config); /** The following 4 functions convert the user-provided schedule or cancel - * functions into C style schedule or cancel functions. **/ + * functions into C style schedule or cancel functions. These are internal + * functions, not meant to be accessed by the user. They are exposed for + * testing purposes only. **/ int TlsCredentialReloadConfigCSchedule(void* config_user_data, grpc_tls_credential_reload_arg* arg); diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index efaa1f1e87d..fcb7355ba66 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -51,7 +51,7 @@ static void tls_credential_reload_callback( } class TestTlsCredentialReload : public TlsCredentialReloadInterface { - int Schedule(std::unique_ptr& arg) override { + int Schedule(TlsCredentialReloadArg* arg) override { GPR_ASSERT(arg != nullptr); struct TlsKeyMaterialsConfig::PemKeyCertPair pair3 = {"private_key3", "cert_chain3"}; @@ -69,7 +69,7 @@ class TestTlsCredentialReload : public TlsCredentialReloadInterface { return 0; } - void Cancel(std::unique_ptr& arg) override { + void Cancel(TlsCredentialReloadArg* arg) override { GPR_ASSERT(arg != nullptr); arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); arg->set_error_details("cancelled"); @@ -90,7 +90,7 @@ static void tls_server_authorization_check_callback( class TestTlsServerAuthorizationCheck : public TlsServerAuthorizationCheckInterface { - int Schedule(std::unique_ptr& arg) override { + int Schedule(TlsServerAuthorizationCheckArg* arg) override { GPR_ASSERT(arg != nullptr); grpc::string cb_user_data = "cb_user_data"; arg->set_cb_user_data(static_cast(gpr_strdup(cb_user_data.c_str()))); @@ -102,7 +102,7 @@ class TestTlsServerAuthorizationCheck return 1; } - void Cancel(std::unique_ptr& arg) override { + void Cancel(TlsServerAuthorizationCheckArg* arg) override { GPR_ASSERT(arg != nullptr); arg->set_status(GRPC_STATUS_PERMISSION_DENIED); arg->set_error_details("cancelled"); @@ -348,9 +348,8 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { new TestTlsCredentialReload()); TlsCredentialReloadConfig config(std::move(test_credential_reload)); grpc_tls_credential_reload_arg c_arg; - std::unique_ptr arg( - new TlsCredentialReloadArg(&c_arg)); - arg->set_cb_user_data(static_cast(nullptr)); + TlsCredentialReloadArg arg(&c_arg); + arg.set_cb_user_data(static_cast(nullptr)); std::shared_ptr key_materials_config( new TlsKeyMaterialsConfig()); struct TlsKeyMaterialsConfig::PemKeyCertPair pair1 = {"private_key1", @@ -359,20 +358,19 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { "cert_chain2"}; std::vector pair_list = {pair1, pair2}; key_materials_config->set_key_materials("pem_root_certs", pair_list); - arg->set_key_materials_config(key_materials_config); - arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); - arg->set_error_details("error_details"); + arg.set_key_materials_config(key_materials_config); + arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + arg.set_error_details("error_details"); grpc_tls_key_materials_config* key_materials_config_before_schedule = c_arg.key_materials_config; const char* error_details_before_schedule = c_arg.error_details; - int schedule_output = config.Schedule(arg); - GPR_ASSERT(arg != nullptr); + int schedule_output = config.Schedule(&arg); EXPECT_EQ(schedule_output, 0); - EXPECT_EQ(arg->cb_user_data(), nullptr); - EXPECT_STREQ(arg->key_materials_config()->pem_root_certs().c_str(), + EXPECT_EQ(arg.cb_user_data(), nullptr); + EXPECT_STREQ(arg.key_materials_config()->pem_root_certs().c_str(), "new_pem_root_certs"); - pair_list = arg->key_materials_config()->pem_key_cert_pair_list(); + pair_list = arg.key_materials_config()->pem_key_cert_pair_list(); EXPECT_EQ(static_cast(pair_list.size()), 3); EXPECT_STREQ(pair_list[0].private_key.c_str(), "private_key01"); EXPECT_STREQ(pair_list[0].cert_chain.c_str(), "cert_chain01"); @@ -380,8 +378,8 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { EXPECT_STREQ(pair_list[1].cert_chain.c_str(), "cert_chain2"); EXPECT_STREQ(pair_list[2].private_key.c_str(), "private_key3"); EXPECT_STREQ(pair_list[2].cert_chain.c_str(), "cert_chain3"); - EXPECT_EQ(arg->status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); - EXPECT_STREQ(arg->error_details().c_str(), "error_details"); + EXPECT_EQ(arg.status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + EXPECT_STREQ(arg.error_details().c_str(), "error_details"); // Cleanup. gpr_free(const_cast(error_details_before_schedule)); @@ -437,13 +435,8 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { grpc_tls_key_materials_config* key_materials_config_after_schedule = c_arg.key_materials_config; - c_config->Cancel(&c_arg); - EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); - EXPECT_STREQ(c_arg.error_details, "cancelled"); - // Cleanup. ::grpc_core::Delete(key_materials_config_after_schedule); - gpr_free(const_cast(c_arg.error_details)); ::grpc_core::Delete(config.c_config()); } @@ -490,29 +483,28 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { TlsServerAuthorizationCheckConfig config( std::move(test_server_authorization_check)); grpc_tls_server_authorization_check_arg c_arg; - std::unique_ptr arg( - new TlsServerAuthorizationCheckArg(&c_arg)); - arg->set_cb_user_data(nullptr); - arg->set_success(0); - arg->set_target_name("target_name"); - arg->set_peer_cert("peer_cert"); - arg->set_status(GRPC_STATUS_PERMISSION_DENIED); - arg->set_error_details("error_details"); + TlsServerAuthorizationCheckArg arg(&c_arg); + arg.set_cb_user_data(nullptr); + arg.set_success(0); + arg.set_target_name("target_name"); + arg.set_peer_cert("peer_cert"); + arg.set_status(GRPC_STATUS_PERMISSION_DENIED); + arg.set_error_details("error_details"); const char* target_name_before_schedule = c_arg.target_name; const char* peer_cert_before_schedule = c_arg.peer_cert; const char* error_details_before_schedule = c_arg.error_details; - int schedule_output = config.Schedule(arg); + int schedule_output = config.Schedule(&arg); EXPECT_EQ(schedule_output, 1); - EXPECT_STREQ(static_cast(arg->cb_user_data()), "cb_user_data"); - EXPECT_EQ(arg->success(), 1); - EXPECT_STREQ(arg->target_name().c_str(), "sync_target_name"); - EXPECT_STREQ(arg->peer_cert().c_str(), "sync_peer_cert"); - EXPECT_EQ(arg->status(), GRPC_STATUS_OK); - EXPECT_STREQ(arg->error_details().c_str(), "sync_error_details"); + EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); + EXPECT_EQ(arg.success(), 1); + EXPECT_STREQ(arg.target_name().c_str(), "sync_target_name"); + EXPECT_STREQ(arg.peer_cert().c_str(), "sync_peer_cert"); + EXPECT_EQ(arg.status(), GRPC_STATUS_OK); + EXPECT_STREQ(arg.error_details().c_str(), "sync_error_details"); // Cleanup. - gpr_free(arg->cb_user_data()); + gpr_free(arg.cb_user_data()); gpr_free(const_cast(target_name_before_schedule)); gpr_free(const_cast(peer_cert_before_schedule)); gpr_free(const_cast(error_details_before_schedule)); @@ -547,18 +539,12 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { const char* target_name_after_schedule = c_arg.target_name; const char* peer_cert_after_schedule = c_arg.peer_cert; - const char* error_details_after_schedule = c_arg.error_details; - - (c_arg.config)->Cancel(&c_arg); - EXPECT_EQ(c_arg.status, GRPC_STATUS_PERMISSION_DENIED); - EXPECT_STREQ(c_arg.error_details, "cancelled"); // Cleanup. gpr_free(c_arg.cb_user_data); gpr_free(const_cast(c_arg.error_details)); gpr_free(const_cast(target_name_after_schedule)); gpr_free(const_cast(peer_cert_after_schedule)); - gpr_free(const_cast(error_details_after_schedule)); ::grpc_core::Delete(config.c_config()); } From a7f9d943d5cd6d3bf9dadb3a2cfbc307e9394913 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Thu, 26 Sep 2019 18:13:59 -0700 Subject: [PATCH 62/70] First set of small changes from development of e2e tests. --- .../grpcpp/security/tls_credentials_options.h | 33 +++++++++++---- .../tls/grpc_tls_credentials_options.h | 6 +++ src/cpp/common/tls_credentials_options.cc | 41 ++++++++++++------ .../common/tls_credentials_options_util.cc | 24 ----------- src/cpp/common/tls_credentials_options_util.h | 5 +-- test/cpp/client/credentials_test.cc | 42 ++++++++++--------- 6 files changed, 84 insertions(+), 67 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 24bfd2ccb8e..83535bc5701 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -57,6 +57,8 @@ class TlsKeyMaterialsConfig { /** Setter for key materials that will be called by the user. The setter * transfers ownership of the arguments to the config. **/ + void set_pem_root_certs(grpc::string pem_root_certs); + void add_pem_key_cert_pair(PemKeyCertPair pem_key_cert_pair); void set_key_materials(grpc::string pem_root_certs, std::vector pem_key_cert_pair_list); void set_version(int version) { version_ = version; }; @@ -88,7 +90,7 @@ class TlsCredentialReloadArg { * of the key materials config, it creates a new instance of the C++ key * materials config from the underlying C grpc_tls_key_materials_config. **/ void* cb_user_data() const; - std::shared_ptr key_materials_config() const; + bool is_pem_key_cert_pair_list_empty() const; grpc_ssl_certificate_config_reload_status status() const; grpc::string error_details() const; @@ -99,6 +101,8 @@ class TlsCredentialReloadArg { * setter function. * **/ void set_cb_user_data(void* cb_user_data); + void set_pem_root_certs(grpc::string pem_root_certs); + void add_pem_key_cert_pair(TlsKeyMaterialsConfig::PemKeyCertPair pem_key_cert_pair); void set_key_materials_config( const std::shared_ptr& key_materials_config); void set_status(grpc_ssl_certificate_config_reload_status status); @@ -127,16 +131,23 @@ struct TlsCredentialReloadInterface { * used for experimental purposes for now and it is subject to change. **/ class TlsCredentialReloadConfig { public: - /** The config takes ownership of the credential reload interface. **/ - TlsCredentialReloadConfig(std::unique_ptr + TlsCredentialReloadConfig(std::shared_ptr credential_reload_interface); ~TlsCredentialReloadConfig(); int Schedule(TlsCredentialReloadArg* arg) const { + if (credential_reload_interface_ == nullptr) { + gpr_log(GPR_ERROR, "credential reload interface is nullptr"); + return 1; + } return credential_reload_interface_->Schedule(arg); } void Cancel(TlsCredentialReloadArg* arg) const { + if (credential_reload_interface_ == nullptr) { + gpr_log(GPR_ERROR, "credential reload interface is nullptr"); + return; + } credential_reload_interface_->Cancel(arg); } @@ -145,7 +156,7 @@ class TlsCredentialReloadConfig { private: grpc_tls_credential_reload_config* c_config_; - std::unique_ptr credential_reload_interface_; + std::shared_ptr credential_reload_interface_; }; /** TLS server authorization check arguments, wraps @@ -213,18 +224,24 @@ struct TlsServerAuthorizationCheckInterface { * purposes for now and it is subject to change. **/ class TlsServerAuthorizationCheckConfig { public: - /** The config takes ownership of the server authorization check interface. - * **/ TlsServerAuthorizationCheckConfig( - std::unique_ptr + std::shared_ptr server_authorization_check_interface); ~TlsServerAuthorizationCheckConfig(); int Schedule(TlsServerAuthorizationCheckArg* arg) const { + if (server_authorization_check_interface_ == nullptr) { + gpr_log(GPR_ERROR, "server authorization check interface is nullptr"); + return 1; + } return server_authorization_check_interface_->Schedule(arg); } void Cancel(TlsServerAuthorizationCheckArg* arg) const { + if (server_authorization_check_interface_ == nullptr) { + gpr_log(GPR_ERROR, "server authorization check interface is nullptr"); + return; + } server_authorization_check_interface_->Cancel(arg); } @@ -235,7 +252,7 @@ class TlsServerAuthorizationCheckConfig { private: grpc_tls_server_authorization_check_config* c_config_; - std::unique_ptr + std::shared_ptr server_authorization_check_interface_; }; diff --git a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h index d2b2a80ec1d..b9ee16c2f1e 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +++ b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h @@ -42,6 +42,12 @@ struct grpc_tls_key_materials_config int version() const { return version_; } /** Setters for member fields. **/ + void set_pem_root_certs(grpc_core::UniquePtr pem_root_certs) { + pem_root_certs_ = std::move(pem_root_certs); + } + void add_pem_key_cert_pair(grpc_core::PemKeyCertPair pem_key_cert_pair) { + pem_key_cert_pair_list_.push_back(pem_key_cert_pair); + } void set_key_materials(grpc_core::UniquePtr pem_root_certs, PemKeyCertPairList pem_key_cert_pair_list); void set_version(int version) { version_ = version; } diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 6c77675bedb..aa052fa5027 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -25,6 +25,14 @@ namespace grpc_impl { namespace experimental { /** TLS key materials config API implementation **/ +void TlsKeyMaterialsConfig::set_pem_root_certs(grpc::string pem_root_certs) { + pem_root_certs_ = std::move(pem_root_certs); +} + +void TlsKeyMaterialsConfig::add_pem_key_cert_pair(PemKeyCertPair pem_key_cert_pair) { + pem_key_cert_pair_list_.push_back(pem_key_cert_pair); +} + void TlsKeyMaterialsConfig::set_key_materials( grpc::string pem_root_certs, std::vector pem_key_cert_pair_list) { @@ -51,11 +59,6 @@ void* TlsCredentialReloadArg::cb_user_data() const { /** This function creates a new TlsKeyMaterialsConfig instance whose fields are * not shared with the corresponding key materials config fields of the * TlsCredentialReloadArg instance. **/ -std::shared_ptr -TlsCredentialReloadArg::key_materials_config() const { - return ConvertToCppKeyMaterialsConfig(c_arg_->key_materials_config); -} - grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() const { return c_arg_->status; @@ -70,6 +73,20 @@ void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { c_arg_->cb_user_data = cb_user_data; } +void TlsCredentialReloadArg::set_pem_root_certs(grpc::string pem_root_certs) { + ::grpc_core::UniquePtr c_pem_root_certs(gpr_strdup(pem_root_certs.c_str())); + c_arg_->key_materials_config->set_pem_root_certs(std::move(c_pem_root_certs)); +} + +void TlsCredentialReloadArg::add_pem_key_cert_pair(TlsKeyMaterialsConfig::PemKeyCertPair pem_key_cert_pair) { + grpc_ssl_pem_key_cert_pair* ssl_pair = (grpc_ssl_pem_key_cert_pair*)gpr_malloc(sizeof(grpc_ssl_pem_key_cert_pair)); + ssl_pair->private_key = gpr_strdup(pem_key_cert_pair.private_key.c_str()); + ssl_pair->cert_chain = gpr_strdup(pem_key_cert_pair.cert_chain.c_str()); + ::grpc_core::PemKeyCertPair c_pem_key_cert_pair = + ::grpc_core::PemKeyCertPair(ssl_pair); + c_arg_->key_materials_config->add_pem_key_cert_pair(c_pem_key_cert_pair); +} + void TlsCredentialReloadArg::set_key_materials_config( const std::shared_ptr& key_materials_config) { c_arg_->key_materials_config = @@ -96,8 +113,8 @@ void TlsCredentialReloadArg::OnCredentialReloadDoneCallback() { /** gRPC TLS credential reload config API implementation **/ TlsCredentialReloadConfig::TlsCredentialReloadConfig( - std::unique_ptr credential_reload_interface) - : credential_reload_interface_(std::move(credential_reload_interface)) { + std::shared_ptr credential_reload_interface) + : credential_reload_interface_(credential_reload_interface) { c_config_ = grpc_tls_credential_reload_config_create( nullptr, &TlsCredentialReloadConfigCSchedule, &TlsCredentialReloadConfigCCancel, nullptr); @@ -182,10 +199,10 @@ void TlsServerAuthorizationCheckArg::OnServerAuthorizationCheckDoneCallback() { /** gRPC TLS server authorization check config API implementation. **/ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( - std::unique_ptr + std::shared_ptr server_authorization_check_interface) : server_authorization_check_interface_( - std::move(server_authorization_check_interface)) { + server_authorization_check_interface) { c_config_ = grpc_tls_server_authorization_check_config_create( nullptr, &TlsServerAuthorizationCheckConfigCSchedule, &TlsServerAuthorizationCheckConfigCCancel, nullptr); @@ -202,10 +219,10 @@ TlsCredentialsOptions::TlsCredentialsOptions( std::shared_ptr server_authorization_check_config) : cert_request_type_(cert_request_type), - key_materials_config_(std::move(key_materials_config)), - credential_reload_config_(std::move(credential_reload_config)), + key_materials_config_(key_materials_config), + credential_reload_config_(credential_reload_config), server_authorization_check_config_( - std::move(server_authorization_check_config)) { + server_authorization_check_config) { c_credentials_options_ = grpc_tls_credentials_options_create(); grpc_tls_credentials_options_set_cert_request_type(c_credentials_options_, cert_request_type_); diff --git a/src/cpp/common/tls_credentials_options_util.cc b/src/cpp/common/tls_credentials_options_util.cc index d2cf845378b..0f644638d75 100644 --- a/src/cpp/common/tls_credentials_options_util.cc +++ b/src/cpp/common/tls_credentials_options_util.cc @@ -56,30 +56,6 @@ grpc_tls_key_materials_config* ConvertToCKeyMaterialsConfig( return c_config; } -/** Converts the C key materials config to a Cpp key materials config; it - * allocates memory for the Cpp config. **/ -std::shared_ptr ConvertToCppKeyMaterialsConfig( - const grpc_tls_key_materials_config* config) { - if (config == nullptr) { - return nullptr; - } - std::shared_ptr cpp_config( - new TlsKeyMaterialsConfig()); - std::vector cpp_pem_key_cert_pair_list; - grpc_tls_key_materials_config::PemKeyCertPairList pem_key_cert_pair_list = - config->pem_key_cert_pair_list(); - for (size_t i = 0; i < pem_key_cert_pair_list.size(); i++) { - ::grpc_core::PemKeyCertPair key_cert_pair = pem_key_cert_pair_list[i]; - TlsKeyMaterialsConfig::PemKeyCertPair p = {key_cert_pair.private_key(), - key_cert_pair.cert_chain()}; - cpp_pem_key_cert_pair_list.push_back(::std::move(p)); - } - cpp_config->set_key_materials(std::move(config->pem_root_certs()), - std::move(cpp_pem_key_cert_pair_list)); - cpp_config->set_version(config->version()); - return cpp_config; -} - /** The C schedule and cancel functions for the credential reload config. * They populate a C credential reload arg with the result of a C++ credential * reload schedule/cancel API. **/ diff --git a/src/cpp/common/tls_credentials_options_util.h b/src/cpp/common/tls_credentials_options_util.h index 5fadc83090b..d5e20846254 100644 --- a/src/cpp/common/tls_credentials_options_util.h +++ b/src/cpp/common/tls_credentials_options_util.h @@ -27,13 +27,10 @@ namespace grpc_impl { namespace experimental { -/** The following 2 functions are exposed for testing purposes. **/ +/** The following function is exposed for testing purposes. **/ grpc_tls_key_materials_config* ConvertToCKeyMaterialsConfig( const std::shared_ptr& config); -std::shared_ptr ConvertToCppKeyMaterialsConfig( - const grpc_tls_key_materials_config* config); - /** The following 4 functions convert the user-provided schedule or cancel * functions into C style schedule or cancel functions. These are internal * functions, not meant to be accessed by the user. They are exposed for diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index fcb7355ba66..979bc63fdd0 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -55,16 +55,18 @@ class TestTlsCredentialReload : public TlsCredentialReloadInterface { GPR_ASSERT(arg != nullptr); struct TlsKeyMaterialsConfig::PemKeyCertPair pair3 = {"private_key3", "cert_chain3"}; - std::shared_ptr key_materials_config = - arg->key_materials_config(); - GPR_ASSERT(key_materials_config != nullptr); - std::vector pair_list = - key_materials_config->pem_key_cert_pair_list(); + //std::shared_ptr key_materials_config = + // arg->key_materials_config(); + //GPR_ASSERT(key_materials_config != nullptr); + //std::vector pair_list = + // key_materials_config->pem_key_cert_pair_list(); pair_list.push_back(pair3); - pair_list[0].private_key = "private_key01"; - pair_list[0].cert_chain = "cert_chain01"; - key_materials_config->set_key_materials("new_pem_root_certs", pair_list); - arg->set_key_materials_config(key_materials_config); + //pair_list[0].private_key = "private_key01"; + //pair_list[0].cert_chain = "cert_chain01"; + //key_materials_config->set_key_materials("new_pem_root_certs", pair_list); + //arg->set_key_materials_config(key_materials_config); + arg->set_pem_root_certs("new_pem_root_certs"); + arg->add_pem_key_cert_pair(pair3); arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); return 0; } @@ -302,6 +304,7 @@ TEST_F(CredentialsTest, TlsKeyMaterialsConfigCppToC) { gpr_free(c_config); } +/** TEST_F(CredentialsTest, TlsKeyMaterialsCtoCpp) { grpc_tls_key_materials_config c_config; grpc::string test_private_key = "private_key"; @@ -328,6 +331,7 @@ TEST_F(CredentialsTest, TlsKeyMaterialsCtoCpp) { EXPECT_STREQ("private_key", cpp_pair_list[0].private_key.c_str()); EXPECT_STREQ("cert_chain", cpp_pair_list[0].cert_chain.c_str()); } +**/ typedef class ::grpc_impl::experimental::TlsCredentialReloadArg TlsCredentialReloadArg; @@ -344,7 +348,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { } TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { - std::unique_ptr test_credential_reload( + std::shared_ptr test_credential_reload( new TestTlsCredentialReload()); TlsCredentialReloadConfig config(std::move(test_credential_reload)); grpc_tls_credential_reload_arg c_arg; @@ -368,9 +372,9 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { int schedule_output = config.Schedule(&arg); EXPECT_EQ(schedule_output, 0); EXPECT_EQ(arg.cb_user_data(), nullptr); - EXPECT_STREQ(arg.key_materials_config()->pem_root_certs().c_str(), + EXPECT_STREQ(c_arg.key_materials_config->pem_root_certs().get(), "new_pem_root_certs"); - pair_list = arg.key_materials_config()->pem_key_cert_pair_list(); + pair_list = c_arg.key_materials_config->pem_key_cert_pair_list(); EXPECT_EQ(static_cast(pair_list.size()), 3); EXPECT_STREQ(pair_list[0].private_key.c_str(), "private_key01"); EXPECT_STREQ(pair_list[0].cert_chain.c_str(), "cert_chain01"); @@ -389,7 +393,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { } TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { - std::unique_ptr test_credential_reload( + std::shared_ptr test_credential_reload( new TestTlsCredentialReload()); TlsCredentialReloadConfig config(std::move(test_credential_reload)); grpc_tls_credential_reload_arg c_arg; @@ -478,7 +482,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { - std::unique_ptr + std::shared_ptr test_server_authorization_check(new TestTlsServerAuthorizationCheck()); TlsServerAuthorizationCheckConfig config( std::move(test_server_authorization_check)); @@ -515,7 +519,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { - std::unique_ptr + std::shared_ptr test_server_authorization_check(new TestTlsServerAuthorizationCheck()); TlsServerAuthorizationCheckConfig config( std::move(test_server_authorization_check)); @@ -559,12 +563,12 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { std::vector pair_list = {pair}; key_materials_config->set_key_materials("pem_root_certs", pair_list); - std::unique_ptr test_credential_reload( + std::shared_ptr test_credential_reload( new TestTlsCredentialReload()); std::shared_ptr credential_reload_config( new TlsCredentialReloadConfig(std::move(test_credential_reload))); - std::unique_ptr + std::shared_ptr test_server_authorization_check(new TestTlsServerAuthorizationCheck()); std::shared_ptr server_authorization_check_config(new TlsServerAuthorizationCheckConfig( @@ -656,12 +660,12 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { // This test demonstrates how the SPIFFE credentials will be used. TEST_F(CredentialsTest, LoadSpiffeChannelCredentials) { - std::unique_ptr test_credential_reload( + std::shared_ptr test_credential_reload( new TestTlsCredentialReload()); std::shared_ptr credential_reload_config( new TlsCredentialReloadConfig(std::move(test_credential_reload))); - std::unique_ptr + std::shared_ptr test_server_authorization_check(new TestTlsServerAuthorizationCheck()); std::shared_ptr server_authorization_check_config(new TlsServerAuthorizationCheckConfig( From d866d09b5c38e923210a6d7843f5e238ad86c12e Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Thu, 26 Sep 2019 21:26:57 -0700 Subject: [PATCH 63/70] Second round of small changes from e2e tests. --- include/grpc/grpc_security.h | 8 +- .../grpcpp/security/tls_credentials_options.h | 3 +- src/cpp/common/tls_credentials_options.cc | 18 ++-- test/cpp/client/credentials_test.cc | 87 +++++-------------- 4 files changed, 39 insertions(+), 77 deletions(-) diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index 4c1a2a02cbe..57d780dfa87 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -826,8 +826,8 @@ struct grpc_tls_credential_reload_arg { grpc_tls_key_materials_config* key_materials_config; grpc_ssl_certificate_config_reload_status status; const char* error_details; - grpc_tls_credential_reload_config* config; - void* context; + grpc_tls_credential_reload_config* config = nullptr; + void* context = nullptr; }; /** Create a grpc_tls_credential_reload_config instance. @@ -899,8 +899,8 @@ struct grpc_tls_server_authorization_check_arg { const char* peer_cert; grpc_status_code status; const char* error_details; - grpc_tls_server_authorization_check_config* config; - void* context; + grpc_tls_server_authorization_check_config* config = nullptr; + void* context = nullptr; }; /** Create a grpc_tls_server_authorization_check_config instance. diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 83535bc5701..107d00fbbe4 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -102,7 +102,8 @@ class TlsCredentialReloadArg { * **/ void set_cb_user_data(void* cb_user_data); void set_pem_root_certs(grpc::string pem_root_certs); - void add_pem_key_cert_pair(TlsKeyMaterialsConfig::PemKeyCertPair pem_key_cert_pair); + void add_pem_key_cert_pair( + TlsKeyMaterialsConfig::PemKeyCertPair pem_key_cert_pair); void set_key_materials_config( const std::shared_ptr& key_materials_config); void set_status(grpc_ssl_certificate_config_reload_status status); diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index aa052fa5027..198f4ce7375 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -29,7 +29,8 @@ void TlsKeyMaterialsConfig::set_pem_root_certs(grpc::string pem_root_certs) { pem_root_certs_ = std::move(pem_root_certs); } -void TlsKeyMaterialsConfig::add_pem_key_cert_pair(PemKeyCertPair pem_key_cert_pair) { +void TlsKeyMaterialsConfig::add_pem_key_cert_pair( + PemKeyCertPair pem_key_cert_pair) { pem_key_cert_pair_list_.push_back(pem_key_cert_pair); } @@ -74,16 +75,20 @@ void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { } void TlsCredentialReloadArg::set_pem_root_certs(grpc::string pem_root_certs) { - ::grpc_core::UniquePtr c_pem_root_certs(gpr_strdup(pem_root_certs.c_str())); + ::grpc_core::UniquePtr c_pem_root_certs( + gpr_strdup(pem_root_certs.c_str())); c_arg_->key_materials_config->set_pem_root_certs(std::move(c_pem_root_certs)); } -void TlsCredentialReloadArg::add_pem_key_cert_pair(TlsKeyMaterialsConfig::PemKeyCertPair pem_key_cert_pair) { - grpc_ssl_pem_key_cert_pair* ssl_pair = (grpc_ssl_pem_key_cert_pair*)gpr_malloc(sizeof(grpc_ssl_pem_key_cert_pair)); +void TlsCredentialReloadArg::add_pem_key_cert_pair( + TlsKeyMaterialsConfig::PemKeyCertPair pem_key_cert_pair) { + grpc_ssl_pem_key_cert_pair* ssl_pair = + (grpc_ssl_pem_key_cert_pair*)gpr_malloc( + sizeof(grpc_ssl_pem_key_cert_pair)); ssl_pair->private_key = gpr_strdup(pem_key_cert_pair.private_key.c_str()); ssl_pair->cert_chain = gpr_strdup(pem_key_cert_pair.cert_chain.c_str()); ::grpc_core::PemKeyCertPair c_pem_key_cert_pair = - ::grpc_core::PemKeyCertPair(ssl_pair); + ::grpc_core::PemKeyCertPair(ssl_pair); c_arg_->key_materials_config->add_pem_key_cert_pair(c_pem_key_cert_pair); } @@ -221,8 +226,7 @@ TlsCredentialsOptions::TlsCredentialsOptions( : cert_request_type_(cert_request_type), key_materials_config_(key_materials_config), credential_reload_config_(credential_reload_config), - server_authorization_check_config_( - server_authorization_check_config) { + server_authorization_check_config_(server_authorization_check_config) { c_credentials_options_ = grpc_tls_credentials_options_create(); grpc_tls_credentials_options_set_cert_request_type(c_credentials_options_, cert_request_type_); diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 979bc63fdd0..cba4e874442 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -55,16 +55,6 @@ class TestTlsCredentialReload : public TlsCredentialReloadInterface { GPR_ASSERT(arg != nullptr); struct TlsKeyMaterialsConfig::PemKeyCertPair pair3 = {"private_key3", "cert_chain3"}; - //std::shared_ptr key_materials_config = - // arg->key_materials_config(); - //GPR_ASSERT(key_materials_config != nullptr); - //std::vector pair_list = - // key_materials_config->pem_key_cert_pair_list(); - pair_list.push_back(pair3); - //pair_list[0].private_key = "private_key01"; - //pair_list[0].cert_chain = "cert_chain01"; - //key_materials_config->set_key_materials("new_pem_root_certs", pair_list); - //arg->set_key_materials_config(key_materials_config); arg->set_pem_root_certs("new_pem_root_certs"); arg->add_pem_key_cert_pair(pair3); arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); @@ -304,35 +294,6 @@ TEST_F(CredentialsTest, TlsKeyMaterialsConfigCppToC) { gpr_free(c_config); } -/** -TEST_F(CredentialsTest, TlsKeyMaterialsCtoCpp) { - grpc_tls_key_materials_config c_config; - grpc::string test_private_key = "private_key"; - grpc::string test_cert_chain = "cert_chain"; - grpc_ssl_pem_key_cert_pair* ssl_pair = - (grpc_ssl_pem_key_cert_pair*)gpr_malloc( - sizeof(grpc_ssl_pem_key_cert_pair)); - ssl_pair->private_key = gpr_strdup(test_private_key.c_str()); - ssl_pair->cert_chain = gpr_strdup(test_cert_chain.c_str()); - ::grpc_core::PemKeyCertPair pem_key_cert_pair = - ::grpc_core::PemKeyCertPair(ssl_pair); - ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> - pem_key_cert_pair_list; - pem_key_cert_pair_list.push_back(pem_key_cert_pair); - c_config.set_key_materials( - ::grpc_core::UniquePtr(gpr_strdup("pem_root_certs")), - pem_key_cert_pair_list); - std::shared_ptr cpp_config = - ::grpc_impl::experimental::ConvertToCppKeyMaterialsConfig(&c_config); - EXPECT_STREQ("pem_root_certs", cpp_config->pem_root_certs().c_str()); - std::vector cpp_pair_list = - cpp_config->pem_key_cert_pair_list(); - EXPECT_EQ(1, static_cast(cpp_pair_list.size())); - EXPECT_STREQ("private_key", cpp_pair_list[0].private_key.c_str()); - EXPECT_STREQ("cert_chain", cpp_pair_list[0].cert_chain.c_str()); -} -**/ - typedef class ::grpc_impl::experimental::TlsCredentialReloadArg TlsCredentialReloadArg; typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig @@ -350,7 +311,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { std::shared_ptr test_credential_reload( new TestTlsCredentialReload()); - TlsCredentialReloadConfig config(std::move(test_credential_reload)); + TlsCredentialReloadConfig config(test_credential_reload); grpc_tls_credential_reload_arg c_arg; TlsCredentialReloadArg arg(&c_arg); arg.set_cb_user_data(static_cast(nullptr)); @@ -372,22 +333,22 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { int schedule_output = config.Schedule(&arg); EXPECT_EQ(schedule_output, 0); EXPECT_EQ(arg.cb_user_data(), nullptr); - EXPECT_STREQ(c_arg.key_materials_config->pem_root_certs().get(), + EXPECT_STREQ(c_arg.key_materials_config->pem_root_certs(), "new_pem_root_certs"); - pair_list = c_arg.key_materials_config->pem_key_cert_pair_list(); - EXPECT_EQ(static_cast(pair_list.size()), 3); - EXPECT_STREQ(pair_list[0].private_key.c_str(), "private_key01"); - EXPECT_STREQ(pair_list[0].cert_chain.c_str(), "cert_chain01"); - EXPECT_STREQ(pair_list[1].private_key.c_str(), "private_key2"); - EXPECT_STREQ(pair_list[1].cert_chain.c_str(), "cert_chain2"); - EXPECT_STREQ(pair_list[2].private_key.c_str(), "private_key3"); - EXPECT_STREQ(pair_list[2].cert_chain.c_str(), "cert_chain3"); + grpc_tls_key_materials_config::PemKeyCertPairList c_pair_list = + c_arg.key_materials_config->pem_key_cert_pair_list(); + EXPECT_EQ(static_cast(c_pair_list.size()), 3); + EXPECT_STREQ(c_pair_list[0].private_key(), "private_key1"); + EXPECT_STREQ(c_pair_list[0].cert_chain(), "cert_chain1"); + EXPECT_STREQ(c_pair_list[1].private_key(), "private_key2"); + EXPECT_STREQ(c_pair_list[1].cert_chain(), "cert_chain2"); + EXPECT_STREQ(c_pair_list[2].private_key(), "private_key3"); + EXPECT_STREQ(c_pair_list[2].cert_chain(), "cert_chain3"); EXPECT_EQ(arg.status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); EXPECT_STREQ(arg.error_details().c_str(), "error_details"); // Cleanup. gpr_free(const_cast(error_details_before_schedule)); - ::grpc_core::Delete(key_materials_config_before_schedule); ::grpc_core::Delete(c_arg.key_materials_config); ::grpc_core::Delete(config.c_config()); } @@ -395,7 +356,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { std::shared_ptr test_credential_reload( new TestTlsCredentialReload()); - TlsCredentialReloadConfig config(std::move(test_credential_reload)); + TlsCredentialReloadConfig config(test_credential_reload); grpc_tls_credential_reload_arg c_arg; c_arg.cb_user_data = static_cast(nullptr); grpc_tls_key_materials_config c_key_materials; @@ -430,8 +391,8 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> pair_list = c_arg.key_materials_config->pem_key_cert_pair_list(); EXPECT_EQ(static_cast(pair_list.size()), 2); - EXPECT_STREQ(pair_list[0].private_key(), "private_key01"); - EXPECT_STREQ(pair_list[0].cert_chain(), "cert_chain01"); + EXPECT_STREQ(pair_list[0].private_key(), "private_key"); + EXPECT_STREQ(pair_list[0].cert_chain(), "cert_chain"); EXPECT_STREQ(pair_list[1].private_key(), "private_key3"); EXPECT_STREQ(pair_list[1].cert_chain(), "cert_chain3"); EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); @@ -440,7 +401,6 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { c_arg.key_materials_config; // Cleanup. - ::grpc_core::Delete(key_materials_config_after_schedule); ::grpc_core::Delete(config.c_config()); } @@ -484,8 +444,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { std::shared_ptr test_server_authorization_check(new TestTlsServerAuthorizationCheck()); - TlsServerAuthorizationCheckConfig config( - std::move(test_server_authorization_check)); + TlsServerAuthorizationCheckConfig config(test_server_authorization_check); grpc_tls_server_authorization_check_arg c_arg; TlsServerAuthorizationCheckArg arg(&c_arg); arg.set_cb_user_data(nullptr); @@ -521,8 +480,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { std::shared_ptr test_server_authorization_check(new TestTlsServerAuthorizationCheck()); - TlsServerAuthorizationCheckConfig config( - std::move(test_server_authorization_check)); + TlsServerAuthorizationCheckConfig config(test_server_authorization_check); grpc_tls_server_authorization_check_arg c_arg; c_arg.cb = tls_server_authorization_check_callback; c_arg.cb_user_data = nullptr; @@ -566,13 +524,13 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { std::shared_ptr test_credential_reload( new TestTlsCredentialReload()); std::shared_ptr credential_reload_config( - new TlsCredentialReloadConfig(std::move(test_credential_reload))); + new TlsCredentialReloadConfig(test_credential_reload)); std::shared_ptr test_server_authorization_check(new TestTlsServerAuthorizationCheck()); std::shared_ptr server_authorization_check_config(new TlsServerAuthorizationCheckConfig( - std::move(test_server_authorization_check))); + test_server_authorization_check)); TlsCredentialsOptions options = TlsCredentialsOptions( GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, key_materials_config, @@ -622,8 +580,8 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> c_pair_list = c_credential_reload_arg.key_materials_config->pem_key_cert_pair_list(); EXPECT_EQ(static_cast(c_pair_list.size()), 2); - EXPECT_STREQ(c_pair_list[0].private_key(), "private_key01"); - EXPECT_STREQ(c_pair_list[0].cert_chain(), "cert_chain01"); + EXPECT_STREQ(c_pair_list[0].private_key(), "private_key"); + EXPECT_STREQ(c_pair_list[0].cert_chain(), "cert_chain"); EXPECT_STREQ(c_pair_list[1].private_key(), "private_key3"); EXPECT_STREQ(c_pair_list[1].cert_chain(), "cert_chain3"); EXPECT_EQ(c_credential_reload_arg.status, @@ -647,7 +605,6 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { "sync_error_details"); // Cleanup. - ::grpc_core::Delete(c_key_materials_config); ::grpc_core::Delete(c_credential_reload_arg.key_materials_config); gpr_free(c_server_authorization_check_arg.cb_user_data); gpr_free(const_cast(c_server_authorization_check_arg.target_name)); @@ -663,13 +620,13 @@ TEST_F(CredentialsTest, LoadSpiffeChannelCredentials) { std::shared_ptr test_credential_reload( new TestTlsCredentialReload()); std::shared_ptr credential_reload_config( - new TlsCredentialReloadConfig(std::move(test_credential_reload))); + new TlsCredentialReloadConfig(test_credential_reload)); std::shared_ptr test_server_authorization_check(new TestTlsServerAuthorizationCheck()); std::shared_ptr server_authorization_check_config(new TlsServerAuthorizationCheckConfig( - std::move(test_server_authorization_check))); + test_server_authorization_check)); TlsCredentialsOptions options = TlsCredentialsOptions( GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, nullptr, From f503a60855c5476eb76a4d5342804c7e79f8c477 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Fri, 27 Sep 2019 09:00:05 -0700 Subject: [PATCH 64/70] Third --- include/grpc/grpc_security.h | 8 +++--- src/cpp/common/tls_credentials_options.cc | 32 +++++++++++++++++++---- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index 57d780dfa87..4c1a2a02cbe 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -826,8 +826,8 @@ struct grpc_tls_credential_reload_arg { grpc_tls_key_materials_config* key_materials_config; grpc_ssl_certificate_config_reload_status status; const char* error_details; - grpc_tls_credential_reload_config* config = nullptr; - void* context = nullptr; + grpc_tls_credential_reload_config* config; + void* context; }; /** Create a grpc_tls_credential_reload_config instance. @@ -899,8 +899,8 @@ struct grpc_tls_server_authorization_check_arg { const char* peer_cert; grpc_status_code status; const char* error_details; - grpc_tls_server_authorization_check_config* config = nullptr; - void* context = nullptr; + grpc_tls_server_authorization_check_config* config; + void* context; }; /** Create a grpc_tls_server_authorization_check_config instance. diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 198f4ce7375..fddf31a871f 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -57,9 +57,10 @@ void* TlsCredentialReloadArg::cb_user_data() const { return c_arg_->cb_user_data; } -/** This function creates a new TlsKeyMaterialsConfig instance whose fields are - * not shared with the corresponding key materials config fields of the - * TlsCredentialReloadArg instance. **/ +bool TlsCredentialReloadArg::is_pem_key_cert_pair_list_empty() const { + return c_arg_->key_materials_config->pem_key_cert_pair_list().empty(); +} + grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status() const { return c_arg_->status; @@ -94,8 +95,29 @@ void TlsCredentialReloadArg::add_pem_key_cert_pair( void TlsCredentialReloadArg::set_key_materials_config( const std::shared_ptr& key_materials_config) { - c_arg_->key_materials_config = - ConvertToCKeyMaterialsConfig(key_materials_config); + if (key_materials_config == nullptr) { + c_arg_->key_materials_config = nullptr; + return; + } + ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> + c_pem_key_cert_pair_list; + for (auto key_cert_pair = key_materials_config->pem_key_cert_pair_list().begin(); + key_cert_pair != key_materials_config->pem_key_cert_pair_list().end(); + key_cert_pair++) { + grpc_ssl_pem_key_cert_pair* ssl_pair = + (grpc_ssl_pem_key_cert_pair*)gpr_malloc( + sizeof(grpc_ssl_pem_key_cert_pair)); + ssl_pair->private_key = gpr_strdup(key_cert_pair->private_key.c_str()); + ssl_pair->cert_chain = gpr_strdup(key_cert_pair->cert_chain.c_str()); + ::grpc_core::PemKeyCertPair c_pem_key_cert_pair = + ::grpc_core::PemKeyCertPair(ssl_pair); + c_pem_key_cert_pair_list.push_back(::std::move(c_pem_key_cert_pair)); + } + ::grpc_core::UniquePtr c_pem_root_certs( + gpr_strdup(key_materials_config->pem_root_certs().c_str())); + c_arg_->key_materials_config->set_key_materials(std::move(c_pem_root_certs), + std::move(c_pem_key_cert_pair_list)); + c_arg_->key_materials_config->set_version(key_materials_config->version()); } void TlsCredentialReloadArg::set_status( From fba2fc2dba9ca9a5eb75b0e1971cc766faee16d6 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Fri, 27 Sep 2019 14:30:49 -0700 Subject: [PATCH 65/70] Fourth --- .../grpcpp/security/tls_credentials_options.h | 4 +- src/cpp/common/tls_credentials_options.cc | 37 +++--- test/cpp/client/credentials_test.cc | 112 ++++++++++-------- 3 files changed, 88 insertions(+), 65 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 107d00fbbe4..8cd17c03da4 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -58,7 +58,7 @@ class TlsKeyMaterialsConfig { /** Setter for key materials that will be called by the user. The setter * transfers ownership of the arguments to the config. **/ void set_pem_root_certs(grpc::string pem_root_certs); - void add_pem_key_cert_pair(PemKeyCertPair pem_key_cert_pair); + void add_pem_key_cert_pair(const PemKeyCertPair& pem_key_cert_pair); void set_key_materials(grpc::string pem_root_certs, std::vector pem_key_cert_pair_list); void set_version(int version) { version_ = version; }; @@ -101,7 +101,7 @@ class TlsCredentialReloadArg { * setter function. * **/ void set_cb_user_data(void* cb_user_data); - void set_pem_root_certs(grpc::string pem_root_certs); + void set_pem_root_certs(const grpc::string& pem_root_certs); void add_pem_key_cert_pair( TlsKeyMaterialsConfig::PemKeyCertPair pem_key_cert_pair); void set_key_materials_config( diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index fddf31a871f..39a1cf3a39d 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -30,7 +30,7 @@ void TlsKeyMaterialsConfig::set_pem_root_certs(grpc::string pem_root_certs) { } void TlsKeyMaterialsConfig::add_pem_key_cert_pair( - PemKeyCertPair pem_key_cert_pair) { + const PemKeyCertPair& pem_key_cert_pair) { pem_key_cert_pair_list_.push_back(pem_key_cert_pair); } @@ -51,7 +51,7 @@ TlsCredentialReloadArg::TlsCredentialReloadArg( c_arg_->context = static_cast(this); } -TlsCredentialReloadArg::~TlsCredentialReloadArg() { c_arg_->context = nullptr; } +TlsCredentialReloadArg::~TlsCredentialReloadArg() {} void* TlsCredentialReloadArg::cb_user_data() const { return c_arg_->cb_user_data; @@ -75,7 +75,8 @@ void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) { c_arg_->cb_user_data = cb_user_data; } -void TlsCredentialReloadArg::set_pem_root_certs(grpc::string pem_root_certs) { +void TlsCredentialReloadArg::set_pem_root_certs( + const grpc::string& pem_root_certs) { ::grpc_core::UniquePtr c_pem_root_certs( gpr_strdup(pem_root_certs.c_str())); c_arg_->key_materials_config->set_pem_root_certs(std::move(c_pem_root_certs)); @@ -90,7 +91,8 @@ void TlsCredentialReloadArg::add_pem_key_cert_pair( ssl_pair->cert_chain = gpr_strdup(pem_key_cert_pair.cert_chain.c_str()); ::grpc_core::PemKeyCertPair c_pem_key_cert_pair = ::grpc_core::PemKeyCertPair(ssl_pair); - c_arg_->key_materials_config->add_pem_key_cert_pair(c_pem_key_cert_pair); + c_arg_->key_materials_config->add_pem_key_cert_pair( + std::move(c_pem_key_cert_pair)); } void TlsCredentialReloadArg::set_key_materials_config( @@ -101,7 +103,8 @@ void TlsCredentialReloadArg::set_key_materials_config( } ::grpc_core::InlinedVector<::grpc_core::PemKeyCertPair, 1> c_pem_key_cert_pair_list; - for (auto key_cert_pair = key_materials_config->pem_key_cert_pair_list().begin(); + for (auto key_cert_pair = + key_materials_config->pem_key_cert_pair_list().begin(); key_cert_pair != key_materials_config->pem_key_cert_pair_list().end(); key_cert_pair++) { grpc_ssl_pem_key_cert_pair* ssl_pair = @@ -111,12 +114,15 @@ void TlsCredentialReloadArg::set_key_materials_config( ssl_pair->cert_chain = gpr_strdup(key_cert_pair->cert_chain.c_str()); ::grpc_core::PemKeyCertPair c_pem_key_cert_pair = ::grpc_core::PemKeyCertPair(ssl_pair); - c_pem_key_cert_pair_list.push_back(::std::move(c_pem_key_cert_pair)); + c_pem_key_cert_pair_list.emplace_back(std::move(c_pem_key_cert_pair)); } ::grpc_core::UniquePtr c_pem_root_certs( gpr_strdup(key_materials_config->pem_root_certs().c_str())); - c_arg_->key_materials_config->set_key_materials(std::move(c_pem_root_certs), - std::move(c_pem_key_cert_pair_list)); + if (c_arg_->key_materials_config == nullptr) { + c_arg_->key_materials_config = grpc_tls_key_materials_config_create(); + } + c_arg_->key_materials_config->set_key_materials( + std::move(c_pem_root_certs), std::move(c_pem_key_cert_pair_list)); c_arg_->key_materials_config->set_version(key_materials_config->version()); } @@ -141,7 +147,7 @@ void TlsCredentialReloadArg::OnCredentialReloadDoneCallback() { /** gRPC TLS credential reload config API implementation **/ TlsCredentialReloadConfig::TlsCredentialReloadConfig( std::shared_ptr credential_reload_interface) - : credential_reload_interface_(credential_reload_interface) { + : credential_reload_interface_(std::move(credential_reload_interface)) { c_config_ = grpc_tls_credential_reload_config_create( nullptr, &TlsCredentialReloadConfigCSchedule, &TlsCredentialReloadConfigCCancel, nullptr); @@ -160,9 +166,7 @@ TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg( c_arg_->context = static_cast(this); } -TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() { - c_arg_->context = nullptr; -} +TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() {} void* TlsServerAuthorizationCheckArg::cb_user_data() const { return c_arg_->cb_user_data; @@ -229,7 +233,7 @@ TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig( std::shared_ptr server_authorization_check_interface) : server_authorization_check_interface_( - server_authorization_check_interface) { + std::move(server_authorization_check_interface)) { c_config_ = grpc_tls_server_authorization_check_config_create( nullptr, &TlsServerAuthorizationCheckConfigCSchedule, &TlsServerAuthorizationCheckConfigCCancel, nullptr); @@ -246,9 +250,10 @@ TlsCredentialsOptions::TlsCredentialsOptions( std::shared_ptr server_authorization_check_config) : cert_request_type_(cert_request_type), - key_materials_config_(key_materials_config), - credential_reload_config_(credential_reload_config), - server_authorization_check_config_(server_authorization_check_config) { + key_materials_config_(std::move(key_materials_config)), + credential_reload_config_(std::move(credential_reload_config)), + server_authorization_check_config_( + std::move(server_authorization_check_config)) { c_credentials_options_ = grpc_tls_credentials_options_create(); grpc_tls_credentials_options_set_cert_request_type(c_credentials_options_, cert_request_type_); diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index cba4e874442..5c6b78a2b57 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -294,6 +294,20 @@ TEST_F(CredentialsTest, TlsKeyMaterialsConfigCppToC) { gpr_free(c_config); } +TEST_F(CredentialsTest, TlsKeyMaterialsModifiers) { + std::shared_ptr config(new TlsKeyMaterialsConfig()); + struct TlsKeyMaterialsConfig::PemKeyCertPair pair = {"private_key", + "cert_chain"}; + config->add_pem_key_cert_pair(pair); + config->set_pem_root_certs("pem_root_certs"); + EXPECT_STREQ(config->pem_root_certs().c_str(), "pem_root_certs"); + std::vector list = + config->pem_key_cert_pair_list(); + EXPECT_EQ(static_cast(list.size()), 1); + EXPECT_STREQ(list[0].private_key.c_str(), "private_key"); + EXPECT_STREQ(list[0].cert_chain.c_str(), "cert_chain"); +} + typedef class ::grpc_impl::experimental::TlsCredentialReloadArg TlsCredentialReloadArg; typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig @@ -311,10 +325,11 @@ TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { std::shared_ptr test_credential_reload( new TestTlsCredentialReload()); - TlsCredentialReloadConfig config(test_credential_reload); - grpc_tls_credential_reload_arg c_arg; - TlsCredentialReloadArg arg(&c_arg); - arg.set_cb_user_data(static_cast(nullptr)); + std::shared_ptr config( + new TlsCredentialReloadConfig(test_credential_reload)); + grpc_tls_credential_reload_arg* c_arg = + grpc_core::New(); + TlsCredentialReloadArg* arg = new TlsCredentialReloadArg(c_arg); std::shared_ptr key_materials_config( new TlsKeyMaterialsConfig()); struct TlsKeyMaterialsConfig::PemKeyCertPair pair1 = {"private_key1", @@ -323,20 +338,20 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { "cert_chain2"}; std::vector pair_list = {pair1, pair2}; key_materials_config->set_key_materials("pem_root_certs", pair_list); - arg.set_key_materials_config(key_materials_config); - arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); - arg.set_error_details("error_details"); + arg->set_key_materials_config(key_materials_config); + arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + arg->set_error_details("error_details"); grpc_tls_key_materials_config* key_materials_config_before_schedule = - c_arg.key_materials_config; - const char* error_details_before_schedule = c_arg.error_details; + c_arg->key_materials_config; + const char* error_details_before_schedule = c_arg->error_details; - int schedule_output = config.Schedule(&arg); + int schedule_output = config->Schedule(arg); EXPECT_EQ(schedule_output, 0); - EXPECT_EQ(arg.cb_user_data(), nullptr); - EXPECT_STREQ(c_arg.key_materials_config->pem_root_certs(), + EXPECT_STREQ(c_arg->key_materials_config->pem_root_certs(), "new_pem_root_certs"); grpc_tls_key_materials_config::PemKeyCertPairList c_pair_list = - c_arg.key_materials_config->pem_key_cert_pair_list(); + c_arg->key_materials_config->pem_key_cert_pair_list(); + EXPECT_TRUE(!arg->is_pem_key_cert_pair_list_empty()); EXPECT_EQ(static_cast(c_pair_list.size()), 3); EXPECT_STREQ(c_pair_list[0].private_key(), "private_key1"); EXPECT_STREQ(c_pair_list[0].cert_chain(), "cert_chain1"); @@ -344,13 +359,15 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { EXPECT_STREQ(c_pair_list[1].cert_chain(), "cert_chain2"); EXPECT_STREQ(c_pair_list[2].private_key(), "private_key3"); EXPECT_STREQ(c_pair_list[2].cert_chain(), "cert_chain3"); - EXPECT_EQ(arg.status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); - EXPECT_STREQ(arg.error_details().c_str(), "error_details"); + EXPECT_EQ(arg->status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + EXPECT_STREQ(arg->error_details().c_str(), "error_details"); // Cleanup. gpr_free(const_cast(error_details_before_schedule)); - ::grpc_core::Delete(c_arg.key_materials_config); - ::grpc_core::Delete(config.c_config()); + grpc_core::Delete(c_arg->key_materials_config); + delete arg; + gpr_free(c_arg); + gpr_free(config->c_config()); } TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { @@ -445,36 +462,40 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { std::shared_ptr test_server_authorization_check(new TestTlsServerAuthorizationCheck()); TlsServerAuthorizationCheckConfig config(test_server_authorization_check); - grpc_tls_server_authorization_check_arg c_arg; - TlsServerAuthorizationCheckArg arg(&c_arg); - arg.set_cb_user_data(nullptr); - arg.set_success(0); - arg.set_target_name("target_name"); - arg.set_peer_cert("peer_cert"); - arg.set_status(GRPC_STATUS_PERMISSION_DENIED); - arg.set_error_details("error_details"); - const char* target_name_before_schedule = c_arg.target_name; - const char* peer_cert_before_schedule = c_arg.peer_cert; - const char* error_details_before_schedule = c_arg.error_details; - - int schedule_output = config.Schedule(&arg); + grpc_tls_server_authorization_check_arg* c_arg = + grpc_core::New(); + TlsServerAuthorizationCheckArg* arg = + new TlsServerAuthorizationCheckArg(c_arg); + arg->set_cb_user_data(nullptr); + arg->set_success(0); + arg->set_target_name("target_name"); + arg->set_peer_cert("peer_cert"); + arg->set_status(GRPC_STATUS_PERMISSION_DENIED); + arg->set_error_details("error_details"); + const char* target_name_before_schedule = c_arg->target_name; + const char* peer_cert_before_schedule = c_arg->peer_cert; + const char* error_details_before_schedule = c_arg->error_details; + + int schedule_output = config.Schedule(arg); EXPECT_EQ(schedule_output, 1); - EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); - EXPECT_EQ(arg.success(), 1); - EXPECT_STREQ(arg.target_name().c_str(), "sync_target_name"); - EXPECT_STREQ(arg.peer_cert().c_str(), "sync_peer_cert"); - EXPECT_EQ(arg.status(), GRPC_STATUS_OK); - EXPECT_STREQ(arg.error_details().c_str(), "sync_error_details"); + EXPECT_STREQ(static_cast(arg->cb_user_data()), "cb_user_data"); + EXPECT_EQ(arg->success(), 1); + EXPECT_STREQ(arg->target_name().c_str(), "sync_target_name"); + EXPECT_STREQ(arg->peer_cert().c_str(), "sync_peer_cert"); + EXPECT_EQ(arg->status(), GRPC_STATUS_OK); + EXPECT_STREQ(arg->error_details().c_str(), "sync_error_details"); // Cleanup. - gpr_free(arg.cb_user_data()); + gpr_free(arg->cb_user_data()); gpr_free(const_cast(target_name_before_schedule)); gpr_free(const_cast(peer_cert_before_schedule)); gpr_free(const_cast(error_details_before_schedule)); - gpr_free(const_cast(c_arg.target_name)); - gpr_free(const_cast(c_arg.peer_cert)); - gpr_free(const_cast(c_arg.error_details)); - ::grpc_core::Delete(config.c_config()); + gpr_free(const_cast(c_arg->target_name)); + gpr_free(const_cast(c_arg->peer_cert)); + gpr_free(const_cast(c_arg->error_details)); + delete arg; + gpr_free(c_arg); + gpr_free(config.c_config()); } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { @@ -499,15 +520,12 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { EXPECT_EQ(c_arg.status, GRPC_STATUS_OK); EXPECT_STREQ(c_arg.error_details, "sync_error_details"); - const char* target_name_after_schedule = c_arg.target_name; - const char* peer_cert_after_schedule = c_arg.peer_cert; - // Cleanup. gpr_free(c_arg.cb_user_data); gpr_free(const_cast(c_arg.error_details)); - gpr_free(const_cast(target_name_after_schedule)); - gpr_free(const_cast(peer_cert_after_schedule)); - ::grpc_core::Delete(config.c_config()); + gpr_free(const_cast(c_arg.target_name)); + gpr_free(const_cast(c_arg.peer_cert)); + gpr_free(config.c_config()); } typedef class ::grpc_impl::experimental::TlsCredentialsOptions From 00cce90adf8956091a4edcbc2c476baf8e91924b Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 1 Oct 2019 16:06:01 -0700 Subject: [PATCH 66/70] Changes requested by Yihua. --- .../grpcpp/security/tls_credentials_options.h | 24 +++- .../tls/grpc_tls_credentials_options.h | 26 +++- src/cpp/common/tls_credentials_options.cc | 2 + test/cpp/client/credentials_test.cc | 124 +++++++++++++----- 4 files changed, 142 insertions(+), 34 deletions(-) diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 8cd17c03da4..76ff9ed2939 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -139,6 +139,11 @@ class TlsCredentialReloadConfig { int Schedule(TlsCredentialReloadArg* arg) const { if (credential_reload_interface_ == nullptr) { gpr_log(GPR_ERROR, "credential reload interface is nullptr"); + if (arg != nullptr) { + arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); + arg->set_error_details( + "the interface of the credential reload config is nullptr"); + } return 1; } return credential_reload_interface_->Schedule(arg); @@ -147,6 +152,11 @@ class TlsCredentialReloadConfig { void Cancel(TlsCredentialReloadArg* arg) const { if (credential_reload_interface_ == nullptr) { gpr_log(GPR_ERROR, "credential reload interface is nullptr"); + if (arg != nullptr) { + arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); + arg->set_error_details( + "the interface of the credential reload config is nullptr"); + } return; } credential_reload_interface_->Cancel(arg); @@ -233,6 +243,12 @@ class TlsServerAuthorizationCheckConfig { int Schedule(TlsServerAuthorizationCheckArg* arg) const { if (server_authorization_check_interface_ == nullptr) { gpr_log(GPR_ERROR, "server authorization check interface is nullptr"); + if (arg != nullptr) { + arg->set_status(GRPC_STATUS_NOT_FOUND); + arg->set_error_details( + "the interface of the server authorization check config is " + "nullptr"); + } return 1; } return server_authorization_check_interface_->Schedule(arg); @@ -241,12 +257,18 @@ class TlsServerAuthorizationCheckConfig { void Cancel(TlsServerAuthorizationCheckArg* arg) const { if (server_authorization_check_interface_ == nullptr) { gpr_log(GPR_ERROR, "server authorization check interface is nullptr"); + if (arg != nullptr) { + arg->set_status(GRPC_STATUS_NOT_FOUND); + arg->set_error_details( + "the interface of the server authorization check config is " + "nullptr"); + } return; } server_authorization_check_interface_->Cancel(arg); } - /** Creates C struct for the server authorization check config. **/ + /** Returns C struct for the server authorization check config. **/ grpc_tls_server_authorization_check_config* c_config() const { return c_config_; } diff --git a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h index b9ee16c2f1e..a7f99822121 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +++ b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h @@ -77,9 +77,14 @@ struct grpc_tls_credential_reload_config int Schedule(grpc_tls_credential_reload_arg* arg) const { if (schedule_ == nullptr) { gpr_log(GPR_ERROR, "schedule API is nullptr"); + if (arg != nullptr) { + arg->status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL; + arg->error_details = + gpr_strdup("schedule API in credential reload config is nullptr"); + } return 1; } - if (arg != nullptr && context_ != nullptr) { + if (arg != nullptr) { arg->config = const_cast(this); } return schedule_(config_user_data_, arg); @@ -87,9 +92,14 @@ struct grpc_tls_credential_reload_config void Cancel(grpc_tls_credential_reload_arg* arg) const { if (cancel_ == nullptr) { gpr_log(GPR_ERROR, "cancel API is nullptr."); + if (arg != nullptr) { + arg->status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL; + arg->error_details = + gpr_strdup("cancel API in credential reload config is nullptr"); + } return; } - if (arg != nullptr && context_ != nullptr) { + if (arg != nullptr) { arg->config = const_cast(this); } cancel_(config_user_data_, arg); @@ -143,6 +153,11 @@ struct grpc_tls_server_authorization_check_config int Schedule(grpc_tls_server_authorization_check_arg* arg) const { if (schedule_ == nullptr) { gpr_log(GPR_ERROR, "schedule API is nullptr"); + if (arg != nullptr) { + arg->status = GRPC_STATUS_NOT_FOUND; + arg->error_details = gpr_strdup( + "schedule API in server authorization check config is nullptr"); + } return 1; } if (arg != nullptr && context_ != nullptr) { @@ -154,9 +169,14 @@ struct grpc_tls_server_authorization_check_config void Cancel(grpc_tls_server_authorization_check_arg* arg) const { if (cancel_ == nullptr) { gpr_log(GPR_ERROR, "cancel API is nullptr."); + if (arg != nullptr) { + arg->status = GRPC_STATUS_NOT_FOUND; + arg->error_details = gpr_strdup( + "schedule API in server authorization check config is nullptr"); + } return; } - if (arg != nullptr && context_ != nullptr) { + if (arg != nullptr) { arg->config = const_cast(this); } diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 39a1cf3a39d..7c16241717b 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -19,6 +19,8 @@ #include #include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" +#include + #include "src/cpp/common/tls_credentials_options_util.h" namespace grpc_impl { diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 5c6b78a2b57..4d216d1609d 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -314,12 +314,16 @@ typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig TlsCredentialReloadConfig; TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { - grpc_tls_credential_reload_arg c_arg; - c_arg.cb = tls_credential_reload_callback; - TlsCredentialReloadArg arg = TlsCredentialReloadArg(&c_arg); - arg.set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); - arg.OnCredentialReloadDoneCallback(); - EXPECT_EQ(arg.status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED); + grpc_tls_credential_reload_arg* c_arg = new grpc_tls_credential_reload_arg; + c_arg->cb = tls_credential_reload_callback; + TlsCredentialReloadArg* arg = new TlsCredentialReloadArg(c_arg); + arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + arg->OnCredentialReloadDoneCallback(); + EXPECT_EQ(arg->status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED); + + // Cleanup. + delete arg; + delete c_arg; } TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { @@ -427,35 +431,39 @@ typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckConfig TlsServerAuthorizationCheckConfig; TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { - grpc_tls_server_authorization_check_arg c_arg; - c_arg.cb = tls_server_authorization_check_callback; - TlsServerAuthorizationCheckArg arg(&c_arg); - arg.set_cb_user_data(nullptr); - arg.set_success(0); - arg.set_target_name("target_name"); - arg.set_peer_cert("peer_cert"); - arg.set_status(GRPC_STATUS_UNAUTHENTICATED); - arg.set_error_details("error_details"); - const char* target_name_before_callback = c_arg.target_name; - const char* peer_cert_before_callback = c_arg.peer_cert; - const char* error_details_before_callback = c_arg.error_details; - - arg.OnServerAuthorizationCheckDoneCallback(); - EXPECT_STREQ(static_cast(arg.cb_user_data()), "cb_user_data"); - gpr_free(arg.cb_user_data()); - EXPECT_EQ(arg.success(), 1); - EXPECT_STREQ(arg.target_name().c_str(), "callback_target_name"); - EXPECT_STREQ(arg.peer_cert().c_str(), "callback_peer_cert"); - EXPECT_EQ(arg.status(), GRPC_STATUS_OK); - EXPECT_STREQ(arg.error_details().c_str(), "callback_error_details"); + grpc_tls_server_authorization_check_arg* c_arg = + new grpc_tls_server_authorization_check_arg; + c_arg->cb = tls_server_authorization_check_callback; + TlsServerAuthorizationCheckArg* arg = + new TlsServerAuthorizationCheckArg(c_arg); + arg->set_cb_user_data(nullptr); + arg->set_success(0); + arg->set_target_name("target_name"); + arg->set_peer_cert("peer_cert"); + arg->set_status(GRPC_STATUS_UNAUTHENTICATED); + arg->set_error_details("error_details"); + const char* target_name_before_callback = c_arg->target_name; + const char* peer_cert_before_callback = c_arg->peer_cert; + const char* error_details_before_callback = c_arg->error_details; + + arg->OnServerAuthorizationCheckDoneCallback(); + EXPECT_STREQ(static_cast(arg->cb_user_data()), "cb_user_data"); + gpr_free(arg->cb_user_data()); + EXPECT_EQ(arg->success(), 1); + EXPECT_STREQ(arg->target_name().c_str(), "callback_target_name"); + EXPECT_STREQ(arg->peer_cert().c_str(), "callback_peer_cert"); + EXPECT_EQ(arg->status(), GRPC_STATUS_OK); + EXPECT_STREQ(arg->error_details().c_str(), "callback_error_details"); // Cleanup. gpr_free(const_cast(target_name_before_callback)); gpr_free(const_cast(peer_cert_before_callback)); gpr_free(const_cast(error_details_before_callback)); - gpr_free(const_cast(c_arg.target_name)); - gpr_free(const_cast(c_arg.peer_cert)); - gpr_free(const_cast(c_arg.error_details)); + gpr_free(const_cast(c_arg->target_name)); + gpr_free(const_cast(c_arg->peer_cert)); + gpr_free(const_cast(c_arg->error_details)); + delete arg; + delete c_arg; } TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { @@ -654,6 +662,62 @@ TEST_F(CredentialsTest, LoadSpiffeChannelCredentials) { GPR_ASSERT(channel_credentials != nullptr); } +TEST_F(CredentialsTest, TlsCredentialReloadConfigErrorMessages) { + std::shared_ptr config( + new TlsCredentialReloadConfig(nullptr)); + grpc_tls_credential_reload_arg* c_arg = new grpc_tls_credential_reload_arg; + TlsCredentialReloadArg* arg = new TlsCredentialReloadArg(c_arg); + int schedule_output = config->Schedule(arg); + + EXPECT_EQ(schedule_output, 1); + EXPECT_EQ(arg->status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); + EXPECT_STREQ(arg->error_details().c_str(), + "the interface of the credential reload config is nullptr"); + gpr_free(const_cast(c_arg->error_details)); + + arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED); + config->Cancel(arg); + EXPECT_EQ(arg->status(), GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); + EXPECT_STREQ(arg->error_details().c_str(), + "the interface of the credential reload config is nullptr"); + + // Cleanup. + gpr_free(const_cast(c_arg->error_details)); + delete arg; + delete c_arg; + gpr_free(config->c_config()); +} + +TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigErrorMessages) { + std::shared_ptr config( + new TlsServerAuthorizationCheckConfig(nullptr)); + grpc_tls_server_authorization_check_arg* c_arg = + new grpc_tls_server_authorization_check_arg; + TlsServerAuthorizationCheckArg* arg = + new TlsServerAuthorizationCheckArg(c_arg); + int schedule_output = config->Schedule(arg); + + EXPECT_EQ(schedule_output, 1); + EXPECT_EQ(arg->status(), GRPC_STATUS_NOT_FOUND); + EXPECT_STREQ( + arg->error_details().c_str(), + "the interface of the server authorization check config is nullptr"); + gpr_free(const_cast(c_arg->error_details)); + + arg->set_status(GRPC_STATUS_OK); + config->Cancel(arg); + EXPECT_EQ(arg->status(), GRPC_STATUS_NOT_FOUND); + EXPECT_STREQ( + arg->error_details().c_str(), + "the interface of the server authorization check config is nullptr"); + + // Cleanup. + gpr_free(const_cast(c_arg->error_details)); + delete arg; + delete c_arg; + gpr_free(config->c_config()); +} + } // namespace testing } // namespace grpc From c45a97d8cde6c4c2d9fd7afca060ec8abff8a525 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 8 Oct 2019 19:15:31 -0700 Subject: [PATCH 67/70] Changed delete per Yang's comment. --- include/grpc/grpc_security.h | 6 +++++ .../tls/spiffe_security_connector.cc | 6 +++++ src/cpp/common/tls_credentials_options.cc | 2 ++ .../common/tls_credentials_options_util.cc | 20 ++++++++++++--- src/cpp/common/tls_credentials_options_util.h | 9 +++++-- test/cpp/client/credentials_test.cc | 25 ++++++++++++++++--- 6 files changed, 58 insertions(+), 10 deletions(-) diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index 4c1a2a02cbe..2bd30d912b7 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -818,6 +818,8 @@ typedef void (*grpc_tls_on_credential_reload_done_cb)( instance that this argument corresponds to. - context is a pointer to a wrapped language implementation of this grpc_tls_credential_reload_arg instance. + - destroy_context is a pointer to a caller-provided method that cleans + up any data associated with the context pointer. It is used for experimental purposes for now and subject to change. */ struct grpc_tls_credential_reload_arg { @@ -828,6 +830,7 @@ struct grpc_tls_credential_reload_arg { const char* error_details; grpc_tls_credential_reload_config* config; void* context; + void (*destroy_context)(void* ctx); }; /** Create a grpc_tls_credential_reload_config instance. @@ -889,6 +892,8 @@ typedef void (*grpc_tls_on_server_authorization_check_done_cb)( corresponds to. - context is a pointer to a wrapped language implementation of this grpc_tls_server_authorization_check_arg instance. + - destroy_context is a pointer to a caller-provided method that cleans + up any data associated with the context pointer. It is used for experimental purpose for now and subject to change. */ struct grpc_tls_server_authorization_check_arg { @@ -901,6 +906,7 @@ struct grpc_tls_server_authorization_check_arg { const char* error_details; grpc_tls_server_authorization_check_config* config; void* context; + void (*destroy_context)(void* ctx); }; /** Create a grpc_tls_server_authorization_check_config instance. diff --git a/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc b/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc index bac32c08813..b56559458f3 100644 --- a/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc +++ b/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc @@ -104,6 +104,9 @@ grpc_status_code TlsFetchKeyMaterials( } } gpr_free((void*)arg->error_details); + if (arg->destroy_context != nullptr) { + arg->destroy_context(arg->context); + } grpc_core::Delete(arg); } return status; @@ -392,6 +395,9 @@ void SpiffeChannelSecurityConnector::ServerAuthorizationCheckArgDestroy( gpr_free((void*)arg->target_name); gpr_free((void*)arg->peer_cert); gpr_free((void*)arg->error_details); + if (arg->destroy_context != nullptr) { + arg->destroy_context(arg->context); + } grpc_core::Delete(arg); } diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 7c16241717b..d06b47737ec 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -51,6 +51,7 @@ TlsCredentialReloadArg::TlsCredentialReloadArg( gpr_log(GPR_ERROR, "c_arg context has already been set"); } c_arg_->context = static_cast(this); + c_arg_->destroy_context = &TlsCredentialReloadArgDestroyContext; } TlsCredentialReloadArg::~TlsCredentialReloadArg() {} @@ -166,6 +167,7 @@ TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg( gpr_log(GPR_ERROR, "c_arg context has already been set"); } c_arg_->context = static_cast(this); + c_arg_->destroy_context = &TlsServerAuthorizationCheckArgDestroyContext; } TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() {} diff --git a/src/cpp/common/tls_credentials_options_util.cc b/src/cpp/common/tls_credentials_options_util.cc index 0f644638d75..89709005dcb 100644 --- a/src/cpp/common/tls_credentials_options_util.cc +++ b/src/cpp/common/tls_credentials_options_util.cc @@ -70,7 +70,6 @@ int TlsCredentialReloadConfigCSchedule(void* config_user_data, static_cast(arg->config->context()); TlsCredentialReloadArg* cpp_arg = new TlsCredentialReloadArg(arg); int schedule_result = cpp_config->Schedule(cpp_arg); - delete cpp_arg; return schedule_result; } @@ -90,7 +89,14 @@ void TlsCredentialReloadConfigCCancel(void* config_user_data, TlsCredentialReloadArg* cpp_arg = static_cast(arg->context); cpp_config->Cancel(cpp_arg); - delete cpp_arg; +} + +void TlsCredentialReloadArgDestroyContext(void* context) { + if (context != nullptr) { + TlsCredentialReloadArg* cpp_arg = + static_cast(context); + delete cpp_arg; + } } /** The C schedule and cancel functions for the server authorization check @@ -109,7 +115,6 @@ int TlsServerAuthorizationCheckConfigCSchedule( TlsServerAuthorizationCheckArg* cpp_arg = new TlsServerAuthorizationCheckArg(arg); int schedule_result = cpp_config->Schedule(cpp_arg); - delete cpp_arg; return schedule_result; } @@ -131,7 +136,14 @@ void TlsServerAuthorizationCheckConfigCCancel( TlsServerAuthorizationCheckArg* cpp_arg = static_cast(arg->context); cpp_config->Cancel(cpp_arg); - delete cpp_arg; +} + +void TlsServerAuthorizationCheckArgDestroyContext(void* context) { + if (context != nullptr) { + TlsServerAuthorizationCheckArg* cpp_arg = + static_cast(context); + delete cpp_arg; + } } } // namespace experimental diff --git a/src/cpp/common/tls_credentials_options_util.h b/src/cpp/common/tls_credentials_options_util.h index d5e20846254..93e94562398 100644 --- a/src/cpp/common/tls_credentials_options_util.h +++ b/src/cpp/common/tls_credentials_options_util.h @@ -33,8 +33,7 @@ grpc_tls_key_materials_config* ConvertToCKeyMaterialsConfig( /** The following 4 functions convert the user-provided schedule or cancel * functions into C style schedule or cancel functions. These are internal - * functions, not meant to be accessed by the user. They are exposed for - * testing purposes only. **/ + * functions, not meant to be accessed by the user. **/ int TlsCredentialReloadConfigCSchedule(void* config_user_data, grpc_tls_credential_reload_arg* arg); @@ -47,6 +46,12 @@ int TlsServerAuthorizationCheckConfigCSchedule( void TlsServerAuthorizationCheckConfigCCancel( void* config_user_data, grpc_tls_server_authorization_check_arg* arg); +/** The following 2 functions cleanup data created in the above C schedule + * functions. **/ +void TlsCredentialReloadArgDestroyContext(void* context); + +void TlsServerAuthorizationCheckArgDestroyContext(void* context); + } // namespace experimental } // namespace grpc_impl diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 4d216d1609d..3eb6fb52b9e 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -369,7 +369,10 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { // Cleanup. gpr_free(const_cast(error_details_before_schedule)); grpc_core::Delete(c_arg->key_materials_config); - delete arg; + // delete arg; + if (c_arg->destroy_context != nullptr) { + c_arg->destroy_context(c_arg->context); + } gpr_free(c_arg); gpr_free(config->c_config()); } @@ -422,6 +425,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { c_arg.key_materials_config; // Cleanup. + c_arg.destroy_context(c_arg.context); ::grpc_core::Delete(config.c_config()); } @@ -501,7 +505,10 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { gpr_free(const_cast(c_arg->target_name)); gpr_free(const_cast(c_arg->peer_cert)); gpr_free(const_cast(c_arg->error_details)); - delete arg; + // delete arg; + if (c_arg->destroy_context != nullptr) { + c_arg->destroy_context(c_arg->context); + } gpr_free(c_arg); gpr_free(config.c_config()); } @@ -530,6 +537,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { // Cleanup. gpr_free(c_arg.cb_user_data); + c_arg.destroy_context(c_arg.context); gpr_free(const_cast(c_arg.error_details)); gpr_free(const_cast(c_arg.target_name)); gpr_free(const_cast(c_arg.peer_cert)); @@ -632,6 +640,9 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { // Cleanup. ::grpc_core::Delete(c_credential_reload_arg.key_materials_config); + c_credential_reload_arg.destroy_context(c_credential_reload_arg.context); + c_server_authorization_check_arg.destroy_context( + c_server_authorization_check_arg.context); gpr_free(c_server_authorization_check_arg.cb_user_data); gpr_free(const_cast(c_server_authorization_check_arg.target_name)); gpr_free(const_cast(c_server_authorization_check_arg.peer_cert)); @@ -683,7 +694,10 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigErrorMessages) { // Cleanup. gpr_free(const_cast(c_arg->error_details)); - delete arg; + // delete arg; + if (c_arg->destroy_context != nullptr) { + c_arg->destroy_context(c_arg->context); + } delete c_arg; gpr_free(config->c_config()); } @@ -713,7 +727,10 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigErrorMessages) { // Cleanup. gpr_free(const_cast(c_arg->error_details)); - delete arg; + // delete arg; + if (c_arg->destroy_context != nullptr) { + c_arg->destroy_context(c_arg->context); + } delete c_arg; gpr_free(config->c_config()); } From ed198f5a54f99ff161acb4d007cf712e9ec56996 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 8 Oct 2019 19:15:31 -0700 Subject: [PATCH 68/70] Changed delete per Yang's comment. --- include/grpc/grpc_security.h | 6 +++++ .../tls/spiffe_security_connector.cc | 6 +++++ src/cpp/common/tls_credentials_options.cc | 2 ++ .../common/tls_credentials_options_util.cc | 20 +++++++++++--- src/cpp/common/tls_credentials_options_util.h | 9 +++++-- test/cpp/client/credentials_test.cc | 27 ++++++++++++++++--- 6 files changed, 60 insertions(+), 10 deletions(-) diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index 4c1a2a02cbe..2bd30d912b7 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -818,6 +818,8 @@ typedef void (*grpc_tls_on_credential_reload_done_cb)( instance that this argument corresponds to. - context is a pointer to a wrapped language implementation of this grpc_tls_credential_reload_arg instance. + - destroy_context is a pointer to a caller-provided method that cleans + up any data associated with the context pointer. It is used for experimental purposes for now and subject to change. */ struct grpc_tls_credential_reload_arg { @@ -828,6 +830,7 @@ struct grpc_tls_credential_reload_arg { const char* error_details; grpc_tls_credential_reload_config* config; void* context; + void (*destroy_context)(void* ctx); }; /** Create a grpc_tls_credential_reload_config instance. @@ -889,6 +892,8 @@ typedef void (*grpc_tls_on_server_authorization_check_done_cb)( corresponds to. - context is a pointer to a wrapped language implementation of this grpc_tls_server_authorization_check_arg instance. + - destroy_context is a pointer to a caller-provided method that cleans + up any data associated with the context pointer. It is used for experimental purpose for now and subject to change. */ struct grpc_tls_server_authorization_check_arg { @@ -901,6 +906,7 @@ struct grpc_tls_server_authorization_check_arg { const char* error_details; grpc_tls_server_authorization_check_config* config; void* context; + void (*destroy_context)(void* ctx); }; /** Create a grpc_tls_server_authorization_check_config instance. diff --git a/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc b/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc index bac32c08813..b56559458f3 100644 --- a/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc +++ b/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc @@ -104,6 +104,9 @@ grpc_status_code TlsFetchKeyMaterials( } } gpr_free((void*)arg->error_details); + if (arg->destroy_context != nullptr) { + arg->destroy_context(arg->context); + } grpc_core::Delete(arg); } return status; @@ -392,6 +395,9 @@ void SpiffeChannelSecurityConnector::ServerAuthorizationCheckArgDestroy( gpr_free((void*)arg->target_name); gpr_free((void*)arg->peer_cert); gpr_free((void*)arg->error_details); + if (arg->destroy_context != nullptr) { + arg->destroy_context(arg->context); + } grpc_core::Delete(arg); } diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 7c16241717b..d06b47737ec 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -51,6 +51,7 @@ TlsCredentialReloadArg::TlsCredentialReloadArg( gpr_log(GPR_ERROR, "c_arg context has already been set"); } c_arg_->context = static_cast(this); + c_arg_->destroy_context = &TlsCredentialReloadArgDestroyContext; } TlsCredentialReloadArg::~TlsCredentialReloadArg() {} @@ -166,6 +167,7 @@ TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg( gpr_log(GPR_ERROR, "c_arg context has already been set"); } c_arg_->context = static_cast(this); + c_arg_->destroy_context = &TlsServerAuthorizationCheckArgDestroyContext; } TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() {} diff --git a/src/cpp/common/tls_credentials_options_util.cc b/src/cpp/common/tls_credentials_options_util.cc index 0f644638d75..89709005dcb 100644 --- a/src/cpp/common/tls_credentials_options_util.cc +++ b/src/cpp/common/tls_credentials_options_util.cc @@ -70,7 +70,6 @@ int TlsCredentialReloadConfigCSchedule(void* config_user_data, static_cast(arg->config->context()); TlsCredentialReloadArg* cpp_arg = new TlsCredentialReloadArg(arg); int schedule_result = cpp_config->Schedule(cpp_arg); - delete cpp_arg; return schedule_result; } @@ -90,7 +89,14 @@ void TlsCredentialReloadConfigCCancel(void* config_user_data, TlsCredentialReloadArg* cpp_arg = static_cast(arg->context); cpp_config->Cancel(cpp_arg); - delete cpp_arg; +} + +void TlsCredentialReloadArgDestroyContext(void* context) { + if (context != nullptr) { + TlsCredentialReloadArg* cpp_arg = + static_cast(context); + delete cpp_arg; + } } /** The C schedule and cancel functions for the server authorization check @@ -109,7 +115,6 @@ int TlsServerAuthorizationCheckConfigCSchedule( TlsServerAuthorizationCheckArg* cpp_arg = new TlsServerAuthorizationCheckArg(arg); int schedule_result = cpp_config->Schedule(cpp_arg); - delete cpp_arg; return schedule_result; } @@ -131,7 +136,14 @@ void TlsServerAuthorizationCheckConfigCCancel( TlsServerAuthorizationCheckArg* cpp_arg = static_cast(arg->context); cpp_config->Cancel(cpp_arg); - delete cpp_arg; +} + +void TlsServerAuthorizationCheckArgDestroyContext(void* context) { + if (context != nullptr) { + TlsServerAuthorizationCheckArg* cpp_arg = + static_cast(context); + delete cpp_arg; + } } } // namespace experimental diff --git a/src/cpp/common/tls_credentials_options_util.h b/src/cpp/common/tls_credentials_options_util.h index d5e20846254..93e94562398 100644 --- a/src/cpp/common/tls_credentials_options_util.h +++ b/src/cpp/common/tls_credentials_options_util.h @@ -33,8 +33,7 @@ grpc_tls_key_materials_config* ConvertToCKeyMaterialsConfig( /** The following 4 functions convert the user-provided schedule or cancel * functions into C style schedule or cancel functions. These are internal - * functions, not meant to be accessed by the user. They are exposed for - * testing purposes only. **/ + * functions, not meant to be accessed by the user. **/ int TlsCredentialReloadConfigCSchedule(void* config_user_data, grpc_tls_credential_reload_arg* arg); @@ -47,6 +46,12 @@ int TlsServerAuthorizationCheckConfigCSchedule( void TlsServerAuthorizationCheckConfigCCancel( void* config_user_data, grpc_tls_server_authorization_check_arg* arg); +/** The following 2 functions cleanup data created in the above C schedule + * functions. **/ +void TlsCredentialReloadArgDestroyContext(void* context); + +void TlsServerAuthorizationCheckArgDestroyContext(void* context); + } // namespace experimental } // namespace grpc_impl diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 4d216d1609d..89e4d711043 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -316,6 +316,7 @@ typedef class ::grpc_impl::experimental::TlsCredentialReloadConfig TEST_F(CredentialsTest, TlsCredentialReloadArgCallback) { grpc_tls_credential_reload_arg* c_arg = new grpc_tls_credential_reload_arg; c_arg->cb = tls_credential_reload_callback; + c_arg->context = nullptr; TlsCredentialReloadArg* arg = new TlsCredentialReloadArg(c_arg); arg->set_status(GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); arg->OnCredentialReloadDoneCallback(); @@ -369,7 +370,10 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { // Cleanup. gpr_free(const_cast(error_details_before_schedule)); grpc_core::Delete(c_arg->key_materials_config); - delete arg; + // delete arg; + if (c_arg->destroy_context != nullptr) { + c_arg->destroy_context(c_arg->context); + } gpr_free(c_arg); gpr_free(config->c_config()); } @@ -422,6 +426,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { c_arg.key_materials_config; // Cleanup. + c_arg.destroy_context(c_arg.context); ::grpc_core::Delete(config.c_config()); } @@ -434,6 +439,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckArgCallback) { grpc_tls_server_authorization_check_arg* c_arg = new grpc_tls_server_authorization_check_arg; c_arg->cb = tls_server_authorization_check_callback; + c_arg->context = nullptr; TlsServerAuthorizationCheckArg* arg = new TlsServerAuthorizationCheckArg(c_arg); arg->set_cb_user_data(nullptr); @@ -501,7 +507,10 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { gpr_free(const_cast(c_arg->target_name)); gpr_free(const_cast(c_arg->peer_cert)); gpr_free(const_cast(c_arg->error_details)); - delete arg; + // delete arg; + if (c_arg->destroy_context != nullptr) { + c_arg->destroy_context(c_arg->context); + } gpr_free(c_arg); gpr_free(config.c_config()); } @@ -530,6 +539,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { // Cleanup. gpr_free(c_arg.cb_user_data); + c_arg.destroy_context(c_arg.context); gpr_free(const_cast(c_arg.error_details)); gpr_free(const_cast(c_arg.target_name)); gpr_free(const_cast(c_arg.peer_cert)); @@ -632,6 +642,9 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { // Cleanup. ::grpc_core::Delete(c_credential_reload_arg.key_materials_config); + c_credential_reload_arg.destroy_context(c_credential_reload_arg.context); + c_server_authorization_check_arg.destroy_context( + c_server_authorization_check_arg.context); gpr_free(c_server_authorization_check_arg.cb_user_data); gpr_free(const_cast(c_server_authorization_check_arg.target_name)); gpr_free(const_cast(c_server_authorization_check_arg.peer_cert)); @@ -683,7 +696,10 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigErrorMessages) { // Cleanup. gpr_free(const_cast(c_arg->error_details)); - delete arg; + // delete arg; + if (c_arg->destroy_context != nullptr) { + c_arg->destroy_context(c_arg->context); + } delete c_arg; gpr_free(config->c_config()); } @@ -713,7 +729,10 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigErrorMessages) { // Cleanup. gpr_free(const_cast(c_arg->error_details)); - delete arg; + // delete arg; + if (c_arg->destroy_context != nullptr) { + c_arg->destroy_context(c_arg->context); + } delete c_arg; gpr_free(config->c_config()); } From 313bb5848e87477816351e0ca7ecf793a2580670 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 8 Oct 2019 21:25:46 -0700 Subject: [PATCH 69/70] Remove some unnecessary comments. --- test/cpp/client/credentials_test.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 89e4d711043..47ead042901 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -334,6 +334,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { new TlsCredentialReloadConfig(test_credential_reload)); grpc_tls_credential_reload_arg* c_arg = grpc_core::New(); + c_arg.context = nullptr; TlsCredentialReloadArg* arg = new TlsCredentialReloadArg(c_arg); std::shared_ptr key_materials_config( new TlsKeyMaterialsConfig()); @@ -370,7 +371,6 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { // Cleanup. gpr_free(const_cast(error_details_before_schedule)); grpc_core::Delete(c_arg->key_materials_config); - // delete arg; if (c_arg->destroy_context != nullptr) { c_arg->destroy_context(c_arg->context); } @@ -383,6 +383,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { new TestTlsCredentialReload()); TlsCredentialReloadConfig config(test_credential_reload); grpc_tls_credential_reload_arg c_arg; + c_arg.context = nullptr; c_arg.cb_user_data = static_cast(nullptr); grpc_tls_key_materials_config c_key_materials; grpc::string test_private_key = "private_key"; @@ -478,6 +479,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { TlsServerAuthorizationCheckConfig config(test_server_authorization_check); grpc_tls_server_authorization_check_arg* c_arg = grpc_core::New(); + c_arg.context = nullptr; TlsServerAuthorizationCheckArg* arg = new TlsServerAuthorizationCheckArg(c_arg); arg->set_cb_user_data(nullptr); @@ -507,7 +509,6 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { gpr_free(const_cast(c_arg->target_name)); gpr_free(const_cast(c_arg->peer_cert)); gpr_free(const_cast(c_arg->error_details)); - // delete arg; if (c_arg->destroy_context != nullptr) { c_arg->destroy_context(c_arg->context); } @@ -528,6 +529,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { c_arg.status = GRPC_STATUS_UNAUTHENTICATED; c_arg.error_details = "error_details"; c_arg.config = config.c_config(); + c_arg.context = nullptr; int c_schedule_output = (c_arg.config)->Schedule(&c_arg); EXPECT_EQ(c_schedule_output, 1); EXPECT_STREQ(static_cast(c_arg.cb_user_data), "cb_user_data"); @@ -585,6 +587,7 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { c_credential_reload_arg.status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; grpc::string test_error_details = "error_details"; c_credential_reload_arg.error_details = test_error_details.c_str(); + c_credential_reload_arg.context = nullptr; grpc_tls_server_authorization_check_config* c_server_authorization_check_config = c_options->server_authorization_check_config(); @@ -596,6 +599,7 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { c_server_authorization_check_arg.peer_cert = "peer_cert"; c_server_authorization_check_arg.status = GRPC_STATUS_UNAUTHENTICATED; c_server_authorization_check_arg.error_details = "error_details"; + c_server_authorization_check_arg.context = nullptr; EXPECT_STREQ(c_key_materials_config->pem_root_certs(), "pem_root_certs"); EXPECT_EQ( static_cast(c_key_materials_config->pem_key_cert_pair_list().size()), @@ -679,6 +683,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigErrorMessages) { std::shared_ptr config( new TlsCredentialReloadConfig(nullptr)); grpc_tls_credential_reload_arg* c_arg = new grpc_tls_credential_reload_arg; + c_arg.context = nullptr; TlsCredentialReloadArg* arg = new TlsCredentialReloadArg(c_arg); int schedule_output = config->Schedule(arg); @@ -696,7 +701,6 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigErrorMessages) { // Cleanup. gpr_free(const_cast(c_arg->error_details)); - // delete arg; if (c_arg->destroy_context != nullptr) { c_arg->destroy_context(c_arg->context); } @@ -709,6 +713,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigErrorMessages) { new TlsServerAuthorizationCheckConfig(nullptr)); grpc_tls_server_authorization_check_arg* c_arg = new grpc_tls_server_authorization_check_arg; + c_arg.context = nullptr; TlsServerAuthorizationCheckArg* arg = new TlsServerAuthorizationCheckArg(c_arg); int schedule_output = config->Schedule(arg); @@ -729,7 +734,6 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigErrorMessages) { // Cleanup. gpr_free(const_cast(c_arg->error_details)); - // delete arg; if (c_arg->destroy_context != nullptr) { c_arg->destroy_context(c_arg->context); } From c7802d488a58f9734b9e23588f74a122878f6bcb Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Tue, 8 Oct 2019 21:36:52 -0700 Subject: [PATCH 70/70] Fixed a small typos from previous commit. --- test/cpp/client/credentials_test.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 47ead042901..707a1d57012 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -334,7 +334,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { new TlsCredentialReloadConfig(test_credential_reload)); grpc_tls_credential_reload_arg* c_arg = grpc_core::New(); - c_arg.context = nullptr; + c_arg->context = nullptr; TlsCredentialReloadArg* arg = new TlsCredentialReloadArg(c_arg); std::shared_ptr key_materials_config( new TlsKeyMaterialsConfig()); @@ -423,8 +423,6 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { EXPECT_STREQ(pair_list[1].cert_chain(), "cert_chain3"); EXPECT_EQ(c_arg.status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); EXPECT_STREQ(c_arg.error_details, test_error_details.c_str()); - grpc_tls_key_materials_config* key_materials_config_after_schedule = - c_arg.key_materials_config; // Cleanup. c_arg.destroy_context(c_arg.context); @@ -479,7 +477,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { TlsServerAuthorizationCheckConfig config(test_server_authorization_check); grpc_tls_server_authorization_check_arg* c_arg = grpc_core::New(); - c_arg.context = nullptr; + c_arg->context = nullptr; TlsServerAuthorizationCheckArg* arg = new TlsServerAuthorizationCheckArg(c_arg); arg->set_cb_user_data(nullptr); @@ -683,7 +681,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigErrorMessages) { std::shared_ptr config( new TlsCredentialReloadConfig(nullptr)); grpc_tls_credential_reload_arg* c_arg = new grpc_tls_credential_reload_arg; - c_arg.context = nullptr; + c_arg->context = nullptr; TlsCredentialReloadArg* arg = new TlsCredentialReloadArg(c_arg); int schedule_output = config->Schedule(arg); @@ -713,7 +711,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigErrorMessages) { new TlsServerAuthorizationCheckConfig(nullptr)); grpc_tls_server_authorization_check_arg* c_arg = new grpc_tls_server_authorization_check_arg; - c_arg.context = nullptr; + c_arg->context = nullptr; TlsServerAuthorizationCheckArg* arg = new TlsServerAuthorizationCheckArg(c_arg); int schedule_output = config->Schedule(arg);