grpc 1.37.0.pre1 → 1.39.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +96 -59
- data/include/grpc/event_engine/README.md +38 -0
- data/include/grpc/event_engine/endpoint_config.h +48 -0
- data/include/grpc/event_engine/event_engine.h +334 -0
- data/include/grpc/event_engine/port.h +41 -0
- data/include/grpc/event_engine/slice_allocator.h +91 -0
- data/include/grpc/grpc.h +11 -4
- data/include/grpc/grpc_security.h +32 -0
- data/include/grpc/grpc_security_constants.h +15 -0
- data/include/grpc/impl/codegen/grpc_types.h +28 -13
- data/include/grpc/impl/codegen/port_platform.h +22 -0
- data/include/grpc/module.modulemap +14 -14
- data/src/core/ext/filters/client_channel/backup_poller.cc +3 -3
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +177 -202
- data/src/core/ext/filters/client_channel/client_channel.cc +630 -3103
- data/src/core/ext/filters/client_channel/client_channel.h +489 -55
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +1 -1
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +4 -1
- data/src/core/ext/filters/client_channel/config_selector.h +1 -1
- data/src/core/ext/filters/client_channel/connector.h +1 -1
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +9 -10
- data/src/core/ext/filters/client_channel/dynamic_filters.h +3 -3
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +28 -27
- data/src/core/ext/filters/client_channel/health/health_check_client.h +30 -29
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +24 -21
- data/src/core/ext/filters/client_channel/http_proxy.cc +16 -1
- data/src/core/ext/filters/client_channel/lb_policy.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy.h +4 -4
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +6 -6
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +46 -43
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +2 -1
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +5 -5
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +14 -12
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +755 -0
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +10 -0
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +4 -4
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +15 -15
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +46 -54
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +23 -23
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +31 -46
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +146 -155
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +4 -4
- data/src/core/ext/filters/client_channel/lb_policy_registry.h +1 -1
- data/src/core/ext/filters/client_channel/resolver.h +2 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +24 -18
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc +31 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +2 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +14 -14
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +33 -24
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc +28 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +18 -12
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +20 -28
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +7 -5
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +20 -13
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +60 -32
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +32 -239
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +20 -49
- data/src/core/ext/filters/client_channel/retry_filter.cc +2449 -0
- data/src/core/ext/filters/client_channel/retry_filter.h +30 -0
- data/src/core/ext/filters/client_channel/retry_service_config.cc +306 -0
- data/src/core/ext/filters/client_channel/retry_service_config.h +96 -0
- data/src/core/ext/filters/client_channel/server_address.cc +1 -1
- data/src/core/ext/filters/client_channel/service_config.cc +15 -14
- data/src/core/ext/filters/client_channel/service_config.h +7 -6
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +5 -4
- data/src/core/ext/filters/client_channel/service_config_parser.cc +6 -6
- data/src/core/ext/filters/client_channel/service_config_parser.h +7 -4
- data/src/core/ext/filters/client_channel/subchannel.cc +17 -16
- data/src/core/ext/filters/client_channel/subchannel.h +7 -6
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +17 -16
- data/src/core/ext/filters/deadline/deadline_filter.cc +10 -10
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +46 -34
- data/src/core/ext/filters/fault_injection/service_config_parser.cc +5 -5
- data/src/core/ext/filters/fault_injection/service_config_parser.h +1 -1
- data/src/core/ext/filters/http/client/http_client_filter.cc +28 -21
- data/src/core/ext/filters/http/client_authority_filter.cc +3 -3
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +23 -22
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +21 -21
- data/src/core/ext/filters/http/server/http_server_filter.cc +27 -23
- data/src/core/ext/filters/max_age/max_age_filter.cc +12 -10
- data/src/core/ext/filters/message_size/message_size_filter.cc +14 -11
- data/src/core/ext/filters/message_size/message_size_filter.h +1 -1
- data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +4 -3
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +7 -7
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +7 -7
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +2 -2
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +3 -2
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +3 -3
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +44 -45
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +2 -2
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +3 -4
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +5 -4
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +3 -4
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +139 -120
- data/src/core/ext/transport/chttp2/transport/context_list.cc +4 -5
- data/src/core/ext/transport/chttp2/transport/context_list.h +4 -4
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +3 -3
- data/src/core/ext/transport/chttp2/transport/flow_control.h +8 -8
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +8 -8
- data/src/core/ext/transport/chttp2/transport/frame_data.h +10 -10
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +7 -8
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +6 -6
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +7 -8
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +7 -6
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +7 -7
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +6 -6
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +6 -5
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +6 -6
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +4 -6
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +4 -6
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +237 -208
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +10 -10
- data/src/core/ext/transport/chttp2/transport/hpack_table.cc +4 -3
- data/src/core/ext/transport/chttp2/transport/hpack_table.h +4 -4
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +2 -2
- data/src/core/ext/transport/chttp2/transport/internal.h +32 -27
- data/src/core/ext/transport/chttp2/transport/parsing.cc +65 -58
- data/src/core/ext/transport/chttp2/transport/writing.cc +7 -3
- data/src/core/ext/transport/inproc/inproc_transport.cc +72 -60
- data/src/core/ext/xds/certificate_provider_factory.h +1 -1
- data/src/core/ext/xds/certificate_provider_store.h +3 -3
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +3 -3
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +2 -2
- data/src/core/ext/xds/xds_api.cc +349 -200
- data/src/core/ext/xds/xds_api.h +21 -12
- data/src/core/ext/xds/xds_bootstrap.cc +97 -159
- data/src/core/ext/xds/xds_bootstrap.h +19 -24
- data/src/core/ext/xds/xds_certificate_provider.cc +4 -4
- data/src/core/ext/xds/xds_certificate_provider.h +4 -4
- data/src/core/ext/xds/xds_channel_args.h +5 -2
- data/src/core/ext/xds/xds_client.cc +310 -178
- data/src/core/ext/xds/xds_client.h +41 -27
- data/src/core/ext/xds/xds_client_stats.h +3 -2
- data/src/core/ext/xds/xds_server_config_fetcher.cc +34 -20
- data/src/core/lib/{iomgr → address_utils}/parse_address.cc +17 -17
- data/src/core/lib/{iomgr → address_utils}/parse_address.h +7 -7
- data/src/core/lib/{iomgr → address_utils}/sockaddr_utils.cc +16 -20
- data/src/core/lib/{iomgr → address_utils}/sockaddr_utils.h +16 -11
- data/src/core/lib/channel/channel_stack.cc +10 -9
- data/src/core/lib/channel/channel_stack.h +10 -9
- data/src/core/lib/channel/channel_stack_builder.cc +2 -2
- data/src/core/lib/channel/channel_stack_builder.h +1 -1
- data/src/core/lib/channel/channelz.cc +21 -13
- data/src/core/lib/channel/channelz.h +3 -0
- data/src/core/lib/channel/connected_channel.cc +4 -4
- data/src/core/lib/channel/handshaker.cc +7 -6
- data/src/core/lib/channel/handshaker.h +5 -5
- data/src/core/lib/event_engine/endpoint_config.cc +46 -0
- data/src/core/lib/event_engine/endpoint_config_internal.h +42 -0
- data/src/core/lib/event_engine/event_engine.cc +50 -0
- data/src/core/lib/event_engine/slice_allocator.cc +89 -0
- data/src/core/lib/event_engine/sockaddr.cc +40 -0
- data/src/core/lib/event_engine/sockaddr.h +44 -0
- data/src/core/lib/gpr/wrap_memcpy.cc +2 -1
- data/src/core/lib/gprpp/ref_counted.h +28 -14
- data/src/core/lib/gprpp/status_helper.cc +407 -0
- data/src/core/lib/gprpp/status_helper.h +183 -0
- data/src/core/lib/http/httpcli.cc +11 -11
- data/src/core/lib/http/httpcli_security_connector.cc +11 -7
- data/src/core/lib/http/parser.cc +16 -16
- data/src/core/lib/http/parser.h +4 -4
- data/src/core/lib/iomgr/buffer_list.cc +7 -9
- data/src/core/lib/iomgr/buffer_list.h +4 -5
- data/src/core/lib/iomgr/call_combiner.cc +15 -12
- data/src/core/lib/iomgr/call_combiner.h +12 -14
- data/src/core/lib/iomgr/cfstream_handle.cc +3 -3
- data/src/core/lib/iomgr/cfstream_handle.h +1 -1
- data/src/core/lib/iomgr/closure.h +7 -6
- data/src/core/lib/iomgr/combiner.cc +14 -12
- data/src/core/lib/iomgr/combiner.h +2 -2
- data/src/core/lib/iomgr/endpoint.cc +1 -1
- data/src/core/lib/iomgr/endpoint.h +2 -2
- data/src/core/lib/iomgr/endpoint_cfstream.cc +11 -13
- data/src/core/lib/iomgr/endpoint_pair_event_engine.cc +33 -0
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +1 -1
- data/src/core/lib/iomgr/error.cc +168 -61
- data/src/core/lib/iomgr/error.h +217 -106
- data/src/core/lib/iomgr/error_cfstream.cc +3 -2
- data/src/core/lib/iomgr/error_cfstream.h +2 -2
- data/src/core/lib/iomgr/error_internal.h +5 -1
- data/src/core/lib/iomgr/ev_apple.cc +5 -5
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +19 -19
- data/src/core/lib/iomgr/ev_epollex_linux.cc +48 -45
- data/src/core/lib/iomgr/ev_poll_posix.cc +26 -23
- data/src/core/lib/iomgr/ev_posix.cc +9 -8
- data/src/core/lib/iomgr/ev_posix.h +9 -9
- data/src/core/lib/iomgr/event_engine/closure.cc +54 -0
- data/src/core/lib/iomgr/event_engine/closure.h +33 -0
- data/src/core/lib/iomgr/event_engine/endpoint.cc +194 -0
- data/src/core/lib/iomgr/event_engine/endpoint.h +53 -0
- data/src/core/lib/iomgr/event_engine/iomgr.cc +105 -0
- data/src/core/lib/iomgr/event_engine/iomgr.h +24 -0
- data/src/core/lib/iomgr/event_engine/pollset.cc +87 -0
- data/src/core/lib/iomgr/event_engine/pollset.h +25 -0
- data/src/core/lib/iomgr/event_engine/promise.h +51 -0
- data/src/core/lib/iomgr/event_engine/resolved_address_internal.cc +41 -0
- data/src/core/lib/iomgr/event_engine/resolved_address_internal.h +35 -0
- data/src/core/lib/iomgr/event_engine/resolver.cc +110 -0
- data/src/core/lib/iomgr/event_engine/tcp.cc +243 -0
- data/src/core/lib/iomgr/event_engine/timer.cc +57 -0
- data/src/core/lib/iomgr/exec_ctx.cc +12 -4
- data/src/core/lib/iomgr/exec_ctx.h +4 -5
- data/src/core/lib/iomgr/executor.cc +8 -8
- data/src/core/lib/iomgr/executor.h +2 -2
- data/src/core/lib/iomgr/executor/threadpool.cc +2 -3
- data/src/core/lib/iomgr/executor/threadpool.h +2 -2
- data/src/core/lib/iomgr/iomgr.cc +2 -2
- data/src/core/lib/iomgr/iomgr.h +1 -1
- data/src/core/lib/iomgr/iomgr_custom.cc +1 -1
- data/src/core/lib/iomgr/iomgr_internal.cc +2 -2
- data/src/core/lib/iomgr/iomgr_internal.h +3 -3
- data/src/core/lib/iomgr/iomgr_posix.cc +3 -1
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +42 -12
- data/src/core/lib/iomgr/iomgr_windows.cc +1 -1
- data/src/core/lib/iomgr/load_file.cc +4 -4
- data/src/core/lib/iomgr/load_file.h +2 -2
- data/src/core/lib/iomgr/lockfree_event.cc +5 -5
- data/src/core/lib/iomgr/lockfree_event.h +1 -1
- data/src/core/lib/iomgr/pollset.cc +5 -5
- data/src/core/lib/iomgr/pollset.h +9 -9
- data/src/core/lib/iomgr/pollset_custom.cc +7 -7
- data/src/core/lib/iomgr/pollset_custom.h +3 -1
- data/src/core/lib/iomgr/pollset_uv.cc +3 -1
- data/src/core/lib/iomgr/pollset_uv.h +5 -1
- data/src/core/lib/iomgr/pollset_windows.cc +5 -5
- data/src/core/lib/iomgr/port.h +7 -5
- data/src/core/lib/iomgr/python_util.h +1 -1
- data/src/core/lib/iomgr/resolve_address.cc +8 -4
- data/src/core/lib/iomgr/resolve_address.h +12 -6
- data/src/core/lib/iomgr/resolve_address_custom.cc +10 -9
- data/src/core/lib/iomgr/resolve_address_custom.h +3 -3
- data/src/core/lib/iomgr/resolve_address_posix.cc +3 -3
- data/src/core/lib/iomgr/resolve_address_windows.cc +4 -4
- data/src/core/lib/iomgr/resource_quota.cc +11 -10
- data/src/core/lib/iomgr/sockaddr.h +1 -0
- data/src/core/lib/iomgr/socket_mutator.cc +15 -2
- data/src/core/lib/iomgr/socket_mutator.h +26 -2
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +24 -22
- data/src/core/lib/iomgr/socket_utils_posix.h +20 -20
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +4 -4
- data/src/core/lib/iomgr/tcp_client_custom.cc +5 -6
- data/src/core/lib/iomgr/tcp_client_posix.cc +22 -19
- data/src/core/lib/iomgr/tcp_client_posix.h +3 -4
- data/src/core/lib/iomgr/tcp_client_windows.cc +5 -5
- data/src/core/lib/iomgr/tcp_custom.cc +14 -16
- data/src/core/lib/iomgr/tcp_custom.h +13 -12
- data/src/core/lib/iomgr/tcp_posix.cc +78 -73
- data/src/core/lib/iomgr/tcp_posix.h +8 -0
- data/src/core/lib/iomgr/tcp_server.cc +6 -6
- data/src/core/lib/iomgr/tcp_server.h +12 -11
- data/src/core/lib/iomgr/tcp_server_custom.cc +26 -25
- data/src/core/lib/iomgr/tcp_server_posix.cc +28 -21
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +13 -12
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +21 -18
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +9 -9
- data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc +4 -4
- data/src/core/lib/iomgr/tcp_server_windows.cc +26 -25
- data/src/core/lib/iomgr/tcp_uv.cc +25 -23
- data/src/core/lib/iomgr/tcp_windows.cc +13 -13
- data/src/core/lib/iomgr/tcp_windows.h +2 -2
- data/src/core/lib/iomgr/timer.h +6 -1
- data/src/core/lib/iomgr/timer_custom.cc +2 -1
- data/src/core/lib/iomgr/timer_custom.h +1 -1
- data/src/core/lib/iomgr/timer_generic.cc +6 -6
- data/src/core/lib/iomgr/udp_server.cc +21 -20
- data/src/core/lib/iomgr/unix_sockets_posix.cc +3 -3
- data/src/core/lib/iomgr/unix_sockets_posix.h +2 -2
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +10 -7
- data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +3 -3
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +4 -4
- data/src/core/lib/iomgr/wakeup_fd_posix.cc +3 -3
- data/src/core/lib/iomgr/wakeup_fd_posix.h +8 -6
- data/src/core/lib/iomgr/work_serializer.h +17 -1
- data/src/core/lib/json/json.h +1 -1
- data/src/core/lib/json/json_reader.cc +4 -4
- data/src/core/lib/matchers/matchers.cc +39 -39
- data/src/core/lib/matchers/matchers.h +28 -28
- data/src/core/lib/security/authorization/authorization_engine.h +44 -0
- data/src/core/lib/security/authorization/authorization_policy_provider.h +32 -0
- data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +46 -0
- data/src/core/lib/security/authorization/evaluate_args.cc +209 -0
- data/src/core/lib/security/authorization/evaluate_args.h +91 -0
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +4 -4
- data/src/core/lib/security/credentials/composite/composite_credentials.h +2 -2
- data/src/core/lib/security/credentials/credentials.h +2 -2
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +17 -13
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +13 -11
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +2 -1
- data/src/core/lib/security/credentials/external/aws_request_signer.h +1 -1
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +15 -12
- data/src/core/lib/security/credentials/external/external_account_credentials.h +9 -8
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +5 -4
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +4 -3
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +8 -8
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +9 -7
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +2 -2
- data/src/core/lib/security/credentials/fake/fake_credentials.h +2 -2
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +12 -10
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +2 -2
- data/src/core/lib/security/credentials/iam/iam_credentials.h +2 -2
- data/src/core/lib/security/credentials/jwt/json_token.cc +2 -2
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +3 -3
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +2 -2
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +7 -5
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +21 -19
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +5 -5
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +5 -5
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +2 -2
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +8 -7
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +9 -9
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +19 -13
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +4 -0
- data/src/core/lib/security/credentials/tls/tls_utils.cc +32 -0
- data/src/core/lib/security/credentials/tls/tls_utils.h +13 -0
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +3 -3
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +13 -3
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +13 -3
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +2 -2
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +12 -2
- data/src/core/lib/security/security_connector/load_system_roots_linux.cc +1 -1
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +22 -9
- data/src/core/lib/security/security_connector/security_connector.h +9 -4
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +16 -6
- data/src/core/lib/security/security_connector/ssl_utils.cc +27 -4
- data/src/core/lib/security/security_connector/ssl_utils.h +4 -4
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +56 -60
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +66 -48
- data/src/core/lib/security/transport/client_auth_filter.cc +18 -10
- data/src/core/lib/security/transport/secure_endpoint.cc +4 -4
- data/src/core/lib/security/transport/security_handshaker.cc +33 -32
- data/src/core/lib/security/transport/server_auth_filter.cc +24 -11
- data/src/core/lib/security/transport/tsi_error.cc +2 -1
- data/src/core/lib/security/transport/tsi_error.h +2 -1
- data/src/core/lib/security/util/json_util.cc +2 -2
- data/src/core/lib/security/util/json_util.h +1 -1
- data/src/core/lib/surface/call.cc +67 -46
- data/src/core/lib/surface/call.h +13 -2
- data/src/core/lib/surface/channel.cc +6 -6
- data/src/core/lib/surface/channel.h +3 -2
- data/src/core/lib/surface/channel_ping.cc +1 -1
- data/src/core/lib/surface/completion_queue.cc +68 -69
- data/src/core/lib/surface/completion_queue.h +3 -2
- data/src/core/lib/surface/completion_queue_factory.cc +1 -2
- data/src/core/lib/surface/init.cc +1 -3
- data/src/core/lib/surface/init.h +10 -1
- data/src/core/lib/surface/lame_client.cc +11 -11
- data/src/core/lib/surface/lame_client.h +1 -1
- data/src/core/lib/surface/server.cc +28 -22
- data/src/core/lib/surface/server.h +16 -15
- data/src/core/lib/surface/validate_metadata.cc +7 -7
- data/src/core/lib/surface/validate_metadata.h +3 -2
- data/src/core/lib/surface/version.cc +4 -2
- data/src/core/lib/transport/byte_stream.cc +5 -5
- data/src/core/lib/transport/byte_stream.h +8 -8
- data/src/core/lib/transport/connectivity_state.cc +1 -1
- data/src/core/lib/transport/error_utils.cc +21 -10
- data/src/core/lib/transport/error_utils.h +11 -5
- data/src/core/lib/transport/metadata_batch.cc +37 -37
- data/src/core/lib/transport/metadata_batch.h +19 -18
- data/src/core/lib/transport/transport.cc +4 -3
- data/src/core/lib/transport/transport.h +6 -4
- data/src/core/lib/transport/transport_op_string.cc +6 -6
- data/src/core/plugin_registry/grpc_plugin_registry.cc +4 -0
- data/src/core/tsi/alts/crypt/gsec.h +6 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +5 -4
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +7 -6
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +2 -1
- data/src/core/tsi/ssl_transport_security.cc +32 -14
- data/src/core/tsi/ssl_transport_security.h +3 -4
- data/src/ruby/bin/math_services_pb.rb +1 -1
- data/src/ruby/ext/grpc/extconf.rb +2 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +6 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +11 -2
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/v1/health_services_pb.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb +6 -6
- data/third_party/abseil-cpp/absl/algorithm/container.h +3 -3
- data/third_party/abseil-cpp/absl/base/attributes.h +24 -4
- data/third_party/abseil-cpp/absl/base/call_once.h +2 -9
- data/third_party/abseil-cpp/absl/base/config.h +37 -9
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +24 -10
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +4 -1
- data/third_party/abseil-cpp/absl/base/internal/endian.h +61 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h +2 -3
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +34 -32
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +16 -6
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +11 -2
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +14 -5
- data/third_party/abseil-cpp/absl/base/internal/spinlock_akaros.inc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +3 -3
- data/third_party/abseil-cpp/absl/base/internal/spinlock_posix.inc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h +11 -11
- data/third_party/abseil-cpp/absl/base/internal/spinlock_win32.inc +5 -5
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +1 -1
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +5 -2
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +43 -42
- data/third_party/abseil-cpp/absl/base/internal/throw_delegate.cc +111 -7
- data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +0 -76
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +1 -3
- data/third_party/abseil-cpp/absl/base/log_severity.h +4 -4
- data/third_party/abseil-cpp/absl/base/macros.h +11 -0
- data/third_party/abseil-cpp/absl/base/optimization.h +10 -7
- data/third_party/abseil-cpp/absl/base/options.h +1 -1
- data/third_party/abseil-cpp/absl/base/port.h +0 -1
- data/third_party/abseil-cpp/absl/base/thread_annotations.h +1 -1
- data/third_party/abseil-cpp/absl/container/fixed_array.h +2 -2
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +5 -3
- data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +1 -1
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +5 -1
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +2 -1
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_force_weak_definition.cc +2 -1
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +141 -66
- data/third_party/abseil-cpp/absl/container/internal/layout.h +4 -4
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +14 -1
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +136 -136
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +16 -12
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +5 -2
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +3 -12
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +6 -1
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +3 -5
- data/third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc +2 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +2 -2
- data/third_party/abseil-cpp/absl/hash/internal/city.cc +15 -12
- data/third_party/abseil-cpp/absl/hash/internal/city.h +1 -19
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +25 -10
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +86 -37
- data/third_party/abseil-cpp/absl/hash/internal/wyhash.cc +111 -0
- data/third_party/abseil-cpp/absl/hash/internal/wyhash.h +48 -0
- data/third_party/abseil-cpp/absl/meta/type_traits.h +16 -2
- data/third_party/abseil-cpp/absl/numeric/bits.h +177 -0
- data/third_party/abseil-cpp/absl/numeric/int128.cc +3 -3
- data/third_party/abseil-cpp/absl/numeric/internal/bits.h +358 -0
- data/third_party/abseil-cpp/absl/numeric/internal/representation.h +55 -0
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +18 -0
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +4 -7
- data/third_party/abseil-cpp/absl/status/status.cc +29 -22
- data/third_party/abseil-cpp/absl/status/status.h +81 -20
- data/third_party/abseil-cpp/absl/status/statusor.h +3 -3
- data/third_party/abseil-cpp/absl/strings/charconv.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/cord.cc +326 -371
- data/third_party/abseil-cpp/absl/strings/cord.h +182 -64
- data/third_party/abseil-cpp/absl/strings/escaping.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +6 -6
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +83 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +387 -17
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +146 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc +897 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +589 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h +114 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +15 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +19 -4
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +36 -18
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.h +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +15 -40
- data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +64 -0
- data/third_party/abseil-cpp/absl/strings/match.cc +6 -3
- data/third_party/abseil-cpp/absl/strings/match.h +16 -6
- data/third_party/abseil-cpp/absl/strings/numbers.cc +132 -4
- data/third_party/abseil-cpp/absl/strings/numbers.h +10 -10
- data/third_party/abseil-cpp/absl/strings/str_join.h +1 -1
- data/third_party/abseil-cpp/absl/strings/str_split.h +38 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +154 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +2 -1
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +2 -2
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +4 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +1 -65
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +2 -6
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +71 -59
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +79 -62
- data/third_party/abseil-cpp/absl/time/clock.cc +146 -130
- data/third_party/abseil-cpp/absl/time/clock.h +2 -2
- data/third_party/abseil-cpp/absl/time/duration.cc +3 -2
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +7 -11
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +7 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +4 -4
- data/third_party/abseil-cpp/absl/time/time.cc +4 -3
- data/third_party/abseil-cpp/absl/time/time.h +26 -24
- data/third_party/abseil-cpp/absl/types/internal/variant.h +1 -1
- data/third_party/abseil-cpp/absl/types/variant.h +9 -4
- data/third_party/boringssl-with-bazel/err_data.c +483 -461
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bool.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +9 -7
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c +18 -8
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +1 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_locl.h +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/cipher_extra.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_tls.c +1 -88
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h +14 -3
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c +119 -273
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/err/err.c +87 -80
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp.c +9 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/prime.c +0 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/cipher.c +11 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/e_aes.c +25 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digest.c +7 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digests.c +10 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/md32_common.h +87 -160
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_key.c +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h +0 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +104 -93
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/internal.h +39 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md4/md4.c +52 -65
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md5/md5.c +52 -66
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/cbc.c +33 -22
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/cfb.c +9 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ctr.c +9 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm.c +17 -13
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/internal.h +1 -22
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ofb.c +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +1 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +0 -13
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +26 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa.c +26 -24
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +10 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/fips.c +79 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +14 -9
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha1.c +61 -75
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha256.c +80 -103
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha512.c +40 -49
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +367 -315
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +65 -0
- data/third_party/boringssl-with-bazel/src/crypto/mem.c +14 -0
- data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7_x509.c +5 -3
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +95 -48
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/passive.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/rand_extra.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_asn1.c +1 -2
- data/third_party/boringssl-with-bazel/src/crypto/thread_pthread.c +0 -28
- data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +120 -11
- data/third_party/boringssl-with-bazel/src/crypto/x509/t_req.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509a.c +3 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c +19 -25
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c +3 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c +42 -89
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c +9 -16
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +14 -15
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vpm.c +53 -73
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +31 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509rset.c +3 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_algor.c +21 -17
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_all.c +3 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_attrib.c +7 -25
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c +25 -22
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_req.c +5 -8
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_sig.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_val.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c +3 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +7 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +2 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c +5 -8
- data/third_party/boringssl-with-bazel/src/include/openssl/aead.h +1 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +66 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +120 -41
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +47 -7
- data/third_party/boringssl-with-bazel/src/include/openssl/bytestring.h +1 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/chacha.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +0 -8
- data/third_party/boringssl-with-bazel/src/include/openssl/crypto.h +24 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +6 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +5 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/ecdsa.h +33 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/err.h +3 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +20 -49
- data/third_party/boringssl-with-bazel/src/{crypto/x509/x509_r2x.c → include/openssl/evp_errors.h} +41 -58
- data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +325 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/obj.h +24 -5
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +25 -7
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +9 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +2 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +99 -63
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +283 -85
- data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +13 -19
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +445 -152
- data/third_party/boringssl-with-bazel/src/include/openssl/x509_vfy.h +451 -435
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +2 -1
- data/third_party/boringssl-with-bazel/src/ssl/d1_both.cc +7 -2
- data/third_party/boringssl-with-bazel/src/ssl/d1_srtp.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc +1133 -0
- data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +298 -22
- data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +66 -30
- data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +189 -86
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +154 -24
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +414 -135
- data/third_party/boringssl-with-bazel/src/ssl/s3_both.cc +9 -3
- data/third_party/boringssl-with-bazel/src/ssl/s3_lib.cc +2 -2
- data/third_party/boringssl-with-bazel/src/ssl/s3_pkt.cc +14 -19
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cert.cc +4 -6
- data/third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc +23 -26
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +51 -60
- data/third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc +2 -0
- data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +8 -31
- data/third_party/boringssl-with-bazel/src/ssl/ssl_stat.cc +3 -0
- data/third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc +4 -3
- data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +7 -3
- data/third_party/boringssl-with-bazel/src/ssl/t1_lib.cc +664 -702
- data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +65 -7
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +98 -39
- data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +141 -94
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +213 -118
- data/third_party/boringssl-with-bazel/src/ssl/tls_method.cc +4 -2
- metadata +93 -45
- data/src/core/lib/iomgr/poller/eventmanager_libuv.cc +0 -88
- data/src/core/lib/iomgr/poller/eventmanager_libuv.h +0 -88
- data/third_party/abseil-cpp/absl/base/internal/bits.h +0 -219
- data/third_party/abseil-cpp/absl/synchronization/internal/mutex_nonprod.inc +0 -249
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/is_fips.c +0 -29
- data/third_party/boringssl-with-bazel/src/crypto/hpke/internal.h +0 -246
- data/third_party/boringssl-with-bazel/src/crypto/x509/vpm_int.h +0 -71
data/src/core/ext/xds/xds_api.cc
CHANGED
@@ -90,13 +90,13 @@
|
|
90
90
|
#include <grpc/support/string_util.h>
|
91
91
|
|
92
92
|
#include "src/core/ext/xds/xds_api.h"
|
93
|
+
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
93
94
|
#include "src/core/lib/gpr/env.h"
|
94
95
|
#include "src/core/lib/gpr/string.h"
|
95
96
|
#include "src/core/lib/gpr/useful.h"
|
96
97
|
#include "src/core/lib/gprpp/host_port.h"
|
97
98
|
#include "src/core/lib/iomgr/error.h"
|
98
99
|
#include "src/core/lib/iomgr/sockaddr.h"
|
99
|
-
#include "src/core/lib/iomgr/sockaddr_utils.h"
|
100
100
|
#include "src/core/lib/iomgr/socket_utils.h"
|
101
101
|
#include "src/core/lib/slice/slice_utils.h"
|
102
102
|
|
@@ -697,10 +697,24 @@ std::string XdsApi::LdsUpdate::ToString() const {
|
|
697
697
|
//
|
698
698
|
|
699
699
|
std::string XdsApi::CdsUpdate::ToString() const {
|
700
|
-
absl::InlinedVector<std::string,
|
701
|
-
|
702
|
-
|
703
|
-
|
700
|
+
absl::InlinedVector<std::string, 8> contents;
|
701
|
+
switch (cluster_type) {
|
702
|
+
case EDS:
|
703
|
+
contents.push_back("cluster_type=EDS");
|
704
|
+
if (!eds_service_name.empty()) {
|
705
|
+
contents.push_back(
|
706
|
+
absl::StrFormat("eds_service_name=%s", eds_service_name));
|
707
|
+
}
|
708
|
+
break;
|
709
|
+
case LOGICAL_DNS:
|
710
|
+
contents.push_back("cluster_type=LOGICAL_DNS");
|
711
|
+
contents.push_back(absl::StrFormat("dns_hostname=%s", dns_hostname));
|
712
|
+
break;
|
713
|
+
case AGGREGATE:
|
714
|
+
contents.push_back("cluster_type=AGGREGATE");
|
715
|
+
contents.push_back(
|
716
|
+
absl::StrFormat("prioritized_cluster_names=[%s]",
|
717
|
+
absl::StrJoin(prioritized_cluster_names, ", ")));
|
704
718
|
}
|
705
719
|
if (!common_tls_context.Empty()) {
|
706
720
|
contents.push_back(absl::StrFormat("common_tls_context=%s",
|
@@ -710,6 +724,11 @@ std::string XdsApi::CdsUpdate::ToString() const {
|
|
710
724
|
contents.push_back(absl::StrFormat("lrs_load_reporting_server_name=%s",
|
711
725
|
lrs_load_reporting_server_name.value()));
|
712
726
|
}
|
727
|
+
contents.push_back(absl::StrCat("lb_policy=", lb_policy));
|
728
|
+
if (lb_policy == "RING_HASH") {
|
729
|
+
contents.push_back(absl::StrCat("min_ring_size=", min_ring_size));
|
730
|
+
contents.push_back(absl::StrCat("max_ring_size=", max_ring_size));
|
731
|
+
}
|
713
732
|
contents.push_back(
|
714
733
|
absl::StrFormat("max_concurrent_requests=%d", max_concurrent_requests));
|
715
734
|
return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
|
@@ -830,14 +849,39 @@ bool IsEds(absl::string_view type_url) {
|
|
830
849
|
|
831
850
|
} // namespace
|
832
851
|
|
852
|
+
// If gRPC is built with -DGRPC_XDS_USER_AGENT_NAME_SUFFIX="...", that string
|
853
|
+
// will be appended to the user agent name reported to the xDS server.
|
854
|
+
#ifdef GRPC_XDS_USER_AGENT_NAME_SUFFIX
|
855
|
+
#define GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING \
|
856
|
+
" " GRPC_XDS_USER_AGENT_NAME_SUFFIX
|
857
|
+
#else
|
858
|
+
#define GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING ""
|
859
|
+
#endif
|
860
|
+
|
861
|
+
// If gRPC is built with -DGRPC_XDS_USER_AGENT_VERSION_SUFFIX="...", that string
|
862
|
+
// will be appended to the user agent version reported to the xDS server.
|
863
|
+
#ifdef GRPC_XDS_USER_AGENT_VERSION_SUFFIX
|
864
|
+
#define GRPC_XDS_USER_AGENT_VERSION_SUFFIX_STRING \
|
865
|
+
" " GRPC_XDS_USER_AGENT_VERSION_SUFFIX
|
866
|
+
#else
|
867
|
+
#define GRPC_XDS_USER_AGENT_VERSION_SUFFIX_STRING ""
|
868
|
+
#endif
|
869
|
+
|
833
870
|
XdsApi::XdsApi(XdsClient* client, TraceFlag* tracer,
|
834
871
|
const XdsBootstrap::Node* node)
|
835
872
|
: client_(client),
|
836
873
|
tracer_(tracer),
|
837
874
|
node_(node),
|
838
875
|
build_version_(absl::StrCat("gRPC C-core ", GPR_PLATFORM_STRING, " ",
|
839
|
-
grpc_version_string()
|
840
|
-
|
876
|
+
grpc_version_string(),
|
877
|
+
GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING,
|
878
|
+
GRPC_XDS_USER_AGENT_VERSION_SUFFIX_STRING)),
|
879
|
+
user_agent_name_(absl::StrCat("gRPC C-core ", GPR_PLATFORM_STRING,
|
880
|
+
GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING)),
|
881
|
+
user_agent_version_(
|
882
|
+
absl::StrCat("C-core ", grpc_version_string(),
|
883
|
+
GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING,
|
884
|
+
GRPC_XDS_USER_AGENT_VERSION_SUFFIX_STRING)) {
|
841
885
|
// Populate upb symtab with xDS proto messages that we want to print
|
842
886
|
// properly in logs.
|
843
887
|
// Note: This won't actually work properly until upb adds support for
|
@@ -968,6 +1012,7 @@ void PopulateNode(const EncodingContext& context,
|
|
968
1012
|
const XdsBootstrap::Node* node,
|
969
1013
|
const std::string& build_version,
|
970
1014
|
const std::string& user_agent_name,
|
1015
|
+
const std::string& user_agent_version,
|
971
1016
|
envoy_config_core_v3_Node* node_msg) {
|
972
1017
|
if (node != nullptr) {
|
973
1018
|
if (!node->id.empty()) {
|
@@ -1007,7 +1052,7 @@ void PopulateNode(const EncodingContext& context,
|
|
1007
1052
|
envoy_config_core_v3_Node_set_user_agent_name(
|
1008
1053
|
node_msg, StdStringToUpbString(user_agent_name));
|
1009
1054
|
envoy_config_core_v3_Node_set_user_agent_version(
|
1010
|
-
node_msg,
|
1055
|
+
node_msg, StdStringToUpbString(user_agent_version));
|
1011
1056
|
envoy_config_core_v3_Node_add_client_features(
|
1012
1057
|
node_msg, upb_strview_makez("envoy.lb.does_not_support_overprovisioning"),
|
1013
1058
|
context.arena);
|
@@ -1068,8 +1113,8 @@ absl::string_view TypeUrlExternalToInternal(bool use_v3,
|
|
1068
1113
|
grpc_slice XdsApi::CreateAdsRequest(
|
1069
1114
|
const XdsBootstrap::XdsServer& server, const std::string& type_url,
|
1070
1115
|
const std::set<absl::string_view>& resource_names,
|
1071
|
-
const std::string& version, const std::string& nonce,
|
1072
|
-
bool populate_node) {
|
1116
|
+
const std::string& version, const std::string& nonce,
|
1117
|
+
grpc_error_handle error, bool populate_node) {
|
1073
1118
|
upb::Arena arena;
|
1074
1119
|
const EncodingContext context = {client_, tracer_, symtab_.ptr(), arena.ptr(),
|
1075
1120
|
server.ShouldUseV3()};
|
@@ -1092,6 +1137,7 @@ grpc_slice XdsApi::CreateAdsRequest(
|
|
1092
1137
|
request, StdStringToUpbString(nonce));
|
1093
1138
|
}
|
1094
1139
|
// Set error_detail if it's a NACK.
|
1140
|
+
std::string error_string_storage;
|
1095
1141
|
if (error != GRPC_ERROR_NONE) {
|
1096
1142
|
google_rpc_Status* error_detail =
|
1097
1143
|
envoy_service_discovery_v3_DiscoveryRequest_mutable_error_detail(
|
@@ -1102,8 +1148,8 @@ grpc_slice XdsApi::CreateAdsRequest(
|
|
1102
1148
|
// generate them in the parsing code, and then use that here.
|
1103
1149
|
google_rpc_Status_set_code(error_detail, GRPC_STATUS_INVALID_ARGUMENT);
|
1104
1150
|
// Error description comes from the error that was passed in.
|
1105
|
-
|
1106
|
-
|
1151
|
+
error_string_storage = grpc_error_std_string(error);
|
1152
|
+
upb_strview error_description = StdStringToUpbString(error_string_storage);
|
1107
1153
|
google_rpc_Status_set_message(error_detail, error_description);
|
1108
1154
|
GRPC_ERROR_UNREF(error);
|
1109
1155
|
}
|
@@ -1112,7 +1158,8 @@ grpc_slice XdsApi::CreateAdsRequest(
|
|
1112
1158
|
envoy_config_core_v3_Node* node_msg =
|
1113
1159
|
envoy_service_discovery_v3_DiscoveryRequest_mutable_node(request,
|
1114
1160
|
arena.ptr());
|
1115
|
-
PopulateNode(context, node_, build_version_, user_agent_name_,
|
1161
|
+
PopulateNode(context, node_, build_version_, user_agent_name_,
|
1162
|
+
user_agent_version_, node_msg);
|
1116
1163
|
}
|
1117
1164
|
// Add resource_names.
|
1118
1165
|
for (const auto& resource_name : resource_names) {
|
@@ -1197,8 +1244,9 @@ void MaybeLogClusterLoadAssignment(
|
|
1197
1244
|
}
|
1198
1245
|
}
|
1199
1246
|
|
1200
|
-
|
1201
|
-
|
1247
|
+
grpc_error_handle RoutePathMatchParse(
|
1248
|
+
const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route,
|
1249
|
+
bool* ignore_route) {
|
1202
1250
|
auto* case_sensitive_ptr =
|
1203
1251
|
envoy_config_route_v3_RouteMatch_case_sensitive(match);
|
1204
1252
|
bool case_sensitive = true;
|
@@ -1231,7 +1279,7 @@ grpc_error* RoutePathMatchParse(const envoy_config_route_v3_RouteMatch* match,
|
|
1231
1279
|
return GRPC_ERROR_NONE;
|
1232
1280
|
}
|
1233
1281
|
}
|
1234
|
-
type = StringMatcher::Type::
|
1282
|
+
type = StringMatcher::Type::kPrefix;
|
1235
1283
|
match_string = std::string(prefix);
|
1236
1284
|
} else if (envoy_config_route_v3_RouteMatch_has_path(match)) {
|
1237
1285
|
absl::string_view path =
|
@@ -1265,13 +1313,13 @@ grpc_error* RoutePathMatchParse(const envoy_config_route_v3_RouteMatch* match,
|
|
1265
1313
|
*ignore_route = true;
|
1266
1314
|
return GRPC_ERROR_NONE;
|
1267
1315
|
}
|
1268
|
-
type = StringMatcher::Type::
|
1316
|
+
type = StringMatcher::Type::kExact;
|
1269
1317
|
match_string = std::string(path);
|
1270
1318
|
} else if (envoy_config_route_v3_RouteMatch_has_safe_regex(match)) {
|
1271
1319
|
const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
|
1272
1320
|
envoy_config_route_v3_RouteMatch_safe_regex(match);
|
1273
1321
|
GPR_ASSERT(regex_matcher != nullptr);
|
1274
|
-
type = StringMatcher::Type::
|
1322
|
+
type = StringMatcher::Type::kSafeRegex;
|
1275
1323
|
match_string = UpbStringToStdString(
|
1276
1324
|
envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
|
1277
1325
|
} else {
|
@@ -1290,7 +1338,7 @@ grpc_error* RoutePathMatchParse(const envoy_config_route_v3_RouteMatch* match,
|
|
1290
1338
|
return GRPC_ERROR_NONE;
|
1291
1339
|
}
|
1292
1340
|
|
1293
|
-
|
1341
|
+
grpc_error_handle RouteHeaderMatchersParse(
|
1294
1342
|
const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route) {
|
1295
1343
|
size_t size;
|
1296
1344
|
const envoy_config_route_v3_HeaderMatcher* const* headers =
|
@@ -1305,7 +1353,7 @@ grpc_error* RouteHeaderMatchersParse(
|
|
1305
1353
|
int64_t range_end = 0;
|
1306
1354
|
bool present_match = false;
|
1307
1355
|
if (envoy_config_route_v3_HeaderMatcher_has_exact_match(header)) {
|
1308
|
-
type = HeaderMatcher::Type::
|
1356
|
+
type = HeaderMatcher::Type::kExact;
|
1309
1357
|
match_string = UpbStringToStdString(
|
1310
1358
|
envoy_config_route_v3_HeaderMatcher_exact_match(header));
|
1311
1359
|
} else if (envoy_config_route_v3_HeaderMatcher_has_safe_regex_match(
|
@@ -1313,28 +1361,28 @@ grpc_error* RouteHeaderMatchersParse(
|
|
1313
1361
|
const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
|
1314
1362
|
envoy_config_route_v3_HeaderMatcher_safe_regex_match(header);
|
1315
1363
|
GPR_ASSERT(regex_matcher != nullptr);
|
1316
|
-
type = HeaderMatcher::Type::
|
1364
|
+
type = HeaderMatcher::Type::kSafeRegex;
|
1317
1365
|
match_string = UpbStringToStdString(
|
1318
1366
|
envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
|
1319
1367
|
} else if (envoy_config_route_v3_HeaderMatcher_has_range_match(header)) {
|
1320
|
-
type = HeaderMatcher::Type::
|
1368
|
+
type = HeaderMatcher::Type::kRange;
|
1321
1369
|
const envoy_type_v3_Int64Range* range_matcher =
|
1322
1370
|
envoy_config_route_v3_HeaderMatcher_range_match(header);
|
1323
1371
|
range_start = envoy_type_v3_Int64Range_start(range_matcher);
|
1324
1372
|
range_end = envoy_type_v3_Int64Range_end(range_matcher);
|
1325
1373
|
} else if (envoy_config_route_v3_HeaderMatcher_has_present_match(header)) {
|
1326
|
-
type = HeaderMatcher::Type::
|
1374
|
+
type = HeaderMatcher::Type::kPresent;
|
1327
1375
|
present_match = envoy_config_route_v3_HeaderMatcher_present_match(header);
|
1328
1376
|
} else if (envoy_config_route_v3_HeaderMatcher_has_prefix_match(header)) {
|
1329
|
-
type = HeaderMatcher::Type::
|
1377
|
+
type = HeaderMatcher::Type::kPrefix;
|
1330
1378
|
match_string = UpbStringToStdString(
|
1331
1379
|
envoy_config_route_v3_HeaderMatcher_prefix_match(header));
|
1332
1380
|
} else if (envoy_config_route_v3_HeaderMatcher_has_suffix_match(header)) {
|
1333
|
-
type = HeaderMatcher::Type::
|
1381
|
+
type = HeaderMatcher::Type::kSuffix;
|
1334
1382
|
match_string = UpbStringToStdString(
|
1335
1383
|
envoy_config_route_v3_HeaderMatcher_suffix_match(header));
|
1336
1384
|
} else if (envoy_config_route_v3_HeaderMatcher_has_contains_match(header)) {
|
1337
|
-
type = HeaderMatcher::Type::
|
1385
|
+
type = HeaderMatcher::Type::kContains;
|
1338
1386
|
match_string = UpbStringToStdString(
|
1339
1387
|
envoy_config_route_v3_HeaderMatcher_contains_match(header));
|
1340
1388
|
} else {
|
@@ -1357,7 +1405,7 @@ grpc_error* RouteHeaderMatchersParse(
|
|
1357
1405
|
return GRPC_ERROR_NONE;
|
1358
1406
|
}
|
1359
1407
|
|
1360
|
-
|
1408
|
+
grpc_error_handle RouteRuntimeFractionParse(
|
1361
1409
|
const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route) {
|
1362
1410
|
const envoy_config_core_v3_RuntimeFractionalPercent* runtime_fraction =
|
1363
1411
|
envoy_config_route_v3_RouteMatch_runtime_fraction(match);
|
@@ -1390,9 +1438,9 @@ grpc_error* RouteRuntimeFractionParse(
|
|
1390
1438
|
return GRPC_ERROR_NONE;
|
1391
1439
|
}
|
1392
1440
|
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1441
|
+
grpc_error_handle ExtractHttpFilterTypeName(const EncodingContext& context,
|
1442
|
+
const google_protobuf_Any* any,
|
1443
|
+
absl::string_view* filter_type) {
|
1396
1444
|
*filter_type = UpbStringToAbsl(google_protobuf_Any_type_url(any));
|
1397
1445
|
if (*filter_type == "type.googleapis.com/udpa.type.v1.TypedStruct") {
|
1398
1446
|
upb_strview any_value = google_protobuf_Any_value(any);
|
@@ -1410,7 +1458,7 @@ grpc_error* ExtractHttpFilterTypeName(const EncodingContext& context,
|
|
1410
1458
|
}
|
1411
1459
|
|
1412
1460
|
template <typename ParentType, typename EntryType>
|
1413
|
-
|
1461
|
+
grpc_error_handle ParseTypedPerFilterConfig(
|
1414
1462
|
const EncodingContext& context, const ParentType* parent,
|
1415
1463
|
const EntryType* (*entry_func)(const ParentType*, size_t*),
|
1416
1464
|
upb_strview (*key_func)(const EntryType*),
|
@@ -1454,7 +1502,8 @@ grpc_error* ParseTypedPerFilterConfig(
|
|
1454
1502
|
.c_str());
|
1455
1503
|
}
|
1456
1504
|
}
|
1457
|
-
|
1505
|
+
grpc_error_handle error =
|
1506
|
+
ExtractHttpFilterTypeName(context, any, &filter_type);
|
1458
1507
|
if (error != GRPC_ERROR_NONE) return error;
|
1459
1508
|
const XdsHttpFilterImpl* filter_impl =
|
1460
1509
|
XdsHttpFilterRegistry::GetFilterForType(filter_type);
|
@@ -1478,9 +1527,9 @@ grpc_error* ParseTypedPerFilterConfig(
|
|
1478
1527
|
return GRPC_ERROR_NONE;
|
1479
1528
|
}
|
1480
1529
|
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1530
|
+
grpc_error_handle RouteActionParse(const EncodingContext& context,
|
1531
|
+
const envoy_config_route_v3_Route* route_msg,
|
1532
|
+
XdsApi::Route* route, bool* ignore_route) {
|
1484
1533
|
if (!envoy_config_route_v3_Route_has_route(route_msg)) {
|
1485
1534
|
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1486
1535
|
"No RouteAction found in route.");
|
@@ -1533,7 +1582,7 @@ grpc_error* RouteActionParse(const EncodingContext& context,
|
|
1533
1582
|
if (cluster.weight == 0) continue;
|
1534
1583
|
sum_of_weights += cluster.weight;
|
1535
1584
|
if (context.use_v3) {
|
1536
|
-
|
1585
|
+
grpc_error_handle error = ParseTypedPerFilterConfig<
|
1537
1586
|
envoy_config_route_v3_WeightedCluster_ClusterWeight,
|
1538
1587
|
envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry>(
|
1539
1588
|
context, cluster_weight,
|
@@ -1602,40 +1651,35 @@ grpc_error* RouteActionParse(const EncodingContext& context,
|
|
1602
1651
|
regex_rewrite =
|
1603
1652
|
envoy_config_route_v3_RouteAction_HashPolicy_Header_regex_rewrite(
|
1604
1653
|
header);
|
1605
|
-
if (regex_rewrite
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
"compile");
|
1634
|
-
continue;
|
1654
|
+
if (regex_rewrite != nullptr) {
|
1655
|
+
const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
|
1656
|
+
envoy_type_matcher_v3_RegexMatchAndSubstitute_pattern(
|
1657
|
+
regex_rewrite);
|
1658
|
+
if (regex_matcher == nullptr) {
|
1659
|
+
gpr_log(
|
1660
|
+
GPR_DEBUG,
|
1661
|
+
"RouteAction HashPolicy contains policy specifier Header with "
|
1662
|
+
"RegexMatchAndSubstitution but RegexMatcher pattern is "
|
1663
|
+
"missing");
|
1664
|
+
continue;
|
1665
|
+
}
|
1666
|
+
RE2::Options options;
|
1667
|
+
policy.regex = absl::make_unique<RE2>(
|
1668
|
+
UpbStringToStdString(
|
1669
|
+
envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher)),
|
1670
|
+
options);
|
1671
|
+
if (!policy.regex->ok()) {
|
1672
|
+
gpr_log(
|
1673
|
+
GPR_DEBUG,
|
1674
|
+
"RouteAction HashPolicy contains policy specifier Header with "
|
1675
|
+
"RegexMatchAndSubstitution but RegexMatcher pattern does not "
|
1676
|
+
"compile");
|
1677
|
+
continue;
|
1678
|
+
}
|
1679
|
+
policy.regex_substitution = UpbStringToStdString(
|
1680
|
+
envoy_type_matcher_v3_RegexMatchAndSubstitute_substitution(
|
1681
|
+
regex_rewrite));
|
1635
1682
|
}
|
1636
|
-
policy.regex_substitution = UpbStringToStdString(
|
1637
|
-
envoy_type_matcher_v3_RegexMatchAndSubstitute_substitution(
|
1638
|
-
regex_rewrite));
|
1639
1683
|
} else if ((filter_state =
|
1640
1684
|
envoy_config_route_v3_RouteAction_HashPolicy_filter_state(
|
1641
1685
|
hash_policy)) != nullptr) {
|
@@ -1663,7 +1707,7 @@ grpc_error* RouteActionParse(const EncodingContext& context,
|
|
1663
1707
|
return GRPC_ERROR_NONE;
|
1664
1708
|
}
|
1665
1709
|
|
1666
|
-
|
1710
|
+
grpc_error_handle RouteConfigParse(
|
1667
1711
|
const EncodingContext& context,
|
1668
1712
|
const envoy_config_route_v3_RouteConfiguration* route_config,
|
1669
1713
|
XdsApi::RdsUpdate* rds_update) {
|
@@ -1695,7 +1739,7 @@ grpc_error* RouteConfigParse(
|
|
1695
1739
|
}
|
1696
1740
|
// Parse typed_per_filter_config.
|
1697
1741
|
if (context.use_v3) {
|
1698
|
-
|
1742
|
+
grpc_error_handle error = ParseTypedPerFilterConfig<
|
1699
1743
|
envoy_config_route_v3_VirtualHost,
|
1700
1744
|
envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry>(
|
1701
1745
|
context, virtual_hosts[i],
|
@@ -1728,7 +1772,8 @@ grpc_error* RouteConfigParse(
|
|
1728
1772
|
}
|
1729
1773
|
XdsApi::Route route;
|
1730
1774
|
bool ignore_route = false;
|
1731
|
-
|
1775
|
+
grpc_error_handle error =
|
1776
|
+
RoutePathMatchParse(match, &route, &ignore_route);
|
1732
1777
|
if (error != GRPC_ERROR_NONE) return error;
|
1733
1778
|
if (ignore_route) continue;
|
1734
1779
|
error = RouteHeaderMatchersParse(match, &route);
|
@@ -1739,7 +1784,7 @@ grpc_error* RouteConfigParse(
|
|
1739
1784
|
if (error != GRPC_ERROR_NONE) return error;
|
1740
1785
|
if (ignore_route) continue;
|
1741
1786
|
if (context.use_v3) {
|
1742
|
-
|
1787
|
+
grpc_error_handle error = ParseTypedPerFilterConfig<
|
1743
1788
|
envoy_config_route_v3_Route,
|
1744
1789
|
envoy_config_route_v3_Route_TypedPerFilterConfigEntry>(
|
1745
1790
|
context, routes[j],
|
@@ -1771,11 +1816,11 @@ CertificateProviderInstanceParse(
|
|
1771
1816
|
certificate_provider_instance_proto))};
|
1772
1817
|
}
|
1773
1818
|
|
1774
|
-
|
1819
|
+
grpc_error_handle CommonTlsContextParse(
|
1775
1820
|
const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*
|
1776
1821
|
common_tls_context_proto,
|
1777
1822
|
XdsApi::CommonTlsContext* common_tls_context) GRPC_MUST_USE_RESULT;
|
1778
|
-
|
1823
|
+
grpc_error_handle CommonTlsContextParse(
|
1779
1824
|
const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*
|
1780
1825
|
common_tls_context_proto,
|
1781
1826
|
XdsApi::CommonTlsContext* common_tls_context) {
|
@@ -1796,31 +1841,31 @@ grpc_error* CommonTlsContextParse(
|
|
1796
1841
|
std::string matcher;
|
1797
1842
|
if (envoy_type_matcher_v3_StringMatcher_has_exact(
|
1798
1843
|
subject_alt_names_matchers[i])) {
|
1799
|
-
type = StringMatcher::Type::
|
1844
|
+
type = StringMatcher::Type::kExact;
|
1800
1845
|
matcher =
|
1801
1846
|
UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_exact(
|
1802
1847
|
subject_alt_names_matchers[i]));
|
1803
1848
|
} else if (envoy_type_matcher_v3_StringMatcher_has_prefix(
|
1804
1849
|
subject_alt_names_matchers[i])) {
|
1805
|
-
type = StringMatcher::Type::
|
1850
|
+
type = StringMatcher::Type::kPrefix;
|
1806
1851
|
matcher =
|
1807
1852
|
UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_prefix(
|
1808
1853
|
subject_alt_names_matchers[i]));
|
1809
1854
|
} else if (envoy_type_matcher_v3_StringMatcher_has_suffix(
|
1810
1855
|
subject_alt_names_matchers[i])) {
|
1811
|
-
type = StringMatcher::Type::
|
1856
|
+
type = StringMatcher::Type::kSuffix;
|
1812
1857
|
matcher =
|
1813
1858
|
UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_suffix(
|
1814
1859
|
subject_alt_names_matchers[i]));
|
1815
1860
|
} else if (envoy_type_matcher_v3_StringMatcher_has_contains(
|
1816
1861
|
subject_alt_names_matchers[i])) {
|
1817
|
-
type = StringMatcher::Type::
|
1862
|
+
type = StringMatcher::Type::kContains;
|
1818
1863
|
matcher =
|
1819
1864
|
UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_contains(
|
1820
1865
|
subject_alt_names_matchers[i]));
|
1821
1866
|
} else if (envoy_type_matcher_v3_StringMatcher_has_safe_regex(
|
1822
1867
|
subject_alt_names_matchers[i])) {
|
1823
|
-
type = StringMatcher::Type::
|
1868
|
+
type = StringMatcher::Type::kSafeRegex;
|
1824
1869
|
auto* regex_matcher = envoy_type_matcher_v3_StringMatcher_safe_regex(
|
1825
1870
|
subject_alt_names_matchers[i]);
|
1826
1871
|
matcher = UpbStringToStdString(
|
@@ -1840,7 +1885,7 @@ grpc_error* CommonTlsContextParse(
|
|
1840
1885
|
string_matcher.status().message())
|
1841
1886
|
.c_str());
|
1842
1887
|
}
|
1843
|
-
if (type == StringMatcher::Type::
|
1888
|
+
if (type == StringMatcher::Type::kSafeRegex && ignore_case) {
|
1844
1889
|
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1845
1890
|
"StringMatcher: ignore_case has no effect for SAFE_REGEX.");
|
1846
1891
|
}
|
@@ -1870,7 +1915,7 @@ grpc_error* CommonTlsContextParse(
|
|
1870
1915
|
return GRPC_ERROR_NONE;
|
1871
1916
|
}
|
1872
1917
|
|
1873
|
-
|
1918
|
+
grpc_error_handle HttpConnectionManagerParse(
|
1874
1919
|
bool is_client, const EncodingContext& context,
|
1875
1920
|
const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*
|
1876
1921
|
http_connection_manager_proto,
|
@@ -1925,7 +1970,8 @@ grpc_error* HttpConnectionManagerParse(
|
|
1925
1970
|
.c_str());
|
1926
1971
|
}
|
1927
1972
|
absl::string_view filter_type;
|
1928
|
-
|
1973
|
+
grpc_error_handle error =
|
1974
|
+
ExtractHttpFilterTypeName(context, any, &filter_type);
|
1929
1975
|
if (error != GRPC_ERROR_NONE) return error;
|
1930
1976
|
const XdsHttpFilterImpl* filter_impl =
|
1931
1977
|
XdsHttpFilterRegistry::GetFilterForType(filter_type);
|
@@ -1974,7 +2020,8 @@ grpc_error* HttpConnectionManagerParse(
|
|
1974
2020
|
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(
|
1975
2021
|
http_connection_manager_proto);
|
1976
2022
|
XdsApi::RdsUpdate rds_update;
|
1977
|
-
|
2023
|
+
grpc_error_handle error =
|
2024
|
+
RouteConfigParse(context, route_config, &rds_update);
|
1978
2025
|
if (error != GRPC_ERROR_NONE) return error;
|
1979
2026
|
http_connection_manager->rds_update = std::move(rds_update);
|
1980
2027
|
return GRPC_ERROR_NONE;
|
@@ -2007,7 +2054,7 @@ grpc_error* HttpConnectionManagerParse(
|
|
2007
2054
|
return GRPC_ERROR_NONE;
|
2008
2055
|
}
|
2009
2056
|
|
2010
|
-
|
2057
|
+
grpc_error_handle LdsResponseParseClient(
|
2011
2058
|
const EncodingContext& context,
|
2012
2059
|
const envoy_config_listener_v3_ApiListener* api_listener, bool is_v2,
|
2013
2060
|
XdsApi::LdsUpdate* lds_update) {
|
@@ -2026,7 +2073,7 @@ grpc_error* LdsResponseParseClient(
|
|
2026
2073
|
&lds_update->http_connection_manager);
|
2027
2074
|
}
|
2028
2075
|
|
2029
|
-
|
2076
|
+
grpc_error_handle DownstreamTlsContextParse(
|
2030
2077
|
const EncodingContext& context,
|
2031
2078
|
const envoy_config_core_v3_TransportSocket* transport_socket,
|
2032
2079
|
XdsApi::DownstreamTlsContext* downstream_tls_context) {
|
@@ -2050,7 +2097,7 @@ grpc_error* DownstreamTlsContextParse(
|
|
2050
2097
|
envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_common_tls_context(
|
2051
2098
|
downstream_tls_context_proto);
|
2052
2099
|
if (common_tls_context != nullptr) {
|
2053
|
-
|
2100
|
+
grpc_error_handle error = CommonTlsContextParse(
|
2054
2101
|
common_tls_context, &downstream_tls_context->common_tls_context);
|
2055
2102
|
if (error != GRPC_ERROR_NONE) return error;
|
2056
2103
|
}
|
@@ -2073,13 +2120,13 @@ grpc_error* DownstreamTlsContextParse(
|
|
2073
2120
|
return GRPC_ERROR_NONE;
|
2074
2121
|
}
|
2075
2122
|
|
2076
|
-
|
2123
|
+
grpc_error_handle CidrRangeParse(
|
2077
2124
|
const envoy_config_core_v3_CidrRange* cidr_range_proto,
|
2078
2125
|
XdsApi::LdsUpdate::FilterChainMap::CidrRange* cidr_range) {
|
2079
2126
|
std::string address_prefix = UpbStringToStdString(
|
2080
2127
|
envoy_config_core_v3_CidrRange_address_prefix(cidr_range_proto));
|
2081
|
-
|
2082
|
-
|
2128
|
+
grpc_error_handle error =
|
2129
|
+
grpc_string_to_sockaddr(&cidr_range->address, address_prefix.c_str(), 0);
|
2083
2130
|
if (error != GRPC_ERROR_NONE) return error;
|
2084
2131
|
cidr_range->prefix_len = 0;
|
2085
2132
|
auto* prefix_len_proto =
|
@@ -2097,7 +2144,7 @@ grpc_error* CidrRangeParse(
|
|
2097
2144
|
return GRPC_ERROR_NONE;
|
2098
2145
|
}
|
2099
2146
|
|
2100
|
-
|
2147
|
+
grpc_error_handle FilterChainMatchParse(
|
2101
2148
|
const envoy_config_listener_v3_FilterChainMatch* filter_chain_match_proto,
|
2102
2149
|
FilterChain::FilterChainMatch* filter_chain_match) {
|
2103
2150
|
auto* destination_port =
|
@@ -2113,7 +2160,7 @@ grpc_error* FilterChainMatchParse(
|
|
2113
2160
|
filter_chain_match->prefix_ranges.reserve(size);
|
2114
2161
|
for (size_t i = 0; i < size; i++) {
|
2115
2162
|
XdsApi::LdsUpdate::FilterChainMap::CidrRange cidr_range;
|
2116
|
-
|
2163
|
+
grpc_error_handle error = CidrRangeParse(prefix_ranges[i], &cidr_range);
|
2117
2164
|
if (error != GRPC_ERROR_NONE) return error;
|
2118
2165
|
filter_chain_match->prefix_ranges.push_back(cidr_range);
|
2119
2166
|
}
|
@@ -2127,7 +2174,8 @@ grpc_error* FilterChainMatchParse(
|
|
2127
2174
|
filter_chain_match->source_prefix_ranges.reserve(size);
|
2128
2175
|
for (size_t i = 0; i < size; i++) {
|
2129
2176
|
XdsApi::LdsUpdate::FilterChainMap::CidrRange cidr_range;
|
2130
|
-
|
2177
|
+
grpc_error_handle error =
|
2178
|
+
CidrRangeParse(source_prefix_ranges[i], &cidr_range);
|
2131
2179
|
if (error != GRPC_ERROR_NONE) return error;
|
2132
2180
|
filter_chain_match->source_prefix_ranges.push_back(cidr_range);
|
2133
2181
|
}
|
@@ -2156,11 +2204,11 @@ grpc_error* FilterChainMatchParse(
|
|
2156
2204
|
return GRPC_ERROR_NONE;
|
2157
2205
|
}
|
2158
2206
|
|
2159
|
-
|
2207
|
+
grpc_error_handle FilterChainParse(
|
2160
2208
|
const EncodingContext& context,
|
2161
2209
|
const envoy_config_listener_v3_FilterChain* filter_chain_proto, bool is_v2,
|
2162
2210
|
FilterChain* filter_chain) {
|
2163
|
-
|
2211
|
+
grpc_error_handle error = GRPC_ERROR_NONE;
|
2164
2212
|
auto* filter_chain_match =
|
2165
2213
|
envoy_config_listener_v3_FilterChain_filter_chain_match(
|
2166
2214
|
filter_chain_proto);
|
@@ -2223,8 +2271,8 @@ grpc_error* FilterChainParse(
|
|
2223
2271
|
return error;
|
2224
2272
|
}
|
2225
2273
|
|
2226
|
-
|
2227
|
-
|
2274
|
+
grpc_error_handle AddressParse(
|
2275
|
+
const envoy_config_core_v3_Address* address_proto, std::string* address) {
|
2228
2276
|
const auto* socket_address =
|
2229
2277
|
envoy_config_core_v3_Address_socket_address(address_proto);
|
2230
2278
|
if (socket_address == nullptr) {
|
@@ -2263,7 +2311,7 @@ struct InternalFilterChainMap {
|
|
2263
2311
|
DestinationIpMap destination_ip_map;
|
2264
2312
|
};
|
2265
2313
|
|
2266
|
-
|
2314
|
+
grpc_error_handle AddFilterChainDataForSourcePort(
|
2267
2315
|
const FilterChain& filter_chain,
|
2268
2316
|
XdsApi::LdsUpdate::FilterChainMap::SourcePortsMap* ports_map,
|
2269
2317
|
uint32_t port) {
|
@@ -2280,14 +2328,14 @@ grpc_error* AddFilterChainDataForSourcePort(
|
|
2280
2328
|
return GRPC_ERROR_NONE;
|
2281
2329
|
}
|
2282
2330
|
|
2283
|
-
|
2331
|
+
grpc_error_handle AddFilterChainDataForSourcePorts(
|
2284
2332
|
const FilterChain& filter_chain,
|
2285
2333
|
XdsApi::LdsUpdate::FilterChainMap::SourcePortsMap* ports_map) {
|
2286
2334
|
if (filter_chain.filter_chain_match.source_ports.empty()) {
|
2287
2335
|
return AddFilterChainDataForSourcePort(filter_chain, ports_map, 0);
|
2288
2336
|
} else {
|
2289
2337
|
for (uint32_t port : filter_chain.filter_chain_match.source_ports) {
|
2290
|
-
|
2338
|
+
grpc_error_handle error =
|
2291
2339
|
AddFilterChainDataForSourcePort(filter_chain, ports_map, port);
|
2292
2340
|
if (error != GRPC_ERROR_NONE) return error;
|
2293
2341
|
}
|
@@ -2295,7 +2343,7 @@ grpc_error* AddFilterChainDataForSourcePorts(
|
|
2295
2343
|
return GRPC_ERROR_NONE;
|
2296
2344
|
}
|
2297
2345
|
|
2298
|
-
|
2346
|
+
grpc_error_handle AddFilterChainDataForSourceIpRange(
|
2299
2347
|
const FilterChain& filter_chain,
|
2300
2348
|
InternalFilterChainMap::SourceIpMap* source_ip_map) {
|
2301
2349
|
if (filter_chain.filter_chain_match.source_prefix_ranges.empty()) {
|
@@ -2313,7 +2361,7 @@ grpc_error* AddFilterChainDataForSourceIpRange(
|
|
2313
2361
|
if (insert_result.second) {
|
2314
2362
|
insert_result.first->second.prefix_range.emplace(prefix_range);
|
2315
2363
|
}
|
2316
|
-
|
2364
|
+
grpc_error_handle error = AddFilterChainDataForSourcePorts(
|
2317
2365
|
filter_chain, &insert_result.first->second.ports_map);
|
2318
2366
|
if (error != GRPC_ERROR_NONE) return error;
|
2319
2367
|
}
|
@@ -2321,7 +2369,7 @@ grpc_error* AddFilterChainDataForSourceIpRange(
|
|
2321
2369
|
return GRPC_ERROR_NONE;
|
2322
2370
|
}
|
2323
2371
|
|
2324
|
-
|
2372
|
+
grpc_error_handle AddFilterChainDataForSourceType(
|
2325
2373
|
const FilterChain& filter_chain,
|
2326
2374
|
InternalFilterChainMap::DestinationIp* destination_ip) {
|
2327
2375
|
GPR_ASSERT(static_cast<unsigned int>(
|
@@ -2331,7 +2379,7 @@ grpc_error* AddFilterChainDataForSourceType(
|
|
2331
2379
|
filter_chain.filter_chain_match.source_type)]);
|
2332
2380
|
}
|
2333
2381
|
|
2334
|
-
|
2382
|
+
grpc_error_handle AddFilterChainDataForApplicationProtocols(
|
2335
2383
|
const FilterChain& filter_chain,
|
2336
2384
|
InternalFilterChainMap::DestinationIp* destination_ip) {
|
2337
2385
|
// Only allow filter chains that do not mention application protocols
|
@@ -2341,7 +2389,7 @@ grpc_error* AddFilterChainDataForApplicationProtocols(
|
|
2341
2389
|
return AddFilterChainDataForSourceType(filter_chain, destination_ip);
|
2342
2390
|
}
|
2343
2391
|
|
2344
|
-
|
2392
|
+
grpc_error_handle AddFilterChainDataForTransportProtocol(
|
2345
2393
|
const FilterChain& filter_chain,
|
2346
2394
|
InternalFilterChainMap::DestinationIp* destination_ip) {
|
2347
2395
|
const std::string& transport_protocol =
|
@@ -2369,7 +2417,7 @@ grpc_error* AddFilterChainDataForTransportProtocol(
|
|
2369
2417
|
destination_ip);
|
2370
2418
|
}
|
2371
2419
|
|
2372
|
-
|
2420
|
+
grpc_error_handle AddFilterChainDataForServerNames(
|
2373
2421
|
const FilterChain& filter_chain,
|
2374
2422
|
InternalFilterChainMap::DestinationIp* destination_ip) {
|
2375
2423
|
// Don't continue adding filter chains with server names mentioned
|
@@ -2379,7 +2427,7 @@ grpc_error* AddFilterChainDataForServerNames(
|
|
2379
2427
|
return AddFilterChainDataForTransportProtocol(filter_chain, destination_ip);
|
2380
2428
|
}
|
2381
2429
|
|
2382
|
-
|
2430
|
+
grpc_error_handle AddFilterChainDataForDestinationIpRange(
|
2383
2431
|
const FilterChain& filter_chain,
|
2384
2432
|
InternalFilterChainMap::DestinationIpMap* destination_ip_map) {
|
2385
2433
|
if (filter_chain.filter_chain_match.prefix_ranges.empty()) {
|
@@ -2397,7 +2445,7 @@ grpc_error* AddFilterChainDataForDestinationIpRange(
|
|
2397
2445
|
if (insert_result.second) {
|
2398
2446
|
insert_result.first->second.prefix_range.emplace(prefix_range);
|
2399
2447
|
}
|
2400
|
-
|
2448
|
+
grpc_error_handle error = AddFilterChainDataForServerNames(
|
2401
2449
|
filter_chain, &insert_result.first->second);
|
2402
2450
|
if (error != GRPC_ERROR_NONE) return error;
|
2403
2451
|
}
|
@@ -2424,14 +2472,14 @@ XdsApi::LdsUpdate::FilterChainMap BuildFromInternalFilterChainMap(
|
|
2424
2472
|
return filter_chain_map;
|
2425
2473
|
}
|
2426
2474
|
|
2427
|
-
|
2475
|
+
grpc_error_handle BuildFilterChainMap(
|
2428
2476
|
const std::vector<FilterChain>& filter_chains,
|
2429
2477
|
XdsApi::LdsUpdate::FilterChainMap* filter_chain_map) {
|
2430
2478
|
InternalFilterChainMap internal_filter_chain_map;
|
2431
2479
|
for (const auto& filter_chain : filter_chains) {
|
2432
2480
|
// Discard filter chain entries that specify destination port
|
2433
2481
|
if (filter_chain.filter_chain_match.destination_port != 0) continue;
|
2434
|
-
|
2482
|
+
grpc_error_handle error = AddFilterChainDataForDestinationIpRange(
|
2435
2483
|
filter_chain, &internal_filter_chain_map.destination_ip_map);
|
2436
2484
|
if (error != GRPC_ERROR_NONE) return error;
|
2437
2485
|
}
|
@@ -2440,12 +2488,12 @@ grpc_error* BuildFilterChainMap(
|
|
2440
2488
|
return GRPC_ERROR_NONE;
|
2441
2489
|
}
|
2442
2490
|
|
2443
|
-
|
2491
|
+
grpc_error_handle LdsResponseParseServer(
|
2444
2492
|
const EncodingContext& context,
|
2445
2493
|
const envoy_config_listener_v3_Listener* listener, bool is_v2,
|
2446
2494
|
XdsApi::LdsUpdate* lds_update) {
|
2447
2495
|
lds_update->type = XdsApi::LdsUpdate::ListenerType::kTcpListener;
|
2448
|
-
|
2496
|
+
grpc_error_handle error =
|
2449
2497
|
AddressParse(envoy_config_listener_v3_Listener_address(listener),
|
2450
2498
|
&lds_update->address);
|
2451
2499
|
if (error != GRPC_ERROR_NONE) return error;
|
@@ -2489,13 +2537,13 @@ grpc_error* LdsResponseParseServer(
|
|
2489
2537
|
return GRPC_ERROR_NONE;
|
2490
2538
|
}
|
2491
2539
|
|
2492
|
-
|
2540
|
+
grpc_error_handle LdsResponseParse(
|
2493
2541
|
const EncodingContext& context,
|
2494
2542
|
const envoy_service_discovery_v3_DiscoveryResponse* response,
|
2495
2543
|
const std::set<absl::string_view>& expected_listener_names,
|
2496
2544
|
XdsApi::LdsUpdateMap* lds_update_map,
|
2497
2545
|
std::set<std::string>* resource_names_failed) {
|
2498
|
-
std::vector<
|
2546
|
+
std::vector<grpc_error_handle> errors;
|
2499
2547
|
// Get the resources from the response.
|
2500
2548
|
size_t size;
|
2501
2549
|
const google_protobuf_Any* const* resources =
|
@@ -2564,7 +2612,7 @@ grpc_error* LdsResponseParse(
|
|
2564
2612
|
resource_names_failed->insert(listener_name);
|
2565
2613
|
continue;
|
2566
2614
|
}
|
2567
|
-
|
2615
|
+
grpc_error_handle error = GRPC_ERROR_NONE;
|
2568
2616
|
if (api_listener != nullptr) {
|
2569
2617
|
error = LdsResponseParseClient(context, api_listener, is_v2, &lds_update);
|
2570
2618
|
} else {
|
@@ -2581,13 +2629,13 @@ grpc_error* LdsResponseParse(
|
|
2581
2629
|
return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing LDS response", &errors);
|
2582
2630
|
}
|
2583
2631
|
|
2584
|
-
|
2632
|
+
grpc_error_handle RdsResponseParse(
|
2585
2633
|
const EncodingContext& context,
|
2586
2634
|
const envoy_service_discovery_v3_DiscoveryResponse* response,
|
2587
2635
|
const std::set<absl::string_view>& expected_route_configuration_names,
|
2588
2636
|
XdsApi::RdsUpdateMap* rds_update_map,
|
2589
2637
|
std::set<std::string>* resource_names_failed) {
|
2590
|
-
std::vector<
|
2638
|
+
std::vector<grpc_error_handle> errors;
|
2591
2639
|
// Get the resources from the response.
|
2592
2640
|
size_t size;
|
2593
2641
|
const google_protobuf_Any* const* resources =
|
@@ -2638,7 +2686,8 @@ grpc_error* RdsResponseParse(
|
|
2638
2686
|
rds_resource_data.serialized_proto =
|
2639
2687
|
UpbStringToStdString(encoded_route_config);
|
2640
2688
|
// Parse the route_config.
|
2641
|
-
|
2689
|
+
grpc_error_handle error =
|
2690
|
+
RouteConfigParse(context, route_config, &rds_update);
|
2642
2691
|
if (error != GRPC_ERROR_NONE) {
|
2643
2692
|
errors.push_back(grpc_error_add_child(
|
2644
2693
|
GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
@@ -2650,13 +2699,13 @@ grpc_error* RdsResponseParse(
|
|
2650
2699
|
return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing RDS response", &errors);
|
2651
2700
|
}
|
2652
2701
|
|
2653
|
-
|
2702
|
+
grpc_error_handle CdsResponseParse(
|
2654
2703
|
const EncodingContext& context,
|
2655
2704
|
const envoy_service_discovery_v3_DiscoveryResponse* response,
|
2656
2705
|
const std::set<absl::string_view>& expected_cluster_names,
|
2657
2706
|
XdsApi::CdsUpdateMap* cds_update_map,
|
2658
2707
|
std::set<std::string>* resource_names_failed) {
|
2659
|
-
std::vector<
|
2708
|
+
std::vector<grpc_error_handle> errors;
|
2660
2709
|
// Get the resources from the response.
|
2661
2710
|
size_t size;
|
2662
2711
|
const google_protobuf_Any* const* resources =
|
@@ -2699,10 +2748,11 @@ grpc_error* CdsResponseParse(
|
|
2699
2748
|
resource_names_failed->insert(cluster_name);
|
2700
2749
|
continue;
|
2701
2750
|
}
|
2702
|
-
//
|
2751
|
+
// Add the cluster to cds_update_map.
|
2703
2752
|
XdsApi::CdsResourceData& cds_resource_data =
|
2704
2753
|
(*cds_update_map)[cluster_name];
|
2705
2754
|
XdsApi::CdsUpdate& cds_update = cds_resource_data.resource;
|
2755
|
+
// Store serialized proto.
|
2706
2756
|
cds_resource_data.serialized_proto = UpbStringToStdString(encoded_cluster);
|
2707
2757
|
// Check the cluster_discovery_type.
|
2708
2758
|
if (!envoy_config_cluster_v3_Cluster_has_type(cluster) &&
|
@@ -2744,6 +2794,102 @@ grpc_error* CdsResponseParse(
|
|
2744
2794
|
} else if (envoy_config_cluster_v3_Cluster_type(cluster) ==
|
2745
2795
|
envoy_config_cluster_v3_Cluster_LOGICAL_DNS) {
|
2746
2796
|
cds_update.cluster_type = XdsApi::CdsUpdate::ClusterType::LOGICAL_DNS;
|
2797
|
+
const auto* load_assignment =
|
2798
|
+
envoy_config_cluster_v3_Cluster_load_assignment(cluster);
|
2799
|
+
if (load_assignment == nullptr) {
|
2800
|
+
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2801
|
+
absl::StrCat(
|
2802
|
+
cluster_name,
|
2803
|
+
": load_assignment not present for LOGICAL_DNS cluster")
|
2804
|
+
.c_str()));
|
2805
|
+
resource_names_failed->insert(cluster_name);
|
2806
|
+
continue;
|
2807
|
+
}
|
2808
|
+
size_t num_localities;
|
2809
|
+
const auto* const* localities =
|
2810
|
+
envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(
|
2811
|
+
load_assignment, &num_localities);
|
2812
|
+
if (num_localities != 1) {
|
2813
|
+
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2814
|
+
absl::StrCat(cluster_name,
|
2815
|
+
": load_assignment for LOGICAL_DNS cluster must have "
|
2816
|
+
"exactly one locality, found ",
|
2817
|
+
num_localities)
|
2818
|
+
.c_str()));
|
2819
|
+
resource_names_failed->insert(cluster_name);
|
2820
|
+
continue;
|
2821
|
+
}
|
2822
|
+
size_t num_endpoints;
|
2823
|
+
const auto* const* endpoints =
|
2824
|
+
envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(
|
2825
|
+
localities[0], &num_endpoints);
|
2826
|
+
if (num_endpoints != 1) {
|
2827
|
+
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2828
|
+
absl::StrCat(cluster_name,
|
2829
|
+
": locality for LOGICAL_DNS cluster must have "
|
2830
|
+
"exactly one endpoint, found ",
|
2831
|
+
num_endpoints)
|
2832
|
+
.c_str()));
|
2833
|
+
resource_names_failed->insert(cluster_name);
|
2834
|
+
continue;
|
2835
|
+
}
|
2836
|
+
const auto* endpoint =
|
2837
|
+
envoy_config_endpoint_v3_LbEndpoint_endpoint(endpoints[0]);
|
2838
|
+
if (endpoint == nullptr) {
|
2839
|
+
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2840
|
+
absl::StrCat(cluster_name, ": LbEndpoint endpoint field not set")
|
2841
|
+
.c_str()));
|
2842
|
+
resource_names_failed->insert(cluster_name);
|
2843
|
+
continue;
|
2844
|
+
}
|
2845
|
+
const auto* address = envoy_config_endpoint_v3_Endpoint_address(endpoint);
|
2846
|
+
if (address == nullptr) {
|
2847
|
+
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2848
|
+
absl::StrCat(cluster_name, ": Endpoint address field not set")
|
2849
|
+
.c_str()));
|
2850
|
+
resource_names_failed->insert(cluster_name);
|
2851
|
+
continue;
|
2852
|
+
}
|
2853
|
+
const auto* socket_address =
|
2854
|
+
envoy_config_core_v3_Address_socket_address(address);
|
2855
|
+
if (socket_address == nullptr) {
|
2856
|
+
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2857
|
+
absl::StrCat(cluster_name, ": Address socket_address field not set")
|
2858
|
+
.c_str()));
|
2859
|
+
resource_names_failed->insert(cluster_name);
|
2860
|
+
continue;
|
2861
|
+
}
|
2862
|
+
if (envoy_config_core_v3_SocketAddress_resolver_name(socket_address)
|
2863
|
+
.size != 0) {
|
2864
|
+
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2865
|
+
absl::StrCat(
|
2866
|
+
cluster_name,
|
2867
|
+
": LOGICAL_DNS clusters must NOT have a custom resolver "
|
2868
|
+
"name set")
|
2869
|
+
.c_str()));
|
2870
|
+
resource_names_failed->insert(cluster_name);
|
2871
|
+
continue;
|
2872
|
+
}
|
2873
|
+
absl::string_view address_str = UpbStringToAbsl(
|
2874
|
+
envoy_config_core_v3_SocketAddress_address(socket_address));
|
2875
|
+
if (address_str.empty()) {
|
2876
|
+
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2877
|
+
absl::StrCat(cluster_name, ": SocketAddress address field not set")
|
2878
|
+
.c_str()));
|
2879
|
+
resource_names_failed->insert(cluster_name);
|
2880
|
+
continue;
|
2881
|
+
}
|
2882
|
+
if (!envoy_config_core_v3_SocketAddress_has_port_value(socket_address)) {
|
2883
|
+
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2884
|
+
absl::StrCat(cluster_name,
|
2885
|
+
": SocketAddress port_value field not set")
|
2886
|
+
.c_str()));
|
2887
|
+
resource_names_failed->insert(cluster_name);
|
2888
|
+
continue;
|
2889
|
+
}
|
2890
|
+
cds_update.dns_hostname = JoinHostPort(
|
2891
|
+
address_str,
|
2892
|
+
envoy_config_core_v3_SocketAddress_port_value(socket_address));
|
2747
2893
|
} else {
|
2748
2894
|
if (envoy_config_cluster_v3_Cluster_has_cluster_type(cluster)) {
|
2749
2895
|
const envoy_config_cluster_v3_Cluster_CustomClusterType*
|
@@ -2807,75 +2953,61 @@ grpc_error* CdsResponseParse(
|
|
2807
2953
|
// Record ring hash lb config
|
2808
2954
|
auto* ring_hash_config =
|
2809
2955
|
envoy_config_cluster_v3_Cluster_ring_hash_lb_config(cluster);
|
2810
|
-
if (ring_hash_config
|
2811
|
-
|
2812
|
-
|
2813
|
-
|
2814
|
-
|
2815
|
-
|
2816
|
-
|
2817
|
-
|
2818
|
-
|
2819
|
-
|
2820
|
-
|
2821
|
-
|
2822
|
-
|
2823
|
-
|
2824
|
-
|
2825
|
-
|
2826
|
-
|
2827
|
-
absl::StrCat(
|
2828
|
-
cluster_name,
|
2829
|
-
": max_ring_size is not in the range of 1 to 8388608.")
|
2830
|
-
.c_str()));
|
2831
|
-
resource_names_failed->insert(cluster_name);
|
2832
|
-
continue;
|
2956
|
+
if (ring_hash_config != nullptr) {
|
2957
|
+
const google_protobuf_UInt64Value* max_ring_size =
|
2958
|
+
envoy_config_cluster_v3_Cluster_RingHashLbConfig_maximum_ring_size(
|
2959
|
+
ring_hash_config);
|
2960
|
+
if (max_ring_size != nullptr) {
|
2961
|
+
cds_update.max_ring_size =
|
2962
|
+
google_protobuf_UInt64Value_value(max_ring_size);
|
2963
|
+
if (cds_update.max_ring_size > 8388608 ||
|
2964
|
+
cds_update.max_ring_size == 0) {
|
2965
|
+
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2966
|
+
absl::StrCat(
|
2967
|
+
cluster_name,
|
2968
|
+
": max_ring_size is not in the range of 1 to 8388608.")
|
2969
|
+
.c_str()));
|
2970
|
+
resource_names_failed->insert(cluster_name);
|
2971
|
+
continue;
|
2972
|
+
}
|
2833
2973
|
}
|
2834
|
-
|
2835
|
-
|
2836
|
-
|
2837
|
-
|
2838
|
-
|
2839
|
-
|
2840
|
-
|
2841
|
-
|
2842
|
-
|
2843
|
-
|
2844
|
-
|
2845
|
-
|
2846
|
-
|
2847
|
-
|
2848
|
-
|
2849
|
-
|
2974
|
+
const google_protobuf_UInt64Value* min_ring_size =
|
2975
|
+
envoy_config_cluster_v3_Cluster_RingHashLbConfig_minimum_ring_size(
|
2976
|
+
ring_hash_config);
|
2977
|
+
if (min_ring_size != nullptr) {
|
2978
|
+
cds_update.min_ring_size =
|
2979
|
+
google_protobuf_UInt64Value_value(min_ring_size);
|
2980
|
+
if (cds_update.min_ring_size > 8388608 ||
|
2981
|
+
cds_update.min_ring_size == 0) {
|
2982
|
+
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2983
|
+
absl::StrCat(
|
2984
|
+
cluster_name,
|
2985
|
+
": min_ring_size is not in the range of 1 to 8388608.")
|
2986
|
+
.c_str()));
|
2987
|
+
resource_names_failed->insert(cluster_name);
|
2988
|
+
continue;
|
2989
|
+
}
|
2990
|
+
if (cds_update.min_ring_size > cds_update.max_ring_size) {
|
2991
|
+
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2992
|
+
absl::StrCat(
|
2993
|
+
cluster_name,
|
2994
|
+
": min_ring_size cannot be greater than max_ring_size.")
|
2995
|
+
.c_str()));
|
2996
|
+
resource_names_failed->insert(cluster_name);
|
2997
|
+
continue;
|
2998
|
+
}
|
2850
2999
|
}
|
2851
|
-
if (
|
3000
|
+
if (envoy_config_cluster_v3_Cluster_RingHashLbConfig_hash_function(
|
3001
|
+
ring_hash_config) !=
|
3002
|
+
envoy_config_cluster_v3_Cluster_RingHashLbConfig_XX_HASH) {
|
2852
3003
|
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2853
|
-
absl::StrCat(
|
2854
|
-
|
2855
|
-
": min_ring_size cannot be greater than max_ring_size.")
|
3004
|
+
absl::StrCat(cluster_name,
|
3005
|
+
": ring hash lb config has invalid hash function.")
|
2856
3006
|
.c_str()));
|
2857
3007
|
resource_names_failed->insert(cluster_name);
|
2858
3008
|
continue;
|
2859
3009
|
}
|
2860
3010
|
}
|
2861
|
-
if (envoy_config_cluster_v3_Cluster_RingHashLbConfig_hash_function(
|
2862
|
-
ring_hash_config) ==
|
2863
|
-
envoy_config_cluster_v3_Cluster_RingHashLbConfig_XX_HASH) {
|
2864
|
-
cds_update.hash_function = XdsApi::CdsUpdate::HashFunction::XX_HASH;
|
2865
|
-
} else if (
|
2866
|
-
envoy_config_cluster_v3_Cluster_RingHashLbConfig_hash_function(
|
2867
|
-
ring_hash_config) ==
|
2868
|
-
envoy_config_cluster_v3_Cluster_RingHashLbConfig_MURMUR_HASH_2) {
|
2869
|
-
cds_update.hash_function =
|
2870
|
-
XdsApi::CdsUpdate::HashFunction::MURMUR_HASH_2;
|
2871
|
-
} else {
|
2872
|
-
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2873
|
-
absl::StrCat(cluster_name,
|
2874
|
-
": ring hash lb config has invalid hash function.")
|
2875
|
-
.c_str()));
|
2876
|
-
resource_names_failed->insert(cluster_name);
|
2877
|
-
continue;
|
2878
|
-
}
|
2879
3011
|
} else {
|
2880
3012
|
errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
2881
3013
|
absl::StrCat(cluster_name, ": LB policy is not supported.").c_str()));
|
@@ -2912,7 +3044,7 @@ grpc_error* CdsResponseParse(
|
|
2912
3044
|
envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(
|
2913
3045
|
upstream_tls_context);
|
2914
3046
|
if (common_tls_context != nullptr) {
|
2915
|
-
|
3047
|
+
grpc_error_handle error = CommonTlsContextParse(
|
2916
3048
|
common_tls_context, &cds_update.common_tls_context);
|
2917
3049
|
if (error != GRPC_ERROR_NONE) {
|
2918
3050
|
errors.push_back(grpc_error_add_child(
|
@@ -2983,7 +3115,7 @@ grpc_error* CdsResponseParse(
|
|
2983
3115
|
return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing CDS response", &errors);
|
2984
3116
|
}
|
2985
3117
|
|
2986
|
-
|
3118
|
+
grpc_error_handle ServerAddressParseAndAppend(
|
2987
3119
|
const envoy_config_endpoint_v3_LbEndpoint* lb_endpoint,
|
2988
3120
|
ServerAddressList* list) {
|
2989
3121
|
// If health_status is not HEALTHY or UNKNOWN, skip this endpoint.
|
@@ -3006,17 +3138,32 @@ grpc_error* ServerAddressParseAndAppend(
|
|
3006
3138
|
if (GPR_UNLIKELY(port >> 16) != 0) {
|
3007
3139
|
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Invalid port.");
|
3008
3140
|
}
|
3141
|
+
// Find load_balancing_weight for the endpoint.
|
3142
|
+
const google_protobuf_UInt32Value* load_balancing_weight =
|
3143
|
+
envoy_config_endpoint_v3_LbEndpoint_load_balancing_weight(lb_endpoint);
|
3144
|
+
const int32_t weight =
|
3145
|
+
load_balancing_weight != nullptr
|
3146
|
+
? google_protobuf_UInt32Value_value(load_balancing_weight)
|
3147
|
+
: 500;
|
3148
|
+
if (weight == 0) {
|
3149
|
+
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
3150
|
+
"Invalid endpoint weight of 0.");
|
3151
|
+
}
|
3009
3152
|
// Populate grpc_resolved_address.
|
3010
3153
|
grpc_resolved_address addr;
|
3011
|
-
|
3012
|
-
|
3154
|
+
grpc_error_handle error =
|
3155
|
+
grpc_string_to_sockaddr(&addr, address_str.c_str(), port);
|
3013
3156
|
if (error != GRPC_ERROR_NONE) return error;
|
3014
3157
|
// Append the address to the list.
|
3015
|
-
|
3158
|
+
std::map<const char*, std::unique_ptr<ServerAddress::AttributeInterface>>
|
3159
|
+
attributes;
|
3160
|
+
attributes[ServerAddressWeightAttribute::kServerAddressWeightAttributeKey] =
|
3161
|
+
absl::make_unique<ServerAddressWeightAttribute>(weight);
|
3162
|
+
list->emplace_back(addr, nullptr, std::move(attributes));
|
3016
3163
|
return GRPC_ERROR_NONE;
|
3017
3164
|
}
|
3018
3165
|
|
3019
|
-
|
3166
|
+
grpc_error_handle LocalityParse(
|
3020
3167
|
const envoy_config_endpoint_v3_LocalityLbEndpoints* locality_lb_endpoints,
|
3021
3168
|
XdsApi::EdsUpdate::Priority::Locality* output_locality, size_t* priority) {
|
3022
3169
|
// Parse LB weight.
|
@@ -3050,7 +3197,7 @@ grpc_error* LocalityParse(
|
|
3050
3197
|
envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(
|
3051
3198
|
locality_lb_endpoints, &size);
|
3052
3199
|
for (size_t i = 0; i < size; ++i) {
|
3053
|
-
|
3200
|
+
grpc_error_handle error = ServerAddressParseAndAppend(
|
3054
3201
|
lb_endpoints[i], &output_locality->endpoints);
|
3055
3202
|
if (error != GRPC_ERROR_NONE) return error;
|
3056
3203
|
}
|
@@ -3060,7 +3207,7 @@ grpc_error* LocalityParse(
|
|
3060
3207
|
return GRPC_ERROR_NONE;
|
3061
3208
|
}
|
3062
3209
|
|
3063
|
-
|
3210
|
+
grpc_error_handle DropParseAndAppend(
|
3064
3211
|
const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*
|
3065
3212
|
drop_overload,
|
3066
3213
|
XdsApi::EdsUpdate::DropConfig* drop_config) {
|
@@ -3099,13 +3246,13 @@ grpc_error* DropParseAndAppend(
|
|
3099
3246
|
return GRPC_ERROR_NONE;
|
3100
3247
|
}
|
3101
3248
|
|
3102
|
-
|
3249
|
+
grpc_error_handle EdsResponseParse(
|
3103
3250
|
const EncodingContext& context,
|
3104
3251
|
const envoy_service_discovery_v3_DiscoveryResponse* response,
|
3105
3252
|
const std::set<absl::string_view>& expected_eds_service_names,
|
3106
3253
|
XdsApi::EdsUpdateMap* eds_update_map,
|
3107
3254
|
std::set<std::string>* resource_names_failed) {
|
3108
|
-
std::vector<
|
3255
|
+
std::vector<grpc_error_handle> errors;
|
3109
3256
|
// Get the resources from the response.
|
3110
3257
|
size_t size;
|
3111
3258
|
const google_protobuf_Any* const* resources =
|
@@ -3162,7 +3309,7 @@ grpc_error* EdsResponseParse(
|
|
3162
3309
|
const envoy_config_endpoint_v3_LocalityLbEndpoints* const* endpoints =
|
3163
3310
|
envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(
|
3164
3311
|
cluster_load_assignment, &locality_size);
|
3165
|
-
|
3312
|
+
grpc_error_handle error = GRPC_ERROR_NONE;
|
3166
3313
|
for (size_t j = 0; j < locality_size; ++j) {
|
3167
3314
|
size_t priority;
|
3168
3315
|
XdsApi::EdsUpdate::Priority::Locality locality;
|
@@ -3354,7 +3501,8 @@ grpc_slice XdsApi::CreateLrsInitialRequest(
|
|
3354
3501
|
envoy_config_core_v3_Node* node_msg =
|
3355
3502
|
envoy_service_load_stats_v3_LoadStatsRequest_mutable_node(request,
|
3356
3503
|
arena.ptr());
|
3357
|
-
PopulateNode(context, node_, build_version_, user_agent_name_,
|
3504
|
+
PopulateNode(context, node_, build_version_, user_agent_name_,
|
3505
|
+
user_agent_version_, node_msg);
|
3358
3506
|
envoy_config_core_v3_Node_add_client_features(
|
3359
3507
|
node_msg, upb_strview_makez("envoy.lrs.supports_send_all_clusters"),
|
3360
3508
|
arena.ptr());
|
@@ -3476,10 +3624,10 @@ grpc_slice XdsApi::CreateLrsRequest(
|
|
3476
3624
|
return SerializeLrsRequest(context, request);
|
3477
3625
|
}
|
3478
3626
|
|
3479
|
-
|
3480
|
-
|
3481
|
-
|
3482
|
-
|
3627
|
+
grpc_error_handle XdsApi::ParseLrsResponse(
|
3628
|
+
const grpc_slice& encoded_response, bool* send_all_clusters,
|
3629
|
+
std::set<std::string>* cluster_names,
|
3630
|
+
grpc_millis* load_reporting_interval) {
|
3483
3631
|
upb::Arena arena;
|
3484
3632
|
// Decode the response.
|
3485
3633
|
const envoy_service_load_stats_v3_LoadStatsResponse* decoded_response =
|
@@ -3521,7 +3669,7 @@ google_protobuf_Timestamp* GrpcMillisToTimestamp(const EncodingContext& context,
|
|
3521
3669
|
grpc_millis value) {
|
3522
3670
|
google_protobuf_Timestamp* timestamp =
|
3523
3671
|
google_protobuf_Timestamp_new(context.arena);
|
3524
|
-
gpr_timespec timespec = grpc_millis_to_timespec(value,
|
3672
|
+
gpr_timespec timespec = grpc_millis_to_timespec(value, GPR_CLOCK_REALTIME);
|
3525
3673
|
google_protobuf_Timestamp_set_seconds(timestamp, timespec.tv_sec);
|
3526
3674
|
google_protobuf_Timestamp_set_nanos(timestamp, timespec.tv_nsec);
|
3527
3675
|
return timestamp;
|
@@ -3751,7 +3899,8 @@ std::string XdsApi::AssembleClientConfig(
|
|
3751
3899
|
arena.ptr());
|
3752
3900
|
const EncodingContext context = {client_, tracer_, symtab_.ptr(), arena.ptr(),
|
3753
3901
|
true};
|
3754
|
-
PopulateNode(context, node_, build_version_, user_agent_name_,
|
3902
|
+
PopulateNode(context, node_, build_version_, user_agent_name_,
|
3903
|
+
user_agent_version_, node);
|
3755
3904
|
// Dump each xDS-type config into PerXdsConfig
|
3756
3905
|
for (auto& p : resource_type_metadata_map) {
|
3757
3906
|
absl::string_view type_url = p.first;
|