diff --git a/.github/workflows/update-artifacts-branch.yaml b/.github/workflows/update-artifacts-branch.yaml deleted file mode 100644 index 693488f027ee5..0000000000000 --- a/.github/workflows/update-artifacts-branch.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: EXPERIMENTAL -- Update artifacts branch - -on: - push: - branches: - - master - -permissions: - contents: write - -jobs: - sync: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: master - fetch-depth: 0 - - name: Setup git user - run: | - git config --global user.name "GitHub Actions" - git config --global user.email "" - - name: Update artifacts branch - run: | - git checkout master - git fetch origin - git checkout artifacts - git reset master . - git clean -fd - git rev-parse master > .source-revision - git add . - git commit -m "Update artifacts branch" - git push origin artifacts diff --git a/CMakeLists.txt b/CMakeLists.txt index da48ca9f836af..1e37f381e2087 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1215,6 +1215,7 @@ if(gRPC_BUILD_TESTS) endif() add_dependencies(buildtests_cxx load_config_test) add_dependencies(buildtests_cxx load_file_test) + add_dependencies(buildtests_cxx local_security_connector_test) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx log_too_many_open_files_test) endif() @@ -19550,6 +19551,57 @@ target_link_libraries(load_file_test ) +endif() +if(gRPC_BUILD_TESTS) + +add_executable(local_security_connector_test + test/core/security/local_security_connector_test.cc + test/core/test_util/cmdline.cc + test/core/test_util/fuzzer_util.cc + test/core/test_util/grpc_profiler.cc + test/core/test_util/histogram.cc + test/core/test_util/mock_endpoint.cc + test/core/test_util/parse_hexstring.cc + test/core/test_util/resolve_localhost_ip46.cc + test/core/test_util/slice_splitter.cc + test/core/test_util/tracer_util.cc +) +if(WIN32 AND MSVC) + if(BUILD_SHARED_LIBS) + target_compile_definitions(local_security_connector_test + PRIVATE + "GPR_DLL_IMPORTS" + "GRPC_DLL_IMPORTS" + ) + endif() +endif() +target_compile_features(local_security_connector_test PUBLIC cxx_std_14) +target_include_directories(local_security_connector_test + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + ${_gRPC_RE2_INCLUDE_DIR} + ${_gRPC_SSL_INCLUDE_DIR} + ${_gRPC_UPB_GENERATED_DIR} + ${_gRPC_UPB_GRPC_GENERATED_DIR} + ${_gRPC_UPB_INCLUDE_DIR} + ${_gRPC_XXHASH_INCLUDE_DIR} + ${_gRPC_ZLIB_INCLUDE_DIR} + third_party/googletest/googletest/include + third_party/googletest/googletest + third_party/googletest/googlemock/include + third_party/googletest/googlemock + ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(local_security_connector_test + ${_gRPC_ALLTARGETS_LIBRARIES} + gtest + grpc_test_util +) + + endif() if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index 64a197963a15d..32f229fde9a60 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -25,6 +25,7 @@ EXPERIMENT_ENABLES = { "event_engine_dns": "event_engine_dns", "event_engine_listener": "event_engine_listener", "free_large_allocator": "free_large_allocator", + "local_connector_secure": "local_connector_secure", "max_pings_wo_data_throttle": "max_pings_wo_data_throttle", "monitoring_experiment": "monitoring_experiment", "multiping": "multiping", @@ -52,6 +53,9 @@ EXPERIMENTS = { "dbg": { }, "off": { + "core_end2end_test": [ + "local_connector_secure", + ], "endpoint_test": [ "tcp_frame_size_tuning", "tcp_rcv_lowat", @@ -99,6 +103,9 @@ EXPERIMENTS = { "dbg": { }, "off": { + "core_end2end_test": [ + "local_connector_secure", + ], "endpoint_test": [ "tcp_frame_size_tuning", "tcp_rcv_lowat", @@ -132,6 +139,7 @@ EXPERIMENTS = { "off": { "core_end2end_test": [ "event_engine_client", + "local_connector_secure", "work_serializer_dispatch", ], "cpp_end2end_test": [ diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index b95f89cafd6db..43213aceb14fb 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -12915,6 +12915,35 @@ targets: - gtest - grpc_test_util uses_polling: false +- name: local_security_connector_test + gtest: true + build: test + language: c++ + headers: + - test/core/test_util/cmdline.h + - test/core/test_util/evaluate_args_test_util.h + - test/core/test_util/fuzzer_util.h + - test/core/test_util/grpc_profiler.h + - test/core/test_util/histogram.h + - test/core/test_util/mock_endpoint.h + - test/core/test_util/parse_hexstring.h + - test/core/test_util/resolve_localhost_ip46.h + - test/core/test_util/slice_splitter.h + - test/core/test_util/tracer_util.h + src: + - test/core/security/local_security_connector_test.cc + - test/core/test_util/cmdline.cc + - test/core/test_util/fuzzer_util.cc + - test/core/test_util/grpc_profiler.cc + - test/core/test_util/histogram.cc + - test/core/test_util/mock_endpoint.cc + - test/core/test_util/parse_hexstring.cc + - test/core/test_util/resolve_localhost_ip46.cc + - test/core/test_util/slice_splitter.cc + - test/core/test_util/tracer_util.cc + deps: + - gtest + - grpc_test_util - name: log_too_many_open_files_test gtest: true build: test diff --git a/examples/cpp/otel/codelab/BUILD b/examples/cpp/otel/codelab/BUILD deleted file mode 100644 index 2cc92ae3f4acd..0000000000000 --- a/examples/cpp/otel/codelab/BUILD +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright 2023 the 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. - -licenses(["notice"]) - -package( - default_visibility = ["//examples/cpp:__subpackages__"], -) - -cc_library( - name = "util", - srcs = ["util.cc"], - hdrs = ["util.h"], - defines = ["BAZEL_BUILD"], - deps = [ - "//:grpc++", - "//examples/protos:helloworld_cc_grpc", - "@io_opentelemetry_cpp//sdk/src/metrics", - ], -) - -cc_binary( - name = "greeter_callback_client", - srcs = ["greeter_callback_client.cc"], - defines = ["BAZEL_BUILD"], - deps = [ - "util", - "//:grpc++", - "//:grpcpp_otel_plugin", - "//examples/cpp/otel:util", - "@com_google_absl//absl/flags:flag", - "@com_google_absl//absl/flags:parse", - "@io_opentelemetry_cpp//exporters/prometheus:prometheus_exporter", - "@io_opentelemetry_cpp//sdk/src/metrics", - ], -) - -cc_binary( - name = "greeter_callback_server", - srcs = ["greeter_callback_server.cc"], - defines = ["BAZEL_BUILD"], - deps = [ - "util", - "//:grpc++", - "//:grpc++_reflection", - "//:grpcpp_otel_plugin", - "//examples/cpp/otel:util", - "@com_google_absl//absl/flags:flag", - "@com_google_absl//absl/flags:parse", - "@com_google_absl//absl/strings:str_format", - "@io_opentelemetry_cpp//exporters/prometheus:prometheus_exporter", - "@io_opentelemetry_cpp//sdk/src/metrics", - ], -) - -cc_binary( - name = "greeter_callback_client_solution", - srcs = ["greeter_callback_client_solution.cc"], - defines = ["BAZEL_BUILD"], - deps = [ - "util", - "//:grpc++", - "//:grpcpp_otel_plugin", - "//examples/cpp/otel:util", - "@com_google_absl//absl/flags:flag", - "@com_google_absl//absl/flags:parse", - "@io_opentelemetry_cpp//exporters/prometheus:prometheus_exporter", - "@io_opentelemetry_cpp//sdk/src/metrics", - ], -) - -cc_binary( - name = "greeter_callback_server_solution", - srcs = ["greeter_callback_server_solution.cc"], - defines = ["BAZEL_BUILD"], - deps = [ - "util", - "//:grpc++", - "//:grpc++_reflection", - "//:grpcpp_otel_plugin", - "//examples/cpp/otel:util", - "@com_google_absl//absl/flags:flag", - "@com_google_absl//absl/flags:parse", - "@com_google_absl//absl/strings:str_format", - "@io_opentelemetry_cpp//exporters/prometheus:prometheus_exporter", - "@io_opentelemetry_cpp//sdk/src/metrics", - ], -) diff --git a/examples/cpp/otel/codelab/CMakeLists.txt b/examples/cpp/otel/codelab/CMakeLists.txt deleted file mode 100644 index 6ce38d77a2f66..0000000000000 --- a/examples/cpp/otel/codelab/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2018 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. -# -# cmake build file for C++ gRPC OpenTelemetry example. -# Assumes absl, protobuf, prometheus-cpp, opentelemetry-cpp and gRPC (with -DgRPC_BUILD_OPENTELEMETRY_PLUGIN=ON) have been installed using cmake. -# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build -# that automatically builds all the dependencies before building helloworld. - -cmake_minimum_required(VERSION 3.13) - -project(grpc_opentelemetry_example C CXX) - -include(../../cmake/common.cmake) - -# Find prometheus-cpp package -find_package(prometheus-cpp CONFIG REQUIRED) - -# Find opentelemetry-cpp package -find_package(opentelemetry-cpp CONFIG REQUIRED) - -# Proto file -get_filename_component(hw_proto "../../../protos/helloworld.proto" ABSOLUTE) -get_filename_component(hw_proto_path "${hw_proto}" PATH) - -# Generated sources -set(hw_proto_srcs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.pb.cc") -set(hw_proto_hdrs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.pb.h") -set(hw_grpc_srcs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.grpc.pb.cc") -set(hw_grpc_hdrs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.grpc.pb.h") -add_custom_command( - OUTPUT "${hw_proto_srcs}" "${hw_proto_hdrs}" "${hw_grpc_srcs}" "${hw_grpc_hdrs}" - COMMAND ${_PROTOBUF_PROTOC} - ARGS --grpc_out "${CMAKE_CURRENT_BINARY_DIR}" - --cpp_out "${CMAKE_CURRENT_BINARY_DIR}" - -I "${hw_proto_path}" - --plugin=protoc-gen-grpc="${_GRPC_CPP_PLUGIN_EXECUTABLE}" - "${hw_proto}" - DEPENDS "${hw_proto}") - -# Include generated *.pb.h files -include_directories("${CMAKE_CURRENT_BINARY_DIR}") -include_directories("${CMAKE_SOURCE_DIR}") - -# hw_grpc_proto -add_library(hw_grpc_proto - ${hw_grpc_srcs} - ${hw_grpc_hdrs} - ${hw_proto_srcs} - ${hw_proto_hdrs}) -target_link_libraries(hw_grpc_proto - ${_REFLECTION} - ${_GRPC_GRPCPP} - ${_PROTOBUF_LIBPROTOBUF}) - -# util -add_library(util - "util.cc") -target_link_libraries(util - hw_grpc_proto - opentelemetry-cpp::metrics - ${_GRPC_GRPCPP} - ${_REFLECTION} - ${_PROTOBUF_LIBPROTOBUF}) - -# Targets greeter_callback_(client|server) greeter_callback_(client|server)_solution -foreach(_target - greeter_callback_client greeter_callback_server greeter_callback_client_solution greeter_callback_server_solution) - add_executable(${_target} "${_target}.cc") - target_link_libraries(${_target} - absl::flags - absl::flags_parse - opentelemetry-cpp::metrics - opentelemetry-cpp::prometheus_exporter - gRPC::grpcpp_otel_plugin - util) -endforeach() diff --git a/examples/cpp/otel/codelab/greeter_callback_client.cc b/examples/cpp/otel/codelab/greeter_callback_client.cc deleted file mode 100644 index d9eab4e9edd2f..0000000000000 --- a/examples/cpp/otel/codelab/greeter_callback_client.cc +++ /dev/null @@ -1,138 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -// Explicitly define HAVE_ABSEIL to avoid conflict with OTel's Abseil -// version. Refer -// https://github.com/open-telemetry/opentelemetry-cpp/issues/1042. -#ifndef HAVE_ABSEIL -#define HAVE_ABSEIL -#endif - -#include -#include -#include - -#include "absl/flags/flag.h" -#include "absl/flags/parse.h" -#include "opentelemetry/exporters/prometheus/exporter_factory.h" -#include "opentelemetry/exporters/prometheus/exporter_options.h" -#include "opentelemetry/sdk/metrics/meter_provider.h" - -#include -#include - -#ifdef BAZEL_BUILD -#include "examples/cpp/otel/codelab/util.h" -#include "examples/protos/helloworld.grpc.pb.h" -#else -#include "helloworld.grpc.pb.h" -#include "util.h" -#endif - -ABSL_FLAG(std::string, target, "localhost:50051", "Server address"); -ABSL_FLAG(std::string, prometheus_endpoint, "localhost:9465", - "Prometheus exporter endpoint"); - -namespace { - -using grpc::Channel; -using grpc::ClientContext; -using grpc::Status; -using helloworld::Greeter; -using helloworld::HelloReply; -using helloworld::HelloRequest; - -class GreeterClient { - public: - GreeterClient(std::shared_ptr channel) - : stub_(Greeter::NewStub(channel)) {} - - // Assembles the client's payload, sends it and presents the response back - // from the server. - std::string SayHello(const std::string& user) { - // Data we are sending to the server. - HelloRequest request; - request.set_name(user); - - // Container for the data we expect from the server. - HelloReply reply; - - // Context for the client. It could be used to convey extra information to - // the server and/or tweak certain RPC behaviors. - ClientContext context; - - // The actual RPC. - std::mutex mu; - std::condition_variable cv; - bool done = false; - Status status; - stub_->async()->SayHello(&context, &request, &reply, - [&mu, &cv, &done, &status](Status s) { - status = std::move(s); - std::lock_guard lock(mu); - done = true; - cv.notify_one(); - }); - - std::unique_lock lock(mu); - while (!done) { - cv.wait(lock); - } - - // Act upon its status. - if (status.ok()) { - return reply.message(); - } else { - std::cout << status.error_code() << ": " << status.error_message() - << std::endl; - return "RPC failed"; - } - } - - private: - std::unique_ptr stub_; -}; - -void RunClient(const std::string& target_str) { - // Instantiate the client. It requires a channel, out of which the actual RPCs - // are created. This channel models a connection to an endpoint specified by - // the argument "--target=" which is the only expected argument. - grpc::ChannelArguments args; - // Continuously send RPCs every second. - while (true) { - GreeterClient greeter(grpc::CreateCustomChannel( - target_str, grpc::InsecureChannelCredentials(), args)); - std::string user("world"); - std::string reply = greeter.SayHello(user); - std::cout << "Greeter received: " << reply << std::endl; - std::this_thread::sleep_for(std::chrono::seconds(1)); - } -} - -} // namespace - -int main(int argc, char** argv) { - absl::ParseCommandLine(argc, argv); - - // CODELAB HINT : Add code to register gRPC OpenTelemetry plugin here. - - // Continuously send RPCs. - RunClient(absl::GetFlag(FLAGS_target)); - - return 0; -} diff --git a/examples/cpp/otel/codelab/greeter_callback_client_solution.cc b/examples/cpp/otel/codelab/greeter_callback_client_solution.cc deleted file mode 100644 index b7b507c509d74..0000000000000 --- a/examples/cpp/otel/codelab/greeter_callback_client_solution.cc +++ /dev/null @@ -1,157 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -// Explicitly define HAVE_ABSEIL to avoid conflict with OTel's Abseil -// version. Refer -// https://github.com/open-telemetry/opentelemetry-cpp/issues/1042. -#ifndef HAVE_ABSEIL -#define HAVE_ABSEIL -#endif - -#include -#include -#include - -#include "absl/flags/flag.h" -#include "absl/flags/parse.h" -#include "opentelemetry/exporters/prometheus/exporter_factory.h" -#include "opentelemetry/exporters/prometheus/exporter_options.h" -#include "opentelemetry/sdk/metrics/meter_provider.h" - -#include -#include - -#ifdef BAZEL_BUILD -#include "examples/cpp/otel/codelab/util.h" -#include "examples/protos/helloworld.grpc.pb.h" -#else -#include "helloworld.grpc.pb.h" -#include "util.h" -#endif - -ABSL_FLAG(std::string, target, "localhost:50051", "Server address"); -ABSL_FLAG(std::string, prometheus_endpoint, "localhost:9465", - "Prometheus exporter endpoint"); - -namespace { - -using grpc::Channel; -using grpc::ClientContext; -using grpc::Status; -using helloworld::Greeter; -using helloworld::HelloReply; -using helloworld::HelloRequest; - -class GreeterClient { - public: - GreeterClient(std::shared_ptr channel) - : stub_(Greeter::NewStub(channel)) {} - - // Assembles the client's payload, sends it and presents the response back - // from the server. - std::string SayHello(const std::string& user) { - // Data we are sending to the server. - HelloRequest request; - request.set_name(user); - - // Container for the data we expect from the server. - HelloReply reply; - - // Context for the client. It could be used to convey extra information to - // the server and/or tweak certain RPC behaviors. - ClientContext context; - - // The actual RPC. - std::mutex mu; - std::condition_variable cv; - bool done = false; - Status status; - stub_->async()->SayHello(&context, &request, &reply, - [&mu, &cv, &done, &status](Status s) { - status = std::move(s); - std::lock_guard lock(mu); - done = true; - cv.notify_one(); - }); - - std::unique_lock lock(mu); - while (!done) { - cv.wait(lock); - } - - // Act upon its status. - if (status.ok()) { - return reply.message(); - } else { - std::cout << status.error_code() << ": " << status.error_message() - << std::endl; - return "RPC failed"; - } - } - - private: - std::unique_ptr stub_; -}; - -void RunClient(const std::string& target_str) { - // Instantiate the client. It requires a channel, out of which the actual RPCs - // are created. This channel models a connection to an endpoint specified by - // the argument "--target=" which is the only expected argument. - grpc::ChannelArguments args; - // Continuously send RPCs every second. - while (true) { - GreeterClient greeter(grpc::CreateCustomChannel( - target_str, grpc::InsecureChannelCredentials(), args)); - std::string user("world"); - std::string reply = greeter.SayHello(user); - std::cout << "Greeter received: " << reply << std::endl; - std::this_thread::sleep_for(std::chrono::seconds(1)); - } -} - -} // namespace - -int main(int argc, char** argv) { - absl::ParseCommandLine(argc, argv); - // Register a global gRPC OpenTelemetry plugin configured with a prometheus - // exporter. - opentelemetry::exporter::metrics::PrometheusExporterOptions opts; - opts.url = absl::GetFlag(FLAGS_prometheus_endpoint); - auto prometheus_exporter = - opentelemetry::exporter::metrics::PrometheusExporterFactory::Create(opts); - auto meter_provider = - std::make_shared(); - // The default histogram boundaries are not granular enough for RPCs. Override - // the "grpc.client.attempt.duration" view as recommended by - // https://github.com/grpc/proposal/blob/master/A66-otel-stats.md. - AddLatencyView(meter_provider.get(), "grpc.client.attempt.duration", "s"); - meter_provider->AddMetricReader(std::move(prometheus_exporter)); - auto status = grpc::OpenTelemetryPluginBuilder() - .SetMeterProvider(std::move(meter_provider)) - .BuildAndRegisterGlobal(); - if (!status.ok()) { - std::cerr << "Failed to register gRPC OpenTelemetry Plugin: " - << status.ToString() << std::endl; - return static_cast(status.code()); - } - - // Continuously send RPCs. - RunClient(absl::GetFlag(FLAGS_target)); - - return 0; -} diff --git a/examples/cpp/otel/codelab/greeter_callback_server.cc b/examples/cpp/otel/codelab/greeter_callback_server.cc deleted file mode 100644 index bba7c9ce0724c..0000000000000 --- a/examples/cpp/otel/codelab/greeter_callback_server.cc +++ /dev/null @@ -1,112 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -// Explicitly define HAVE_ABSEIL to avoid conflict with OTel's Abseil -// version. Refer -// https://github.com/open-telemetry/opentelemetry-cpp/issues/1042. -#ifndef HAVE_ABSEIL -#define HAVE_ABSEIL -#endif - -#include -#include -#include - -#include "absl/flags/flag.h" -#include "absl/flags/parse.h" -#include "absl/strings/str_format.h" -#include "opentelemetry/exporters/prometheus/exporter_factory.h" -#include "opentelemetry/exporters/prometheus/exporter_options.h" -#include "opentelemetry/sdk/metrics/meter_provider.h" - -#include -#include -#include -#include - -#ifdef BAZEL_BUILD -#include "examples/cpp/otel/codelab/util.h" -#include "examples/protos/helloworld.grpc.pb.h" -#else -#include "helloworld.grpc.pb.h" -#include "util.h" -#endif - -ABSL_FLAG(uint16_t, port, 50051, "Server port for the service"); -ABSL_FLAG(std::string, prometheus_endpoint, "localhost:9464", - "Prometheus exporter endpoint"); - -namespace { - -using grpc::CallbackServerContext; -using grpc::Server; -using grpc::ServerBuilder; -using grpc::ServerUnaryReactor; -using grpc::Status; -using helloworld::Greeter; -using helloworld::HelloReply; -using helloworld::HelloRequest; - -// Logic and data behind the server's behavior. -class GreeterServiceImpl final : public Greeter::CallbackService { - ServerUnaryReactor* SayHello(CallbackServerContext* context, - const HelloRequest* request, - HelloReply* reply) override { - std::string prefix("Hello "); - reply->set_message(prefix + request->name()); - - // CODELAB HINT: This sleep seems suspicious. - std::this_thread::sleep_for(std::chrono::seconds(5)); - - ServerUnaryReactor* reactor = context->DefaultReactor(); - reactor->Finish(Status::OK); - return reactor; - } -}; - -void RunServer(uint16_t port) { - std::string server_address = absl::StrFormat("0.0.0.0:%d", port); - GreeterServiceImpl service; - - grpc::EnableDefaultHealthCheckService(true); - grpc::reflection::InitProtoReflectionServerBuilderPlugin(); - ServerBuilder builder; - // Listen on the given address without any authentication mechanism. - builder.AddListeningPort(server_address, grpc::InsecureServerCredentials()); - // Register "service" as the instance through which we'll communicate with - // clients. In this case it corresponds to an *synchronous* service. - builder.RegisterService(&service); - // Finally assemble the server. - std::unique_ptr server(builder.BuildAndStart()); - std::cout << "Server listening on " << server_address << std::endl; - - // Wait for the server to shutdown. Note that some other thread must be - // responsible for shutting down the server for this call to ever return. - server->Wait(); -} - -} // namespace - -int main(int argc, char** argv) { - absl::ParseCommandLine(argc, argv); - - // CODELAB HINT : Add code to register gRPC OpenTelemetry plugin here. - - RunServer(absl::GetFlag(FLAGS_port)); - return 0; -} diff --git a/examples/cpp/otel/codelab/greeter_callback_server_solution.cc b/examples/cpp/otel/codelab/greeter_callback_server_solution.cc deleted file mode 100644 index a53ab288af4b1..0000000000000 --- a/examples/cpp/otel/codelab/greeter_callback_server_solution.cc +++ /dev/null @@ -1,127 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -// Explicitly define HAVE_ABSEIL to avoid conflict with OTel's Abseil -// version. Refer -// https://github.com/open-telemetry/opentelemetry-cpp/issues/1042. -#ifndef HAVE_ABSEIL -#define HAVE_ABSEIL -#endif - -#include -#include -#include - -#include "absl/flags/flag.h" -#include "absl/flags/parse.h" -#include "absl/strings/str_format.h" -#include "opentelemetry/exporters/prometheus/exporter_factory.h" -#include "opentelemetry/exporters/prometheus/exporter_options.h" -#include "opentelemetry/sdk/metrics/meter_provider.h" - -#include -#include -#include -#include - -#ifdef BAZEL_BUILD -#include "examples/cpp/otel/codelab/util.h" -#include "examples/protos/helloworld.grpc.pb.h" -#else -#include "helloworld.grpc.pb.h" -#include "util.h" -#endif - -ABSL_FLAG(uint16_t, port, 50051, "Server port for the service"); -ABSL_FLAG(std::string, prometheus_endpoint, "localhost:9464", - "Prometheus exporter endpoint"); - -namespace { - -using grpc::CallbackServerContext; -using grpc::Server; -using grpc::ServerBuilder; -using grpc::ServerUnaryReactor; -using grpc::Status; -using helloworld::Greeter; -using helloworld::HelloReply; -using helloworld::HelloRequest; - -// Logic and data behind the server's behavior. -class GreeterServiceImpl final : public Greeter::CallbackService { - ServerUnaryReactor* SayHello(CallbackServerContext* context, - const HelloRequest* request, - HelloReply* reply) override { - std::string prefix("Hello "); - reply->set_message(prefix + request->name()); - - ServerUnaryReactor* reactor = context->DefaultReactor(); - reactor->Finish(Status::OK); - return reactor; - } -}; - -void RunServer(uint16_t port) { - std::string server_address = absl::StrFormat("0.0.0.0:%d", port); - GreeterServiceImpl service; - - grpc::EnableDefaultHealthCheckService(true); - grpc::reflection::InitProtoReflectionServerBuilderPlugin(); - ServerBuilder builder; - // Listen on the given address without any authentication mechanism. - builder.AddListeningPort(server_address, grpc::InsecureServerCredentials()); - // Register "service" as the instance through which we'll communicate with - // clients. In this case it corresponds to an *synchronous* service. - builder.RegisterService(&service); - // Finally assemble the server. - std::unique_ptr server(builder.BuildAndStart()); - std::cout << "Server listening on " << server_address << std::endl; - - // Wait for the server to shutdown. Note that some other thread must be - // responsible for shutting down the server for this call to ever return. - server->Wait(); -} - -} // namespace - -int main(int argc, char** argv) { - absl::ParseCommandLine(argc, argv); - // Register a global gRPC OpenTelemetry plugin configured with a prometheus - // exporter. - opentelemetry::exporter::metrics::PrometheusExporterOptions opts; - opts.url = absl::GetFlag(FLAGS_prometheus_endpoint); - auto prometheus_exporter = - opentelemetry::exporter::metrics::PrometheusExporterFactory::Create(opts); - auto meter_provider = - std::make_shared(); - // The default histogram boundaries are not granular enough for RPCs. Override - // the "grpc.server.call.duration" view as recommended by - // https://github.com/grpc/proposal/blob/master/A66-otel-stats.md. - AddLatencyView(meter_provider.get(), "grpc.server.call.duration", "s"); - meter_provider->AddMetricReader(std::move(prometheus_exporter)); - auto status = grpc::OpenTelemetryPluginBuilder() - .SetMeterProvider(std::move(meter_provider)) - .BuildAndRegisterGlobal(); - if (!status.ok()) { - std::cerr << "Failed to register gRPC OpenTelemetry Plugin: " - << status.ToString() << std::endl; - return static_cast(status.code()); - } - RunServer(absl::GetFlag(FLAGS_port)); - return 0; -} diff --git a/examples/cpp/otel/codelab/util.cc b/examples/cpp/otel/codelab/util.cc deleted file mode 100644 index a8fcce95663f7..0000000000000 --- a/examples/cpp/otel/codelab/util.cc +++ /dev/null @@ -1,70 +0,0 @@ -// -// -// Copyright 2024 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. -// -// - -// Explicitly define HAVE_ABSEIL to avoid conflict with OTel's Abseil -// version. Refer -// https://github.com/open-telemetry/opentelemetry-cpp/issues/1042. -#ifndef HAVE_ABSEIL -#define HAVE_ABSEIL -#endif - -#include "opentelemetry/sdk/metrics/view/instrument_selector_factory.h" -#include "opentelemetry/sdk/metrics/view/meter_selector_factory.h" -#include "opentelemetry/sdk/metrics/view/view_factory.h" - -#include - -#ifdef BAZEL_BUILD -#include "examples/cpp/otel/codelab/util.h" -#include "examples/protos/helloworld.grpc.pb.h" -#else -#include "helloworld.grpc.pb.h" -#include "util.h" -#endif - -using grpc::CallbackServerContext; -using grpc::Channel; -using grpc::ClientContext; -using grpc::Server; -using grpc::ServerBuilder; -using grpc::ServerUnaryReactor; -using grpc::Status; -using helloworld::Greeter; -using helloworld::HelloReply; -using helloworld::HelloRequest; - -void AddLatencyView(opentelemetry::sdk::metrics::MeterProvider* provider, - const std::string& name, const std::string& unit) { - auto histogram_config = std::make_shared< - opentelemetry::sdk::metrics::HistogramAggregationConfig>(); - histogram_config->boundaries_ = { - 0, 0.00001, 0.00005, 0.0001, 0.0003, 0.0006, 0.0008, 0.001, 0.002, - 0.003, 0.004, 0.005, 0.006, 0.008, 0.01, 0.013, 0.016, 0.02, - 0.025, 0.03, 0.04, 0.05, 0.065, 0.08, 0.1, 0.13, 0.16, - 0.2, 0.25, 0.3, 0.4, 0.5, 0.65, 0.8, 1, 2, - 5, 10, 20, 50, 100}; - provider->AddView( - opentelemetry::sdk::metrics::InstrumentSelectorFactory::Create( - opentelemetry::sdk::metrics::InstrumentType::kHistogram, name, unit), - opentelemetry::sdk::metrics::MeterSelectorFactory::Create( - "grpc-c++", grpc::Version(), ""), - opentelemetry::sdk::metrics::ViewFactory::Create( - name, "", unit, - opentelemetry::sdk::metrics::AggregationType::kHistogram, - std::move(histogram_config))); -} diff --git a/examples/cpp/otel/codelab/util.h b/examples/cpp/otel/codelab/util.h deleted file mode 100644 index cf140de16f36c..0000000000000 --- a/examples/cpp/otel/codelab/util.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// -// Copyright 2024 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_EXAMPLES_CPP_OTEL_CODELAB_UTIL_H -#define GRPCPP_EXAMPLES_CPP_OTEL_CODELAB_UTIL_H - -#include - -#include "opentelemetry/sdk/metrics/meter_provider.h" - -// Helper function that adds view for gRPC latency instrument \a name with unit -// \a unit with bucket boundaries that are more useful for RPCs. -void AddLatencyView(opentelemetry::sdk::metrics::MeterProvider* provider, - const std::string& name, const std::string& unit); - -#endif // GRPCPP_EXAMPLES_CPP_OTEL_UTIL_H diff --git a/src/core/BUILD b/src/core/BUILD index e762447cfbcbd..ff913a4ed042a 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -4097,6 +4097,7 @@ grpc_cc_library( "//:sockaddr_utils", "//:tsi_base", "//:uri_parser", + "//src/core:experiments", ], ) diff --git a/src/core/lib/experiments/experiments.cc b/src/core/lib/experiments/experiments.cc index 5ce7bfb84f4d9..70847ae2ffd45 100644 --- a/src/core/lib/experiments/experiments.cc +++ b/src/core/lib/experiments/experiments.cc @@ -47,6 +47,9 @@ const char* const additional_constraints_event_engine_listener = "{}"; const char* const description_free_large_allocator = "If set, return all free bytes from a \042big\042 allocator"; const char* const additional_constraints_free_large_allocator = "{}"; +const char* const description_local_connector_secure = + "Local Security Connector uses TSI_PRIVACY_AND_INTEGRITY only for UDS."; +const char* const additional_constraints_local_connector_secure = "{}"; const char* const description_max_pings_wo_data_throttle = "Experiment to throttle pings to a period of 1 min when " "GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA limit has reached (instead of " @@ -123,6 +126,8 @@ const ExperimentMetadata g_experiment_metadata[] = { additional_constraints_event_engine_listener, nullptr, 0, false, true}, {"free_large_allocator", description_free_large_allocator, additional_constraints_free_large_allocator, nullptr, 0, false, true}, + {"local_connector_secure", description_local_connector_secure, + additional_constraints_local_connector_secure, nullptr, 0, false, true}, {"max_pings_wo_data_throttle", description_max_pings_wo_data_throttle, additional_constraints_max_pings_wo_data_throttle, nullptr, 0, false, true}, @@ -191,6 +196,9 @@ const char* const additional_constraints_event_engine_listener = "{}"; const char* const description_free_large_allocator = "If set, return all free bytes from a \042big\042 allocator"; const char* const additional_constraints_free_large_allocator = "{}"; +const char* const description_local_connector_secure = + "Local Security Connector uses TSI_PRIVACY_AND_INTEGRITY only for UDS."; +const char* const additional_constraints_local_connector_secure = "{}"; const char* const description_max_pings_wo_data_throttle = "Experiment to throttle pings to a period of 1 min when " "GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA limit has reached (instead of " @@ -267,6 +275,8 @@ const ExperimentMetadata g_experiment_metadata[] = { additional_constraints_event_engine_listener, nullptr, 0, true, true}, {"free_large_allocator", description_free_large_allocator, additional_constraints_free_large_allocator, nullptr, 0, false, true}, + {"local_connector_secure", description_local_connector_secure, + additional_constraints_local_connector_secure, nullptr, 0, false, true}, {"max_pings_wo_data_throttle", description_max_pings_wo_data_throttle, additional_constraints_max_pings_wo_data_throttle, nullptr, 0, false, true}, @@ -335,6 +345,9 @@ const char* const additional_constraints_event_engine_listener = "{}"; const char* const description_free_large_allocator = "If set, return all free bytes from a \042big\042 allocator"; const char* const additional_constraints_free_large_allocator = "{}"; +const char* const description_local_connector_secure = + "Local Security Connector uses TSI_PRIVACY_AND_INTEGRITY only for UDS."; +const char* const additional_constraints_local_connector_secure = "{}"; const char* const description_max_pings_wo_data_throttle = "Experiment to throttle pings to a period of 1 min when " "GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA limit has reached (instead of " @@ -411,6 +424,8 @@ const ExperimentMetadata g_experiment_metadata[] = { additional_constraints_event_engine_listener, nullptr, 0, true, true}, {"free_large_allocator", description_free_large_allocator, additional_constraints_free_large_allocator, nullptr, 0, false, true}, + {"local_connector_secure", description_local_connector_secure, + additional_constraints_local_connector_secure, nullptr, 0, false, true}, {"max_pings_wo_data_throttle", description_max_pings_wo_data_throttle, additional_constraints_max_pings_wo_data_throttle, nullptr, 0, false, true}, diff --git a/src/core/lib/experiments/experiments.h b/src/core/lib/experiments/experiments.h index 89f6b6010ae90..6eecb5179ea6d 100644 --- a/src/core/lib/experiments/experiments.h +++ b/src/core/lib/experiments/experiments.h @@ -67,6 +67,7 @@ inline bool IsEventEngineClientEnabled() { return false; } inline bool IsEventEngineDnsEnabled() { return false; } inline bool IsEventEngineListenerEnabled() { return false; } inline bool IsFreeLargeAllocatorEnabled() { return false; } +inline bool IsLocalConnectorSecureEnabled() { return false; } inline bool IsMaxPingsWoDataThrottleEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT inline bool IsMonitoringExperimentEnabled() { return true; } @@ -100,6 +101,7 @@ inline bool IsEventEngineDnsEnabled() { return true; } #define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_LISTENER inline bool IsEventEngineListenerEnabled() { return true; } inline bool IsFreeLargeAllocatorEnabled() { return false; } +inline bool IsLocalConnectorSecureEnabled() { return false; } inline bool IsMaxPingsWoDataThrottleEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT inline bool IsMonitoringExperimentEnabled() { return true; } @@ -132,6 +134,7 @@ inline bool IsEventEngineDnsEnabled() { return true; } #define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_LISTENER inline bool IsEventEngineListenerEnabled() { return true; } inline bool IsFreeLargeAllocatorEnabled() { return false; } +inline bool IsLocalConnectorSecureEnabled() { return false; } inline bool IsMaxPingsWoDataThrottleEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT inline bool IsMonitoringExperimentEnabled() { return true; } @@ -162,6 +165,7 @@ enum ExperimentIds { kExperimentIdEventEngineDns, kExperimentIdEventEngineListener, kExperimentIdFreeLargeAllocator, + kExperimentIdLocalConnectorSecure, kExperimentIdMaxPingsWoDataThrottle, kExperimentIdMonitoringExperiment, kExperimentIdMultiping, @@ -210,6 +214,10 @@ inline bool IsEventEngineListenerEnabled() { inline bool IsFreeLargeAllocatorEnabled() { return IsExperimentEnabled(); } +#define GRPC_EXPERIMENT_IS_INCLUDED_LOCAL_CONNECTOR_SECURE +inline bool IsLocalConnectorSecureEnabled() { + return IsExperimentEnabled(); +} #define GRPC_EXPERIMENT_IS_INCLUDED_MAX_PINGS_WO_DATA_THROTTLE inline bool IsMaxPingsWoDataThrottleEnabled() { return IsExperimentEnabled(); diff --git a/src/core/lib/experiments/experiments.yaml b/src/core/lib/experiments/experiments.yaml index 8179377da0e08..f93ddd8590dfa 100644 --- a/src/core/lib/experiments/experiments.yaml +++ b/src/core/lib/experiments/experiments.yaml @@ -91,6 +91,11 @@ expiry: 2024/12/01 owner: alishananda@google.com test_tags: [resource_quota_test] +- name: local_connector_secure + description: Local Security Connector uses TSI_PRIVACY_AND_INTEGRITY only for UDS. + expiry: 2024/10/30 + owner: aermolov@google.com + test_tags: ["core_end2end_test"] - name: max_pings_wo_data_throttle description: Experiment to throttle pings to a period of 1 min when diff --git a/src/core/lib/experiments/rollouts.yaml b/src/core/lib/experiments/rollouts.yaml index a8803b2331afd..cc8cf6b01b812 100644 --- a/src/core/lib/experiments/rollouts.yaml +++ b/src/core/lib/experiments/rollouts.yaml @@ -75,6 +75,8 @@ windows: true - name: free_large_allocator default: false +- name: local_connector_secure + default: false - name: max_pings_wo_data_throttle default: false - name: monitoring_experiment diff --git a/src/core/lib/security/security_connector/local/local_security_connector.cc b/src/core/lib/security/security_connector/local/local_security_connector.cc index b78ddbe483022..70f502399c3ac 100644 --- a/src/core/lib/security/security_connector/local/local_security_connector.cc +++ b/src/core/lib/security/security_connector/local/local_security_connector.cc @@ -43,6 +43,7 @@ #include "src/core/lib/address_utils/parse_address.h" #include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/experiments/experiments.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/iomgr/closure.h" @@ -143,9 +144,22 @@ void local_check_peer(tsi_peer peer, grpc_endpoint* ep, } if (peer.properties != nullptr) gpr_free(peer.properties); peer.properties = new_properties; - // TODO(yihuazhang): Set security level of local TCP to TSI_SECURITY_NONE. - const char* security_level = - tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY); + // Set security level to NONE for TCP type, privacy&integrity otherwise. + const char* security_level; + if (grpc_core::IsLocalConnectorSecureEnabled()) { + switch (type) { + case UDS: + security_level = + tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY); + break; + default: + security_level = tsi_security_level_to_string(TSI_SECURITY_NONE); + break; + } + } else { + security_level = tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY); + } + tsi_result result = tsi_construct_string_peer_property_from_cstring( TSI_SECURITY_LEVEL_PEER_PROPERTY, security_level, &peer.properties[peer.property_count]); diff --git a/src/core/util/ring_buffer.h b/src/core/util/ring_buffer.h deleted file mode 100644 index 4831c2202c16b..0000000000000 --- a/src/core/util/ring_buffer.h +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2024 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_SRC_CORE_UTIL_RING_BUFFER_H -#define GRPC_SRC_CORE_UTIL_RING_BUFFER_H - -#include - -#include -#include -#include - -#include "absl/types/optional.h" - -namespace grpc_core { - -template -class RingBuffer { - public: - class RingBufferIterator { - public: - using iterator_category = std::forward_iterator_tag; - using value_type = const T; - using pointer = void; - using reference = void; - using difference_type = std::ptrdiff_t; - - RingBufferIterator& operator++() { - if (--size_ <= 0) { - head_ = 0; - size_ = 0; - buffer_ = nullptr; - } else { - head_ = (head_ + 1) % kCapacity; - } - return *this; - } - - RingBufferIterator operator++(int) { - RingBufferIterator tmp(*this); - operator++(); - return tmp; - } - - bool operator==(const RingBufferIterator& rhs) const { - return (buffer_ == rhs.buffer_ && head_ == rhs.head_ && - size_ == rhs.size_); - } - - bool operator!=(const RingBufferIterator& rhs) const { - return !operator==(rhs); - } - - T operator*() { return buffer_->data_[head_]; } - - RingBufferIterator() : buffer_(nullptr), head_(0), size_(0){}; - RingBufferIterator(const RingBufferIterator& other) = default; - explicit RingBufferIterator(const RingBuffer* buffer) - : buffer_(buffer), head_(buffer->head_), size_(buffer->size_) { - if (!size_) { - buffer_ = nullptr; - } - } - - private: - friend class RingBuffer; - const RingBuffer* buffer_; - int head_ = 0; - int size_ = 0; - }; - - RingBuffer() = default; - - void Append(T data) { - if (size_ < kCapacity) { - data_[size_] = std::move(data); - size_++; - } else { - data_[head_] = std::move(data); - head_ = (head_ + 1) % kCapacity; - } - } - - // Returns the data of the first element in the buffer and removes it from - // the buffer. If the buffer is empty, returns absl::nullopt. - absl::optional PopIfNotEmpty() { - if (!size_) return absl::nullopt; - T data = std::move(data_[head_]); - --size_; - head_ = (head_ + 1) % kCapacity; - return data; - } - - void Clear() { - head_ = 0; - size_ = 0; - } - - RingBufferIterator begin() const { return RingBufferIterator(this); } - - RingBufferIterator end() const { return RingBufferIterator(); } - - private: - friend class RingBufferIterator; - std::array data_; - int head_ = 0; - int size_ = 0; -}; - -} // namespace grpc_core - -#endif // GRPC_SRC_CORE_UTIL_RING_BUFFER_H diff --git a/src/core/util/unique_ptr_with_bitset.h b/src/core/util/unique_ptr_with_bitset.h deleted file mode 100644 index 112c3ea49ec6c..0000000000000 --- a/src/core/util/unique_ptr_with_bitset.h +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2024 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_SRC_CORE_UTIL_UNIQUE_PTR_WITH_BITSET_H -#define GRPC_SRC_CORE_UTIL_UNIQUE_PTR_WITH_BITSET_H - -#include -#include - -#include "absl/log/check.h" -#include "absl/numeric/bits.h" - -namespace grpc_core { - -// Like std::unique_ptr, but also includes a small bitset stored in the lower -// bits of the underlying T*. -template -class UniquePtrWithBitset { - public: - UniquePtrWithBitset() : p_(0) {} - // NOLINTNEXTLINE(google-explicit-constructor) - UniquePtrWithBitset(std::nullptr_t) : p_(0) {} - explicit UniquePtrWithBitset(T* p) : p_(reinterpret_cast(p)) {} - // NOLINTNEXTLINE(google-explicit-constructor) - UniquePtrWithBitset(std::unique_ptr&& p) - : UniquePtrWithBitset(p.release()) {} - ~UniquePtrWithBitset() { - DCHECK_LE(kBits, static_cast(absl::countr_zero(alignof(T)))); - delete get(); - } - UniquePtrWithBitset(const UniquePtrWithBitset&) = delete; - UniquePtrWithBitset& operator=(const UniquePtrWithBitset&) = delete; - UniquePtrWithBitset(UniquePtrWithBitset&& other) noexcept - : p_(std::exchange(other.p_, 0)) {} - UniquePtrWithBitset& operator=(UniquePtrWithBitset&& other) noexcept { - p_ = std::exchange(other.p_, 0); - return *this; - } - - T* get() const { return reinterpret_cast(p_ & ~kBitMask); } - T* operator->() const { return get(); } - T& operator*() const { return *get(); } - explicit operator bool() const { return get() != nullptr; } - void reset(T* p = nullptr) { - uintptr_t bits = p_ & kBitMask; - delete get(); - p_ = reinterpret_cast(p) | bits; - } - - void SetBit(size_t bit) { - DCHECK_LT(bit, kBits); - p_ |= 1 << bit; - } - void ClearBit(size_t bit) { - DCHECK_LT(bit, kBits); - p_ &= ~(1 << bit); - } - bool TestBit(size_t bit) const { - DCHECK_LT(bit, kBits); - return p_ & (1 << bit); - } - - friend bool operator==(const UniquePtrWithBitset& a, - const UniquePtrWithBitset& b) { - return a.p_ == b.p_; - } - - private: - static constexpr uintptr_t kBitMask = (1 << kBits) - 1; - uintptr_t p_; -}; - -} // namespace grpc_core - -#endif // GRPC_SRC_CORE_UTIL_UNIQUE_PTR_WITH_BITSET_H diff --git a/src/objective-c/BoringSSL-GRPC.podspec b/src/objective-c/BoringSSL-GRPC.podspec index 260f6c6b908c9..85c27a09dc955 100644 --- a/src/objective-c/BoringSSL-GRPC.podspec +++ b/src/objective-c/BoringSSL-GRPC.podspec @@ -76,7 +76,7 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/google/boringssl.git', - :commit => "16c8d3db1af20fcc04b5190b25242aadcb1fbb30", + :commit => "b8a2bffc598f230484ff48a247526a9820facfc2", } s.ios.deployment_target = '10.0' diff --git a/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py b/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py index 88c521a446712..36a971be68417 100644 --- a/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py +++ b/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py @@ -28,6 +28,7 @@ _SERVICE_NAME = "test" _UNARY_UNARY = "UnaryUnary" _REQUEST = b"0000" +_UDS_PATH = "/tmp/grpc_fullstack_test.sock" def _unary_unary_handler(request, context): @@ -52,13 +53,17 @@ def contextvars_supported(): def _server(): try: server = test_common.test_server() - target = "localhost:0" - port = server.add_insecure_port(target) server.add_registered_method_handlers(_SERVICE_NAME, _METHOD_HANDLERS) + server_creds = grpc.local_server_credentials( + grpc.LocalConnectionType.UDS + ) + server.add_secure_port(f"unix:{_UDS_PATH}", server_creds) server.start() - yield port + yield _UDS_PATH finally: server.stop(None) + if os.path.exists(_UDS_PATH): + os.remove(_UDS_PATH) if contextvars_supported(): @@ -103,9 +108,10 @@ def __call__(self, context, callback): class ContextVarsPropagationTest(unittest.TestCase): def test_propagation_to_auth_plugin(self): set_up_expected_context() - with _server() as port: - target = "localhost:{}".format(port) - local_credentials = grpc.local_channel_credentials() + with _server() as uds_path: + local_credentials = grpc.local_channel_credentials( + grpc.LocalConnectionType.UDS + ) test_call_credentials = TestCallCredentials() call_credentials = grpc.metadata_call_credentials( test_call_credentials, "test call credentials" @@ -113,7 +119,9 @@ def test_propagation_to_auth_plugin(self): composite_credentials = grpc.composite_channel_credentials( local_credentials, call_credentials ) - with grpc.secure_channel(target, composite_credentials) as channel: + with grpc.secure_channel( + f"unix:{uds_path}", composite_credentials + ) as channel: stub = channel.unary_unary( grpc._common.fully_qualified_method( _SERVICE_NAME, _UNARY_UNARY @@ -128,9 +136,10 @@ def test_concurrent_propagation(self): _RPC_COUNT = 32 set_up_expected_context() - with _server() as port: - target = "localhost:{}".format(port) - local_credentials = grpc.local_channel_credentials() + with _server() as uds_path: + local_credentials = grpc.local_channel_credentials( + grpc.LocalConnectionType.UDS + ) test_call_credentials = TestCallCredentials() call_credentials = grpc.metadata_call_credentials( test_call_credentials, "test call credentials" @@ -143,7 +152,7 @@ def test_concurrent_propagation(self): def _run_on_thread(exception_queue): try: with grpc.secure_channel( - target, composite_credentials + f"unix:{uds_path}", composite_credentials ) as channel: stub = channel.unary_unary( grpc._common.fully_qualified_method( diff --git a/test/core/client_channel/bm_load_balanced_call_destination.cc b/test/core/client_channel/bm_load_balanced_call_destination.cc deleted file mode 100644 index a9024edb7685a..0000000000000 --- a/test/core/client_channel/bm_load_balanced_call_destination.cc +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2024 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 - -#include "absl/memory/memory.h" -#include "absl/strings/string_view.h" - -#include - -#include "src/core/client_channel/load_balanced_call_destination.h" -#include "src/core/lib/address_utils/parse_address.h" -#include "test/core/transport/call_spine_benchmarks.h" - -namespace grpc_core { -namespace { - -const Slice kTestPath = Slice::FromExternalString("/foo/bar"); - -class LoadBalancedCallDestinationTraits { - public: - RefCountedPtr CreateCallDestination( - RefCountedPtr final_destination) { - picker_observable_.Set(MakeRefCounted( - MakeRefCounted(std::move(final_destination)))); - return MakeRefCounted(picker_observable_); - } - - ClientMetadataHandle MakeClientInitialMetadata() { - auto md = Arena::MakePooled(); - md->Set(HttpPathMetadata(), kTestPath.Copy()); - return md; - } - - ServerMetadataHandle MakeServerInitialMetadata() { - return Arena::MakePooled(); - } - - MessageHandle MakePayload() { return Arena::MakePooled(); } - - ServerMetadataHandle MakeServerTrailingMetadata() { - return Arena::MakePooled(); - } - - private: - class TestSubchannel : public SubchannelInterfaceWithCallDestination { - public: - explicit TestSubchannel( - RefCountedPtr call_destination) - : call_destination_(std::move(call_destination)) {} - - void WatchConnectivityState( - std::unique_ptr) override { - Crash("not implemented"); - } - void CancelConnectivityStateWatch( - ConnectivityStateWatcherInterface*) override { - Crash("not implemented"); - } - void RequestConnection() override { Crash("not implemented"); } - void ResetBackoff() override { Crash("not implemented"); } - void AddDataWatcher(std::unique_ptr) override { - Crash("not implemented"); - } - void CancelDataWatcher(DataWatcherInterface*) override { - Crash("not implemented"); - } - RefCountedPtr call_destination() override { - return call_destination_; - } - - private: - const RefCountedPtr call_destination_; - }; - - class TestPicker final : public LoadBalancingPolicy::SubchannelPicker { - public: - explicit TestPicker(RefCountedPtr subchannel) - : subchannel_{subchannel} {} - - LoadBalancingPolicy::PickResult Pick( - LoadBalancingPolicy::PickArgs) override { - return LoadBalancingPolicy::PickResult::Complete(subchannel_); - } - - private: - RefCountedPtr subchannel_; - }; - - ClientChannel::PickerObservable picker_observable_{nullptr}; -}; -GRPC_CALL_SPINE_BENCHMARK( - UnstartedCallDestinationFixture); - -void BM_LoadBalancedCallDestination(benchmark::State& state) { - class FinalDestination : public UnstartedCallDestination { - public: - void StartCall(UnstartedCallHandler) override {} - void Orphaned() override {} - }; - LoadBalancedCallDestinationTraits traits; - auto final_destination = MakeRefCounted(); - for (auto _ : state) { - traits.CreateCallDestination(final_destination); - } -} -BENCHMARK(BM_LoadBalancedCallDestination); - -} // namespace -} // namespace grpc_core - -// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, -// and others do not. This allows us to support both modes. -namespace benchmark { -void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } -} // namespace benchmark - -int main(int argc, char** argv) { - ::benchmark::Initialize(&argc, argv); - grpc_init(); - { - auto ee = grpc_event_engine::experimental::GetDefaultEventEngine(); - benchmark::RunTheBenchmarksNamespaced(); - } - grpc_shutdown(); - return 0; -} diff --git a/test/core/end2end/end2end_test_suites.cc b/test/core/end2end/end2end_test_suites.cc index 047c2a7f3d974..5f17cd02bd62c 100644 --- a/test/core/end2end/end2end_test_suites.cc +++ b/test/core/end2end/end2end_test_suites.cc @@ -645,7 +645,8 @@ std::vector DefaultConfigs() { FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | FEATURE_MASK_IS_HTTP2 | FEATURE_MASK_DO_NOT_FUZZ | - FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS, + FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS | + FEATURE_MASK_IS_LOCAL_CREDS, nullptr, [](const ChannelArgs& /*client_args*/, const ChannelArgs& /*server_args*/) { @@ -658,7 +659,8 @@ std::vector DefaultConfigs() { FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | FEATURE_MASK_IS_HTTP2 | FEATURE_MASK_DO_NOT_FUZZ | - FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS, + FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS | + FEATURE_MASK_IS_LOCAL_CREDS, nullptr, [](const ChannelArgs& /*client_args*/, const ChannelArgs& /*server_args*/) { diff --git a/test/core/end2end/end2end_tests.h b/test/core/end2end/end2end_tests.h index e37f3f4939cb0..e664062a17ab2 100644 --- a/test/core/end2end/end2end_tests.h +++ b/test/core/end2end/end2end_tests.h @@ -84,6 +84,7 @@ // Exclude this fixture from experiment runs #define FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS (1 << 14) #define FEATURE_MASK_IS_CALL_V3 (1 << 15) +#define FEATURE_MASK_IS_LOCAL_CREDS (1 << 16) #define FAIL_AUTH_CHECK_SERVER_ARG_NAME "fail_auth_check" @@ -683,6 +684,11 @@ class CoreEnd2endTestRegistry { GTEST_SKIP() << "Disabled for initial v3 testing"; \ } +#define SKIP_IF_LOCAL_CREDS() \ + if (GetParam()->feature_mask & FEATURE_MASK_IS_LOCAL_CREDS) { \ + GTEST_SKIP() << "Disabled for Local TCP Connection"; \ + } + #define CORE_END2END_TEST(suite, name) \ class CoreEnd2endTest_##suite##_##name : public grpc_core::suite { \ public: \ diff --git a/test/core/end2end/fuzzers/connector_fuzzer.cc b/test/core/end2end/fuzzers/connector_fuzzer.cc deleted file mode 100644 index 5c230c4929760..0000000000000 --- a/test/core/end2end/fuzzers/connector_fuzzer.cc +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright 2024 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 "test/core/end2end/fuzzers/connector_fuzzer.h" - -#include "src/core/lib/address_utils/parse_address.h" -#include "src/core/lib/event_engine/channel_args_endpoint_config.h" -#include "src/core/lib/event_engine/default_event_engine.h" -#include "src/core/lib/event_engine/tcp_socket_utils.h" -#include "src/core/lib/gprpp/env.h" -#include "src/core/lib/iomgr/executor.h" -#include "src/core/lib/iomgr/timer_manager.h" -#include "test/core/end2end/fuzzers/fuzzer_input.pb.h" -#include "test/core/end2end/fuzzers/network_input.h" -#include "test/core/test_util/fuzz_config_vars.h" -#include "test/core/test_util/test_config.h" - -bool squelch = true; -bool leak_check = true; - -using ::grpc_event_engine::experimental::ChannelArgsEndpointConfig; -using ::grpc_event_engine::experimental::EventEngine; -using ::grpc_event_engine::experimental::FuzzingEventEngine; -using ::grpc_event_engine::experimental::GetDefaultEventEngine; -using ::grpc_event_engine::experimental::MockEndpointController; -using ::grpc_event_engine::experimental::SetEventEngineFactory; -using ::grpc_event_engine::experimental::URIToResolvedAddress; - -namespace grpc_core { -namespace { - -class ConnectorFuzzer { - public: - ConnectorFuzzer( - const fuzzer_input::Msg& msg, - absl::FunctionRef()> - make_security_connector, - absl::FunctionRef()> make_connector) - : make_security_connector_(make_security_connector), - engine_([actions = msg.event_engine_actions()]() { - SetEventEngineFactory([actions]() -> std::unique_ptr { - return std::make_unique( - FuzzingEventEngine::Options(), actions); - }); - return std::dynamic_pointer_cast( - GetDefaultEventEngine()); - }()), - mock_endpoint_controller_(MockEndpointController::Create(engine_)), - connector_(make_connector()) { - CHECK(engine_); - for (const auto& input : msg.network_input()) { - network_inputs_.push(input); - } - grpc_timer_manager_set_start_threaded(false); - grpc_init(); - ExecCtx exec_ctx; - Executor::SetThreadingAll(false); - listener_ = - engine_ - ->CreateListener( - [this](std::unique_ptr endpoint, - MemoryAllocator) { - if (network_inputs_.empty()) return; - ScheduleWrites(network_inputs_.front(), std::move(endpoint), - engine_.get()); - network_inputs_.pop(); - }, - [](absl::Status) {}, ChannelArgsEndpointConfig(ChannelArgs{}), - std::make_unique("foo")) - .value(); - if (msg.has_shutdown_connector() && - msg.shutdown_connector().delay_ms() > 0) { - auto shutdown_connector = msg.shutdown_connector(); - const auto delay = Duration::Milliseconds(shutdown_connector.delay_ms()); - engine_->RunAfterExactly(delay, [this, shutdown_connector = std::move( - shutdown_connector)]() { - if (connector_ == nullptr) return; - connector_->Shutdown(absl::Status( - static_cast(shutdown_connector.shutdown_status()), - shutdown_connector.shutdown_message())); - }); - } - // Abbreviated runtime for interpreting API actions, since we simply don't - // support many here. - uint64_t when_ms = 0; - for (const auto& action : msg.api_actions()) { - switch (action.type_case()) { - default: - break; - case api_fuzzer::Action::kSleepMs: - when_ms += action.sleep_ms(); - break; - case api_fuzzer::Action::kResizeResourceQuota: - engine_->RunAfterExactly( - Duration::Milliseconds(when_ms), - [this, new_size = action.resize_resource_quota()]() { - resource_quota_->memory_quota()->SetSize(new_size); - }); - when_ms += 1; - break; - } - } - } - - ~ConnectorFuzzer() { - listener_.reset(); - connector_.reset(); - mock_endpoint_controller_.reset(); - engine_->TickUntilIdle(); - grpc_shutdown_blocking(); - engine_->UnsetGlobalHooks(); - } - - void Run() { - grpc_resolved_address addr; - CHECK(grpc_parse_uri(URI::Parse("ipv4:127.0.0.1:1234").value(), &addr)); - CHECK_OK( - listener_->Bind(URIToResolvedAddress("ipv4:127.0.0.1:1234").value())); - CHECK_OK(listener_->Start()); - OrphanablePtr endpoint( - mock_endpoint_controller_->TakeCEndpoint()); - SubchannelConnector::Result result; - bool done = false; - auto channel_args = ChannelArgs{}.SetObject(engine_).SetObject( - resource_quota_); - auto security_connector = make_security_connector_(); - if (security_connector != nullptr) { - channel_args = channel_args.SetObject(std::move(security_connector)); - } - connector_->Connect( - SubchannelConnector::Args{&addr, nullptr, - Timestamp::Now() + Duration::Seconds(20), - channel_args}, - &result, NewClosure([&done, &result](grpc_error_handle status) { - done = true; - if (status.ok()) result.transport->Orphan(); - })); - - while (!done) { - engine_->Tick(); - grpc_timer_manager_tick(); - } - } - - private: - RefCountedPtr resource_quota_ = - MakeRefCounted("fuzzer"); - absl::FunctionRef()> - make_security_connector_; - std::shared_ptr engine_; - std::queue network_inputs_; - std::shared_ptr mock_endpoint_controller_; - std::unique_ptr listener_; - OrphanablePtr connector_; -}; - -} // namespace - -void RunConnectorFuzzer( - const fuzzer_input::Msg& msg, - absl::FunctionRef()> - make_security_connector, - absl::FunctionRef()> make_connector) { - if (squelch && !GetEnv("GRPC_TRACE_FUZZER").has_value()) { - grpc_disable_all_absl_logs(); - } - static const int once = []() { - ForceEnableExperiment("event_engine_client", true); - ForceEnableExperiment("event_engine_listener", true); - return 42; - }(); - CHECK_EQ(once, 42); // avoid unused variable warning - ApplyFuzzConfigVars(msg.config_vars()); - TestOnlyReloadExperimentsFromConfigVariables(); - ConnectorFuzzer(msg, make_security_connector, make_connector).Run(); -} - -} // namespace grpc_core diff --git a/test/core/end2end/fuzzers/connector_fuzzer.h b/test/core/end2end/fuzzers/connector_fuzzer.h deleted file mode 100644 index 64b78aeb0bf6b..0000000000000 --- a/test/core/end2end/fuzzers/connector_fuzzer.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2024 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_TEST_CORE_END2END_FUZZERS_CONNECTOR_FUZZER_H -#define GRPC_TEST_CORE_END2END_FUZZERS_CONNECTOR_FUZZER_H - -#include "absl/functional/function_ref.h" - -#include "src/core/client_channel/connector.h" -#include "src/core/lib/security/security_connector/security_connector.h" -#include "test/core/end2end/fuzzers/fuzzer_input.pb.h" - -namespace grpc_core { - -void RunConnectorFuzzer( - const fuzzer_input::Msg& msg, - absl::FunctionRef()> - make_security_connector, - absl::FunctionRef()> make_connector); - -} - -#endif // GRPC_TEST_CORE_END2END_FUZZERS_CONNECTOR_FUZZER_H diff --git a/test/core/end2end/fuzzers/connector_fuzzer_chttp2.cc b/test/core/end2end/fuzzers/connector_fuzzer_chttp2.cc deleted file mode 100644 index 4c3e531189fee..0000000000000 --- a/test/core/end2end/fuzzers/connector_fuzzer_chttp2.cc +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2024 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 -#include -#include - -#include "src/core/ext/transport/chttp2/client/chttp2_connector.h" -#include "src/libfuzzer/libfuzzer_macro.h" -#include "test/core/end2end/fuzzers/connector_fuzzer.h" - -DEFINE_PROTO_FUZZER(const fuzzer_input::Msg& msg) { - grpc_core::RunConnectorFuzzer( - msg, - []() { - return grpc_core::RefCountedPtr(); - }, - []() { return grpc_core::MakeOrphanable(); }); -} diff --git a/test/core/end2end/fuzzers/connector_fuzzer_chttp2_corpus/empty b/test/core/end2end/fuzzers/connector_fuzzer_chttp2_corpus/empty deleted file mode 100644 index 8b137891791fe..0000000000000 --- a/test/core/end2end/fuzzers/connector_fuzzer_chttp2_corpus/empty +++ /dev/null @@ -1 +0,0 @@ - diff --git a/test/core/end2end/fuzzers/connector_fuzzer_chttp2_fakesec.cc b/test/core/end2end/fuzzers/connector_fuzzer_chttp2_fakesec.cc deleted file mode 100644 index aaccced6543ca..0000000000000 --- a/test/core/end2end/fuzzers/connector_fuzzer_chttp2_fakesec.cc +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2024 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 -#include -#include - -#include "src/core/ext/transport/chttp2/client/chttp2_connector.h" -#include "src/core/lib/security/credentials/credentials.h" -#include "src/core/lib/security/credentials/fake/fake_credentials.h" -#include "src/core/lib/security/security_connector/fake/fake_security_connector.h" -#include "src/libfuzzer/libfuzzer_macro.h" -#include "test/core/end2end/fuzzers/connector_fuzzer.h" - -DEFINE_PROTO_FUZZER(const fuzzer_input::Msg& msg) { - grpc_core::RunConnectorFuzzer( - msg, - []() { - return grpc_fake_channel_security_connector_create( - grpc_core::RefCountedPtr( - grpc_fake_transport_security_credentials_create()), - nullptr, "foobar", grpc_core::ChannelArgs{}); - }, - []() { return grpc_core::MakeOrphanable(); }); -} diff --git a/test/core/end2end/fuzzers/connector_fuzzer_chttp2_fakesec_corpus/empty b/test/core/end2end/fuzzers/connector_fuzzer_chttp2_fakesec_corpus/empty deleted file mode 100644 index 8b137891791fe..0000000000000 --- a/test/core/end2end/fuzzers/connector_fuzzer_chttp2_fakesec_corpus/empty +++ /dev/null @@ -1 +0,0 @@ - diff --git a/test/core/end2end/fuzzers/server_fuzzer_chttp2_fake_creds.cc b/test/core/end2end/fuzzers/server_fuzzer_chttp2_fake_creds.cc deleted file mode 100644 index 1167b3d89b844..0000000000000 --- a/test/core/end2end/fuzzers/server_fuzzer_chttp2_fake_creds.cc +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2024 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 -#include - -#include "src/core/lib/security/credentials/fake/fake_credentials.h" -#include "src/libfuzzer/libfuzzer_macro.h" -#include "test/core/end2end/fuzzers/server_fuzzer.h" - -DEFINE_PROTO_FUZZER(const fuzzer_input::Msg& msg) { - grpc_core::RunServerFuzzer(msg, [](grpc_server* server, int port_num, - const grpc_core::ChannelArgs&) { - auto* creds = grpc_fake_transport_security_server_credentials_create(); - grpc_server_add_http2_port( - server, absl::StrCat("0.0.0.0:", port_num).c_str(), creds); - grpc_server_credentials_release(creds); - }); -} diff --git a/test/core/end2end/fuzzers/server_fuzzer_chttp2_fake_creds_corpus/empty b/test/core/end2end/fuzzers/server_fuzzer_chttp2_fake_creds_corpus/empty deleted file mode 100644 index 8b137891791fe..0000000000000 --- a/test/core/end2end/fuzzers/server_fuzzer_chttp2_fake_creds_corpus/empty +++ /dev/null @@ -1 +0,0 @@ - diff --git a/test/core/end2end/tests/call_creds.cc b/test/core/end2end/tests/call_creds.cc index fd89930a96754..2fb1e8eb067f7 100644 --- a/test/core/end2end/tests/call_creds.cc +++ b/test/core/end2end/tests/call_creds.cc @@ -264,11 +264,17 @@ CORE_END2END_TEST(PerCallCredsOnInsecureTest, } CORE_END2END_TEST(PerCallCredsTest, RequestResponseWithPayloadAndCallCreds) { + if (IsLocalConnectorSecureEnabled()) { + SKIP_IF_LOCAL_CREDS(); + } TestRequestResponseWithPayloadAndCallCreds(*this, true); } CORE_END2END_TEST(PerCallCredsTest, RequestResponseWithPayloadAndOverriddenCallCreds) { + if (IsLocalConnectorSecureEnabled()) { + SKIP_IF_LOCAL_CREDS(); + } TestRequestResponseWithPayloadAndOverriddenCallCreds(*this, true); } diff --git a/test/core/load_balancing/bm_picker.cc b/test/core/load_balancing/bm_picker.cc deleted file mode 100644 index fb16691674e3c..0000000000000 --- a/test/core/load_balancing/bm_picker.cc +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright 2024 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 - -#include - -#include "absl/strings/string_view.h" - -#include - -#include "src/core/client_channel/subchannel_interface_internal.h" -#include "src/core/lib/address_utils/parse_address.h" -#include "src/core/lib/config/core_configuration.h" -#include "src/core/lib/event_engine/channel_args_endpoint_config.h" -#include "src/core/lib/event_engine/default_event_engine.h" -#include "src/core/lib/transport/connectivity_state.h" -#include "src/core/load_balancing/health_check_client_internal.h" -#include "src/core/load_balancing/lb_policy.h" -#include "src/core/util/json/json_reader.h" -#include "test/core/test_util/build.h" - -namespace grpc_core { -namespace { - -bool IsSlowBuild() { return BuiltUnderMsan() || BuiltUnderUbsan(); } - -class BenchmarkHelper : public std::enable_shared_from_this { - public: - BenchmarkHelper(absl::string_view name, absl::string_view config) - : name_(name), config_json_(config) { - CHECK(lb_policy_ != nullptr) << "Failed to create LB policy: " << name; - auto parsed_json = JsonParse(std::string(config_json_)); - CHECK_OK(parsed_json); - auto config_parsed = - CoreConfiguration::Get().lb_policy_registry().ParseLoadBalancingConfig( - *parsed_json); - CHECK_OK(config_parsed); - config_ = std::move(*config_parsed); - } - - RefCountedPtr GetPicker() { - MutexLock lock(&mu_); - while (picker_ == nullptr) { - cv_.Wait(&mu_); - } - return picker_; - } - - void UpdateLbPolicy(size_t num_endpoints) { - { - MutexLock lock(&mu_); - picker_ = nullptr; - work_serializer_->Schedule( - [this, num_endpoints]() { - EndpointAddressesList addresses; - for (size_t i = 0; i < num_endpoints; i++) { - grpc_resolved_address addr; - int port = i % 65536; - int ip = i / 65536; - CHECK_LT(ip, 256); - CHECK(grpc_parse_uri( - URI::Parse(absl::StrCat("ipv4:127.0.0.", ip, ":", port)) - .value(), - &addr)); - addresses.emplace_back(addr, ChannelArgs()); - } - CHECK_OK(lb_policy_->UpdateLocked(LoadBalancingPolicy::UpdateArgs{ - std::make_shared( - std::move(addresses)), - config_, "", ChannelArgs()})); - }, - DEBUG_LOCATION); - } - work_serializer_->DrainQueue(); - } - - private: - class SubchannelFake final : public SubchannelInterface { - public: - explicit SubchannelFake(BenchmarkHelper* helper) : helper_(helper) {} - - void WatchConnectivityState( - std::unique_ptr unique_watcher) - override { - AddConnectivityWatcherInternal( - std::shared_ptr( - std::move(unique_watcher))); - } - - void CancelConnectivityStateWatch( - ConnectivityStateWatcherInterface* watcher) override { - MutexLock lock(&helper_->mu_); - helper_->connectivity_watchers_.erase(watcher); - } - - void RequestConnection() override { LOG(FATAL) << "unimplemented"; } - - void ResetBackoff() override { LOG(FATAL) << "unimplemented"; } - - void AddDataWatcher( - std::unique_ptr watcher) override { - auto* watcher_internal = - DownCast(watcher.get()); - if (watcher_internal->type() == HealthProducer::Type()) { - AddConnectivityWatcherInternal( - DownCast(watcher_internal)->TakeWatcher()); - } else { - LOG(FATAL) << "unimplemented watcher type: " - << watcher_internal->type(); - } - } - - void CancelDataWatcher(DataWatcherInterface* watcher) override {} - - private: - void AddConnectivityWatcherInternal( - std::shared_ptr watcher) { - { - MutexLock lock(&helper_->mu_); - helper_->work_serializer_->Schedule( - [watcher]() { - watcher->OnConnectivityStateChange(GRPC_CHANNEL_READY, - absl::OkStatus()); - }, - DEBUG_LOCATION); - helper_->connectivity_watchers_.insert(std::move(watcher)); - } - helper_->work_serializer_->DrainQueue(); - } - - BenchmarkHelper* helper_; - }; - - class LbHelper final : public LoadBalancingPolicy::ChannelControlHelper { - public: - explicit LbHelper(BenchmarkHelper* helper) : helper_(helper) {} - - RefCountedPtr CreateSubchannel( - const grpc_resolved_address& address, - const ChannelArgs& per_address_args, const ChannelArgs& args) override { - return MakeRefCounted(helper_); - } - - void UpdateState( - grpc_connectivity_state state, const absl::Status& status, - RefCountedPtr picker) override { - MutexLock lock(&helper_->mu_); - helper_->picker_ = std::move(picker); - helper_->cv_.SignalAll(); - } - - void RequestReresolution() override { LOG(FATAL) << "unimplemented"; } - - absl::string_view GetTarget() override { return "foo"; } - - absl::string_view GetAuthority() override { return "foo"; } - - RefCountedPtr GetChannelCredentials() override { - LOG(FATAL) << "unimplemented"; - } - - RefCountedPtr GetUnsafeChannelCredentials() - override { - LOG(FATAL) << "unimplemented"; - } - - grpc_event_engine::experimental::EventEngine* GetEventEngine() override { - return helper_->event_engine_.get(); - } - - GlobalStatsPluginRegistry::StatsPluginGroup& GetStatsPluginGroup() - override { - return helper_->stats_plugin_group_; - } - - void AddTraceEvent(TraceSeverity severity, - absl::string_view message) override { - LOG(FATAL) << "unimplemented"; - } - - BenchmarkHelper* helper_; - }; - - const absl::string_view name_; - const absl::string_view config_json_; - std::shared_ptr event_engine_ = - grpc_event_engine::experimental::GetDefaultEventEngine(); - std::shared_ptr work_serializer_ = - std::make_shared(event_engine_); - OrphanablePtr lb_policy_ = - CoreConfiguration::Get().lb_policy_registry().CreateLoadBalancingPolicy( - name_, LoadBalancingPolicy::Args{work_serializer_, - std::make_unique(this), - ChannelArgs()}); - RefCountedPtr config_; - Mutex mu_; - CondVar cv_; - RefCountedPtr picker_ - ABSL_GUARDED_BY(mu_); - absl::flat_hash_set< - std::shared_ptr> - connectivity_watchers_ ABSL_GUARDED_BY(mu_); - GlobalStatsPluginRegistry::StatsPluginGroup stats_plugin_group_ = - GlobalStatsPluginRegistry::GetStatsPluginsForChannel( - experimental::StatsPluginChannelScope( - "foo", "foo", - grpc_event_engine::experimental::ChannelArgsEndpointConfig{ - ChannelArgs{}})); -}; - -void BM_Pick(benchmark::State& state, BenchmarkHelper& helper) { - helper.UpdateLbPolicy(state.range(0)); - auto picker = helper.GetPicker(); - for (auto _ : state) { - picker->Pick(LoadBalancingPolicy::PickArgs{ - "/foo/bar", - nullptr, - nullptr, - }); - } -} -#define PICKER_BENCHMARK(policy, config) \ - BENCHMARK_CAPTURE(BM_Pick, policy, \ - []() -> BenchmarkHelper& { \ - static auto* helper = \ - new BenchmarkHelper(#policy, config); \ - return *helper; \ - }()) \ - ->RangeMultiplier(10) \ - ->Range(1, IsSlowBuild() ? 1000 : 100000) - -PICKER_BENCHMARK(pick_first, "[{\"pick_first\":{}}]"); -PICKER_BENCHMARK( - weighted_round_robin, - "[{\"weighted_round_robin\":{\"enableOobLoadReport\":false}}]"); - -} // namespace -} // namespace grpc_core - -// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, -// and others do not. This allows us to support both modes. -namespace benchmark { -void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } -} // namespace benchmark - -int main(int argc, char** argv) { - ::benchmark::Initialize(&argc, argv); - grpc_init(); - benchmark::RunTheBenchmarksNamespaced(); - grpc_shutdown(); - return 0; -} diff --git a/test/core/security/BUILD b/test/core/security/BUILD index 4fec75a477cf6..f87d78f5b1908 100644 --- a/test/core/security/BUILD +++ b/test/core/security/BUILD @@ -379,6 +379,23 @@ grpc_cc_test( ], ) +grpc_cc_test( + name = "local_security_connector_test", + srcs = ["local_security_connector_test.cc"], + external_deps = [ + "absl/log:check", + "gtest", + ], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//src/core:channel_args", + "//test/core/test_util:grpc_test_util", + "//test/core/test_util:grpc_test_util_base", + ], +) + grpc_cc_test( name = "grpc_tls_credentials_options_test", srcs = ["grpc_tls_credentials_options_test.cc"], diff --git a/test/core/security/local_security_connector_test.cc b/test/core/security/local_security_connector_test.cc new file mode 100644 index 0000000000000..a6c14c7871ab8 --- /dev/null +++ b/test/core/security/local_security_connector_test.cc @@ -0,0 +1,140 @@ +// +// +// Copyright 2024 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 + +#include + +#include "src/core/client_channel/client_channel_filter.h" +#include "src/core/lib/security/context/security_context.h" +#include "src/core/tsi/transport_security.h" +#include "test/core/test_util/test_config.h" + +namespace grpc_core { +namespace testing { +namespace { + +absl::string_view GetLocalUnixAddress(grpc_endpoint* /*ep*/) { return "unix:"; } + +const grpc_endpoint_vtable kUnixEndpointVtable = { + nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, GetLocalUnixAddress, + nullptr, nullptr}; + +absl::string_view GetLocalTcpAddress(grpc_endpoint* /*ep*/) { + return "ipv4:127.0.0.1:12667"; +} + +const grpc_endpoint_vtable kTcpEndpointVtable = { + nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, GetLocalTcpAddress, + nullptr, nullptr}; + +void CheckSecurityLevelForServer(grpc_local_connect_type connect_type, + tsi_security_level level, grpc_endpoint ep) { + grpc_server_credentials* server_creds = + grpc_local_server_credentials_create(connect_type); + ChannelArgs args; + RefCountedPtr connector = + server_creds->create_security_connector(args); + ASSERT_NE(connector, nullptr); + tsi_peer peer; + CHECK(tsi_construct_peer(0, &peer) == TSI_OK); + + RefCountedPtr auth_context; + connector->check_peer(peer, &ep, args, &auth_context, nullptr); + tsi_peer_destruct(&peer); + auto it = grpc_auth_context_find_properties_by_name( + auth_context.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME); + const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it); + ASSERT_NE(prop, nullptr); + EXPECT_STREQ(prop->value, tsi_security_level_to_string(level)); + connector.reset(); + auth_context.reset(); + grpc_server_credentials_release(server_creds); +} + +void CheckSecurityLevelForChannel(grpc_local_connect_type connect_type, + tsi_security_level level, grpc_endpoint ep) { + grpc_channel_credentials* channel_creds = + grpc_local_credentials_create(connect_type); + ChannelArgs args; + args = args.Set((char*)GRPC_ARG_SERVER_URI, (char*)"unix:"); + RefCountedPtr connector = + channel_creds->create_security_connector(nullptr, "unix:", &args); + ASSERT_NE(connector, nullptr); + tsi_peer peer; + CHECK(tsi_construct_peer(0, &peer) == TSI_OK); + RefCountedPtr auth_context; + connector->check_peer(peer, &ep, args, &auth_context, nullptr); + tsi_peer_destruct(&peer); + + auto it = grpc_auth_context_find_properties_by_name( + auth_context.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME); + const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it); + ASSERT_NE(prop, nullptr); + EXPECT_STREQ(prop->value, tsi_security_level_to_string(level)); + + connector.reset(); + auth_context.reset(); + grpc_channel_credentials_release(channel_creds); +} + +TEST(LocalSecurityConnectorTest, CheckSecurityLevelOfUdsConnectionServer) { + grpc_endpoint ep; + ep.vtable = &kUnixEndpointVtable; + CheckSecurityLevelForServer(UDS, TSI_PRIVACY_AND_INTEGRITY, ep); +} + +TEST(LocalSecurityConnectorTest, SecurityLevelOfTcpConnectionServer) { + if (!IsLocalConnectorSecureEnabled()) { + return; + } + grpc_endpoint ep; + ep.vtable = &kTcpEndpointVtable; + CheckSecurityLevelForServer(LOCAL_TCP, TSI_SECURITY_NONE, ep); +} + +TEST(LocalSecurityConnectorTest, CheckSecurityLevelOfUdsConnectionChannel) { + grpc_endpoint ep; + ep.vtable = &kUnixEndpointVtable; + CheckSecurityLevelForChannel(UDS, TSI_PRIVACY_AND_INTEGRITY, ep); +} + +TEST(LocalSecurityConnectorTest, SecurityLevelOfTcpConnectionChannel) { + if (!IsLocalConnectorSecureEnabled()) { + return; + } + grpc_endpoint ep; + ep.vtable = &kTcpEndpointVtable; + CheckSecurityLevelForChannel(LOCAL_TCP, TSI_SECURITY_NONE, ep); +} + +} // namespace +} // namespace testing +} // namespace grpc_core + +int main(int argc, char** argv) { + grpc::testing::TestEnvironment env(&argc, argv); + ::testing::InitGoogleTest(&argc, argv); + grpc_init(); + LOG(ERROR) << "experiment" << grpc_core::IsLocalConnectorSecureEnabled(); + int ret = RUN_ALL_TESTS(); + grpc_shutdown(); + return ret; +} diff --git a/test/core/transport/bm_metadata.cc b/test/core/transport/bm_metadata.cc deleted file mode 100644 index 3a5bea8179d83..0000000000000 --- a/test/core/transport/bm_metadata.cc +++ /dev/null @@ -1,86 +0,0 @@ -// -// -// Copyright 2017 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 - -#include "src/core/lib/transport/metadata.h" - -namespace grpc_core { -namespace { - -void BM_MetadataMapCreateDestroy(benchmark::State& state) { - for (auto _ : state) { - auto md = Arena::MakePooledForOverwrite(); - } -} -BENCHMARK(BM_MetadataMapCreateDestroy); - -void BM_MetadataMapCreateDestroyOnStack(benchmark::State& state) { - for (auto _ : state) { - ServerMetadata md; - } -} -BENCHMARK(BM_MetadataMapCreateDestroyOnStack); - -void BM_MetadataMapCreateDestroySetStatus(benchmark::State& state) { - auto message = Slice::FromExternalString("message"); - for (auto _ : state) { - auto md = Arena::MakePooledForOverwrite(); - md->Set(GrpcStatusMetadata(), GRPC_STATUS_UNKNOWN); - md->Set(GrpcMessageMetadata(), message.Copy()); - } -} -BENCHMARK(BM_MetadataMapCreateDestroySetStatus); - -void BM_MetadataMapCreateDestroySetStatusCancelled(benchmark::State& state) { - auto message = Slice::FromExternalString("message"); - for (auto _ : state) { - auto md = Arena::MakePooledForOverwrite(); - md->Set(GrpcStatusMetadata(), GRPC_STATUS_CANCELLED); - } -} -BENCHMARK(BM_MetadataMapCreateDestroySetStatusCancelled); - -void BM_MetadataMapFromAbslStatusCancelled(benchmark::State& state) { - for (auto _ : state) { - ServerMetadataFromStatus(absl::CancelledError()); - } -} -BENCHMARK(BM_MetadataMapFromAbslStatusCancelled); - -void BM_MetadataMapFromAbslStatusOk(benchmark::State& state) { - for (auto _ : state) { - ServerMetadataFromStatus(absl::OkStatus()); - } -} -BENCHMARK(BM_MetadataMapFromAbslStatusOk); - -} // namespace -} // namespace grpc_core - -// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, -// and others do not. This allows us to support both modes. -namespace benchmark { -void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } -} // namespace benchmark - -int main(int argc, char** argv) { - ::benchmark::Initialize(&argc, argv); - benchmark::RunTheBenchmarksNamespaced(); - return 0; -} diff --git a/test/core/util/ring_buffer_test.cc b/test/core/util/ring_buffer_test.cc deleted file mode 100644 index 808018d0538c9..0000000000000 --- a/test/core/util/ring_buffer_test.cc +++ /dev/null @@ -1,89 +0,0 @@ -// -// -// Copyright 2015 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/core/util/ring_buffer.h" - -#include "gtest/gtest.h" - -#include - -namespace grpc_core { - -constexpr int kBufferCapacity = 1000; - -TEST(RingBufferTest, BufferAppendPopTest) { - RingBuffer buffer; - EXPECT_FALSE(buffer.PopIfNotEmpty().has_value()); - - for (int i = 0; i < (3 * kBufferCapacity) / 2; ++i) { - buffer.Append(i); - } - // Pop half of the elements. Elements in [kBufferCapacity / 2, - // kBufferCapacity) are popped. - int j = kBufferCapacity / 2; - for (int i = 0; i < kBufferCapacity / 2; ++i) { - EXPECT_EQ(buffer.PopIfNotEmpty(), j++); - } - EXPECT_EQ(j, kBufferCapacity); - // Iterate over the remaining elements. - for (auto it = buffer.begin(); it != buffer.end(); ++it) { - EXPECT_EQ(*it, j++); - } - // Elements in [kBufferCapacity, (3 * kBufferCapacity) / 2) should be present. - EXPECT_EQ(j, (3 * kBufferCapacity) / 2); - - // Append some more elements. The buffer should now have elements in - // [kBufferCapacity, 2 * kBufferCapacity). - for (int i = 0; i < kBufferCapacity / 2; ++i) { - buffer.Append(j++); - } - // Pop all the elements. - j = kBufferCapacity; - while (true) { - auto ret = buffer.PopIfNotEmpty(); - if (!ret.has_value()) break; - EXPECT_EQ(*ret, j++); - } - EXPECT_EQ(j, 2 * kBufferCapacity); -} - -TEST(RingBufferTest, BufferAppendIterateTest) { - RingBuffer buffer; - for (int i = 0; i < 5 * kBufferCapacity; ++i) { - buffer.Append(i); - int j = std::max(0, i + 1 - kBufferCapacity); - // If i >= kBufferCapacity, check that the buffer contains only the last - // kBufferCapacity elements [i + 1 - kBufferCapacity, i]. Otherwise check - // that the buffer contains all elements from 0 to i. - for (auto it = buffer.begin(); it != buffer.end(); ++it) { - EXPECT_EQ(*it, j++); - } - // Check that j was incremented at each step which implies that all the - // required elements were present in the buffer. - EXPECT_EQ(j, i + 1); - } - buffer.Clear(); - EXPECT_EQ(buffer.begin(), buffer.end()); -} - -} // namespace grpc_core - -int main(int argc, char** argv) { - ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/test/core/util/unique_ptr_with_bitset_test.cc b/test/core/util/unique_ptr_with_bitset_test.cc deleted file mode 100644 index e5b67a36ff9c4..0000000000000 --- a/test/core/util/unique_ptr_with_bitset_test.cc +++ /dev/null @@ -1,60 +0,0 @@ -// -// -// Copyright 2015 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/core/util/unique_ptr_with_bitset.h" - -#include - -#include -#include - -#include "gtest/gtest.h" - -#include - -namespace grpc_core { - -TEST(UniquePtrWithBitsetTest, Basic) { - UniquePtrWithBitset ptr; - EXPECT_EQ(ptr.get(), nullptr); - EXPECT_EQ(ptr.TestBit(0), false); - ptr.reset(new int(42)); - EXPECT_EQ(*ptr, 42); - EXPECT_EQ(ptr.TestBit(0), false); - ptr.SetBit(0); - EXPECT_EQ(ptr.TestBit(0), true); - ptr.reset(); - EXPECT_EQ(ptr.get(), nullptr); - EXPECT_EQ(ptr.TestBit(0), true); - ptr.ClearBit(0); - EXPECT_EQ(ptr.TestBit(0), false); - ptr.reset(new int(43)); - ptr.SetBit(0); - - UniquePtrWithBitset ptr2; - ptr2 = std::move(ptr); - EXPECT_EQ(*ptr2, 43); - EXPECT_EQ(ptr2.TestBit(0), true); -} - -} // namespace grpc_core - -int main(int argc, char** argv) { - ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/test/cpp/microbenchmarks/bm_stats_plugin.cc b/test/cpp/microbenchmarks/bm_stats_plugin.cc deleted file mode 100644 index abc55bf80c224..0000000000000 --- a/test/cpp/microbenchmarks/bm_stats_plugin.cc +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2024 The 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 - -#include - -#include "absl/log/absl_check.h" -#include "absl/strings/string_view.h" -#include "opentelemetry/sdk/metrics/meter_provider.h" - -#include - -#include "src/core/lib/event_engine/channel_args_endpoint_config.h" -#include "src/core/telemetry/metrics.h" -#include "test/core/test_util/fake_stats_plugin.h" -#include "test/core/test_util/test_config.h" -#include "test/cpp/microbenchmarks/helpers.h" -#include "test/cpp/util/test_config.h" - -namespace { - -constexpr const absl::string_view kMetricName = "test.counter"; -constexpr const absl::string_view kMetricNameWithLabels = - "test.counter_with_labels"; - -const auto kCounterHandle = - grpc_core::GlobalInstrumentsRegistry::RegisterUInt64Counter( - kMetricName, "A simple test counter", "{count}", true) - .Build(); - -const auto kCounterWithLabelsHandle = - grpc_core::GlobalInstrumentsRegistry::RegisterUInt64Counter( - kMetricNameWithLabels, "A simple test counter with labels", "{count}", - true) - .Labels("key1", "key2", "key3") - .OptionalLabels("opt_key1", "opt_key2", "opt_key3") - .Build(); - -void BM_AddCounterWithFakeStatsPlugin(benchmark::State& state) { - grpc_core::GlobalStatsPluginRegistryTestPeer:: - ResetGlobalStatsPluginRegistry(); - grpc_core::FakeStatsPluginBuilder().BuildAndRegister(); - grpc_event_engine::experimental::ChannelArgsEndpointConfig endpoint_config; - auto stats_plugin_group = - grpc_core::GlobalStatsPluginRegistry::GetStatsPluginsForChannel( - grpc_core::experimental::StatsPluginChannelScope("", "", - endpoint_config)); - for (auto _ : state) { - stats_plugin_group.AddCounter(kCounterHandle, 1, {}, {}); - } -} -BENCHMARK(BM_AddCounterWithFakeStatsPlugin); - -void BM_AddCounterWithLabelsWithFakeStatsPlugin(benchmark::State& state) { - grpc_core::GlobalStatsPluginRegistryTestPeer:: - ResetGlobalStatsPluginRegistry(); - grpc_core::FakeStatsPluginBuilder().BuildAndRegister(); - grpc_event_engine::experimental::ChannelArgsEndpointConfig endpoint_config; - auto stats_plugin_group = - grpc_core::GlobalStatsPluginRegistry::GetStatsPluginsForChannel( - grpc_core::experimental::StatsPluginChannelScope("", "", - endpoint_config)); - for (auto _ : state) { - stats_plugin_group.AddCounter(kCounterWithLabelsHandle, 1, - {"val1", "val2", "val3"}, - {"opt_val1", "opt_val2", "opt_val3"}); - } -} -BENCHMARK(BM_AddCounterWithLabelsWithFakeStatsPlugin); - -void BM_AddCounterWithOTelPlugin(benchmark::State& state) { - grpc_core::GlobalStatsPluginRegistryTestPeer:: - ResetGlobalStatsPluginRegistry(); - auto meter_provider = - std::make_shared(); - auto status = grpc::OpenTelemetryPluginBuilder() - .EnableMetrics({kMetricName}) - .SetMeterProvider(std::move(meter_provider)) - .BuildAndRegisterGlobal(); - CHECK(status.ok()); - grpc_event_engine::experimental::ChannelArgsEndpointConfig endpoint_config; - auto stats_plugin_group = - grpc_core::GlobalStatsPluginRegistry::GetStatsPluginsForChannel( - grpc_core::experimental::StatsPluginChannelScope("", "", - endpoint_config)); - for (auto _ : state) { - stats_plugin_group.AddCounter(kCounterHandle, 1, {}, {}); - } -} -BENCHMARK(BM_AddCounterWithOTelPlugin); - -void BM_AddCounterWithLabelsWithOTelPlugin(benchmark::State& state) { - grpc_core::GlobalStatsPluginRegistryTestPeer:: - ResetGlobalStatsPluginRegistry(); - auto meter_provider = - std::make_shared(); - auto status = grpc::OpenTelemetryPluginBuilder() - .EnableMetrics({kMetricName}) - .SetMeterProvider(std::move(meter_provider)) - .BuildAndRegisterGlobal(); - CHECK(status.ok()); - grpc_event_engine::experimental::ChannelArgsEndpointConfig endpoint_config; - auto stats_plugin_group = - grpc_core::GlobalStatsPluginRegistry::GetStatsPluginsForChannel( - grpc_core::experimental::StatsPluginChannelScope("", "", - endpoint_config)); - for (auto _ : state) { - stats_plugin_group.AddCounter(kCounterWithLabelsHandle, 1, - {"val1", "val2", "val3"}, - {"opt_val1", "opt_val2", "opt_val3"}); - } -} -BENCHMARK(BM_AddCounterWithLabelsWithOTelPlugin); - -void BM_AddCounterWithNoPlugin(benchmark::State& state) { - grpc_core::GlobalStatsPluginRegistryTestPeer:: - ResetGlobalStatsPluginRegistry(); - grpc_event_engine::experimental::ChannelArgsEndpointConfig endpoint_config; - auto stats_plugin_group = - grpc_core::GlobalStatsPluginRegistry::GetStatsPluginsForChannel( - grpc_core::experimental::StatsPluginChannelScope("", "", - endpoint_config)); - for (auto _ : state) { - stats_plugin_group.AddCounter(kCounterHandle, 1, {}, {}); - } -} -BENCHMARK(BM_AddCounterWithNoPlugin); - -void BM_AddCounterWithLabelsWithNoPlugin(benchmark::State& state) { - grpc_core::GlobalStatsPluginRegistryTestPeer:: - ResetGlobalStatsPluginRegistry(); - grpc_event_engine::experimental::ChannelArgsEndpointConfig endpoint_config; - auto stats_plugin_group = - grpc_core::GlobalStatsPluginRegistry::GetStatsPluginsForChannel( - grpc_core::experimental::StatsPluginChannelScope("", "", - endpoint_config)); - for (auto _ : state) { - stats_plugin_group.AddCounter(kCounterWithLabelsHandle, 1, - {"val1", "val2", "val3"}, - {"opt_val1", "opt_val2", "opt_val3"}); - } -} -BENCHMARK(BM_AddCounterWithLabelsWithNoPlugin); - -} // namespace - -// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, -// and others do not. This allows us to support both modes. -namespace benchmark { -void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } -} // namespace benchmark - -int main(int argc, char** argv) { - grpc::testing::TestEnvironment env(&argc, argv); - LibraryInitializer libInit; - ::benchmark::Initialize(&argc, argv); - grpc::testing::InitTest(&argc, &argv, false); - benchmark::RunTheBenchmarksNamespaced(); - return 0; -} diff --git a/third_party/boringssl-with-bazel b/third_party/boringssl-with-bazel index 16c8d3db1af20..b8a2bffc598f2 160000 --- a/third_party/boringssl-with-bazel +++ b/third_party/boringssl-with-bazel @@ -1 +1 @@ -Subproject commit 16c8d3db1af20fcc04b5190b25242aadcb1fbb30 +Subproject commit b8a2bffc598f230484ff48a247526a9820facfc2 diff --git a/third_party/envoy-api b/third_party/envoy-api index f8b75d1efa92b..091cfd0442583 160000 --- a/third_party/envoy-api +++ b/third_party/envoy-api @@ -1 +1 @@ -Subproject commit f8b75d1efa92bbf534596a013d9ca5873f79dd30 +Subproject commit 091cfd044258312a56c632ae1860813b1c0c58bc diff --git a/tools/distrib/python/xds_protos/envoy/config/cluster/v3/cluster_pb2.py b/tools/distrib/python/xds_protos/envoy/config/cluster/v3/cluster_pb2.py index 2dd84f96e9a3d..65716280de8fb 100644 --- a/tools/distrib/python/xds_protos/envoy/config/cluster/v3/cluster_pb2.py +++ b/tools/distrib/python/xds_protos/envoy/config/cluster/v3/cluster_pb2.py @@ -37,7 +37,7 @@ from validate import validate_pb2 as validate_dot_validate__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%envoy/config/cluster/v3/cluster.proto\x12\x17\x65nvoy.config.cluster.v3\x1a-envoy/config/cluster/v3/circuit_breaker.proto\x1a$envoy/config/cluster/v3/filter.proto\x1a/envoy/config/cluster/v3/outlier_detection.proto\x1a\"envoy/config/core/v3/address.proto\x1a\x1f\x65nvoy/config/core/v3/base.proto\x1a(envoy/config/core/v3/config_source.proto\x1a$envoy/config/core/v3/extension.proto\x1a\'envoy/config/core/v3/health_check.proto\x1a#envoy/config/core/v3/protocol.proto\x1a#envoy/config/core/v3/resolver.proto\x1a\'envoy/config/endpoint/v3/endpoint.proto\x1a%envoy/type/metadata/v3/metadata.proto\x1a\x1b\x65nvoy/type/v3/percent.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\"xds/core/v3/collection_entry.proto\x1a#envoy/annotations/deprecation.proto\x1a\x1eudpa/annotations/migrate.proto\x1a\x1fudpa/annotations/security.proto\x1a\x1dudpa/annotations/status.proto\x1a!udpa/annotations/versioning.proto\x1a\x17validate/validate.proto\"B\n\x11\x43lusterCollection\x12-\n\x07\x65ntries\x18\x01 \x01(\x0b\x32\x1c.xds.core.v3.CollectionEntry\"\xde\x44\n\x07\x43luster\x12W\n\x18transport_socket_matches\x18+ \x03(\x0b\x32\x35.envoy.config.cluster.v3.Cluster.TransportSocketMatch\x12\x15\n\x04name\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01\x12\x31\n\ralt_stat_name\x18\x1c \x01(\tB\x1a\xf2\x98\xfe\x8f\x05\x14\n\x12observability_name\x12H\n\x04type\x18\x02 \x01(\x0e\x32..envoy.config.cluster.v3.Cluster.DiscoveryTypeB\x08\xfa\x42\x05\x82\x01\x02\x10\x01H\x00\x12J\n\x0c\x63luster_type\x18& \x01(\x0b\x32\x32.envoy.config.cluster.v3.Cluster.CustomClusterTypeH\x00\x12M\n\x12\x65\x64s_cluster_config\x18\x03 \x01(\x0b\x32\x31.envoy.config.cluster.v3.Cluster.EdsClusterConfig\x12<\n\x0f\x63onnect_timeout\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x08\xfa\x42\x05\xaa\x01\x02*\x00\x12P\n!per_connection_buffer_limit_bytes\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.UInt32ValueB\x07\x8a\x93\xb7*\x02\x10\x01\x12\x46\n\tlb_policy\x18\x06 \x01(\x0e\x32).envoy.config.cluster.v3.Cluster.LbPolicyB\x08\xfa\x42\x05\x82\x01\x02\x10\x01\x12H\n\x0fload_assignment\x18! \x01(\x0b\x32/.envoy.config.endpoint.v3.ClusterLoadAssignment\x12\x38\n\rhealth_checks\x18\x08 \x03(\x0b\x32!.envoy.config.core.v3.HealthCheck\x12N\n\x1bmax_requests_per_connection\x18\t \x01(\x0b\x32\x1c.google.protobuf.UInt32ValueB\x0b\x18\x01\x92\xc7\x86\xd8\x04\x03\x33.0\x12\x42\n\x10\x63ircuit_breakers\x18\n \x01(\x0b\x32(.envoy.config.cluster.v3.CircuitBreakers\x12\x66\n\x1eupstream_http_protocol_options\x18. \x01(\x0b\x32\x31.envoy.config.core.v3.UpstreamHttpProtocolOptionsB\x0b\x18\x01\x92\xc7\x86\xd8\x04\x03\x33.0\x12\\\n\x1c\x63ommon_http_protocol_options\x18\x1d \x01(\x0b\x32).envoy.config.core.v3.HttpProtocolOptionsB\x0b\x18\x01\x92\xc7\x86\xd8\x04\x03\x33.0\x12V\n\x15http_protocol_options\x18\r \x01(\x0b\x32*.envoy.config.core.v3.Http1ProtocolOptionsB\x0b\x18\x01\x92\xc7\x86\xd8\x04\x03\x33.0\x12^\n\x16http2_protocol_options\x18\x0e \x01(\x0b\x32*.envoy.config.core.v3.Http2ProtocolOptionsB\x12\x18\x01\x8a\x93\xb7*\x02\x10\x01\x92\xc7\x86\xd8\x04\x03\x33.0\x12m\n typed_extension_protocol_options\x18$ \x03(\x0b\x32\x43.envoy.config.cluster.v3.Cluster.TypedExtensionProtocolOptionsEntry\x12\x41\n\x10\x64ns_refresh_rate\x18\x10 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0c\xfa\x42\t\xaa\x01\x06*\x04\x10\xc0\x84=\x12N\n\x18\x64ns_failure_refresh_rate\x18, \x01(\x0b\x32,.envoy.config.cluster.v3.Cluster.RefreshRate\x12\x17\n\x0frespect_dns_ttl\x18\' \x01(\x08\x12U\n\x11\x64ns_lookup_family\x18\x11 \x01(\x0e\x32\x30.envoy.config.cluster.v3.Cluster.DnsLookupFamilyB\x08\xfa\x42\x05\x82\x01\x02\x10\x01\x12\x41\n\rdns_resolvers\x18\x12 \x03(\x0b\x32\x1d.envoy.config.core.v3.AddressB\x0b\x18\x01\x92\xc7\x86\xd8\x04\x03\x33.0\x12,\n\x17use_tcp_for_dns_lookups\x18- \x01(\x08\x42\x0b\x18\x01\x92\xc7\x86\xd8\x04\x03\x33.0\x12U\n\x15\x64ns_resolution_config\x18\x35 \x01(\x0b\x32).envoy.config.core.v3.DnsResolutionConfigB\x0b\x18\x01\x92\xc7\x86\xd8\x04\x03\x33.0\x12M\n\x19typed_dns_resolver_config\x18\x37 \x01(\x0b\x32*.envoy.config.core.v3.TypedExtensionConfig\x12\x39\n\x15wait_for_warm_on_init\x18\x36 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x44\n\x11outlier_detection\x18\x13 \x01(\x0b\x32).envoy.config.cluster.v3.OutlierDetection\x12=\n\x10\x63leanup_interval\x18\x14 \x01(\x0b\x32\x19.google.protobuf.DurationB\x08\xfa\x42\x05\xaa\x01\x02*\x00\x12>\n\x14upstream_bind_config\x18\x15 \x01(\x0b\x32 .envoy.config.core.v3.BindConfig\x12I\n\x10lb_subset_config\x18\x16 \x01(\x0b\x32/.envoy.config.cluster.v3.Cluster.LbSubsetConfig\x12P\n\x13ring_hash_lb_config\x18\x17 \x01(\x0b\x32\x31.envoy.config.cluster.v3.Cluster.RingHashLbConfigH\x01\x12K\n\x10maglev_lb_config\x18\x34 \x01(\x0b\x32/.envoy.config.cluster.v3.Cluster.MaglevLbConfigH\x01\x12V\n\x16original_dst_lb_config\x18\" \x01(\x0b\x32\x34.envoy.config.cluster.v3.Cluster.OriginalDstLbConfigH\x01\x12X\n\x17least_request_lb_config\x18% \x01(\x0b\x32\x35.envoy.config.cluster.v3.Cluster.LeastRequestLbConfigH\x01\x12T\n\x15round_robin_lb_config\x18\x38 \x01(\x0b\x32\x33.envoy.config.cluster.v3.Cluster.RoundRobinLbConfigH\x01\x12I\n\x10\x63ommon_lb_config\x18\x1b \x01(\x0b\x32/.envoy.config.cluster.v3.Cluster.CommonLbConfig\x12?\n\x10transport_socket\x18\x18 \x01(\x0b\x32%.envoy.config.core.v3.TransportSocket\x12\x30\n\x08metadata\x18\x19 \x01(\x0b\x32\x1e.envoy.config.core.v3.Metadata\x12\x62\n\x12protocol_selection\x18\x1a \x01(\x0e\x32\x39.envoy.config.cluster.v3.Cluster.ClusterProtocolSelectionB\x0b\x18\x01\x92\xc7\x86\xd8\x04\x03\x33.0\x12W\n\x1bupstream_connection_options\x18\x1e \x01(\x0b\x32\x32.envoy.config.cluster.v3.UpstreamConnectionOptions\x12\x30\n(close_connections_on_host_health_failure\x18\x1f \x01(\x08\x12%\n\x1dignore_health_on_host_removal\x18 \x01(\x08\x12\x30\n\x07\x66ilters\x18( \x03(\x0b\x32\x1f.envoy.config.cluster.v3.Filter\x12K\n\x15load_balancing_policy\x18) \x01(\x0b\x32,.envoy.config.cluster.v3.LoadBalancingPolicy\x12\x36\n\nlrs_server\x18* \x01(\x0b\x32\".envoy.config.core.v3.ConfigSource\x12#\n\x1blrs_report_endpoint_metrics\x18\x39 \x03(\t\x12*\n\x15track_timeout_budgets\x18/ \x01(\x08\x42\x0b\x18\x01\x92\xc7\x86\xd8\x04\x03\x33.0\x12\x43\n\x0fupstream_config\x18\x30 \x01(\x0b\x32*.envoy.config.core.v3.TypedExtensionConfig\x12G\n\x13track_cluster_stats\x18\x31 \x01(\x0b\x32*.envoy.config.cluster.v3.TrackClusterStats\x12L\n\x11preconnect_policy\x18\x32 \x01(\x0b\x32\x31.envoy.config.cluster.v3.Cluster.PreconnectPolicy\x12\x31\n)connection_pool_per_downstream_connection\x18\x33 \x01(\x08\x1a\xc8\x01\n\x14TransportSocketMatch\x12\x15\n\x04name\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01\x12&\n\x05match\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12?\n\x10transport_socket\x18\x03 \x01(\x0b\x32%.envoy.config.core.v3.TransportSocket:0\x9a\xc5\x88\x1e+\n)envoy.api.v2.Cluster.TransportSocketMatch\x1a\x85\x01\n\x11\x43ustomClusterType\x12\x15\n\x04name\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01\x12*\n\x0ctyped_config\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:-\x9a\xc5\x88\x1e(\n&envoy.api.v2.Cluster.CustomClusterType\x1a\x8e\x01\n\x10\x45\x64sClusterConfig\x12\x36\n\neds_config\x18\x01 \x01(\x0b\x32\".envoy.config.core.v3.ConfigSource\x12\x14\n\x0cservice_name\x18\x02 \x01(\t:,\x9a\xc5\x88\x1e\'\n%envoy.api.v2.Cluster.EdsClusterConfig\x1a\xd9\x08\n\x0eLbSubsetConfig\x12i\n\x0f\x66\x61llback_policy\x18\x01 \x01(\x0e\x32\x46.envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetFallbackPolicyB\x08\xfa\x42\x05\x82\x01\x02\x10\x01\x12/\n\x0e\x64\x65\x66\x61ult_subset\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12Z\n\x10subset_selectors\x18\x03 \x03(\x0b\x32@.envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector\x12\x1d\n\x15locality_weight_aware\x18\x04 \x01(\x08\x12\x1d\n\x15scale_locality_weight\x18\x05 \x01(\x08\x12\x16\n\x0epanic_mode_any\x18\x06 \x01(\x08\x12\x13\n\x0blist_as_any\x18\x07 \x01(\x08\x12z\n\x18metadata_fallback_policy\x18\x08 \x01(\x0e\x32N.envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetMetadataFallbackPolicyB\x08\xfa\x42\x05\x82\x01\x02\x10\x01\x1a\x9b\x03\n\x10LbSubsetSelector\x12\x0c\n\x04keys\x18\x01 \x03(\t\x12\x1e\n\x16single_host_per_subset\x18\x04 \x01(\x08\x12\x82\x01\n\x0f\x66\x61llback_policy\x18\x02 \x01(\x0e\x32_.envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector.LbSubsetSelectorFallbackPolicyB\x08\xfa\x42\x05\x82\x01\x02\x10\x01\x12\x1c\n\x14\x66\x61llback_keys_subset\x18\x03 \x03(\t\"y\n\x1eLbSubsetSelectorFallbackPolicy\x12\x0f\n\x0bNOT_DEFINED\x10\x00\x12\x0f\n\x0bNO_FALLBACK\x10\x01\x12\x10\n\x0c\x41NY_ENDPOINT\x10\x02\x12\x12\n\x0e\x44\x45\x46\x41ULT_SUBSET\x10\x03\x12\x0f\n\x0bKEYS_SUBSET\x10\x04:;\x9a\xc5\x88\x1e\x36\n4envoy.api.v2.Cluster.LbSubsetConfig.LbSubsetSelector\"O\n\x16LbSubsetFallbackPolicy\x12\x0f\n\x0bNO_FALLBACK\x10\x00\x12\x10\n\x0c\x41NY_ENDPOINT\x10\x01\x12\x12\n\x0e\x44\x45\x46\x41ULT_SUBSET\x10\x02\"M\n\x1eLbSubsetMetadataFallbackPolicy\x12\x18\n\x14METADATA_NO_FALLBACK\x10\x00\x12\x11\n\rFALLBACK_LIST\x10\x01:*\x9a\xc5\x88\x1e%\n#envoy.api.v2.Cluster.LbSubsetConfig\x1a\xb4\x01\n\x0fSlowStartConfig\x12\x34\n\x11slow_start_window\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\naggression\x18\x02 \x01(\x0b\x32#.envoy.config.core.v3.RuntimeDouble\x12\x32\n\x12min_weight_percent\x18\x03 \x01(\x0b\x32\x16.envoy.type.v3.Percent\x1a\x61\n\x12RoundRobinLbConfig\x12K\n\x11slow_start_config\x18\x01 \x01(\x0b\x32\x30.envoy.config.cluster.v3.Cluster.SlowStartConfig\x1a\x94\x02\n\x14LeastRequestLbConfig\x12;\n\x0c\x63hoice_count\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32ValueB\x07\xfa\x42\x04*\x02(\x02\x12@\n\x13\x61\x63tive_request_bias\x18\x02 \x01(\x0b\x32#.envoy.config.core.v3.RuntimeDouble\x12K\n\x11slow_start_config\x18\x03 \x01(\x0b\x32\x30.envoy.config.cluster.v3.Cluster.SlowStartConfig:0\x9a\xc5\x88\x1e+\n)envoy.api.v2.Cluster.LeastRequestLbConfig\x1a\xe1\x02\n\x10RingHashLbConfig\x12\x43\n\x11minimum_ring_size\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt64ValueB\n\xfa\x42\x07\x32\x05\x18\x80\x80\x80\x04\x12_\n\rhash_function\x18\x03 \x01(\x0e\x32>.envoy.config.cluster.v3.Cluster.RingHashLbConfig.HashFunctionB\x08\xfa\x42\x05\x82\x01\x02\x10\x01\x12\x43\n\x11maximum_ring_size\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt64ValueB\n\xfa\x42\x07\x32\x05\x18\x80\x80\x80\x04\".\n\x0cHashFunction\x12\x0b\n\x07XX_HASH\x10\x00\x12\x11\n\rMURMUR_HASH_2\x10\x01:,\x9a\xc5\x88\x1e\'\n%envoy.api.v2.Cluster.RingHashLbConfigJ\x04\x08\x02\x10\x03\x1aN\n\x0eMaglevLbConfig\x12<\n\ntable_size\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt64ValueB\n\xfa\x42\x07\x32\x05\x18\xcb\x96\xb1\x02\x1a\xfd\x01\n\x13OriginalDstLbConfig\x12\x17\n\x0fuse_http_header\x18\x01 \x01(\x08\x12\x18\n\x10http_header_name\x18\x02 \x01(\t\x12G\n\x16upstream_port_override\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32ValueB\t\xfa\x42\x06*\x04\x18\xff\xff\x03\x12\x39\n\x0cmetadata_key\x18\x04 \x01(\x0b\x32#.envoy.type.metadata.v3.MetadataKey:/\x9a\xc5\x88\x1e*\n(envoy.api.v2.Cluster.OriginalDstLbConfig\x1a\xb2\t\n\x0e\x43ommonLbConfig\x12\x37\n\x17healthy_panic_threshold\x18\x01 \x01(\x0b\x32\x16.envoy.type.v3.Percent\x12\x61\n\x14zone_aware_lb_config\x18\x02 \x01(\x0b\x32\x41.envoy.config.cluster.v3.Cluster.CommonLbConfig.ZoneAwareLbConfigH\x00\x12o\n\x1blocality_weighted_lb_config\x18\x03 \x01(\x0b\x32H.envoy.config.cluster.v3.Cluster.CommonLbConfig.LocalityWeightedLbConfigH\x00\x12\x36\n\x13update_merge_window\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\'\n\x1fignore_new_hosts_until_first_hc\x18\x05 \x01(\x08\x12,\n$close_connections_on_host_set_change\x18\x06 \x01(\x08\x12o\n\x1c\x63onsistent_hashing_lb_config\x18\x07 \x01(\x0b\x32I.envoy.config.cluster.v3.Cluster.CommonLbConfig.ConsistentHashingLbConfig\x12\x43\n\x14override_host_status\x18\x08 \x01(\x0b\x32%.envoy.config.core.v3.HealthStatusSet\x1a\xd9\x01\n\x11ZoneAwareLbConfig\x12/\n\x0frouting_enabled\x18\x01 \x01(\x0b\x32\x16.envoy.type.v3.Percent\x12\x36\n\x10min_cluster_size\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt64Value\x12\x1d\n\x15\x66\x61il_traffic_on_panic\x18\x03 \x01(\x08:<\x9a\xc5\x88\x1e\x37\n5envoy.api.v2.Cluster.CommonLbConfig.ZoneAwareLbConfig\x1a_\n\x18LocalityWeightedLbConfig:C\x9a\xc5\x88\x1e>\n\n\x14upstream_bind_config\x18\x15 \x01(\x0b\x32 .envoy.config.core.v3.BindConfig\x12I\n\x10lb_subset_config\x18\x16 \x01(\x0b\x32/.envoy.config.cluster.v3.Cluster.LbSubsetConfig\x12P\n\x13ring_hash_lb_config\x18\x17 \x01(\x0b\x32\x31.envoy.config.cluster.v3.Cluster.RingHashLbConfigH\x01\x12K\n\x10maglev_lb_config\x18\x34 \x01(\x0b\x32/.envoy.config.cluster.v3.Cluster.MaglevLbConfigH\x01\x12V\n\x16original_dst_lb_config\x18\" \x01(\x0b\x32\x34.envoy.config.cluster.v3.Cluster.OriginalDstLbConfigH\x01\x12X\n\x17least_request_lb_config\x18% \x01(\x0b\x32\x35.envoy.config.cluster.v3.Cluster.LeastRequestLbConfigH\x01\x12T\n\x15round_robin_lb_config\x18\x38 \x01(\x0b\x32\x33.envoy.config.cluster.v3.Cluster.RoundRobinLbConfigH\x01\x12I\n\x10\x63ommon_lb_config\x18\x1b \x01(\x0b\x32/.envoy.config.cluster.v3.Cluster.CommonLbConfig\x12?\n\x10transport_socket\x18\x18 \x01(\x0b\x32%.envoy.config.core.v3.TransportSocket\x12\x30\n\x08metadata\x18\x19 \x01(\x0b\x32\x1e.envoy.config.core.v3.Metadata\x12\x62\n\x12protocol_selection\x18\x1a \x01(\x0e\x32\x39.envoy.config.cluster.v3.Cluster.ClusterProtocolSelectionB\x0b\x18\x01\x92\xc7\x86\xd8\x04\x03\x33.0\x12W\n\x1bupstream_connection_options\x18\x1e \x01(\x0b\x32\x32.envoy.config.cluster.v3.UpstreamConnectionOptions\x12\x30\n(close_connections_on_host_health_failure\x18\x1f \x01(\x08\x12%\n\x1dignore_health_on_host_removal\x18 \x01(\x08\x12\x30\n\x07\x66ilters\x18( \x03(\x0b\x32\x1f.envoy.config.cluster.v3.Filter\x12K\n\x15load_balancing_policy\x18) \x01(\x0b\x32,.envoy.config.cluster.v3.LoadBalancingPolicy\x12\x36\n\nlrs_server\x18* \x01(\x0b\x32\".envoy.config.core.v3.ConfigSource\x12*\n\x15track_timeout_budgets\x18/ \x01(\x08\x42\x0b\x18\x01\x92\xc7\x86\xd8\x04\x03\x33.0\x12\x43\n\x0fupstream_config\x18\x30 \x01(\x0b\x32*.envoy.config.core.v3.TypedExtensionConfig\x12G\n\x13track_cluster_stats\x18\x31 \x01(\x0b\x32*.envoy.config.cluster.v3.TrackClusterStats\x12L\n\x11preconnect_policy\x18\x32 \x01(\x0b\x32\x31.envoy.config.cluster.v3.Cluster.PreconnectPolicy\x12\x31\n)connection_pool_per_downstream_connection\x18\x33 \x01(\x08\x1a\xc8\x01\n\x14TransportSocketMatch\x12\x15\n\x04name\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01\x12&\n\x05match\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12?\n\x10transport_socket\x18\x03 \x01(\x0b\x32%.envoy.config.core.v3.TransportSocket:0\x9a\xc5\x88\x1e+\n)envoy.api.v2.Cluster.TransportSocketMatch\x1a\x85\x01\n\x11\x43ustomClusterType\x12\x15\n\x04name\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01\x12*\n\x0ctyped_config\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:-\x9a\xc5\x88\x1e(\n&envoy.api.v2.Cluster.CustomClusterType\x1a\x8e\x01\n\x10\x45\x64sClusterConfig\x12\x36\n\neds_config\x18\x01 \x01(\x0b\x32\".envoy.config.core.v3.ConfigSource\x12\x14\n\x0cservice_name\x18\x02 \x01(\t:,\x9a\xc5\x88\x1e\'\n%envoy.api.v2.Cluster.EdsClusterConfig\x1a\xd9\x08\n\x0eLbSubsetConfig\x12i\n\x0f\x66\x61llback_policy\x18\x01 \x01(\x0e\x32\x46.envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetFallbackPolicyB\x08\xfa\x42\x05\x82\x01\x02\x10\x01\x12/\n\x0e\x64\x65\x66\x61ult_subset\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12Z\n\x10subset_selectors\x18\x03 \x03(\x0b\x32@.envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector\x12\x1d\n\x15locality_weight_aware\x18\x04 \x01(\x08\x12\x1d\n\x15scale_locality_weight\x18\x05 \x01(\x08\x12\x16\n\x0epanic_mode_any\x18\x06 \x01(\x08\x12\x13\n\x0blist_as_any\x18\x07 \x01(\x08\x12z\n\x18metadata_fallback_policy\x18\x08 \x01(\x0e\x32N.envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetMetadataFallbackPolicyB\x08\xfa\x42\x05\x82\x01\x02\x10\x01\x1a\x9b\x03\n\x10LbSubsetSelector\x12\x0c\n\x04keys\x18\x01 \x03(\t\x12\x1e\n\x16single_host_per_subset\x18\x04 \x01(\x08\x12\x82\x01\n\x0f\x66\x61llback_policy\x18\x02 \x01(\x0e\x32_.envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector.LbSubsetSelectorFallbackPolicyB\x08\xfa\x42\x05\x82\x01\x02\x10\x01\x12\x1c\n\x14\x66\x61llback_keys_subset\x18\x03 \x03(\t\"y\n\x1eLbSubsetSelectorFallbackPolicy\x12\x0f\n\x0bNOT_DEFINED\x10\x00\x12\x0f\n\x0bNO_FALLBACK\x10\x01\x12\x10\n\x0c\x41NY_ENDPOINT\x10\x02\x12\x12\n\x0e\x44\x45\x46\x41ULT_SUBSET\x10\x03\x12\x0f\n\x0bKEYS_SUBSET\x10\x04:;\x9a\xc5\x88\x1e\x36\n4envoy.api.v2.Cluster.LbSubsetConfig.LbSubsetSelector\"O\n\x16LbSubsetFallbackPolicy\x12\x0f\n\x0bNO_FALLBACK\x10\x00\x12\x10\n\x0c\x41NY_ENDPOINT\x10\x01\x12\x12\n\x0e\x44\x45\x46\x41ULT_SUBSET\x10\x02\"M\n\x1eLbSubsetMetadataFallbackPolicy\x12\x18\n\x14METADATA_NO_FALLBACK\x10\x00\x12\x11\n\rFALLBACK_LIST\x10\x01:*\x9a\xc5\x88\x1e%\n#envoy.api.v2.Cluster.LbSubsetConfig\x1a\xb4\x01\n\x0fSlowStartConfig\x12\x34\n\x11slow_start_window\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\naggression\x18\x02 \x01(\x0b\x32#.envoy.config.core.v3.RuntimeDouble\x12\x32\n\x12min_weight_percent\x18\x03 \x01(\x0b\x32\x16.envoy.type.v3.Percent\x1a\x61\n\x12RoundRobinLbConfig\x12K\n\x11slow_start_config\x18\x01 \x01(\x0b\x32\x30.envoy.config.cluster.v3.Cluster.SlowStartConfig\x1a\x94\x02\n\x14LeastRequestLbConfig\x12;\n\x0c\x63hoice_count\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32ValueB\x07\xfa\x42\x04*\x02(\x02\x12@\n\x13\x61\x63tive_request_bias\x18\x02 \x01(\x0b\x32#.envoy.config.core.v3.RuntimeDouble\x12K\n\x11slow_start_config\x18\x03 \x01(\x0b\x32\x30.envoy.config.cluster.v3.Cluster.SlowStartConfig:0\x9a\xc5\x88\x1e+\n)envoy.api.v2.Cluster.LeastRequestLbConfig\x1a\xe1\x02\n\x10RingHashLbConfig\x12\x43\n\x11minimum_ring_size\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt64ValueB\n\xfa\x42\x07\x32\x05\x18\x80\x80\x80\x04\x12_\n\rhash_function\x18\x03 \x01(\x0e\x32>.envoy.config.cluster.v3.Cluster.RingHashLbConfig.HashFunctionB\x08\xfa\x42\x05\x82\x01\x02\x10\x01\x12\x43\n\x11maximum_ring_size\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt64ValueB\n\xfa\x42\x07\x32\x05\x18\x80\x80\x80\x04\".\n\x0cHashFunction\x12\x0b\n\x07XX_HASH\x10\x00\x12\x11\n\rMURMUR_HASH_2\x10\x01:,\x9a\xc5\x88\x1e\'\n%envoy.api.v2.Cluster.RingHashLbConfigJ\x04\x08\x02\x10\x03\x1aN\n\x0eMaglevLbConfig\x12<\n\ntable_size\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt64ValueB\n\xfa\x42\x07\x32\x05\x18\xcb\x96\xb1\x02\x1a\xfd\x01\n\x13OriginalDstLbConfig\x12\x17\n\x0fuse_http_header\x18\x01 \x01(\x08\x12\x18\n\x10http_header_name\x18\x02 \x01(\t\x12G\n\x16upstream_port_override\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32ValueB\t\xfa\x42\x06*\x04\x18\xff\xff\x03\x12\x39\n\x0cmetadata_key\x18\x04 \x01(\x0b\x32#.envoy.type.metadata.v3.MetadataKey:/\x9a\xc5\x88\x1e*\n(envoy.api.v2.Cluster.OriginalDstLbConfig\x1a\xb2\t\n\x0e\x43ommonLbConfig\x12\x37\n\x17healthy_panic_threshold\x18\x01 \x01(\x0b\x32\x16.envoy.type.v3.Percent\x12\x61\n\x14zone_aware_lb_config\x18\x02 \x01(\x0b\x32\x41.envoy.config.cluster.v3.Cluster.CommonLbConfig.ZoneAwareLbConfigH\x00\x12o\n\x1blocality_weighted_lb_config\x18\x03 \x01(\x0b\x32H.envoy.config.cluster.v3.Cluster.CommonLbConfig.LocalityWeightedLbConfigH\x00\x12\x36\n\x13update_merge_window\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\'\n\x1fignore_new_hosts_until_first_hc\x18\x05 \x01(\x08\x12,\n$close_connections_on_host_set_change\x18\x06 \x01(\x08\x12o\n\x1c\x63onsistent_hashing_lb_config\x18\x07 \x01(\x0b\x32I.envoy.config.cluster.v3.Cluster.CommonLbConfig.ConsistentHashingLbConfig\x12\x43\n\x14override_host_status\x18\x08 \x01(\x0b\x32%.envoy.config.core.v3.HealthStatusSet\x1a\xd9\x01\n\x11ZoneAwareLbConfig\x12/\n\x0frouting_enabled\x18\x01 \x01(\x0b\x32\x16.envoy.type.v3.Percent\x12\x36\n\x10min_cluster_size\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt64Value\x12\x1d\n\x15\x66\x61il_traffic_on_panic\x18\x03 \x01(\x08:<\x9a\xc5\x88\x1e\x37\n5envoy.api.v2.Cluster.CommonLbConfig.ZoneAwareLbConfig\x1a_\n\x18LocalityWeightedLbConfig:C\x9a\xc5\x88\x1e>\n\n\x0bstatus_code\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32ValueB\x0b\xfa\x42\x08*\x06\x18\xe7\x07(\xc8\x01\x12S\n\x17response_headers_to_add\x18\x04 \x03(\x0b\x32\'.envoy.config.core.v3.HeaderValueOptionB\t\xfa\x42\x06\x92\x01\x03\x10\xe8\x07\x12R\n\x16request_headers_to_add\x18\x05 \x03(\x0b\x32\'.envoy.config.core.v3.HeaderValueOptionB\t\xfa\x42\x06\x92\x01\x03\x10\xe8\x07\x12Q\n\x1dmodify_request_headers_action\x18\x06 \x01(\x0b\x32*.envoy.config.core.v3.TypedExtensionConfigB \n\x19redirect_action_specifier\x12\x03\xf8\x42\x01\x42\xe2\x01\nFio.envoyproxy.envoy.extensions.http.custom_response.redirect_policy.v3B\x13RedirectPolicyProtoP\x01Zqgithub.com/envoyproxy/go-control-plane/envoy/extensions/http/custom_response/redirect_policy/v3;redirect_policyv3\xba\x80\xc8\xd1\x06\x02\x10\x02\xd2\xc6\xa4\xe1\x06\x02\x08\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nNenvoy/extensions/http/custom_response/redirect_policy/v3/redirect_policy.proto\x12\x38\x65nvoy.extensions.http.custom_response.redirect_policy.v3\x1a\x1f\x65nvoy/config/core/v3/base.proto\x1a$envoy/config/core/v3/extension.proto\x1a,envoy/config/route/v3/route_components.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1fxds/annotations/v3/status.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xc7\x03\n\x0eRedirectPolicy\x12\x16\n\x03uri\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01H\x00\x12@\n\x0fredirect_action\x18\x02 \x01(\x0b\x32%.envoy.config.route.v3.RedirectActionH\x00\x12=\n\x0bstatus_code\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32ValueB\n\xfa\x42\x07*\x05\x18\xe7\x07(d\x12S\n\x17response_headers_to_add\x18\x04 \x03(\x0b\x32\'.envoy.config.core.v3.HeaderValueOptionB\t\xfa\x42\x06\x92\x01\x03\x10\xe8\x07\x12R\n\x16request_headers_to_add\x18\x05 \x03(\x0b\x32\'.envoy.config.core.v3.HeaderValueOptionB\t\xfa\x42\x06\x92\x01\x03\x10\xe8\x07\x12Q\n\x1dmodify_request_headers_action\x18\x06 \x01(\x0b\x32*.envoy.config.core.v3.TypedExtensionConfigB \n\x19redirect_action_specifier\x12\x03\xf8\x42\x01\x42\xe2\x01\nFio.envoyproxy.envoy.extensions.http.custom_response.redirect_policy.v3B\x13RedirectPolicyProtoP\x01Zqgithub.com/envoyproxy/go-control-plane/envoy/extensions/http/custom_response/redirect_policy/v3;redirect_policyv3\xba\x80\xc8\xd1\x06\x02\x10\x02\xd2\xc6\xa4\xe1\x06\x02\x08\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -33,11 +33,11 @@ _REDIRECTPOLICY.fields_by_name['uri']._options = None _REDIRECTPOLICY.fields_by_name['uri']._serialized_options = b'\372B\004r\002\020\001' _REDIRECTPOLICY.fields_by_name['status_code']._options = None - _REDIRECTPOLICY.fields_by_name['status_code']._serialized_options = b'\372B\010*\006\030\347\007(\310\001' + _REDIRECTPOLICY.fields_by_name['status_code']._serialized_options = b'\372B\007*\005\030\347\007(d' _REDIRECTPOLICY.fields_by_name['response_headers_to_add']._options = None _REDIRECTPOLICY.fields_by_name['response_headers_to_add']._serialized_options = b'\372B\006\222\001\003\020\350\007' _REDIRECTPOLICY.fields_by_name['request_headers_to_add']._options = None _REDIRECTPOLICY.fields_by_name['request_headers_to_add']._serialized_options = b'\372B\006\222\001\003\020\350\007' _globals['_REDIRECTPOLICY']._serialized_start=379 - _globals['_REDIRECTPOLICY']._serialized_end=835 + _globals['_REDIRECTPOLICY']._serialized_end=834 # @@protoc_insertion_point(module_scope) diff --git a/tools/distrib/python/xds_protos/envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector_pb2.py b/tools/distrib/python/xds_protos/envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector_pb2.py deleted file mode 100644 index 3cf0824a5753a..0000000000000 --- a/tools/distrib/python/xds_protos/envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector_pb2.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from udpa.annotations import status_pb2 as udpa_dot_annotations_dot_status__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nbenvoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector.proto\x12