grpc 1.83.1 → 1.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +21 -17
- data/include/grpc/credentials.h +10 -0
- data/include/grpc/grpc_security_constants.h +2 -0
- data/include/grpc/impl/channel_arg_names.h +9 -0
- data/src/core/call/call_filters.h +4 -2
- data/src/core/call/client_call.cc +20 -8
- data/src/core/call/client_call.h +4 -0
- data/src/core/call/interception_chain.cc +2 -0
- data/src/core/call/interception_chain.h +14 -1
- data/src/core/call/metadata.cc +1 -3
- data/src/core/call/metadata_batch.h +13 -5
- data/src/core/call/server_call.cc +31 -14
- data/src/core/call/server_call.h +4 -0
- data/src/core/channelz/text_encode.cc +9 -4
- data/src/core/channelz/v2tov1/convert.cc +2 -2
- data/src/core/client_channel/backup_poller.cc +1 -2
- data/src/core/client_channel/client_channel.cc +6 -33
- data/src/core/client_channel/client_channel_filter.cc +22 -55
- data/src/core/client_channel/client_channel_filter.h +2 -2
- data/src/core/client_channel/client_channel_service_config.cc +3 -19
- data/src/core/client_channel/direct_channel.cc +7 -1
- data/src/core/client_channel/direct_channel.h +2 -2
- data/src/core/client_channel/load_balanced_call_destination.cc +5 -3
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +5 -12
- data/src/core/client_channel/subchannel.cc +310 -1058
- data/src/core/client_channel/subchannel.h +44 -329
- data/src/core/client_channel/subchannel_metrics.cc +48 -0
- data/src/core/client_channel/subchannel_metrics.h +60 -0
- data/src/core/credentials/call/external/file_external_account_credentials.cc +1 -1
- data/src/core/credentials/call/external/url_external_account_credentials.cc +2 -3
- data/src/core/credentials/call/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +8 -24
- data/src/core/credentials/call/gcp_service_account_identity/gcp_service_account_identity_credentials.h +3 -6
- data/src/core/credentials/call/gdch_service_account/gdch_service_account_credentials.cc +525 -0
- data/src/core/credentials/call/gdch_service_account/gdch_service_account_credentials.h +138 -0
- data/src/core/credentials/call/json_util.h +1 -0
- data/src/core/credentials/call/jwt/json_token.cc +10 -2
- data/src/core/credentials/call/jwt/jwt_verifier.cc +15 -1
- data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.cc +1 -1
- data/src/core/credentials/call/oauth2/oauth2_credentials.cc +42 -79
- data/src/core/credentials/call/oauth2/oauth2_credentials.h +2 -5
- data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.cc +52 -31
- data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.h +21 -8
- data/src/core/credentials/transport/google_default/google_default_credentials.cc +3 -4
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +59 -72
- data/src/core/credentials/transport/ssl/ssl_credentials.h +9 -8
- data/src/core/credentials/transport/ssl/ssl_security_connector.cc +12 -6
- data/src/core/credentials/transport/ssl/ssl_security_connector.h +4 -4
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.cc +29 -18
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.h +9 -6
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc +45 -56
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.h +5 -4
- data/src/core/credentials/transport/tls/grpc_tls_certificate_selector.h +26 -0
- data/src/core/credentials/transport/tls/grpc_tls_crl_provider.cc +1 -1
- data/src/core/credentials/transport/tls/load_system_roots.h +2 -6
- data/src/core/credentials/transport/tls/load_system_roots_fallback.cc +2 -4
- data/src/core/credentials/transport/tls/load_system_roots_supported.cc +13 -15
- data/src/core/credentials/transport/tls/load_system_roots_supported.h +3 -2
- data/src/core/credentials/transport/tls/load_system_roots_windows.cc +5 -8
- data/src/core/credentials/transport/tls/spiffe_utils.cc +1 -1
- data/src/core/credentials/transport/tls/ssl_utils.cc +39 -28
- data/src/core/credentials/transport/tls/ssl_utils.h +12 -49
- data/src/core/credentials/transport/tls/tls_security_connector.cc +48 -33
- data/src/core/credentials/transport/tls/tls_security_connector.h +31 -10
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +15 -11
- data/src/core/ext/filters/http/http_filters_plugin.cc +20 -9
- data/src/core/ext/filters/rbac/rbac_filter.cc +43 -21
- data/src/core/ext/filters/rbac/rbac_filter.h +21 -3
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +2 -2
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +1 -1
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +6 -20
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +32 -67
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +78 -4
- data/src/core/ext/transport/chttp2/transport/frame.h +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +3 -4
- data/src/core/ext/transport/chttp2/transport/goaway.h +7 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +5 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +3 -1
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +141 -130
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +22 -22
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.cc +402 -269
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.h +80 -49
- data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +1 -2
- data/src/core/ext/transport/chttp2/transport/http2_status.h +38 -37
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +178 -5
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +345 -5
- data/src/core/ext/transport/chttp2/transport/parsing.cc +5 -5
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +3 -2
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +25 -5
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +3 -4
- data/src/core/ext/transport/chttp2/transport/read_context.h +30 -3
- data/src/core/ext/transport/chttp2/transport/stream.h +65 -23
- data/src/core/ext/transport/chttp2/transport/writing.cc +0 -3
- data/src/core/ext/transport/inproc/inproc_transport.cc +1 -5
- data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +4 -17
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb.h +1912 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb_minitable.c +300 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb_minitable.h +37 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upb.h +187 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upb_minitable.c +64 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upb_minitable.h +31 -0
- data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb.h +2362 -0
- data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb_minitable.c +556 -0
- data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb_minitable.h +47 -0
- data/src/core/ext/upb-gen/{src/proto/grpc/channelz → grpc/channelz/v1}/channelz.upb.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc/channelz → grpc/channelz/v1}/channelz.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/{src/proto/grpc/channelz → grpc/channelz/v1}/channelz.upb_minitable.h +5 -5
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upbdefs.c +453 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upbdefs.h +67 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upbdefs.c +142 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upbdefs.h +37 -0
- data/src/core/ext/upbdefs-gen/grpc/channelz/v1/channelz.upbdefs.c +715 -0
- data/src/core/ext/upbdefs-gen/{src/proto/grpc/channelz → grpc/channelz/v1}/channelz.upbdefs.h +44 -44
- data/src/core/filter/auth/server_auth_filter.cc +2 -3
- data/src/core/filter/composite/composite_filter.cc +45 -33
- data/src/core/filter/composite/composite_filter.h +5 -4
- data/src/core/filter/ext_proc/ext_proc_filter.cc +224 -0
- data/src/core/filter/ext_proc/ext_proc_filter.h +155 -0
- data/src/core/filter/ext_proc/ext_proc_messages.cc +701 -0
- data/src/core/filter/ext_proc/ext_proc_messages.h +297 -0
- data/src/core/filter/filter_args.h +13 -2
- data/src/core/handshaker/http_connect/http_proxy_mapper.cc +30 -3
- data/src/core/handshaker/security/security_handshaker.cc +9 -6
- data/src/core/lib/channel/channel_stack.cc +3 -0
- data/src/core/lib/channel/channel_stack.h +2 -0
- data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -2
- data/src/core/lib/channel/promise_based_filter.cc +132 -20
- data/src/core/lib/channel/promise_based_filter.h +42 -12
- data/src/core/lib/compression/compression_internal.cc +4 -5
- data/src/core/lib/debug/trace_flags.cc +8 -0
- data/src/core/lib/debug/trace_flags.h +3 -0
- data/src/core/lib/event_engine/ares_resolver.cc +54 -50
- data/src/core/lib/event_engine/ares_resolver.h +3 -2
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +3 -3
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +4 -10
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +74 -33
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +4 -4
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +6 -2
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +3 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +3 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +1 -3
- data/src/core/lib/experiments/experiments.cc +60 -96
- data/src/core/lib/experiments/experiments.h +34 -50
- data/src/core/lib/iomgr/cfstream_handle.cc +2 -6
- data/src/core/lib/iomgr/endpoint_cfstream.cc +3 -10
- data/src/core/lib/iomgr/error.cc +2 -6
- data/src/core/lib/iomgr/error_cfstream.cc +1 -1
- data/src/core/lib/iomgr/ev_poll_posix.cc +5 -9
- data/src/core/lib/iomgr/event_engine_shims/closure.cc +1 -1
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +1 -2
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.cc +1 -2
- data/src/core/lib/iomgr/iomgr_posix.cc +0 -4
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +0 -4
- data/src/core/lib/iomgr/iomgr_windows.cc +0 -4
- data/src/core/lib/iomgr/socket_factory_posix.h +1 -1
- data/src/core/lib/iomgr/socket_utils_posix.cc +3 -0
- data/src/core/lib/iomgr/socket_utils_posix.h +3 -0
- data/src/core/lib/iomgr/systemd_utils.cc +0 -1
- data/src/core/lib/iomgr/tcp_client.h +1 -1
- data/src/core/lib/iomgr/tcp_posix.cc +23 -15
- data/src/core/lib/iomgr/tcp_server.h +1 -1
- data/src/core/lib/iomgr/tcp_server_posix.cc +2 -3
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +0 -1
- data/src/core/lib/iomgr/tcp_server_windows.cc +0 -1
- data/src/core/lib/iomgr/tcp_windows.cc +5 -10
- data/src/core/lib/iomgr/unix_sockets_posix.cc +2 -4
- data/src/core/lib/iomgr/unix_sockets_posix.h +3 -1
- data/src/core/lib/iomgr/vsock.h +3 -1
- data/src/core/lib/resource_quota/memory_quota.cc +1 -1
- data/src/core/lib/security/authorization/rbac_policy.cc +139 -56
- data/src/core/lib/security/authorization/rbac_policy.h +21 -3
- data/src/core/lib/surface/call.cc +3 -9
- data/src/core/lib/surface/call_utils.h +113 -0
- data/src/core/lib/surface/channel_create.cc +1 -1
- data/src/core/lib/surface/channel_create.h +0 -2
- data/src/core/lib/surface/channel_init.cc +77 -38
- data/src/core/lib/surface/channel_init.h +30 -16
- data/src/core/lib/surface/filter_stack_call.cc +5 -10
- data/src/core/lib/surface/init.cc +13 -27
- data/src/core/lib/surface/version.cc +1 -1
- data/src/core/lib/transport/error_utils.cc +0 -27
- data/src/core/lib/transport/error_utils.h +0 -16
- data/src/core/lib/transport/transport.h +7 -5
- data/src/core/load_balancing/pick_first/pick_first.cc +2 -0
- data/src/core/load_balancing/rls/rls.cc +28 -11
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +33 -42
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.h +0 -2
- data/src/core/load_balancing/xds/cds.cc +3 -1
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +0 -1
- data/src/core/mitigation_engine/mitigation.h +14 -5
- data/src/core/mitigation_engine/mitigation_engine.h +7 -3
- data/src/core/mitigation_engine/mitigation_provider.h +2 -1
- data/src/core/plugin_registry/grpc_plugin_registry.cc +39 -8
- data/src/core/resolver/dns/{event_engine/event_engine_client_channel_resolver.cc → dns_resolver.cc} +42 -41
- data/src/core/resolver/dns/{event_engine/event_engine_client_channel_resolver.h → dns_resolver.h} +8 -5
- data/src/core/resolver/dns/{event_engine/service_config_helper.cc → service_config_helper.cc} +1 -1
- data/src/core/resolver/dns/{event_engine/service_config_helper.h → service_config_helper.h} +3 -3
- data/src/core/resolver/endpoint_addresses.h +3 -0
- data/src/core/resolver/google_c2p/google_c2p_resolver.cc +2 -1
- data/src/core/resolver/xds/xds_resolver.cc +35 -9
- data/src/core/server/server.cc +2 -6
- data/src/core/server/server_config_selector.h +18 -3
- data/src/core/server/server_config_selector_filter.cc +178 -91
- data/src/core/server/server_config_selector_filter.h +58 -3
- data/src/core/server/xds_server_config_fetcher.cc +196 -129
- data/src/core/server/xds_server_config_fetcher.h +49 -0
- data/src/core/server/xds_server_config_fetcher_legacy.cc +41 -37
- data/src/core/telemetry/histogram.h +94 -14
- data/src/core/telemetry/instrument.cc +179 -74
- data/src/core/telemetry/instrument.h +78 -30
- data/src/core/telemetry/metrics.h +5 -0
- data/src/core/{resolver/dns/dns_resolver_plugin.h → telemetry/telemetry_label.h} +12 -8
- data/src/core/tsi/alts/crypt/aes_gcm.cc +10 -13
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +2 -2
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +3 -1
- data/src/core/tsi/ssl_telemetry_utils.cc +216 -259
- data/src/core/tsi/ssl_telemetry_utils.h +12 -2
- data/src/core/tsi/ssl_transport_security.cc +238 -80
- data/src/core/tsi/ssl_transport_security.h +63 -33
- data/src/core/tsi/tls_telemetry.cc +31 -0
- data/src/core/tsi/tls_telemetry.h +47 -0
- data/src/core/tsi/transport_security.cc +2 -2
- data/src/core/tsi/transport_security.h +1 -1
- data/src/core/tsi/transport_security_interface.h +1 -1
- data/src/core/{resolver/dns/native/dns_resolver.h → util/address_sorting_init.cc} +21 -8
- data/src/core/{resolver/dns/c_ares/grpc_ares_wrapper_posix.cc → util/address_sorting_init.h} +7 -8
- data/src/core/util/http_client/httpcli.cc +16 -53
- data/src/core/util/http_client/httpcli.h +0 -7
- data/src/core/util/http_client/httpcli_security_connector.cc +13 -8
- data/src/core/util/linux/cpu.cc +1 -1
- data/src/core/util/load_file.cc +3 -9
- data/src/core/util/load_file.h +3 -4
- data/src/core/util/matchers.h +8 -0
- data/src/core/util/posix/cpu.cc +1 -1
- data/src/core/util/status_helper.cc +0 -20
- data/src/core/util/status_helper.h +3 -14
- data/src/core/xds/grpc/xds_audit_logger_registry.cc +51 -31
- data/src/core/xds/grpc/xds_audit_logger_registry.h +17 -3
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +2 -10
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +8 -6
- data/src/core/xds/grpc/xds_bootstrap_grpc_builder.cc +488 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc_builder.h +97 -0
- data/src/core/xds/grpc/xds_certificate_provider.cc +7 -7
- data/src/core/xds/grpc/xds_client_grpc.cc +4 -8
- data/src/core/xds/grpc/xds_client_grpc.h +0 -4
- data/src/core/xds/grpc/xds_cluster.h +1 -0
- data/src/core/xds/grpc/xds_cluster_parser.cc +1 -5
- data/src/core/xds/grpc/xds_cluster_parser.h +0 -2
- data/src/core/xds/grpc/xds_cluster_specifier_plugin.cc +0 -2
- data/src/core/xds/grpc/xds_cluster_specifier_plugin.h +0 -2
- data/src/core/xds/grpc/xds_common_types.cc +0 -91
- data/src/core/xds/grpc/xds_common_types.h +1 -47
- data/src/core/xds/grpc/xds_common_types_parser.cc +84 -378
- data/src/core/xds/grpc/xds_common_types_parser.h +9 -11
- data/src/core/xds/grpc/xds_endpoint_parser.cc +0 -2
- data/src/core/xds/grpc/xds_grpc_service_parser.cc +177 -0
- data/src/core/{resolver/dns/c_ares/dns_resolver_ares.h → xds/grpc/xds_grpc_service_parser.h} +14 -9
- data/src/core/xds/grpc/xds_http_composite_filter.cc +26 -21
- data/src/core/xds/grpc/xds_http_composite_filter.h +4 -3
- data/src/core/xds/grpc/xds_http_ext_proc_filter.cc +418 -0
- data/src/core/xds/grpc/xds_http_ext_proc_filter.h +89 -0
- data/src/core/xds/grpc/xds_http_fault_filter.cc +9 -12
- data/src/core/xds/grpc/xds_http_fault_filter.h +1 -4
- data/src/core/xds/grpc/xds_http_filter.cc +2 -1
- data/src/core/xds/grpc/xds_http_filter.h +6 -5
- data/src/core/xds/grpc/xds_http_filter_registry.cc +10 -127
- data/src/core/xds/grpc/xds_http_filter_registry.h +7 -59
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +13 -14
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +3 -2
- data/src/core/xds/grpc/xds_http_rbac_filter.cc +403 -25
- data/src/core/xds/grpc/xds_http_rbac_filter.h +1 -3
- data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +8 -13
- data/src/core/xds/grpc/xds_http_stateful_session_filter.h +1 -4
- data/src/core/xds/grpc/xds_lb_policy_registry.cc +0 -292
- data/src/core/xds/grpc/xds_lb_policy_registry.h +7 -3
- data/src/core/xds/grpc/xds_listener.cc +2 -0
- data/src/core/xds/grpc/xds_listener.h +5 -0
- data/src/core/xds/grpc/xds_listener_parser.cc +16 -11
- data/src/core/xds/grpc/xds_matcher_parse.h +3 -1
- data/src/core/xds/grpc/xds_metadata_parser.cc +6 -1
- data/src/core/xds/grpc/xds_metadata_parser.h +2 -0
- data/src/core/xds/grpc/xds_route_config.cc +2 -0
- data/src/core/xds/grpc/xds_route_config.h +3 -1
- data/src/core/xds/grpc/xds_route_config_parser.cc +13 -79
- data/src/core/xds/grpc/xds_route_config_parser.h +0 -3
- data/src/core/xds/grpc/xds_routing.cc +116 -69
- data/src/core/xds/grpc/xds_routing.h +19 -8
- data/src/core/xds/grpc/xds_tls_context.cc +117 -0
- data/src/core/xds/grpc/xds_tls_context.h +76 -0
- data/src/core/xds/grpc/xds_tls_context_parser.cc +275 -0
- data/src/core/xds/grpc/xds_tls_context_parser.h +35 -0
- data/src/core/xds/grpc/xds_transport_grpc.cc +41 -38
- data/src/core/xds/grpc/xds_transport_grpc.h +4 -2
- data/src/ruby/ext/grpc/rb_call.c +26 -15
- data/src/ruby/ext/grpc/rb_completion_queue.c +6 -5
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +2 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +3 -0
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/test/client.rb +5 -4
- data/src/ruby/spec/call_spec.rb +14 -0
- data/src/ruby/spec/generic/server_interceptors_spec.rb +3 -6
- metadata +50 -35
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/channelz.upbdefs.c +0 -716
- data/src/core/lib/iomgr/resolve_address.cc +0 -59
- data/src/core/lib/iomgr/resolve_address.h +0 -125
- data/src/core/lib/iomgr/resolve_address_impl.h +0 -58
- data/src/core/lib/iomgr/resolve_address_posix.cc +0 -184
- data/src/core/lib/iomgr/resolve_address_posix.h +0 -78
- data/src/core/lib/iomgr/resolve_address_windows.cc +0 -169
- data/src/core/lib/iomgr/resolve_address_windows.h +0 -76
- data/src/core/resolver/dns/c_ares/dns_resolver_ares.cc +0 -781
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver.h +0 -93
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +0 -203
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +0 -838
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc +0 -1237
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h +0 -130
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +0 -35
- data/src/core/resolver/dns/dns_resolver_plugin.cc +0 -64
- data/src/core/resolver/dns/native/dns_resolver.cc +0 -173
- data/src/core/util/json/json_util.cc +0 -101
- data/src/core/util/json/json_util.h +0 -163
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 gRPC authors.
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
//
|
|
16
|
+
|
|
17
|
+
#ifndef GRPC_SRC_CORE_FILTER_EXT_PROC_EXT_PROC_MESSAGES_H
|
|
18
|
+
#define GRPC_SRC_CORE_FILTER_EXT_PROC_EXT_PROC_MESSAGES_H
|
|
19
|
+
|
|
20
|
+
#include <grpc/status.h>
|
|
21
|
+
|
|
22
|
+
#include <optional>
|
|
23
|
+
#include <string>
|
|
24
|
+
#include <variant>
|
|
25
|
+
#include <vector>
|
|
26
|
+
|
|
27
|
+
#include "google/protobuf/struct.upb.h"
|
|
28
|
+
#include "src/core/call/metadata_batch.h"
|
|
29
|
+
#include "src/core/util/matchers.h"
|
|
30
|
+
#include "src/core/xds/grpc/xds_common_types.h"
|
|
31
|
+
#include "upb/mem/arena.h"
|
|
32
|
+
#include "absl/status/statusor.h"
|
|
33
|
+
#include "absl/strings/string_view.h"
|
|
34
|
+
|
|
35
|
+
// Data structures and message creation/parsing helpers for the xDS External
|
|
36
|
+
// Processing (ext_proc) filter in gRPC, as specified in gRFC A93
|
|
37
|
+
// (https://github.com/grpc/proposal/blob/master/A93-xds-ext-proc.md).
|
|
38
|
+
|
|
39
|
+
namespace grpc_core {
|
|
40
|
+
|
|
41
|
+
// Represents the processing mode configuration for an external processor
|
|
42
|
+
// stream, corresponding to
|
|
43
|
+
// envoy.extensions.filters.http.ext_proc.v3.ProcessingMode in gRFC A93. Note:
|
|
44
|
+
// In gRPC, when body processing is enabled (send_request_body /
|
|
45
|
+
// send_response_body), it always operates in GRPC mode (deframed gRPC messages
|
|
46
|
+
// sent one at a time).
|
|
47
|
+
struct ExtProcProcessingMode {
|
|
48
|
+
bool send_request_headers = false;
|
|
49
|
+
bool send_response_headers = false;
|
|
50
|
+
bool send_response_trailers = false;
|
|
51
|
+
bool send_request_body = false;
|
|
52
|
+
bool send_response_body = false;
|
|
53
|
+
|
|
54
|
+
bool operator==(const ExtProcProcessingMode& other) const {
|
|
55
|
+
return send_request_headers == other.send_request_headers &&
|
|
56
|
+
send_response_headers == other.send_response_headers &&
|
|
57
|
+
send_response_trailers == other.send_response_trailers &&
|
|
58
|
+
send_request_body == other.send_request_body &&
|
|
59
|
+
send_response_body == other.send_response_body;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
std::string ToString() const;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// Creates a serialized envoy.service.ext_proc.v3.ProcessingRequest containing a
|
|
66
|
+
// HttpHeaders message for client request headers.
|
|
67
|
+
//
|
|
68
|
+
// Parameters:
|
|
69
|
+
// - arena: The upb arena used for memory allocation during proto creation and
|
|
70
|
+
// serialization.
|
|
71
|
+
// - metadata: The gRPC metadata batch containing the client request headers.
|
|
72
|
+
// - allowed_headers: List of string matchers specifying which headers are
|
|
73
|
+
// allowed to be forwarded.
|
|
74
|
+
// - disallowed_headers: List of string matchers specifying which headers must
|
|
75
|
+
// be excluded.
|
|
76
|
+
// - attributes: A protobuf Struct message containing request/connection
|
|
77
|
+
// attributes to include, or nullptr.
|
|
78
|
+
// - observability_mode: If true (observability mode in gRFC A93), indicates
|
|
79
|
+
// that the external processor should only observe traffic asynchronously
|
|
80
|
+
// without blocking or mutating the stream.
|
|
81
|
+
// - processing_mode: If present, populates the protocol_config field in the
|
|
82
|
+
// request (sent on the first message of a stream to configure desired
|
|
83
|
+
// processing modes as per gRFC A93).
|
|
84
|
+
absl::StatusOr<std::string> CreateExtProcClientHeadersRequest(
|
|
85
|
+
upb_Arena* arena, grpc_metadata_batch* metadata,
|
|
86
|
+
const std::vector<StringMatcher>& allowed_headers,
|
|
87
|
+
const std::vector<StringMatcher>& disallowed_headers,
|
|
88
|
+
::google_protobuf_Struct* attributes, bool observability_mode,
|
|
89
|
+
std::optional<ExtProcProcessingMode> processing_mode);
|
|
90
|
+
|
|
91
|
+
// Creates a serialized envoy.service.ext_proc.v3.ProcessingRequest containing a
|
|
92
|
+
// HttpHeaders message for server response headers.
|
|
93
|
+
//
|
|
94
|
+
// Parameters:
|
|
95
|
+
// - arena: The upb arena used for memory allocation during proto creation and
|
|
96
|
+
// serialization.
|
|
97
|
+
// - metadata: The gRPC metadata batch containing the server response headers.
|
|
98
|
+
// - allowed_headers: List of string matchers specifying which headers are
|
|
99
|
+
// allowed to be forwarded.
|
|
100
|
+
// - disallowed_headers: List of string matchers specifying which headers must
|
|
101
|
+
// be excluded.
|
|
102
|
+
// - attributes: A protobuf Struct message containing request/connection
|
|
103
|
+
// attributes to include, or nullptr.
|
|
104
|
+
// - observability_mode: If true (observability mode in gRFC A93), indicates
|
|
105
|
+
// that the external
|
|
106
|
+
// processor should only observe traffic asynchronously without blocking or
|
|
107
|
+
// mutating the stream.
|
|
108
|
+
// - processing_mode: If present, populates the protocol_config field in the
|
|
109
|
+
// request (sent on the
|
|
110
|
+
// first message of a stream to configure desired processing modes as per
|
|
111
|
+
// gRFC A93).
|
|
112
|
+
// - end_of_stream: If true, indicates that this header message is also the end
|
|
113
|
+
// of the HTTP/gRPC stream.
|
|
114
|
+
absl::StatusOr<std::string> CreateExtProcServerHeadersRequest(
|
|
115
|
+
upb_Arena* arena, grpc_metadata_batch* metadata,
|
|
116
|
+
const std::vector<StringMatcher>& allowed_headers,
|
|
117
|
+
const std::vector<StringMatcher>& disallowed_headers,
|
|
118
|
+
::google_protobuf_Struct* attributes, bool observability_mode,
|
|
119
|
+
std::optional<ExtProcProcessingMode> processing_mode, bool end_of_stream);
|
|
120
|
+
|
|
121
|
+
// Creates a serialized envoy.service.ext_proc.v3.ProcessingRequest containing a
|
|
122
|
+
// HttpBody message for a client request body payload chunk.
|
|
123
|
+
//
|
|
124
|
+
// Parameters:
|
|
125
|
+
// - arena: The upb arena used for memory allocation during proto creation and
|
|
126
|
+
// serialization.
|
|
127
|
+
// - body: The payload data chunk of the body. In GRPC mode (gRFC A93), this
|
|
128
|
+
// represents a complete, deframed gRPC message payload (not raw HTTP/2 DATA
|
|
129
|
+
// frames).
|
|
130
|
+
// - attributes: A protobuf Struct message containing request/connection
|
|
131
|
+
// attributes to include, or nullptr.
|
|
132
|
+
// - observability_mode: If true (observability mode in gRFC A93), indicates
|
|
133
|
+
// that the external processor should only observe traffic asynchronously
|
|
134
|
+
// without blocking or mutating the stream.
|
|
135
|
+
// - processing_mode: If present, populates the protocol_config field in the
|
|
136
|
+
// request (sent on the first message of a stream to configure desired
|
|
137
|
+
// processing modes as per gRFC A93).
|
|
138
|
+
// - end_of_stream: If true, indicates that this body chunk is the last message
|
|
139
|
+
// on the stream.
|
|
140
|
+
// - end_of_stream_without_message: If true, indicates end of stream with an
|
|
141
|
+
// empty body chunk.
|
|
142
|
+
absl::StatusOr<std::string> CreateExtProcClientBodyRequest(
|
|
143
|
+
upb_Arena* arena, absl::string_view body,
|
|
144
|
+
::google_protobuf_Struct* attributes, bool observability_mode,
|
|
145
|
+
std::optional<ExtProcProcessingMode> processing_mode, bool end_of_stream,
|
|
146
|
+
bool end_of_stream_without_message);
|
|
147
|
+
|
|
148
|
+
// Creates a serialized envoy.service.ext_proc.v3.ProcessingRequest containing a
|
|
149
|
+
// HttpBody message for a server response body payload chunk.
|
|
150
|
+
//
|
|
151
|
+
// Parameters:
|
|
152
|
+
// - arena: The upb arena used for memory allocation during proto creation and
|
|
153
|
+
// serialization.
|
|
154
|
+
// - body: The payload data chunk of the body. In GRPC mode (gRFC A93), this
|
|
155
|
+
// represents a complete, deframed gRPC message payload (not raw HTTP/2 DATA
|
|
156
|
+
// frames).
|
|
157
|
+
// - attributes: A protobuf Struct message containing request/connection
|
|
158
|
+
// attributes to include, or nullptr.
|
|
159
|
+
// - observability_mode: If true (observability mode in gRFC A93), indicates
|
|
160
|
+
// that the external processor should only observe traffic asynchronously
|
|
161
|
+
// without blocking or mutating the stream.
|
|
162
|
+
// - processing_mode: If present, populates the protocol_config field in the
|
|
163
|
+
// request (sent on the first message of a stream to configure desired
|
|
164
|
+
// processing modes as per gRFC A93).
|
|
165
|
+
absl::StatusOr<std::string> CreateExtProcServerBodyRequest(
|
|
166
|
+
upb_Arena* arena, absl::string_view body,
|
|
167
|
+
::google_protobuf_Struct* attributes, bool observability_mode,
|
|
168
|
+
std::optional<ExtProcProcessingMode> processing_mode);
|
|
169
|
+
|
|
170
|
+
// Creates a serialized envoy.service.ext_proc.v3.ProcessingRequest containing a
|
|
171
|
+
// HttpTrailers message for server response trailers.
|
|
172
|
+
//
|
|
173
|
+
// Parameters:
|
|
174
|
+
// - arena: The upb arena used for memory allocation during proto creation and
|
|
175
|
+
// serialization.
|
|
176
|
+
// - trailers: The gRPC metadata batch containing the server response trailers.
|
|
177
|
+
// - allowed_headers: List of string matchers specifying which trailer keys are
|
|
178
|
+
// allowed to be forwarded.
|
|
179
|
+
// - disallowed_headers: List of string matchers specifying which trailer keys
|
|
180
|
+
// must be excluded.
|
|
181
|
+
// - attributes: A protobuf Struct message containing request/connection
|
|
182
|
+
// attributes to include, or nullptr.
|
|
183
|
+
// - observability_mode: If true (observability mode in gRFC A93), indicates
|
|
184
|
+
// that the external processor should only observe traffic asynchronously
|
|
185
|
+
// without blocking or mutating the stream.
|
|
186
|
+
// - processing_mode: If present, populates the protocol_config field in the
|
|
187
|
+
// request (sent on the first message of a stream to configure desired
|
|
188
|
+
// processing modes as per gRFC A93).
|
|
189
|
+
absl::StatusOr<std::string> CreateExtProcServerTrailersRequest(
|
|
190
|
+
upb_Arena* arena, grpc_metadata_batch* trailers,
|
|
191
|
+
const std::vector<StringMatcher>& allowed_headers,
|
|
192
|
+
const std::vector<StringMatcher>& disallowed_headers,
|
|
193
|
+
::google_protobuf_Struct* attributes, bool observability_mode,
|
|
194
|
+
std::optional<ExtProcProcessingMode> processing_mode);
|
|
195
|
+
|
|
196
|
+
// Creates a protobuf Struct message (::google_protobuf_Struct*) containing
|
|
197
|
+
// connection and request metadata attributes requested by the external
|
|
198
|
+
// processor configuration.
|
|
199
|
+
//
|
|
200
|
+
// Parameters:
|
|
201
|
+
// - arena: The upb arena used for allocating the Struct message and its
|
|
202
|
+
// fields.
|
|
203
|
+
// - requested_attributes: A list of attribute names (e.g., "request.path",
|
|
204
|
+
// "request.method", "request.host") to extract and populate.
|
|
205
|
+
// - metadata: The gRPC metadata batch from which attribute values (like
|
|
206
|
+
// authority, method, path, or headers) are extracted.
|
|
207
|
+
//
|
|
208
|
+
// Returns:
|
|
209
|
+
// A pointer to the newly created ::google_protobuf_Struct message on the
|
|
210
|
+
// arena, or nullptr if no requested attributes were matched or populated.
|
|
211
|
+
::google_protobuf_Struct* CreateExtProcAttributesProtoStruct(
|
|
212
|
+
upb_Arena* arena, const std::vector<std::string>& requested_attributes,
|
|
213
|
+
const grpc_metadata_batch& metadata);
|
|
214
|
+
|
|
215
|
+
// Represents the parsed response from an external processor, corresponding to
|
|
216
|
+
// envoy.service.ext_proc.v3.ProcessingResponse in gRFC A93.
|
|
217
|
+
struct ExtProcResponse {
|
|
218
|
+
struct HeaderMutation {
|
|
219
|
+
// Headers to set or append.
|
|
220
|
+
std::vector<XdsHeaderValueOption> set_headers;
|
|
221
|
+
// Header keys to remove.
|
|
222
|
+
std::vector<std::string> remove_headers;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
// Represents body mutations returned by the external processor.
|
|
226
|
+
// In GRPC mode (gRFC A93), the body string must be a complete deframed gRPC
|
|
227
|
+
// message.
|
|
228
|
+
struct BodyMutation {
|
|
229
|
+
// The new body content.
|
|
230
|
+
std::string body;
|
|
231
|
+
// If true, indicates the end of the stream.
|
|
232
|
+
bool end_of_stream = false;
|
|
233
|
+
// If true, indicates the end of the stream without a message.
|
|
234
|
+
bool end_of_stream_without_message = false;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
struct RequestHeaders {
|
|
238
|
+
HeaderMutation mutation;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
struct ResponseHeaders {
|
|
242
|
+
HeaderMutation mutation;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
struct ResponseTrailers {
|
|
246
|
+
HeaderMutation mutation;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
struct RequestBody {
|
|
250
|
+
BodyMutation mutation;
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
struct ResponseBody {
|
|
254
|
+
BodyMutation mutation;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
struct ImmediateResponse {
|
|
258
|
+
// The gRPC status code to return.
|
|
259
|
+
grpc_status_code status = GRPC_STATUS_UNKNOWN;
|
|
260
|
+
// error message to return with.
|
|
261
|
+
std::string details;
|
|
262
|
+
// Headers to set in the response.
|
|
263
|
+
HeaderMutation header_mutation;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
// The variant representing the actual response content.
|
|
267
|
+
// It can hold one of the mutation types or std::monostate if no response
|
|
268
|
+
// is set.
|
|
269
|
+
using ResponseValue =
|
|
270
|
+
std::variant<std::monostate, RequestHeaders, ResponseHeaders,
|
|
271
|
+
ResponseTrailers, RequestBody, ResponseBody,
|
|
272
|
+
ImmediateResponse>;
|
|
273
|
+
|
|
274
|
+
ResponseValue response;
|
|
275
|
+
// If true, indicates that the client request should be drained as specified
|
|
276
|
+
// in gRFC A93: the filter sends a half-close on the ext_proc stream and
|
|
277
|
+
// pauses data plane reading until the ext_proc server echoes remaining
|
|
278
|
+
// messages and terminates the stream with OK status.
|
|
279
|
+
bool request_drain = false;
|
|
280
|
+
|
|
281
|
+
// Parses a serialized envoy.service.ext_proc.v3.ProcessingResponse proto.
|
|
282
|
+
//
|
|
283
|
+
// Parameters:
|
|
284
|
+
// - serialized_response: The raw string containing the protobuf-serialized
|
|
285
|
+
// ProcessingResponse.
|
|
286
|
+
//
|
|
287
|
+
// Returns:
|
|
288
|
+
// The parsed ExtProcResponse structure representing header/body/trailer
|
|
289
|
+
// mutations or immediate responses, or an absl::Status error if
|
|
290
|
+
// deserialization or validation fails.
|
|
291
|
+
static absl::StatusOr<ExtProcResponse> Parse(
|
|
292
|
+
absl::string_view serialized_response);
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
} // namespace grpc_core
|
|
296
|
+
|
|
297
|
+
#endif // GRPC_SRC_CORE_FILTER_EXT_PROC_EXT_PROC_MESSAGES_H
|
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
#include "src/core/util/ref_counted_ptr.h"
|
|
24
24
|
#include "src/core/util/unique_type_name.h"
|
|
25
25
|
|
|
26
|
+
// A boolean channel arg indicating whether we're using the v3 filter stack.
|
|
27
|
+
#define GRPC_ARG_USE_V3_STACK "grpc.internal.use_v3_stack"
|
|
28
|
+
|
|
29
|
+
// A boolean channel arg indicating whether the filter stack is for the
|
|
30
|
+
// server side.
|
|
31
|
+
#define GRPC_ARG_IS_SERVER_FILTER_STACK "grpc.internal.is_server_filter_stack"
|
|
32
|
+
|
|
26
33
|
namespace grpc_core {
|
|
27
34
|
|
|
28
35
|
// A base class for filter configs.
|
|
@@ -83,8 +90,8 @@ class FilterArgs {
|
|
|
83
90
|
// 0 0 0 1 1 0 2.
|
|
84
91
|
// This is useful for filters that need to store per-instance data in a
|
|
85
92
|
// parallel data structure.
|
|
86
|
-
// TODO(roth): Remove this
|
|
87
|
-
//
|
|
93
|
+
// TODO(roth): Remove this when removing the
|
|
94
|
+
// xds_server_filter_chain_per_route experiment.
|
|
88
95
|
size_t instance_id() const {
|
|
89
96
|
return Match(
|
|
90
97
|
impl_,
|
|
@@ -103,11 +110,15 @@ class FilterArgs {
|
|
|
103
110
|
struct ChannelStackBased {
|
|
104
111
|
grpc_channel_stack* channel_stack;
|
|
105
112
|
grpc_channel_element* channel_element;
|
|
113
|
+
// TODO(roth): Remove this when removing the
|
|
114
|
+
// xds_server_filter_chain_per_route experiment.
|
|
106
115
|
size_t (*channel_stack_filter_instance_number)(grpc_channel_stack*,
|
|
107
116
|
grpc_channel_element*);
|
|
108
117
|
};
|
|
109
118
|
|
|
110
119
|
struct V3Based {
|
|
120
|
+
// TODO(roth): Remove this when removing the
|
|
121
|
+
// xds_server_filter_chain_per_route experiment.
|
|
111
122
|
size_t instance_id;
|
|
112
123
|
};
|
|
113
124
|
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
#include "src/core/lib/address_utils/parse_address.h"
|
|
34
34
|
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
|
35
35
|
#include "src/core/lib/channel/channel_args.h"
|
|
36
|
-
#include "src/core/lib/iomgr/resolve_address.h"
|
|
37
36
|
#include "src/core/util/env.h"
|
|
38
37
|
#include "src/core/util/grpc_check.h"
|
|
39
38
|
#include "src/core/util/host_port.h"
|
|
@@ -55,6 +54,8 @@
|
|
|
55
54
|
namespace grpc_core {
|
|
56
55
|
namespace {
|
|
57
56
|
|
|
57
|
+
constexpr int kDefaultSecurePortInt = 443;
|
|
58
|
+
|
|
58
59
|
bool ServerInCIDRRange(const grpc_resolved_address& server_address,
|
|
59
60
|
absl::string_view cidr_range) {
|
|
60
61
|
std::pair<absl::string_view, absl::string_view> possible_cidr =
|
|
@@ -76,8 +77,34 @@ bool ServerInCIDRRange(const grpc_resolved_address& server_address,
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
bool ExactMatchOrSubdomain(absl::string_view host_name,
|
|
79
|
-
absl::string_view
|
|
80
|
-
|
|
80
|
+
absl::string_view no_proxy_entry) {
|
|
81
|
+
// Remove surrounding whitespace.
|
|
82
|
+
no_proxy_entry = absl::StripAsciiWhitespace(no_proxy_entry);
|
|
83
|
+
|
|
84
|
+
// Strip a leading dot if present (e.g. ".example.com" -> "example.com").
|
|
85
|
+
// A leading dot is optional notation; both "example.com" and
|
|
86
|
+
// ".example.com" match the domain itself and all of its subdomains.
|
|
87
|
+
if (!no_proxy_entry.empty() && no_proxy_entry[0] == '.') {
|
|
88
|
+
no_proxy_entry = no_proxy_entry.substr(1);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (no_proxy_entry.empty()) return false;
|
|
92
|
+
|
|
93
|
+
// Exact match (case-insensitive).
|
|
94
|
+
if (absl::EqualsIgnoreCase(host_name, no_proxy_entry)) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Boundary-aware subdomain match: host_name must end with
|
|
99
|
+
// ".<no_proxy_entry>". Prevents "notexample.com" from matching
|
|
100
|
+
// "example.com", while "test.example.com" still matches.
|
|
101
|
+
if (host_name.size() > no_proxy_entry.size() &&
|
|
102
|
+
absl::EndsWithIgnoreCase(host_name, no_proxy_entry) &&
|
|
103
|
+
host_name[host_name.size() - no_proxy_entry.size() - 1] == '.') {
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return false;
|
|
81
108
|
}
|
|
82
109
|
|
|
83
110
|
// Parses the list of host names, addresses or subnet masks and returns true if
|
|
@@ -92,7 +92,7 @@ class SecurityHandshaker : public Handshaker {
|
|
|
92
92
|
tsi_result result, const unsigned char* bytes_to_send,
|
|
93
93
|
size_t bytes_to_send_size, tsi_handshaker_result* handshaker_result)
|
|
94
94
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
|
|
95
|
-
void HandshakeFailedLocked(absl::Status error)
|
|
95
|
+
void HandshakeFailedLocked(absl::Status error, bool peer_closed = false)
|
|
96
96
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
|
|
97
97
|
void Finish(absl::Status status);
|
|
98
98
|
|
|
@@ -166,14 +166,15 @@ size_t SecurityHandshaker::MoveReadBufferIntoHandshakeBuffer() {
|
|
|
166
166
|
|
|
167
167
|
// If the handshake failed or we're shutting down, clean up and invoke the
|
|
168
168
|
// callback with the error.
|
|
169
|
-
void SecurityHandshaker::HandshakeFailedLocked(absl::Status error
|
|
169
|
+
void SecurityHandshaker::HandshakeFailedLocked(absl::Status error,
|
|
170
|
+
bool peer_closed) {
|
|
170
171
|
if (error.ok()) {
|
|
171
172
|
// If we were shut down after the handshake succeeded but before an
|
|
172
173
|
// endpoint callback was invoked, we need to generate our own error.
|
|
173
174
|
error = GRPC_ERROR_CREATE("Handshaker shutdown");
|
|
174
175
|
}
|
|
175
176
|
if (!is_shutdown_) {
|
|
176
|
-
tsi_handshaker_shutdown(handshaker_);
|
|
177
|
+
tsi_handshaker_shutdown(handshaker_, peer_closed);
|
|
177
178
|
// Set shutdown to true so that subsequent calls to
|
|
178
179
|
// security_handshaker_shutdown() do nothing.
|
|
179
180
|
is_shutdown_ = true;
|
|
@@ -457,7 +458,8 @@ void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn(absl::Status error) {
|
|
|
457
458
|
MutexLock lock(&mu_);
|
|
458
459
|
if (!error.ok() || is_shutdown_) {
|
|
459
460
|
HandshakeFailedLocked(
|
|
460
|
-
GRPC_ERROR_CREATE_REFERENCING("Handshake read failed", &error, 1)
|
|
461
|
+
GRPC_ERROR_CREATE_REFERENCING("Handshake read failed", &error, 1),
|
|
462
|
+
/*peer_closed=*/true);
|
|
461
463
|
return;
|
|
462
464
|
}
|
|
463
465
|
// Copy all slices received.
|
|
@@ -488,7 +490,8 @@ void SecurityHandshaker::OnHandshakeDataSentToPeerFn(absl::Status error) {
|
|
|
488
490
|
MutexLock lock(&mu_);
|
|
489
491
|
if (!error.ok() || is_shutdown_) {
|
|
490
492
|
HandshakeFailedLocked(
|
|
491
|
-
GRPC_ERROR_CREATE_REFERENCING("Handshake write failed", &error, 1)
|
|
493
|
+
GRPC_ERROR_CREATE_REFERENCING("Handshake write failed", &error, 1),
|
|
494
|
+
/*peer_closed=*/true);
|
|
492
495
|
return;
|
|
493
496
|
}
|
|
494
497
|
// We may be done.
|
|
@@ -518,7 +521,7 @@ void SecurityHandshaker::Shutdown(grpc_error_handle error) {
|
|
|
518
521
|
if (!is_shutdown_) {
|
|
519
522
|
is_shutdown_ = true;
|
|
520
523
|
connector_->cancel_check_peer(on_peer_checked_, std::move(error));
|
|
521
|
-
tsi_handshaker_shutdown(handshaker_);
|
|
524
|
+
tsi_handshaker_shutdown(handshaker_, /*peer_closed=*/false);
|
|
522
525
|
args_->endpoint.reset();
|
|
523
526
|
}
|
|
524
527
|
}
|
|
@@ -307,6 +307,9 @@ void grpc_channel_next_get_info(grpc_channel_element* elem,
|
|
|
307
307
|
|
|
308
308
|
void grpc_channel_next_op(grpc_channel_element* elem, grpc_transport_op* op) {
|
|
309
309
|
grpc_channel_element* next_elem = elem + 1;
|
|
310
|
+
GRPC_TRACE_LOG(channel, INFO)
|
|
311
|
+
<< "TRANSPORT OP[" << elem->filter->name << ":" << elem
|
|
312
|
+
<< "]: " << grpc_transport_op_string(op);
|
|
310
313
|
next_elem->filter->start_transport_op(next_elem, op);
|
|
311
314
|
}
|
|
312
315
|
|
|
@@ -257,6 +257,8 @@ grpc_channel_element* grpc_channel_stack_last_element(
|
|
|
257
257
|
// A utility function for a filter to determine how many other instances
|
|
258
258
|
// of the same filter exist above it in the same stack. Intended to be
|
|
259
259
|
// used in the filter's init_channel_elem() method.
|
|
260
|
+
// TODO(roth): Remove this when removing the
|
|
261
|
+
// xds_server_filter_chain_per_route experiment.
|
|
260
262
|
size_t grpc_channel_stack_filter_instance_number(
|
|
261
263
|
grpc_channel_stack* channel_stack, grpc_channel_element* elem);
|
|
262
264
|
|
|
@@ -75,8 +75,7 @@ ChannelStackBuilderImpl::Build() {
|
|
|
75
75
|
if (!error.ok()) {
|
|
76
76
|
grpc_channel_stack_destroy(channel_stack);
|
|
77
77
|
gpr_free(channel_stack);
|
|
78
|
-
|
|
79
|
-
return status;
|
|
78
|
+
return error;
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
// run post-initialization functions
|