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,224 @@
|
|
|
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
|
+
#include "src/core/filter/ext_proc/ext_proc_filter.h"
|
|
18
|
+
|
|
19
|
+
#include <memory>
|
|
20
|
+
#include <string>
|
|
21
|
+
#include <utility>
|
|
22
|
+
|
|
23
|
+
#include "src/core/call/call_spine.h"
|
|
24
|
+
#include "src/core/call/metadata.h"
|
|
25
|
+
#include "src/core/lib/channel/channel_args.h"
|
|
26
|
+
#include "src/core/lib/channel/channel_fwd.h"
|
|
27
|
+
#include "src/core/lib/channel/promise_based_filter.h"
|
|
28
|
+
#include "src/core/lib/debug/trace_impl.h"
|
|
29
|
+
#include "src/core/lib/promise/try_seq.h"
|
|
30
|
+
#include "src/core/util/down_cast.h"
|
|
31
|
+
#include "src/core/util/grpc_check.h"
|
|
32
|
+
#include "src/core/util/match.h"
|
|
33
|
+
#include "src/core/util/ref_counted_ptr.h"
|
|
34
|
+
#include "src/core/util/string.h"
|
|
35
|
+
#include "src/core/util/time.h"
|
|
36
|
+
#include "src/core/xds/grpc/xds_server_grpc.h"
|
|
37
|
+
#include "src/core/xds/xds_client/xds_bootstrap.h"
|
|
38
|
+
#include "src/core/xds/xds_client/xds_transport.h"
|
|
39
|
+
#include "absl/log/log.h"
|
|
40
|
+
#include "absl/status/status.h"
|
|
41
|
+
#include "absl/status/statusor.h"
|
|
42
|
+
#include "absl/strings/str_join.h"
|
|
43
|
+
|
|
44
|
+
namespace grpc_core {
|
|
45
|
+
|
|
46
|
+
//
|
|
47
|
+
// ExtProcFilter::Config
|
|
48
|
+
//
|
|
49
|
+
|
|
50
|
+
std::string ExtProcFilter::Config::ToString() const {
|
|
51
|
+
std::string result = "{";
|
|
52
|
+
bool is_first = true;
|
|
53
|
+
Match(
|
|
54
|
+
channel_info,
|
|
55
|
+
[&](const GrpcXdsServerTarget& target) {
|
|
56
|
+
StrAppend(result, "grpc_service=");
|
|
57
|
+
StrAppend(result, target.Key());
|
|
58
|
+
is_first = false;
|
|
59
|
+
},
|
|
60
|
+
[&](const RefCountedPtr<ExtProcChannel>& channel) {
|
|
61
|
+
if (channel != nullptr) {
|
|
62
|
+
StrAppend(result, "ext_proc_channel=");
|
|
63
|
+
StrAppend(result, channel->server()->Key());
|
|
64
|
+
is_first = false;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
if (failure_mode_allow.value_or(false)) {
|
|
68
|
+
if (!is_first) StrAppend(result, ", ");
|
|
69
|
+
StrAppend(result, "failure_mode_allow=true");
|
|
70
|
+
is_first = false;
|
|
71
|
+
}
|
|
72
|
+
if (processing_mode.has_value()) {
|
|
73
|
+
if (!is_first) StrAppend(result, ", ");
|
|
74
|
+
StrAppend(result, "processing_mode=");
|
|
75
|
+
StrAppend(result, processing_mode->ToString());
|
|
76
|
+
is_first = false;
|
|
77
|
+
}
|
|
78
|
+
if (!request_attributes.empty()) {
|
|
79
|
+
if (!is_first) StrAppend(result, ", ");
|
|
80
|
+
StrAppend(result, "request_attributes=[");
|
|
81
|
+
StrAppend(result, absl::StrJoin(request_attributes, ", "));
|
|
82
|
+
StrAppend(result, "]");
|
|
83
|
+
is_first = false;
|
|
84
|
+
}
|
|
85
|
+
if (!response_attributes.empty()) {
|
|
86
|
+
if (!is_first) StrAppend(result, ", ");
|
|
87
|
+
StrAppend(result, "response_attributes=[");
|
|
88
|
+
StrAppend(result, absl::StrJoin(response_attributes, ", "));
|
|
89
|
+
StrAppend(result, "]");
|
|
90
|
+
is_first = false;
|
|
91
|
+
}
|
|
92
|
+
if (mutation_rules.has_value()) {
|
|
93
|
+
if (!is_first) StrAppend(result, ", ");
|
|
94
|
+
StrAppend(result, "mutation_rules=");
|
|
95
|
+
StrAppend(result, mutation_rules->ToString());
|
|
96
|
+
is_first = false;
|
|
97
|
+
}
|
|
98
|
+
if (!forwarding_allowed_headers.empty()) {
|
|
99
|
+
if (!is_first) StrAppend(result, ", ");
|
|
100
|
+
StrAppend(result, "forwarding_allowed_headers=[");
|
|
101
|
+
bool first_matcher = true;
|
|
102
|
+
for (const auto& matcher : forwarding_allowed_headers) {
|
|
103
|
+
if (!first_matcher) StrAppend(result, ", ");
|
|
104
|
+
StrAppend(result, matcher.ToString());
|
|
105
|
+
first_matcher = false;
|
|
106
|
+
}
|
|
107
|
+
StrAppend(result, "]");
|
|
108
|
+
is_first = false;
|
|
109
|
+
}
|
|
110
|
+
if (!forwarding_disallowed_headers.empty()) {
|
|
111
|
+
if (!is_first) StrAppend(result, ", ");
|
|
112
|
+
StrAppend(result, "forwarding_disallowed_headers=[");
|
|
113
|
+
bool first_matcher = true;
|
|
114
|
+
for (const auto& matcher : forwarding_disallowed_headers) {
|
|
115
|
+
if (!first_matcher) StrAppend(result, ", ");
|
|
116
|
+
StrAppend(result, matcher.ToString());
|
|
117
|
+
first_matcher = false;
|
|
118
|
+
}
|
|
119
|
+
StrAppend(result, "]");
|
|
120
|
+
is_first = false;
|
|
121
|
+
}
|
|
122
|
+
if (disable_immediate_response) {
|
|
123
|
+
if (!is_first) StrAppend(result, ", ");
|
|
124
|
+
StrAppend(result, "disable_immediate_response=true");
|
|
125
|
+
is_first = false;
|
|
126
|
+
}
|
|
127
|
+
if (observability_mode) {
|
|
128
|
+
if (!is_first) StrAppend(result, ", ");
|
|
129
|
+
StrAppend(result, "observability_mode=true");
|
|
130
|
+
is_first = false;
|
|
131
|
+
}
|
|
132
|
+
if (deferred_close_timeout != Duration::Zero()) {
|
|
133
|
+
if (!is_first) StrAppend(result, ", ");
|
|
134
|
+
StrAppend(result, "deferred_close_timeout=");
|
|
135
|
+
StrAppend(result, deferred_close_timeout.ToString());
|
|
136
|
+
}
|
|
137
|
+
StrAppend(result, "}");
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
bool ExtProcFilter::Config::Equals(const FilterConfig& other) const {
|
|
142
|
+
const auto& o = DownCast<const Config&>(other);
|
|
143
|
+
return channel_info == o.channel_info &&
|
|
144
|
+
failure_mode_allow == o.failure_mode_allow &&
|
|
145
|
+
processing_mode == o.processing_mode &&
|
|
146
|
+
request_attributes == o.request_attributes &&
|
|
147
|
+
response_attributes == o.response_attributes &&
|
|
148
|
+
mutation_rules == o.mutation_rules &&
|
|
149
|
+
forwarding_allowed_headers == o.forwarding_allowed_headers &&
|
|
150
|
+
forwarding_disallowed_headers == o.forwarding_disallowed_headers &&
|
|
151
|
+
disable_immediate_response == o.disable_immediate_response &&
|
|
152
|
+
observability_mode == o.observability_mode &&
|
|
153
|
+
deferred_close_timeout == o.deferred_close_timeout;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
//
|
|
157
|
+
// ExtProcFilter
|
|
158
|
+
//
|
|
159
|
+
|
|
160
|
+
const grpc_channel_filter ExtProcFilter::kFilterVtable = MakePromiseBasedFilter<
|
|
161
|
+
ExtProcFilter, FilterEndpoint::kClient,
|
|
162
|
+
kFilterExaminesServerInitialMetadata | kFilterExaminesOutboundMessages |
|
|
163
|
+
kFilterExaminesInboundMessages | kFilterExaminesCallContext>();
|
|
164
|
+
|
|
165
|
+
absl::StatusOr<RefCountedPtr<ExtProcFilter>> ExtProcFilter::Create(
|
|
166
|
+
const ChannelArgs& args, ChannelFilter::Args filter_args) {
|
|
167
|
+
if (filter_args.config()->type() != Config::Type()) {
|
|
168
|
+
return absl::InternalError("ext_proc filter config has wrong type");
|
|
169
|
+
}
|
|
170
|
+
auto config = filter_args.config().TakeAsSubclass<const Config>();
|
|
171
|
+
return MakeRefCounted<ExtProcFilter>(args, std::move(config));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
ExtProcFilter::ExtProcFilter(const ChannelArgs& args,
|
|
175
|
+
RefCountedPtr<const Config> config)
|
|
176
|
+
: V3InterceptorToV2Bridge<ExtProcFilter>(args),
|
|
177
|
+
config_(std::move(config)) {}
|
|
178
|
+
|
|
179
|
+
void ExtProcFilter::InterceptCall(UnstartedCallHandler unstarted_call_handler) {
|
|
180
|
+
CallHandler handler = Consume(std::move(unstarted_call_handler));
|
|
181
|
+
handler.SpawnGuarded(
|
|
182
|
+
"ext_proc_bypass",
|
|
183
|
+
[self = RefAsSubclass<ExtProcFilter>(), handler]() mutable {
|
|
184
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
185
|
+
<< "ExtProc: Bypassing filter (stub implementation)";
|
|
186
|
+
return TrySeq(handler.PullClientInitialMetadata(),
|
|
187
|
+
[self, handler](ClientMetadataHandle metadata) mutable {
|
|
188
|
+
CallInitiator initiator = self->MakeChildCall(
|
|
189
|
+
std::move(metadata), handler.arena()->Ref());
|
|
190
|
+
handler.AddChildCall(initiator);
|
|
191
|
+
ForwardCall(handler, initiator);
|
|
192
|
+
return absl::OkStatus();
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
//
|
|
198
|
+
// ExtProcFilter::ExtProcChannel
|
|
199
|
+
//
|
|
200
|
+
|
|
201
|
+
ExtProcFilter::ExtProcChannel::ExtProcChannel(
|
|
202
|
+
std::shared_ptr<const XdsBootstrap::XdsServerTarget> server,
|
|
203
|
+
RefCountedPtr<XdsTransportFactory> transport_factory)
|
|
204
|
+
: server_(std::move(server)) {
|
|
205
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
206
|
+
<< "creating channel " << this << " for server " << server_->server_uri();
|
|
207
|
+
absl::Status status;
|
|
208
|
+
transport_ = transport_factory->GetTransport(*server_, &status);
|
|
209
|
+
GRPC_CHECK(transport_ != nullptr);
|
|
210
|
+
// TODO(rishesh): Return an error if channel construction fails instead of
|
|
211
|
+
// just logging a message.
|
|
212
|
+
if (!status.ok()) {
|
|
213
|
+
LOG(ERROR) << "Error creating ext_proc channel to " << server_->server_uri()
|
|
214
|
+
<< ": " << status;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
ExtProcFilter::ExtProcChannel::~ExtProcChannel() {
|
|
219
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
220
|
+
<< "destroying ext_proc channel " << this << " for server "
|
|
221
|
+
<< server_->server_uri();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
} // namespace grpc_core
|
|
@@ -0,0 +1,155 @@
|
|
|
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_FILTER_H
|
|
18
|
+
#define GRPC_SRC_CORE_FILTER_EXT_PROC_EXT_PROC_FILTER_H
|
|
19
|
+
|
|
20
|
+
#include <memory>
|
|
21
|
+
#include <optional>
|
|
22
|
+
#include <string>
|
|
23
|
+
#include <variant>
|
|
24
|
+
#include <vector>
|
|
25
|
+
|
|
26
|
+
#include "src/core/filter/ext_proc/ext_proc_messages.h"
|
|
27
|
+
#include "src/core/filter/filter_args.h"
|
|
28
|
+
#include "src/core/lib/channel/channel_args.h"
|
|
29
|
+
#include "src/core/lib/channel/promise_based_filter.h"
|
|
30
|
+
#include "src/core/util/matchers.h"
|
|
31
|
+
#include "src/core/util/ref_counted_ptr.h"
|
|
32
|
+
#include "src/core/util/unique_type_name.h"
|
|
33
|
+
#include "src/core/xds/grpc/blackboard.h"
|
|
34
|
+
#include "src/core/xds/grpc/xds_common_types.h"
|
|
35
|
+
#include "src/core/xds/grpc/xds_server_grpc.h"
|
|
36
|
+
#include "src/core/xds/xds_client/xds_transport.h"
|
|
37
|
+
|
|
38
|
+
namespace grpc_core {
|
|
39
|
+
|
|
40
|
+
class ExtProcFilter final : public V3InterceptorToV2Bridge<ExtProcFilter> {
|
|
41
|
+
public:
|
|
42
|
+
class ExtProcChannel;
|
|
43
|
+
|
|
44
|
+
using ProcessingMode = ExtProcProcessingMode;
|
|
45
|
+
|
|
46
|
+
struct Config final : public FilterConfig {
|
|
47
|
+
static UniqueTypeName Type() {
|
|
48
|
+
return GRPC_UNIQUE_TYPE_NAME_HERE("ext_proc_filter_config");
|
|
49
|
+
}
|
|
50
|
+
UniqueTypeName type() const override { return Type(); }
|
|
51
|
+
|
|
52
|
+
bool Equals(const FilterConfig& other) const override;
|
|
53
|
+
|
|
54
|
+
std::string ToString() const override;
|
|
55
|
+
|
|
56
|
+
// The gRPC service configuration (target URI, credentials, timeout)
|
|
57
|
+
// used to establish the side-channel connection to the external processor
|
|
58
|
+
// server as described in gRFC A102.
|
|
59
|
+
// Or, a ref-counted handle to the persistent gRPC side-channel
|
|
60
|
+
// (ExtProcChannel) used to communicate with the external processing server
|
|
61
|
+
// across multiple data plane RPCs.
|
|
62
|
+
// Holds a null RefCountedPtr when neither is set (e.g. in an empty
|
|
63
|
+
// override config).
|
|
64
|
+
std::variant<RefCountedPtr<ExtProcChannel>, GrpcXdsServerTarget>
|
|
65
|
+
channel_info;
|
|
66
|
+
// If true, when an ext_proc stream fails or terminates with a non-OK
|
|
67
|
+
// status, the data plane RPC is allowed to continue without error if the
|
|
68
|
+
// filter is in observability mode or has not yet sent message bodies (body
|
|
69
|
+
// send mode is NONE). Defaults to false (failing the RPC with INTERNAL).
|
|
70
|
+
std::optional<bool> failure_mode_allow;
|
|
71
|
+
// Specifies which data plane events (request/response headers, body chunks,
|
|
72
|
+
// and trailers) should be forwarded to the external processing server. In
|
|
73
|
+
// gRPC, body chunks are sent in GRPC mode.
|
|
74
|
+
std::optional<ProcessingMode> processing_mode;
|
|
75
|
+
// List of request attribute names (e.g., "request.path", "request.method",
|
|
76
|
+
// "request.host") to extract from metadata and include in client request
|
|
77
|
+
// header events.
|
|
78
|
+
std::vector<std::string> request_attributes;
|
|
79
|
+
// List of response attribute names to extract from metadata and include in
|
|
80
|
+
// server response header events.
|
|
81
|
+
std::vector<std::string> response_attributes;
|
|
82
|
+
// Configuration specifying rules and restrictions for header mutations
|
|
83
|
+
// performed by the external processor (such as disallowed headers or rules
|
|
84
|
+
// for adding/removing headers).
|
|
85
|
+
std::optional<HeaderMutationRules> mutation_rules;
|
|
86
|
+
// List of string matchers defining the set of request/response headers and
|
|
87
|
+
// trailers allowed to be forwarded to the external processing server.
|
|
88
|
+
std::vector<StringMatcher> forwarding_allowed_headers;
|
|
89
|
+
// List of string matchers defining the set of request/response headers and
|
|
90
|
+
// trailers that must be excluded when sending events to the external
|
|
91
|
+
// processing server.
|
|
92
|
+
std::vector<StringMatcher> forwarding_disallowed_headers;
|
|
93
|
+
// If true, prevents the external processing server from sending an
|
|
94
|
+
// ImmediateResponse message to reject or terminate the data plane RPC
|
|
95
|
+
// prematurely.
|
|
96
|
+
bool disable_immediate_response;
|
|
97
|
+
// If true (observability mode as defined in gRFC A93), events are sent
|
|
98
|
+
// asynchronously without blocking data plane RPC traffic or waiting for
|
|
99
|
+
// response mutations from the external processor.
|
|
100
|
+
bool observability_mode;
|
|
101
|
+
// The maximum duration to wait for the external processor to close or drain
|
|
102
|
+
// its stream before forcibly closing the side-channel stream.
|
|
103
|
+
Duration deferred_close_timeout;
|
|
104
|
+
|
|
105
|
+
RefCountedPtr<ExtProcChannel> channel() const {
|
|
106
|
+
auto* channel = std::get_if<RefCountedPtr<ExtProcChannel>>(&channel_info);
|
|
107
|
+
if (channel == nullptr) return nullptr;
|
|
108
|
+
return *channel;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
static const grpc_channel_filter kFilterVtable;
|
|
113
|
+
|
|
114
|
+
static absl::string_view TypeName() { return "ext_proc"; }
|
|
115
|
+
|
|
116
|
+
static absl::StatusOr<RefCountedPtr<ExtProcFilter>> Create(
|
|
117
|
+
const ChannelArgs& args, ChannelFilter::Args filter_args);
|
|
118
|
+
|
|
119
|
+
ExtProcFilter(const ChannelArgs& args, RefCountedPtr<const Config> config);
|
|
120
|
+
|
|
121
|
+
RefCountedPtr<const Config> config() const { return config_; }
|
|
122
|
+
RefCountedPtr<ExtProcChannel> channel() const { return config_->channel(); }
|
|
123
|
+
|
|
124
|
+
class ExtProcChannel final : public Blackboard::Entry {
|
|
125
|
+
public:
|
|
126
|
+
static UniqueTypeName Type() {
|
|
127
|
+
return GRPC_UNIQUE_TYPE_NAME_HERE("ext_proc_channel");
|
|
128
|
+
}
|
|
129
|
+
ExtProcChannel(std::shared_ptr<const XdsBootstrap::XdsServerTarget> server,
|
|
130
|
+
RefCountedPtr<XdsTransportFactory> transport_factory);
|
|
131
|
+
~ExtProcChannel() override;
|
|
132
|
+
std::shared_ptr<const XdsBootstrap::XdsServerTarget> server() const {
|
|
133
|
+
return server_;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
RefCountedPtr<XdsTransportFactory::XdsTransport> transport() const {
|
|
137
|
+
return transport_;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
private:
|
|
141
|
+
std::shared_ptr<const XdsBootstrap::XdsServerTarget> server_;
|
|
142
|
+
RefCountedPtr<XdsTransportFactory::XdsTransport> transport_;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
private:
|
|
146
|
+
void Orphaned() override {}
|
|
147
|
+
|
|
148
|
+
void InterceptCall(UnstartedCallHandler unstarted_call_handler) override;
|
|
149
|
+
|
|
150
|
+
RefCountedPtr<const Config> config_;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
} // namespace grpc_core
|
|
154
|
+
|
|
155
|
+
#endif // GRPC_SRC_CORE_FILTER_EXT_PROC_EXT_PROC_FILTER_H
|