grpc 1.78.0 → 1.80.0.pre1
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/grpc.rb +7 -9
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +1 -1
- data/src/ruby/spec/client_server_spec.rb +1 -1
- data/src/ruby/spec/generic/rpc_server_pool_spec.rb +1 -1
- data/src/ruby/spec/generic/rpc_server_spec.rb +3 -4
- data/src/ruby/spec/spec_helper.rb +1 -1
- metadata +64 -14
- data/src/core/ext/transport/chttp2/transport/security_frame.cc +0 -31
- data/src/core/handshaker/security/legacy_secure_endpoint.cc +0 -597
|
@@ -76,19 +76,18 @@ absl::string_view XdsHttpFaultFilter::ConfigProtoName() const {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
absl::string_view XdsHttpFaultFilter::OverrideConfigProtoName() const {
|
|
79
|
-
return "";
|
|
79
|
+
return "envoy.extensions.filters.http.fault.v3.HTTPFault";
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
void XdsHttpFaultFilter::PopulateSymtab(upb_DefPool* symtab) const {
|
|
83
83
|
envoy_extensions_filters_http_fault_v3_HTTPFault_getmsgdef(symtab);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
std::optional<
|
|
87
|
-
XdsHttpFaultFilter::GenerateFilterConfig(
|
|
86
|
+
std::optional<Json> XdsHttpFaultFilter::GenerateFilterConfig(
|
|
88
87
|
absl::string_view /*instance_name*/,
|
|
89
|
-
const XdsResourceType::DecodeContext& context,
|
|
90
|
-
ValidationErrors* errors) const {
|
|
91
|
-
absl::string_view* serialized_filter_config =
|
|
88
|
+
const XdsResourceType::DecodeContext& context,
|
|
89
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
90
|
+
const absl::string_view* serialized_filter_config =
|
|
92
91
|
std::get_if<absl::string_view>(&extension.value);
|
|
93
92
|
if (serialized_filter_config == nullptr) {
|
|
94
93
|
errors->AddError("could not parse fault injection filter config");
|
|
@@ -199,27 +198,26 @@ XdsHttpFaultFilter::GenerateFilterConfig(
|
|
|
199
198
|
fault_injection_policy_json["maxFaults"] =
|
|
200
199
|
Json::FromNumber(*max_fault_wrapper);
|
|
201
200
|
}
|
|
202
|
-
return
|
|
203
|
-
Json::FromObject(std::move(fault_injection_policy_json))};
|
|
201
|
+
return Json::FromObject(std::move(fault_injection_policy_json));
|
|
204
202
|
}
|
|
205
203
|
|
|
206
|
-
std::optional<
|
|
207
|
-
XdsHttpFaultFilter::GenerateFilterConfigOverride(
|
|
204
|
+
std::optional<Json> XdsHttpFaultFilter::GenerateFilterConfigOverride(
|
|
208
205
|
absl::string_view instance_name,
|
|
209
|
-
const XdsResourceType::DecodeContext& context,
|
|
210
|
-
ValidationErrors* errors) const {
|
|
206
|
+
const XdsResourceType::DecodeContext& context,
|
|
207
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
211
208
|
// HTTPFault filter has the same message type in HTTP connection manager's
|
|
212
209
|
// filter config and in overriding filter config field.
|
|
213
|
-
return GenerateFilterConfig(instance_name, context,
|
|
214
|
-
errors);
|
|
210
|
+
return GenerateFilterConfig(instance_name, context, extension, errors);
|
|
215
211
|
}
|
|
216
212
|
|
|
217
|
-
|
|
218
|
-
|
|
213
|
+
const grpc_channel_filter* XdsHttpFaultFilter::channel_filter() const {
|
|
214
|
+
return &FaultInjectionFilter::kFilterVtable;
|
|
219
215
|
}
|
|
220
216
|
|
|
221
|
-
|
|
222
|
-
|
|
217
|
+
void XdsHttpFaultFilter::AddFilter(
|
|
218
|
+
FilterChainBuilder& builder,
|
|
219
|
+
RefCountedPtr<const FilterConfig> config) const {
|
|
220
|
+
builder.AddFilter<FaultInjectionFilter>(std::move(config));
|
|
223
221
|
}
|
|
224
222
|
|
|
225
223
|
ChannelArgs XdsHttpFaultFilter::ModifyChannelArgs(
|
|
@@ -229,19 +227,125 @@ ChannelArgs XdsHttpFaultFilter::ModifyChannelArgs(
|
|
|
229
227
|
|
|
230
228
|
absl::StatusOr<XdsHttpFilterImpl::ServiceConfigJsonEntry>
|
|
231
229
|
XdsHttpFaultFilter::GenerateMethodConfig(
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
: hcm_filter_config.config;
|
|
230
|
+
const Json& hcm_filter_config, const Json* filter_config_override) const {
|
|
231
|
+
const Json& policy_json = filter_config_override != nullptr
|
|
232
|
+
? *filter_config_override
|
|
233
|
+
: hcm_filter_config;
|
|
237
234
|
// The policy JSON may be empty, that's allowed.
|
|
238
235
|
return ServiceConfigJsonEntry{"faultInjectionPolicy", JsonDump(policy_json)};
|
|
239
236
|
}
|
|
240
237
|
|
|
241
238
|
absl::StatusOr<XdsHttpFilterImpl::ServiceConfigJsonEntry>
|
|
242
239
|
XdsHttpFaultFilter::GenerateServiceConfig(
|
|
243
|
-
const
|
|
240
|
+
const Json& /*hcm_filter_config*/) const {
|
|
244
241
|
return ServiceConfigJsonEntry{"", ""};
|
|
245
242
|
}
|
|
246
243
|
|
|
244
|
+
RefCountedPtr<const FilterConfig> XdsHttpFaultFilter::ParseTopLevelConfig(
|
|
245
|
+
absl::string_view /*instance_name*/,
|
|
246
|
+
const XdsResourceType::DecodeContext& context,
|
|
247
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
248
|
+
const absl::string_view* serialized_filter_config =
|
|
249
|
+
std::get_if<absl::string_view>(&extension.value);
|
|
250
|
+
if (serialized_filter_config == nullptr) {
|
|
251
|
+
errors->AddError("could not parse fault injection filter config");
|
|
252
|
+
return nullptr;
|
|
253
|
+
}
|
|
254
|
+
auto* http_fault = envoy_extensions_filters_http_fault_v3_HTTPFault_parse(
|
|
255
|
+
serialized_filter_config->data(), serialized_filter_config->size(),
|
|
256
|
+
context.arena);
|
|
257
|
+
if (http_fault == nullptr) {
|
|
258
|
+
errors->AddError("could not parse fault injection filter config");
|
|
259
|
+
return nullptr;
|
|
260
|
+
}
|
|
261
|
+
auto config = MakeRefCounted<FaultInjectionFilter::Config>();
|
|
262
|
+
// Section 1: Parse the abort injection config
|
|
263
|
+
const auto* fault_abort =
|
|
264
|
+
envoy_extensions_filters_http_fault_v3_HTTPFault_abort(http_fault);
|
|
265
|
+
if (fault_abort != nullptr) {
|
|
266
|
+
ValidationErrors::ScopedField field(errors, ".abort");
|
|
267
|
+
// Try if gRPC status code is set first. Otherwise, use HTTP status.
|
|
268
|
+
if (int abort_grpc_status_code_raw =
|
|
269
|
+
envoy_extensions_filters_http_fault_v3_FaultAbort_grpc_status(
|
|
270
|
+
fault_abort);
|
|
271
|
+
abort_grpc_status_code_raw != 0) {
|
|
272
|
+
if (!grpc_status_code_from_int(abort_grpc_status_code_raw,
|
|
273
|
+
&config->abort_code)) {
|
|
274
|
+
ValidationErrors::ScopedField field(errors, ".grpc_status");
|
|
275
|
+
errors->AddError(absl::StrCat("invalid gRPC status code: ",
|
|
276
|
+
abort_grpc_status_code_raw));
|
|
277
|
+
}
|
|
278
|
+
} else if (
|
|
279
|
+
int abort_http_status_code =
|
|
280
|
+
envoy_extensions_filters_http_fault_v3_FaultAbort_http_status(
|
|
281
|
+
fault_abort);
|
|
282
|
+
abort_http_status_code != 0 && abort_http_status_code != 200) {
|
|
283
|
+
config->abort_code =
|
|
284
|
+
grpc_http2_status_to_grpc_status(abort_http_status_code);
|
|
285
|
+
}
|
|
286
|
+
// Set the headers if we enabled header abort injection control
|
|
287
|
+
if (envoy_extensions_filters_http_fault_v3_FaultAbort_has_header_abort(
|
|
288
|
+
fault_abort)) {
|
|
289
|
+
config->abort_code_header = "x-envoy-fault-abort-grpc-request";
|
|
290
|
+
config->abort_percentage_header = "x-envoy-fault-abort-percentage";
|
|
291
|
+
}
|
|
292
|
+
// Set the fraction percent
|
|
293
|
+
auto* percent =
|
|
294
|
+
envoy_extensions_filters_http_fault_v3_FaultAbort_percentage(
|
|
295
|
+
fault_abort);
|
|
296
|
+
if (percent != nullptr) {
|
|
297
|
+
config->abort_percentage_numerator =
|
|
298
|
+
envoy_type_v3_FractionalPercent_numerator(percent);
|
|
299
|
+
config->abort_percentage_denominator = GetDenominator(percent);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
// Section 2: Parse the delay injection config
|
|
303
|
+
const auto* fault_delay =
|
|
304
|
+
envoy_extensions_filters_http_fault_v3_HTTPFault_delay(http_fault);
|
|
305
|
+
if (fault_delay != nullptr) {
|
|
306
|
+
ValidationErrors::ScopedField field(errors, ".delay");
|
|
307
|
+
// Parse the delay duration
|
|
308
|
+
const auto* delay_duration =
|
|
309
|
+
envoy_extensions_filters_common_fault_v3_FaultDelay_fixed_delay(
|
|
310
|
+
fault_delay);
|
|
311
|
+
if (delay_duration != nullptr) {
|
|
312
|
+
ValidationErrors::ScopedField field(errors, ".fixed_delay");
|
|
313
|
+
config->delay = ParseDuration(delay_duration, errors);
|
|
314
|
+
}
|
|
315
|
+
// Set the headers if we enabled header delay injection control
|
|
316
|
+
if (envoy_extensions_filters_common_fault_v3_FaultDelay_has_header_delay(
|
|
317
|
+
fault_delay)) {
|
|
318
|
+
config->delay_header = "x-envoy-fault-delay-request";
|
|
319
|
+
config->delay_percentage_header =
|
|
320
|
+
"x-envoy-fault-delay-request-percentage";
|
|
321
|
+
}
|
|
322
|
+
// Set the fraction percent
|
|
323
|
+
auto* percent =
|
|
324
|
+
envoy_extensions_filters_common_fault_v3_FaultDelay_percentage(
|
|
325
|
+
fault_delay);
|
|
326
|
+
if (percent != nullptr) {
|
|
327
|
+
config->delay_percentage_numerator =
|
|
328
|
+
envoy_type_v3_FractionalPercent_numerator(percent);
|
|
329
|
+
config->delay_percentage_denominator = GetDenominator(percent);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
// Section 3: Parse the maximum active faults
|
|
333
|
+
auto max_fault_wrapper = ParseUInt32Value(
|
|
334
|
+
envoy_extensions_filters_http_fault_v3_HTTPFault_max_active_faults(
|
|
335
|
+
http_fault));
|
|
336
|
+
if (max_fault_wrapper.has_value()) {
|
|
337
|
+
config->max_faults = *max_fault_wrapper;
|
|
338
|
+
}
|
|
339
|
+
return config;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
RefCountedPtr<const FilterConfig> XdsHttpFaultFilter::ParseOverrideConfig(
|
|
343
|
+
absl::string_view instance_name,
|
|
344
|
+
const XdsResourceType::DecodeContext& context,
|
|
345
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
346
|
+
// HTTPFault filter has the same message type in HTTP connection manager's
|
|
347
|
+
// filter config and in overriding filter config field.
|
|
348
|
+
return ParseTopLevelConfig(instance_name, context, extension, errors);
|
|
349
|
+
}
|
|
350
|
+
|
|
247
351
|
} // namespace grpc_core
|
|
@@ -38,22 +38,31 @@ class XdsHttpFaultFilter final : public XdsHttpFilterImpl {
|
|
|
38
38
|
absl::string_view ConfigProtoName() const override;
|
|
39
39
|
absl::string_view OverrideConfigProtoName() const override;
|
|
40
40
|
void PopulateSymtab(upb_DefPool* symtab) const override;
|
|
41
|
-
std::optional<
|
|
41
|
+
std::optional<Json> GenerateFilterConfig(
|
|
42
42
|
absl::string_view /*instance_name*/,
|
|
43
|
-
const XdsResourceType::DecodeContext& context,
|
|
44
|
-
ValidationErrors* errors) const override;
|
|
45
|
-
std::optional<
|
|
43
|
+
const XdsResourceType::DecodeContext& context,
|
|
44
|
+
const XdsExtension& extension, ValidationErrors* errors) const override;
|
|
45
|
+
std::optional<Json> GenerateFilterConfigOverride(
|
|
46
46
|
absl::string_view /*instance_name*/,
|
|
47
|
-
const XdsResourceType::DecodeContext& context,
|
|
48
|
-
ValidationErrors* errors) const override;
|
|
49
|
-
void AddFilter(InterceptionChainBuilder& builder) const override;
|
|
47
|
+
const XdsResourceType::DecodeContext& context,
|
|
48
|
+
const XdsExtension& extension, ValidationErrors* errors) const override;
|
|
50
49
|
const grpc_channel_filter* channel_filter() const override;
|
|
51
50
|
ChannelArgs ModifyChannelArgs(const ChannelArgs& args) const override;
|
|
52
51
|
absl::StatusOr<ServiceConfigJsonEntry> GenerateMethodConfig(
|
|
53
|
-
const
|
|
54
|
-
const
|
|
52
|
+
const Json& hcm_filter_config,
|
|
53
|
+
const Json* filter_config_override) const override;
|
|
55
54
|
absl::StatusOr<ServiceConfigJsonEntry> GenerateServiceConfig(
|
|
56
|
-
const
|
|
55
|
+
const Json& hcm_filter_config) const override;
|
|
56
|
+
void AddFilter(FilterChainBuilder& builder,
|
|
57
|
+
RefCountedPtr<const FilterConfig> config) const override;
|
|
58
|
+
RefCountedPtr<const FilterConfig> ParseTopLevelConfig(
|
|
59
|
+
absl::string_view instance_name,
|
|
60
|
+
const XdsResourceType::DecodeContext& context,
|
|
61
|
+
const XdsExtension& extension, ValidationErrors* errors) const override;
|
|
62
|
+
RefCountedPtr<const FilterConfig> ParseOverrideConfig(
|
|
63
|
+
absl::string_view instance_name,
|
|
64
|
+
const XdsResourceType::DecodeContext& context,
|
|
65
|
+
const XdsExtension& extension, ValidationErrors* errors) const override;
|
|
57
66
|
bool IsSupportedOnClients() const override { return true; }
|
|
58
67
|
bool IsSupportedOnServers() const override { return false; }
|
|
59
68
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 gRPC authors.
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
//
|
|
16
|
+
|
|
17
|
+
#include "src/core/xds/grpc/xds_http_filter.h"
|
|
18
|
+
|
|
19
|
+
namespace grpc_core {
|
|
20
|
+
|
|
21
|
+
RefCountedPtr<const FilterConfig> XdsHttpFilterImpl::MergeConfigs(
|
|
22
|
+
RefCountedPtr<const FilterConfig> top_level_config,
|
|
23
|
+
RefCountedPtr<const FilterConfig> virtual_host_override_config,
|
|
24
|
+
RefCountedPtr<const FilterConfig> route_override_config,
|
|
25
|
+
RefCountedPtr<const FilterConfig> cluster_weight_override_config) const {
|
|
26
|
+
if (cluster_weight_override_config != nullptr) {
|
|
27
|
+
return cluster_weight_override_config;
|
|
28
|
+
}
|
|
29
|
+
if (route_override_config != nullptr) {
|
|
30
|
+
return route_override_config;
|
|
31
|
+
}
|
|
32
|
+
if (virtual_host_override_config != nullptr) {
|
|
33
|
+
return virtual_host_override_config;
|
|
34
|
+
}
|
|
35
|
+
return top_level_config;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
} // namespace grpc_core
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
#include <optional>
|
|
21
21
|
#include <string>
|
|
22
22
|
|
|
23
|
-
#include "src/core/call/interception_chain.h"
|
|
24
23
|
#include "src/core/filter/blackboard.h"
|
|
24
|
+
#include "src/core/filter/filter_chain.h"
|
|
25
25
|
#include "src/core/lib/channel/channel_args.h"
|
|
26
26
|
#include "src/core/lib/channel/channel_fwd.h"
|
|
27
27
|
#include "src/core/util/json/json.h"
|
|
@@ -38,19 +38,65 @@ namespace grpc_core {
|
|
|
38
38
|
|
|
39
39
|
class XdsHttpFilterImpl {
|
|
40
40
|
public:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
virtual ~XdsHttpFilterImpl() = default;
|
|
42
|
+
|
|
43
|
+
// Returns the top-level filter config proto message name.
|
|
44
|
+
virtual absl::string_view ConfigProtoName() const = 0;
|
|
45
|
+
|
|
46
|
+
// Returns the override filter config proto message name.
|
|
47
|
+
// If empty, no override type is supported.
|
|
48
|
+
virtual absl::string_view OverrideConfigProtoName() const = 0;
|
|
49
|
+
|
|
50
|
+
// Loads the proto message into the upb symtab.
|
|
51
|
+
virtual void PopulateSymtab(upb_DefPool* symtab) const = 0;
|
|
52
|
+
|
|
53
|
+
// Adds the filter to the builder.
|
|
54
|
+
virtual void AddFilter(FilterChainBuilder& builder,
|
|
55
|
+
RefCountedPtr<const FilterConfig> config) const = 0;
|
|
56
|
+
|
|
57
|
+
// Parses the top-level filter config.
|
|
58
|
+
virtual RefCountedPtr<const FilterConfig> ParseTopLevelConfig(
|
|
59
|
+
absl::string_view instance_name,
|
|
60
|
+
const XdsResourceType::DecodeContext& context,
|
|
61
|
+
const XdsExtension& extension, ValidationErrors* errors) const = 0;
|
|
62
|
+
|
|
63
|
+
// Parses an override config.
|
|
64
|
+
virtual RefCountedPtr<const FilterConfig> ParseOverrideConfig(
|
|
65
|
+
absl::string_view instance_name,
|
|
66
|
+
const XdsResourceType::DecodeContext& context,
|
|
67
|
+
const XdsExtension& extension, ValidationErrors* errors) const = 0;
|
|
68
|
+
|
|
69
|
+
// Returns a new filter config that takes into account any necessary
|
|
70
|
+
// overrides. Base class returns the most specific filter config;
|
|
71
|
+
// subclasses can override if needed.
|
|
72
|
+
virtual RefCountedPtr<const FilterConfig> MergeConfigs(
|
|
73
|
+
RefCountedPtr<const FilterConfig> top_level_config,
|
|
74
|
+
RefCountedPtr<const FilterConfig> virtual_host_override_config,
|
|
75
|
+
RefCountedPtr<const FilterConfig> route_override_config,
|
|
76
|
+
RefCountedPtr<const FilterConfig> cluster_weight_override_config) const;
|
|
77
|
+
|
|
78
|
+
// Adds state to new_blackboard if needed for the specified filter
|
|
79
|
+
// config. Copies existing state from old_blackboard as appropriate.
|
|
80
|
+
virtual void UpdateBlackboard(const FilterConfig& /*config*/,
|
|
81
|
+
const Blackboard* /*old_blackboard*/,
|
|
82
|
+
Blackboard* /*new_blackboard*/) const {}
|
|
83
|
+
|
|
84
|
+
// Returns true if the filter is supported on clients; false otherwise
|
|
85
|
+
virtual bool IsSupportedOnClients() const = 0;
|
|
86
|
+
|
|
87
|
+
// Returns true if the filter is supported on servers; false otherwise
|
|
88
|
+
virtual bool IsSupportedOnServers() const = 0;
|
|
89
|
+
|
|
90
|
+
// Returns true if the filter must be the last filter in the chain.
|
|
91
|
+
virtual bool IsTerminalFilter() const { return false; }
|
|
92
|
+
|
|
93
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
94
|
+
//
|
|
95
|
+
// ALL INTERFACES BELOW ARE DEPRECATED
|
|
96
|
+
//
|
|
97
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
98
|
+
// TODO(roth): Remove these once the server side is migrated to the new
|
|
99
|
+
// approach for passing xDS HTTP filter configs.
|
|
54
100
|
|
|
55
101
|
// Service config data for the filter, returned by GenerateServiceConfig().
|
|
56
102
|
struct ServiceConfigJsonEntry {
|
|
@@ -66,34 +112,20 @@ class XdsHttpFilterImpl {
|
|
|
66
112
|
std::string element;
|
|
67
113
|
};
|
|
68
114
|
|
|
69
|
-
virtual ~XdsHttpFilterImpl() = default;
|
|
70
|
-
|
|
71
|
-
// Returns the top-level filter config proto message name.
|
|
72
|
-
virtual absl::string_view ConfigProtoName() const = 0;
|
|
73
|
-
|
|
74
|
-
// Returns the override filter config proto message name.
|
|
75
|
-
// If empty, no override type is supported.
|
|
76
|
-
virtual absl::string_view OverrideConfigProtoName() const = 0;
|
|
77
|
-
|
|
78
|
-
// Loads the proto message into the upb symtab.
|
|
79
|
-
virtual void PopulateSymtab(upb_DefPool* symtab) const = 0;
|
|
80
|
-
|
|
81
115
|
// Generates a Config from the xDS filter config proto.
|
|
82
116
|
// Used for the top-level config in the HCM HTTP filter list.
|
|
83
|
-
virtual std::optional<
|
|
117
|
+
virtual std::optional<Json> GenerateFilterConfig(
|
|
84
118
|
absl::string_view instance_name,
|
|
85
|
-
const XdsResourceType::DecodeContext& context,
|
|
86
|
-
ValidationErrors* errors) const = 0;
|
|
119
|
+
const XdsResourceType::DecodeContext& context,
|
|
120
|
+
const XdsExtension& extension, ValidationErrors* errors) const = 0;
|
|
87
121
|
|
|
88
122
|
// Generates a Config from the xDS filter config proto.
|
|
89
123
|
// Used for the typed_per_filter_config override in VirtualHost and Route.
|
|
90
|
-
virtual std::optional<
|
|
124
|
+
virtual std::optional<Json> GenerateFilterConfigOverride(
|
|
91
125
|
absl::string_view instance_name,
|
|
92
|
-
const XdsResourceType::DecodeContext& context,
|
|
93
|
-
ValidationErrors* errors) const = 0;
|
|
126
|
+
const XdsResourceType::DecodeContext& context,
|
|
127
|
+
const XdsExtension& extension, ValidationErrors* errors) const = 0;
|
|
94
128
|
|
|
95
|
-
// C-core channel filter implementation.
|
|
96
|
-
virtual void AddFilter(InterceptionChainBuilder& builder) const = 0;
|
|
97
129
|
// TODO(roth): Remove this once the legacy filter stack goes away.
|
|
98
130
|
virtual const grpc_channel_filter* channel_filter() const = 0;
|
|
99
131
|
|
|
@@ -110,30 +142,21 @@ class XdsHttpFilterImpl {
|
|
|
110
142
|
// Route, or VirtualHost entries that it is found in, or null if
|
|
111
143
|
// there is no override in any of those locations.
|
|
112
144
|
virtual absl::StatusOr<ServiceConfigJsonEntry> GenerateMethodConfig(
|
|
113
|
-
const
|
|
114
|
-
const
|
|
145
|
+
const Json& hcm_filter_config,
|
|
146
|
+
const Json* filter_config_override) const = 0;
|
|
115
147
|
|
|
116
148
|
// Function to convert the Configs into a JSON string to be added to the
|
|
117
149
|
// top level of the service config.
|
|
118
150
|
// The hcm_filter_config comes from the HttpConnectionManager config.
|
|
119
151
|
// Currently used only on the client side.
|
|
120
152
|
virtual absl::StatusOr<ServiceConfigJsonEntry> GenerateServiceConfig(
|
|
121
|
-
const
|
|
153
|
+
const Json& hcm_filter_config) const = 0;
|
|
122
154
|
|
|
123
155
|
// Adds state to new_blackboard if needed for the specified filter
|
|
124
156
|
// config. Copies existing state from old_blackboard as appropriate.
|
|
125
|
-
virtual void UpdateBlackboard(const
|
|
157
|
+
virtual void UpdateBlackboard(const Json& /*hcm_filter_config*/,
|
|
126
158
|
const Blackboard* /*old_blackboard*/,
|
|
127
159
|
Blackboard* /*new_blackboard*/) const {}
|
|
128
|
-
|
|
129
|
-
// Returns true if the filter is supported on clients; false otherwise
|
|
130
|
-
virtual bool IsSupportedOnClients() const = 0;
|
|
131
|
-
|
|
132
|
-
// Returns true if the filter is supported on servers; false otherwise
|
|
133
|
-
virtual bool IsSupportedOnServers() const = 0;
|
|
134
|
-
|
|
135
|
-
// Returns true if the filter must be the last filter in the chain.
|
|
136
|
-
virtual bool IsTerminalFilter() const { return false; }
|
|
137
160
|
};
|
|
138
161
|
|
|
139
162
|
} // namespace grpc_core
|
|
@@ -51,12 +51,11 @@ void XdsHttpRouterFilter::PopulateSymtab(upb_DefPool* symtab) const {
|
|
|
51
51
|
envoy_extensions_filters_http_router_v3_Router_getmsgdef(symtab);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
std::optional<
|
|
55
|
-
XdsHttpRouterFilter::GenerateFilterConfig(
|
|
54
|
+
std::optional<Json> XdsHttpRouterFilter::GenerateFilterConfig(
|
|
56
55
|
absl::string_view /*instance_name*/,
|
|
57
|
-
const XdsResourceType::DecodeContext& context,
|
|
58
|
-
ValidationErrors* errors) const {
|
|
59
|
-
absl::string_view* serialized_filter_config =
|
|
56
|
+
const XdsResourceType::DecodeContext& context,
|
|
57
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
58
|
+
const absl::string_view* serialized_filter_config =
|
|
60
59
|
std::get_if<absl::string_view>(&extension.value);
|
|
61
60
|
if (serialized_filter_config == nullptr) {
|
|
62
61
|
errors->AddError("could not parse router filter config");
|
|
@@ -68,18 +67,44 @@ XdsHttpRouterFilter::GenerateFilterConfig(
|
|
|
68
67
|
errors->AddError("could not parse router filter config");
|
|
69
68
|
return std::nullopt;
|
|
70
69
|
}
|
|
71
|
-
return
|
|
70
|
+
return Json();
|
|
72
71
|
}
|
|
73
72
|
|
|
74
|
-
std::optional<
|
|
75
|
-
XdsHttpRouterFilter::GenerateFilterConfigOverride(
|
|
73
|
+
std::optional<Json> XdsHttpRouterFilter::GenerateFilterConfigOverride(
|
|
76
74
|
absl::string_view /*instance_name*/,
|
|
77
75
|
const XdsResourceType::DecodeContext& /*context*/,
|
|
78
|
-
XdsExtension /*extension*/, ValidationErrors* errors) const {
|
|
76
|
+
const XdsExtension& /*extension*/, ValidationErrors* errors) const {
|
|
79
77
|
errors->AddError("router filter does not support config override");
|
|
80
78
|
return std::nullopt;
|
|
81
79
|
}
|
|
82
80
|
|
|
81
|
+
RefCountedPtr<const FilterConfig> XdsHttpRouterFilter::ParseTopLevelConfig(
|
|
82
|
+
absl::string_view /*instance_name*/,
|
|
83
|
+
const XdsResourceType::DecodeContext& context,
|
|
84
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
85
|
+
const absl::string_view* serialized_filter_config =
|
|
86
|
+
std::get_if<absl::string_view>(&extension.value);
|
|
87
|
+
if (serialized_filter_config == nullptr) {
|
|
88
|
+
errors->AddError("could not parse router filter config");
|
|
89
|
+
return nullptr;
|
|
90
|
+
}
|
|
91
|
+
if (envoy_extensions_filters_http_router_v3_Router_parse(
|
|
92
|
+
serialized_filter_config->data(), serialized_filter_config->size(),
|
|
93
|
+
context.arena) == nullptr) {
|
|
94
|
+
errors->AddError("could not parse router filter config");
|
|
95
|
+
return nullptr;
|
|
96
|
+
}
|
|
97
|
+
return nullptr;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
RefCountedPtr<const FilterConfig> XdsHttpRouterFilter::ParseOverrideConfig(
|
|
101
|
+
absl::string_view /*instance_name*/,
|
|
102
|
+
const XdsResourceType::DecodeContext& /*context*/,
|
|
103
|
+
const XdsExtension& /*extension*/, ValidationErrors* errors) const {
|
|
104
|
+
errors->AddError("router filter does not support config override");
|
|
105
|
+
return nullptr;
|
|
106
|
+
}
|
|
107
|
+
|
|
83
108
|
//
|
|
84
109
|
// XdsHttpFilterRegistry
|
|
85
110
|
//
|
|
@@ -97,18 +122,27 @@ XdsHttpFilterRegistry::XdsHttpFilterRegistry(bool register_builtins) {
|
|
|
97
122
|
void XdsHttpFilterRegistry::RegisterFilter(
|
|
98
123
|
std::unique_ptr<XdsHttpFilterImpl> filter) {
|
|
99
124
|
GRPC_CHECK(
|
|
100
|
-
|
|
125
|
+
top_level_config_map_.emplace(filter->ConfigProtoName(), filter.get())
|
|
126
|
+
.second);
|
|
101
127
|
auto override_proto_name = filter->OverrideConfigProtoName();
|
|
102
128
|
if (!override_proto_name.empty()) {
|
|
103
|
-
GRPC_CHECK(
|
|
129
|
+
GRPC_CHECK(
|
|
130
|
+
override_config_map_.emplace(override_proto_name, filter.get()).second);
|
|
104
131
|
}
|
|
105
132
|
owning_list_.push_back(std::move(filter));
|
|
106
133
|
}
|
|
107
134
|
|
|
108
|
-
const XdsHttpFilterImpl* XdsHttpFilterRegistry::
|
|
135
|
+
const XdsHttpFilterImpl* XdsHttpFilterRegistry::GetFilterForTopLevelType(
|
|
136
|
+
absl::string_view proto_type_name) const {
|
|
137
|
+
auto it = top_level_config_map_.find(proto_type_name);
|
|
138
|
+
if (it == top_level_config_map_.end()) return nullptr;
|
|
139
|
+
return it->second;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const XdsHttpFilterImpl* XdsHttpFilterRegistry::GetFilterForOverrideType(
|
|
109
143
|
absl::string_view proto_type_name) const {
|
|
110
|
-
auto it =
|
|
111
|
-
if (it ==
|
|
144
|
+
auto it = override_config_map_.find(proto_type_name);
|
|
145
|
+
if (it == override_config_map_.end()) return nullptr;
|
|
112
146
|
return it->second;
|
|
113
147
|
}
|
|
114
148
|
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
#include <utility>
|
|
25
25
|
#include <vector>
|
|
26
26
|
|
|
27
|
-
#include "src/core/call/interception_chain.h"
|
|
28
27
|
#include "src/core/lib/channel/channel_args.h"
|
|
29
28
|
#include "src/core/lib/channel/channel_fwd.h"
|
|
30
29
|
#include "src/core/util/validation_errors.h"
|
|
@@ -43,27 +42,36 @@ class XdsHttpRouterFilter final : public XdsHttpFilterImpl {
|
|
|
43
42
|
absl::string_view ConfigProtoName() const override;
|
|
44
43
|
absl::string_view OverrideConfigProtoName() const override;
|
|
45
44
|
void PopulateSymtab(upb_DefPool* symtab) const override;
|
|
46
|
-
std::optional<
|
|
45
|
+
std::optional<Json> GenerateFilterConfig(
|
|
47
46
|
absl::string_view /*instance_name*/,
|
|
48
|
-
const XdsResourceType::DecodeContext& context,
|
|
49
|
-
ValidationErrors* errors) const override;
|
|
50
|
-
std::optional<
|
|
47
|
+
const XdsResourceType::DecodeContext& context,
|
|
48
|
+
const XdsExtension& extension, ValidationErrors* errors) const override;
|
|
49
|
+
std::optional<Json> GenerateFilterConfigOverride(
|
|
51
50
|
absl::string_view /*instance_name*/,
|
|
52
|
-
const XdsResourceType::DecodeContext& context,
|
|
53
|
-
ValidationErrors* errors) const override;
|
|
54
|
-
void AddFilter(InterceptionChainBuilder& /*builder*/) const override {}
|
|
51
|
+
const XdsResourceType::DecodeContext& context,
|
|
52
|
+
const XdsExtension& extension, ValidationErrors* errors) const override;
|
|
55
53
|
const grpc_channel_filter* channel_filter() const override { return nullptr; }
|
|
56
54
|
absl::StatusOr<ServiceConfigJsonEntry> GenerateMethodConfig(
|
|
57
|
-
const
|
|
58
|
-
const
|
|
55
|
+
const Json& /*hcm_filter_config*/,
|
|
56
|
+
const Json* /*filter_config_override*/) const override {
|
|
59
57
|
// This will never be called, since channel_filter() returns null.
|
|
60
58
|
return absl::UnimplementedError("router filter should never be called");
|
|
61
59
|
}
|
|
62
60
|
absl::StatusOr<ServiceConfigJsonEntry> GenerateServiceConfig(
|
|
63
|
-
const
|
|
61
|
+
const Json& /*hcm_filter_config*/) const override {
|
|
64
62
|
// This will never be called, since channel_filter() returns null.
|
|
65
63
|
return absl::UnimplementedError("router filter should never be called");
|
|
66
64
|
}
|
|
65
|
+
void AddFilter(FilterChainBuilder& /*builder*/,
|
|
66
|
+
RefCountedPtr<const FilterConfig> /*config*/) const override {}
|
|
67
|
+
RefCountedPtr<const FilterConfig> ParseTopLevelConfig(
|
|
68
|
+
absl::string_view instance_name,
|
|
69
|
+
const XdsResourceType::DecodeContext& context,
|
|
70
|
+
const XdsExtension& extension, ValidationErrors* errors) const override;
|
|
71
|
+
RefCountedPtr<const FilterConfig> ParseOverrideConfig(
|
|
72
|
+
absl::string_view instance_name,
|
|
73
|
+
const XdsResourceType::DecodeContext& context,
|
|
74
|
+
const XdsExtension& extension, ValidationErrors* errors) const override;
|
|
67
75
|
bool IsSupportedOnClients() const override { return true; }
|
|
68
76
|
bool IsSupportedOnServers() const override { return true; }
|
|
69
77
|
bool IsTerminalFilter() const override { return true; }
|
|
@@ -80,23 +88,29 @@ class XdsHttpFilterRegistry final {
|
|
|
80
88
|
// Movable.
|
|
81
89
|
XdsHttpFilterRegistry(XdsHttpFilterRegistry&& other) noexcept
|
|
82
90
|
: owning_list_(std::move(other.owning_list_)),
|
|
83
|
-
|
|
91
|
+
top_level_config_map_(std::move(other.top_level_config_map_)),
|
|
92
|
+
override_config_map_(std::move(other.override_config_map_)) {}
|
|
84
93
|
XdsHttpFilterRegistry& operator=(XdsHttpFilterRegistry&& other) noexcept {
|
|
85
94
|
owning_list_ = std::move(other.owning_list_);
|
|
86
|
-
|
|
95
|
+
top_level_config_map_ = std::move(other.top_level_config_map_);
|
|
96
|
+
override_config_map_ = std::move(other.override_config_map_);
|
|
87
97
|
return *this;
|
|
88
98
|
}
|
|
89
99
|
|
|
90
100
|
void RegisterFilter(std::unique_ptr<XdsHttpFilterImpl> filter);
|
|
91
101
|
|
|
92
|
-
const XdsHttpFilterImpl*
|
|
102
|
+
const XdsHttpFilterImpl* GetFilterForTopLevelType(
|
|
103
|
+
absl::string_view proto_type_name) const;
|
|
104
|
+
|
|
105
|
+
const XdsHttpFilterImpl* GetFilterForOverrideType(
|
|
93
106
|
absl::string_view proto_type_name) const;
|
|
94
107
|
|
|
95
108
|
void PopulateSymtab(upb_DefPool* symtab) const;
|
|
96
109
|
|
|
97
110
|
private:
|
|
98
111
|
std::vector<std::unique_ptr<XdsHttpFilterImpl>> owning_list_;
|
|
99
|
-
std::map<absl::string_view, XdsHttpFilterImpl*>
|
|
112
|
+
std::map<absl::string_view, XdsHttpFilterImpl*> top_level_config_map_;
|
|
113
|
+
std::map<absl::string_view, XdsHttpFilterImpl*> override_config_map_;
|
|
100
114
|
};
|
|
101
115
|
|
|
102
116
|
} // namespace grpc_core
|