grpc 1.58.0 → 1.59.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +48 -33
- data/include/grpc/event_engine/event_engine.h +6 -10
- data/include/grpc/impl/channel_arg_names.h +4 -0
- data/include/grpc/support/port_platform.h +74 -1
- data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +22 -9
- data/src/core/ext/filters/client_channel/client_channel.cc +422 -56
- data/src/core/ext/filters/client_channel/client_channel.h +52 -8
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +15 -1
- data/src/core/ext/filters/client_channel/dynamic_filters.h +2 -0
- data/src/core/ext/filters/client_channel/{http_proxy.cc → http_proxy_mapper.cc} +1 -1
- data/src/core/ext/filters/client_channel/{http_proxy.h → http_proxy_mapper.h} +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/endpoint_list.cc +188 -0
- data/src/core/ext/filters/client_channel/lb_policy/endpoint_list.h +214 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +17 -4
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc +41 -6
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client_internal.h +5 -3
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +32 -103
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +0 -7
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +416 -139
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.h +16 -0
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +434 -459
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +410 -26
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +14 -46
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +851 -57
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +16 -10
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +47 -32
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +55 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +105 -175
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +14 -7
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +24 -6
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +36 -2
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +54 -44
- data/src/core/ext/filters/client_channel/subchannel.cc +33 -0
- data/src/core/ext/filters/client_channel/subchannel.h +9 -0
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +11 -6
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +28 -22
- data/src/core/ext/transport/chttp2/transport/flow_control.h +27 -4
- data/src/core/ext/transport/chttp2/transport/frame_data.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +9 -0
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +19 -10
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +3 -1
- data/src/core/ext/transport/chttp2/transport/internal.h +66 -47
- data/src/core/ext/transport/chttp2/transport/{frame.h → legacy_frame.h} +3 -3
- data/src/core/ext/transport/chttp2/transport/parsing.cc +4 -2
- data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc +10 -0
- data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.h +4 -0
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/writing.cc +2 -1
- data/src/core/ext/transport/inproc/inproc_transport.cc +9 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +16 -18
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +75 -83
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +27 -29
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +102 -110
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +16 -18
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +73 -81
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c +65 -67
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h +294 -302
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +20 -28
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +24 -32
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +42 -44
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +141 -149
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +4 -12
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +36 -38
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +157 -165
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +87 -89
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +372 -380
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +13 -15
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +55 -63
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +111 -113
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +441 -449
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +23 -25
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +88 -96
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +40 -42
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +180 -188
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +26 -28
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +108 -116
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +9 -17
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +65 -67
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +245 -253
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +27 -29
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +119 -127
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +6 -14
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +20 -28
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +49 -51
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +184 -192
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +49 -51
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +225 -233
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +63 -65
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +246 -254
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +30 -38
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +28 -36
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +9 -17
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +12 -14
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +48 -56
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +23 -25
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +92 -100
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +27 -29
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +108 -116
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +5 -13
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +38 -40
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +167 -175
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +34 -36
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +162 -170
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +10 -12
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +37 -45
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +18 -26
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +22 -24
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +97 -105
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +24 -26
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +111 -119
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +43 -45
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +183 -191
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +20 -22
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +102 -110
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +253 -255
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +1108 -1116
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +31 -39
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +35 -37
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +150 -158
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +14 -16
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +53 -61
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +5 -13
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +24 -32
- data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +23 -31
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +23 -31
- data/src/core/ext/upb-generated/envoy/data/accesslog/v3/accesslog.upb.c +114 -116
- data/src/core/ext/upb-generated/envoy/data/accesslog/v3/accesslog.upb.h +372 -380
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +9 -17
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +30 -38
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +21 -23
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +81 -89
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +24 -32
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +12 -14
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +52 -60
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +14 -22
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +114 -116
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +468 -476
- data/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h +5 -13
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +25 -33
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c +11 -13
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +40 -48
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.h +4 -12
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +27 -35
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +5 -13
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +35 -37
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +165 -173
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +9 -11
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +32 -40
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +39 -41
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +169 -177
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +16 -24
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +55 -57
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +241 -249
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +31 -39
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +23 -25
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +98 -106
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +11 -19
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +18 -26
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h +9 -17
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +16 -24
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +24 -32
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +6 -14
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +20 -28
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +33 -41
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +18 -26
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +31 -39
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +34 -42
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +14 -16
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +47 -55
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +4 -12
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.h +20 -28
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +12 -20
- data/src/core/ext/upb-generated/google/api/annotations.upb.c +2 -4
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +1 -9
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +45 -47
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +190 -198
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +54 -56
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +210 -218
- data/src/core/ext/upb-generated/google/api/http.upb.c +15 -17
- data/src/core/ext/upb-generated/google/api/http.upb.h +60 -68
- data/src/core/ext/upb-generated/google/api/httpbody.upb.c +4 -6
- data/src/core/ext/upb-generated/google/api/httpbody.upb.h +15 -23
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +3 -5
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +7 -15
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +359 -204
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +1340 -760
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +3 -5
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +7 -15
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +1 -3
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +1 -9
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +11 -13
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +43 -51
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +3 -5
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +7 -15
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +10 -12
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +28 -36
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +4 -6
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +15 -23
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +11 -13
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +35 -43
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +10 -12
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +28 -36
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +48 -50
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +190 -198
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +5 -7
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +15 -23
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +3 -5
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +7 -15
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +21 -23
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +80 -88
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +9 -11
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +29 -37
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +32 -34
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +147 -155
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +10 -12
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +13 -21
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +4 -6
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +7 -15
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +2 -4
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +1 -9
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +4 -6
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +7 -15
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +3 -5
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +4 -12
- data/src/core/ext/upb-generated/validate/validate.upb.c +201 -203
- data/src/core/ext/upb-generated/validate/validate.upb.h +924 -932
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +10 -12
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +13 -21
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +4 -6
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +7 -15
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +2 -4
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +1 -9
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +9 -11
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +16 -24
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +4 -12
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +2 -4
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +4 -12
- data/src/core/ext/upb-generated/xds/core/v3/cidr.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/core/v3/cidr.upb.h +8 -16
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +6 -8
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +20 -28
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +4 -6
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +9 -17
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +8 -16
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +4 -6
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +12 -20
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +9 -11
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +35 -43
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +5 -7
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +14 -22
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +16 -18
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +43 -51
- data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h +13 -21
- data/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.c +2 -4
- data/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.h +5 -13
- data/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.c +4 -6
- data/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.h +21 -29
- data/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.c +1 -3
- data/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.h +1 -9
- data/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.c +5 -7
- data/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.h +24 -32
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +24 -26
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +103 -111
- data/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.c +10 -12
- data/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.h +61 -69
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +9 -17
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +8 -10
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +33 -41
- data/src/core/ext/upb-generated/xds/type/v3/cel.upb.c +5 -7
- data/src/core/ext/upb-generated/xds/type/v3/cel.upb.h +18 -26
- data/src/core/ext/upb-generated/xds/type/v3/range.upb.c +7 -9
- data/src/core/ext/upb-generated/xds/type/v3/range.upb.h +19 -27
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +8 -16
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +367 -290
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +10 -0
- data/src/core/ext/xds/xds_client.cc +6 -9
- data/src/core/ext/xds/xds_client.h +2 -2
- data/src/core/ext/xds/xds_cluster.cc +30 -42
- data/src/core/ext/xds/xds_cluster.h +0 -4
- data/src/core/ext/xds/xds_endpoint.cc +12 -19
- data/src/core/ext/xds/xds_endpoint.h +0 -1
- data/src/core/ext/xds/xds_http_filters.cc +1 -4
- data/src/core/ext/xds/xds_http_stateful_session_filter.cc +1 -4
- data/src/core/ext/xds/xds_listener.cc +14 -14
- data/src/core/ext/xds/xds_listener.h +13 -3
- data/src/core/ext/xds/xds_resource_type.h +1 -7
- data/src/core/ext/xds/xds_resource_type_impl.h +9 -11
- data/src/core/ext/xds/xds_route_config.cc +10 -11
- data/src/core/ext/xds/xds_route_config.h +1 -1
- data/src/core/ext/xds/xds_server_config_fetcher.cc +53 -28
- data/src/core/ext/xds/xds_transport_grpc.cc +11 -1
- data/src/core/lib/backoff/random_early_detection.cc +4 -2
- data/src/core/lib/backoff/random_early_detection.h +2 -4
- data/src/core/lib/channel/call_tracer.cc +7 -1
- data/src/core/lib/channel/call_tracer.h +4 -1
- data/src/core/lib/channel/channelz_registry.h +4 -2
- data/src/core/lib/channel/connected_channel.cc +1 -1
- data/src/core/lib/config/config_vars.h +1 -1
- data/src/core/lib/config/core_configuration.cc +2 -1
- data/src/core/lib/config/core_configuration.h +5 -4
- data/src/core/lib/debug/stats_data.cc +146 -51
- data/src/core/lib/debug/stats_data.h +81 -20
- data/src/core/lib/event_engine/ares_resolver.cc +9 -0
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +3 -0
- data/src/core/lib/event_engine/cf_engine/cf_engine.h +3 -0
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +3 -0
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +3 -0
- data/src/core/lib/event_engine/cf_engine/cftype_unique_ref.h +3 -0
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +15 -3
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +3 -0
- data/src/core/lib/event_engine/nameser.h +102 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +1 -1
- data/src/core/lib/event_engine/thread_pool/thread_count.h +15 -0
- data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +3 -15
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +10 -4
- data/src/core/lib/experiments/config.cc +9 -1
- data/src/core/lib/experiments/experiments.cc +409 -144
- data/src/core/lib/experiments/experiments.h +153 -39
- data/src/core/lib/gprpp/fork.h +1 -1
- data/src/core/lib/gprpp/manual_constructor.h +1 -2
- data/src/core/lib/gprpp/no_destruct.h +1 -1
- data/src/core/lib/gprpp/per_cpu.cc +2 -0
- data/src/core/lib/gprpp/per_cpu.h +36 -7
- data/src/core/lib/gprpp/ref_counted_ptr.h +63 -0
- data/src/core/lib/gprpp/work_serializer.cc +297 -25
- data/src/core/lib/gprpp/work_serializer.h +25 -9
- data/src/core/lib/iomgr/combiner.cc +54 -15
- data/src/core/lib/iomgr/combiner.h +8 -3
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +2 -4
- data/src/core/lib/iomgr/exec_ctx.cc +12 -0
- data/src/core/lib/iomgr/exec_ctx.h +55 -19
- data/src/core/lib/iomgr/polling_entity.cc +10 -0
- data/src/core/lib/iomgr/polling_entity.h +2 -0
- data/src/core/lib/iomgr/port.h +14 -0
- data/src/core/lib/iomgr/tcp_posix.cc +17 -14
- data/src/core/lib/load_balancing/lb_policy.h +10 -9
- data/src/core/lib/promise/arena_promise.h +5 -1
- data/src/core/lib/promise/detail/seq_state.h +418 -0
- data/src/core/lib/promise/latch.h +1 -0
- data/src/core/lib/promise/loop.h +8 -5
- data/src/core/lib/promise/pipe.h +24 -24
- data/src/core/lib/promise/poll.h +4 -6
- data/src/core/lib/resolver/server_address.h +1 -0
- data/src/core/lib/resource_quota/memory_quota.cc +58 -2
- data/src/core/lib/resource_quota/memory_quota.h +4 -1
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +115 -9
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +14 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_match.cc +86 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +0 -59
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +2 -0
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +7 -57
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +1 -1
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +2 -14
- data/src/core/lib/slice/slice.h +6 -0
- data/src/core/lib/slice/slice_buffer.cc +15 -0
- data/src/core/lib/slice/slice_buffer.h +16 -4
- data/src/core/lib/slice/slice_refcount.h +1 -1
- data/src/core/lib/surface/call.cc +92 -34
- data/src/core/lib/surface/call.h +4 -0
- data/src/core/lib/surface/channel.cc +7 -4
- data/src/core/lib/surface/channel_init.h +3 -2
- data/src/core/lib/surface/server.cc +45 -5
- data/src/core/lib/surface/server.h +18 -6
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/batch_builder.cc +3 -5
- data/src/core/lib/transport/metadata_batch.cc +6 -0
- data/src/core/lib/transport/metadata_batch.h +20 -1
- data/src/core/lib/transport/parsed_metadata.h +2 -4
- data/src/core/lib/transport/simple_slice_based_metadata.h +1 -2
- data/src/core/lib/transport/transport.h +21 -11
- data/src/core/tsi/ssl_transport_security.cc +7 -0
- data/src/core/tsi/ssl_transport_security.h +4 -0
- data/src/ruby/ext/grpc/extconf.rb +1 -1
- data/src/ruby/ext/grpc/rb_channel_args.c +6 -4
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +4 -1
- data/third_party/abseil-cpp/absl/random/bit_gen_ref.h +185 -0
- data/third_party/upb/upb/collections/array.c +6 -0
- data/third_party/upb/upb/collections/array.h +6 -0
- data/third_party/upb/upb/collections/map.c +7 -0
- data/third_party/upb/upb/collections/map.h +5 -0
- data/third_party/upb/upb/collections/map_sorter_internal.h +1 -1
- data/third_party/upb/upb/collections/message_value.h +8 -1
- data/third_party/upb/upb/generated_code_support.h +54 -0
- data/third_party/upb/upb/hash/common.c +5 -0
- data/third_party/upb/upb/hash/common.h +1 -0
- data/third_party/upb/upb/hash/str_table.h +1 -0
- data/third_party/upb/upb/message/accessors.c +25 -1
- data/third_party/upb/upb/message/accessors.h +46 -25
- data/third_party/upb/upb/message/accessors_internal.h +69 -3
- data/third_party/upb/upb/message/extension_internal.h +1 -1
- data/third_party/upb/upb/message/internal/map_entry.h +64 -0
- data/third_party/upb/upb/message/internal.h +2 -6
- data/third_party/upb/upb/message/message.c +0 -6
- data/third_party/upb/upb/message/message.h +1 -1
- data/third_party/upb/upb/message/tagged_ptr.h +89 -0
- data/third_party/upb/upb/mini_descriptor/build_enum.c +150 -0
- data/third_party/upb/upb/mini_descriptor/build_enum.h +63 -0
- data/third_party/upb/upb/{mini_table → mini_descriptor}/decode.c +122 -374
- data/third_party/upb/upb/{mini_table → mini_descriptor}/decode.h +11 -50
- data/third_party/upb/upb/mini_descriptor/internal/base92.c +46 -0
- data/third_party/upb/upb/mini_descriptor/internal/base92.h +81 -0
- data/third_party/upb/upb/mini_descriptor/internal/decoder.h +73 -0
- data/third_party/upb/upb/{mini_table → mini_descriptor/internal}/encode.c +58 -32
- data/third_party/upb/upb/{mini_table/encode_internal.h → mini_descriptor/internal/encode.h} +3 -4
- data/third_party/upb/upb/{mini_table/encode_internal.hpp → mini_descriptor/internal/encode.hpp} +1 -1
- data/third_party/upb/upb/mini_descriptor/internal/modifiers.h +50 -0
- data/third_party/upb/upb/{mini_table/common_internal.h → mini_descriptor/internal/wire_constants.h} +3 -23
- data/third_party/upb/upb/mini_descriptor/link.c +142 -0
- data/third_party/upb/upb/mini_descriptor/link.h +104 -0
- data/third_party/upb/upb/mini_table/{types.h → enum.h} +19 -9
- data/third_party/upb/upb/mini_table/extension.h +40 -0
- data/third_party/upb/upb/mini_table/extension_registry.c +1 -1
- data/third_party/upb/upb/mini_table/extension_registry.h +2 -1
- data/third_party/upb/upb/mini_table/field.h +118 -0
- data/third_party/upb/upb/{json_decode.h → mini_table/file.h} +5 -6
- data/third_party/upb/upb/mini_table/{enum_internal.h → internal/enum.h} +7 -19
- data/third_party/upb/upb/mini_table/{extension_internal.h → internal/extension.h} +8 -8
- data/third_party/upb/upb/mini_table/{field_internal.h → internal/field.h} +10 -66
- data/third_party/upb/upb/mini_table/{file_internal.h → internal/file.h} +6 -4
- data/third_party/upb/upb/mini_table/internal/message.c +39 -0
- data/third_party/upb/upb/mini_table/{message_internal.h → internal/message.h} +14 -37
- data/third_party/upb/upb/mini_table/{sub_internal.h → internal/sub.h} +7 -6
- data/third_party/upb/upb/mini_table/{common.c → message.c} +2 -33
- data/third_party/upb/upb/mini_table/{common.h → message.h} +12 -77
- data/third_party/upb/upb/{json_encode.h → mini_table/sub.h} +5 -6
- data/third_party/upb/upb/reflection/def.hpp +16 -4
- data/third_party/upb/upb/reflection/def_pool_internal.h +1 -1
- data/third_party/upb/upb/reflection/desc_state_internal.h +1 -1
- data/third_party/upb/upb/reflection/enum_def.c +1 -1
- data/third_party/upb/upb/reflection/field_def.c +2 -1
- data/third_party/upb/upb/reflection/message.c +2 -2
- data/third_party/upb/upb/reflection/message_def.c +3 -1
- data/third_party/upb/upb/wire/decode.c +68 -29
- data/third_party/upb/upb/wire/decode.h +40 -0
- data/third_party/upb/upb/wire/encode.c +23 -13
- metadata +44 -27
- data/src/core/lib/event_engine/thread_pool/original_thread_pool.cc +0 -256
- data/src/core/lib/event_engine/thread_pool/original_thread_pool.h +0 -137
@@ -44,6 +44,7 @@ class Latch {
|
|
44
44
|
public:
|
45
45
|
Latch() = default;
|
46
46
|
Latch(const Latch&) = delete;
|
47
|
+
explicit Latch(T value) : value_(std::move(value)), has_value_(true) {}
|
47
48
|
Latch& operator=(const Latch&) = delete;
|
48
49
|
Latch(Latch&& other) noexcept
|
49
50
|
: value_(std::move(other.value_)), has_value_(other.has_value_) {
|
data/src/core/lib/promise/loop.h
CHANGED
@@ -54,9 +54,9 @@ struct LoopTraits<absl::StatusOr<LoopCtl<T>>> {
|
|
54
54
|
using Result = absl::StatusOr<T>;
|
55
55
|
static LoopCtl<Result> ToLoopCtl(absl::StatusOr<LoopCtl<T>> value) {
|
56
56
|
if (!value.ok()) return value.status();
|
57
|
-
|
57
|
+
auto& inner = *value;
|
58
58
|
if (absl::holds_alternative<Continue>(inner)) return Continue{};
|
59
|
-
return absl::get<T>(inner);
|
59
|
+
return absl::get<T>(std::move(inner));
|
60
60
|
}
|
61
61
|
};
|
62
62
|
|
@@ -87,7 +87,10 @@ class Loop {
|
|
87
87
|
if (started_) Destruct(&promise_);
|
88
88
|
}
|
89
89
|
|
90
|
-
Loop(Loop&& loop) noexcept
|
90
|
+
Loop(Loop&& loop) noexcept
|
91
|
+
: factory_(std::move(loop.factory_)), started_(loop.started_) {
|
92
|
+
if (started_) Construct(&promise_, std::move(loop.promise_));
|
93
|
+
}
|
91
94
|
|
92
95
|
Loop(const Loop& loop) = delete;
|
93
96
|
Loop& operator=(const Loop& loop) = delete;
|
@@ -104,14 +107,14 @@ class Loop {
|
|
104
107
|
if (auto* p = promise_result.value_if_ready()) {
|
105
108
|
// - then if it's Continue, destroy the promise and recreate a new one
|
106
109
|
// from our factory.
|
107
|
-
auto lc = LoopTraits<PromiseResult>::ToLoopCtl(*p);
|
110
|
+
auto lc = LoopTraits<PromiseResult>::ToLoopCtl(std::move(*p));
|
108
111
|
if (absl::holds_alternative<Continue>(lc)) {
|
109
112
|
Destruct(&promise_);
|
110
113
|
Construct(&promise_, factory_.Make());
|
111
114
|
continue;
|
112
115
|
}
|
113
116
|
// - otherwise there's our result... return it out.
|
114
|
-
return absl::get<Result>(lc);
|
117
|
+
return absl::get<Result>(std::move(lc));
|
115
118
|
} else {
|
116
119
|
// Otherwise the inner promise was pending, so we are pending.
|
117
120
|
return Pending();
|
data/src/core/lib/promise/pipe.h
CHANGED
@@ -541,7 +541,9 @@ class Next {
|
|
541
541
|
Next(Next&& other) noexcept = default;
|
542
542
|
Next& operator=(Next&& other) noexcept = default;
|
543
543
|
|
544
|
-
Poll<absl::optional<T>> operator()() {
|
544
|
+
Poll<absl::optional<T>> operator()() {
|
545
|
+
return center_ == nullptr ? absl::nullopt : center_->Next();
|
546
|
+
}
|
545
547
|
|
546
548
|
private:
|
547
549
|
friend class PipeReceiver<T>;
|
@@ -572,29 +574,27 @@ class PipeReceiver {
|
|
572
574
|
// Blocks the promise until the receiver is either closed or a message is
|
573
575
|
// available.
|
574
576
|
auto Next() {
|
575
|
-
return Seq(
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
[cancelled]() { return NextResult<T>(cancelled); });
|
597
|
-
});
|
577
|
+
return Seq(pipe_detail::Next<T>(center_), [center = center_](
|
578
|
+
absl::optional<T> value) {
|
579
|
+
bool open = value.has_value();
|
580
|
+
bool cancelled = center == nullptr ? true : center->cancelled();
|
581
|
+
return If(
|
582
|
+
open,
|
583
|
+
[center = std::move(center), value = std::move(value)]() mutable {
|
584
|
+
auto run = center->Run(std::move(value));
|
585
|
+
return Map(std::move(run), [center = std::move(center)](
|
586
|
+
absl::optional<T> value) mutable {
|
587
|
+
if (value.has_value()) {
|
588
|
+
center->value() = std::move(*value);
|
589
|
+
return NextResult<T>(std::move(center));
|
590
|
+
} else {
|
591
|
+
center->MarkCancelled();
|
592
|
+
return NextResult<T>(true);
|
593
|
+
}
|
594
|
+
});
|
595
|
+
},
|
596
|
+
[cancelled]() { return NextResult<T>(cancelled); });
|
597
|
+
});
|
598
598
|
}
|
599
599
|
|
600
600
|
// Return a promise that resolves when the receiver is closed.
|
data/src/core/lib/promise/poll.h
CHANGED
@@ -29,15 +29,13 @@ namespace grpc_core {
|
|
29
29
|
// A type that signals a Promise is still pending and not yet completed.
|
30
30
|
// Allows writing 'return Pending{}' and with automatic conversions gets
|
31
31
|
// upgraded to a Poll<> object.
|
32
|
-
struct Pending {
|
33
|
-
|
34
|
-
};
|
32
|
+
struct Pending {};
|
33
|
+
inline bool operator==(const Pending&, const Pending&) { return true; }
|
35
34
|
|
36
35
|
// A type that contains no value. Useful for simulating 'void' in promises that
|
37
36
|
// always need to return some kind of value.
|
38
|
-
struct Empty {
|
39
|
-
|
40
|
-
};
|
37
|
+
struct Empty {};
|
38
|
+
inline bool operator==(const Empty&, const Empty&) { return true; }
|
41
39
|
|
42
40
|
// The result of polling a Promise once.
|
43
41
|
//
|
@@ -58,6 +58,7 @@ class ServerAddress {
|
|
58
58
|
ServerAddress& operator=(ServerAddress&& other) noexcept;
|
59
59
|
|
60
60
|
bool operator==(const ServerAddress& other) const { return Cmp(other) == 0; }
|
61
|
+
bool operator<(const ServerAddress& other) const { return Cmp(other) < 0; }
|
61
62
|
|
62
63
|
int Cmp(const ServerAddress& other) const;
|
63
64
|
|
@@ -37,12 +37,60 @@
|
|
37
37
|
|
38
38
|
namespace grpc_core {
|
39
39
|
|
40
|
+
namespace {
|
40
41
|
// Maximum number of bytes an allocator will request from a quota in one step.
|
41
42
|
// Larger allocations than this will require multiple allocation requests.
|
42
|
-
|
43
|
+
constexpr size_t kMaxReplenishBytes = 1024 * 1024;
|
43
44
|
|
44
45
|
// Minimum number of bytes an allocator will request from a quota in one step.
|
45
|
-
|
46
|
+
constexpr size_t kMinReplenishBytes = 4096;
|
47
|
+
|
48
|
+
class MemoryQuotaTracker {
|
49
|
+
public:
|
50
|
+
static MemoryQuotaTracker& Get() {
|
51
|
+
static MemoryQuotaTracker* tracker = new MemoryQuotaTracker();
|
52
|
+
return *tracker;
|
53
|
+
}
|
54
|
+
|
55
|
+
void Add(std::shared_ptr<BasicMemoryQuota> quota) {
|
56
|
+
MutexLock lock(&mu_);
|
57
|
+
// Common usage is that we only create a few (one or two) quotas.
|
58
|
+
// We'd like to ensure that we don't OOM if more are added - and
|
59
|
+
// using a weak_ptr here, whilst nicely braindead, does run that
|
60
|
+
// risk.
|
61
|
+
// If usage patterns change sufficiently we'll likely want to
|
62
|
+
// change this class to have a more sophisticated data structure
|
63
|
+
// and probably a Remove() method.
|
64
|
+
GatherAndGarbageCollect();
|
65
|
+
quotas_.push_back(quota);
|
66
|
+
}
|
67
|
+
|
68
|
+
std::vector<std::shared_ptr<BasicMemoryQuota>> All() {
|
69
|
+
MutexLock lock(&mu_);
|
70
|
+
return GatherAndGarbageCollect();
|
71
|
+
}
|
72
|
+
|
73
|
+
private:
|
74
|
+
MemoryQuotaTracker() {}
|
75
|
+
|
76
|
+
std::vector<std::shared_ptr<BasicMemoryQuota>> GatherAndGarbageCollect()
|
77
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
|
78
|
+
std::vector<std::weak_ptr<BasicMemoryQuota>> new_quotas;
|
79
|
+
std::vector<std::shared_ptr<BasicMemoryQuota>> all_quotas;
|
80
|
+
for (const auto& quota : quotas_) {
|
81
|
+
auto p = quota.lock();
|
82
|
+
if (p == nullptr) continue;
|
83
|
+
new_quotas.push_back(quota);
|
84
|
+
all_quotas.push_back(p);
|
85
|
+
}
|
86
|
+
quotas_.swap(new_quotas);
|
87
|
+
return all_quotas;
|
88
|
+
}
|
89
|
+
|
90
|
+
Mutex mu_;
|
91
|
+
std::vector<std::weak_ptr<BasicMemoryQuota>> quotas_ ABSL_GUARDED_BY(mu_);
|
92
|
+
};
|
93
|
+
} // namespace
|
46
94
|
|
47
95
|
//
|
48
96
|
// Reclaimer
|
@@ -314,9 +362,13 @@ class BasicMemoryQuota::WaitForSweepPromise {
|
|
314
362
|
uint64_t token_;
|
315
363
|
};
|
316
364
|
|
365
|
+
BasicMemoryQuota::BasicMemoryQuota(std::string name) : name_(std::move(name)) {}
|
366
|
+
|
317
367
|
void BasicMemoryQuota::Start() {
|
318
368
|
auto self = shared_from_this();
|
319
369
|
|
370
|
+
MemoryQuotaTracker::Get().Add(self);
|
371
|
+
|
320
372
|
// Reclamation loop:
|
321
373
|
// basically, wait until we are in overcommit (free_bytes_ < 0), and then:
|
322
374
|
// while (free_bytes_ < 0) reclaim_memory()
|
@@ -695,4 +747,8 @@ MemoryOwner MemoryQuota::CreateMemoryOwner(absl::string_view name) {
|
|
695
747
|
return MemoryOwner(std::move(impl));
|
696
748
|
}
|
697
749
|
|
750
|
+
std::vector<std::shared_ptr<BasicMemoryQuota>> AllMemoryQuotas() {
|
751
|
+
return MemoryQuotaTracker::Get().All();
|
752
|
+
}
|
753
|
+
|
698
754
|
} // namespace grpc_core
|
@@ -26,6 +26,7 @@
|
|
26
26
|
#include <memory>
|
27
27
|
#include <string>
|
28
28
|
#include <utility>
|
29
|
+
#include <vector>
|
29
30
|
|
30
31
|
#include "absl/base/thread_annotations.h"
|
31
32
|
#include "absl/container/flat_hash_set.h"
|
@@ -296,7 +297,7 @@ class BasicMemoryQuota final
|
|
296
297
|
size_t max_recommended_allocation_size = 0;
|
297
298
|
};
|
298
299
|
|
299
|
-
explicit BasicMemoryQuota(std::string name)
|
300
|
+
explicit BasicMemoryQuota(std::string name);
|
300
301
|
|
301
302
|
// Start the reclamation activity.
|
302
303
|
void Start();
|
@@ -586,6 +587,8 @@ inline MemoryQuotaRefPtr MakeMemoryQuota(std::string name) {
|
|
586
587
|
return std::make_shared<MemoryQuota>(std::move(name));
|
587
588
|
}
|
588
589
|
|
590
|
+
std::vector<std::shared_ptr<BasicMemoryQuota>> AllMemoryQuotas();
|
591
|
+
|
589
592
|
} // namespace grpc_core
|
590
593
|
|
591
594
|
#endif // GRPC_SRC_CORE_LIB_RESOURCE_QUOTA_MEMORY_QUOTA_H
|
@@ -39,6 +39,7 @@
|
|
39
39
|
#include "src/core/lib/surface/api_trace.h"
|
40
40
|
#include "src/core/tsi/ssl/session_cache/ssl_session_cache.h"
|
41
41
|
#include "src/core/tsi/ssl_transport_security.h"
|
42
|
+
#include "src/core/tsi/transport_security_interface.h"
|
42
43
|
|
43
44
|
//
|
44
45
|
// SSL Channel Credentials.
|
@@ -48,6 +49,26 @@ grpc_ssl_credentials::grpc_ssl_credentials(
|
|
48
49
|
const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
|
49
50
|
const grpc_ssl_verify_peer_options* verify_options) {
|
50
51
|
build_config(pem_root_certs, pem_key_cert_pair, verify_options);
|
52
|
+
// Use default (e.g. OS) root certificates if the user did not pass any root
|
53
|
+
// certificates.
|
54
|
+
if (config_.pem_root_certs == nullptr) {
|
55
|
+
const char* pem_root_certs =
|
56
|
+
grpc_core::DefaultSslRootStore::GetPemRootCerts();
|
57
|
+
if (pem_root_certs == nullptr) {
|
58
|
+
gpr_log(GPR_ERROR, "Could not get default pem root certs.");
|
59
|
+
} else {
|
60
|
+
char* default_roots = gpr_strdup(pem_root_certs);
|
61
|
+
config_.pem_root_certs = default_roots;
|
62
|
+
root_store_ = grpc_core::DefaultSslRootStore::GetRootStore();
|
63
|
+
}
|
64
|
+
} else {
|
65
|
+
config_.pem_root_certs = config_.pem_root_certs;
|
66
|
+
root_store_ = nullptr;
|
67
|
+
}
|
68
|
+
|
69
|
+
client_handshaker_initialization_status_ = InitializeClientHandshakerFactory(
|
70
|
+
&config_, config_.pem_root_certs, root_store_, nullptr,
|
71
|
+
&client_handshaker_factory_);
|
51
72
|
}
|
52
73
|
|
53
74
|
grpc_ssl_credentials::~grpc_ssl_credentials() {
|
@@ -57,26 +78,67 @@ grpc_ssl_credentials::~grpc_ssl_credentials() {
|
|
57
78
|
config_.verify_options.verify_peer_destruct(
|
58
79
|
config_.verify_options.verify_peer_callback_userdata);
|
59
80
|
}
|
81
|
+
tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory_);
|
60
82
|
}
|
61
83
|
|
62
84
|
grpc_core::RefCountedPtr<grpc_channel_security_connector>
|
63
85
|
grpc_ssl_credentials::create_security_connector(
|
64
86
|
grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
|
65
87
|
const char* target, grpc_core::ChannelArgs* args) {
|
88
|
+
if (config_.pem_root_certs == nullptr) {
|
89
|
+
gpr_log(GPR_ERROR,
|
90
|
+
"No root certs in config. Client-side security connector must have "
|
91
|
+
"root certs.");
|
92
|
+
return nullptr;
|
93
|
+
}
|
66
94
|
absl::optional<std::string> overridden_target_name =
|
67
95
|
args->GetOwnedString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG);
|
68
96
|
auto* ssl_session_cache = args->GetObject<tsi::SslSessionLRUCache>();
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
97
|
+
tsi_ssl_session_cache* session_cache =
|
98
|
+
ssl_session_cache == nullptr ? nullptr : ssl_session_cache->c_ptr();
|
99
|
+
|
100
|
+
grpc_core::RefCountedPtr<grpc_channel_security_connector> security_connector =
|
101
|
+
nullptr;
|
102
|
+
if (session_cache != nullptr) {
|
103
|
+
// We need a separate factory and SSL_CTX if there's a cache in the channel
|
104
|
+
// args. SSL_CTX should live with the factory and that should live on the
|
105
|
+
// credentials. However, there is a way to configure a session cache in the
|
106
|
+
// channel args, so that prevents us from also keeping the session cache at
|
107
|
+
// the credentials level. In the case of a session cache, we still need to
|
108
|
+
// keep a separate factory and SSL_CTX at the subchannel/security_connector
|
109
|
+
// level.
|
110
|
+
tsi_ssl_client_handshaker_factory* factory_with_cache = nullptr;
|
111
|
+
grpc_security_status status = InitializeClientHandshakerFactory(
|
112
|
+
&config_, config_.pem_root_certs, root_store_, session_cache,
|
113
|
+
&factory_with_cache);
|
114
|
+
if (status != GRPC_SECURITY_OK) {
|
115
|
+
gpr_log(GPR_ERROR,
|
116
|
+
"InitializeClientHandshakerFactory returned bad "
|
117
|
+
"status.");
|
118
|
+
return nullptr;
|
119
|
+
}
|
120
|
+
security_connector = grpc_ssl_channel_security_connector_create(
|
121
|
+
this->Ref(), std::move(call_creds), &config_, target,
|
122
|
+
overridden_target_name.has_value() ? overridden_target_name->c_str()
|
123
|
+
: nullptr,
|
124
|
+
factory_with_cache);
|
125
|
+
tsi_ssl_client_handshaker_factory_unref(factory_with_cache);
|
126
|
+
} else {
|
127
|
+
if (client_handshaker_initialization_status_ != GRPC_SECURITY_OK) {
|
128
|
+
return nullptr;
|
129
|
+
}
|
130
|
+
security_connector = grpc_ssl_channel_security_connector_create(
|
131
|
+
this->Ref(), std::move(call_creds), &config_, target,
|
132
|
+
overridden_target_name.has_value() ? overridden_target_name->c_str()
|
133
|
+
: nullptr,
|
134
|
+
client_handshaker_factory_);
|
135
|
+
}
|
136
|
+
|
137
|
+
if (security_connector == nullptr) {
|
138
|
+
return security_connector;
|
77
139
|
}
|
78
140
|
*args = args->Set(GRPC_ARG_HTTP2_SCHEME, "https");
|
79
|
-
return
|
141
|
+
return security_connector;
|
80
142
|
}
|
81
143
|
|
82
144
|
grpc_core::UniqueTypeName grpc_ssl_credentials::Type() {
|
@@ -119,6 +181,50 @@ void grpc_ssl_credentials::set_max_tls_version(
|
|
119
181
|
config_.max_tls_version = max_tls_version;
|
120
182
|
}
|
121
183
|
|
184
|
+
grpc_security_status grpc_ssl_credentials::InitializeClientHandshakerFactory(
|
185
|
+
const grpc_ssl_config* config, const char* pem_root_certs,
|
186
|
+
const tsi_ssl_root_certs_store* root_store,
|
187
|
+
tsi_ssl_session_cache* ssl_session_cache,
|
188
|
+
tsi_ssl_client_handshaker_factory** handshaker_factory) {
|
189
|
+
// This class level factory can't have a session cache by design. If we want
|
190
|
+
// to init one with a cache we need to make a new one
|
191
|
+
if (client_handshaker_factory_ != nullptr && ssl_session_cache == nullptr) {
|
192
|
+
return GRPC_SECURITY_OK;
|
193
|
+
}
|
194
|
+
|
195
|
+
bool has_key_cert_pair = config->pem_key_cert_pair != nullptr &&
|
196
|
+
config->pem_key_cert_pair->private_key != nullptr &&
|
197
|
+
config->pem_key_cert_pair->cert_chain != nullptr;
|
198
|
+
tsi_ssl_client_handshaker_options options;
|
199
|
+
if (pem_root_certs == nullptr) {
|
200
|
+
gpr_log(
|
201
|
+
GPR_ERROR,
|
202
|
+
"Handshaker factory creation failed. pem_root_certs cannot be nullptr");
|
203
|
+
return GRPC_SECURITY_ERROR;
|
204
|
+
}
|
205
|
+
options.pem_root_certs = pem_root_certs;
|
206
|
+
options.root_store = root_store;
|
207
|
+
options.alpn_protocols =
|
208
|
+
grpc_fill_alpn_protocol_strings(&options.num_alpn_protocols);
|
209
|
+
if (has_key_cert_pair) {
|
210
|
+
options.pem_key_cert_pair = config->pem_key_cert_pair;
|
211
|
+
}
|
212
|
+
options.cipher_suites = grpc_get_ssl_cipher_suites();
|
213
|
+
options.session_cache = ssl_session_cache;
|
214
|
+
options.min_tls_version = grpc_get_tsi_tls_version(config->min_tls_version);
|
215
|
+
options.max_tls_version = grpc_get_tsi_tls_version(config->max_tls_version);
|
216
|
+
const tsi_result result =
|
217
|
+
tsi_create_ssl_client_handshaker_factory_with_options(&options,
|
218
|
+
handshaker_factory);
|
219
|
+
gpr_free(options.alpn_protocols);
|
220
|
+
if (result != TSI_OK) {
|
221
|
+
gpr_log(GPR_ERROR, "Handshaker factory creation failed with %s.",
|
222
|
+
tsi_result_to_string(result));
|
223
|
+
return GRPC_SECURITY_ERROR;
|
224
|
+
}
|
225
|
+
return GRPC_SECURITY_OK;
|
226
|
+
}
|
227
|
+
|
122
228
|
// Deprecated in favor of grpc_ssl_credentials_create_ex. Will be removed
|
123
229
|
// once all of its call sites are migrated to grpc_ssl_credentials_create_ex.
|
124
230
|
grpc_channel_credentials* grpc_ssl_credentials_create(
|
@@ -69,7 +69,21 @@ class grpc_ssl_credentials : public grpc_channel_credentials {
|
|
69
69
|
grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
|
70
70
|
const grpc_ssl_verify_peer_options* verify_options);
|
71
71
|
|
72
|
+
// InitializeClientHandshakerFactory constructs a client handshaker factory
|
73
|
+
// that is stored on this credentials object. This handshaker factory will be
|
74
|
+
// used when creating handshakers using these credentials except in the case
|
75
|
+
// that there is a session cache. If a session cache is used, a new handshaker
|
76
|
+
// factory will be created and used that contains that session cache.
|
77
|
+
grpc_security_status InitializeClientHandshakerFactory(
|
78
|
+
const grpc_ssl_config* config, const char* pem_root_certs,
|
79
|
+
const tsi_ssl_root_certs_store* root_store,
|
80
|
+
tsi_ssl_session_cache* ssl_session_cache,
|
81
|
+
tsi_ssl_client_handshaker_factory** handshaker_factory);
|
82
|
+
|
72
83
|
grpc_ssl_config config_;
|
84
|
+
tsi_ssl_client_handshaker_factory* client_handshaker_factory_ = nullptr;
|
85
|
+
const tsi_ssl_root_certs_store* root_store_ = nullptr;
|
86
|
+
grpc_security_status client_handshaker_initialization_status_;
|
73
87
|
};
|
74
88
|
|
75
89
|
struct grpc_ssl_server_certificate_config {
|
@@ -0,0 +1,86 @@
|
|
1
|
+
//
|
2
|
+
// Copyright 2020 gRPC authors.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
15
|
+
//
|
16
|
+
|
17
|
+
#include <grpc/support/port_platform.h>
|
18
|
+
|
19
|
+
#include <openssl/bio.h>
|
20
|
+
#include <openssl/crypto.h>
|
21
|
+
#include <openssl/evp.h>
|
22
|
+
#include <openssl/pem.h>
|
23
|
+
#include <openssl/x509.h>
|
24
|
+
|
25
|
+
#include "absl/status/status.h"
|
26
|
+
#include "absl/status/statusor.h"
|
27
|
+
#include "absl/strings/string_view.h"
|
28
|
+
|
29
|
+
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
|
30
|
+
|
31
|
+
namespace grpc_core {
|
32
|
+
|
33
|
+
absl::StatusOr<bool> PrivateKeyAndCertificateMatch(
|
34
|
+
absl::string_view private_key, absl::string_view cert_chain) {
|
35
|
+
if (private_key.empty()) {
|
36
|
+
return absl::InvalidArgumentError("Private key string is empty.");
|
37
|
+
}
|
38
|
+
if (cert_chain.empty()) {
|
39
|
+
return absl::InvalidArgumentError("Certificate string is empty.");
|
40
|
+
}
|
41
|
+
BIO* cert_bio =
|
42
|
+
BIO_new_mem_buf(cert_chain.data(), static_cast<int>(cert_chain.size()));
|
43
|
+
if (cert_bio == nullptr) {
|
44
|
+
return absl::InvalidArgumentError(
|
45
|
+
"Conversion from certificate string to BIO failed.");
|
46
|
+
}
|
47
|
+
// Reads the first cert from the cert_chain which is expected to be the leaf
|
48
|
+
// cert
|
49
|
+
X509* x509 = PEM_read_bio_X509(cert_bio, nullptr, nullptr, nullptr);
|
50
|
+
BIO_free(cert_bio);
|
51
|
+
if (x509 == nullptr) {
|
52
|
+
return absl::InvalidArgumentError(
|
53
|
+
"Conversion from PEM string to X509 failed.");
|
54
|
+
}
|
55
|
+
EVP_PKEY* public_evp_pkey = X509_get_pubkey(x509);
|
56
|
+
X509_free(x509);
|
57
|
+
if (public_evp_pkey == nullptr) {
|
58
|
+
return absl::InvalidArgumentError(
|
59
|
+
"Extraction of public key from x.509 certificate failed.");
|
60
|
+
}
|
61
|
+
BIO* private_key_bio =
|
62
|
+
BIO_new_mem_buf(private_key.data(), static_cast<int>(private_key.size()));
|
63
|
+
if (private_key_bio == nullptr) {
|
64
|
+
EVP_PKEY_free(public_evp_pkey);
|
65
|
+
return absl::InvalidArgumentError(
|
66
|
+
"Conversion from private key string to BIO failed.");
|
67
|
+
}
|
68
|
+
EVP_PKEY* private_evp_pkey =
|
69
|
+
PEM_read_bio_PrivateKey(private_key_bio, nullptr, nullptr, nullptr);
|
70
|
+
BIO_free(private_key_bio);
|
71
|
+
if (private_evp_pkey == nullptr) {
|
72
|
+
EVP_PKEY_free(public_evp_pkey);
|
73
|
+
return absl::InvalidArgumentError(
|
74
|
+
"Conversion from PEM string to EVP_PKEY failed.");
|
75
|
+
}
|
76
|
+
#if OPENSSL_VERSION_NUMBER < 0x30000000L
|
77
|
+
bool result = EVP_PKEY_cmp(private_evp_pkey, public_evp_pkey) == 1;
|
78
|
+
#else
|
79
|
+
bool result = EVP_PKEY_eq(private_evp_pkey, public_evp_pkey) == 1;
|
80
|
+
#endif
|
81
|
+
EVP_PKEY_free(private_evp_pkey);
|
82
|
+
EVP_PKEY_free(public_evp_pkey);
|
83
|
+
return result;
|
84
|
+
}
|
85
|
+
|
86
|
+
} // namespace grpc_core
|
@@ -25,12 +25,6 @@
|
|
25
25
|
#include <utility>
|
26
26
|
#include <vector>
|
27
27
|
|
28
|
-
#include <openssl/bio.h>
|
29
|
-
#include <openssl/crypto.h>
|
30
|
-
#include <openssl/evp.h>
|
31
|
-
#include <openssl/pem.h>
|
32
|
-
#include <openssl/x509.h>
|
33
|
-
|
34
28
|
#include "absl/status/status.h"
|
35
29
|
|
36
30
|
#include <grpc/slice.h>
|
@@ -394,59 +388,6 @@ int64_t FileWatcherCertificateProvider::TestOnlyGetRefreshIntervalSecond()
|
|
394
388
|
return refresh_interval_sec_;
|
395
389
|
}
|
396
390
|
|
397
|
-
absl::StatusOr<bool> PrivateKeyAndCertificateMatch(
|
398
|
-
absl::string_view private_key, absl::string_view cert_chain) {
|
399
|
-
if (private_key.empty()) {
|
400
|
-
return absl::InvalidArgumentError("Private key string is empty.");
|
401
|
-
}
|
402
|
-
if (cert_chain.empty()) {
|
403
|
-
return absl::InvalidArgumentError("Certificate string is empty.");
|
404
|
-
}
|
405
|
-
BIO* cert_bio =
|
406
|
-
BIO_new_mem_buf(cert_chain.data(), static_cast<int>(cert_chain.size()));
|
407
|
-
if (cert_bio == nullptr) {
|
408
|
-
return absl::InvalidArgumentError(
|
409
|
-
"Conversion from certificate string to BIO failed.");
|
410
|
-
}
|
411
|
-
// Reads the first cert from the cert_chain which is expected to be the leaf
|
412
|
-
// cert
|
413
|
-
X509* x509 = PEM_read_bio_X509(cert_bio, nullptr, nullptr, nullptr);
|
414
|
-
BIO_free(cert_bio);
|
415
|
-
if (x509 == nullptr) {
|
416
|
-
return absl::InvalidArgumentError(
|
417
|
-
"Conversion from PEM string to X509 failed.");
|
418
|
-
}
|
419
|
-
EVP_PKEY* public_evp_pkey = X509_get_pubkey(x509);
|
420
|
-
X509_free(x509);
|
421
|
-
if (public_evp_pkey == nullptr) {
|
422
|
-
return absl::InvalidArgumentError(
|
423
|
-
"Extraction of public key from x.509 certificate failed.");
|
424
|
-
}
|
425
|
-
BIO* private_key_bio =
|
426
|
-
BIO_new_mem_buf(private_key.data(), static_cast<int>(private_key.size()));
|
427
|
-
if (private_key_bio == nullptr) {
|
428
|
-
EVP_PKEY_free(public_evp_pkey);
|
429
|
-
return absl::InvalidArgumentError(
|
430
|
-
"Conversion from private key string to BIO failed.");
|
431
|
-
}
|
432
|
-
EVP_PKEY* private_evp_pkey =
|
433
|
-
PEM_read_bio_PrivateKey(private_key_bio, nullptr, nullptr, nullptr);
|
434
|
-
BIO_free(private_key_bio);
|
435
|
-
if (private_evp_pkey == nullptr) {
|
436
|
-
EVP_PKEY_free(public_evp_pkey);
|
437
|
-
return absl::InvalidArgumentError(
|
438
|
-
"Conversion from PEM string to EVP_PKEY failed.");
|
439
|
-
}
|
440
|
-
#if OPENSSL_VERSION_NUMBER < 0x30000000L
|
441
|
-
bool result = EVP_PKEY_cmp(private_evp_pkey, public_evp_pkey) == 1;
|
442
|
-
#else
|
443
|
-
bool result = EVP_PKEY_eq(private_evp_pkey, public_evp_pkey) == 1;
|
444
|
-
#endif
|
445
|
-
EVP_PKEY_free(private_evp_pkey);
|
446
|
-
EVP_PKEY_free(public_evp_pkey);
|
447
|
-
return result;
|
448
|
-
}
|
449
|
-
|
450
391
|
} // namespace grpc_core
|
451
392
|
|
452
393
|
/// -- Wrapper APIs declared in grpc_security.h -- *
|
@@ -50,6 +50,8 @@ struct grpc_tls_certificate_verifier
|
|
50
50
|
absl::Status* sync_status) = 0;
|
51
51
|
// Operations that will be performed when a request is cancelled.
|
52
52
|
// This is only needed when in async mode.
|
53
|
+
// TODO(roth): This needs to take an absl::Status argument so that we
|
54
|
+
// can pass the cancellation status through to the check_peer callback.
|
53
55
|
virtual void Cancel(grpc_tls_custom_verification_check_request* request) = 0;
|
54
56
|
|
55
57
|
// Compares this grpc_tls_certificate_verifier object with \a other.
|