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
|
@@ -16,26 +16,13 @@
|
|
|
16
16
|
|
|
17
17
|
#include "src/core/xds/grpc/xds_lb_policy_registry.h"
|
|
18
18
|
|
|
19
|
-
#include <grpc/support/json.h>
|
|
20
|
-
#include <grpc/support/port_platform.h>
|
|
21
|
-
#include <stddef.h>
|
|
22
|
-
#include <stdint.h>
|
|
23
|
-
|
|
24
|
-
#include <optional>
|
|
25
19
|
#include <string>
|
|
26
20
|
#include <utility>
|
|
27
21
|
#include <variant>
|
|
28
22
|
|
|
29
23
|
#include "envoy/config/core/v3/extension.upb.h"
|
|
30
|
-
#include "envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h"
|
|
31
|
-
#include "envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.h"
|
|
32
|
-
#include "envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h"
|
|
33
|
-
#include "envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h"
|
|
34
|
-
#include "google/protobuf/wrappers.upb.h"
|
|
35
|
-
#include "src/core/client_channel/client_channel_service_config.h"
|
|
36
24
|
#include "src/core/config/core_configuration.h"
|
|
37
25
|
#include "src/core/load_balancing/lb_policy_registry.h"
|
|
38
|
-
#include "src/core/load_balancing/weighted_round_robin/weighted_round_robin.h"
|
|
39
26
|
#include "src/core/util/time.h"
|
|
40
27
|
#include "src/core/util/validation_errors.h"
|
|
41
28
|
#include "src/core/xds/grpc/xds_common_types.h"
|
|
@@ -44,285 +31,6 @@
|
|
|
44
31
|
|
|
45
32
|
namespace grpc_core {
|
|
46
33
|
|
|
47
|
-
namespace {
|
|
48
|
-
|
|
49
|
-
class RoundRobinLbPolicyConfigFactory final
|
|
50
|
-
: public XdsLbPolicyRegistry::ConfigFactory {
|
|
51
|
-
public:
|
|
52
|
-
Json::Object ConvertXdsLbPolicyConfig(
|
|
53
|
-
const XdsLbPolicyRegistry* /*registry*/,
|
|
54
|
-
const XdsResourceType::DecodeContext& /*context*/,
|
|
55
|
-
absl::string_view /*configuration*/, ValidationErrors* /*errors*/,
|
|
56
|
-
int /*recursion_depth*/) override {
|
|
57
|
-
return Json::Object{{"round_robin", Json::FromObject({})}};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
absl::string_view type() override { return Type(); }
|
|
61
|
-
|
|
62
|
-
static absl::string_view Type() {
|
|
63
|
-
return "envoy.extensions.load_balancing_policies.round_robin.v3.RoundRobin";
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
class ClientSideWeightedRoundRobinLbPolicyConfigFactory final
|
|
68
|
-
: public XdsLbPolicyRegistry::ConfigFactory {
|
|
69
|
-
public:
|
|
70
|
-
Json::Object ConvertXdsLbPolicyConfig(
|
|
71
|
-
const XdsLbPolicyRegistry* /*registry*/,
|
|
72
|
-
const XdsResourceType::DecodeContext& context,
|
|
73
|
-
absl::string_view configuration, ValidationErrors* errors,
|
|
74
|
-
int /*recursion_depth*/) override {
|
|
75
|
-
const auto* resource =
|
|
76
|
-
envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_parse(
|
|
77
|
-
configuration.data(), configuration.size(), context.arena);
|
|
78
|
-
if (resource == nullptr) {
|
|
79
|
-
errors->AddError(
|
|
80
|
-
"can't decode ClientSideWeightedRoundRobin LB policy config");
|
|
81
|
-
return {};
|
|
82
|
-
}
|
|
83
|
-
Json::Object config;
|
|
84
|
-
// enable_oob_load_report
|
|
85
|
-
if (ParseBoolValue(
|
|
86
|
-
envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_enable_oob_load_report(
|
|
87
|
-
resource))) {
|
|
88
|
-
config["enableOobLoadReport"] = Json::FromBool(true);
|
|
89
|
-
}
|
|
90
|
-
// oob_reporting_period
|
|
91
|
-
auto* duration_proto =
|
|
92
|
-
envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_oob_reporting_period(
|
|
93
|
-
resource);
|
|
94
|
-
if (duration_proto != nullptr) {
|
|
95
|
-
ValidationErrors::ScopedField field(errors, ".oob_reporting_period");
|
|
96
|
-
Duration duration = ParseDuration(duration_proto, errors);
|
|
97
|
-
config["oobReportingPeriod"] = Json::FromString(duration.ToJsonString());
|
|
98
|
-
}
|
|
99
|
-
// blackout_period
|
|
100
|
-
duration_proto =
|
|
101
|
-
envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_blackout_period(
|
|
102
|
-
resource);
|
|
103
|
-
if (duration_proto != nullptr) {
|
|
104
|
-
ValidationErrors::ScopedField field(errors, ".blackout_period");
|
|
105
|
-
Duration duration = ParseDuration(duration_proto, errors);
|
|
106
|
-
config["blackoutPeriod"] = Json::FromString(duration.ToJsonString());
|
|
107
|
-
}
|
|
108
|
-
// weight_update_period
|
|
109
|
-
duration_proto =
|
|
110
|
-
envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_weight_update_period(
|
|
111
|
-
resource);
|
|
112
|
-
if (duration_proto != nullptr) {
|
|
113
|
-
ValidationErrors::ScopedField field(errors, ".weight_update_period");
|
|
114
|
-
Duration duration = ParseDuration(duration_proto, errors);
|
|
115
|
-
config["weightUpdatePeriod"] = Json::FromString(duration.ToJsonString());
|
|
116
|
-
}
|
|
117
|
-
// weight_expiration_period
|
|
118
|
-
duration_proto =
|
|
119
|
-
envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_weight_expiration_period(
|
|
120
|
-
resource);
|
|
121
|
-
if (duration_proto != nullptr) {
|
|
122
|
-
ValidationErrors::ScopedField field(errors, ".weight_expiration_period");
|
|
123
|
-
Duration duration = ParseDuration(duration_proto, errors);
|
|
124
|
-
config["weightExpirationPeriod"] =
|
|
125
|
-
Json::FromString(duration.ToJsonString());
|
|
126
|
-
}
|
|
127
|
-
// error_utilization_penalty
|
|
128
|
-
auto* error_utilization_penalty =
|
|
129
|
-
envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_error_utilization_penalty(
|
|
130
|
-
resource);
|
|
131
|
-
if (error_utilization_penalty != nullptr) {
|
|
132
|
-
ValidationErrors::ScopedField field(errors, ".error_utilization_penalty");
|
|
133
|
-
const float value =
|
|
134
|
-
google_protobuf_FloatValue_value(error_utilization_penalty);
|
|
135
|
-
if (value < 0.0) {
|
|
136
|
-
errors->AddError("value must be non-negative");
|
|
137
|
-
}
|
|
138
|
-
config["errorUtilizationPenalty"] = Json::FromNumber(value);
|
|
139
|
-
}
|
|
140
|
-
// metric_names_for_computing_utilization
|
|
141
|
-
if (WrrCustomMetricsEnabled()) {
|
|
142
|
-
size_t size;
|
|
143
|
-
auto metric_names_for_computing_utilization =
|
|
144
|
-
envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_metric_names_for_computing_utilization(
|
|
145
|
-
resource, &size);
|
|
146
|
-
if (metric_names_for_computing_utilization != nullptr && size != 0) {
|
|
147
|
-
Json::Array metric_names;
|
|
148
|
-
for (size_t i = 0; i < size; ++i) {
|
|
149
|
-
metric_names.emplace_back(Json::FromString(
|
|
150
|
-
UpbStringToStdString(metric_names_for_computing_utilization[i])));
|
|
151
|
-
}
|
|
152
|
-
config["metricNamesForComputingUtilization"] =
|
|
153
|
-
Json::FromArray(std::move(metric_names));
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return Json::Object{
|
|
157
|
-
{"weighted_round_robin", Json::FromObject(std::move(config))}};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
absl::string_view type() override { return Type(); }
|
|
161
|
-
|
|
162
|
-
static absl::string_view Type() {
|
|
163
|
-
return "envoy.extensions.load_balancing_policies.client_side_weighted_"
|
|
164
|
-
"round_robin.v3.ClientSideWeightedRoundRobin";
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
class RingHashLbPolicyConfigFactory final
|
|
169
|
-
: public XdsLbPolicyRegistry::ConfigFactory {
|
|
170
|
-
public:
|
|
171
|
-
Json::Object ConvertXdsLbPolicyConfig(
|
|
172
|
-
const XdsLbPolicyRegistry* /*registry*/,
|
|
173
|
-
const XdsResourceType::DecodeContext& context,
|
|
174
|
-
absl::string_view configuration, ValidationErrors* errors,
|
|
175
|
-
int /*recursion_depth*/) override {
|
|
176
|
-
const auto* resource =
|
|
177
|
-
envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_parse(
|
|
178
|
-
configuration.data(), configuration.size(), context.arena);
|
|
179
|
-
if (resource == nullptr) {
|
|
180
|
-
errors->AddError("can't decode RingHash LB policy config");
|
|
181
|
-
return {};
|
|
182
|
-
}
|
|
183
|
-
if (envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_hash_function(
|
|
184
|
-
resource) !=
|
|
185
|
-
envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_XX_HASH &&
|
|
186
|
-
envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_hash_function(
|
|
187
|
-
resource) !=
|
|
188
|
-
envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_DEFAULT_HASH) {
|
|
189
|
-
ValidationErrors::ScopedField field(errors, ".hash_function");
|
|
190
|
-
errors->AddError("unsupported value (must be XX_HASH)");
|
|
191
|
-
}
|
|
192
|
-
uint64_t max_ring_size =
|
|
193
|
-
ParseUInt64Value(
|
|
194
|
-
envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_maximum_ring_size(
|
|
195
|
-
resource))
|
|
196
|
-
.value_or(8388608);
|
|
197
|
-
if (max_ring_size == 0 || max_ring_size > 8388608) {
|
|
198
|
-
ValidationErrors::ScopedField field(errors, ".maximum_ring_size");
|
|
199
|
-
errors->AddError("value must be in the range [1, 8388608]");
|
|
200
|
-
}
|
|
201
|
-
uint64_t min_ring_size =
|
|
202
|
-
ParseUInt64Value(
|
|
203
|
-
envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_minimum_ring_size(
|
|
204
|
-
resource))
|
|
205
|
-
.value_or(1024);
|
|
206
|
-
{
|
|
207
|
-
ValidationErrors::ScopedField field(errors, ".minimum_ring_size");
|
|
208
|
-
if (min_ring_size == 0 || min_ring_size > 8388608) {
|
|
209
|
-
errors->AddError("value must be in the range [1, 8388608]");
|
|
210
|
-
}
|
|
211
|
-
if (min_ring_size > max_ring_size) {
|
|
212
|
-
errors->AddError("cannot be greater than maximum_ring_size");
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
return Json::Object{
|
|
216
|
-
{"ring_hash_experimental",
|
|
217
|
-
Json::FromObject({
|
|
218
|
-
{"minRingSize", Json::FromNumber(min_ring_size)},
|
|
219
|
-
{"maxRingSize", Json::FromNumber(max_ring_size)},
|
|
220
|
-
})},
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
absl::string_view type() override { return Type(); }
|
|
225
|
-
|
|
226
|
-
static absl::string_view Type() {
|
|
227
|
-
return "envoy.extensions.load_balancing_policies.ring_hash.v3.RingHash";
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
class WrrLocalityLbPolicyConfigFactory final
|
|
232
|
-
: public XdsLbPolicyRegistry::ConfigFactory {
|
|
233
|
-
public:
|
|
234
|
-
Json::Object ConvertXdsLbPolicyConfig(
|
|
235
|
-
const XdsLbPolicyRegistry* registry,
|
|
236
|
-
const XdsResourceType::DecodeContext& context,
|
|
237
|
-
absl::string_view configuration, ValidationErrors* errors,
|
|
238
|
-
int recursion_depth) override {
|
|
239
|
-
const auto* resource =
|
|
240
|
-
envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_parse(
|
|
241
|
-
configuration.data(), configuration.size(), context.arena);
|
|
242
|
-
if (resource == nullptr) {
|
|
243
|
-
errors->AddError("can't decode WrrLocality LB policy config");
|
|
244
|
-
return {};
|
|
245
|
-
}
|
|
246
|
-
ValidationErrors::ScopedField field(errors, ".endpoint_picking_policy");
|
|
247
|
-
const auto* endpoint_picking_policy =
|
|
248
|
-
envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_endpoint_picking_policy(
|
|
249
|
-
resource);
|
|
250
|
-
if (endpoint_picking_policy == nullptr) {
|
|
251
|
-
errors->AddError("field not present");
|
|
252
|
-
return {};
|
|
253
|
-
}
|
|
254
|
-
auto child_policy = registry->ConvertXdsLbPolicyConfig(
|
|
255
|
-
context, endpoint_picking_policy, errors, recursion_depth + 1);
|
|
256
|
-
return Json::Object{
|
|
257
|
-
{"xds_wrr_locality_experimental",
|
|
258
|
-
Json::FromObject(
|
|
259
|
-
{{"childPolicy", Json::FromArray(std::move(child_policy))}})}};
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
absl::string_view type() override { return Type(); }
|
|
263
|
-
|
|
264
|
-
static absl::string_view Type() {
|
|
265
|
-
return "envoy.extensions.load_balancing_policies.wrr_locality.v3."
|
|
266
|
-
"WrrLocality";
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
class PickFirstLbPolicyConfigFactory final
|
|
271
|
-
: public XdsLbPolicyRegistry::ConfigFactory {
|
|
272
|
-
public:
|
|
273
|
-
Json::Object ConvertXdsLbPolicyConfig(
|
|
274
|
-
const XdsLbPolicyRegistry* /*registry*/,
|
|
275
|
-
const XdsResourceType::DecodeContext& context,
|
|
276
|
-
absl::string_view configuration, ValidationErrors* errors,
|
|
277
|
-
int /*recursion_depth*/) override {
|
|
278
|
-
const auto* resource =
|
|
279
|
-
envoy_extensions_load_balancing_policies_pick_first_v3_PickFirst_parse(
|
|
280
|
-
configuration.data(), configuration.size(), context.arena);
|
|
281
|
-
if (resource == nullptr) {
|
|
282
|
-
errors->AddError("can't decode PickFirst LB policy config");
|
|
283
|
-
return {};
|
|
284
|
-
}
|
|
285
|
-
bool shuffle_address_list =
|
|
286
|
-
envoy_extensions_load_balancing_policies_pick_first_v3_PickFirst_shuffle_address_list(
|
|
287
|
-
resource);
|
|
288
|
-
return Json::Object{
|
|
289
|
-
{"pick_first",
|
|
290
|
-
Json::FromObject({
|
|
291
|
-
{"shuffleAddressList", Json::FromBool(shuffle_address_list)},
|
|
292
|
-
})}};
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
absl::string_view type() override { return Type(); }
|
|
296
|
-
|
|
297
|
-
static absl::string_view Type() {
|
|
298
|
-
return "envoy.extensions.load_balancing_policies.pick_first.v3.PickFirst";
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
} // namespace
|
|
303
|
-
|
|
304
|
-
//
|
|
305
|
-
// XdsLbPolicyRegistry
|
|
306
|
-
//
|
|
307
|
-
|
|
308
|
-
XdsLbPolicyRegistry::XdsLbPolicyRegistry() {
|
|
309
|
-
policy_config_factories_.emplace(
|
|
310
|
-
RingHashLbPolicyConfigFactory::Type(),
|
|
311
|
-
std::make_unique<RingHashLbPolicyConfigFactory>());
|
|
312
|
-
policy_config_factories_.emplace(
|
|
313
|
-
RoundRobinLbPolicyConfigFactory::Type(),
|
|
314
|
-
std::make_unique<RoundRobinLbPolicyConfigFactory>());
|
|
315
|
-
policy_config_factories_.emplace(
|
|
316
|
-
ClientSideWeightedRoundRobinLbPolicyConfigFactory::Type(),
|
|
317
|
-
std::make_unique<ClientSideWeightedRoundRobinLbPolicyConfigFactory>());
|
|
318
|
-
policy_config_factories_.emplace(
|
|
319
|
-
WrrLocalityLbPolicyConfigFactory::Type(),
|
|
320
|
-
std::make_unique<WrrLocalityLbPolicyConfigFactory>());
|
|
321
|
-
policy_config_factories_.emplace(
|
|
322
|
-
PickFirstLbPolicyConfigFactory::Type(),
|
|
323
|
-
std::make_unique<PickFirstLbPolicyConfigFactory>());
|
|
324
|
-
}
|
|
325
|
-
|
|
326
34
|
Json::Array XdsLbPolicyRegistry::ConvertXdsLbPolicyConfig(
|
|
327
35
|
const XdsResourceType::DecodeContext& context,
|
|
328
36
|
const envoy_config_cluster_v3_LoadBalancingPolicy* lb_policy,
|
|
@@ -17,10 +17,9 @@
|
|
|
17
17
|
#ifndef GRPC_SRC_CORE_XDS_GRPC_XDS_LB_POLICY_REGISTRY_H
|
|
18
18
|
#define GRPC_SRC_CORE_XDS_GRPC_XDS_LB_POLICY_REGISTRY_H
|
|
19
19
|
|
|
20
|
-
#include <grpc/support/port_platform.h>
|
|
21
|
-
|
|
22
20
|
#include <map>
|
|
23
21
|
#include <memory>
|
|
22
|
+
#include <utility>
|
|
24
23
|
|
|
25
24
|
#include "envoy/config/cluster/v3/cluster.upb.h"
|
|
26
25
|
#include "src/core/util/json/json.h"
|
|
@@ -45,7 +44,12 @@ class XdsLbPolicyRegistry final {
|
|
|
45
44
|
virtual absl::string_view type() = 0;
|
|
46
45
|
};
|
|
47
46
|
|
|
48
|
-
XdsLbPolicyRegistry();
|
|
47
|
+
XdsLbPolicyRegistry() = default;
|
|
48
|
+
|
|
49
|
+
template <typename T>
|
|
50
|
+
void RegisterFactory(std::unique_ptr<T> factory) {
|
|
51
|
+
policy_config_factories_.emplace(T::Type(), std::move(factory));
|
|
52
|
+
}
|
|
49
53
|
|
|
50
54
|
// Converts an xDS cluster load balancing policy message to gRPC's JSON
|
|
51
55
|
// format. An error is returned if none of the lb policies in the list are
|
|
@@ -66,6 +66,8 @@ std::string XdsListenerResource::HttpConnectionManager::HttpFilter::ToString()
|
|
|
66
66
|
StrAppend(result, config_proto_type);
|
|
67
67
|
StrAppend(result, ", config=");
|
|
68
68
|
StrAppend(result, JsonDump(config));
|
|
69
|
+
StrAppend(result, ", disabled=");
|
|
70
|
+
StrAppend(result, disabled ? "true" : "false");
|
|
69
71
|
StrAppend(result, ", filter_config=");
|
|
70
72
|
StrAppend(result,
|
|
71
73
|
filter_config == nullptr ? "null" : filter_config->ToString());
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
#include "src/core/xds/grpc/xds_common_types.h"
|
|
36
36
|
#include "src/core/xds/grpc/xds_http_filter.h"
|
|
37
37
|
#include "src/core/xds/grpc/xds_route_config.h"
|
|
38
|
+
#include "src/core/xds/grpc/xds_tls_context.h"
|
|
38
39
|
#include "src/core/xds/xds_client/xds_resource_type.h"
|
|
39
40
|
#include "src/core/xds/xds_client/xds_resource_type_impl.h"
|
|
40
41
|
|
|
@@ -55,11 +56,13 @@ struct XdsListenerResource : public XdsResourceType::ResourceData {
|
|
|
55
56
|
absl::string_view config_proto_type;
|
|
56
57
|
Json config;
|
|
57
58
|
RefCountedPtr<const FilterConfig> filter_config;
|
|
59
|
+
bool disabled = false;
|
|
58
60
|
|
|
59
61
|
bool operator==(const HttpFilter& other) const {
|
|
60
62
|
if (name != other.name) return false;
|
|
61
63
|
if (config_proto_type != other.config_proto_type) return false;
|
|
62
64
|
if (config != other.config) return false;
|
|
65
|
+
if (disabled != other.disabled) return false;
|
|
63
66
|
if (filter_config == nullptr) return other.filter_config == nullptr;
|
|
64
67
|
if (other.filter_config == nullptr) return false;
|
|
65
68
|
return *filter_config == *other.filter_config;
|
|
@@ -137,6 +140,8 @@ struct XdsListenerResource : public XdsResourceType::ResourceData {
|
|
|
137
140
|
return *data == *other.data;
|
|
138
141
|
}
|
|
139
142
|
};
|
|
143
|
+
// TODO(roth): Unify this with Rbac::CidrRange, possibly as part of
|
|
144
|
+
// addressing https://github.com/grpc/grpc/issues/34172.
|
|
140
145
|
struct CidrRange {
|
|
141
146
|
grpc_resolved_address address;
|
|
142
147
|
uint32_t prefix_len;
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
#include "src/core/xds/grpc/xds_common_types.h"
|
|
51
51
|
#include "src/core/xds/grpc/xds_common_types_parser.h"
|
|
52
52
|
#include "src/core/xds/grpc/xds_route_config_parser.h"
|
|
53
|
+
#include "src/core/xds/grpc/xds_tls_context_parser.h"
|
|
53
54
|
#include "src/core/xds/xds_client/xds_resource_type.h"
|
|
54
55
|
#include "upb/text/encode.h"
|
|
55
56
|
#include "absl/log/log.h"
|
|
@@ -288,14 +289,14 @@ XdsListenerResource::HttpConnectionManager HttpConnectionManagerParse(
|
|
|
288
289
|
http_filter);
|
|
289
290
|
auto extension = ExtractXdsExtension(context, typed_config, errors);
|
|
290
291
|
if (!extension.has_value()) continue;
|
|
291
|
-
const
|
|
292
|
+
const XdsHttpFilterFactory* factory =
|
|
292
293
|
http_filter_registry.GetFilterForTopLevelType(extension->type);
|
|
293
|
-
if (
|
|
294
|
+
if (factory == nullptr) {
|
|
294
295
|
if (!is_optional) errors->AddError("unsupported filter type");
|
|
295
296
|
continue;
|
|
296
297
|
}
|
|
297
|
-
if ((is_client && !
|
|
298
|
-
(!is_client && !
|
|
298
|
+
if ((is_client && !factory->IsSupportedOnClients()) ||
|
|
299
|
+
(!is_client && !factory->IsSupportedOnServers())) {
|
|
299
300
|
if (!is_optional) {
|
|
300
301
|
errors->AddError(absl::StrCat("filter is not supported on ",
|
|
301
302
|
is_client ? "clients" : "servers"));
|
|
@@ -305,16 +306,19 @@ XdsListenerResource::HttpConnectionManager HttpConnectionManagerParse(
|
|
|
305
306
|
http_connection_manager.http_filters.emplace_back();
|
|
306
307
|
auto& entry = http_connection_manager.http_filters.back();
|
|
307
308
|
entry.name = std::string(name);
|
|
308
|
-
entry.config_proto_type =
|
|
309
|
+
entry.config_proto_type = factory->ConfigProtoName();
|
|
310
|
+
entry.disabled =
|
|
311
|
+
envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_disabled(
|
|
312
|
+
http_filter);
|
|
309
313
|
if (!is_client) {
|
|
310
|
-
std::optional<Json> filter_config =
|
|
311
|
-
name, context, *extension, errors);
|
|
314
|
+
std::optional<Json> filter_config =
|
|
315
|
+
factory->GenerateFilterConfig(name, context, *extension, errors);
|
|
312
316
|
if (filter_config.has_value()) {
|
|
313
317
|
entry.config = std::move(*filter_config);
|
|
314
318
|
}
|
|
315
319
|
}
|
|
316
320
|
entry.filter_config =
|
|
317
|
-
|
|
321
|
+
factory->ParseTopLevelConfig(name, context, *extension, errors);
|
|
318
322
|
}
|
|
319
323
|
}
|
|
320
324
|
if (errors->size() == original_error_size &&
|
|
@@ -326,19 +330,19 @@ XdsListenerResource::HttpConnectionManager HttpConnectionManagerParse(
|
|
|
326
330
|
// to take care of the case where there are two terminal filters in the list
|
|
327
331
|
// out of which only one gets added in the final list.
|
|
328
332
|
for (const auto& http_filter : http_connection_manager.http_filters) {
|
|
329
|
-
const
|
|
333
|
+
const XdsHttpFilterFactory* factory =
|
|
330
334
|
http_filter_registry.GetFilterForTopLevelType(
|
|
331
335
|
http_filter.config_proto_type);
|
|
332
336
|
if (&http_filter != &http_connection_manager.http_filters.back()) {
|
|
333
337
|
// Filters before the last filter must not be terminal.
|
|
334
|
-
if (
|
|
338
|
+
if (factory->IsTerminalFilter()) {
|
|
335
339
|
errors->AddError(absl::StrCat(
|
|
336
340
|
"terminal filter for config type ", http_filter.config_proto_type,
|
|
337
341
|
" must be the last filter in the chain"));
|
|
338
342
|
}
|
|
339
343
|
} else {
|
|
340
344
|
// The last filter must be terminal.
|
|
341
|
-
if (!
|
|
345
|
+
if (!factory->IsTerminalFilter()) {
|
|
342
346
|
errors->AddError(absl::StrCat("non-terminal filter for config type ",
|
|
343
347
|
http_filter.config_proto_type,
|
|
344
348
|
" is the last filter in the chain"));
|
|
@@ -668,6 +672,7 @@ std::optional<FilterChain> FilterChainParse(
|
|
|
668
672
|
return filter_chain;
|
|
669
673
|
}
|
|
670
674
|
|
|
675
|
+
// TODO(roth): Merge this with ParseXdsAddress() to avoid duplication.
|
|
671
676
|
std::optional<std::string> AddressParse(
|
|
672
677
|
const envoy_config_core_v3_Address* address_proto,
|
|
673
678
|
ValidationErrors* errors) {
|
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
|
|
18
18
|
#include <memory>
|
|
19
19
|
|
|
20
|
-
#include "src/core/
|
|
20
|
+
#include "src/core/util/unique_type_name.h"
|
|
21
|
+
#include "src/core/util/validation_errors.h"
|
|
21
22
|
#include "src/core/xds/grpc/xds_matcher.h"
|
|
22
23
|
#include "src/core/xds/grpc/xds_matcher_action.h"
|
|
24
|
+
#include "src/core/xds/xds_client/xds_resource_type.h"
|
|
23
25
|
#include "xds/type/matcher/v3/matcher.upb.h"
|
|
24
26
|
|
|
25
27
|
namespace grpc_core {
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
#include "envoy/config/core/v3/address.upbdefs.h"
|
|
24
24
|
#include "envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h"
|
|
25
25
|
#include "envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h"
|
|
26
|
+
#include "src/core/config/experiment_env_var.h"
|
|
26
27
|
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
|
27
28
|
#include "src/core/util/upb_utils.h"
|
|
28
29
|
#include "src/core/util/validation_errors.h"
|
|
29
|
-
#include "src/core/xds/grpc/xds_cluster_parser.h"
|
|
30
30
|
#include "src/core/xds/grpc/xds_common_types.h"
|
|
31
31
|
#include "src/core/xds/grpc/xds_common_types_parser.h"
|
|
32
32
|
#include "upb/base/string_view.h"
|
|
@@ -39,6 +39,11 @@
|
|
|
39
39
|
|
|
40
40
|
namespace grpc_core {
|
|
41
41
|
|
|
42
|
+
// TODO(roth): Remove this once the feature passes interop tests.
|
|
43
|
+
bool XdsHttpConnectEnabled() {
|
|
44
|
+
return IsExperimentEnvVarEnabled("GRPC_EXPERIMENTAL_XDS_HTTP_CONNECT");
|
|
45
|
+
}
|
|
46
|
+
|
|
42
47
|
namespace {
|
|
43
48
|
|
|
44
49
|
std::unique_ptr<XdsMetadataValue> ParseGcpAuthnAudience(
|
|
@@ -38,6 +38,8 @@ std::string XdsRouteConfigResource::FilterConfigOverride::ToString() const {
|
|
|
38
38
|
StrAppend(result, config_proto_type);
|
|
39
39
|
StrAppend(result, ", config=");
|
|
40
40
|
StrAppend(result, JsonDump(config));
|
|
41
|
+
StrAppend(result, ", disabled=");
|
|
42
|
+
StrAppend(result, disabled ? "true" : "false");
|
|
41
43
|
StrAppend(result, ", filter_config=");
|
|
42
44
|
StrAppend(result,
|
|
43
45
|
filter_config == nullptr ? "null" : filter_config->ToString());
|
|
@@ -42,11 +42,13 @@ struct XdsRouteConfigResource : public XdsResourceType::ResourceData {
|
|
|
42
42
|
absl::string_view config_proto_type;
|
|
43
43
|
Json config;
|
|
44
44
|
RefCountedPtr<const FilterConfig> filter_config;
|
|
45
|
+
bool disabled = false;
|
|
45
46
|
|
|
46
47
|
bool operator==(const FilterConfigOverride& other) const {
|
|
47
48
|
if (config_proto_type != other.config_proto_type) return false;
|
|
48
49
|
if (config != other.config) return false;
|
|
49
|
-
if (
|
|
50
|
+
if (disabled != other.disabled) return false;
|
|
51
|
+
if (filter_config == nullptr) return other.filter_config == nullptr;
|
|
50
52
|
if (other.filter_config == nullptr) return false;
|
|
51
53
|
return *filter_config == *other.filter_config;
|
|
52
54
|
}
|