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
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
#include <grpc/grpc.h>
|
|
21
21
|
#include <grpc/grpc_security.h>
|
|
22
22
|
#include <grpc/support/json.h>
|
|
23
|
-
#include <grpc/support/port_platform.h>
|
|
24
23
|
#include <grpc/support/time.h>
|
|
25
24
|
|
|
26
25
|
#include <map>
|
|
@@ -28,11 +27,15 @@
|
|
|
28
27
|
#include <string>
|
|
29
28
|
#include <utility>
|
|
30
29
|
|
|
30
|
+
#include "envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb.h"
|
|
31
|
+
#include "envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb.h"
|
|
32
|
+
#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
|
|
31
33
|
#include "src/core/config/core_configuration.h"
|
|
32
34
|
#include "src/core/credentials/call/call_credentials.h"
|
|
33
35
|
#include "src/core/credentials/transport/channel_creds_registry.h"
|
|
34
36
|
#include "src/core/credentials/transport/fake/fake_credentials.h"
|
|
35
37
|
#include "src/core/credentials/transport/google_default/google_default_credentials.h" // IWYU pragma: keep
|
|
38
|
+
#include "src/core/credentials/transport/ssl/ssl_credentials.h"
|
|
36
39
|
#include "src/core/credentials/transport/tls/grpc_tls_certificate_provider.h"
|
|
37
40
|
#include "src/core/credentials/transport/tls/grpc_tls_credentials_options.h"
|
|
38
41
|
#include "src/core/credentials/transport/tls/tls_credentials.h"
|
|
@@ -42,6 +45,7 @@
|
|
|
42
45
|
#include "src/core/util/ref_counted_ptr.h"
|
|
43
46
|
#include "src/core/util/time.h"
|
|
44
47
|
#include "src/core/util/validation_errors.h"
|
|
48
|
+
#include "absl/functional/any_invocable.h"
|
|
45
49
|
#include "absl/strings/string_view.h"
|
|
46
50
|
|
|
47
51
|
namespace grpc_core {
|
|
@@ -49,13 +53,23 @@ namespace grpc_core {
|
|
|
49
53
|
class GoogleDefaultChannelCredsFactory : public ChannelCredsFactory<> {
|
|
50
54
|
public:
|
|
51
55
|
absl::string_view type() const override { return Type(); }
|
|
52
|
-
RefCountedPtr<ChannelCredsConfig> ParseConfig(
|
|
56
|
+
RefCountedPtr<const ChannelCredsConfig> ParseConfig(
|
|
53
57
|
const Json& /*config*/, const JsonArgs& /*args*/,
|
|
54
58
|
ValidationErrors* /*errors*/) const override {
|
|
55
59
|
return MakeRefCounted<Config>();
|
|
56
60
|
}
|
|
61
|
+
absl::string_view proto_type() const override { return ProtoType(); }
|
|
62
|
+
RefCountedPtr<const ChannelCredsConfig> ParseProto(
|
|
63
|
+
absl::string_view /*serialized_config*/,
|
|
64
|
+
const CertificateProviderStoreInterface::PluginDefinitionMap&
|
|
65
|
+
/*certificate_provider_definitions*/,
|
|
66
|
+
ValidationErrors* /*errors*/) const override {
|
|
67
|
+
return MakeRefCounted<Config>();
|
|
68
|
+
}
|
|
57
69
|
RefCountedPtr<grpc_channel_credentials> CreateChannelCreds(
|
|
58
|
-
RefCountedPtr<ChannelCredsConfig> /*config
|
|
70
|
+
RefCountedPtr<const ChannelCredsConfig> /*config*/,
|
|
71
|
+
CertificateProviderStoreInterface& /*certificate_provider_store*/)
|
|
72
|
+
const override {
|
|
59
73
|
return RefCountedPtr<grpc_channel_credentials>(
|
|
60
74
|
grpc_google_default_credentials_create(nullptr, nullptr));
|
|
61
75
|
}
|
|
@@ -64,64 +78,143 @@ class GoogleDefaultChannelCredsFactory : public ChannelCredsFactory<> {
|
|
|
64
78
|
class Config : public ChannelCredsConfig {
|
|
65
79
|
public:
|
|
66
80
|
absl::string_view type() const override { return Type(); }
|
|
81
|
+
absl::string_view proto_type() const override { return ProtoType(); }
|
|
67
82
|
bool Equals(const ChannelCredsConfig&) const override { return true; }
|
|
68
83
|
std::string ToString() const override { return "{}"; }
|
|
69
84
|
};
|
|
70
85
|
|
|
71
86
|
static absl::string_view Type() { return "google_default"; }
|
|
87
|
+
|
|
88
|
+
static absl::string_view ProtoType() {
|
|
89
|
+
return "envoy.extensions.grpc_service.channel_credentials.google_default"
|
|
90
|
+
".v3.GoogleDefaultCredentials";
|
|
91
|
+
}
|
|
72
92
|
};
|
|
73
93
|
|
|
74
94
|
class TlsChannelCredsFactory : public ChannelCredsFactory<> {
|
|
75
95
|
public:
|
|
76
96
|
absl::string_view type() const override { return Type(); }
|
|
77
97
|
|
|
78
|
-
RefCountedPtr<ChannelCredsConfig> ParseConfig(
|
|
98
|
+
RefCountedPtr<const ChannelCredsConfig> ParseConfig(
|
|
79
99
|
const Json& config, const JsonArgs& args,
|
|
80
100
|
ValidationErrors* errors) const override {
|
|
81
101
|
return LoadFromJson<RefCountedPtr<TlsConfig>>(config, args, errors);
|
|
82
102
|
}
|
|
83
103
|
|
|
104
|
+
absl::string_view proto_type() const override { return ProtoType(); }
|
|
105
|
+
|
|
106
|
+
RefCountedPtr<const ChannelCredsConfig> ParseProto(
|
|
107
|
+
absl::string_view serialized_config,
|
|
108
|
+
const CertificateProviderStoreInterface::PluginDefinitionMap&
|
|
109
|
+
certificate_provider_definitions,
|
|
110
|
+
ValidationErrors* errors) const override {
|
|
111
|
+
return TlsConfig::ParseProto(serialized_config,
|
|
112
|
+
certificate_provider_definitions, errors);
|
|
113
|
+
}
|
|
114
|
+
|
|
84
115
|
RefCountedPtr<grpc_channel_credentials> CreateChannelCreds(
|
|
85
|
-
RefCountedPtr<ChannelCredsConfig> base_config
|
|
116
|
+
RefCountedPtr<const ChannelCredsConfig> base_config,
|
|
117
|
+
CertificateProviderStoreInterface& certificate_provider_store)
|
|
118
|
+
const override {
|
|
86
119
|
auto* config = static_cast<const TlsConfig*>(base_config.get());
|
|
87
120
|
auto options = MakeRefCounted<grpc_tls_credentials_options>();
|
|
88
|
-
if (!config->
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
options->
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
121
|
+
if (!config->root_certificate_provider().instance_name.empty()) {
|
|
122
|
+
options->set_root_certificate_provider(
|
|
123
|
+
certificate_provider_store.CreateOrGetCertificateProvider(
|
|
124
|
+
config->root_certificate_provider().instance_name));
|
|
125
|
+
options->set_root_cert_name(
|
|
126
|
+
config->root_certificate_provider().certificate_name);
|
|
127
|
+
if (!config->identity_certificate_provider().instance_name.empty()) {
|
|
128
|
+
options->set_identity_certificate_provider(
|
|
129
|
+
certificate_provider_store.CreateOrGetCertificateProvider(
|
|
130
|
+
config->identity_certificate_provider().instance_name));
|
|
131
|
+
options->set_identity_cert_name(
|
|
132
|
+
config->identity_certificate_provider().certificate_name);
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
if (!config->certificate_file().empty() ||
|
|
136
|
+
!config->ca_certificate_file().empty()) {
|
|
137
|
+
// TODO(gtcooke94): Expose the spiffe_bundle_map option in the XDS
|
|
138
|
+
// bootstrap config to use here.
|
|
139
|
+
auto provider = MakeRefCounted<FileWatcherCertificateProvider>(
|
|
140
|
+
config->private_key_file(), config->certificate_file(),
|
|
141
|
+
config->ca_certificate_file(), /*spiffe_bundle_map_file=*/"",
|
|
142
|
+
config->refresh_interval().millis() / GPR_MS_PER_SEC);
|
|
143
|
+
options->set_root_certificate_provider(
|
|
144
|
+
config->ca_certificate_file().empty() ? nullptr : provider);
|
|
145
|
+
options->set_identity_certificate_provider(
|
|
146
|
+
config->certificate_file().empty() ? nullptr : provider);
|
|
147
|
+
}
|
|
97
148
|
}
|
|
98
|
-
options->set_watch_root_cert(!config->ca_certificate_file().empty());
|
|
99
|
-
options->set_watch_identity_pair(!config->certificate_file().empty());
|
|
100
149
|
options->set_certificate_verifier(
|
|
101
150
|
MakeRefCounted<HostNameCertificateVerifier>());
|
|
102
151
|
return MakeRefCounted<TlsCredentials>(std::move(options));
|
|
103
152
|
}
|
|
104
153
|
|
|
105
154
|
private:
|
|
106
|
-
// TODO(roth):
|
|
107
|
-
//
|
|
108
|
-
//
|
|
155
|
+
// TODO(roth): This duplicates a bunch of code from the xDS bootstrap
|
|
156
|
+
// parsing code and the CommonTlsContext parsing code. When we have
|
|
157
|
+
// time, figure out a way to avoid this duplication without causing
|
|
158
|
+
// dependency headaches for CoreConfiguration.
|
|
109
159
|
class TlsConfig : public ChannelCredsConfig {
|
|
110
160
|
public:
|
|
161
|
+
struct CertificateProviderInstance {
|
|
162
|
+
std::string instance_name;
|
|
163
|
+
std::string certificate_name;
|
|
164
|
+
|
|
165
|
+
void PopulateFromProto(
|
|
166
|
+
const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*
|
|
167
|
+
proto,
|
|
168
|
+
const CertificateProviderStoreInterface::PluginDefinitionMap&
|
|
169
|
+
certificate_provider_definitions,
|
|
170
|
+
ValidationErrors* errors) {
|
|
171
|
+
instance_name = UpbStringToStdString(
|
|
172
|
+
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_instance_name(
|
|
173
|
+
proto));
|
|
174
|
+
if (certificate_provider_definitions.find(instance_name) ==
|
|
175
|
+
certificate_provider_definitions.end()) {
|
|
176
|
+
ValidationErrors::ScopedField field(errors, ".instance_name");
|
|
177
|
+
errors->AddError(
|
|
178
|
+
absl::StrCat("unrecognized certificate provider instance name: ",
|
|
179
|
+
instance_name));
|
|
180
|
+
}
|
|
181
|
+
certificate_name = UpbStringToStdString(
|
|
182
|
+
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_certificate_name(
|
|
183
|
+
proto));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
bool operator==(const CertificateProviderInstance& other) const {
|
|
187
|
+
return instance_name == other.instance_name &&
|
|
188
|
+
certificate_name == other.certificate_name;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
std::string ToString() const {
|
|
192
|
+
std::vector<std::string> parts;
|
|
193
|
+
parts.push_back(absl::StrCat("instance_name=\"", instance_name, "\""));
|
|
194
|
+
if (!certificate_name.empty()) {
|
|
195
|
+
parts.push_back(
|
|
196
|
+
absl::StrCat("certificate_name=\"", certificate_name, "\""));
|
|
197
|
+
}
|
|
198
|
+
return absl::StrCat("{", absl::StrJoin(parts, ","), "}");
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
111
202
|
absl::string_view type() const override { return Type(); }
|
|
112
203
|
|
|
204
|
+
absl::string_view proto_type() const override { return ProtoType(); }
|
|
205
|
+
|
|
113
206
|
bool Equals(const ChannelCredsConfig& other) const override {
|
|
114
|
-
auto& o =
|
|
207
|
+
auto& o = DownCast<const TlsConfig&>(other);
|
|
115
208
|
return certificate_file_ == o.certificate_file_ &&
|
|
116
209
|
private_key_file_ == o.private_key_file_ &&
|
|
117
210
|
ca_certificate_file_ == o.ca_certificate_file_ &&
|
|
118
|
-
refresh_interval_ == o.refresh_interval_
|
|
211
|
+
refresh_interval_ == o.refresh_interval_ &&
|
|
212
|
+
root_certificate_provider_ == o.root_certificate_provider_ &&
|
|
213
|
+
identity_certificate_provider_ == o.identity_certificate_provider_;
|
|
119
214
|
}
|
|
120
215
|
|
|
121
216
|
std::string ToString() const override {
|
|
122
217
|
std::vector<std::string> parts;
|
|
123
|
-
Json::Object obj;
|
|
124
|
-
parts.push_back("{");
|
|
125
218
|
if (!certificate_file_.empty()) {
|
|
126
219
|
parts.push_back(absl::StrCat("certificate_file=", certificate_file_));
|
|
127
220
|
}
|
|
@@ -136,8 +229,16 @@ class TlsChannelCredsFactory : public ChannelCredsFactory<> {
|
|
|
136
229
|
parts.push_back(
|
|
137
230
|
absl::StrCat("refresh_interval=", refresh_interval_.ToString()));
|
|
138
231
|
}
|
|
139
|
-
|
|
140
|
-
|
|
232
|
+
if (!root_certificate_provider_.instance_name.empty()) {
|
|
233
|
+
parts.push_back(absl::StrCat("root_cert_provider=",
|
|
234
|
+
root_certificate_provider_.ToString()));
|
|
235
|
+
}
|
|
236
|
+
if (!identity_certificate_provider_.instance_name.empty()) {
|
|
237
|
+
parts.push_back(
|
|
238
|
+
absl::StrCat("identity_cert_provider=",
|
|
239
|
+
identity_certificate_provider_.ToString()));
|
|
240
|
+
}
|
|
241
|
+
return absl::StrCat("{", absl::StrJoin(parts, ","), "}");
|
|
141
242
|
}
|
|
142
243
|
|
|
143
244
|
const std::string& certificate_file() const { return certificate_file_; }
|
|
@@ -147,6 +248,13 @@ class TlsChannelCredsFactory : public ChannelCredsFactory<> {
|
|
|
147
248
|
}
|
|
148
249
|
Duration refresh_interval() const { return refresh_interval_; }
|
|
149
250
|
|
|
251
|
+
const CertificateProviderInstance& root_certificate_provider() const {
|
|
252
|
+
return root_certificate_provider_;
|
|
253
|
+
}
|
|
254
|
+
const CertificateProviderInstance& identity_certificate_provider() const {
|
|
255
|
+
return identity_certificate_provider_;
|
|
256
|
+
}
|
|
257
|
+
|
|
150
258
|
static const JsonLoaderInterface* JsonLoader(const JsonArgs&) {
|
|
151
259
|
static const auto* loader =
|
|
152
260
|
JsonObjectLoader<TlsConfig>()
|
|
@@ -169,16 +277,69 @@ class TlsChannelCredsFactory : public ChannelCredsFactory<> {
|
|
|
169
277
|
}
|
|
170
278
|
}
|
|
171
279
|
|
|
280
|
+
static RefCountedPtr<const TlsConfig> ParseProto(
|
|
281
|
+
absl::string_view serialized_proto,
|
|
282
|
+
const CertificateProviderStoreInterface::PluginDefinitionMap&
|
|
283
|
+
certificate_provider_definitions,
|
|
284
|
+
ValidationErrors* errors) {
|
|
285
|
+
upb::Arena arena;
|
|
286
|
+
const auto* proto =
|
|
287
|
+
envoy_extensions_grpc_service_channel_credentials_tls_v3_TlsCredentials_parse(
|
|
288
|
+
serialized_proto.data(), serialized_proto.size(), arena.ptr());
|
|
289
|
+
if (proto == nullptr) {
|
|
290
|
+
errors->AddError("could not parse channel credentials config");
|
|
291
|
+
return nullptr;
|
|
292
|
+
}
|
|
293
|
+
auto config = MakeRefCounted<TlsConfig>();
|
|
294
|
+
// root_certificate_provider
|
|
295
|
+
{
|
|
296
|
+
ValidationErrors::ScopedField field(errors,
|
|
297
|
+
".root_certificate_provider");
|
|
298
|
+
const auto* root_provider =
|
|
299
|
+
envoy_extensions_grpc_service_channel_credentials_tls_v3_TlsCredentials_root_certificate_provider(
|
|
300
|
+
proto);
|
|
301
|
+
if (root_provider == nullptr) {
|
|
302
|
+
errors->AddError("field not set");
|
|
303
|
+
} else {
|
|
304
|
+
config->root_certificate_provider_.PopulateFromProto(
|
|
305
|
+
root_provider, certificate_provider_definitions, errors);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
// identity_certificate_provider
|
|
309
|
+
{
|
|
310
|
+
ValidationErrors::ScopedField field(errors,
|
|
311
|
+
".identity_certificate_provider");
|
|
312
|
+
const auto* identity_provider =
|
|
313
|
+
envoy_extensions_grpc_service_channel_credentials_tls_v3_TlsCredentials_identity_certificate_provider(
|
|
314
|
+
proto);
|
|
315
|
+
if (identity_provider != nullptr) {
|
|
316
|
+
config->identity_certificate_provider_.PopulateFromProto(
|
|
317
|
+
identity_provider, certificate_provider_definitions, errors);
|
|
318
|
+
}
|
|
319
|
+
return config;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
172
323
|
private:
|
|
173
324
|
static constexpr Duration kDefaultRefreshInterval = Duration::Minutes(10);
|
|
174
325
|
|
|
326
|
+
// Fields populated from xDS bootstrap file.
|
|
175
327
|
std::string certificate_file_;
|
|
176
328
|
std::string private_key_file_;
|
|
177
329
|
std::string ca_certificate_file_;
|
|
178
330
|
Duration refresh_interval_ = kDefaultRefreshInterval;
|
|
331
|
+
|
|
332
|
+
// Fields populated from GrpcService proto credentials extension.
|
|
333
|
+
CertificateProviderInstance root_certificate_provider_;
|
|
334
|
+
CertificateProviderInstance identity_certificate_provider_;
|
|
179
335
|
};
|
|
180
336
|
|
|
181
337
|
static absl::string_view Type() { return "tls"; }
|
|
338
|
+
|
|
339
|
+
static absl::string_view ProtoType() {
|
|
340
|
+
return "envoy.extensions.grpc_service.channel_credentials.tls"
|
|
341
|
+
".v3.TlsCredentials";
|
|
342
|
+
}
|
|
182
343
|
};
|
|
183
344
|
|
|
184
345
|
constexpr Duration TlsChannelCredsFactory::TlsConfig::kDefaultRefreshInterval;
|
|
@@ -186,13 +347,23 @@ constexpr Duration TlsChannelCredsFactory::TlsConfig::kDefaultRefreshInterval;
|
|
|
186
347
|
class InsecureChannelCredsFactory : public ChannelCredsFactory<> {
|
|
187
348
|
public:
|
|
188
349
|
absl::string_view type() const override { return Type(); }
|
|
189
|
-
RefCountedPtr<ChannelCredsConfig> ParseConfig(
|
|
350
|
+
RefCountedPtr<const ChannelCredsConfig> ParseConfig(
|
|
190
351
|
const Json& /*config*/, const JsonArgs& /*args*/,
|
|
191
352
|
ValidationErrors* /*errors*/) const override {
|
|
192
353
|
return MakeRefCounted<Config>();
|
|
193
354
|
}
|
|
355
|
+
absl::string_view proto_type() const override { return ProtoType(); }
|
|
356
|
+
RefCountedPtr<const ChannelCredsConfig> ParseProto(
|
|
357
|
+
absl::string_view /*serialized_config*/,
|
|
358
|
+
const CertificateProviderStoreInterface::PluginDefinitionMap&
|
|
359
|
+
/*certificate_provider_definitions*/,
|
|
360
|
+
ValidationErrors* /*errors*/) const override {
|
|
361
|
+
return MakeRefCounted<Config>();
|
|
362
|
+
}
|
|
194
363
|
RefCountedPtr<grpc_channel_credentials> CreateChannelCreds(
|
|
195
|
-
RefCountedPtr<ChannelCredsConfig> /*config
|
|
364
|
+
RefCountedPtr<const ChannelCredsConfig> /*config*/,
|
|
365
|
+
CertificateProviderStoreInterface& /*certificate_provider_store*/)
|
|
366
|
+
const override {
|
|
196
367
|
return RefCountedPtr<grpc_channel_credentials>(
|
|
197
368
|
grpc_insecure_credentials_create());
|
|
198
369
|
}
|
|
@@ -201,23 +372,149 @@ class InsecureChannelCredsFactory : public ChannelCredsFactory<> {
|
|
|
201
372
|
class Config : public ChannelCredsConfig {
|
|
202
373
|
public:
|
|
203
374
|
absl::string_view type() const override { return Type(); }
|
|
375
|
+
absl::string_view proto_type() const override { return ProtoType(); }
|
|
204
376
|
bool Equals(const ChannelCredsConfig&) const override { return true; }
|
|
205
377
|
std::string ToString() const override { return "{}"; }
|
|
206
378
|
};
|
|
207
379
|
|
|
208
380
|
static absl::string_view Type() { return "insecure"; }
|
|
381
|
+
|
|
382
|
+
static absl::string_view ProtoType() {
|
|
383
|
+
return "envoy.extensions.grpc_service.channel_credentials.insecure"
|
|
384
|
+
".v3.InsecureCredentials";
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
class XdsChannelCredsFactory : public ChannelCredsFactory<> {
|
|
389
|
+
public:
|
|
390
|
+
absl::string_view type() const override { return ""; }
|
|
391
|
+
|
|
392
|
+
RefCountedPtr<const ChannelCredsConfig> ParseConfig(
|
|
393
|
+
const Json& /*config*/, const JsonArgs& /*args*/,
|
|
394
|
+
ValidationErrors* /*errors*/) const override {
|
|
395
|
+
return nullptr;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
absl::string_view proto_type() const override { return ProtoType(); }
|
|
399
|
+
|
|
400
|
+
RefCountedPtr<const ChannelCredsConfig> ParseProto(
|
|
401
|
+
absl::string_view serialized_config,
|
|
402
|
+
const CertificateProviderStoreInterface::PluginDefinitionMap&
|
|
403
|
+
certificate_provider_definitions,
|
|
404
|
+
ValidationErrors* errors) const override {
|
|
405
|
+
return Config::ParseProto(serialized_config,
|
|
406
|
+
certificate_provider_definitions, errors);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
RefCountedPtr<grpc_channel_credentials> CreateChannelCreds(
|
|
410
|
+
RefCountedPtr<const ChannelCredsConfig> config,
|
|
411
|
+
CertificateProviderStoreInterface& certificate_provider_store)
|
|
412
|
+
const override {
|
|
413
|
+
auto fallback_creds =
|
|
414
|
+
CoreConfiguration::Get().channel_creds_registry().CreateChannelCreds(
|
|
415
|
+
DownCast<const Config&>(*config).fallback_credentials(),
|
|
416
|
+
certificate_provider_store);
|
|
417
|
+
return RefCountedPtr<grpc_channel_credentials>(
|
|
418
|
+
grpc_xds_credentials_create(fallback_creds.get()));
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
private:
|
|
422
|
+
class Config : public ChannelCredsConfig {
|
|
423
|
+
public:
|
|
424
|
+
absl::string_view type() const override { return ""; }
|
|
425
|
+
|
|
426
|
+
absl::string_view proto_type() const override { return ProtoType(); }
|
|
427
|
+
|
|
428
|
+
bool Equals(const ChannelCredsConfig& other) const override {
|
|
429
|
+
auto& o = DownCast<const Config&>(other);
|
|
430
|
+
if (fallback_credentials_ == nullptr) {
|
|
431
|
+
return o.fallback_credentials_ == nullptr;
|
|
432
|
+
} else if (o.fallback_credentials_ == nullptr) {
|
|
433
|
+
return false;
|
|
434
|
+
}
|
|
435
|
+
return *fallback_credentials_ == *o.fallback_credentials_;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
std::string ToString() const override {
|
|
439
|
+
return absl::StrCat(
|
|
440
|
+
"{fallback_creds=",
|
|
441
|
+
fallback_credentials_ == nullptr
|
|
442
|
+
? "<null>"
|
|
443
|
+
: absl::StrCat("{type=", fallback_credentials_->type(),
|
|
444
|
+
", config=", fallback_credentials_->ToString(),
|
|
445
|
+
"}"),
|
|
446
|
+
"}");
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
RefCountedPtr<const ChannelCredsConfig> fallback_credentials() const {
|
|
450
|
+
return fallback_credentials_;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
static RefCountedPtr<const Config> ParseProto(
|
|
454
|
+
absl::string_view serialized_proto,
|
|
455
|
+
const CertificateProviderStoreInterface::PluginDefinitionMap&
|
|
456
|
+
certificate_provider_definitions,
|
|
457
|
+
ValidationErrors* errors) {
|
|
458
|
+
upb::Arena arena;
|
|
459
|
+
const auto* proto =
|
|
460
|
+
envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_parse(
|
|
461
|
+
serialized_proto.data(), serialized_proto.size(), arena.ptr());
|
|
462
|
+
if (proto == nullptr) {
|
|
463
|
+
errors->AddError("could not parse channel credentials config");
|
|
464
|
+
return nullptr;
|
|
465
|
+
}
|
|
466
|
+
auto config = MakeRefCounted<Config>();
|
|
467
|
+
ValidationErrors::ScopedField field(errors, ".fallback_credentials");
|
|
468
|
+
const auto* fallback_creds_proto =
|
|
469
|
+
envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_fallback_credentials(
|
|
470
|
+
proto);
|
|
471
|
+
if (fallback_creds_proto == nullptr) {
|
|
472
|
+
errors->AddError("field not set");
|
|
473
|
+
} else {
|
|
474
|
+
absl::string_view type = absl::StripPrefix(
|
|
475
|
+
UpbStringToAbsl(google_protobuf_Any_type_url(fallback_creds_proto)),
|
|
476
|
+
"type.googleapis.com/");
|
|
477
|
+
ValidationErrors::ScopedField field(errors, ".value");
|
|
478
|
+
config->fallback_credentials_ =
|
|
479
|
+
CoreConfiguration::Get().channel_creds_registry().ParseProto(
|
|
480
|
+
type,
|
|
481
|
+
UpbStringToAbsl(
|
|
482
|
+
google_protobuf_Any_value(fallback_creds_proto)),
|
|
483
|
+
certificate_provider_definitions, errors);
|
|
484
|
+
}
|
|
485
|
+
return config;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
private:
|
|
489
|
+
RefCountedPtr<const ChannelCredsConfig> fallback_credentials_;
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
static absl::string_view ProtoType() {
|
|
493
|
+
return "envoy.extensions.grpc_service.channel_credentials.xds.v3"
|
|
494
|
+
".XdsCredentials";
|
|
495
|
+
}
|
|
209
496
|
};
|
|
210
497
|
|
|
211
498
|
class FakeChannelCredsFactory : public ChannelCredsFactory<> {
|
|
212
499
|
public:
|
|
213
500
|
absl::string_view type() const override { return Type(); }
|
|
214
|
-
RefCountedPtr<ChannelCredsConfig> ParseConfig(
|
|
501
|
+
RefCountedPtr<const ChannelCredsConfig> ParseConfig(
|
|
215
502
|
const Json& /*config*/, const JsonArgs& /*args*/,
|
|
216
503
|
ValidationErrors* /*errors*/) const override {
|
|
217
504
|
return MakeRefCounted<Config>();
|
|
218
505
|
}
|
|
506
|
+
absl::string_view proto_type() const override { return ""; }
|
|
507
|
+
RefCountedPtr<const ChannelCredsConfig> ParseProto(
|
|
508
|
+
absl::string_view /*serialized_config*/,
|
|
509
|
+
const CertificateProviderStoreInterface::PluginDefinitionMap&
|
|
510
|
+
/*certificate_provider_definitions*/,
|
|
511
|
+
ValidationErrors* /*errors*/) const override {
|
|
512
|
+
return MakeRefCounted<Config>();
|
|
513
|
+
}
|
|
219
514
|
RefCountedPtr<grpc_channel_credentials> CreateChannelCreds(
|
|
220
|
-
RefCountedPtr<ChannelCredsConfig> /*config
|
|
515
|
+
RefCountedPtr<const ChannelCredsConfig> /*config*/,
|
|
516
|
+
CertificateProviderStoreInterface& /*certificate_provider_store*/)
|
|
517
|
+
const override {
|
|
221
518
|
return RefCountedPtr<grpc_channel_credentials>(
|
|
222
519
|
grpc_fake_transport_security_credentials_create());
|
|
223
520
|
}
|
|
@@ -226,6 +523,7 @@ class FakeChannelCredsFactory : public ChannelCredsFactory<> {
|
|
|
226
523
|
class Config : public ChannelCredsConfig {
|
|
227
524
|
public:
|
|
228
525
|
absl::string_view type() const override { return Type(); }
|
|
526
|
+
absl::string_view proto_type() const override { return ""; }
|
|
229
527
|
bool Equals(const ChannelCredsConfig&) const override { return true; }
|
|
230
528
|
std::string ToString() const override { return "{}"; }
|
|
231
529
|
};
|
|
@@ -240,8 +538,19 @@ void RegisterChannelDefaultCreds(CoreConfiguration::Builder* builder) {
|
|
|
240
538
|
std::make_unique<TlsChannelCredsFactory>());
|
|
241
539
|
builder->channel_creds_registry()->RegisterChannelCredsFactory(
|
|
242
540
|
std::make_unique<InsecureChannelCredsFactory>());
|
|
541
|
+
builder->channel_creds_registry()->RegisterChannelCredsFactory(
|
|
542
|
+
std::make_unique<XdsChannelCredsFactory>());
|
|
243
543
|
builder->channel_creds_registry()->RegisterChannelCredsFactory(
|
|
244
544
|
std::make_unique<FakeChannelCredsFactory>());
|
|
245
545
|
}
|
|
246
546
|
|
|
547
|
+
void RegisterAuthComparators(CoreConfiguration::Builder* builder) {
|
|
548
|
+
builder->auth_context_comparator_registry()->RegisterComparator(
|
|
549
|
+
std::string(grpc_ssl_credentials::Type().name()),
|
|
550
|
+
std::make_unique<absl::AnyInvocable<bool(const grpc_auth_context*,
|
|
551
|
+
const grpc_auth_context*)>>(
|
|
552
|
+
[&](const grpc_auth_context* ctx1, const grpc_auth_context* ctx2)
|
|
553
|
+
-> bool { return SslLeafHashComparator(ctx1, ctx2); }));
|
|
554
|
+
}
|
|
555
|
+
|
|
247
556
|
} // namespace grpc_core
|