grpc 1.78.1 → 1.80.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 +22 -8
- data/include/grpc/credentials.h +47 -37
- data/include/grpc/credentials_cpp.h +39 -0
- data/include/grpc/event_engine/event_engine.h +8 -3
- data/include/grpc/grpc.h +4 -0
- data/include/grpc/impl/call.h +9 -0
- data/include/grpc/impl/channel_arg_names.h +7 -0
- data/include/grpc/module.modulemap +2 -0
- data/include/grpc/private_key_signer.h +104 -0
- data/include/grpc/support/port_platform.h +6 -0
- data/src/core/call/call_filters.h +101 -78
- data/src/core/call/call_spine.h +91 -68
- data/src/core/call/call_state.h +60 -4
- data/src/core/call/client_call.cc +9 -9
- data/src/core/call/client_call.h +1 -1
- data/src/core/call/metadata_batch.cc +2 -0
- data/src/core/call/metadata_batch.h +48 -1
- data/src/core/call/metadata_info.cc +35 -0
- data/src/core/call/metadata_info.h +2 -0
- data/src/core/call/simple_slice_based_metadata.h +2 -1
- data/src/core/channelz/channelz.cc +9 -6
- data/src/core/channelz/channelz.h +7 -4
- data/src/core/channelz/property_list.h +5 -0
- data/src/core/channelz/v2tov1/convert.cc +1 -1
- data/src/core/channelz/v2tov1/legacy_api.cc +164 -307
- data/src/core/client_channel/buffered_call.cc +7 -3
- data/src/core/client_channel/buffered_call.h +11 -5
- data/src/core/client_channel/client_channel.cc +106 -44
- data/src/core/client_channel/client_channel.h +3 -6
- data/src/core/client_channel/client_channel_filter.cc +90 -64
- data/src/core/client_channel/client_channel_filter.h +3 -6
- data/src/core/client_channel/client_channel_internal.h +5 -0
- data/src/core/client_channel/config_selector.h +17 -12
- data/src/core/client_channel/dynamic_filters.cc +8 -7
- data/src/core/client_channel/dynamic_filters.h +7 -5
- data/src/core/client_channel/retry_filter.cc +1 -1
- data/src/core/client_channel/retry_filter.h +2 -2
- data/src/core/client_channel/subchannel.cc +1682 -266
- data/src/core/client_channel/subchannel.h +411 -134
- data/src/core/client_channel/subchannel_stream_client.cc +22 -18
- data/src/core/client_channel/subchannel_stream_client.h +8 -9
- data/src/core/client_channel/subchannel_stream_limiter.cc +76 -0
- data/src/core/client_channel/subchannel_stream_limiter.h +51 -0
- data/src/core/config/config_vars.cc +9 -1
- data/src/core/config/config_vars.h +6 -0
- data/src/core/credentials/call/call_creds_registry.h +51 -22
- data/src/core/credentials/call/call_creds_registry_init.cc +86 -2
- data/src/core/credentials/call/external/aws_external_account_credentials.cc +2 -2
- data/src/core/credentials/call/external/external_account_credentials.cc +11 -4
- data/src/core/credentials/call/external/file_external_account_credentials.cc +2 -2
- data/src/core/credentials/transport/channel_creds_registry.h +71 -20
- data/src/core/credentials/transport/channel_creds_registry_init.cc +338 -29
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +43 -24
- data/src/core/credentials/transport/ssl/ssl_credentials.h +7 -1
- data/src/core/credentials/transport/ssl/ssl_security_connector.cc +2 -8
- data/src/core/credentials/transport/ssl/ssl_security_connector.h +4 -3
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.cc +25 -5
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.h +7 -5
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc +181 -109
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.h +55 -42
- data/src/core/credentials/transport/tls/grpc_tls_credentials_options.cc +28 -23
- data/src/core/credentials/transport/tls/grpc_tls_credentials_options.h +26 -23
- data/src/core/credentials/transport/tls/spiffe_utils.cc +2 -2
- data/src/core/credentials/transport/tls/ssl_utils.cc +18 -18
- data/src/core/credentials/transport/tls/ssl_utils.h +12 -10
- data/src/core/credentials/transport/tls/tls_security_connector.cc +106 -74
- data/src/core/credentials/transport/tls/tls_security_connector.h +12 -8
- data/src/core/credentials/transport/xds/xds_credentials.cc +76 -32
- data/src/core/credentials/transport/xds/xds_credentials.h +4 -2
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +117 -35
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +42 -4
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +58 -29
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +19 -11
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +82 -25
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +28 -3
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc +9 -7
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +1 -1
- data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.h +7 -1
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +117 -67
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +2 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +11 -1
- data/src/core/ext/transport/chttp2/transport/frame.cc +2 -15
- data/src/core/ext/transport/chttp2/transport/frame.h +0 -4
- data/src/core/ext/transport/chttp2/transport/goaway.cc +17 -2
- data/src/core/ext/transport/chttp2/transport/goaway.h +27 -6
- data/src/core/ext/transport/chttp2/transport/header_assembler.h +8 -21
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +101 -40
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +95 -0
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +923 -772
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +406 -423
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +8 -1
- data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +25 -13
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +71 -24
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +25 -49
- data/src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h +2 -2
- data/src/core/ext/transport/chttp2/transport/incoming_metadata_tracker.h +29 -9
- data/src/core/ext/transport/chttp2/transport/internal.h +6 -2
- data/src/core/ext/transport/chttp2/transport/keepalive.cc +14 -20
- data/src/core/ext/transport/chttp2/transport/keepalive.h +9 -6
- data/src/core/ext/transport/chttp2/transport/parsing.cc +11 -0
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +34 -74
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +123 -79
- data/src/core/ext/transport/chttp2/transport/security_frame.h +233 -3
- data/src/core/ext/transport/chttp2/transport/stream.h +152 -73
- data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +155 -85
- data/src/core/ext/transport/chttp2/transport/transport_common.h +0 -5
- data/src/core/ext/transport/chttp2/transport/writable_streams.h +8 -7
- data/src/core/ext/transport/chttp2/transport/write_cycle.cc +86 -0
- data/src/core/ext/transport/chttp2/transport/write_cycle.h +355 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +31 -29
- data/src/core/ext/upb-gen/cel/expr/checked.upb.h +1875 -0
- data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.c +409 -0
- data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.h +56 -0
- data/src/core/ext/upb-gen/cel/expr/syntax.upb.h +2223 -0
- data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.c +489 -0
- data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.h +60 -0
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb.h +2 -1
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +130 -18
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +18 -13
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +70 -38
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +20 -17
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb.h +26 -10
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c +8 -7
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb.h +495 -0
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.c +114 -0
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.h +36 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +26 -10
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +8 -7
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb.h +121 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.c +54 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb.h +143 -9
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c +18 -6
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +112 -11
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +22 -9
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb.h +276 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.c +60 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.h +4 -0
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +72 -0
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +23 -2
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +129 -13
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +36 -10
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +30 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +5 -3
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb.h +16 -0
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c +4 -3
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +31 -0
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +5 -3
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb.h +2 -1
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +63 -0
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +12 -7
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb.h +97 -81
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c +40 -23
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +604 -228
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +146 -100
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb.h +30 -0
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c +5 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +35 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +7 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +66 -14
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +22 -11
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +87 -0
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c +29 -2
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +20 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +5 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +239 -60
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +59 -28
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb.h +89 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.c +50 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb.h +135 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.c +53 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb.h +105 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.c +51 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb_minitable.c +6 -3
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +206 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +41 -8
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +64 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +4 -3
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +64 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.c +31 -5
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb.h +283 -14
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c +48 -11
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb.h +144 -6
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c +35 -7
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb.h +42 -21
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c +9 -8
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +164 -1
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +37 -6
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb.h +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb.h +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb.h +26 -11
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c +8 -8
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb.h +33 -0
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.c +14 -3
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb.h +90 -10
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.c +18 -7
- data/src/core/ext/upbdefs-gen/cel/expr/checked.upbdefs.c +248 -0
- data/src/core/ext/upbdefs-gen/cel/expr/checked.upbdefs.h +97 -0
- data/src/core/ext/upbdefs-gen/cel/expr/syntax.upbdefs.c +283 -0
- data/src/core/ext/upbdefs-gen/cel/expr/syntax.upbdefs.h +107 -0
- data/src/core/ext/upbdefs-gen/envoy/config/accesslog/v3/accesslog.upbdefs.c +213 -211
- data/src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +635 -614
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.c +1012 -1000
- data/src/core/ext/upbdefs-gen/envoy/config/common/matcher/v3/matcher.upbdefs.c +276 -273
- data/src/core/ext/upbdefs-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upbdefs.c +152 -0
- data/src/core/ext/upbdefs-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upbdefs.h +47 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/address.upbdefs.c +149 -144
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.c +367 -370
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/cel.upbdefs.c +63 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/cel.upbdefs.h +37 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/grpc_service.upbdefs.c +297 -284
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.c +492 -469
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/proxy_protocol.upbdefs.c +74 -43
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/proxy_protocol.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/substitution_format_string.upbdefs.c +60 -59
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +202 -184
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.c +354 -339
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/quic_config.upbdefs.c +28 -19
- data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/metrics_service.upbdefs.c +30 -27
- data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/stats.upbdefs.c +71 -66
- data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.c +94 -91
- data/src/core/ext/upbdefs-gen/envoy/config/rbac/v3/rbac.upbdefs.c +386 -369
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route.upbdefs.c +60 -57
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.c +1974 -1884
- data/src/core/ext/upbdefs-gen/envoy/config/tap/v3/common.upbdefs.c +119 -112
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opentelemetry.upbdefs.c +62 -51
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/zipkin.upbdefs.c +109 -88
- data/src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +54 -36
- data/src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +78 -84
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c +48 -46
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +1041 -984
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +304 -290
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +94 -77
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upbdefs.c +246 -193
- data/src/core/ext/upbdefs-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/type/http/v3/cookie.upbdefs.c +37 -23
- data/src/core/ext/upbdefs-gen/envoy/type/http/v3/cookie.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/type/tracing/v3/custom_tag.upbdefs.c +5 -3
- data/src/core/ext/upbdefs-gen/google/api/http.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-gen/google/api/httpbody.upbdefs.c +4 -5
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.c +113 -87
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/udpa/annotations/migrate.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/security.upbdefs.c +6 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/sensitive.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/status.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/versioning.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/cel.upbdefs.c +25 -30
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/http_inputs.upbdefs.c +14 -20
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/matcher.upbdefs.c +180 -183
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/string.upbdefs.c +56 -47
- data/src/core/ext/upbdefs-gen/xds/type/v3/cel.upbdefs.c +69 -47
- data/src/core/filter/filter_chain.h +95 -0
- data/src/core/handshaker/http_connect/{http_connect_handshaker.cc → http_connect_client_handshaker.cc} +32 -31
- data/src/core/handshaker/http_connect/{http_connect_handshaker.h → http_connect_client_handshaker.h} +4 -4
- data/src/core/handshaker/http_connect/http_proxy_mapper.cc +1 -1
- data/src/core/handshaker/http_connect/xds_http_proxy_mapper.cc +1 -1
- data/src/core/handshaker/security/pipelined_secure_endpoint.cc +14 -13
- data/src/core/handshaker/security/secure_endpoint.cc +282 -68
- data/src/core/handshaker/security/secure_endpoint.h +0 -7
- data/src/core/lib/channel/channel_args.h +1 -1
- data/src/core/lib/channel/promise_based_filter.cc +17 -4
- data/src/core/lib/channel/promise_based_filter.h +3 -2
- data/src/core/lib/debug/trace_flags.cc +2 -0
- data/src/core/lib/debug/trace_flags.h +1 -0
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +35 -8
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +1 -2
- data/src/core/lib/event_engine/event_engine.cc +9 -0
- data/src/core/lib/event_engine/extensions/tcp_trace.h +0 -3
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +2 -2
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +1 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +34 -9
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +24 -2
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +1 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +141 -14
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +19 -2
- data/src/core/lib/event_engine/posix_engine/posix_interface.h +7 -0
- data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +21 -3
- data/src/core/lib/event_engine/posix_engine/posix_interface_windows.cc +16 -0
- data/src/core/lib/experiments/experiments.cc +309 -201
- data/src/core/lib/experiments/experiments.h +141 -80
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +2 -2
- data/src/core/lib/iomgr/resolve_address.h +0 -2
- data/src/core/lib/iomgr/resolved_address.h +0 -2
- data/src/core/lib/iomgr/tcp_posix.cc +13 -5
- data/src/core/lib/iomgr/tcp_server.cc +0 -5
- data/src/core/lib/iomgr/tcp_server.h +0 -7
- data/src/core/lib/iomgr/tcp_server_posix.cc +0 -17
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +0 -3
- data/src/core/lib/iomgr/tcp_server_windows.cc +12 -51
- data/src/core/lib/promise/all_ok.h +17 -12
- data/src/core/lib/promise/cancel_callback.h +12 -13
- data/src/core/lib/promise/detail/join_state.h +626 -0
- data/src/core/lib/promise/detail/promise_factory.h +14 -14
- data/src/core/lib/promise/for_each.h +32 -8
- data/src/core/lib/promise/if.h +9 -7
- data/src/core/lib/promise/loop.h +18 -16
- data/src/core/lib/promise/map.h +54 -47
- data/src/core/lib/promise/mpsc.h +11 -10
- data/src/core/lib/promise/observable.h +6 -6
- data/src/core/lib/promise/party.h +25 -19
- data/src/core/lib/promise/poll.h +5 -5
- data/src/core/lib/promise/prioritized_race.h +10 -7
- data/src/core/lib/promise/promise.h +16 -11
- data/src/core/lib/promise/race.h +6 -5
- data/src/core/lib/promise/seq.h +109 -74
- data/src/core/lib/promise/try_join.h +14 -6
- data/src/core/lib/promise/try_seq.h +76 -60
- data/src/core/lib/resource_quota/api.cc +7 -0
- data/src/core/lib/resource_quota/arena.h +1 -1
- data/src/core/lib/resource_quota/memory_quota.cc +4 -1
- data/src/core/lib/resource_quota/resource_quota.cc +2 -1
- data/src/core/lib/resource_quota/resource_quota.h +3 -0
- data/src/core/lib/resource_quota/stream_quota.cc +77 -1
- data/src/core/lib/resource_quota/stream_quota.h +64 -1
- data/src/core/lib/resource_quota/telemetry.h +1 -1
- data/src/core/lib/surface/call.cc +13 -0
- data/src/core/lib/surface/call_utils.h +58 -43
- data/src/core/lib/surface/channel.h +1 -4
- data/src/core/lib/surface/completion_queue.cc +13 -6
- data/src/core/lib/surface/validate_metadata.cc +20 -15
- data/src/core/lib/surface/validate_metadata.h +3 -1
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/promise_endpoint.cc +1 -1
- data/src/core/lib/transport/promise_endpoint.h +1 -1
- data/src/core/lib/transport/transport.h +5 -0
- data/src/core/load_balancing/health_check_client.cc +1 -15
- data/src/core/load_balancing/health_check_client_internal.h +0 -2
- data/src/core/load_balancing/oob_backend_metric.cc +1 -5
- data/src/core/load_balancing/oob_backend_metric_internal.h +0 -1
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +12 -9
- data/src/core/plugin_registry/grpc_plugin_registry.cc +3 -2
- data/src/core/resolver/xds/xds_resolver.cc +162 -116
- data/src/core/server/server.cc +18 -1
- data/src/core/server/server.h +2 -0
- data/src/core/server/xds_server_config_fetcher.cc +4 -4
- data/src/core/telemetry/call_tracer.cc +87 -2
- data/src/core/telemetry/call_tracer.h +46 -8
- data/src/core/telemetry/instrument.cc +102 -40
- data/src/core/telemetry/instrument.h +246 -65
- data/src/core/tsi/fake_transport_security.cc +3 -1
- data/src/core/tsi/ssl_transport_security.cc +516 -137
- data/src/core/tsi/ssl_transport_security.h +28 -22
- data/src/core/tsi/ssl_transport_security_utils.cc +2 -2
- data/src/core/tsi/ssl_transport_security_utils.h +2 -2
- data/src/core/util/bitset.h +6 -0
- data/src/core/util/function_signature.h +3 -1
- data/src/core/util/http_client/httpcli_security_connector.cc +2 -1
- data/src/core/util/json/json_reader.cc +0 -4
- data/src/core/xds/grpc/certificate_provider_store.cc +2 -1
- data/src/core/xds/grpc/certificate_provider_store.h +3 -17
- data/src/core/xds/grpc/certificate_provider_store_interface.h +61 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +48 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +18 -0
- data/src/core/xds/grpc/xds_certificate_provider.cc +7 -2
- data/src/core/xds/grpc/xds_certificate_provider.h +13 -2
- data/src/core/xds/grpc/xds_client_grpc.cc +13 -6
- data/src/core/xds/grpc/xds_client_grpc.h +10 -7
- data/src/core/xds/grpc/xds_cluster.cc +18 -4
- data/src/core/xds/grpc/xds_cluster.h +17 -2
- data/src/core/xds/grpc/xds_cluster_parser.cc +36 -11
- data/src/core/xds/grpc/xds_common_types.cc +45 -0
- data/src/core/xds/grpc/xds_common_types.h +31 -0
- data/src/core/xds/grpc/xds_common_types_parser.cc +274 -16
- data/src/core/xds/grpc/xds_common_types_parser.h +12 -0
- data/src/core/xds/grpc/xds_http_fault_filter.cc +128 -24
- data/src/core/xds/grpc/xds_http_fault_filter.h +19 -10
- data/src/core/xds/grpc/xds_http_filter.cc +38 -0
- data/src/core/xds/grpc/xds_http_filter.h +70 -47
- data/src/core/xds/grpc/xds_http_filter_registry.cc +48 -14
- data/src/core/xds/grpc/xds_http_filter_registry.h +29 -15
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +88 -22
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +22 -11
- data/src/core/xds/grpc/xds_http_rbac_filter.cc +36 -20
- data/src/core/xds/grpc/xds_http_rbac_filter.h +19 -10
- data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +143 -26
- data/src/core/xds/grpc/xds_http_stateful_session_filter.h +19 -10
- data/src/core/xds/grpc/xds_listener.cc +4 -1
- data/src/core/xds/grpc/xds_listener.h +10 -2
- data/src/core/xds/grpc/xds_listener_parser.cc +23 -18
- data/src/core/xds/grpc/xds_matcher.cc +40 -5
- data/src/core/xds/grpc/xds_matcher.h +13 -0
- data/src/core/xds/grpc/xds_matcher_action.h +1 -1
- data/src/core/xds/grpc/xds_matcher_parse.cc +60 -40
- data/src/core/xds/grpc/xds_matcher_parse.h +2 -1
- data/src/core/xds/grpc/xds_route_config.cc +12 -1
- data/src/core/xds/grpc/xds_route_config.h +15 -2
- data/src/core/xds/grpc/xds_route_config_parser.cc +11 -5
- data/src/core/xds/grpc/xds_routing.cc +181 -6
- data/src/core/xds/grpc/xds_routing.h +57 -0
- data/src/core/xds/grpc/xds_server_grpc.cc +55 -43
- data/src/core/xds/grpc/xds_server_grpc.h +13 -6
- data/src/core/xds/grpc/xds_server_grpc_interface.h +3 -2
- data/src/core/xds/grpc/xds_transport_grpc.cc +12 -6
- data/src/core/xds/grpc/xds_transport_grpc.h +5 -1
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +12 -8
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +18 -12
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +1 -1
- metadata +42 -6
- data/src/core/ext/transport/chttp2/transport/security_frame.cc +0 -31
- data/src/core/handshaker/security/legacy_secure_endpoint.cc +0 -597
|
@@ -251,7 +251,7 @@ XdsListenerResource::HttpConnectionManager HttpConnectionManagerParse(
|
|
|
251
251
|
auto extension = ExtractXdsExtension(context, typed_config, errors);
|
|
252
252
|
if (!extension.has_value()) continue;
|
|
253
253
|
const XdsHttpFilterImpl* filter_impl =
|
|
254
|
-
http_filter_registry.
|
|
254
|
+
http_filter_registry.GetFilterForTopLevelType(extension->type);
|
|
255
255
|
if (filter_impl == nullptr) {
|
|
256
256
|
if (!is_optional) errors->AddError("unsupported filter type");
|
|
257
257
|
continue;
|
|
@@ -264,13 +264,20 @@ XdsListenerResource::HttpConnectionManager HttpConnectionManagerParse(
|
|
|
264
264
|
}
|
|
265
265
|
continue;
|
|
266
266
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
267
|
+
http_connection_manager.http_filters.emplace_back();
|
|
268
|
+
auto& entry = http_connection_manager.http_filters.back();
|
|
269
|
+
entry.name = std::string(name);
|
|
270
|
+
entry.config_proto_type = filter_impl->ConfigProtoName();
|
|
271
|
+
if (!is_client || !IsXdsChannelFilterChainPerRouteEnabled()) {
|
|
272
|
+
std::optional<Json> filter_config = filter_impl->GenerateFilterConfig(
|
|
273
|
+
name, context, *extension, errors);
|
|
274
|
+
if (filter_config.has_value()) {
|
|
275
|
+
entry.config = std::move(*filter_config);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
if (IsXdsChannelFilterChainPerRouteEnabled()) {
|
|
279
|
+
entry.filter_config = filter_impl->ParseTopLevelConfig(
|
|
280
|
+
name, context, *extension, errors);
|
|
274
281
|
}
|
|
275
282
|
}
|
|
276
283
|
}
|
|
@@ -284,23 +291,21 @@ XdsListenerResource::HttpConnectionManager HttpConnectionManagerParse(
|
|
|
284
291
|
// out of which only one gets added in the final list.
|
|
285
292
|
for (const auto& http_filter : http_connection_manager.http_filters) {
|
|
286
293
|
const XdsHttpFilterImpl* filter_impl =
|
|
287
|
-
http_filter_registry.
|
|
288
|
-
http_filter.
|
|
294
|
+
http_filter_registry.GetFilterForTopLevelType(
|
|
295
|
+
http_filter.config_proto_type);
|
|
289
296
|
if (&http_filter != &http_connection_manager.http_filters.back()) {
|
|
290
297
|
// Filters before the last filter must not be terminal.
|
|
291
298
|
if (filter_impl->IsTerminalFilter()) {
|
|
292
|
-
errors->AddError(
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
" must be the last filter in the chain"));
|
|
299
|
+
errors->AddError(absl::StrCat(
|
|
300
|
+
"terminal filter for config type ", http_filter.config_proto_type,
|
|
301
|
+
" must be the last filter in the chain"));
|
|
296
302
|
}
|
|
297
303
|
} else {
|
|
298
304
|
// The last filter must be terminal.
|
|
299
305
|
if (!filter_impl->IsTerminalFilter()) {
|
|
300
|
-
errors->AddError(
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
" is the last filter in the chain"));
|
|
306
|
+
errors->AddError(absl::StrCat("non-terminal filter for config type ",
|
|
307
|
+
http_filter.config_proto_type,
|
|
308
|
+
" is the last filter in the chain"));
|
|
304
309
|
}
|
|
305
310
|
}
|
|
306
311
|
}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
namespace grpc_core {
|
|
28
28
|
|
|
29
29
|
//
|
|
30
|
-
// XdsMatcher
|
|
30
|
+
// XdsMatcher::OnMatch
|
|
31
31
|
//
|
|
32
32
|
|
|
33
33
|
bool XdsMatcher::OnMatch::operator==(const OnMatch& other) const {
|
|
@@ -82,6 +82,15 @@ bool XdsMatcher::OnMatch::FindMatches(const MatchContext& context,
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
void XdsMatcherList::OnMatch::ForEachAction(
|
|
86
|
+
absl::FunctionRef<void(const Action&)> func) const {
|
|
87
|
+
Match(
|
|
88
|
+
action, [&](const std::unique_ptr<Action>& action) { func(*action); },
|
|
89
|
+
[&](const std::unique_ptr<XdsMatcher>& matcher) {
|
|
90
|
+
matcher->ForEachAction(func);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
85
94
|
//
|
|
86
95
|
// XdsMatcherList
|
|
87
96
|
//
|
|
@@ -120,6 +129,16 @@ bool XdsMatcherList::FindMatches(const MatchContext& context,
|
|
|
120
129
|
return false;
|
|
121
130
|
}
|
|
122
131
|
|
|
132
|
+
void XdsMatcherList::ForEachAction(
|
|
133
|
+
absl::FunctionRef<void(const Action&)> func) const {
|
|
134
|
+
for (const auto& [_, on_match] : matchers_) {
|
|
135
|
+
on_match.ForEachAction(func);
|
|
136
|
+
}
|
|
137
|
+
if (on_no_match_.has_value()) {
|
|
138
|
+
on_no_match_->ForEachAction(func);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
123
142
|
bool XdsMatcherList::AndPredicate::Equals(const Predicate& other) const {
|
|
124
143
|
if (type() != other.type()) return false;
|
|
125
144
|
const auto& o = DownCast<const AndPredicate&>(other);
|
|
@@ -213,6 +232,16 @@ bool XdsMatcherExactMap::FindMatches(const MatchContext& context,
|
|
|
213
232
|
return false;
|
|
214
233
|
}
|
|
215
234
|
|
|
235
|
+
void XdsMatcherExactMap::ForEachAction(
|
|
236
|
+
absl::FunctionRef<void(const Action&)> func) const {
|
|
237
|
+
for (const auto& [_, on_match] : map_) {
|
|
238
|
+
on_match.ForEachAction(func);
|
|
239
|
+
}
|
|
240
|
+
if (on_no_match_.has_value()) {
|
|
241
|
+
on_no_match_->ForEachAction(func);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
216
245
|
//
|
|
217
246
|
// XdsMatcherPrefixMap
|
|
218
247
|
//
|
|
@@ -256,10 +285,6 @@ bool XdsMatcherPrefixMap::FindMatches(const MatchContext& context,
|
|
|
256
285
|
auto input = input_->GetValue(context);
|
|
257
286
|
std::vector<const OnMatch*> on_match_results;
|
|
258
287
|
root_.ForEachPrefixMatch(input.value_or(""), [&](const OnMatch& on_match) {
|
|
259
|
-
if (!on_match.keep_matching) {
|
|
260
|
-
// Don't need previous entries if we can use this one.
|
|
261
|
-
on_match_results.clear();
|
|
262
|
-
}
|
|
263
288
|
on_match_results.push_back(&on_match);
|
|
264
289
|
});
|
|
265
290
|
for (auto it = on_match_results.rbegin(); it != on_match_results.rend();
|
|
@@ -274,4 +299,14 @@ bool XdsMatcherPrefixMap::FindMatches(const MatchContext& context,
|
|
|
274
299
|
return false;
|
|
275
300
|
}
|
|
276
301
|
|
|
302
|
+
void XdsMatcherPrefixMap::ForEachAction(
|
|
303
|
+
absl::FunctionRef<void(const Action&)> func) const {
|
|
304
|
+
root_.ForEach([&](absl::string_view /*key*/, const OnMatch& on_match) {
|
|
305
|
+
on_match.ForEachAction(func);
|
|
306
|
+
});
|
|
307
|
+
if (on_no_match_.has_value()) {
|
|
308
|
+
on_no_match_->ForEachAction(func);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
277
312
|
} // namespace grpc_core
|
|
@@ -105,6 +105,7 @@ class XdsMatcher {
|
|
|
105
105
|
bool operator!=(const OnMatch& other) const { return !(*this == other); }
|
|
106
106
|
|
|
107
107
|
bool FindMatches(const MatchContext& context, Result& result) const;
|
|
108
|
+
void ForEachAction(absl::FunctionRef<void(const Action&)> func) const;
|
|
108
109
|
std::string ToString() const;
|
|
109
110
|
|
|
110
111
|
std::variant<std::unique_ptr<Action>, std::unique_ptr<XdsMatcher>> action;
|
|
@@ -125,6 +126,12 @@ class XdsMatcher {
|
|
|
125
126
|
// considered successful.
|
|
126
127
|
virtual bool FindMatches(const MatchContext& context,
|
|
127
128
|
Result& result) const = 0;
|
|
129
|
+
|
|
130
|
+
// Calls func for each action in the matcher. This can be used to
|
|
131
|
+
// initialize data structures that the caller needs for matching after
|
|
132
|
+
// the matcher tree has already been constructed.
|
|
133
|
+
virtual void ForEachAction(
|
|
134
|
+
absl::FunctionRef<void(const Action&)> func) const = 0;
|
|
128
135
|
};
|
|
129
136
|
|
|
130
137
|
//
|
|
@@ -223,6 +230,8 @@ class XdsMatcherList : public XdsMatcher {
|
|
|
223
230
|
bool Equals(const XdsMatcher& other) const override;
|
|
224
231
|
std::string ToString() const override;
|
|
225
232
|
bool FindMatches(const MatchContext& context, Result& result) const override;
|
|
233
|
+
void ForEachAction(
|
|
234
|
+
absl::FunctionRef<void(const Action&)> func) const override;
|
|
226
235
|
|
|
227
236
|
private:
|
|
228
237
|
template <typename T>
|
|
@@ -401,6 +410,8 @@ class XdsMatcherExactMap : public XdsMatcher {
|
|
|
401
410
|
bool Equals(const XdsMatcher& other) const override;
|
|
402
411
|
std::string ToString() const override;
|
|
403
412
|
bool FindMatches(const MatchContext& context, Result& result) const override;
|
|
413
|
+
void ForEachAction(
|
|
414
|
+
absl::FunctionRef<void(const Action&)> func) const override;
|
|
404
415
|
|
|
405
416
|
private:
|
|
406
417
|
std::unique_ptr<InputValue<absl::string_view>> input_;
|
|
@@ -420,6 +431,8 @@ class XdsMatcherPrefixMap : public XdsMatcher {
|
|
|
420
431
|
bool Equals(const XdsMatcher& other) const override;
|
|
421
432
|
std::string ToString() const override;
|
|
422
433
|
bool FindMatches(const MatchContext& context, Result& result) const override;
|
|
434
|
+
void ForEachAction(
|
|
435
|
+
absl::FunctionRef<void(const Action&)> func) const override;
|
|
423
436
|
|
|
424
437
|
private:
|
|
425
438
|
TrieLookupTree<XdsMatcher::OnMatch> root_;
|
|
@@ -23,11 +23,11 @@ namespace grpc_core {
|
|
|
23
23
|
|
|
24
24
|
class XdsMatcherActionFactory {
|
|
25
25
|
public:
|
|
26
|
+
virtual ~XdsMatcherActionFactory() = default;
|
|
26
27
|
virtual absl::string_view type() const = 0;
|
|
27
28
|
virtual std::unique_ptr<XdsMatcher::Action> ParseAndCreateAction(
|
|
28
29
|
const XdsResourceType::DecodeContext& context,
|
|
29
30
|
absl::string_view serialized_value, ValidationErrors* errors) const = 0;
|
|
30
|
-
virtual ~XdsMatcherActionFactory() = default;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
class XdsMatcherActionRegistry {
|
|
@@ -36,6 +36,12 @@ std::unique_ptr<XdsMatcherList::Predicate> ParsePredicate(
|
|
|
36
36
|
const XdsResourceType::DecodeContext& context,
|
|
37
37
|
const xds_type_matcher_v3_Matcher_MatcherList_Predicate* predicate,
|
|
38
38
|
const UniqueTypeName& matcher_context, ValidationErrors* errors);
|
|
39
|
+
std::unique_ptr<XdsMatcher> ParseXdsMatcherRecursive(
|
|
40
|
+
const XdsResourceType::DecodeContext& context,
|
|
41
|
+
const xds_type_matcher_v3_Matcher* matcher,
|
|
42
|
+
const XdsMatcherActionRegistry& action_registry,
|
|
43
|
+
const UniqueTypeName& matcher_context, bool allow_keep_matching, int depth,
|
|
44
|
+
ValidationErrors* errors);
|
|
39
45
|
|
|
40
46
|
// Function to parse "xds_core_v3_TypedExtensionConfig" to generate
|
|
41
47
|
// XdsMatcher::Input<T>
|
|
@@ -76,36 +82,25 @@ std::unique_ptr<XdsMatcher::Action> ParseAction(
|
|
|
76
82
|
return action_registry.ParseAndCreateAction(context, *extension, errors);
|
|
77
83
|
}
|
|
78
84
|
|
|
79
|
-
// Parse and generate input matcher with type string_view
|
|
80
|
-
// Parsing "xds_type_matcher_v3_StringMatcher" to generate StringMatcher
|
|
81
|
-
std::unique_ptr<XdsMatcherList::InputMatcher<absl::string_view>>
|
|
82
|
-
ParseStringMatcher(const XdsResourceType::DecodeContext& context,
|
|
83
|
-
const xds_type_matcher_v3_StringMatcher* string_matcher_upb,
|
|
84
|
-
ValidationErrors* errors) {
|
|
85
|
-
if (string_matcher_upb == nullptr) {
|
|
86
|
-
errors->AddError("field not present");
|
|
87
|
-
return nullptr;
|
|
88
|
-
}
|
|
89
|
-
auto string_matcher = StringMatcherParse(context, string_matcher_upb, errors);
|
|
90
|
-
return std::make_unique<XdsMatcherList::StringInputMatcher>(
|
|
91
|
-
std::move(string_matcher));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
85
|
// Parse OnMatch components of the matcher
|
|
95
|
-
// TODO(bpawan): b/431645556 this should have a max recursion depth
|
|
96
86
|
XdsMatcher::OnMatch ParseOnMatch(
|
|
97
87
|
const XdsResourceType::DecodeContext& context,
|
|
98
88
|
const xds_type_matcher_v3_Matcher_OnMatch* on_match,
|
|
99
89
|
const XdsMatcherActionRegistry& action_registry,
|
|
100
|
-
const UniqueTypeName& matcher_context,
|
|
90
|
+
const UniqueTypeName& matcher_context, bool allow_keep_matching, int depth,
|
|
91
|
+
ValidationErrors* errors) {
|
|
101
92
|
if (on_match == nullptr) {
|
|
102
93
|
errors->AddError("field not present");
|
|
103
94
|
return XdsMatcher::OnMatch(std::unique_ptr<XdsMatcher::Action>(nullptr),
|
|
104
95
|
false);
|
|
105
96
|
}
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
|
|
97
|
+
// Handle keep_matching.
|
|
98
|
+
bool keep_matching =
|
|
99
|
+
xds_type_matcher_v3_Matcher_OnMatch_keep_matching(on_match);
|
|
100
|
+
if (keep_matching && !allow_keep_matching) {
|
|
101
|
+
ValidationErrors::ScopedField field(errors, ".keep_matching");
|
|
102
|
+
errors->AddError("not supported in this component");
|
|
103
|
+
}
|
|
109
104
|
// Action is a variant which can have Action or a Nested Matcher
|
|
110
105
|
if (const auto* action_proto =
|
|
111
106
|
xds_type_matcher_v3_Matcher_OnMatch_action(on_match);
|
|
@@ -117,8 +112,9 @@ XdsMatcher::OnMatch ParseOnMatch(
|
|
|
117
112
|
xds_type_matcher_v3_Matcher_OnMatch_matcher(on_match);
|
|
118
113
|
matcher_proto != nullptr) {
|
|
119
114
|
ValidationErrors::ScopedField field(errors, ".matcher");
|
|
120
|
-
auto nested_matcher =
|
|
121
|
-
context, matcher_proto, action_registry, matcher_context,
|
|
115
|
+
auto nested_matcher = ParseXdsMatcherRecursive(
|
|
116
|
+
context, matcher_proto, action_registry, matcher_context,
|
|
117
|
+
allow_keep_matching, depth + 1, errors);
|
|
122
118
|
return XdsMatcher::OnMatch(std::move(nested_matcher), keep_matching);
|
|
123
119
|
} else {
|
|
124
120
|
errors->AddError("One of action or matcher should be present");
|
|
@@ -132,7 +128,8 @@ absl::flat_hash_map<std::string, XdsMatcher::OnMatch> ParseMatchMap(
|
|
|
132
128
|
const XdsResourceType::DecodeContext& context,
|
|
133
129
|
const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* match_map,
|
|
134
130
|
const XdsMatcherActionRegistry& action_registry,
|
|
135
|
-
const UniqueTypeName& matcher_context,
|
|
131
|
+
const UniqueTypeName& matcher_context, bool allow_keep_matching, int depth,
|
|
132
|
+
ValidationErrors* errors) {
|
|
136
133
|
absl::flat_hash_map<std::string, XdsMatcher::OnMatch> result;
|
|
137
134
|
if (xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_size(match_map) ==
|
|
138
135
|
0) {
|
|
@@ -146,7 +143,8 @@ absl::flat_hash_map<std::string, XdsMatcher::OnMatch> ParseMatchMap(
|
|
|
146
143
|
match_map, &upb_key, &value, &iter)) {
|
|
147
144
|
ValidationErrors::ScopedField field(errors, ".on_match");
|
|
148
145
|
auto on_match =
|
|
149
|
-
ParseOnMatch(context, value, action_registry, matcher_context,
|
|
146
|
+
ParseOnMatch(context, value, action_registry, matcher_context,
|
|
147
|
+
allow_keep_matching, depth, errors);
|
|
150
148
|
result.emplace(UpbStringToStdString(upb_key), std::move(on_match));
|
|
151
149
|
}
|
|
152
150
|
return result;
|
|
@@ -166,8 +164,8 @@ std::unique_ptr<XdsMatcherList::Predicate> ParseSinglePredicate(
|
|
|
166
164
|
const auto* value_match_proto =
|
|
167
165
|
xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_value_match(
|
|
168
166
|
single_predicate);
|
|
169
|
-
input_string_matcher =
|
|
170
|
-
|
|
167
|
+
input_string_matcher = std::make_unique<XdsMatcherList::StringInputMatcher>(
|
|
168
|
+
StringMatcherParse(context, value_match_proto, errors));
|
|
171
169
|
}
|
|
172
170
|
std::unique_ptr<XdsMatcher::InputValue<absl::string_view>> input_string_value;
|
|
173
171
|
{
|
|
@@ -258,7 +256,8 @@ std::vector<XdsMatcherList::FieldMatcher> ParseFieldMatcherList(
|
|
|
258
256
|
const XdsResourceType::DecodeContext& context,
|
|
259
257
|
const xds_type_matcher_v3_Matcher_MatcherList* matcher_list,
|
|
260
258
|
const XdsMatcherActionRegistry& action_registry,
|
|
261
|
-
const UniqueTypeName& matcher_context,
|
|
259
|
+
const UniqueTypeName& matcher_context, bool allow_keep_matching, int depth,
|
|
260
|
+
ValidationErrors* errors) {
|
|
262
261
|
std::vector<XdsMatcherList::FieldMatcher> field_matcher_list;
|
|
263
262
|
size_t matcher_list_size;
|
|
264
263
|
auto field_matchers = xds_type_matcher_v3_Matcher_MatcherList_matchers(
|
|
@@ -276,7 +275,7 @@ std::vector<XdsMatcherList::FieldMatcher> ParseFieldMatcherList(
|
|
|
276
275
|
xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_on_match(
|
|
277
276
|
field_matchers[i]);
|
|
278
277
|
return ParseOnMatch(context, on_match_upb, action_registry,
|
|
279
|
-
matcher_context, errors);
|
|
278
|
+
matcher_context, allow_keep_matching, depth, errors);
|
|
280
279
|
}();
|
|
281
280
|
auto predicate = [&]() {
|
|
282
281
|
ValidationErrors::ScopedField field(errors, ".predicate");
|
|
@@ -290,27 +289,29 @@ std::vector<XdsMatcherList::FieldMatcher> ParseFieldMatcherList(
|
|
|
290
289
|
return field_matcher_list;
|
|
291
290
|
}
|
|
292
291
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
// Parse Matcher Proto
|
|
296
|
-
// This the top level function expected to be called for the matcher.proto
|
|
297
|
-
std::unique_ptr<XdsMatcher> ParseXdsMatcher(
|
|
292
|
+
std::unique_ptr<XdsMatcher> ParseXdsMatcherRecursive(
|
|
298
293
|
const XdsResourceType::DecodeContext& context,
|
|
299
294
|
const xds_type_matcher_v3_Matcher* matcher,
|
|
300
295
|
const XdsMatcherActionRegistry& action_registry,
|
|
301
|
-
const UniqueTypeName& matcher_context,
|
|
296
|
+
const UniqueTypeName& matcher_context, bool allow_keep_matching, int depth,
|
|
297
|
+
ValidationErrors* errors) {
|
|
298
|
+
if (depth == 16) {
|
|
299
|
+
errors->AddError("matcher tree exceeds max recursion depth");
|
|
300
|
+
return nullptr;
|
|
301
|
+
}
|
|
302
302
|
std::optional<XdsMatcher::OnMatch> on_no_match;
|
|
303
303
|
if (xds_type_matcher_v3_Matcher_has_on_no_match(matcher)) {
|
|
304
304
|
ValidationErrors::ScopedField field(errors, ".on_no_match");
|
|
305
|
-
on_no_match =
|
|
306
|
-
|
|
307
|
-
|
|
305
|
+
on_no_match = ParseOnMatch(
|
|
306
|
+
context, xds_type_matcher_v3_Matcher_on_no_match(matcher),
|
|
307
|
+
action_registry, matcher_context, allow_keep_matching, depth, errors);
|
|
308
308
|
}
|
|
309
309
|
if (xds_type_matcher_v3_Matcher_has_matcher_list(matcher)) {
|
|
310
310
|
ValidationErrors::ScopedField field(errors, ".matcher_list");
|
|
311
311
|
auto matcher_list = xds_type_matcher_v3_Matcher_matcher_list(matcher);
|
|
312
312
|
auto field_matcher_list = ParseFieldMatcherList(
|
|
313
|
-
context, matcher_list, action_registry, matcher_context,
|
|
313
|
+
context, matcher_list, action_registry, matcher_context,
|
|
314
|
+
allow_keep_matching, depth, errors);
|
|
314
315
|
return std::make_unique<XdsMatcherList>(std::move(field_matcher_list),
|
|
315
316
|
std::move(on_no_match));
|
|
316
317
|
} else if (xds_type_matcher_v3_Matcher_has_matcher_tree(matcher)) {
|
|
@@ -329,7 +330,7 @@ std::unique_ptr<XdsMatcher> ParseXdsMatcher(
|
|
|
329
330
|
auto map = ParseMatchMap(
|
|
330
331
|
context,
|
|
331
332
|
xds_type_matcher_v3_Matcher_MatcherTree_exact_match_map(matcher_tree),
|
|
332
|
-
action_registry, matcher_context, errors);
|
|
333
|
+
action_registry, matcher_context, allow_keep_matching, depth, errors);
|
|
333
334
|
return std::make_unique<XdsMatcherExactMap>(
|
|
334
335
|
std::move(input), std::move(map), std::move(on_no_match));
|
|
335
336
|
} else if (xds_type_matcher_v3_Matcher_MatcherTree_has_prefix_match_map(
|
|
@@ -339,7 +340,7 @@ std::unique_ptr<XdsMatcher> ParseXdsMatcher(
|
|
|
339
340
|
context,
|
|
340
341
|
xds_type_matcher_v3_Matcher_MatcherTree_prefix_match_map(
|
|
341
342
|
matcher_tree),
|
|
342
|
-
action_registry, matcher_context, errors);
|
|
343
|
+
action_registry, matcher_context, allow_keep_matching, depth, errors);
|
|
343
344
|
return std::make_unique<XdsMatcherPrefixMap>(
|
|
344
345
|
std::move(input), std::move(map), std::move(on_no_match));
|
|
345
346
|
} else {
|
|
@@ -353,4 +354,23 @@ std::unique_ptr<XdsMatcher> ParseXdsMatcher(
|
|
|
353
354
|
return nullptr;
|
|
354
355
|
}
|
|
355
356
|
|
|
357
|
+
} // namespace
|
|
358
|
+
|
|
359
|
+
// Parse Matcher Proto
|
|
360
|
+
// This the top level function expected to be called for the matcher.proto
|
|
361
|
+
std::unique_ptr<XdsMatcher> ParseXdsMatcher(
|
|
362
|
+
const XdsResourceType::DecodeContext& context,
|
|
363
|
+
const xds_type_matcher_v3_Matcher* matcher,
|
|
364
|
+
const XdsMatcherActionRegistry& action_registry,
|
|
365
|
+
const UniqueTypeName& matcher_context, bool allow_keep_matching,
|
|
366
|
+
ValidationErrors* errors) {
|
|
367
|
+
if (matcher == nullptr) {
|
|
368
|
+
errors->AddError("field not set");
|
|
369
|
+
return nullptr;
|
|
370
|
+
}
|
|
371
|
+
return ParseXdsMatcherRecursive(context, matcher, action_registry,
|
|
372
|
+
matcher_context, allow_keep_matching,
|
|
373
|
+
/*depth=*/0, errors);
|
|
374
|
+
}
|
|
375
|
+
|
|
356
376
|
} // namespace grpc_core
|
|
@@ -32,7 +32,8 @@ std::unique_ptr<XdsMatcher> ParseXdsMatcher(
|
|
|
32
32
|
const XdsResourceType::DecodeContext& context,
|
|
33
33
|
const xds_type_matcher_v3_Matcher* matcher,
|
|
34
34
|
const XdsMatcherActionRegistry& action_registry,
|
|
35
|
-
const UniqueTypeName& matcher_context,
|
|
35
|
+
const UniqueTypeName& matcher_context, bool allow_keep_matching,
|
|
36
|
+
ValidationErrors* errors);
|
|
36
37
|
|
|
37
38
|
} // namespace grpc_core
|
|
38
39
|
|
|
@@ -31,6 +31,17 @@
|
|
|
31
31
|
|
|
32
32
|
namespace grpc_core {
|
|
33
33
|
|
|
34
|
+
//
|
|
35
|
+
// XdsRouteConfigResource::FilterConfigOverride
|
|
36
|
+
//
|
|
37
|
+
|
|
38
|
+
std::string XdsRouteConfigResource::FilterConfigOverride::ToString() const {
|
|
39
|
+
return absl::StrCat(
|
|
40
|
+
"{config_proto_type=", config_proto_type, ", config=", JsonDump(config),
|
|
41
|
+
", filter_config=",
|
|
42
|
+
filter_config == nullptr ? "null" : filter_config->ToString(), "}");
|
|
43
|
+
}
|
|
44
|
+
|
|
34
45
|
//
|
|
35
46
|
// XdsRouteConfigResource::RetryPolicy
|
|
36
47
|
//
|
|
@@ -229,7 +240,7 @@ std::string XdsRouteConfigResource::Route::ToString() const {
|
|
|
229
240
|
}
|
|
230
241
|
|
|
231
242
|
//
|
|
232
|
-
// XdsRouteConfigResource::
|
|
243
|
+
// XdsRouteConfigResource::VirtualHost
|
|
233
244
|
//
|
|
234
245
|
|
|
235
246
|
std::string XdsRouteConfigResource::VirtualHost::ToString() const {
|
|
@@ -38,8 +38,21 @@
|
|
|
38
38
|
namespace grpc_core {
|
|
39
39
|
|
|
40
40
|
struct XdsRouteConfigResource : public XdsResourceType::ResourceData {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
struct FilterConfigOverride {
|
|
42
|
+
absl::string_view config_proto_type;
|
|
43
|
+
Json config;
|
|
44
|
+
RefCountedPtr<const FilterConfig> filter_config;
|
|
45
|
+
|
|
46
|
+
bool operator==(const FilterConfigOverride& other) const {
|
|
47
|
+
if (config_proto_type != other.config_proto_type) return false;
|
|
48
|
+
if (config != other.config) return false;
|
|
49
|
+
if (filter_config == nullptr) return other.filter_config != nullptr;
|
|
50
|
+
if (other.filter_config == nullptr) return false;
|
|
51
|
+
return *filter_config == *other.filter_config;
|
|
52
|
+
}
|
|
53
|
+
std::string ToString() const;
|
|
54
|
+
};
|
|
55
|
+
using TypedPerFilterConfig = std::map<std::string, FilterConfigOverride>;
|
|
43
56
|
|
|
44
57
|
using ClusterSpecifierPluginMap =
|
|
45
58
|
std::map<std::string /*cluster_specifier_plugin_name*/,
|
|
@@ -398,16 +398,22 @@ XdsRouteConfigResource::TypedPerFilterConfig ParseTypedPerFilterConfig(
|
|
|
398
398
|
DownCast<const GrpcXdsBootstrap&>(context.client->bootstrap())
|
|
399
399
|
.http_filter_registry();
|
|
400
400
|
const XdsHttpFilterImpl* filter_impl =
|
|
401
|
-
http_filter_registry.
|
|
401
|
+
http_filter_registry.GetFilterForOverrideType(extension_to_use->type);
|
|
402
402
|
if (filter_impl == nullptr) {
|
|
403
403
|
if (!is_optional) errors->AddError("unsupported filter type");
|
|
404
404
|
continue;
|
|
405
405
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
406
|
+
auto& entry = typed_per_filter_config[std::string(key)];
|
|
407
|
+
entry.config_proto_type = filter_impl->OverrideConfigProtoName();
|
|
408
|
+
std::optional<Json> filter_config =
|
|
409
|
+
filter_impl->GenerateFilterConfigOverride(key, context,
|
|
410
|
+
*extension_to_use, errors);
|
|
409
411
|
if (filter_config.has_value()) {
|
|
410
|
-
|
|
412
|
+
entry.config = std::move(*filter_config);
|
|
413
|
+
}
|
|
414
|
+
if (IsXdsChannelFilterChainPerRouteEnabled()) {
|
|
415
|
+
entry.filter_config = filter_impl->ParseOverrideConfig(
|
|
416
|
+
key, context, *extension_to_use, errors);
|
|
411
417
|
}
|
|
412
418
|
}
|
|
413
419
|
return typed_per_filter_config;
|