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
|
@@ -79,12 +79,11 @@ Json::Object ValidateFilterConfig(
|
|
|
79
79
|
|
|
80
80
|
} // namespace
|
|
81
81
|
|
|
82
|
-
std::optional<
|
|
83
|
-
XdsHttpGcpAuthnFilter::GenerateFilterConfig(
|
|
82
|
+
std::optional<Json> XdsHttpGcpAuthnFilter::GenerateFilterConfig(
|
|
84
83
|
absl::string_view instance_name,
|
|
85
|
-
const XdsResourceType::DecodeContext& context,
|
|
86
|
-
ValidationErrors* errors) const {
|
|
87
|
-
absl::string_view* serialized_filter_config =
|
|
84
|
+
const XdsResourceType::DecodeContext& context,
|
|
85
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
86
|
+
const absl::string_view* serialized_filter_config =
|
|
88
87
|
std::get_if<absl::string_view>(&extension.value);
|
|
89
88
|
if (serialized_filter_config == nullptr) {
|
|
90
89
|
errors->AddError("could not parse GCP auth filter config");
|
|
@@ -98,25 +97,26 @@ XdsHttpGcpAuthnFilter::GenerateFilterConfig(
|
|
|
98
97
|
errors->AddError("could not parse GCP auth filter config");
|
|
99
98
|
return std::nullopt;
|
|
100
99
|
}
|
|
101
|
-
return
|
|
102
|
-
|
|
100
|
+
return Json::FromObject(
|
|
101
|
+
ValidateFilterConfig(instance_name, gcp_auth, errors));
|
|
103
102
|
}
|
|
104
103
|
|
|
105
|
-
std::optional<
|
|
106
|
-
XdsHttpGcpAuthnFilter::GenerateFilterConfigOverride(
|
|
104
|
+
std::optional<Json> XdsHttpGcpAuthnFilter::GenerateFilterConfigOverride(
|
|
107
105
|
absl::string_view /*instance_name*/,
|
|
108
106
|
const XdsResourceType::DecodeContext& /*context*/,
|
|
109
|
-
XdsExtension /*extension*/, ValidationErrors* errors) const {
|
|
107
|
+
const XdsExtension& /*extension*/, ValidationErrors* errors) const {
|
|
110
108
|
errors->AddError("GCP auth filter does not support config override");
|
|
111
109
|
return std::nullopt;
|
|
112
110
|
}
|
|
113
111
|
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
const grpc_channel_filter* XdsHttpGcpAuthnFilter::channel_filter() const {
|
|
113
|
+
return &GcpAuthenticationFilter::kFilterVtable;
|
|
116
114
|
}
|
|
117
115
|
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
void XdsHttpGcpAuthnFilter::AddFilter(
|
|
117
|
+
FilterChainBuilder& builder,
|
|
118
|
+
RefCountedPtr<const FilterConfig> config) const {
|
|
119
|
+
builder.AddFilter<GcpAuthenticationFilter>(std::move(config));
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
ChannelArgs XdsHttpGcpAuthnFilter::ModifyChannelArgs(
|
|
@@ -126,24 +126,24 @@ ChannelArgs XdsHttpGcpAuthnFilter::ModifyChannelArgs(
|
|
|
126
126
|
|
|
127
127
|
absl::StatusOr<XdsHttpFilterImpl::ServiceConfigJsonEntry>
|
|
128
128
|
XdsHttpGcpAuthnFilter::GenerateMethodConfig(
|
|
129
|
-
const
|
|
130
|
-
const
|
|
129
|
+
const Json& /*hcm_filter_config*/,
|
|
130
|
+
const Json* /*filter_config_override*/) const {
|
|
131
131
|
return ServiceConfigJsonEntry{"", ""};
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
absl::StatusOr<XdsHttpFilterImpl::ServiceConfigJsonEntry>
|
|
135
135
|
XdsHttpGcpAuthnFilter::GenerateServiceConfig(
|
|
136
|
-
const
|
|
136
|
+
const Json& hcm_filter_config) const {
|
|
137
137
|
return ServiceConfigJsonEntry{"gcp_authentication",
|
|
138
|
-
JsonDump(hcm_filter_config
|
|
138
|
+
JsonDump(hcm_filter_config)};
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
void XdsHttpGcpAuthnFilter::UpdateBlackboard(
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
void XdsHttpGcpAuthnFilter::UpdateBlackboard(const Json& hcm_filter_config,
|
|
142
|
+
const Blackboard* old_blackboard,
|
|
143
|
+
Blackboard* new_blackboard) const {
|
|
144
144
|
ValidationErrors errors;
|
|
145
145
|
auto config = LoadFromJson<GcpAuthenticationParsedConfig::Config>(
|
|
146
|
-
hcm_filter_config
|
|
146
|
+
hcm_filter_config, JsonArgs(), &errors);
|
|
147
147
|
CHECK(errors.ok()) << errors.message("filter config validation failed");
|
|
148
148
|
RefCountedPtr<GcpAuthenticationFilter::CallCredentialsCache> cache;
|
|
149
149
|
if (old_blackboard != nullptr) {
|
|
@@ -160,4 +160,70 @@ void XdsHttpGcpAuthnFilter::UpdateBlackboard(
|
|
|
160
160
|
new_blackboard->Set(config.filter_instance_name, std::move(cache));
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
void XdsHttpGcpAuthnFilter::UpdateBlackboard(const FilterConfig& config,
|
|
164
|
+
const Blackboard* old_blackboard,
|
|
165
|
+
Blackboard* new_blackboard) const {
|
|
166
|
+
const auto& filter_config =
|
|
167
|
+
DownCast<const GcpAuthenticationFilter::Config&>(config);
|
|
168
|
+
ValidationErrors errors;
|
|
169
|
+
RefCountedPtr<GcpAuthenticationFilter::CallCredentialsCache> cache;
|
|
170
|
+
if (old_blackboard != nullptr) {
|
|
171
|
+
cache = old_blackboard->Get<GcpAuthenticationFilter::CallCredentialsCache>(
|
|
172
|
+
filter_config.instance_name);
|
|
173
|
+
}
|
|
174
|
+
if (cache != nullptr) {
|
|
175
|
+
cache->SetMaxSize(filter_config.cache_size);
|
|
176
|
+
} else {
|
|
177
|
+
cache = MakeRefCounted<GcpAuthenticationFilter::CallCredentialsCache>(
|
|
178
|
+
filter_config.cache_size);
|
|
179
|
+
}
|
|
180
|
+
CHECK_NE(new_blackboard, nullptr);
|
|
181
|
+
new_blackboard->Set(filter_config.instance_name, std::move(cache));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
RefCountedPtr<const FilterConfig> XdsHttpGcpAuthnFilter::ParseTopLevelConfig(
|
|
185
|
+
absl::string_view instance_name,
|
|
186
|
+
const XdsResourceType::DecodeContext& context,
|
|
187
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
188
|
+
const absl::string_view* serialized_filter_config =
|
|
189
|
+
std::get_if<absl::string_view>(&extension.value);
|
|
190
|
+
if (serialized_filter_config == nullptr) {
|
|
191
|
+
errors->AddError("could not parse GCP auth filter config");
|
|
192
|
+
return nullptr;
|
|
193
|
+
}
|
|
194
|
+
auto* gcp_auth =
|
|
195
|
+
envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_parse(
|
|
196
|
+
serialized_filter_config->data(), serialized_filter_config->size(),
|
|
197
|
+
context.arena);
|
|
198
|
+
if (gcp_auth == nullptr) {
|
|
199
|
+
errors->AddError("could not parse GCP auth filter config");
|
|
200
|
+
return nullptr;
|
|
201
|
+
}
|
|
202
|
+
auto config = MakeRefCounted<GcpAuthenticationFilter::Config>();
|
|
203
|
+
config->instance_name = std::string(instance_name);
|
|
204
|
+
const auto* cache_config =
|
|
205
|
+
envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_cache_config(
|
|
206
|
+
gcp_auth);
|
|
207
|
+
if (cache_config == nullptr) return config;
|
|
208
|
+
uint64_t cache_size =
|
|
209
|
+
ParseUInt64Value(
|
|
210
|
+
envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_cache_size(
|
|
211
|
+
cache_config))
|
|
212
|
+
.value_or(10);
|
|
213
|
+
if (cache_size == 0) {
|
|
214
|
+
ValidationErrors::ScopedField field(errors, ".cache_config.cache_size");
|
|
215
|
+
errors->AddError("must be greater than 0");
|
|
216
|
+
}
|
|
217
|
+
config->cache_size = cache_size;
|
|
218
|
+
return config;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
RefCountedPtr<const FilterConfig> XdsHttpGcpAuthnFilter::ParseOverrideConfig(
|
|
222
|
+
absl::string_view /*instance_name*/,
|
|
223
|
+
const XdsResourceType::DecodeContext& /*context*/,
|
|
224
|
+
const XdsExtension& /*extension*/, ValidationErrors* errors) const {
|
|
225
|
+
errors->AddError("GCP auth filter does not support config override");
|
|
226
|
+
return nullptr;
|
|
227
|
+
}
|
|
228
|
+
|
|
163
229
|
} // namespace grpc_core
|
|
@@ -36,23 +36,34 @@ class XdsHttpGcpAuthnFilter final : public XdsHttpFilterImpl {
|
|
|
36
36
|
absl::string_view ConfigProtoName() const override;
|
|
37
37
|
absl::string_view OverrideConfigProtoName() const override;
|
|
38
38
|
void PopulateSymtab(upb_DefPool* symtab) const override;
|
|
39
|
-
std::optional<
|
|
39
|
+
std::optional<Json> GenerateFilterConfig(
|
|
40
40
|
absl::string_view instance_name,
|
|
41
|
-
const XdsResourceType::DecodeContext& context,
|
|
42
|
-
ValidationErrors* errors) const override;
|
|
43
|
-
std::optional<
|
|
41
|
+
const XdsResourceType::DecodeContext& context,
|
|
42
|
+
const XdsExtension& extension, ValidationErrors* errors) const override;
|
|
43
|
+
std::optional<Json> GenerateFilterConfigOverride(
|
|
44
44
|
absl::string_view instance_name,
|
|
45
|
-
const XdsResourceType::DecodeContext& context,
|
|
46
|
-
ValidationErrors* errors) const override;
|
|
47
|
-
void AddFilter(InterceptionChainBuilder& builder) const override;
|
|
45
|
+
const XdsResourceType::DecodeContext& context,
|
|
46
|
+
const XdsExtension& extension, ValidationErrors* errors) const override;
|
|
48
47
|
const grpc_channel_filter* channel_filter() const override;
|
|
49
48
|
ChannelArgs ModifyChannelArgs(const ChannelArgs& args) const override;
|
|
50
49
|
absl::StatusOr<ServiceConfigJsonEntry> GenerateMethodConfig(
|
|
51
|
-
const
|
|
52
|
-
const
|
|
50
|
+
const Json& hcm_filter_config,
|
|
51
|
+
const Json* filter_config_override) const override;
|
|
53
52
|
absl::StatusOr<ServiceConfigJsonEntry> GenerateServiceConfig(
|
|
54
|
-
const
|
|
55
|
-
void
|
|
53
|
+
const Json& hcm_filter_config) const override;
|
|
54
|
+
void AddFilter(FilterChainBuilder& builder,
|
|
55
|
+
RefCountedPtr<const FilterConfig> config) const override;
|
|
56
|
+
RefCountedPtr<const FilterConfig> ParseTopLevelConfig(
|
|
57
|
+
absl::string_view instance_name,
|
|
58
|
+
const XdsResourceType::DecodeContext& context,
|
|
59
|
+
const XdsExtension& extension, ValidationErrors* errors) const override;
|
|
60
|
+
RefCountedPtr<const FilterConfig> ParseOverrideConfig(
|
|
61
|
+
absl::string_view instance_name,
|
|
62
|
+
const XdsResourceType::DecodeContext& context,
|
|
63
|
+
const XdsExtension& extension, ValidationErrors* errors) const override;
|
|
64
|
+
void UpdateBlackboard(const Json& config, const Blackboard* old_blackboard,
|
|
65
|
+
Blackboard* new_blackboard) const override;
|
|
66
|
+
void UpdateBlackboard(const FilterConfig& config,
|
|
56
67
|
const Blackboard* old_blackboard,
|
|
57
68
|
Blackboard* new_blackboard) const override;
|
|
58
69
|
bool IsSupportedOnClients() const override { return true; }
|
|
@@ -516,12 +516,11 @@ void XdsHttpRbacFilter::PopulateSymtab(upb_DefPool* symtab) const {
|
|
|
516
516
|
envoy_extensions_filters_http_rbac_v3_RBAC_getmsgdef(symtab);
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
std::optional<
|
|
520
|
-
XdsHttpRbacFilter::GenerateFilterConfig(
|
|
519
|
+
std::optional<Json> XdsHttpRbacFilter::GenerateFilterConfig(
|
|
521
520
|
absl::string_view /*instance_name*/,
|
|
522
|
-
const XdsResourceType::DecodeContext& context,
|
|
523
|
-
ValidationErrors* errors) const {
|
|
524
|
-
absl::string_view* serialized_filter_config =
|
|
521
|
+
const XdsResourceType::DecodeContext& context,
|
|
522
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
523
|
+
const absl::string_view* serialized_filter_config =
|
|
525
524
|
std::get_if<absl::string_view>(&extension.value);
|
|
526
525
|
if (serialized_filter_config == nullptr) {
|
|
527
526
|
errors->AddError("could not parse HTTP RBAC filter config");
|
|
@@ -534,16 +533,14 @@ XdsHttpRbacFilter::GenerateFilterConfig(
|
|
|
534
533
|
errors->AddError("could not parse HTTP RBAC filter config");
|
|
535
534
|
return std::nullopt;
|
|
536
535
|
}
|
|
537
|
-
return
|
|
538
|
-
ParseHttpRbacToJson(context, rbac, errors)};
|
|
536
|
+
return ParseHttpRbacToJson(context, rbac, errors);
|
|
539
537
|
}
|
|
540
538
|
|
|
541
|
-
std::optional<
|
|
542
|
-
XdsHttpRbacFilter::GenerateFilterConfigOverride(
|
|
539
|
+
std::optional<Json> XdsHttpRbacFilter::GenerateFilterConfigOverride(
|
|
543
540
|
absl::string_view /*instance_name*/,
|
|
544
|
-
const XdsResourceType::DecodeContext& context,
|
|
545
|
-
ValidationErrors* errors) const {
|
|
546
|
-
absl::string_view* serialized_filter_config =
|
|
541
|
+
const XdsResourceType::DecodeContext& context,
|
|
542
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
543
|
+
const absl::string_view* serialized_filter_config =
|
|
547
544
|
std::get_if<absl::string_view>(&extension.value);
|
|
548
545
|
if (serialized_filter_config == nullptr) {
|
|
549
546
|
errors->AddError("could not parse RBACPerRoute");
|
|
@@ -566,11 +563,13 @@ XdsHttpRbacFilter::GenerateFilterConfigOverride(
|
|
|
566
563
|
ValidationErrors::ScopedField field(errors, ".rbac");
|
|
567
564
|
rbac_json = ParseHttpRbacToJson(context, rbac, errors);
|
|
568
565
|
}
|
|
569
|
-
return
|
|
566
|
+
return rbac_json;
|
|
570
567
|
}
|
|
571
568
|
|
|
572
|
-
void XdsHttpRbacFilter::AddFilter(
|
|
573
|
-
|
|
569
|
+
void XdsHttpRbacFilter::AddFilter(
|
|
570
|
+
FilterChainBuilder& builder,
|
|
571
|
+
RefCountedPtr<const FilterConfig> config) const {
|
|
572
|
+
builder.AddFilter<RbacFilter>(std::move(config));
|
|
574
573
|
}
|
|
575
574
|
|
|
576
575
|
const grpc_channel_filter* XdsHttpRbacFilter::channel_filter() const {
|
|
@@ -584,19 +583,36 @@ ChannelArgs XdsHttpRbacFilter::ModifyChannelArgs(
|
|
|
584
583
|
|
|
585
584
|
absl::StatusOr<XdsHttpFilterImpl::ServiceConfigJsonEntry>
|
|
586
585
|
XdsHttpRbacFilter::GenerateMethodConfig(
|
|
587
|
-
const
|
|
588
|
-
const FilterConfig* filter_config_override) const {
|
|
586
|
+
const Json& hcm_filter_config, const Json* filter_config_override) const {
|
|
589
587
|
const Json& policy_json = filter_config_override != nullptr
|
|
590
|
-
? filter_config_override
|
|
591
|
-
: hcm_filter_config
|
|
588
|
+
? *filter_config_override
|
|
589
|
+
: hcm_filter_config;
|
|
592
590
|
// The policy JSON may be empty and that's allowed.
|
|
593
591
|
return ServiceConfigJsonEntry{"rbacPolicy", JsonDump(policy_json)};
|
|
594
592
|
}
|
|
595
593
|
|
|
596
594
|
absl::StatusOr<XdsHttpFilterImpl::ServiceConfigJsonEntry>
|
|
597
595
|
XdsHttpRbacFilter::GenerateServiceConfig(
|
|
598
|
-
const
|
|
596
|
+
const Json& /*hcm_filter_config*/) const {
|
|
599
597
|
return ServiceConfigJsonEntry{"", ""};
|
|
600
598
|
}
|
|
601
599
|
|
|
600
|
+
RefCountedPtr<const FilterConfig> XdsHttpRbacFilter::ParseTopLevelConfig(
|
|
601
|
+
absl::string_view /*instance_name*/,
|
|
602
|
+
const XdsResourceType::DecodeContext& /*context*/,
|
|
603
|
+
const XdsExtension& /*extension*/, ValidationErrors* /*errors*/) const {
|
|
604
|
+
// TODO(roth): Implement this as part of migrating the server side to
|
|
605
|
+
// the new approach for passing xDS HTTP filter configs.
|
|
606
|
+
return nullptr;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
RefCountedPtr<const FilterConfig> XdsHttpRbacFilter::ParseOverrideConfig(
|
|
610
|
+
absl::string_view /*instance_name*/,
|
|
611
|
+
const XdsResourceType::DecodeContext& /*context*/,
|
|
612
|
+
const XdsExtension& /*extension*/, ValidationErrors* /*errors*/) const {
|
|
613
|
+
// TODO(roth): Implement this as part of migrating the server side to
|
|
614
|
+
// the new approach for passing xDS HTTP filter configs.
|
|
615
|
+
return nullptr;
|
|
616
|
+
}
|
|
617
|
+
|
|
602
618
|
} // namespace grpc_core
|
|
@@ -38,22 +38,31 @@ class XdsHttpRbacFilter 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 false; }
|
|
58
67
|
bool IsSupportedOnServers() const override { return true; }
|
|
59
68
|
};
|
|
@@ -138,12 +138,11 @@ Json::Object ValidateStatefulSession(
|
|
|
138
138
|
|
|
139
139
|
} // namespace
|
|
140
140
|
|
|
141
|
-
std::optional<
|
|
142
|
-
XdsHttpStatefulSessionFilter::GenerateFilterConfig(
|
|
141
|
+
std::optional<Json> XdsHttpStatefulSessionFilter::GenerateFilterConfig(
|
|
143
142
|
absl::string_view /*instance_name*/,
|
|
144
|
-
const XdsResourceType::DecodeContext& context,
|
|
145
|
-
ValidationErrors* errors) const {
|
|
146
|
-
absl::string_view* serialized_filter_config =
|
|
143
|
+
const XdsResourceType::DecodeContext& context,
|
|
144
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
145
|
+
const absl::string_view* serialized_filter_config =
|
|
147
146
|
std::get_if<absl::string_view>(&extension.value);
|
|
148
147
|
if (serialized_filter_config == nullptr) {
|
|
149
148
|
errors->AddError("could not parse stateful session filter config");
|
|
@@ -157,17 +156,15 @@ XdsHttpStatefulSessionFilter::GenerateFilterConfig(
|
|
|
157
156
|
errors->AddError("could not parse stateful session filter config");
|
|
158
157
|
return std::nullopt;
|
|
159
158
|
}
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
context, stateful_session, errors))};
|
|
159
|
+
return Json::FromObject(
|
|
160
|
+
ValidateStatefulSession(context, stateful_session, errors));
|
|
163
161
|
}
|
|
164
162
|
|
|
165
|
-
std::optional<
|
|
166
|
-
XdsHttpStatefulSessionFilter::GenerateFilterConfigOverride(
|
|
163
|
+
std::optional<Json> XdsHttpStatefulSessionFilter::GenerateFilterConfigOverride(
|
|
167
164
|
absl::string_view /*instance_name*/,
|
|
168
|
-
const XdsResourceType::DecodeContext& context,
|
|
169
|
-
ValidationErrors* errors) const {
|
|
170
|
-
absl::string_view* serialized_filter_config =
|
|
165
|
+
const XdsResourceType::DecodeContext& context,
|
|
166
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
167
|
+
const absl::string_view* serialized_filter_config =
|
|
171
168
|
std::get_if<absl::string_view>(&extension.value);
|
|
172
169
|
if (serialized_filter_config == nullptr) {
|
|
173
170
|
errors->AddError("could not parse stateful session filter override config");
|
|
@@ -192,18 +189,18 @@ XdsHttpStatefulSessionFilter::GenerateFilterConfigOverride(
|
|
|
192
189
|
config = ValidateStatefulSession(context, stateful_session, errors);
|
|
193
190
|
}
|
|
194
191
|
}
|
|
195
|
-
return
|
|
196
|
-
Json::FromObject(std::move(config))};
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
void XdsHttpStatefulSessionFilter::AddFilter(
|
|
200
|
-
InterceptionChainBuilder& builder) const {
|
|
201
|
-
builder.Add<StatefulSessionFilter>(nullptr);
|
|
192
|
+
return Json::FromObject(std::move(config));
|
|
202
193
|
}
|
|
203
194
|
|
|
204
195
|
const grpc_channel_filter* XdsHttpStatefulSessionFilter::channel_filter()
|
|
205
196
|
const {
|
|
206
|
-
return &StatefulSessionFilter::
|
|
197
|
+
return &StatefulSessionFilter::kFilterVtable;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
void XdsHttpStatefulSessionFilter::AddFilter(
|
|
201
|
+
FilterChainBuilder& builder,
|
|
202
|
+
RefCountedPtr<const FilterConfig> config) const {
|
|
203
|
+
builder.AddFilter<StatefulSessionFilter>(std::move(config));
|
|
207
204
|
}
|
|
208
205
|
|
|
209
206
|
ChannelArgs XdsHttpStatefulSessionFilter::ModifyChannelArgs(
|
|
@@ -213,18 +210,138 @@ ChannelArgs XdsHttpStatefulSessionFilter::ModifyChannelArgs(
|
|
|
213
210
|
|
|
214
211
|
absl::StatusOr<XdsHttpFilterImpl::ServiceConfigJsonEntry>
|
|
215
212
|
XdsHttpStatefulSessionFilter::GenerateMethodConfig(
|
|
216
|
-
const
|
|
217
|
-
const FilterConfig* filter_config_override) const {
|
|
213
|
+
const Json& hcm_filter_config, const Json* filter_config_override) const {
|
|
218
214
|
const Json& config = filter_config_override != nullptr
|
|
219
|
-
? filter_config_override
|
|
220
|
-
: hcm_filter_config
|
|
215
|
+
? *filter_config_override
|
|
216
|
+
: hcm_filter_config;
|
|
221
217
|
return ServiceConfigJsonEntry{"stateful_session", JsonDump(config)};
|
|
222
218
|
}
|
|
223
219
|
|
|
224
220
|
absl::StatusOr<XdsHttpFilterImpl::ServiceConfigJsonEntry>
|
|
225
221
|
XdsHttpStatefulSessionFilter::GenerateServiceConfig(
|
|
226
|
-
const
|
|
222
|
+
const Json& /*hcm_filter_config*/) const {
|
|
227
223
|
return ServiceConfigJsonEntry{"", ""};
|
|
228
224
|
}
|
|
229
225
|
|
|
226
|
+
namespace {
|
|
227
|
+
|
|
228
|
+
RefCountedPtr<StatefulSessionFilter::Config> ParseStatefulSession(
|
|
229
|
+
const XdsResourceType::DecodeContext& context,
|
|
230
|
+
const envoy_extensions_filters_http_stateful_session_v3_StatefulSession*
|
|
231
|
+
stateful_session,
|
|
232
|
+
ValidationErrors* errors) {
|
|
233
|
+
auto config = MakeRefCounted<StatefulSessionFilter::Config>();
|
|
234
|
+
ValidationErrors::ScopedField field(errors, ".session_state");
|
|
235
|
+
const auto* session_state =
|
|
236
|
+
envoy_extensions_filters_http_stateful_session_v3_StatefulSession_session_state(
|
|
237
|
+
stateful_session);
|
|
238
|
+
if (session_state == nullptr) return config;
|
|
239
|
+
ValidationErrors::ScopedField field2(errors, ".typed_config");
|
|
240
|
+
const auto* typed_config =
|
|
241
|
+
envoy_config_core_v3_TypedExtensionConfig_typed_config(session_state);
|
|
242
|
+
auto extension = ExtractXdsExtension(context, typed_config, errors);
|
|
243
|
+
if (!extension.has_value()) return config;
|
|
244
|
+
if (extension->type !=
|
|
245
|
+
"envoy.extensions.http.stateful_session.cookie.v3"
|
|
246
|
+
".CookieBasedSessionState") {
|
|
247
|
+
errors->AddError("unsupported session state type");
|
|
248
|
+
return config;
|
|
249
|
+
}
|
|
250
|
+
const absl::string_view* serialized_session_state =
|
|
251
|
+
std::get_if<absl::string_view>(&extension->value);
|
|
252
|
+
if (serialized_session_state == nullptr) {
|
|
253
|
+
errors->AddError("could not parse session state config");
|
|
254
|
+
return config;
|
|
255
|
+
}
|
|
256
|
+
auto* cookie_state =
|
|
257
|
+
envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_parse(
|
|
258
|
+
serialized_session_state->data(), serialized_session_state->size(),
|
|
259
|
+
context.arena);
|
|
260
|
+
if (cookie_state == nullptr) {
|
|
261
|
+
errors->AddError("could not parse session state config");
|
|
262
|
+
return config;
|
|
263
|
+
}
|
|
264
|
+
ValidationErrors::ScopedField field3(errors, ".cookie");
|
|
265
|
+
const auto* cookie =
|
|
266
|
+
envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_cookie(
|
|
267
|
+
cookie_state);
|
|
268
|
+
if (cookie == nullptr) {
|
|
269
|
+
errors->AddError("field not present");
|
|
270
|
+
return config;
|
|
271
|
+
}
|
|
272
|
+
// name
|
|
273
|
+
config->cookie_name =
|
|
274
|
+
UpbStringToStdString(envoy_type_http_v3_Cookie_name(cookie));
|
|
275
|
+
if (config->cookie_name.empty()) {
|
|
276
|
+
ValidationErrors::ScopedField field(errors, ".name");
|
|
277
|
+
errors->AddError("field not present");
|
|
278
|
+
}
|
|
279
|
+
// ttl
|
|
280
|
+
if (const auto* duration = envoy_type_http_v3_Cookie_ttl(cookie);
|
|
281
|
+
duration != nullptr) {
|
|
282
|
+
ValidationErrors::ScopedField field(errors, ".ttl");
|
|
283
|
+
config->ttl = ParseDuration(duration, errors);
|
|
284
|
+
}
|
|
285
|
+
// path
|
|
286
|
+
config->path = UpbStringToStdString(envoy_type_http_v3_Cookie_path(cookie));
|
|
287
|
+
return config;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
} // namespace
|
|
291
|
+
|
|
292
|
+
RefCountedPtr<const FilterConfig>
|
|
293
|
+
XdsHttpStatefulSessionFilter::ParseTopLevelConfig(
|
|
294
|
+
absl::string_view /*instance_name*/,
|
|
295
|
+
const XdsResourceType::DecodeContext& context,
|
|
296
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
297
|
+
const absl::string_view* serialized_filter_config =
|
|
298
|
+
std::get_if<absl::string_view>(&extension.value);
|
|
299
|
+
if (serialized_filter_config == nullptr) {
|
|
300
|
+
errors->AddError("could not parse stateful session filter config");
|
|
301
|
+
return nullptr;
|
|
302
|
+
}
|
|
303
|
+
auto* stateful_session =
|
|
304
|
+
envoy_extensions_filters_http_stateful_session_v3_StatefulSession_parse(
|
|
305
|
+
serialized_filter_config->data(), serialized_filter_config->size(),
|
|
306
|
+
context.arena);
|
|
307
|
+
if (stateful_session == nullptr) {
|
|
308
|
+
errors->AddError("could not parse stateful session filter config");
|
|
309
|
+
return nullptr;
|
|
310
|
+
}
|
|
311
|
+
return ParseStatefulSession(context, stateful_session, errors);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
RefCountedPtr<const FilterConfig>
|
|
315
|
+
XdsHttpStatefulSessionFilter::ParseOverrideConfig(
|
|
316
|
+
absl::string_view /*instance_name*/,
|
|
317
|
+
const XdsResourceType::DecodeContext& context,
|
|
318
|
+
const XdsExtension& extension, ValidationErrors* errors) const {
|
|
319
|
+
const absl::string_view* serialized_filter_config =
|
|
320
|
+
std::get_if<absl::string_view>(&extension.value);
|
|
321
|
+
if (serialized_filter_config == nullptr) {
|
|
322
|
+
errors->AddError("could not parse stateful session filter override config");
|
|
323
|
+
return nullptr;
|
|
324
|
+
}
|
|
325
|
+
auto* stateful_session_per_route =
|
|
326
|
+
envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_parse(
|
|
327
|
+
serialized_filter_config->data(), serialized_filter_config->size(),
|
|
328
|
+
context.arena);
|
|
329
|
+
if (stateful_session_per_route == nullptr) {
|
|
330
|
+
errors->AddError("could not parse stateful session filter override config");
|
|
331
|
+
return nullptr;
|
|
332
|
+
}
|
|
333
|
+
if (!envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_disabled(
|
|
334
|
+
stateful_session_per_route)) {
|
|
335
|
+
ValidationErrors::ScopedField field(errors, ".stateful_session");
|
|
336
|
+
const auto* stateful_session =
|
|
337
|
+
envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_stateful_session(
|
|
338
|
+
stateful_session_per_route);
|
|
339
|
+
if (stateful_session != nullptr) {
|
|
340
|
+
return ParseStatefulSession(context, stateful_session, errors);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
// Return an empty config. This is used to disable the filter.
|
|
344
|
+
return MakeRefCounted<StatefulSessionFilter::Config>();
|
|
345
|
+
}
|
|
346
|
+
|
|
230
347
|
} // namespace grpc_core
|
|
@@ -38,22 +38,31 @@ class XdsHttpStatefulSessionFilter 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
|
};
|
|
@@ -58,7 +58,10 @@ std::string XdsListenerResource::HttpConnectionManager::ToString() const {
|
|
|
58
58
|
|
|
59
59
|
std::string XdsListenerResource::HttpConnectionManager::HttpFilter::ToString()
|
|
60
60
|
const {
|
|
61
|
-
return absl::StrCat(
|
|
61
|
+
return absl::StrCat(
|
|
62
|
+
"{name=", name, ", config_proto_type=", config_proto_type,
|
|
63
|
+
", config=", JsonDump(config), ", filter_config=",
|
|
64
|
+
filter_config == nullptr ? "null" : filter_config->ToString(), "}");
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
//
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
#include <variant>
|
|
30
30
|
#include <vector>
|
|
31
31
|
|
|
32
|
+
#include "src/core/filter/filter_args.h"
|
|
32
33
|
#include "src/core/lib/iomgr/resolved_address.h"
|
|
33
34
|
#include "src/core/util/time.h"
|
|
34
35
|
#include "src/core/xds/grpc/xds_common_types.h"
|
|
@@ -51,10 +52,17 @@ struct XdsListenerResource : public XdsResourceType::ResourceData {
|
|
|
51
52
|
|
|
52
53
|
struct HttpFilter {
|
|
53
54
|
std::string name;
|
|
54
|
-
|
|
55
|
+
absl::string_view config_proto_type;
|
|
56
|
+
Json config;
|
|
57
|
+
RefCountedPtr<const FilterConfig> filter_config;
|
|
55
58
|
|
|
56
59
|
bool operator==(const HttpFilter& other) const {
|
|
57
|
-
|
|
60
|
+
if (name != other.name) return false;
|
|
61
|
+
if (config_proto_type != other.config_proto_type) return false;
|
|
62
|
+
if (config != other.config) return false;
|
|
63
|
+
if (filter_config == nullptr) return other.filter_config == nullptr;
|
|
64
|
+
if (other.filter_config == nullptr) return false;
|
|
65
|
+
return *filter_config == *other.filter_config;
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
std::string ToString() const;
|