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
|
@@ -81,6 +81,21 @@ struct XdsClusterResource : public XdsResourceType::ResourceData {
|
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
+
struct UpstreamTlsContext {
|
|
85
|
+
CommonTlsContext common_tls_context;
|
|
86
|
+
std::string sni;
|
|
87
|
+
bool auto_host_sni = false;
|
|
88
|
+
bool auto_sni_san_validation = false;
|
|
89
|
+
|
|
90
|
+
bool operator==(const UpstreamTlsContext& other) const {
|
|
91
|
+
return common_tls_context == other.common_tls_context &&
|
|
92
|
+
sni == other.sni && auto_host_sni == other.auto_host_sni &&
|
|
93
|
+
auto_sni_san_validation == other.auto_sni_san_validation;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
std::string ToString() const;
|
|
97
|
+
};
|
|
98
|
+
|
|
84
99
|
std::variant<Eds, LogicalDns, Aggregate> type;
|
|
85
100
|
|
|
86
101
|
// The LB policy to use for locality and endpoint picking.
|
|
@@ -97,7 +112,7 @@ struct XdsClusterResource : public XdsResourceType::ResourceData {
|
|
|
97
112
|
bool use_http_connect = false;
|
|
98
113
|
|
|
99
114
|
// Tls Context used by clients
|
|
100
|
-
|
|
115
|
+
UpstreamTlsContext upstream_tls_context;
|
|
101
116
|
|
|
102
117
|
// Connection idle timeout. Currently used only for SSA.
|
|
103
118
|
Duration connection_idle_timeout = Duration::Hours(1);
|
|
@@ -119,7 +134,7 @@ struct XdsClusterResource : public XdsResourceType::ResourceData {
|
|
|
119
134
|
LrsBackendMetricPropagationEqual(
|
|
120
135
|
lrs_backend_metric_propagation,
|
|
121
136
|
other.lrs_backend_metric_propagation) &&
|
|
122
|
-
|
|
137
|
+
upstream_tls_context == other.upstream_tls_context &&
|
|
123
138
|
connection_idle_timeout == other.connection_idle_timeout &&
|
|
124
139
|
max_concurrent_requests == other.max_concurrent_requests &&
|
|
125
140
|
outlier_detection == other.outlier_detection &&
|
|
@@ -77,6 +77,15 @@ bool XdsHttpConnectEnabled() {
|
|
|
77
77
|
|
|
78
78
|
namespace {
|
|
79
79
|
|
|
80
|
+
// TODO(mlumish): Remove this after the 1.81 release.
|
|
81
|
+
bool XdsSniEnabled() {
|
|
82
|
+
auto value = GetEnv("GRPC_EXPERIMENTAL_XDS_SNI");
|
|
83
|
+
if (!value.has_value()) return true;
|
|
84
|
+
bool parsed_value;
|
|
85
|
+
bool parse_succeeded = gpr_parse_bool_value(value->c_str(), &parsed_value);
|
|
86
|
+
return parse_succeeded && parsed_value;
|
|
87
|
+
}
|
|
88
|
+
|
|
80
89
|
constexpr absl::string_view kUpstreamTlsContextType =
|
|
81
90
|
"envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext";
|
|
82
91
|
|
|
@@ -84,40 +93,56 @@ constexpr absl::string_view kHttp11ProxyType =
|
|
|
84
93
|
"envoy.extensions.transport_sockets.http_11_proxy.v3"
|
|
85
94
|
".Http11ProxyUpstreamTransport";
|
|
86
95
|
|
|
87
|
-
|
|
96
|
+
XdsClusterResource::UpstreamTlsContext UpstreamTlsContextParse(
|
|
88
97
|
const XdsResourceType::DecodeContext& context,
|
|
89
98
|
const XdsExtension& extension, ValidationErrors* errors) {
|
|
99
|
+
XdsClusterResource::UpstreamTlsContext upstream_tls_context;
|
|
90
100
|
const absl::string_view* serialized_upstream_tls_context =
|
|
91
101
|
std::get_if<absl::string_view>(&extension.value);
|
|
92
102
|
if (serialized_upstream_tls_context == nullptr) {
|
|
93
103
|
errors->AddError("can't decode UpstreamTlsContext");
|
|
94
104
|
return {};
|
|
95
105
|
}
|
|
96
|
-
const auto*
|
|
106
|
+
const auto* upstream_tls_context_proto =
|
|
97
107
|
envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_parse(
|
|
98
108
|
serialized_upstream_tls_context->data(),
|
|
99
109
|
serialized_upstream_tls_context->size(), context.arena);
|
|
100
|
-
if (
|
|
110
|
+
if (upstream_tls_context_proto == nullptr) {
|
|
101
111
|
errors->AddError("can't decode UpstreamTlsContext");
|
|
102
112
|
return {};
|
|
103
113
|
}
|
|
114
|
+
if (XdsSniEnabled()) {
|
|
115
|
+
upstream_tls_context.sni = UpbStringToStdString(
|
|
116
|
+
envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_sni(
|
|
117
|
+
upstream_tls_context_proto));
|
|
118
|
+
if (upstream_tls_context.sni.length() > 255) {
|
|
119
|
+
ValidationErrors::ScopedField field(errors, ".sni");
|
|
120
|
+
errors->AddError("must be shorter than 255 characters");
|
|
121
|
+
}
|
|
122
|
+
upstream_tls_context.auto_host_sni =
|
|
123
|
+
envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_auto_host_sni(
|
|
124
|
+
upstream_tls_context_proto);
|
|
125
|
+
upstream_tls_context.auto_sni_san_validation =
|
|
126
|
+
envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_auto_sni_san_validation(
|
|
127
|
+
upstream_tls_context_proto);
|
|
128
|
+
}
|
|
104
129
|
ValidationErrors::ScopedField field3(errors, ".common_tls_context");
|
|
105
130
|
const auto* common_tls_context_proto =
|
|
106
131
|
envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(
|
|
107
|
-
|
|
108
|
-
CommonTlsContext common_tls_context;
|
|
132
|
+
upstream_tls_context_proto);
|
|
109
133
|
if (common_tls_context_proto != nullptr) {
|
|
110
|
-
common_tls_context =
|
|
134
|
+
upstream_tls_context.common_tls_context =
|
|
111
135
|
CommonTlsContextParse(context, common_tls_context_proto, errors);
|
|
112
136
|
}
|
|
113
137
|
if (std::holds_alternative<std::monostate>(
|
|
114
|
-
common_tls_context.certificate_validation_context
|
|
138
|
+
upstream_tls_context.common_tls_context.certificate_validation_context
|
|
139
|
+
.ca_certs)) {
|
|
115
140
|
errors->AddError("no CA certs configured");
|
|
116
141
|
}
|
|
117
|
-
return
|
|
142
|
+
return upstream_tls_context;
|
|
118
143
|
}
|
|
119
144
|
|
|
120
|
-
|
|
145
|
+
XdsClusterResource::UpstreamTlsContext Http11ProxyUpstreamTransportParse(
|
|
121
146
|
const XdsResourceType::DecodeContext& context,
|
|
122
147
|
const XdsExtension& extension, ValidationErrors* errors) {
|
|
123
148
|
const absl::string_view* serialized =
|
|
@@ -490,10 +515,10 @@ absl::StatusOr<std::shared_ptr<const XdsClusterResource>> CdsResourceParse(
|
|
|
490
515
|
if (extension.has_value()) {
|
|
491
516
|
if (XdsHttpConnectEnabled() && extension->type == kHttp11ProxyType) {
|
|
492
517
|
cds_update->use_http_connect = true;
|
|
493
|
-
cds_update->
|
|
518
|
+
cds_update->upstream_tls_context =
|
|
494
519
|
Http11ProxyUpstreamTransportParse(context, *extension, &errors);
|
|
495
520
|
} else if (extension->type == kUpstreamTlsContextType) {
|
|
496
|
-
cds_update->
|
|
521
|
+
cds_update->upstream_tls_context =
|
|
497
522
|
UpstreamTlsContextParse(context, *extension, &errors);
|
|
498
523
|
} else {
|
|
499
524
|
ValidationErrors::ScopedField field(&errors, ".type_url");
|
|
@@ -100,4 +100,49 @@ bool CommonTlsContext::Empty() const {
|
|
|
100
100
|
certificate_validation_context.Empty();
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
//
|
|
104
|
+
// HeaderMutationRules
|
|
105
|
+
//
|
|
106
|
+
|
|
107
|
+
bool HeaderMutationRules::IsMutationAllowed(
|
|
108
|
+
const std::string& header_name) const {
|
|
109
|
+
// If true, all header mutations are disallowed, regardless of any other
|
|
110
|
+
// setting.
|
|
111
|
+
if (disallow_all) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
// If a header name matches this regex, then it will be disallowed
|
|
115
|
+
if (disallow_expression != nullptr &&
|
|
116
|
+
RE2::FullMatch(header_name, *disallow_expression)) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
// If a header name matches this regex and does not match disallow_expression,
|
|
120
|
+
// it will be allowed. If unset, then all headers not matching
|
|
121
|
+
// disallow_expression are allowed
|
|
122
|
+
if (allow_expression == nullptr ||
|
|
123
|
+
RE2::FullMatch(header_name, *allow_expression)) {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
std::string HeaderMutationRules::ToString() const {
|
|
130
|
+
std::vector<std::string> contents;
|
|
131
|
+
if (disallow_all) {
|
|
132
|
+
contents.push_back("disallow_all=true");
|
|
133
|
+
}
|
|
134
|
+
if (disallow_is_error) {
|
|
135
|
+
contents.push_back("disallow_is_error=true");
|
|
136
|
+
}
|
|
137
|
+
if (allow_expression != nullptr) {
|
|
138
|
+
contents.push_back(
|
|
139
|
+
absl::StrCat("allow_expression=", allow_expression->pattern()));
|
|
140
|
+
}
|
|
141
|
+
if (disallow_expression != nullptr) {
|
|
142
|
+
contents.push_back(
|
|
143
|
+
absl::StrCat("disallow_expression=", disallow_expression->pattern()));
|
|
144
|
+
}
|
|
145
|
+
return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
|
|
146
|
+
}
|
|
147
|
+
|
|
103
148
|
} // namespace grpc_core
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
#include "src/core/util/json/json.h"
|
|
25
25
|
#include "src/core/util/matchers.h"
|
|
26
26
|
#include "src/core/util/validation_errors.h"
|
|
27
|
+
#include "src/core/xds/grpc/xds_server_grpc.h"
|
|
27
28
|
#include "absl/strings/string_view.h"
|
|
28
29
|
|
|
29
30
|
namespace grpc_core {
|
|
@@ -85,6 +86,36 @@ struct XdsExtension {
|
|
|
85
86
|
std::vector<ValidationErrors::ScopedField> validation_fields;
|
|
86
87
|
};
|
|
87
88
|
|
|
89
|
+
struct XdsGrpcService {
|
|
90
|
+
std::unique_ptr<GrpcXdsServerTarget> server_target;
|
|
91
|
+
Duration timeout;
|
|
92
|
+
std::vector<std::pair<std::string, std::string>> initial_metadata;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
struct HeaderMutationRules {
|
|
96
|
+
bool disallow_all = false;
|
|
97
|
+
bool disallow_is_error = false;
|
|
98
|
+
std::unique_ptr<RE2> allow_expression;
|
|
99
|
+
std::unique_ptr<RE2> disallow_expression;
|
|
100
|
+
|
|
101
|
+
bool IsMutationAllowed(const std::string& header_name) const;
|
|
102
|
+
|
|
103
|
+
std::string ToString() const;
|
|
104
|
+
|
|
105
|
+
bool operator==(const HeaderMutationRules& other) const {
|
|
106
|
+
auto is_re_equal = [](RE2* a, RE2* b) {
|
|
107
|
+
if (a == nullptr) return b == nullptr;
|
|
108
|
+
if (b == nullptr) return false;
|
|
109
|
+
return a->pattern() == b->pattern();
|
|
110
|
+
};
|
|
111
|
+
return disallow_all == other.disallow_all &&
|
|
112
|
+
disallow_is_error == other.disallow_is_error &&
|
|
113
|
+
is_re_equal(disallow_expression.get(),
|
|
114
|
+
other.disallow_expression.get()) &&
|
|
115
|
+
is_re_equal(allow_expression.get(), other.allow_expression.get());
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
88
119
|
} // namespace grpc_core
|
|
89
120
|
|
|
90
121
|
#endif // GRPC_SRC_CORE_XDS_GRPC_XDS_COMMON_TYPES_H
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
#include "google/protobuf/struct.upb.h"
|
|
33
33
|
#include "google/protobuf/struct.upbdefs.h"
|
|
34
34
|
#include "google/protobuf/wrappers.upb.h"
|
|
35
|
+
#include "src/core/config/core_configuration.h"
|
|
35
36
|
#include "src/core/lib/address_utils/parse_address.h"
|
|
37
|
+
#include "src/core/lib/surface/validate_metadata.h"
|
|
36
38
|
#include "src/core/util/down_cast.h"
|
|
37
39
|
#include "src/core/util/env.h"
|
|
38
40
|
#include "src/core/util/json/json_reader.h"
|
|
@@ -521,6 +523,25 @@ absl::StatusOr<Json> ParseProtobufStructToJson(
|
|
|
521
523
|
// ExtractXdsExtension()
|
|
522
524
|
//
|
|
523
525
|
|
|
526
|
+
namespace {
|
|
527
|
+
|
|
528
|
+
bool StripTypePrefix(absl::string_view& type, ValidationErrors* errors) {
|
|
529
|
+
ValidationErrors::ScopedField field(errors, ".type_url");
|
|
530
|
+
if (type.empty()) {
|
|
531
|
+
errors->AddError("field not present");
|
|
532
|
+
return false;
|
|
533
|
+
}
|
|
534
|
+
size_t pos = type.rfind('/');
|
|
535
|
+
if (pos == absl::string_view::npos || pos == type.size() - 1) {
|
|
536
|
+
errors->AddError(absl::StrCat("invalid value \"", type, "\""));
|
|
537
|
+
} else {
|
|
538
|
+
type = type.substr(pos + 1);
|
|
539
|
+
}
|
|
540
|
+
return true;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
} // namespace
|
|
544
|
+
|
|
524
545
|
std::optional<XdsExtension> ExtractXdsExtension(
|
|
525
546
|
const XdsResourceType::DecodeContext& context,
|
|
526
547
|
const google_protobuf_Any* any, ValidationErrors* errors) {
|
|
@@ -529,22 +550,8 @@ std::optional<XdsExtension> ExtractXdsExtension(
|
|
|
529
550
|
return std::nullopt;
|
|
530
551
|
}
|
|
531
552
|
XdsExtension extension;
|
|
532
|
-
auto strip_type_prefix = [&]() {
|
|
533
|
-
ValidationErrors::ScopedField field(errors, ".type_url");
|
|
534
|
-
if (extension.type.empty()) {
|
|
535
|
-
errors->AddError("field not present");
|
|
536
|
-
return false;
|
|
537
|
-
}
|
|
538
|
-
size_t pos = extension.type.rfind('/');
|
|
539
|
-
if (pos == absl::string_view::npos || pos == extension.type.size() - 1) {
|
|
540
|
-
errors->AddError(absl::StrCat("invalid value \"", extension.type, "\""));
|
|
541
|
-
} else {
|
|
542
|
-
extension.type = extension.type.substr(pos + 1);
|
|
543
|
-
}
|
|
544
|
-
return true;
|
|
545
|
-
};
|
|
546
553
|
extension.type = UpbStringToAbsl(google_protobuf_Any_type_url(any));
|
|
547
|
-
if (!
|
|
554
|
+
if (!StripTypePrefix(extension.type, errors)) return std::nullopt;
|
|
548
555
|
extension.validation_fields.emplace_back(
|
|
549
556
|
errors, absl::StrCat(".value[", extension.type, "]"));
|
|
550
557
|
absl::string_view any_value = UpbStringToAbsl(google_protobuf_Any_value(any));
|
|
@@ -558,7 +565,7 @@ std::optional<XdsExtension> ExtractXdsExtension(
|
|
|
558
565
|
}
|
|
559
566
|
extension.type =
|
|
560
567
|
UpbStringToAbsl(xds_type_v3_TypedStruct_type_url(typed_struct));
|
|
561
|
-
if (!
|
|
568
|
+
if (!StripTypePrefix(extension.type, errors)) return std::nullopt;
|
|
562
569
|
extension.validation_fields.emplace_back(
|
|
563
570
|
errors, absl::StrCat(".value[", extension.type, "]"));
|
|
564
571
|
auto* protobuf_struct = xds_type_v3_TypedStruct_value(typed_struct);
|
|
@@ -578,4 +585,255 @@ std::optional<XdsExtension> ExtractXdsExtension(
|
|
|
578
585
|
return std::move(extension);
|
|
579
586
|
}
|
|
580
587
|
|
|
588
|
+
//
|
|
589
|
+
// ParseXdsGrpcService()
|
|
590
|
+
//
|
|
591
|
+
|
|
592
|
+
namespace {
|
|
593
|
+
|
|
594
|
+
absl::string_view GetHeaderValue(upb_StringView upb_value,
|
|
595
|
+
absl::string_view field_name, bool validate,
|
|
596
|
+
ValidationErrors* errors) {
|
|
597
|
+
absl::string_view value = UpbStringToAbsl(upb_value);
|
|
598
|
+
if (!value.empty()) {
|
|
599
|
+
ValidationErrors::ScopedField field(errors, field_name);
|
|
600
|
+
if (value.size() > 16384) errors->AddError("longer than 16384 bytes");
|
|
601
|
+
if (validate) {
|
|
602
|
+
ValidateMetadataResult result =
|
|
603
|
+
ValidateNonBinaryHeaderValueIsLegal(value);
|
|
604
|
+
if (result != ValidateMetadataResult::kOk) {
|
|
605
|
+
errors->AddError(ValidateMetadataResultToString(result));
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
return value;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
std::pair<std::string, std::string> ParseHeader(
|
|
613
|
+
const envoy_config_core_v3_HeaderValue* header_value,
|
|
614
|
+
ValidationErrors* errors) {
|
|
615
|
+
// key
|
|
616
|
+
absl::string_view key =
|
|
617
|
+
UpbStringToAbsl(envoy_config_core_v3_HeaderValue_key(header_value));
|
|
618
|
+
{
|
|
619
|
+
ValidationErrors::ScopedField field(errors, ".key");
|
|
620
|
+
if (key.size() > 16384) errors->AddError("longer than 16384 bytes");
|
|
621
|
+
ValidateMetadataResult result = ValidateHeaderKeyIsLegal(key);
|
|
622
|
+
if (result != ValidateMetadataResult::kOk) {
|
|
623
|
+
errors->AddError(ValidateMetadataResultToString(result));
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
// value or raw_value
|
|
627
|
+
absl::string_view value;
|
|
628
|
+
if (absl::EndsWith(key, "-bin")) {
|
|
629
|
+
value =
|
|
630
|
+
GetHeaderValue(envoy_config_core_v3_HeaderValue_raw_value(header_value),
|
|
631
|
+
".raw_value", /*validate=*/false, errors);
|
|
632
|
+
if (value.empty()) {
|
|
633
|
+
value =
|
|
634
|
+
GetHeaderValue(envoy_config_core_v3_HeaderValue_value(header_value),
|
|
635
|
+
".value", /*validate=*/true, errors);
|
|
636
|
+
if (value.empty()) {
|
|
637
|
+
errors->AddError("either value or raw_value must be set");
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
} else {
|
|
641
|
+
// Key does not end in "-bin".
|
|
642
|
+
value = GetHeaderValue(envoy_config_core_v3_HeaderValue_value(header_value),
|
|
643
|
+
".value", /*validate=*/true, errors);
|
|
644
|
+
if (value.empty()) {
|
|
645
|
+
ValidationErrors::ScopedField field(errors, ".value");
|
|
646
|
+
errors->AddError("field not set");
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
return {std::string(key), std::string(value)};
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
} // namespace
|
|
653
|
+
|
|
654
|
+
XdsGrpcService ParseXdsGrpcService(
|
|
655
|
+
const XdsResourceType::DecodeContext& context,
|
|
656
|
+
const envoy_config_core_v3_GrpcService* grpc_service,
|
|
657
|
+
ValidationErrors* errors) {
|
|
658
|
+
if (grpc_service == nullptr) {
|
|
659
|
+
errors->AddError("field not set");
|
|
660
|
+
return {};
|
|
661
|
+
}
|
|
662
|
+
XdsGrpcService xds_grpc_service;
|
|
663
|
+
// timeout
|
|
664
|
+
if (auto* timeout = envoy_config_core_v3_GrpcService_timeout(grpc_service);
|
|
665
|
+
timeout != nullptr) {
|
|
666
|
+
ValidationErrors::ScopedField field(errors, ".timeout");
|
|
667
|
+
xds_grpc_service.timeout = ParseDuration(timeout, errors);
|
|
668
|
+
if (xds_grpc_service.timeout <= Duration::Zero()) {
|
|
669
|
+
errors->AddError("duration must be positive");
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
// initial_metadata
|
|
673
|
+
size_t initial_metadata_size;
|
|
674
|
+
auto* initial_metadata = envoy_config_core_v3_GrpcService_initial_metadata(
|
|
675
|
+
grpc_service, &initial_metadata_size);
|
|
676
|
+
for (size_t i = 0; i < initial_metadata_size; ++i) {
|
|
677
|
+
ValidationErrors::ScopedField field(
|
|
678
|
+
errors, absl::StrCat(".initial_metadata[", i, "]"));
|
|
679
|
+
xds_grpc_service.initial_metadata.push_back(
|
|
680
|
+
ParseHeader(initial_metadata[i], errors));
|
|
681
|
+
}
|
|
682
|
+
// google_grpc
|
|
683
|
+
ValidationErrors::ScopedField field(errors, ".google_grpc");
|
|
684
|
+
auto* google_grpc =
|
|
685
|
+
envoy_config_core_v3_GrpcService_google_grpc(grpc_service);
|
|
686
|
+
if (google_grpc == nullptr) {
|
|
687
|
+
errors->AddError("field not set");
|
|
688
|
+
} else {
|
|
689
|
+
// target_uri
|
|
690
|
+
std::string target_uri = UpbStringToStdString(
|
|
691
|
+
envoy_config_core_v3_GrpcService_GoogleGrpc_target_uri(google_grpc));
|
|
692
|
+
if (!CoreConfiguration::Get().resolver_registry().IsValidTarget(
|
|
693
|
+
target_uri)) {
|
|
694
|
+
ValidationErrors::ScopedField field(errors, ".target_uri");
|
|
695
|
+
errors->AddError("invalid target URI");
|
|
696
|
+
}
|
|
697
|
+
// credentials
|
|
698
|
+
RefCountedPtr<const ChannelCredsConfig> channel_creds_config;
|
|
699
|
+
std::vector<RefCountedPtr<const CallCredsConfig>> call_creds_configs;
|
|
700
|
+
if (DownCast<const GrpcXdsServer&>(context.server).TrustedXdsServer()) {
|
|
701
|
+
// Trusted xDS server. Use credentials from the GoogleGrpc proto.
|
|
702
|
+
// First, look at channel creds.
|
|
703
|
+
{
|
|
704
|
+
ValidationErrors::ScopedField field(errors,
|
|
705
|
+
".channel_credentials_plugin");
|
|
706
|
+
size_t size;
|
|
707
|
+
const auto* const* channel_creds_plugin =
|
|
708
|
+
envoy_config_core_v3_GrpcService_GoogleGrpc_channel_credentials_plugin(
|
|
709
|
+
google_grpc, &size);
|
|
710
|
+
if (size == 0) {
|
|
711
|
+
errors->AddError("field not set");
|
|
712
|
+
} else {
|
|
713
|
+
const auto& registry =
|
|
714
|
+
CoreConfiguration::Get().channel_creds_registry();
|
|
715
|
+
const auto& certificate_providers =
|
|
716
|
+
DownCast<const GrpcXdsBootstrap&>(context.client->bootstrap())
|
|
717
|
+
.certificate_providers();
|
|
718
|
+
for (size_t i = 0; i < size; ++i) {
|
|
719
|
+
ValidationErrors::ScopedField field(errors,
|
|
720
|
+
absl::StrCat("[", i, "]"));
|
|
721
|
+
absl::string_view type = UpbStringToAbsl(
|
|
722
|
+
google_protobuf_Any_type_url(channel_creds_plugin[i]));
|
|
723
|
+
if (!StripTypePrefix(type, errors)) continue;
|
|
724
|
+
if (!registry.IsProtoSupported(type)) continue;
|
|
725
|
+
ValidationErrors::ScopedField field2(errors, ".value");
|
|
726
|
+
absl::string_view serialized_config = UpbStringToAbsl(
|
|
727
|
+
google_protobuf_Any_value(channel_creds_plugin[i]));
|
|
728
|
+
channel_creds_config = registry.ParseProto(
|
|
729
|
+
type, serialized_config, certificate_providers, errors);
|
|
730
|
+
break;
|
|
731
|
+
}
|
|
732
|
+
if (channel_creds_config == nullptr) {
|
|
733
|
+
errors->AddError("no supported channel credentials type found");
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
// Now look at call creds.
|
|
738
|
+
{
|
|
739
|
+
ValidationErrors::ScopedField field(errors, ".call_credentials_plugin");
|
|
740
|
+
size_t size;
|
|
741
|
+
const auto* const* call_creds_plugin =
|
|
742
|
+
envoy_config_core_v3_GrpcService_GoogleGrpc_call_credentials_plugin(
|
|
743
|
+
google_grpc, &size);
|
|
744
|
+
const auto& registry = CoreConfiguration::Get().call_creds_registry();
|
|
745
|
+
for (size_t i = 0; i < size; ++i) {
|
|
746
|
+
ValidationErrors::ScopedField field(errors,
|
|
747
|
+
absl::StrCat("[", i, "]"));
|
|
748
|
+
absl::string_view type = UpbStringToAbsl(
|
|
749
|
+
google_protobuf_Any_type_url(call_creds_plugin[i]));
|
|
750
|
+
if (!StripTypePrefix(type, errors)) continue;
|
|
751
|
+
if (!registry.IsProtoSupported(type)) continue;
|
|
752
|
+
ValidationErrors::ScopedField field2(errors, ".value");
|
|
753
|
+
absl::string_view serialized_config =
|
|
754
|
+
UpbStringToAbsl(google_protobuf_Any_value(call_creds_plugin[i]));
|
|
755
|
+
call_creds_configs.push_back(
|
|
756
|
+
registry.ParseProto(type, serialized_config, errors));
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
} else {
|
|
760
|
+
// Not a trusted xDS server. Do lookup in bootstrap.
|
|
761
|
+
const auto& bootstrap =
|
|
762
|
+
DownCast<const GrpcXdsBootstrap&>(context.client->bootstrap());
|
|
763
|
+
auto& allowed_grpc_services = bootstrap.allowed_grpc_services();
|
|
764
|
+
auto it = allowed_grpc_services.find(target_uri);
|
|
765
|
+
if (it == allowed_grpc_services.end()) {
|
|
766
|
+
ValidationErrors::ScopedField field(errors, ".target_uri");
|
|
767
|
+
errors->AddError(
|
|
768
|
+
"service not present in \"allowed_grpc_services\" "
|
|
769
|
+
"in bootstrap config");
|
|
770
|
+
} else {
|
|
771
|
+
channel_creds_config = it->second.channel_creds_config;
|
|
772
|
+
call_creds_configs = it->second.call_creds_configs;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
xds_grpc_service.server_target = std::make_unique<GrpcXdsServerTarget>(
|
|
776
|
+
target_uri, std::move(channel_creds_config),
|
|
777
|
+
std::move(call_creds_configs));
|
|
778
|
+
}
|
|
779
|
+
return xds_grpc_service;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
//
|
|
783
|
+
// ParseHeaderMutationRules()
|
|
784
|
+
//
|
|
785
|
+
namespace {
|
|
786
|
+
|
|
787
|
+
std::unique_ptr<RE2> ParseRegexMatcher(
|
|
788
|
+
const envoy_type_matcher_v3_RegexMatcher* regex_matcher,
|
|
789
|
+
ValidationErrors* errors) {
|
|
790
|
+
auto matcher = UpbStringToStdString(
|
|
791
|
+
envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
|
|
792
|
+
auto regex = std::make_unique<RE2>(matcher);
|
|
793
|
+
if (!regex->ok()) {
|
|
794
|
+
errors->AddError(absl::StrCat("Invalid regex string specified in matcher: ",
|
|
795
|
+
regex->error()));
|
|
796
|
+
return nullptr;
|
|
797
|
+
}
|
|
798
|
+
return regex;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
} // namespace
|
|
802
|
+
|
|
803
|
+
HeaderMutationRules ParseHeaderMutationRules(
|
|
804
|
+
const envoy_config_common_mutation_rules_v3_HeaderMutationRules*
|
|
805
|
+
header_mutation_rules,
|
|
806
|
+
ValidationErrors* errors) {
|
|
807
|
+
if (header_mutation_rules == nullptr) {
|
|
808
|
+
errors->AddError("field is not present");
|
|
809
|
+
return {};
|
|
810
|
+
}
|
|
811
|
+
HeaderMutationRules header_mutation_rules_config;
|
|
812
|
+
header_mutation_rules_config.disallow_all =
|
|
813
|
+
envoy_config_common_mutation_rules_v3_HeaderMutationRules_disallow_all(
|
|
814
|
+
header_mutation_rules);
|
|
815
|
+
header_mutation_rules_config.disallow_is_error =
|
|
816
|
+
envoy_config_common_mutation_rules_v3_HeaderMutationRules_disallow_is_error(
|
|
817
|
+
header_mutation_rules);
|
|
818
|
+
const auto* disallow_expression_proto =
|
|
819
|
+
envoy_config_common_mutation_rules_v3_HeaderMutationRules_disallow_expression(
|
|
820
|
+
header_mutation_rules);
|
|
821
|
+
if (disallow_expression_proto != nullptr) {
|
|
822
|
+
ValidationErrors::ScopedField field(
|
|
823
|
+
errors, ".header_mutation_rules.disallow_expression");
|
|
824
|
+
header_mutation_rules_config.disallow_expression =
|
|
825
|
+
ParseRegexMatcher(disallow_expression_proto, errors);
|
|
826
|
+
}
|
|
827
|
+
const auto* allow_expression_proto =
|
|
828
|
+
envoy_config_common_mutation_rules_v3_HeaderMutationRules_allow_expression(
|
|
829
|
+
header_mutation_rules);
|
|
830
|
+
if (allow_expression_proto != nullptr) {
|
|
831
|
+
ValidationErrors::ScopedField field(
|
|
832
|
+
errors, ".header_mutation_rules.allow_expression");
|
|
833
|
+
header_mutation_rules_config.allow_expression =
|
|
834
|
+
ParseRegexMatcher(allow_expression_proto, errors);
|
|
835
|
+
}
|
|
836
|
+
return header_mutation_rules_config;
|
|
837
|
+
}
|
|
838
|
+
|
|
581
839
|
} // namespace grpc_core
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
|
|
20
20
|
#include <optional>
|
|
21
21
|
|
|
22
|
+
#include "envoy/config/common/mutation_rules/v3/mutation_rules.upb.h"
|
|
22
23
|
#include "envoy/config/core/v3/base.upb.h"
|
|
24
|
+
#include "envoy/config/core/v3/grpc_service.upb.h"
|
|
23
25
|
#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
|
|
24
26
|
#include "envoy/type/matcher/v3/string.upb.h"
|
|
25
27
|
#include "google/protobuf/any.upb.h"
|
|
@@ -84,6 +86,16 @@ std::optional<XdsExtension> ExtractXdsExtension(
|
|
|
84
86
|
const XdsResourceType::DecodeContext& context,
|
|
85
87
|
const google_protobuf_Any* any, ValidationErrors* errors);
|
|
86
88
|
|
|
89
|
+
XdsGrpcService ParseXdsGrpcService(
|
|
90
|
+
const XdsResourceType::DecodeContext& context,
|
|
91
|
+
const envoy_config_core_v3_GrpcService* grpc_service,
|
|
92
|
+
ValidationErrors* errors);
|
|
93
|
+
|
|
94
|
+
HeaderMutationRules ParseHeaderMutationRules(
|
|
95
|
+
const envoy_config_common_mutation_rules_v3_HeaderMutationRules*
|
|
96
|
+
header_mutation_rules,
|
|
97
|
+
ValidationErrors* errors);
|
|
98
|
+
|
|
87
99
|
} // namespace grpc_core
|
|
88
100
|
|
|
89
101
|
#endif // GRPC_SRC_CORE_XDS_GRPC_XDS_COMMON_TYPES_PARSER_H
|