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
|
@@ -36,6 +36,20 @@
|
|
|
36
36
|
|
|
37
37
|
namespace grpc_core {
|
|
38
38
|
|
|
39
|
+
//
|
|
40
|
+
// GcpAuthenticationFilter::Config
|
|
41
|
+
//
|
|
42
|
+
|
|
43
|
+
bool GcpAuthenticationFilter::Config::Equals(const FilterConfig& other) const {
|
|
44
|
+
const auto& o = DownCast<const Config&>(other);
|
|
45
|
+
return instance_name == o.instance_name && cache_size == o.cache_size;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
std::string GcpAuthenticationFilter::Config::ToString() const {
|
|
49
|
+
return absl::StrCat("{instance_name=\"", instance_name,
|
|
50
|
+
"\", cache_size=", cache_size, "}");
|
|
51
|
+
}
|
|
52
|
+
|
|
39
53
|
//
|
|
40
54
|
// GcpAuthenticationFilter::Call
|
|
41
55
|
//
|
|
@@ -83,7 +97,7 @@ absl::Status GcpAuthenticationFilter::Call::OnClientInitialMetadata(
|
|
|
83
97
|
}
|
|
84
98
|
auto& metadata_map = it->second->cluster->metadata;
|
|
85
99
|
const XdsMetadataValue* metadata_value =
|
|
86
|
-
metadata_map.Find(filter->filter_config_->
|
|
100
|
+
metadata_map.Find(filter->filter_config_->instance_name);
|
|
87
101
|
// If no audience in the cluster, then no need to add call creds.
|
|
88
102
|
if (metadata_value == nullptr) return absl::OkStatus();
|
|
89
103
|
// If the entry is present but the wrong type, fail the RPC.
|
|
@@ -137,57 +151,72 @@ GcpAuthenticationFilter::CallCredentialsCache::Get(
|
|
|
137
151
|
// GcpAuthenticationFilter
|
|
138
152
|
//
|
|
139
153
|
|
|
140
|
-
const grpc_channel_filter GcpAuthenticationFilter::
|
|
154
|
+
const grpc_channel_filter GcpAuthenticationFilter::kFilterVtable =
|
|
141
155
|
MakePromiseBasedFilter<GcpAuthenticationFilter, FilterEndpoint::kClient,
|
|
142
156
|
0>();
|
|
143
157
|
|
|
144
158
|
absl::StatusOr<std::unique_ptr<GcpAuthenticationFilter>>
|
|
145
159
|
GcpAuthenticationFilter::Create(const ChannelArgs& args,
|
|
146
160
|
ChannelFilter::Args filter_args) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
RefCountedPtr<const Config> config;
|
|
162
|
+
if (!IsXdsChannelFilterChainPerRouteEnabled()) {
|
|
163
|
+
// Construct new-style filter config from legacy service config.
|
|
164
|
+
auto service_config = args.GetObjectRef<ServiceConfig>();
|
|
165
|
+
if (service_config == nullptr) {
|
|
166
|
+
return absl::InvalidArgumentError(
|
|
167
|
+
"gcp_auth: no service config in channel args");
|
|
168
|
+
}
|
|
169
|
+
auto* global_config = static_cast<const GcpAuthenticationParsedConfig*>(
|
|
170
|
+
service_config->GetGlobalParsedConfig(
|
|
171
|
+
GcpAuthenticationServiceConfigParser::ParserIndex()));
|
|
172
|
+
if (global_config == nullptr) {
|
|
173
|
+
return absl::InvalidArgumentError("gcp_auth: parsed config not found");
|
|
174
|
+
}
|
|
175
|
+
auto* filter_config = global_config->GetConfig(filter_args.instance_id());
|
|
176
|
+
if (filter_config == nullptr) {
|
|
177
|
+
return absl::InvalidArgumentError(
|
|
178
|
+
"gcp_auth: filter instance ID not found in filter config");
|
|
179
|
+
}
|
|
180
|
+
auto new_config = MakeRefCounted<Config>();
|
|
181
|
+
new_config->instance_name = filter_config->filter_instance_name;
|
|
182
|
+
new_config->cache_size = filter_config->cache_size;
|
|
183
|
+
config = std::move(new_config);
|
|
184
|
+
} else {
|
|
185
|
+
// Get filter config.
|
|
186
|
+
if (filter_args.config() == nullptr) {
|
|
187
|
+
return absl::InternalError("gcp_auth: filter config not set");
|
|
188
|
+
}
|
|
189
|
+
if (filter_args.config()->type() != Config::Type()) {
|
|
190
|
+
return absl::InternalError(
|
|
191
|
+
absl::StrCat("wrong config type passed to GCP authn filter: ",
|
|
192
|
+
filter_args.config()->type().name()));
|
|
193
|
+
}
|
|
194
|
+
config = filter_args.config().TakeAsSubclass<const Config>();
|
|
163
195
|
}
|
|
164
196
|
// Get XdsConfig so that we can look up CDS resources.
|
|
165
197
|
auto xds_config = args.GetObjectRef<XdsConfig>();
|
|
166
198
|
if (xds_config == nullptr) {
|
|
167
|
-
return absl::
|
|
199
|
+
return absl::InternalError(
|
|
168
200
|
"gcp_auth: xds config not found in channel args");
|
|
169
201
|
}
|
|
170
202
|
// Get cache from blackboard. This must have been populated
|
|
171
203
|
// previously by the XdsConfigSelector.
|
|
172
|
-
auto cache =
|
|
173
|
-
|
|
204
|
+
auto cache =
|
|
205
|
+
filter_args.GetState<CallCredentialsCache>(config->instance_name);
|
|
174
206
|
if (cache == nullptr) {
|
|
175
|
-
return absl::
|
|
207
|
+
return absl::InternalError(
|
|
176
208
|
"gcp_auth: cache object not found in filter state");
|
|
177
209
|
}
|
|
178
210
|
// Instantiate filter.
|
|
179
|
-
return std::unique_ptr<GcpAuthenticationFilter>(
|
|
180
|
-
|
|
181
|
-
std::move(xds_config), std::move(cache)));
|
|
211
|
+
return std::unique_ptr<GcpAuthenticationFilter>(new GcpAuthenticationFilter(
|
|
212
|
+
std::move(config), std::move(xds_config), std::move(cache)));
|
|
182
213
|
}
|
|
183
214
|
|
|
184
215
|
GcpAuthenticationFilter::GcpAuthenticationFilter(
|
|
185
|
-
RefCountedPtr<
|
|
186
|
-
const GcpAuthenticationParsedConfig::Config* filter_config,
|
|
216
|
+
RefCountedPtr<const Config> filter_config,
|
|
187
217
|
RefCountedPtr<const XdsConfig> xds_config,
|
|
188
218
|
RefCountedPtr<CallCredentialsCache> cache)
|
|
189
|
-
:
|
|
190
|
-
filter_config_(filter_config),
|
|
219
|
+
: filter_config_(std::move(filter_config)),
|
|
191
220
|
xds_config_(std::move(xds_config)),
|
|
192
221
|
cache_(std::move(cache)) {}
|
|
193
222
|
|
|
@@ -42,6 +42,19 @@ namespace grpc_core {
|
|
|
42
42
|
class GcpAuthenticationFilter
|
|
43
43
|
: public ImplementChannelFilter<GcpAuthenticationFilter> {
|
|
44
44
|
public:
|
|
45
|
+
struct Config : public FilterConfig {
|
|
46
|
+
static UniqueTypeName Type() {
|
|
47
|
+
return GRPC_UNIQUE_TYPE_NAME_HERE("gcp_authentication_filter_config");
|
|
48
|
+
}
|
|
49
|
+
UniqueTypeName type() const override { return Type(); }
|
|
50
|
+
|
|
51
|
+
bool Equals(const FilterConfig& other) const override;
|
|
52
|
+
std::string ToString() const override;
|
|
53
|
+
|
|
54
|
+
std::string instance_name;
|
|
55
|
+
uint64_t cache_size = 10;
|
|
56
|
+
};
|
|
57
|
+
|
|
45
58
|
class CallCredentialsCache : public Blackboard::Entry {
|
|
46
59
|
public:
|
|
47
60
|
explicit CallCredentialsCache(size_t max_size) : cache_(max_size) {}
|
|
@@ -58,7 +71,7 @@ class GcpAuthenticationFilter
|
|
|
58
71
|
cache_ ABSL_GUARDED_BY(&mu_);
|
|
59
72
|
};
|
|
60
73
|
|
|
61
|
-
static const grpc_channel_filter
|
|
74
|
+
static const grpc_channel_filter kFilterVtable;
|
|
62
75
|
|
|
63
76
|
static absl::string_view TypeName() { return "gcp_authentication_filter"; }
|
|
64
77
|
|
|
@@ -81,16 +94,11 @@ class GcpAuthenticationFilter
|
|
|
81
94
|
};
|
|
82
95
|
|
|
83
96
|
private:
|
|
84
|
-
GcpAuthenticationFilter(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
// TODO(roth): Consider having the channel stack hold this ref so that
|
|
91
|
-
// individual filters don't need to.
|
|
92
|
-
const RefCountedPtr<ServiceConfig> service_config_;
|
|
93
|
-
const GcpAuthenticationParsedConfig::Config* filter_config_;
|
|
97
|
+
GcpAuthenticationFilter(RefCountedPtr<const Config> filter_config,
|
|
98
|
+
RefCountedPtr<const XdsConfig> xds_config,
|
|
99
|
+
RefCountedPtr<CallCredentialsCache> cache);
|
|
100
|
+
|
|
101
|
+
const RefCountedPtr<const Config> filter_config_;
|
|
94
102
|
const RefCountedPtr<const XdsConfig> xds_config_;
|
|
95
103
|
const RefCountedPtr<CallCredentialsCache> cache_;
|
|
96
104
|
};
|
|
@@ -59,20 +59,50 @@ UniqueTypeName XdsOverrideHostAttribute::TypeName() {
|
|
|
59
59
|
return kFactory.Create();
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
bool StatefulSessionFilter::Config::Equals(const FilterConfig& other) const {
|
|
63
|
+
const auto& o = DownCast<const Config&>(other);
|
|
64
|
+
return cookie_name == o.cookie_name && path == o.path && ttl == o.ttl;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
std::string StatefulSessionFilter::Config::ToString() const {
|
|
68
|
+
std::vector<std::string> parts;
|
|
69
|
+
if (!cookie_name.empty()) {
|
|
70
|
+
parts.push_back(absl::StrCat("cookie_name=\"", cookie_name, "\""));
|
|
71
|
+
}
|
|
72
|
+
if (!path.empty()) {
|
|
73
|
+
parts.push_back(absl::StrCat("path=\"", path, "\""));
|
|
74
|
+
}
|
|
75
|
+
if (ttl != Duration::Zero()) {
|
|
76
|
+
parts.push_back(absl::StrCat("ttl=", ttl.ToString()));
|
|
77
|
+
}
|
|
78
|
+
return absl::StrCat("{", absl::StrJoin(parts, ", "), "}");
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const grpc_channel_filter StatefulSessionFilter::kFilterVtable =
|
|
63
82
|
MakePromiseBasedFilter<StatefulSessionFilter, FilterEndpoint::kClient,
|
|
64
83
|
kFilterExaminesServerInitialMetadata>();
|
|
65
84
|
|
|
66
85
|
absl::StatusOr<std::unique_ptr<StatefulSessionFilter>>
|
|
67
86
|
StatefulSessionFilter::Create(const ChannelArgs&,
|
|
68
87
|
ChannelFilter::Args filter_args) {
|
|
88
|
+
if (IsXdsChannelFilterChainPerRouteEnabled()) {
|
|
89
|
+
if (filter_args.config() == nullptr) {
|
|
90
|
+
return absl::InternalError("no config in stateful session filter");
|
|
91
|
+
}
|
|
92
|
+
if (filter_args.config()->type() != Config::Type()) {
|
|
93
|
+
return absl::InternalError(
|
|
94
|
+
absl::StrCat("wrong config type in stateful session filter: ",
|
|
95
|
+
filter_args.config()->type().name()));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
69
98
|
return std::make_unique<StatefulSessionFilter>(filter_args);
|
|
70
99
|
}
|
|
71
100
|
|
|
72
101
|
StatefulSessionFilter::StatefulSessionFilter(ChannelFilter::Args filter_args)
|
|
73
102
|
: index_(filter_args.instance_id()),
|
|
74
103
|
service_config_parser_index_(
|
|
75
|
-
StatefulSessionServiceConfigParser::ParserIndex())
|
|
104
|
+
StatefulSessionServiceConfigParser::ParserIndex()),
|
|
105
|
+
config_(filter_args.config().TakeAsSubclass<const Config>()) {}
|
|
76
106
|
|
|
77
107
|
namespace {
|
|
78
108
|
|
|
@@ -91,9 +121,11 @@ absl::string_view AllocateStringOnArena(
|
|
|
91
121
|
}
|
|
92
122
|
|
|
93
123
|
// Adds the set-cookie header to the server initial metadata if needed.
|
|
124
|
+
// TODO(roth): Un-templatize this when we remove the
|
|
125
|
+
// xds_channel_filter_chain_per_route experiment.
|
|
126
|
+
template <typename T>
|
|
94
127
|
void MaybeUpdateServerInitialMetadata(
|
|
95
|
-
const
|
|
96
|
-
bool cluster_changed, absl::string_view actual_cluster,
|
|
128
|
+
const T& config, bool cluster_changed, absl::string_view actual_cluster,
|
|
97
129
|
absl::string_view cookie_address_list,
|
|
98
130
|
XdsOverrideHostAttribute* override_host_attribute,
|
|
99
131
|
ServerMetadata& server_initial_metadata) {
|
|
@@ -106,13 +138,13 @@ void MaybeUpdateServerInitialMetadata(
|
|
|
106
138
|
std::string new_value = absl::StrCat(
|
|
107
139
|
override_host_attribute->actual_address_list(), ";", actual_cluster);
|
|
108
140
|
std::vector<std::string> parts = {absl::StrCat(
|
|
109
|
-
|
|
110
|
-
if (!
|
|
111
|
-
parts.emplace_back(absl::StrCat("Path=",
|
|
141
|
+
config.cookie_name, "=", absl::Base64Escape(new_value), "; HttpOnly")};
|
|
142
|
+
if (!config.path.empty()) {
|
|
143
|
+
parts.emplace_back(absl::StrCat("Path=", config.path));
|
|
112
144
|
}
|
|
113
|
-
if (
|
|
145
|
+
if (config.ttl > Duration::Zero()) {
|
|
114
146
|
parts.emplace_back(
|
|
115
|
-
absl::StrCat("Max-Age=",
|
|
147
|
+
absl::StrCat("Max-Age=", config.ttl.as_timespec().tv_sec));
|
|
116
148
|
}
|
|
117
149
|
server_initial_metadata.Append(
|
|
118
150
|
"set-cookie", Slice::FromCopiedString(absl::StrJoin(parts, "; ")),
|
|
@@ -214,21 +246,30 @@ bool IsConfiguredPath(absl::string_view configured_path,
|
|
|
214
246
|
void StatefulSessionFilter::Call::OnClientInitialMetadata(
|
|
215
247
|
ClientMetadata& md, StatefulSessionFilter* filter) {
|
|
216
248
|
GRPC_LATENT_SEE_SCOPE("StatefulSessionFilter::Call::OnClientInitialMetadata");
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
249
|
+
if (!IsXdsChannelFilterChainPerRouteEnabled()) {
|
|
250
|
+
// Get config.
|
|
251
|
+
auto* service_config_call_data = GetContext<ServiceConfigCallData>();
|
|
252
|
+
GRPC_CHECK_NE(service_config_call_data, nullptr);
|
|
253
|
+
auto* method_params = static_cast<StatefulSessionMethodParsedConfig*>(
|
|
254
|
+
service_config_call_data->GetMethodParsedConfig(
|
|
255
|
+
filter->service_config_parser_index_));
|
|
256
|
+
GRPC_CHECK_NE(method_params, nullptr);
|
|
257
|
+
cookie_config_ = method_params->GetConfig(filter->index_);
|
|
258
|
+
GRPC_CHECK_NE(cookie_config_, nullptr);
|
|
259
|
+
OnClientInitialMetadataImpl(md, *cookie_config_);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
OnClientInitialMetadataImpl(md, *filter->config_);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
template <typename T>
|
|
266
|
+
void StatefulSessionFilter::Call::OnClientInitialMetadataImpl(
|
|
267
|
+
ClientMetadata& md, const T& config) {
|
|
268
|
+
if (config.cookie_name.empty() || !IsConfiguredPath(config.path, md)) {
|
|
228
269
|
return;
|
|
229
270
|
}
|
|
230
271
|
// Base64-decode cookie value.
|
|
231
|
-
std::string cookie_value = GetCookieValue(md,
|
|
272
|
+
std::string cookie_value = GetCookieValue(md, config.cookie_name);
|
|
232
273
|
// Cookie format is "host;cluster"
|
|
233
274
|
std::pair<absl::string_view, absl::string_view> host_cluster =
|
|
234
275
|
absl::StrSplit(cookie_value, absl::MaxSplits(';', 1));
|
|
@@ -237,6 +278,8 @@ void StatefulSessionFilter::Call::OnClientInitialMetadata(
|
|
|
237
278
|
cookie_address_list_ = AllocateStringOnArena(host_cluster.first);
|
|
238
279
|
}
|
|
239
280
|
// Set override host attribute.
|
|
281
|
+
auto* service_config_call_data = GetContext<ServiceConfigCallData>();
|
|
282
|
+
GRPC_CHECK_NE(service_config_call_data, nullptr);
|
|
240
283
|
override_host_attribute_ =
|
|
241
284
|
GetContext<Arena>()->ManagedNew<XdsOverrideHostAttribute>(
|
|
242
285
|
cookie_address_list_);
|
|
@@ -252,16 +295,24 @@ void StatefulSessionFilter::Call::OnClientInitialMetadata(
|
|
|
252
295
|
perform_filtering_ = true;
|
|
253
296
|
}
|
|
254
297
|
|
|
255
|
-
void StatefulSessionFilter::Call::OnServerInitialMetadata(
|
|
298
|
+
void StatefulSessionFilter::Call::OnServerInitialMetadata(
|
|
299
|
+
ServerMetadata& md, StatefulSessionFilter* filter) {
|
|
256
300
|
GRPC_LATENT_SEE_SCOPE("StatefulSessionFilter::Call::OnServerInitialMetadata");
|
|
257
301
|
if (!perform_filtering_) return;
|
|
258
302
|
// Add cookie to server initial metadata if needed.
|
|
259
|
-
|
|
303
|
+
if (!IsXdsChannelFilterChainPerRouteEnabled()) {
|
|
304
|
+
MaybeUpdateServerInitialMetadata(*cookie_config_, cluster_changed_,
|
|
305
|
+
cluster_name_, cookie_address_list_,
|
|
306
|
+
override_host_attribute_, md);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
MaybeUpdateServerInitialMetadata(*filter->config_, cluster_changed_,
|
|
260
310
|
cluster_name_, cookie_address_list_,
|
|
261
311
|
override_host_attribute_, md);
|
|
262
312
|
}
|
|
263
313
|
|
|
264
|
-
void StatefulSessionFilter::Call::OnServerTrailingMetadata(
|
|
314
|
+
void StatefulSessionFilter::Call::OnServerTrailingMetadata(
|
|
315
|
+
ServerMetadata& md, StatefulSessionFilter* filter) {
|
|
265
316
|
GRPC_LATENT_SEE_SCOPE(
|
|
266
317
|
"StatefulSessionFilter::Call::OnServerTrailingMetadata");
|
|
267
318
|
if (!perform_filtering_) return;
|
|
@@ -269,7 +320,13 @@ void StatefulSessionFilter::Call::OnServerTrailingMetadata(ServerMetadata& md) {
|
|
|
269
320
|
// cookie to the trailing metadata instead of the
|
|
270
321
|
// initial metadata.
|
|
271
322
|
if (md.get(GrpcTrailersOnly()).value_or(false)) {
|
|
272
|
-
|
|
323
|
+
if (!IsXdsChannelFilterChainPerRouteEnabled()) {
|
|
324
|
+
MaybeUpdateServerInitialMetadata(*cookie_config_, cluster_changed_,
|
|
325
|
+
cluster_name_, cookie_address_list_,
|
|
326
|
+
override_host_attribute_, md);
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
MaybeUpdateServerInitialMetadata(*filter->config_, cluster_changed_,
|
|
273
330
|
cluster_name_, cookie_address_list_,
|
|
274
331
|
override_host_attribute_, md);
|
|
275
332
|
}
|
|
@@ -70,7 +70,21 @@ class XdsOverrideHostAttribute
|
|
|
70
70
|
class StatefulSessionFilter
|
|
71
71
|
: public ImplementChannelFilter<StatefulSessionFilter> {
|
|
72
72
|
public:
|
|
73
|
-
|
|
73
|
+
struct Config : public FilterConfig {
|
|
74
|
+
static UniqueTypeName Type() {
|
|
75
|
+
return GRPC_UNIQUE_TYPE_NAME_HERE("stateful_session_filter_config");
|
|
76
|
+
}
|
|
77
|
+
UniqueTypeName type() const override { return Type(); }
|
|
78
|
+
|
|
79
|
+
bool Equals(const FilterConfig& other) const override;
|
|
80
|
+
std::string ToString() const override;
|
|
81
|
+
|
|
82
|
+
std::string cookie_name;
|
|
83
|
+
std::string path;
|
|
84
|
+
Duration ttl;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
static const grpc_channel_filter kFilterVtable;
|
|
74
88
|
|
|
75
89
|
static absl::string_view TypeName() { return "stateful_session_filter"; }
|
|
76
90
|
|
|
@@ -83,8 +97,10 @@ class StatefulSessionFilter
|
|
|
83
97
|
public:
|
|
84
98
|
void OnClientInitialMetadata(ClientMetadata& md,
|
|
85
99
|
StatefulSessionFilter* filter);
|
|
86
|
-
void OnServerInitialMetadata(ServerMetadata& md
|
|
87
|
-
|
|
100
|
+
void OnServerInitialMetadata(ServerMetadata& md,
|
|
101
|
+
StatefulSessionFilter* filter);
|
|
102
|
+
void OnServerTrailingMetadata(ServerMetadata& md,
|
|
103
|
+
StatefulSessionFilter* filter);
|
|
88
104
|
static inline const NoInterceptor OnClientToServerMessage;
|
|
89
105
|
static inline const NoInterceptor OnClientToServerHalfClose;
|
|
90
106
|
static inline const NoInterceptor OnServerToClientMessage;
|
|
@@ -102,7 +118,12 @@ class StatefulSessionFilter
|
|
|
102
118
|
}
|
|
103
119
|
|
|
104
120
|
private:
|
|
121
|
+
// TODO(roth): Remove these when removing the
|
|
122
|
+
// xds_channel_filter_chain_per_route experiment.
|
|
123
|
+
template <typename T>
|
|
124
|
+
void OnClientInitialMetadataImpl(ClientMetadata& md, const T& config);
|
|
105
125
|
const StatefulSessionMethodParsedConfig::CookieConfig* cookie_config_;
|
|
126
|
+
|
|
106
127
|
XdsOverrideHostAttribute* override_host_attribute_;
|
|
107
128
|
absl::string_view cluster_name_;
|
|
108
129
|
absl::string_view cookie_address_list_;
|
|
@@ -111,10 +132,14 @@ class StatefulSessionFilter
|
|
|
111
132
|
};
|
|
112
133
|
|
|
113
134
|
private:
|
|
135
|
+
// TODO(roth): Remove these fields when removing the
|
|
136
|
+
// xds_channel_filter_chain_per_route experiment.
|
|
114
137
|
// The relative index of instances of the same filter.
|
|
115
138
|
const size_t index_;
|
|
116
139
|
// Index of the service config parser.
|
|
117
140
|
const size_t service_config_parser_index_;
|
|
141
|
+
|
|
142
|
+
const RefCountedPtr<const Config> config_;
|
|
118
143
|
};
|
|
119
144
|
|
|
120
145
|
} // namespace grpc_core
|
|
@@ -27,18 +27,20 @@ namespace grpc_core {
|
|
|
27
27
|
|
|
28
28
|
const JsonLoaderInterface*
|
|
29
29
|
StatefulSessionMethodParsedConfig::CookieConfig::JsonLoader(const JsonArgs&) {
|
|
30
|
-
static const auto* loader =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
static const auto* loader =
|
|
31
|
+
JsonObjectLoader<CookieConfig>()
|
|
32
|
+
.OptionalField("name", &CookieConfig::cookie_name)
|
|
33
|
+
.OptionalField("path", &CookieConfig::path)
|
|
34
|
+
.OptionalField("ttl", &CookieConfig::ttl)
|
|
35
|
+
.Finish();
|
|
35
36
|
return loader;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
void StatefulSessionMethodParsedConfig::CookieConfig::JsonPostLoad(
|
|
39
|
-
const Json
|
|
40
|
+
const Json& json, const JsonArgs&, ValidationErrors* errors) {
|
|
40
41
|
// Validate that cookie_name is non-empty.
|
|
41
|
-
if (
|
|
42
|
+
if (json.object().find("name") != json.object().end() &&
|
|
43
|
+
cookie_name.empty()) {
|
|
42
44
|
ValidationErrors::ScopedField field(errors, ".name");
|
|
43
45
|
errors->AddError("must be non-empty");
|
|
44
46
|
}
|
|
@@ -45,7 +45,7 @@ class StatefulSessionMethodParsedConfig
|
|
|
45
45
|
: public ServiceConfigParser::ParsedConfig {
|
|
46
46
|
public:
|
|
47
47
|
struct CookieConfig {
|
|
48
|
-
std::
|
|
48
|
+
std::string cookie_name; // Will be empty if disabled.
|
|
49
49
|
std::string path;
|
|
50
50
|
Duration ttl;
|
|
51
51
|
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
#ifndef GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CALL_TRACER_WRAPPER_H
|
|
20
20
|
#define GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CALL_TRACER_WRAPPER_H
|
|
21
21
|
|
|
22
|
-
#include "src/core/lib/transport/transport.h"
|
|
23
22
|
#include "src/core/telemetry/call_tracer.h"
|
|
24
23
|
|
|
25
24
|
struct grpc_chttp2_stream;
|
|
@@ -43,7 +42,14 @@ class Chttp2CallTracerWrapper final : public CallTracerInterface {
|
|
|
43
42
|
// Everything else is a no-op.
|
|
44
43
|
void RecordSendInitialMetadata(
|
|
45
44
|
grpc_metadata_batch* /*send_initial_metadata*/) override {}
|
|
45
|
+
void MutateSendInitialMetadata(
|
|
46
|
+
grpc_metadata_batch* /*send_initial_metadata*/) override {}
|
|
46
47
|
void RecordSendTrailingMetadata(
|
|
48
|
+
grpc_metadata_batch* send_trailing_metadata) override {
|
|
49
|
+
GRPC_CHECK(!IsCallTracerSendTrailingMetadataIsAnAnnotationEnabled());
|
|
50
|
+
MutateSendTrailingMetadata(send_trailing_metadata);
|
|
51
|
+
}
|
|
52
|
+
void MutateSendTrailingMetadata(
|
|
47
53
|
grpc_metadata_batch* /*send_trailing_metadata*/) override {}
|
|
48
54
|
void RecordSendMessage(const Message& /*send_message*/) override {}
|
|
49
55
|
void RecordSendCompressedMessage(
|