grpc 1.84.0 → 1.85.0.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +40 -27
- data/include/grpc/event_engine/memory_allocator.h +1 -0
- data/include/grpc/grpc.h +3 -0
- data/include/grpc/grpc_security_constants.h +2 -0
- data/include/grpc/impl/channel_arg_names.h +4 -0
- data/src/core/call/call_filters.h +10 -10
- data/src/core/{lib/security/authorization → call}/evaluate_args.cc +22 -1
- data/src/core/{lib/security/authorization → call}/evaluate_args.h +19 -5
- data/src/core/call/filter_fusion.h +15 -15
- data/src/core/call/interception_chain.h +3 -3
- data/src/core/call/metadata_batch.cc +1 -0
- data/src/core/call/metadata_batch.h +45 -33
- data/src/core/call/parsed_metadata.h +3 -3
- data/src/core/call/request_buffer.cc +6 -6
- data/src/core/call/request_buffer.h +1 -1
- data/src/core/channelz/channel_trace.cc +5 -5
- data/src/core/channelz/channel_trace.h +1 -1
- data/src/core/channelz/channelz.cc +9 -9
- data/src/core/channelz/channelz.h +12 -12
- data/src/core/channelz/channelz_registry.cc +10 -10
- data/src/core/channelz/ztrace_collector.h +5 -5
- data/src/core/client_channel/client_channel.cc +4 -4
- data/src/core/client_channel/client_channel_filter.cc +14 -14
- data/src/core/client_channel/global_subchannel_pool.cc +4 -4
- data/src/core/client_channel/subchannel.cc +24 -23
- data/src/core/client_channel/subchannel_stream_client.cc +5 -5
- data/src/core/credentials/call/external/aws_external_account_credentials.cc +7 -7
- data/src/core/credentials/call/external/aws_request_signer.cc +16 -0
- data/src/core/credentials/call/external/external_account_credentials.cc +4 -4
- data/src/core/credentials/call/regional_access_boundary_fetcher.cc +9 -9
- data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.cc +4 -4
- data/src/core/credentials/transport/google_default/google_default_credentials.cc +3 -3
- data/src/core/credentials/transport/ssl/ssl_security_connector.cc +1 -1
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.cc +9 -9
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.h +1 -1
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc +6 -6
- data/src/core/credentials/transport/tls/grpc_tls_certificate_verifier.cc +3 -3
- data/src/core/credentials/transport/tls/grpc_tls_crl_provider.cc +4 -4
- data/src/core/credentials/transport/tls/ssl_utils.cc +10 -0
- data/src/core/credentials/transport/tls/tls_security_connector.cc +10 -10
- data/src/core/credentials/transport/tls/tls_security_connector.h +6 -6
- data/src/core/credentials/transport/tls/tls_utils.h +9 -0
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +1 -1
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +1 -1
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +2 -2
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +1 -1
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +15 -0
- data/src/core/ext/filters/rbac/rbac_filter.h +1 -1
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +5 -5
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +30 -21
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +5 -11
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +14 -11
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +0 -4
- data/src/core/ext/transport/chttp2/transport/frame.h +9 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +12 -9
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +4 -2
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +16 -18
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +2 -1
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.cc +277 -189
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.h +40 -17
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +12 -24
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +3 -29
- data/src/core/ext/transport/chttp2/transport/internal.h +2 -2
- data/src/core/ext/transport/chttp2/transport/parsing.cc +3 -2
- data/src/core/ext/transport/chttp2/transport/read_context.h +96 -3
- data/src/core/ext/transport/chttp2/transport/reclaimer.cc +32 -0
- data/src/core/ext/transport/chttp2/transport/reclaimer.h +64 -0
- data/src/core/ext/transport/chttp2/transport/security_frame.h +8 -8
- data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +17 -9
- data/src/core/ext/transport/chttp2/transport/write_cycle.h +23 -3
- data/src/core/ext/transport/inproc/inproc_transport.cc +5 -5
- data/src/core/ext/upb-gen/grpc/channelz/v1/channelz.upb.h +137 -73
- data/src/core/ext/upb-gen/grpc/channelz/v1/channelz.upb_minitable.c +45 -25
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/altscontext.upb.h +6 -6
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/altscontext.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/altscontext.upb_minitable.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/handshaker.upb.h +46 -26
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/handshaker.upb_minitable.c +17 -14
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/handshaker.upb_minitable.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/transport_security_common.upb.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/transport_security_common.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/transport_security_common.upb_minitable.h +5 -5
- data/src/core/ext/upb-gen/grpc/health/v1/health.upb.h +329 -0
- data/src/core/ext/upb-gen/grpc/health/v1/health.upb_minitable.c +128 -0
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/health/v1/health.upb_minitable.h +8 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lb/v1/load_balancer.upb.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lb/v1/load_balancer.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lb/v1/load_balancer.upb_minitable.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lookup/v1/rls.upb.h +185 -23
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lookup/v1/rls.upb_minitable.c +20 -12
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lookup/v1/rls.upb_minitable.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lookup/v1/rls_config.upb.h +58 -42
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lookup/v1/rls_config.upb_minitable.c +17 -12
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lookup/v1/rls_config.upb_minitable.h +5 -5
- data/src/core/ext/upbdefs-gen/grpc/channelz/v1/channelz.upbdefs.c +567 -549
- data/src/core/ext/upbdefs-gen/grpc/lookup/v1/rls_config.upbdefs.c +182 -0
- data/src/core/ext/upbdefs-gen/{src/proto/grpc → grpc}/lookup/v1/rls_config.upbdefs.h +14 -14
- data/src/core/filter/ext_proc/ext_proc_filter.cc +1603 -46
- data/src/core/filter/ext_proc/ext_proc_filter.h +55 -22
- data/src/core/filter/ext_proc/ext_proc_messages.cc +106 -51
- data/src/core/filter/ext_proc/ext_proc_messages.h +36 -9
- data/src/core/handshaker/handshaker.cc +4 -4
- data/src/core/handshaker/http_connect/http_connect_client_handshaker.cc +3 -3
- data/src/core/handshaker/security/pipelined_secure_endpoint.cc +10 -10
- data/src/core/handshaker/security/secure_endpoint.cc +13 -13
- data/src/core/handshaker/security/security_handshaker.cc +6 -6
- data/src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc +4 -4
- data/src/core/lib/channel/channel_args.cc +20 -0
- data/src/core/lib/channel/channel_args.h +17 -17
- data/src/core/lib/channel/promise_based_filter.cc +2 -2
- data/src/core/lib/channel/promise_based_filter.h +66 -27
- data/src/core/lib/debug/trace_flags.cc +2 -0
- data/src/core/lib/debug/trace_flags.h +1 -0
- data/src/core/lib/event_engine/ares_resolver.cc +14 -14
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +7 -7
- data/src/core/lib/event_engine/cf_engine/cfsocket_listener.cc +4 -4
- data/src/core/lib/event_engine/default_event_engine.cc +5 -5
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +9 -9
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +16 -14
- data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.cc +6 -6
- data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +1 -1
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +7 -7
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +17 -17
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +3 -3
- data/src/core/lib/event_engine/posix_engine/timer.cc +5 -5
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +5 -5
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +3 -3
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +1 -1
- data/src/core/lib/event_engine/thread_pool/thread_count.cc +1 -1
- data/src/core/lib/event_engine/thread_pool/thread_count.h +3 -3
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +50 -21
- data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc +3 -3
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +3 -3
- data/src/core/lib/event_engine/windows/windows_engine.cc +15 -15
- data/src/core/lib/event_engine/windows/windows_listener.cc +6 -6
- data/src/core/lib/event_engine/work_queue/basic_work_queue.cc +6 -6
- data/src/core/lib/experiments/experiments.cc +48 -0
- data/src/core/lib/experiments/experiments.h +24 -0
- data/src/core/lib/iomgr/buffer_list.cc +3 -3
- data/src/core/lib/iomgr/buffer_list.h +1 -1
- data/src/core/lib/iomgr/combiner.cc +0 -1
- data/src/core/lib/iomgr/ev_apple.cc +4 -4
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +2 -2
- data/src/core/lib/iomgr/tcp_client_posix.cc +3 -3
- data/src/core/lib/iomgr/tcp_posix.cc +7 -7
- data/src/core/lib/promise/activity.cc +1 -1
- data/src/core/lib/promise/activity.h +1 -1
- data/src/core/lib/promise/arena_promise.h +7 -7
- data/src/core/lib/promise/detail/promise_factory.h +8 -8
- data/src/core/lib/promise/detail/promise_like.h +4 -4
- data/src/core/lib/promise/inter_activity_latch.h +6 -6
- data/src/core/lib/promise/inter_activity_pipe.h +1 -1
- data/src/core/lib/promise/observable.h +3 -3
- data/src/core/lib/promise/party.cc +1 -1
- data/src/core/lib/promise/try_seq.h +2 -2
- data/src/core/lib/resource_quota/arena.h +3 -3
- data/src/core/lib/resource_quota/memory_quota.cc +16 -16
- data/src/core/lib/resource_quota/memory_quota.h +1 -1
- data/src/core/lib/resource_quota/thread_quota.cc +3 -3
- data/src/core/lib/security/authorization/audit_logging.cc +5 -5
- data/src/core/lib/security/authorization/authorization_engine.h +1 -1
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +1 -1
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +1 -1
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +1 -1
- data/src/core/lib/security/authorization/matchers.h +1 -1
- data/src/core/lib/surface/call.cc +8 -7
- data/src/core/lib/surface/call.h +3 -3
- data/src/core/lib/surface/call_utils.h +4 -0
- data/src/core/lib/surface/channel.cc +1 -1
- data/src/core/lib/surface/channel.h +1 -1
- data/src/core/lib/surface/channel_init.cc +1 -1
- data/src/core/lib/surface/init.cc +7 -7
- data/src/core/lib/surface/lame_client.cc +1 -1
- data/src/core/lib/surface/legacy_channel.cc +2 -2
- data/src/core/lib/surface/version.cc +1 -1
- data/src/core/lib/transport/transport_framing_endpoint_extension.h +3 -3
- data/src/core/load_balancing/autosharding/autosharding.cc +931 -0
- data/src/core/load_balancing/autosharding/autosharding.h +78 -0
- data/src/core/load_balancing/grpclb/grpclb_client_stats.cc +2 -2
- data/src/core/load_balancing/grpclb/load_balancer_api.cc +1 -1
- data/src/core/load_balancing/grpclb/load_balancer_api.h +3 -1
- data/src/core/load_balancing/health_check_client.cc +7 -7
- data/src/core/load_balancing/lb_policy.cc +1 -1
- data/src/core/load_balancing/oob_backend_metric.cc +5 -5
- data/src/core/load_balancing/outlier_detection/outlier_detection.cc +2 -2
- data/src/core/load_balancing/ring_hash/ring_hash.cc +109 -37
- data/src/core/load_balancing/rls/rls.cc +23 -17
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +10 -10
- data/src/core/load_balancing/xds/cds.cc +6 -5
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +2 -2
- data/src/core/load_balancing/xds/xds_override_host.cc +10 -10
- data/src/core/mitigation_engine/mitigation_engine.h +28 -4
- data/src/core/plugin_registry/grpc_plugin_registry.cc +2 -0
- data/src/core/resolver/dns/dns_resolver.cc +7 -7
- data/src/core/resolver/fake/fake_resolver.cc +5 -5
- data/src/core/resolver/google_c2p/google_c2p_resolver.cc +38 -30
- data/src/core/server/server.cc +30 -30
- data/src/core/server/server.h +4 -3
- data/src/core/server/server_config_selector_filter.cc +3 -3
- data/src/core/server/xds_server_config_fetcher_legacy.cc +15 -15
- data/src/core/telemetry/default_tcp_tracer.cc +1 -1
- data/src/core/telemetry/instrument.cc +30 -16
- data/src/core/telemetry/instrument.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +4 -4
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +2 -2
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +1 -1
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +1 -1
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +5 -5
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +3 -3
- data/src/core/tsi/ssl_transport_security.cc +46 -13
- data/src/core/tsi/ssl_transport_security.h +7 -0
- data/src/core/tsi/ssl_transport_security_utils.cc +16 -6
- data/src/core/util/event_log.cc +3 -3
- data/src/core/util/http_client/httpcli.cc +5 -5
- data/src/core/util/http_client/httpcli.h +1 -1
- data/src/core/util/json/json_object_loader.cc +7 -0
- data/src/core/util/json/json_object_loader.h +17 -2
- data/src/core/util/latent_see.cc +123 -36
- data/src/core/util/latent_see.h +14 -1
- data/src/core/util/mpscq.cc +1 -1
- data/src/core/util/notification.h +4 -4
- data/src/core/util/sync.h +20 -6
- data/src/core/util/table.h +20 -22
- data/src/core/util/work_serializer.cc +2 -2
- data/src/core/xds/grpc/blackboard.cc +4 -3
- data/src/core/xds/grpc/certificate_provider_store.cc +2 -2
- data/src/core/xds/grpc/streaming_call_promise_wrapper.cc +181 -0
- data/src/core/xds/grpc/streaming_call_promise_wrapper.h +213 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc_builder.cc +2 -2
- data/src/core/xds/grpc/xds_client_grpc.cc +8 -8
- data/src/core/xds/grpc/xds_cluster_specifier_plugin.cc +2 -2
- data/src/core/xds/grpc/xds_endpoint.cc +1 -1
- data/src/core/xds/grpc/xds_endpoint_parser.cc +11 -0
- data/src/core/xds/grpc/xds_grpc_service_parser.cc +12 -10
- data/src/core/xds/grpc/xds_http_ext_proc_filter.cc +17 -14
- data/src/core/xds/grpc/xds_matcher.h +2 -2
- data/src/core/xds/grpc/xds_transport_grpc.cc +125 -85
- data/src/core/xds/grpc/xds_transport_grpc.h +19 -4
- data/src/core/xds/xds_client/lrs_client.cc +22 -19
- data/src/core/xds/xds_client/xds_client.cc +19 -16
- data/src/core/xds/xds_client/xds_transport.h +49 -3
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +2 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +3 -0
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/README.md +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +1 -1
- data/third_party/abseil-cpp/absl/algorithm/algorithm.h +34 -2
- data/third_party/abseil-cpp/absl/algorithm/container.h +345 -147
- data/third_party/abseil-cpp/absl/base/attributes.h +67 -44
- data/third_party/abseil-cpp/absl/base/call_once.h +1 -0
- data/third_party/abseil-cpp/absl/base/casts.cc +61 -0
- data/third_party/abseil-cpp/absl/base/casts.h +135 -2
- data/third_party/abseil-cpp/absl/base/config.h +63 -41
- data/third_party/abseil-cpp/absl/base/fast_type_id.h +30 -2
- data/third_party/abseil-cpp/absl/base/internal/dynamic_annotations.h +1 -1
- data/third_party/abseil-cpp/absl/base/internal/hardening.h +136 -0
- data/third_party/abseil-cpp/absl/base/internal/iterator_traits.h +6 -2
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +39 -4
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +6 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h +77 -15
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +3 -4
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +26 -24
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +74 -29
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +1 -11
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +52 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +5 -1
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +5 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h +1 -1
- data/third_party/abseil-cpp/absl/base/macros.h +76 -37
- data/third_party/abseil-cpp/absl/base/nullability.h +5 -5
- data/third_party/abseil-cpp/absl/base/optimization.h +4 -5
- data/third_party/abseil-cpp/absl/base/options.h +46 -18
- data/third_party/abseil-cpp/absl/base/policy_checks.h +5 -5
- data/third_party/abseil-cpp/absl/base/{internal/throw_delegate.cc → throw_delegate.cc} +9 -7
- data/third_party/abseil-cpp/absl/base/{internal/throw_delegate.h → throw_delegate.h} +4 -14
- data/third_party/abseil-cpp/absl/cleanup/cleanup.h +7 -2
- data/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h +3 -2
- data/third_party/abseil-cpp/absl/container/btree_map.h +60 -10
- data/third_party/abseil-cpp/absl/container/btree_set.h +61 -15
- data/third_party/abseil-cpp/absl/container/fixed_array.h +19 -21
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +49 -27
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +50 -26
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +42 -36
- data/third_party/abseil-cpp/absl/container/internal/btree.h +32 -24
- data/third_party/abseil-cpp/absl/container/internal/btree_container.h +30 -22
- data/third_party/abseil-cpp/absl/container/internal/common.h +57 -5
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -1
- data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +40 -36
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +119 -39
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +14 -2
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +14 -22
- data/third_party/abseil-cpp/absl/container/internal/hashtable_control_bytes.h +52 -52
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +7 -7
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +7 -7
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +32 -40
- data/third_party/abseil-cpp/absl/container/internal/layout.h +13 -13
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +95 -72
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +633 -365
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +1016 -749
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set_resize_impl.h +0 -1
- data/third_party/abseil-cpp/absl/container/node_hash_map.h +58 -35
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc +23 -6
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.h +7 -1
- data/third_party/abseil-cpp/absl/crc/internal/crc.cc +4 -6
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +41 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_internal.h +0 -16
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_arm_combined.cc +5 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +304 -188
- data/third_party/abseil-cpp/absl/crc/internal/non_temporal_arm_intrinsics.h +4 -2
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +2 -2
- data/third_party/abseil-cpp/absl/debugging/internal/demangle_rust.h +8 -0
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +4 -4
- data/third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc +15 -1
- data/third_party/abseil-cpp/absl/debugging/internal/examine_stack.h +7 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +12 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +6 -5
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +13 -11
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +14 -7
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +3 -2
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +6 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +14 -8
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +48 -38
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +4 -0
- data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +63 -118
- data/third_party/abseil-cpp/absl/debugging/stacktrace.h +7 -47
- data/third_party/abseil-cpp/absl/debugging/symbolize.cc +20 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +83 -149
- data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +4 -17
- data/third_party/abseil-cpp/absl/debugging/symbolize_unimplemented.inc +4 -4
- data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +2 -4
- data/third_party/abseil-cpp/absl/flags/commandlineflag.h +8 -6
- data/third_party/abseil-cpp/absl/flags/declare.h +9 -0
- data/third_party/abseil-cpp/absl/flags/flag.h +2 -1
- data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.h +1 -1
- data/third_party/abseil-cpp/absl/flags/internal/flag.cc +19 -18
- data/third_party/abseil-cpp/absl/flags/internal/flag.h +33 -34
- data/third_party/abseil-cpp/absl/flags/internal/program_name.cc +2 -2
- data/third_party/abseil-cpp/absl/flags/marshalling.cc +1 -16
- data/third_party/abseil-cpp/absl/flags/marshalling.h +2 -28
- data/third_party/abseil-cpp/absl/flags/reflection.cc +11 -7
- data/third_party/abseil-cpp/absl/flags/usage_config.cc +2 -2
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +22 -19
- data/third_party/abseil-cpp/absl/functional/bind_front.h +7 -1
- data/third_party/abseil-cpp/absl/functional/function_ref.h +125 -20
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +43 -31
- data/third_party/abseil-cpp/absl/functional/internal/front_binder.h +4 -4
- data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +44 -6
- data/third_party/abseil-cpp/absl/hash/hash.h +1 -1
- data/third_party/abseil-cpp/absl/hash/internal/city.cc +39 -51
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +379 -14
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +457 -353
- data/third_party/abseil-cpp/absl/log/absl_vlog_is_on.h +0 -2
- data/third_party/abseil-cpp/absl/log/internal/check_impl.h +2 -1
- data/third_party/abseil-cpp/absl/log/internal/check_op.cc +4 -0
- data/third_party/abseil-cpp/absl/log/internal/check_op.h +128 -50
- data/third_party/abseil-cpp/absl/log/internal/conditions.h +38 -35
- data/third_party/abseil-cpp/absl/log/internal/log_impl.h +108 -110
- data/third_party/abseil-cpp/absl/log/internal/log_message.cc +10 -6
- data/third_party/abseil-cpp/absl/log/internal/log_message.h +19 -1
- data/third_party/abseil-cpp/absl/log/internal/log_sink_set.cc +4 -4
- data/third_party/abseil-cpp/absl/log/internal/nullstream.h +1 -1
- data/third_party/abseil-cpp/absl/log/internal/proto.cc +13 -0
- data/third_party/abseil-cpp/absl/log/internal/strip.h +30 -31
- data/third_party/abseil-cpp/absl/log/internal/structured_proto.cc +5 -5
- data/third_party/abseil-cpp/absl/log/internal/structured_proto.h +6 -5
- data/third_party/abseil-cpp/absl/log/internal/vlog_config.cc +30 -30
- data/third_party/abseil-cpp/absl/log/internal/vlog_config.h +0 -1
- data/third_party/abseil-cpp/absl/log/log.h +2 -2
- data/third_party/abseil-cpp/absl/log/log_entry.cc +263 -0
- data/third_party/abseil-cpp/absl/log/log_entry.h +2 -0
- data/third_party/abseil-cpp/absl/log/vlog_is_on.h +0 -2
- data/third_party/abseil-cpp/absl/memory/memory.h +55 -5
- data/third_party/abseil-cpp/absl/meta/type_traits.h +161 -56
- data/third_party/abseil-cpp/absl/numeric/int128.h +41 -21
- data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +16 -22
- data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +5 -7
- data/third_party/abseil-cpp/absl/numeric/internal/bits.h +32 -4
- data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +9 -9
- data/third_party/abseil-cpp/absl/random/beta_distribution.h +2 -2
- data/third_party/abseil-cpp/absl/random/bit_gen_ref.h +26 -53
- data/third_party/abseil-cpp/absl/random/discrete_distribution.h +1 -1
- data/third_party/abseil-cpp/absl/random/distributions.h +17 -17
- data/third_party/abseil-cpp/absl/random/exponential_distribution.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +8 -21
- data/third_party/abseil-cpp/absl/random/internal/entropy_pool.cc +2 -2
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/generate_real.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/iostream_state_saver.h +2 -2
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +2 -2
- data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +6 -6
- data/third_party/abseil-cpp/absl/random/internal/platform.h +0 -13
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +6 -6
- data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +2 -2
- data/third_party/abseil-cpp/absl/random/internal/salted_seed_seq.h +6 -5
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +5 -31
- data/third_party/abseil-cpp/absl/random/internal/seed_material.h +2 -1
- data/third_party/abseil-cpp/absl/random/internal/traits.h +21 -0
- data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +23 -23
- data/third_party/abseil-cpp/absl/random/mocking_access.h +74 -0
- data/third_party/abseil-cpp/absl/random/uniform_real_distribution.h +1 -1
- data/third_party/abseil-cpp/absl/status/internal/status_internal.cc +63 -18
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +30 -4
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +225 -63
- data/third_party/abseil-cpp/absl/status/status.cc +66 -70
- data/third_party/abseil-cpp/absl/status/status.h +254 -23
- data/third_party/abseil-cpp/absl/status/status_payload_printer.h +3 -2
- data/third_party/abseil-cpp/absl/status/statusor.h +117 -137
- data/third_party/abseil-cpp/absl/strings/ascii.h +10 -6
- data/third_party/abseil-cpp/absl/strings/cord.cc +41 -17
- data/third_party/abseil-cpp/absl/strings/cord.h +26 -17
- data/third_party/abseil-cpp/absl/strings/cord_buffer.h +4 -2
- data/third_party/abseil-cpp/absl/strings/escaping.cc +305 -125
- data/third_party/abseil-cpp/absl/strings/escaping.h +12 -2
- data/third_party/abseil-cpp/absl/strings/internal/append_and_overwrite.h +93 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +6 -6
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +27 -21
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +11 -19
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.cc +6 -0
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.h +1 -0
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +0 -141
- data/third_party/abseil-cpp/absl/strings/internal/escaping.h +2 -24
- data/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h +31 -36
- data/third_party/abseil-cpp/absl/strings/internal/stl_type_traits.h +39 -39
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +14 -22
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +2 -4
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +921 -231
- data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +18 -16
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +16 -12
- data/third_party/abseil-cpp/absl/strings/internal/stringify_sink.h +12 -0
- data/third_party/abseil-cpp/absl/strings/numbers.cc +477 -8
- data/third_party/abseil-cpp/absl/strings/numbers.h +29 -12
- data/third_party/abseil-cpp/absl/strings/resize_and_overwrite.h +198 -0
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +96 -91
- data/third_party/abseil-cpp/absl/strings/str_cat.h +53 -13
- data/third_party/abseil-cpp/absl/strings/str_split.h +14 -9
- data/third_party/abseil-cpp/absl/strings/string_view.h +10 -716
- data/third_party/abseil-cpp/absl/strings/substitute.cc +24 -24
- data/third_party/abseil-cpp/absl/strings/substitute.h +2 -2
- data/third_party/abseil-cpp/absl/synchronization/barrier.cc +1 -1
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc +2 -2
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +24 -3
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +30 -33
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +2 -2
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +5 -0
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +41 -29
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +199 -94
- data/third_party/abseil-cpp/absl/synchronization/notification.cc +5 -5
- data/third_party/abseil-cpp/absl/synchronization/notification.h +1 -1
- data/third_party/abseil-cpp/absl/time/clock.cc +29 -30
- data/third_party/abseil-cpp/absl/time/clock.h +3 -0
- data/third_party/abseil-cpp/absl/time/duration.cc +2 -2
- data/third_party/abseil-cpp/absl/time/format.cc +3 -10
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +12 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +131 -91
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +6 -103
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_name_win.cc +185 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_name_win.h +37 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +10 -15
- data/third_party/abseil-cpp/absl/time/time.cc +4 -4
- data/third_party/abseil-cpp/absl/time/time.h +14 -13
- data/third_party/abseil-cpp/absl/types/compare.h +64 -63
- data/third_party/abseil-cpp/absl/types/internal/span.h +6 -6
- data/third_party/abseil-cpp/absl/types/optional.h +31 -4
- data/third_party/abseil-cpp/absl/types/optional_ref.h +295 -0
- data/third_party/{boringssl-with-bazel/crypto/x509/x_val.cc → abseil-cpp/absl/types/source_location.cc} +4 -14
- data/third_party/abseil-cpp/absl/types/source_location.h +172 -0
- data/third_party/abseil-cpp/absl/types/span.h +67 -38
- data/third_party/abseil-cpp/absl/types/variant.h +75 -18
- data/third_party/abseil-cpp/absl/utility/utility.h +112 -16
- data/third_party/boringssl-with-bazel/crypto/aes/aes.cc +3 -0
- data/third_party/boringssl-with-bazel/crypto/armv8_feature_parsing.h +67 -0
- data/third_party/boringssl-with-bazel/crypto/asn1/a_bitstr.cc +143 -105
- data/third_party/boringssl-with-bazel/crypto/asn1/a_bool.cc +5 -8
- data/third_party/boringssl-with-bazel/crypto/asn1/a_d2i_fp.cc +3 -3
- data/third_party/boringssl-with-bazel/crypto/asn1/a_dup.cc +6 -6
- data/third_party/boringssl-with-bazel/crypto/asn1/a_gentm.cc +33 -12
- data/third_party/boringssl-with-bazel/crypto/asn1/a_i2d_fp.cc +7 -6
- data/third_party/boringssl-with-bazel/crypto/asn1/a_int.cc +80 -52
- data/third_party/boringssl-with-bazel/crypto/asn1/a_mbstr.cc +7 -4
- data/third_party/boringssl-with-bazel/crypto/asn1/a_object.cc +70 -72
- data/third_party/boringssl-with-bazel/crypto/asn1/a_strex.cc +38 -42
- data/third_party/boringssl-with-bazel/crypto/asn1/a_strnid.cc +41 -39
- data/third_party/boringssl-with-bazel/crypto/asn1/a_time.cc +59 -35
- data/third_party/boringssl-with-bazel/crypto/asn1/a_type.cc +275 -15
- data/third_party/boringssl-with-bazel/crypto/asn1/a_utctm.cc +32 -13
- data/third_party/boringssl-with-bazel/crypto/asn1/asn1_lib.cc +128 -30
- data/third_party/boringssl-with-bazel/crypto/asn1/asn_pack.cc +10 -10
- data/third_party/boringssl-with-bazel/crypto/asn1/f_int.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/asn1/f_string.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/asn1/internal.h +261 -115
- data/third_party/boringssl-with-bazel/crypto/asn1/posix_time.cc +8 -5
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_dec.cc +373 -725
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_enc.cc +211 -526
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_fre.cc +22 -19
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_new.cc +26 -24
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_typ.cc +19 -5
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_utl.cc +47 -51
- data/third_party/boringssl-with-bazel/crypto/base64/base64.cc +14 -15
- data/third_party/boringssl-with-bazel/crypto/bcm_support.h +7 -29
- data/third_party/boringssl-with-bazel/crypto/bio/bio.cc +234 -176
- data/third_party/boringssl-with-bazel/crypto/bio/bio_mem.cc +72 -86
- data/third_party/boringssl-with-bazel/crypto/bio/connect.cc +153 -199
- data/third_party/boringssl-with-bazel/crypto/bio/errno.cc +3 -1
- data/third_party/boringssl-with-bazel/crypto/bio/fd.cc +56 -55
- data/third_party/boringssl-with-bazel/crypto/bio/file.cc +70 -78
- data/third_party/boringssl-with-bazel/crypto/bio/hexdump.cc +6 -4
- data/third_party/boringssl-with-bazel/crypto/bio/internal.h +69 -17
- data/third_party/boringssl-with-bazel/crypto/bio/pair.cc +117 -136
- data/third_party/boringssl-with-bazel/crypto/bio/printf.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/bio/socket.cc +116 -50
- data/third_party/boringssl-with-bazel/crypto/bio/socket_helper.cc +53 -5
- data/third_party/boringssl-with-bazel/crypto/blake2/blake2.cc +9 -5
- data/third_party/boringssl-with-bazel/crypto/bn/bn_asn1.cc +2 -2
- data/third_party/boringssl-with-bazel/crypto/bn/convert.cc +56 -70
- data/third_party/boringssl-with-bazel/crypto/bn/div.cc +102 -0
- data/third_party/boringssl-with-bazel/crypto/bn/exponentiation.cc +26 -42
- data/third_party/boringssl-with-bazel/crypto/bn/sqrt.cc +93 -0
- data/third_party/boringssl-with-bazel/crypto/buf/buf.cc +6 -5
- data/third_party/boringssl-with-bazel/crypto/bytestring/asn1_compat.cc +6 -5
- data/third_party/boringssl-with-bazel/crypto/bytestring/ber.cc +22 -20
- data/third_party/boringssl-with-bazel/crypto/bytestring/cbb.cc +119 -59
- data/third_party/boringssl-with-bazel/crypto/bytestring/cbs.cc +115 -31
- data/third_party/boringssl-with-bazel/crypto/bytestring/internal.h +79 -24
- data/third_party/boringssl-with-bazel/crypto/bytestring/unicode.cc +2 -2
- data/third_party/boringssl-with-bazel/crypto/chacha/chacha.cc +5 -3
- data/third_party/boringssl-with-bazel/crypto/chacha/internal.h +23 -22
- data/third_party/boringssl-with-bazel/crypto/cipher/derive_key.cc +14 -18
- data/third_party/boringssl-with-bazel/crypto/cipher/e_aesctrhmac.cc +73 -58
- data/third_party/boringssl-with-bazel/crypto/cipher/e_aeseax.cc +132 -70
- data/third_party/boringssl-with-bazel/crypto/cipher/e_aesgcmsiv.cc +390 -249
- data/third_party/boringssl-with-bazel/crypto/cipher/e_chacha20poly1305.cc +200 -137
- data/third_party/boringssl-with-bazel/crypto/cipher/e_des.cc +45 -29
- data/third_party/boringssl-with-bazel/crypto/cipher/e_null.cc +9 -5
- data/third_party/boringssl-with-bazel/crypto/cipher/e_rc2.cc +43 -28
- data/third_party/boringssl-with-bazel/crypto/cipher/e_rc4.cc +7 -5
- data/third_party/boringssl-with-bazel/crypto/cipher/e_tls.cc +250 -237
- data/third_party/boringssl-with-bazel/crypto/cipher/get_cipher.cc +12 -12
- data/third_party/boringssl-with-bazel/crypto/cipher/internal.h +59 -59
- data/third_party/boringssl-with-bazel/crypto/cipher/tls_cbc.cc +111 -111
- data/third_party/boringssl-with-bazel/crypto/cms/cms.cc +48 -42
- data/third_party/boringssl-with-bazel/crypto/conf/conf.cc +69 -63
- data/third_party/boringssl-with-bazel/crypto/conf/internal.h +11 -12
- data/third_party/boringssl-with-bazel/crypto/cpu_aarch64_apple.cc +8 -5
- data/third_party/boringssl-with-bazel/crypto/cpu_aarch64_fuchsia.cc +6 -1
- data/third_party/boringssl-with-bazel/crypto/cpu_aarch64_linux.cc +7 -1
- data/third_party/boringssl-with-bazel/crypto/cpu_aarch64_openbsd.cc +7 -21
- data/third_party/boringssl-with-bazel/crypto/cpu_aarch64_sysreg.cc +15 -41
- data/third_party/boringssl-with-bazel/crypto/cpu_aarch64_win.cc +16 -3
- data/third_party/boringssl-with-bazel/crypto/cpu_arm_freebsd.cc +4 -2
- data/third_party/boringssl-with-bazel/crypto/cpu_arm_linux.cc +54 -31
- data/third_party/boringssl-with-bazel/crypto/cpu_arm_linux.h +79 -101
- data/third_party/boringssl-with-bazel/crypto/cpu_intel.cc +51 -45
- data/third_party/boringssl-with-bazel/crypto/crypto.cc +26 -55
- data/third_party/boringssl-with-bazel/crypto/curve25519/curve25519.cc +28 -25
- data/third_party/boringssl-with-bazel/crypto/curve25519/curve25519_tables.h +6 -6
- data/third_party/boringssl-with-bazel/crypto/curve25519/internal.h +14 -15
- data/third_party/boringssl-with-bazel/crypto/curve25519/spake25519.cc +23 -20
- data/third_party/boringssl-with-bazel/crypto/des/des.cc +27 -19
- data/third_party/boringssl-with-bazel/crypto/des/internal.h +4 -9
- data/third_party/boringssl-with-bazel/crypto/dh/dh_asn1.cc +34 -49
- data/third_party/boringssl-with-bazel/crypto/dh/params.cc +44 -41
- data/third_party/boringssl-with-bazel/crypto/digest/digest_extra.cc +87 -40
- data/third_party/boringssl-with-bazel/crypto/dsa/dsa.cc +237 -260
- data/third_party/boringssl-with-bazel/crypto/dsa/dsa_asn1.cc +100 -173
- data/third_party/boringssl-with-bazel/crypto/dsa/internal.h +23 -21
- data/third_party/boringssl-with-bazel/crypto/ec/ec_asn1.cc +181 -209
- data/third_party/boringssl-with-bazel/crypto/ec/ec_derive.cc +26 -28
- data/third_party/boringssl-with-bazel/crypto/ec/hash_to_curve.cc +265 -174
- data/third_party/boringssl-with-bazel/crypto/ec/internal.h +54 -18
- data/third_party/boringssl-with-bazel/crypto/ecdh/ecdh.cc +7 -5
- data/third_party/boringssl-with-bazel/crypto/ecdsa/ecdsa_asn1.cc +50 -70
- data/third_party/boringssl-with-bazel/crypto/ecdsa/ecdsa_p1363.cc +54 -0
- data/third_party/boringssl-with-bazel/crypto/engine/engine.cc +7 -7
- data/third_party/boringssl-with-bazel/crypto/err/err.cc +116 -105
- data/third_party/boringssl-with-bazel/crypto/err/internal.h +8 -21
- data/third_party/boringssl-with-bazel/crypto/evp/evp.cc +238 -166
- data/third_party/boringssl-with-bazel/crypto/evp/evp_asn1.cc +202 -234
- data/third_party/boringssl-with-bazel/crypto/evp/evp_ctx.cc +260 -159
- data/third_party/boringssl-with-bazel/crypto/evp/evp_kem.cc +82 -0
- data/third_party/boringssl-with-bazel/crypto/evp/internal.h +292 -137
- data/third_party/boringssl-with-bazel/crypto/evp/p_dh.cc +198 -25
- data/third_party/boringssl-with-bazel/crypto/evp/p_dsa.cc +333 -0
- data/third_party/boringssl-with-bazel/crypto/evp/p_ec.cc +427 -42
- data/third_party/boringssl-with-bazel/crypto/evp/p_ed25519.cc +270 -14
- data/third_party/boringssl-with-bazel/crypto/evp/p_hkdf.cc +70 -102
- data/third_party/boringssl-with-bazel/crypto/evp/p_mldsa.cc +549 -0
- data/third_party/boringssl-with-bazel/crypto/evp/p_mlkem.cc +485 -0
- data/third_party/boringssl-with-bazel/crypto/evp/p_rsa.cc +666 -158
- data/third_party/boringssl-with-bazel/crypto/evp/p_x25519.cc +290 -28
- data/third_party/boringssl-with-bazel/crypto/evp/p_xwing.cc +273 -0
- data/third_party/boringssl-with-bazel/crypto/evp/pbkdf.cc +14 -7
- data/third_party/boringssl-with-bazel/crypto/evp/print.cc +34 -89
- data/third_party/boringssl-with-bazel/crypto/evp/scrypt.cc +23 -21
- data/third_party/boringssl-with-bazel/crypto/evp/sign.cc +23 -42
- data/third_party/boringssl-with-bazel/crypto/ex_data.cc +40 -41
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/aes.cc.inc +34 -28
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/aes_nohw.cc.inc +119 -121
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/cbc.cc.inc +16 -14
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/cfb.cc.inc +12 -10
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/ctr.cc.inc +7 -5
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/gcm.cc.inc +39 -29
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/gcm_nohw.cc.inc +15 -13
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/internal.h +193 -177
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/key_wrap.cc.inc +5 -3
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/mode_wrappers.cc.inc +7 -3
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/ofb.cc.inc +7 -5
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bcm.cc +24 -19
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bcm_interface.h +512 -384
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/add.cc.inc +7 -5
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/asm/x86_64-gcc.cc.inc +63 -44
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/bn.cc.inc +40 -37
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/bytes.cc.inc +27 -22
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/cmp.cc.inc +9 -7
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/ctx.cc.inc +62 -126
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/div.cc.inc +92 -167
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/div_extra.cc.inc +15 -12
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/exponentiation.cc.inc +96 -93
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/gcd.cc.inc +73 -92
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/gcd_extra.cc.inc +59 -71
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/generic.cc.inc +54 -57
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/internal.h +333 -255
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/jacobi.cc.inc +12 -19
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/montgomery.cc.inc +80 -95
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/montgomery_inv.cc.inc +53 -96
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/mul.cc.inc +58 -419
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/prime.cc.inc +164 -213
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/random.cc.inc +27 -26
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/rsaz_exp.cc.inc +12 -10
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/rsaz_exp.h +47 -49
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/shift.cc.inc +14 -17
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/sqrt.cc.inc +19 -108
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/aead.cc.inc +427 -105
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/cipher.cc.inc +412 -212
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/e_aes.cc.inc +230 -225
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/e_aesccm.cc.inc +115 -84
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/internal.h +374 -27
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cmac/cmac.cc.inc +28 -23
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/delocate.h +36 -40
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/dh/check.cc.inc +68 -78
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/dh/dh.cc.inc +154 -196
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/dh/internal.h +24 -24
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/digest/digest.cc.inc +40 -69
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/digest/digests.cc.inc +13 -7
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/digest/internal.h +13 -11
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/digest/md32_common.h +86 -81
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/digestsign/digestsign.cc.inc +38 -34
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/ec.cc.inc +187 -196
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/ec_key.cc.inc +196 -154
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/ec_montgomery.cc.inc +65 -125
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/felem.cc.inc +85 -22
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/internal.h +281 -287
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/oct.cc.inc +23 -22
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256.cc.inc +514 -573
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256_internal.h +193 -0
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/scalar.cc.inc +44 -39
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/simple.cc.inc +58 -90
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/simple_mul.cc.inc +39 -34
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/util.cc.inc +6 -3
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/wnaf.cc.inc +23 -20
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ecdh/ecdh.cc.inc +6 -3
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ecdsa/ecdsa.cc.inc +47 -37
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ecdsa/internal.h +5 -10
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/entropy/internal.h +38 -0
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/entropy/jitter.cc.inc +463 -0
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/entropy/sha512.cc.inc +329 -0
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/hkdf/hkdf.cc.inc +8 -6
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/hmac/hmac.cc.inc +19 -16
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/keccak/internal.h +41 -15
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/keccak/keccak.cc.inc +172 -44
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/mldsa/fips_known_values.inc +5 -5
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/mldsa/mldsa.cc.inc +1632 -766
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/mlkem/fips_known_values.inc +5 -5
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/mlkem/mlkem.cc.inc +740 -436
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rand/android_entropy_client.cc.inc +82 -0
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rand/ctrdrbg.cc.inc +240 -53
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rand/internal.h +41 -26
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rand/rand.cc.inc +221 -218
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rsa/internal.h +64 -67
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rsa/padding.cc.inc +49 -57
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rsa/rsa.cc.inc +247 -234
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rsa/rsa_impl.cc.inc +392 -692
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/self_check/fips.cc.inc +10 -10
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/self_check/self_check.cc.inc +479 -449
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/service_indicator/internal.h +34 -11
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/service_indicator/service_indicator.cc.inc +46 -43
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/sha/internal.h +61 -70
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/sha/sha1.cc.inc +27 -13
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/sha/sha256.cc.inc +46 -30
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/sha/sha512.cc.inc +47 -47
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/address.h +98 -73
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/fors.cc.inc +108 -98
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/fors.h +14 -24
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/merkle.cc.inc +94 -91
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/merkle.h +19 -31
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/params.h +156 -56
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/slhdsa.cc.inc +318 -132
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/thash.cc.inc +234 -81
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/thash.h +20 -34
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/wots.cc.inc +97 -96
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/wots.h +10 -20
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/tls/internal.h +2 -16
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/tls/kdf.cc.inc +26 -26
- data/third_party/boringssl-with-bazel/crypto/fuzzer_mode.cc +5 -5
- data/third_party/boringssl-with-bazel/crypto/hpke/hpke.cc +461 -97
- data/third_party/boringssl-with-bazel/crypto/hrss/hrss.cc +153 -149
- data/third_party/boringssl-with-bazel/crypto/hrss/internal.h +9 -13
- data/third_party/boringssl-with-bazel/crypto/internal.h +531 -394
- data/third_party/boringssl-with-bazel/crypto/kyber/internal.h +117 -12
- data/third_party/boringssl-with-bazel/crypto/kyber/kyber.cc +59 -58
- data/third_party/boringssl-with-bazel/crypto/lhash/internal.h +38 -37
- data/third_party/boringssl-with-bazel/crypto/lhash/lhash.cc +68 -65
- data/third_party/boringssl-with-bazel/crypto/md4/md4.cc +19 -6
- data/third_party/boringssl-with-bazel/crypto/md5/internal.h +6 -9
- data/third_party/boringssl-with-bazel/crypto/md5/md5.cc +18 -6
- data/third_party/boringssl-with-bazel/crypto/mem.cc +61 -65
- data/third_party/boringssl-with-bazel/crypto/mem_internal.h +671 -0
- data/third_party/boringssl-with-bazel/crypto/mldsa/mldsa.cc +238 -32
- data/third_party/boringssl-with-bazel/crypto/mlkem/mlkem.cc +21 -65
- data/third_party/boringssl-with-bazel/crypto/obj/obj.cc +132 -157
- data/third_party/boringssl-with-bazel/crypto/obj/obj_dat.h +79 -1
- data/third_party/boringssl-with-bazel/crypto/obj/obj_xref.cc +14 -11
- data/third_party/boringssl-with-bazel/crypto/params_internal.h +30 -0
- data/third_party/boringssl-with-bazel/crypto/pem/internal.h +20 -15
- data/third_party/boringssl-with-bazel/crypto/pem/pem_all.cc +20 -19
- data/third_party/boringssl-with-bazel/crypto/pem/pem_info.cc +72 -76
- data/third_party/boringssl-with-bazel/crypto/pem/pem_lib.cc +215 -217
- data/third_party/boringssl-with-bazel/crypto/pem/pem_oth.cc +6 -6
- data/third_party/boringssl-with-bazel/crypto/pem/pem_pk8.cc +13 -13
- data/third_party/boringssl-with-bazel/crypto/pem/pem_pkey.cc +11 -11
- data/third_party/boringssl-with-bazel/crypto/pkcs7/internal.h +12 -17
- data/third_party/boringssl-with-bazel/crypto/pkcs7/pkcs7.cc +29 -27
- data/third_party/boringssl-with-bazel/crypto/pkcs7/pkcs7_x509.cc +55 -49
- data/third_party/boringssl-with-bazel/crypto/pkcs8/internal.h +21 -26
- data/third_party/boringssl-with-bazel/crypto/pkcs8/p5_pbev2.cc +33 -31
- data/third_party/boringssl-with-bazel/crypto/pkcs8/pkcs8.cc +73 -81
- data/third_party/boringssl-with-bazel/crypto/pkcs8/pkcs8_x509.cc +139 -138
- data/third_party/boringssl-with-bazel/crypto/poly1305/internal.h +3 -7
- data/third_party/boringssl-with-bazel/crypto/poly1305/poly1305.cc +5 -4
- data/third_party/boringssl-with-bazel/crypto/poly1305/poly1305_arm.cc +43 -47
- data/third_party/boringssl-with-bazel/crypto/poly1305/poly1305_vec.cc +29 -26
- data/third_party/boringssl-with-bazel/crypto/pool/internal.h +64 -20
- data/third_party/boringssl-with-bazel/crypto/pool/pool.cc +177 -157
- data/third_party/boringssl-with-bazel/crypto/rand/deterministic.cc +9 -16
- data/third_party/boringssl-with-bazel/crypto/rand/fork_detect.cc +70 -42
- data/third_party/boringssl-with-bazel/crypto/rand/forkunsafe.cc +7 -7
- data/third_party/boringssl-with-bazel/crypto/rand/getentropy.cc +6 -13
- data/third_party/boringssl-with-bazel/crypto/rand/internal.h +16 -4
- data/third_party/boringssl-with-bazel/crypto/rand/ios.cc +4 -11
- data/third_party/boringssl-with-bazel/crypto/rand/rand.cc +11 -9
- data/third_party/boringssl-with-bazel/crypto/rand/trusty.cc +4 -11
- data/third_party/boringssl-with-bazel/crypto/rand/urandom.cc +16 -195
- data/third_party/boringssl-with-bazel/crypto/rand/windows.cc +12 -19
- data/third_party/boringssl-with-bazel/crypto/refcount.cc +7 -17
- data/third_party/boringssl-with-bazel/crypto/rsa/internal.h +22 -7
- data/third_party/boringssl-with-bazel/crypto/rsa/rsa_asn1.cc +199 -78
- data/third_party/boringssl-with-bazel/crypto/rsa/rsa_crypt.cc +49 -50
- data/third_party/boringssl-with-bazel/crypto/rsa/rsa_extra.cc +11 -0
- data/third_party/boringssl-with-bazel/crypto/rsa/rsa_print.cc +4 -6
- data/third_party/boringssl-with-bazel/crypto/sha/sha1.cc +3 -0
- data/third_party/boringssl-with-bazel/crypto/sha/sha256.cc +3 -1
- data/third_party/boringssl-with-bazel/crypto/sha/sha512.cc +6 -4
- data/third_party/boringssl-with-bazel/crypto/siphash/siphash.cc +2 -0
- data/third_party/boringssl-with-bazel/crypto/slhdsa/slhdsa.cc +43 -6
- data/third_party/boringssl-with-bazel/crypto/spake2plus/internal.h +31 -31
- data/third_party/boringssl-with-bazel/crypto/spake2plus/spake2plus.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/stack/stack.cc +89 -130
- data/third_party/boringssl-with-bazel/crypto/thread.cc +14 -14
- data/third_party/boringssl-with-bazel/crypto/thread_none.cc +10 -13
- data/third_party/boringssl-with-bazel/crypto/thread_pthread.cc +22 -35
- data/third_party/boringssl-with-bazel/crypto/thread_win.cc +29 -40
- data/third_party/boringssl-with-bazel/crypto/trust_token/internal.h +81 -88
- data/third_party/boringssl-with-bazel/crypto/trust_token/pmbtoken.cc +160 -144
- data/third_party/boringssl-with-bazel/crypto/trust_token/trust_token.cc +96 -80
- data/third_party/boringssl-with-bazel/crypto/trust_token/voprf.cc +90 -87
- data/third_party/boringssl-with-bazel/crypto/x509/a_digest.cc +5 -5
- data/third_party/boringssl-with-bazel/crypto/x509/a_sign.cc +51 -48
- data/third_party/boringssl-with-bazel/crypto/x509/a_verify.cc +30 -34
- data/third_party/boringssl-with-bazel/crypto/x509/algorithm.cc +47 -16
- data/third_party/boringssl-with-bazel/crypto/x509/asn1_gen.cc +41 -43
- data/third_party/boringssl-with-bazel/crypto/x509/by_dir.cc +183 -237
- data/third_party/boringssl-with-bazel/crypto/x509/by_file.cc +29 -30
- data/third_party/boringssl-with-bazel/crypto/x509/internal.h +276 -180
- data/third_party/boringssl-with-bazel/crypto/x509/name_print.cc +15 -13
- data/third_party/boringssl-with-bazel/crypto/x509/policy.cc +415 -525
- data/third_party/boringssl-with-bazel/crypto/x509/rsa_pss.cc +94 -271
- data/third_party/boringssl-with-bazel/crypto/x509/t_crl.cc +11 -8
- data/third_party/boringssl-with-bazel/crypto/x509/t_req.cc +26 -23
- data/third_party/boringssl-with-bazel/crypto/x509/t_x509.cc +26 -22
- data/third_party/boringssl-with-bazel/crypto/x509/t_x509a.cc +3 -1
- data/third_party/boringssl-with-bazel/crypto/x509/v3_akey.cc +69 -76
- data/third_party/boringssl-with-bazel/crypto/x509/v3_akeya.cc +2 -2
- data/third_party/boringssl-with-bazel/crypto/x509/v3_alt.cc +112 -69
- data/third_party/boringssl-with-bazel/crypto/x509/v3_bcons.cc +15 -14
- data/third_party/boringssl-with-bazel/crypto/x509/v3_bitst.cc +16 -18
- data/third_party/boringssl-with-bazel/crypto/x509/v3_conf.cc +62 -67
- data/third_party/boringssl-with-bazel/crypto/x509/v3_cpols.cc +143 -170
- data/third_party/boringssl-with-bazel/crypto/x509/v3_crld.cc +121 -165
- data/third_party/boringssl-with-bazel/crypto/x509/v3_enum.cc +13 -12
- data/third_party/boringssl-with-bazel/crypto/x509/v3_extku.cc +17 -34
- data/third_party/boringssl-with-bazel/crypto/x509/v3_genn.cc +20 -10
- data/third_party/boringssl-with-bazel/crypto/x509/v3_ia5.cc +22 -18
- data/third_party/boringssl-with-bazel/crypto/x509/v3_info.cc +45 -47
- data/third_party/boringssl-with-bazel/crypto/x509/v3_int.cc +35 -33
- data/third_party/boringssl-with-bazel/crypto/x509/v3_lib.cc +106 -61
- data/third_party/boringssl-with-bazel/crypto/x509/v3_ncons.cc +642 -358
- data/third_party/boringssl-with-bazel/crypto/x509/v3_ocsp.cc +25 -22
- data/third_party/boringssl-with-bazel/crypto/x509/v3_pcons.cc +15 -14
- data/third_party/boringssl-with-bazel/crypto/x509/v3_pmaps.cc +16 -15
- data/third_party/boringssl-with-bazel/crypto/x509/v3_prn.cc +6 -6
- data/third_party/boringssl-with-bazel/crypto/x509/v3_purp.cc +150 -137
- data/third_party/boringssl-with-bazel/crypto/x509/v3_skey.cc +23 -26
- data/third_party/boringssl-with-bazel/crypto/x509/v3_utl.cc +151 -178
- data/third_party/boringssl-with-bazel/crypto/x509/x509.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/x509/x509_att.cc +32 -30
- data/third_party/boringssl-with-bazel/crypto/x509/x509_cmp.cc +95 -88
- data/third_party/boringssl-with-bazel/crypto/x509/x509_d2.cc +9 -9
- data/third_party/boringssl-with-bazel/crypto/x509/x509_def.cc +6 -8
- data/third_party/boringssl-with-bazel/crypto/x509/x509_ext.cc +46 -24
- data/third_party/boringssl-with-bazel/crypto/x509/x509_lu.cc +211 -195
- data/third_party/boringssl-with-bazel/crypto/x509/x509_obj.cc +20 -16
- data/third_party/boringssl-with-bazel/crypto/x509/x509_req.cc +37 -46
- data/third_party/boringssl-with-bazel/crypto/x509/x509_set.cc +62 -90
- data/third_party/boringssl-with-bazel/crypto/x509/x509_trs.cc +18 -13
- data/third_party/boringssl-with-bazel/crypto/x509/x509_v3.cc +33 -33
- data/third_party/boringssl-with-bazel/crypto/x509/x509_vfy.cc +109 -110
- data/third_party/boringssl-with-bazel/crypto/x509/x509_vpm.cc +56 -47
- data/third_party/boringssl-with-bazel/crypto/x509/x509cset.cc +27 -40
- data/third_party/boringssl-with-bazel/crypto/x509/x509name.cc +77 -67
- data/third_party/boringssl-with-bazel/crypto/x509/x509rset.cc +5 -17
- data/third_party/boringssl-with-bazel/crypto/x509/x509spki.cc +13 -13
- data/third_party/boringssl-with-bazel/crypto/x509/x_algor.cc +131 -24
- data/third_party/boringssl-with-bazel/crypto/x509/x_all.cc +72 -39
- data/third_party/boringssl-with-bazel/crypto/x509/x_attrib.cc +10 -4
- data/third_party/boringssl-with-bazel/crypto/x509/x_crl.cc +77 -44
- data/third_party/boringssl-with-bazel/crypto/x509/x_exten.cc +6 -0
- data/third_party/boringssl-with-bazel/crypto/x509/x_name.cc +311 -383
- data/third_party/boringssl-with-bazel/crypto/x509/x_pubkey.cc +129 -82
- data/third_party/boringssl-with-bazel/crypto/x509/x_req.cc +11 -6
- data/third_party/boringssl-with-bazel/crypto/x509/x_sig.cc +4 -4
- data/third_party/boringssl-with-bazel/crypto/x509/x_spki.cc +11 -1
- data/third_party/boringssl-with-bazel/crypto/x509/x_x509.cc +285 -280
- data/third_party/boringssl-with-bazel/crypto/x509/x_x509a.cc +60 -60
- data/third_party/boringssl-with-bazel/crypto/xwing/xwing.cc +257 -0
- data/third_party/boringssl-with-bazel/gen/boringssl_prefix_symbols_internal_x86_64_win_asm.inc +301 -0
- data/third_party/boringssl-with-bazel/gen/boringssl_prefix_symbols_internal_x86_win_asm.inc +301 -0
- data/third_party/boringssl-with-bazel/gen/crypto/err_data.cc +526 -500
- data/third_party/boringssl-with-bazel/include/openssl/aead.h +286 -114
- data/third_party/boringssl-with-bazel/include/openssl/aes.h +43 -43
- data/third_party/boringssl-with-bazel/include/openssl/asm_base.h +29 -16
- data/third_party/boringssl-with-bazel/include/openssl/asn1.h +641 -631
- data/third_party/boringssl-with-bazel/include/openssl/asn1t.h +7 -9
- data/third_party/boringssl-with-bazel/include/openssl/base.h +34 -54
- data/third_party/boringssl-with-bazel/include/openssl/base64.h +30 -30
- data/third_party/boringssl-with-bazel/include/openssl/bio.h +373 -316
- data/third_party/boringssl-with-bazel/include/openssl/blake2.h +15 -11
- data/third_party/boringssl-with-bazel/include/openssl/blowfish.h +10 -3
- data/third_party/boringssl-with-bazel/include/openssl/bn.h +298 -306
- data/third_party/boringssl-with-bazel/include/openssl/buf.h +14 -14
- data/third_party/boringssl-with-bazel/include/openssl/bytestring.h +272 -207
- data/third_party/boringssl-with-bazel/include/openssl/cast.h +45 -8
- data/third_party/boringssl-with-bazel/include/openssl/chacha.h +3 -3
- data/third_party/boringssl-with-bazel/include/openssl/cipher.h +334 -152
- data/third_party/boringssl-with-bazel/include/openssl/cmac.h +13 -13
- data/third_party/boringssl-with-bazel/include/openssl/cms.h +35 -34
- data/third_party/boringssl-with-bazel/include/openssl/conf.h +15 -14
- data/third_party/boringssl-with-bazel/include/openssl/crypto.h +15 -13
- data/third_party/boringssl-with-bazel/include/openssl/ctrdrbg.h +49 -15
- data/third_party/boringssl-with-bazel/include/openssl/curve25519.h +24 -24
- data/third_party/boringssl-with-bazel/include/openssl/des.h +22 -16
- data/third_party/boringssl-with-bazel/include/openssl/dh.h +95 -95
- data/third_party/boringssl-with-bazel/include/openssl/digest.h +140 -71
- data/third_party/boringssl-with-bazel/include/openssl/dsa.h +101 -101
- data/third_party/boringssl-with-bazel/include/openssl/ec.h +143 -119
- data/third_party/boringssl-with-bazel/include/openssl/ec_key.h +97 -97
- data/third_party/boringssl-with-bazel/include/openssl/ecdh.h +9 -9
- data/third_party/boringssl-with-bazel/include/openssl/ecdsa.h +89 -46
- data/third_party/boringssl-with-bazel/include/openssl/engine.h +5 -5
- data/third_party/boringssl-with-bazel/include/openssl/err.h +73 -71
- data/third_party/boringssl-with-bazel/include/openssl/evp.h +824 -344
- data/third_party/boringssl-with-bazel/include/openssl/evp_errors.h +9 -2
- data/third_party/boringssl-with-bazel/include/openssl/ex_data.h +27 -32
- data/third_party/boringssl-with-bazel/include/openssl/hkdf.h +6 -6
- data/third_party/boringssl-with-bazel/include/openssl/hmac.h +31 -31
- data/third_party/boringssl-with-bazel/include/openssl/hpke.h +133 -117
- data/third_party/boringssl-with-bazel/include/openssl/hrss.h +14 -8
- data/third_party/boringssl-with-bazel/include/openssl/kdf.h +20 -19
- data/third_party/boringssl-with-bazel/include/openssl/lhash.h +4 -25
- data/third_party/boringssl-with-bazel/include/openssl/md4.h +14 -7
- data/third_party/boringssl-with-bazel/include/openssl/md5.h +7 -7
- data/third_party/boringssl-with-bazel/include/openssl/mem.h +38 -38
- data/third_party/boringssl-with-bazel/include/openssl/mldsa.h +380 -24
- data/third_party/boringssl-with-bazel/include/openssl/mlkem.h +43 -43
- data/third_party/boringssl-with-bazel/include/openssl/nid.h +1297 -2
- data/third_party/boringssl-with-bazel/include/openssl/obj.h +49 -49
- data/third_party/boringssl-with-bazel/include/openssl/opensslconf.h +30 -0
- data/third_party/boringssl-with-bazel/include/openssl/params.h +42 -0
- data/third_party/boringssl-with-bazel/include/openssl/pem.h +39 -30
- data/third_party/boringssl-with-bazel/include/openssl/pkcs7.h +40 -40
- data/third_party/boringssl-with-bazel/include/openssl/pkcs8.h +69 -63
- data/third_party/boringssl-with-bazel/include/openssl/poly1305.h +8 -5
- data/third_party/boringssl-with-bazel/include/openssl/pool.h +54 -25
- data/third_party/boringssl-with-bazel/include/openssl/posix_time.h +6 -6
- data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols.h +7866 -0
- data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols_internal_S.h +585 -0
- data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols_internal_c.h +305 -0
- data/third_party/boringssl-with-bazel/include/openssl/rand.h +18 -18
- data/third_party/boringssl-with-bazel/include/openssl/rc4.h +4 -4
- data/third_party/boringssl-with-bazel/include/openssl/ripemd.h +15 -10
- data/third_party/boringssl-with-bazel/include/openssl/rsa.h +272 -235
- data/third_party/boringssl-with-bazel/include/openssl/service_indicator.h +4 -81
- data/third_party/boringssl-with-bazel/include/openssl/sha.h +43 -166
- data/third_party/boringssl-with-bazel/include/openssl/sha2.h +201 -0
- data/third_party/boringssl-with-bazel/include/openssl/slhdsa.h +100 -48
- data/third_party/boringssl-with-bazel/include/openssl/span.h +190 -75
- data/third_party/boringssl-with-bazel/include/openssl/ssl.h +2168 -1567
- data/third_party/boringssl-with-bazel/include/openssl/ssl3.h +11 -69
- data/third_party/boringssl-with-bazel/include/openssl/stack.h +135 -80
- data/third_party/boringssl-with-bazel/include/openssl/target.h +13 -1
- data/third_party/boringssl-with-bazel/include/openssl/thread.h +0 -10
- data/third_party/boringssl-with-bazel/include/openssl/tls1.h +31 -310
- data/third_party/boringssl-with-bazel/include/openssl/tls_prf.h +47 -0
- data/third_party/boringssl-with-bazel/include/openssl/trust_token.h +97 -92
- data/third_party/boringssl-with-bazel/include/openssl/type_check.h +1 -1
- data/third_party/boringssl-with-bazel/include/openssl/x509.h +1805 -1857
- data/third_party/boringssl-with-bazel/include/openssl/x509v3.h +1 -1
- data/third_party/boringssl-with-bazel/include/openssl/xwing.h +115 -0
- data/third_party/boringssl-with-bazel/ssl/bio_ssl.cc +24 -19
- data/third_party/boringssl-with-bazel/ssl/d1_both.cc +59 -57
- data/third_party/boringssl-with-bazel/ssl/d1_lib.cc +53 -42
- data/third_party/boringssl-with-bazel/ssl/d1_pkt.cc +4 -4
- data/third_party/boringssl-with-bazel/ssl/d1_srtp.cc +2 -2
- data/third_party/boringssl-with-bazel/ssl/dtls_method.cc +10 -10
- data/third_party/boringssl-with-bazel/ssl/dtls_record.cc +6 -6
- data/third_party/boringssl-with-bazel/ssl/encrypted_client_hello.cc +61 -71
- data/third_party/boringssl-with-bazel/ssl/extensions.cc +967 -366
- data/third_party/boringssl-with-bazel/ssl/handoff.cc +77 -38
- data/third_party/boringssl-with-bazel/ssl/handshake.cc +63 -30
- data/third_party/boringssl-with-bazel/ssl/handshake_client.cc +129 -85
- data/third_party/boringssl-with-bazel/ssl/handshake_server.cc +116 -68
- data/third_party/boringssl-with-bazel/ssl/internal.h +983 -1207
- data/third_party/boringssl-with-bazel/ssl/s3_both.cc +34 -29
- data/third_party/boringssl-with-bazel/ssl/s3_lib.cc +4 -3
- data/third_party/boringssl-with-bazel/ssl/s3_pkt.cc +12 -12
- data/third_party/boringssl-with-bazel/ssl/ssl_aead_ctx.cc +5 -5
- data/third_party/boringssl-with-bazel/ssl/ssl_asn1.cc +114 -59
- data/third_party/boringssl-with-bazel/ssl/ssl_buffer.cc +17 -18
- data/third_party/boringssl-with-bazel/ssl/ssl_cert.cc +99 -61
- data/third_party/boringssl-with-bazel/ssl/ssl_cipher.cc +143 -134
- data/third_party/boringssl-with-bazel/ssl/ssl_credential.cc +188 -90
- data/third_party/boringssl-with-bazel/ssl/ssl_file.cc +132 -225
- data/third_party/boringssl-with-bazel/ssl/ssl_key_share.cc +79 -7
- data/third_party/boringssl-with-bazel/ssl/ssl_lib.cc +698 -302
- data/third_party/boringssl-with-bazel/ssl/ssl_privkey.cc +102 -45
- data/third_party/boringssl-with-bazel/ssl/ssl_session.cc +117 -102
- data/third_party/boringssl-with-bazel/ssl/ssl_transcript.cc +3 -3
- data/third_party/boringssl-with-bazel/ssl/ssl_versions.cc +24 -24
- data/third_party/boringssl-with-bazel/ssl/ssl_x509.cc +184 -170
- data/third_party/boringssl-with-bazel/ssl/t1_enc.cc +12 -10
- data/third_party/boringssl-with-bazel/ssl/tls13_both.cc +86 -54
- data/third_party/boringssl-with-bazel/ssl/tls13_client.cc +176 -90
- data/third_party/boringssl-with-bazel/ssl/tls13_enc.cc +166 -112
- data/third_party/boringssl-with-bazel/ssl/tls13_server.cc +188 -97
- data/third_party/boringssl-with-bazel/ssl/tls_method.cc +23 -23
- data/third_party/boringssl-with-bazel/ssl/tls_record.cc +17 -14
- data/third_party/boringssl-with-bazel/third_party/fiat/bedrock_unverified_bareminimum.c.inc +47 -0
- data/third_party/boringssl-with-bazel/third_party/fiat/bedrock_unverified_platform.c.inc +137 -0
- data/third_party/boringssl-with-bazel/third_party/fiat/curve25519_64_adx.h +37 -33
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_64.h +4 -93
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_64_msvc.h +4 -69
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_field_32.br.c.inc +71 -0
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_field_64.br.c.inc +84 -0
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_point.br.c.inc +166 -0
- metadata +77 -52
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +0 -240
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +0 -56
- data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb.h +0 -157
- data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb_minitable.c +0 -72
- data/src/core/ext/upbdefs-gen/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +0 -181
- data/third_party/abseil-cpp/absl/base/internal/identity.h +0 -39
- data/third_party/abseil-cpp/absl/base/internal/nullability_deprecated.h +0 -106
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +0 -105
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h +0 -50
- data/third_party/abseil-cpp/absl/strings/string_view.cc +0 -257
- data/third_party/boringssl-with-bazel/crypto/evp/p_dh_asn1.cc +0 -142
- data/third_party/boringssl-with-bazel/crypto/evp/p_dsa_asn1.cc +0 -279
- data/third_party/boringssl-with-bazel/crypto/evp/p_ec_asn1.cc +0 -286
- data/third_party/boringssl-with-bazel/crypto/evp/p_ed25519_asn1.cc +0 -225
- data/third_party/boringssl-with-bazel/crypto/evp/p_rsa_asn1.cc +0 -198
- data/third_party/boringssl-with-bazel/crypto/evp/p_x25519_asn1.cc +0 -237
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p224-64.cc.inc +0 -1163
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256-nistz.cc.inc +0 -741
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256-nistz.h +0 -207
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rsa/blinding.cc.inc +0 -147
- data/third_party/boringssl-with-bazel/crypto/rand/getrandom_fillin.h +0 -64
- data/third_party/boringssl-with-bazel/crypto/rand/passive.cc +0 -178
- data/third_party/boringssl-with-bazel/crypto/x509/ext_dat.h +0 -92
- data/third_party/boringssl-with-bazel/include/openssl/bcm_public.h +0 -82
- data/third_party/boringssl-with-bazel/include/openssl/experimental/kyber.h +0 -146
|
@@ -16,33 +16,132 @@
|
|
|
16
16
|
|
|
17
17
|
#include "src/core/filter/ext_proc/ext_proc_filter.h"
|
|
18
18
|
|
|
19
|
+
#include <grpc/event_engine/event_engine.h>
|
|
20
|
+
#include <grpc/impl/channel_arg_names.h>
|
|
21
|
+
|
|
22
|
+
#include <cstdint>
|
|
19
23
|
#include <memory>
|
|
20
24
|
#include <string>
|
|
21
25
|
#include <utility>
|
|
22
26
|
|
|
23
27
|
#include "src/core/call/call_spine.h"
|
|
28
|
+
#include "src/core/call/evaluate_args.h"
|
|
24
29
|
#include "src/core/call/metadata.h"
|
|
30
|
+
#include "src/core/client_channel/client_channel_args.h"
|
|
31
|
+
#include "src/core/filter/ext_proc/ext_proc_messages.h"
|
|
25
32
|
#include "src/core/lib/channel/channel_args.h"
|
|
26
|
-
#include "src/core/lib/channel/channel_fwd.h"
|
|
27
33
|
#include "src/core/lib/channel/promise_based_filter.h"
|
|
28
34
|
#include "src/core/lib/debug/trace_impl.h"
|
|
35
|
+
#include "src/core/lib/promise/activity.h"
|
|
36
|
+
#include "src/core/lib/promise/for_each.h"
|
|
37
|
+
#include "src/core/lib/promise/if.h"
|
|
38
|
+
#include "src/core/lib/promise/inter_activity_latch.h"
|
|
39
|
+
#include "src/core/lib/promise/inter_activity_pipe.h"
|
|
40
|
+
#include "src/core/lib/promise/latch.h"
|
|
41
|
+
#include "src/core/lib/promise/loop.h"
|
|
42
|
+
#include "src/core/lib/promise/promise.h"
|
|
43
|
+
#include "src/core/lib/promise/seq.h"
|
|
44
|
+
#include "src/core/lib/promise/status_flag.h"
|
|
45
|
+
#include "src/core/lib/promise/try_join.h"
|
|
29
46
|
#include "src/core/lib/promise/try_seq.h"
|
|
47
|
+
#include "src/core/telemetry/metrics.h"
|
|
30
48
|
#include "src/core/util/down_cast.h"
|
|
31
|
-
#include "src/core/util/
|
|
32
|
-
#include "src/core/util/match.h"
|
|
49
|
+
#include "src/core/util/dual_ref_counted.h"
|
|
33
50
|
#include "src/core/util/ref_counted_ptr.h"
|
|
34
51
|
#include "src/core/util/string.h"
|
|
35
52
|
#include "src/core/util/time.h"
|
|
36
|
-
#include "src/core/xds/grpc/
|
|
37
|
-
#include "src/core/xds/
|
|
53
|
+
#include "src/core/xds/grpc/streaming_call_promise_wrapper.h"
|
|
54
|
+
#include "src/core/xds/grpc/xds_common_types.h"
|
|
38
55
|
#include "src/core/xds/xds_client/xds_transport.h"
|
|
39
|
-
#include "absl/log/log.h"
|
|
40
56
|
#include "absl/status/status.h"
|
|
41
57
|
#include "absl/status/statusor.h"
|
|
42
|
-
#include "absl/strings/
|
|
58
|
+
#include "absl/strings/str_cat.h"
|
|
59
|
+
#include "absl/strings/string_view.h"
|
|
43
60
|
|
|
44
61
|
namespace grpc_core {
|
|
45
62
|
|
|
63
|
+
//
|
|
64
|
+
// ExtProcFilter::TelemetryDomain
|
|
65
|
+
//
|
|
66
|
+
|
|
67
|
+
ExtProcFilter::TelemetryDomain::DoubleHistogramHandle<
|
|
68
|
+
ExponentialDoubleHistogramShape>
|
|
69
|
+
ExtProcFilter::TelemetryDomain::kClientHeadersDuration =
|
|
70
|
+
ExtProcFilter::TelemetryDomain::RegisterDoubleHistogram<
|
|
71
|
+
ExponentialDoubleHistogramShape>(
|
|
72
|
+
"grpc.client_ext_proc.client_headers_duration",
|
|
73
|
+
"Time between when the ext_proc filter sees the client's headers "
|
|
74
|
+
"and when it allows those headers to continue on to the next "
|
|
75
|
+
"filter.",
|
|
76
|
+
"s", 60, 20);
|
|
77
|
+
|
|
78
|
+
ExtProcFilter::TelemetryDomain::DoubleHistogramHandle<
|
|
79
|
+
ExponentialDoubleHistogramShape>
|
|
80
|
+
ExtProcFilter::TelemetryDomain::kClientHalfCloseDuration =
|
|
81
|
+
ExtProcFilter::TelemetryDomain::RegisterDoubleHistogram<
|
|
82
|
+
ExponentialDoubleHistogramShape>(
|
|
83
|
+
"grpc.client_ext_proc.client_half_close_duration",
|
|
84
|
+
"Time between when the ext_proc filter sees the client's "
|
|
85
|
+
"half-close and when it allows that half-close to continue on to "
|
|
86
|
+
"the next filter.",
|
|
87
|
+
"s", 60, 20);
|
|
88
|
+
|
|
89
|
+
ExtProcFilter::TelemetryDomain::DoubleHistogramHandle<
|
|
90
|
+
ExponentialDoubleHistogramShape>
|
|
91
|
+
ExtProcFilter::TelemetryDomain::kServerHeadersDuration =
|
|
92
|
+
ExtProcFilter::TelemetryDomain::RegisterDoubleHistogram<
|
|
93
|
+
ExponentialDoubleHistogramShape>(
|
|
94
|
+
"grpc.client_ext_proc.server_headers_duration",
|
|
95
|
+
"Time between when the ext_proc filter sees the server's headers "
|
|
96
|
+
"and when it allows those headers to continue on to the next "
|
|
97
|
+
"filter.",
|
|
98
|
+
"s", 60, 20);
|
|
99
|
+
|
|
100
|
+
ExtProcFilter::TelemetryDomain::DoubleHistogramHandle<
|
|
101
|
+
ExponentialDoubleHistogramShape>
|
|
102
|
+
ExtProcFilter::TelemetryDomain::kServerTrailersDuration =
|
|
103
|
+
ExtProcFilter::TelemetryDomain::RegisterDoubleHistogram<
|
|
104
|
+
ExponentialDoubleHistogramShape>(
|
|
105
|
+
"grpc.client_ext_proc.server_trailers_duration",
|
|
106
|
+
"Time between when the ext_proc filter sees the server's "
|
|
107
|
+
"trailers and when it allows those trailers to continue on to "
|
|
108
|
+
"the next filter.",
|
|
109
|
+
"s", 60, 20);
|
|
110
|
+
|
|
111
|
+
namespace {
|
|
112
|
+
|
|
113
|
+
bool IsProcessingEnabled(
|
|
114
|
+
const std::optional<ExtProcFilter::ProcessingMode>& processing_mode) {
|
|
115
|
+
if (!processing_mode.has_value()) return false;
|
|
116
|
+
return processing_mode->send_request_headers ||
|
|
117
|
+
processing_mode->send_response_headers ||
|
|
118
|
+
processing_mode->send_response_trailers ||
|
|
119
|
+
processing_mode->send_request_body ||
|
|
120
|
+
processing_mode->send_response_body;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
absl::Status ApplyHeaderMutations(
|
|
124
|
+
const ExtProcResponse::HeaderMutation& mutations,
|
|
125
|
+
const std::optional<HeaderMutationRules>& rules,
|
|
126
|
+
grpc_metadata_batch& metadata) {
|
|
127
|
+
const auto* rules_ptr = rules.has_value() ? &rules.value() : nullptr;
|
|
128
|
+
for (const auto& remove : mutations.remove_headers) {
|
|
129
|
+
auto status = ApplyXdsHeaderMutationsRemoval(remove, rules_ptr, metadata);
|
|
130
|
+
if (!status.ok()) {
|
|
131
|
+
return status;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
for (const auto& add : mutations.set_headers) {
|
|
135
|
+
auto status = ApplyXdsHeaderMutationsAddition(add, rules_ptr, metadata);
|
|
136
|
+
if (!status.ok()) {
|
|
137
|
+
return status;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return absl::OkStatus();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
} // namespace
|
|
144
|
+
|
|
46
145
|
//
|
|
47
146
|
// ExtProcFilter::Config
|
|
48
147
|
//
|
|
@@ -60,7 +159,7 @@ std::string ExtProcFilter::Config::ToString() const {
|
|
|
60
159
|
[&](const RefCountedPtr<ExtProcChannel>& channel) {
|
|
61
160
|
if (channel != nullptr) {
|
|
62
161
|
StrAppend(result, "ext_proc_channel=");
|
|
63
|
-
StrAppend(result, channel->server()
|
|
162
|
+
StrAppend(result, channel->server().Key());
|
|
64
163
|
is_first = false;
|
|
65
164
|
}
|
|
66
165
|
});
|
|
@@ -153,6 +252,1429 @@ bool ExtProcFilter::Config::Equals(const FilterConfig& other) const {
|
|
|
153
252
|
deferred_close_timeout == o.deferred_close_timeout;
|
|
154
253
|
}
|
|
155
254
|
|
|
255
|
+
//
|
|
256
|
+
// ExtProcFilter::ExtProcChannel
|
|
257
|
+
//
|
|
258
|
+
|
|
259
|
+
ExtProcFilter::ExtProcChannel::ExtProcChannel(
|
|
260
|
+
GrpcXdsServerTarget server,
|
|
261
|
+
RefCountedPtr<XdsTransportFactory::XdsTransport> transport)
|
|
262
|
+
: server_(std::move(server)), transport_(std::move(transport)) {
|
|
263
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
264
|
+
<< "creating channel " << this << " for server " << server_.server_uri();
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
ExtProcFilter::ExtProcChannel::~ExtProcChannel() {
|
|
268
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
269
|
+
<< "destroying ext_proc channel " << this << " for server "
|
|
270
|
+
<< server_.server_uri();
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
//
|
|
274
|
+
// ExtProcFilter::ExtProcCall
|
|
275
|
+
//
|
|
276
|
+
|
|
277
|
+
// High-Level Architecture of Concurrent Pipeline Loops across Activities:
|
|
278
|
+
//
|
|
279
|
+
// [ Activity 1: handler_ ]
|
|
280
|
+
// LOOP 1: Read-From-Client Pipeline Loop [HandleReadFromClientLoop()]
|
|
281
|
+
// +-----------------------------------------------------------------------+
|
|
282
|
+
// | TrySeq( |
|
|
283
|
+
// | handler_.PullClientInitialMetadata() |
|
|
284
|
+
// | -> HandleInitialMetadataFromClient(), |
|
|
285
|
+
// | ForEach(MessagesFrom(handler_)) |
|
|
286
|
+
// | -> HandleMessageFromClient(), |
|
|
287
|
+
// | HandleHalfCloseFromClient()) |
|
|
288
|
+
// +-----------------------------------------------------------------------+
|
|
289
|
+
// ||
|
|
290
|
+
// Joined via TryJoin() in Run()
|
|
291
|
+
// ||
|
|
292
|
+
// LOOP 2: Read-From-Server Pipeline Loop [HandleReadFromServerActivityLoop()]
|
|
293
|
+
// +-----------------------------------------------------------------------+
|
|
294
|
+
// | Seq( |
|
|
295
|
+
// | TrySeq( |
|
|
296
|
+
// | server_initial_metadata_latch_.Wait() |
|
|
297
|
+
// | -> HandleInitialMetadataFromServer(), |
|
|
298
|
+
// | If(has_initial_metadata, |
|
|
299
|
+
// | ForEach(server_to_client_messages_.receiver) |
|
|
300
|
+
// | -> HandleMessageFromServer())), |
|
|
301
|
+
// | server_trailing_metadata_latch_.Wait() |
|
|
302
|
+
// | -> HandleTrailingMetadataFromServer()) |
|
|
303
|
+
// +-----------------------------------------------------------------------+
|
|
304
|
+
// ||
|
|
305
|
+
// Joined via TryJoin() in Run()
|
|
306
|
+
// ||
|
|
307
|
+
// LOOP 3: Side-Stream Pull Pipeline Loop [HandleReadFromSideStreamLoop()]
|
|
308
|
+
// +-----------------------------------------------------------------------+
|
|
309
|
+
// | Map( |
|
|
310
|
+
// | TrySeq( |
|
|
311
|
+
// | Loop: streaming_call_->PullMessage() |
|
|
312
|
+
// | -> ProcessSideStreamResponse(), |
|
|
313
|
+
// | streaming_call_->PullServerTrailingMetadata()), |
|
|
314
|
+
// | HandleSideStreamStatus(status)) |
|
|
315
|
+
// +-----------------------------------------------------------------------+
|
|
316
|
+
//
|
|
317
|
+
// [ Activity 2: initiator_ ] (Spawned on child call startup in
|
|
318
|
+
// StartChildCall())
|
|
319
|
+
// LOOP 4: Downstream Server Event Forwarding Loop
|
|
320
|
+
// [SpawnReadFromServerLoop()]
|
|
321
|
+
// +-----------------------------------------------------------------------+
|
|
322
|
+
// | Seq( |
|
|
323
|
+
// | initiator_.CancelIfFails(TrySeq( |
|
|
324
|
+
// | initiator_.PullServerInitialMetadata() |
|
|
325
|
+
// | -> server_initial_metadata_latch_.Set(), |
|
|
326
|
+
// | If(has_initial_metadata, |
|
|
327
|
+
// | ForEach(MessagesFrom(initiator_)) |
|
|
328
|
+
// | -> server_to_client_messages_.sender.Push(), |
|
|
329
|
+
// | server_to_client_messages_.sender.MarkClosed()))), |
|
|
330
|
+
// | initiator_.PullServerTrailingMetadata() |
|
|
331
|
+
// | -> server_trailing_metadata_latch_.Set()) |
|
|
332
|
+
// +-----------------------------------------------------------------------+
|
|
333
|
+
|
|
334
|
+
class ExtProcFilter::ExtProcCall final : public DualRefCounted<ExtProcCall> {
|
|
335
|
+
public:
|
|
336
|
+
ExtProcCall(RefCountedPtr<ExtProcFilter> ext_proc_filter,
|
|
337
|
+
RefCountedPtr<XdsTransportFactory::XdsTransport> transport,
|
|
338
|
+
CallHandler handler);
|
|
339
|
+
|
|
340
|
+
~ExtProcCall() override;
|
|
341
|
+
|
|
342
|
+
// Main entry point for an external processor call. Spawns and manages the
|
|
343
|
+
// concurrent request (client-to-server) and response (server-to-client)
|
|
344
|
+
// processing pipelines alongside side-stream message pulling.
|
|
345
|
+
auto Run();
|
|
346
|
+
|
|
347
|
+
private:
|
|
348
|
+
// Tracks the state of outgoing message sends on the ext_proc side-stream.
|
|
349
|
+
enum class SideStreamSendState {
|
|
350
|
+
// Initial state: no message send is currently in flight.
|
|
351
|
+
kIdle,
|
|
352
|
+
// A message send operation has been claimed and is currently in flight on
|
|
353
|
+
// the underlying transport wrapper.
|
|
354
|
+
kSendInFlight,
|
|
355
|
+
// The stream has been closed or terminated due to an error, preventing
|
|
356
|
+
// subsequent sends.
|
|
357
|
+
kSendFailed,
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
enum class SideStreamRequestEventState {
|
|
361
|
+
// Expecting request headers response from external processor.
|
|
362
|
+
kExpectHeaders,
|
|
363
|
+
// Expecting request body response(s) from external processor.
|
|
364
|
+
kExpectBody,
|
|
365
|
+
// Expecting no further request responses from external processor.
|
|
366
|
+
kExpectNothing,
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
enum class SideStreamResponseEventState {
|
|
370
|
+
// Expecting response headers response from external processor.
|
|
371
|
+
kExpectHeaders,
|
|
372
|
+
// Expecting response body or trailers response from external processor.
|
|
373
|
+
kExpectBodyOrTrailers,
|
|
374
|
+
// Expecting response trailers response from external processor.
|
|
375
|
+
kExpectTrailers,
|
|
376
|
+
// Expecting no further response responses from external processor.
|
|
377
|
+
kExpectNothing,
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
// Handle the read-from-client loop on handler_.
|
|
381
|
+
// Called when the ExtProcCall is created.
|
|
382
|
+
//
|
|
383
|
+
// Handles client initial metadata, client messages, and half-close.
|
|
384
|
+
// Sends each event to the ext_proc side-stream and/or to the server,
|
|
385
|
+
// based on the configuration.
|
|
386
|
+
auto HandleReadFromClientLoop();
|
|
387
|
+
|
|
388
|
+
// Handle the read-from-server loop on handler_.
|
|
389
|
+
// Called when the ExtProcCall is created.
|
|
390
|
+
//
|
|
391
|
+
// Handles server initial metadata, server messages, and server
|
|
392
|
+
// trailing metadata received from the initiator_ activity.
|
|
393
|
+
// Sends each event to the ext_proc side-stream and/or to the client,
|
|
394
|
+
// based on the configuration.
|
|
395
|
+
auto HandleReadFromServerActivityLoop();
|
|
396
|
+
|
|
397
|
+
// Handle the read-from-ext_proc-side-stream loop on handler_.
|
|
398
|
+
// Called when the ExtProcCall is created.
|
|
399
|
+
//
|
|
400
|
+
// Handles all events on the call, forwarding data to either handler_
|
|
401
|
+
// (client) or initiator_ (server).
|
|
402
|
+
auto HandleReadFromSideStreamLoop();
|
|
403
|
+
|
|
404
|
+
// Spawns the read-from-server loop on initiator_.
|
|
405
|
+
// Called from StartChildCall().
|
|
406
|
+
//
|
|
407
|
+
// Pulls server initial metadata, messages, and trailing metadata from
|
|
408
|
+
// downstream and immediately forwards them across inter-activity mechanisms
|
|
409
|
+
// to the handler_ activity.
|
|
410
|
+
void SpawnReadFromServerLoop();
|
|
411
|
+
|
|
412
|
+
// Read-from-client event handlers
|
|
413
|
+
auto HandleInitialMetadataFromClient(ClientMetadataHandle metadata);
|
|
414
|
+
auto HandleMessageFromClient(MessageHandle message);
|
|
415
|
+
auto HandleHalfCloseFromClient();
|
|
416
|
+
|
|
417
|
+
// Read-from-server event handlers
|
|
418
|
+
auto HandleInitialMetadataFromServer(
|
|
419
|
+
std::optional<ServerMetadataHandle> metadata);
|
|
420
|
+
auto HandleMessageFromServer(MessageHandle message);
|
|
421
|
+
auto HandleTrailingMetadataFromServer(ServerMetadataHandle metadata);
|
|
422
|
+
|
|
423
|
+
// Read-from-sidestream event handlers
|
|
424
|
+
StatusFlag HandleClientInitialMetadataFromSidestream(
|
|
425
|
+
const ExtProcResponse::RequestHeaders& response);
|
|
426
|
+
StatusFlag HandleClientMessageFromSidestream(
|
|
427
|
+
const ExtProcResponse::RequestBody& response);
|
|
428
|
+
StatusFlag HandleServerInitialMetadataFromSidestream(
|
|
429
|
+
const ExtProcResponse::ResponseHeaders& response);
|
|
430
|
+
StatusFlag HandleServerMessageFromSidestream(
|
|
431
|
+
const ExtProcResponse::ResponseBody& response);
|
|
432
|
+
StatusFlag HandleServerTrailingMetadataFromSidestream(
|
|
433
|
+
const ExtProcResponse::ResponseTrailers& response);
|
|
434
|
+
StatusFlag HandleImmediateResponseFromSidestream(
|
|
435
|
+
const ExtProcResponse::ImmediateResponse& response);
|
|
436
|
+
|
|
437
|
+
// Initializes and starts the child call to the backend server, and spawns
|
|
438
|
+
// the background task for the server-to-client response path.
|
|
439
|
+
void StartChildCall(ClientMetadataHandle metadata);
|
|
440
|
+
|
|
441
|
+
// Sends a message to the external processor side-stream.
|
|
442
|
+
// Coordinates client-side and server-side message sources within the handler_
|
|
443
|
+
// activity so that only one send is in-flight on streaming_call_ at a time,
|
|
444
|
+
// using a single Waker without any queue or vector allocations.
|
|
445
|
+
auto SendMessageToSideStream(std::string payload);
|
|
446
|
+
|
|
447
|
+
// Parses and processes an incoming response message payload from the
|
|
448
|
+
// side-stream.
|
|
449
|
+
auto ProcessSideStreamResponse(absl::string_view payload);
|
|
450
|
+
|
|
451
|
+
// Handles transport status updates/closure on the ext_proc side-stream.
|
|
452
|
+
// Returns true if the call remains active (either status is OK or fail-open
|
|
453
|
+
// is allowed), or false if the call has been cancelled with an error.
|
|
454
|
+
bool HandleSideStreamStatus(absl::Status status);
|
|
455
|
+
|
|
456
|
+
const Config& config() const { return *ext_proc_filter_->config_; }
|
|
457
|
+
|
|
458
|
+
const ProcessingMode& processing_mode() const {
|
|
459
|
+
return *config().processing_mode;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// Returns true if this is the first message being sent on the side-stream,
|
|
463
|
+
// resetting the internal flag. Used to attach ProcessingMode on the first
|
|
464
|
+
// request.
|
|
465
|
+
bool IsFirstMessageOnSideStream() {
|
|
466
|
+
return std::exchange(is_first_message_on_side_stream_, false);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
bool IsFailOpenAllowed() const {
|
|
470
|
+
const bool allow = config().failure_mode_allow.value_or(false);
|
|
471
|
+
if (config().observability_mode) return allow;
|
|
472
|
+
return allow && !first_body_message_sent_;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
// Fails the intercepted data plane RPC with the given error status by
|
|
476
|
+
// pushing error trailing metadata downstream to the client.
|
|
477
|
+
void CancelCallWithError(absl::Status status) {
|
|
478
|
+
GRPC_CHECK(!status.ok());
|
|
479
|
+
auto error_md = CancelledServerMetadataFromStatus(status);
|
|
480
|
+
handler_.PushServerTrailingMetadata(std::move(error_md));
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
void Orphaned() override {}
|
|
484
|
+
|
|
485
|
+
static SideStreamRequestEventState InitialRequestEventState(
|
|
486
|
+
const Config& config) {
|
|
487
|
+
if (config.observability_mode) {
|
|
488
|
+
return SideStreamRequestEventState::kExpectNothing;
|
|
489
|
+
}
|
|
490
|
+
if (config.processing_mode.has_value() &&
|
|
491
|
+
config.processing_mode->send_request_headers) {
|
|
492
|
+
return SideStreamRequestEventState::kExpectHeaders;
|
|
493
|
+
}
|
|
494
|
+
if (config.processing_mode.has_value() &&
|
|
495
|
+
config.processing_mode->send_request_body) {
|
|
496
|
+
return SideStreamRequestEventState::kExpectBody;
|
|
497
|
+
}
|
|
498
|
+
return SideStreamRequestEventState::kExpectNothing;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
static SideStreamResponseEventState InitialResponseEventState(
|
|
502
|
+
const Config& config) {
|
|
503
|
+
if (config.observability_mode) {
|
|
504
|
+
return SideStreamResponseEventState::kExpectNothing;
|
|
505
|
+
}
|
|
506
|
+
if (config.processing_mode.has_value() &&
|
|
507
|
+
config.processing_mode->send_response_headers) {
|
|
508
|
+
return SideStreamResponseEventState::kExpectHeaders;
|
|
509
|
+
}
|
|
510
|
+
if (config.processing_mode.has_value() &&
|
|
511
|
+
config.processing_mode->send_response_body) {
|
|
512
|
+
return SideStreamResponseEventState::kExpectBodyOrTrailers;
|
|
513
|
+
}
|
|
514
|
+
if (config.processing_mode.has_value() &&
|
|
515
|
+
config.processing_mode->send_response_trailers) {
|
|
516
|
+
return SideStreamResponseEventState::kExpectTrailers;
|
|
517
|
+
}
|
|
518
|
+
return SideStreamResponseEventState::kExpectNothing;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
std::string DebugTag() const;
|
|
522
|
+
|
|
523
|
+
// Track event states for request and response side-stream messages.
|
|
524
|
+
// Synchronized by the handler_ activity.
|
|
525
|
+
SideStreamRequestEventState request_event_state_;
|
|
526
|
+
SideStreamResponseEventState response_event_state_;
|
|
527
|
+
|
|
528
|
+
// Metadata handles stored during request/response processing.
|
|
529
|
+
// Synchronized by the handler_ activity.
|
|
530
|
+
ClientMetadataHandle client_initial_metadata_;
|
|
531
|
+
ServerMetadataHandle server_initial_metadata_;
|
|
532
|
+
ServerMetadataHandle server_trailing_metadata_;
|
|
533
|
+
|
|
534
|
+
// Inter-activity communication mechanisms between initiator_ and handler_.
|
|
535
|
+
InterActivityLatch<std::optional<ServerMetadataHandle>>
|
|
536
|
+
server_initial_metadata_latch_;
|
|
537
|
+
InterActivityPipe<MessageHandle, 1> server_to_client_messages_;
|
|
538
|
+
InterActivityLatch<ServerMetadataHandle> server_trailing_metadata_latch_;
|
|
539
|
+
|
|
540
|
+
// Timestamps recorded when events arrive from the data plane, used to
|
|
541
|
+
// measure delay introduced by the external processor in normal mode.
|
|
542
|
+
// Synchronized by the handler_ activity.
|
|
543
|
+
Timestamp client_initial_metadata_start_time_;
|
|
544
|
+
Timestamp client_half_close_start_time_;
|
|
545
|
+
Timestamp server_initial_metadata_start_time_;
|
|
546
|
+
Timestamp server_trailing_metadata_start_time_;
|
|
547
|
+
|
|
548
|
+
// Temporary UPB arena holding request attributes until the first client body
|
|
549
|
+
// request is sent to the sidestream. Synchronized by the handler_ activity.
|
|
550
|
+
upb::Arena request_attributes_arena_;
|
|
551
|
+
// Request attributes generated during request header processing to be
|
|
552
|
+
// attached to subsequent request body processing requests. Synchronized by
|
|
553
|
+
// the handler_ activity.
|
|
554
|
+
::google_protobuf_Struct* request_attributes_ = nullptr;
|
|
555
|
+
// Indicates whether a stream drain operation has been requested by the
|
|
556
|
+
// filter. Synchronized by the handler_ activity.
|
|
557
|
+
bool drain_requested_ = false;
|
|
558
|
+
// True if no messages have been sent on the external processor side-stream
|
|
559
|
+
// yet. Used to include overall processing_mode in the initial stream header
|
|
560
|
+
// request. Synchronized by the handler_ activity.
|
|
561
|
+
bool is_first_message_on_side_stream_ = true;
|
|
562
|
+
// Tracks whether the first body message has been sent on the side-stream,
|
|
563
|
+
// used for fail-open determination. Synchronized by the handler_ activity.
|
|
564
|
+
bool first_body_message_sent_ = false;
|
|
565
|
+
// TODO(rishesh): Need to remove this once PH2 work is done.
|
|
566
|
+
// Number of messages sent to ext_proc that are awaiting response processing
|
|
567
|
+
// in S2C and C2S directions respectively. Synchronized by the handler_
|
|
568
|
+
// activity.
|
|
569
|
+
size_t outstanding_s2c_messages_ = 0;
|
|
570
|
+
size_t outstanding_c2s_messages_ = 0;
|
|
571
|
+
// Data plane stream state flags tracking directional write completion,
|
|
572
|
+
// half-close, and trailers-only RPC mode. Synchronized by the handler_
|
|
573
|
+
// activity.
|
|
574
|
+
bool c2s_writes_done_ = false;
|
|
575
|
+
bool is_trailers_only_ = false;
|
|
576
|
+
// Set to true when the external processor indicates end of stream for
|
|
577
|
+
// client-to-server messages (early half-close). Synchronized by the
|
|
578
|
+
// handler_ activity.
|
|
579
|
+
bool ext_proc_closed_c2s_ = false;
|
|
580
|
+
// Latch signaled when the side-stream is closed or drained.
|
|
581
|
+
Latch<void> side_stream_closed_latch_;
|
|
582
|
+
|
|
583
|
+
// Send state and waiters for coordinating message sends on the side-stream
|
|
584
|
+
// within the handler_ activity.
|
|
585
|
+
SideStreamSendState ext_proc_send_state_ = SideStreamSendState::kIdle;
|
|
586
|
+
IntraActivityWaiter ext_proc_send_waiter_;
|
|
587
|
+
|
|
588
|
+
CallHandler handler_;
|
|
589
|
+
CallInitiator initiator_;
|
|
590
|
+
RefCountedPtr<XdsStreamingCallPromiseWrapper> streaming_call_;
|
|
591
|
+
RefCountedPtr<ExtProcFilter> ext_proc_filter_;
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
ExtProcFilter::ExtProcCall::ExtProcCall(
|
|
595
|
+
RefCountedPtr<ExtProcFilter> ext_proc_filter,
|
|
596
|
+
RefCountedPtr<XdsTransportFactory::XdsTransport> transport,
|
|
597
|
+
CallHandler handler)
|
|
598
|
+
: request_event_state_(InitialRequestEventState(*ext_proc_filter->config_)),
|
|
599
|
+
response_event_state_(
|
|
600
|
+
InitialResponseEventState(*ext_proc_filter->config_)),
|
|
601
|
+
handler_(handler),
|
|
602
|
+
ext_proc_filter_(std::move(ext_proc_filter)) {
|
|
603
|
+
const char* method = "/envoy.service.ext_proc.v3.ExternalProcessor/Process";
|
|
604
|
+
streaming_call_ = MakeRefCounted<XdsStreamingCallPromiseWrapper>(
|
|
605
|
+
*transport, method, XdsTransportFactory::XdsTransport::CallOptions());
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
std::string ExtProcFilter::ExtProcCall::DebugTag() const {
|
|
609
|
+
std::string tag;
|
|
610
|
+
StrAppend(tag, "[");
|
|
611
|
+
StrAppend(tag, Activity::current() != nullptr
|
|
612
|
+
? Activity::current()->DebugTag()
|
|
613
|
+
: "<unknown>");
|
|
614
|
+
StrAppend(tag, " ext_proc_filter=0x");
|
|
615
|
+
StrAppend(tag, absl::StrCat(absl::Hex(
|
|
616
|
+
reinterpret_cast<uintptr_t>(ext_proc_filter_.get()))));
|
|
617
|
+
StrAppend(tag, " ext_proc_call=0x");
|
|
618
|
+
StrAppend(tag, absl::StrCat(absl::Hex(reinterpret_cast<uintptr_t>(this))));
|
|
619
|
+
StrAppend(tag, "] ");
|
|
620
|
+
return tag;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
ExtProcFilter::ExtProcCall::~ExtProcCall() {
|
|
624
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
625
|
+
<< DebugTag() << "ExtProcCall destroyed";
|
|
626
|
+
if (config().deferred_close_timeout != Duration::Zero() &&
|
|
627
|
+
config().observability_mode) {
|
|
628
|
+
ext_proc_filter_->event_engine_->RunAfter(
|
|
629
|
+
config().deferred_close_timeout,
|
|
630
|
+
[call = std::move(streaming_call_)]() mutable {
|
|
631
|
+
// An ExecCtx is required on EventEngine threads when destroying the
|
|
632
|
+
// underlying streaming call, as its cancellation schedules completion
|
|
633
|
+
// closures.
|
|
634
|
+
ExecCtx exec_ctx;
|
|
635
|
+
call.reset();
|
|
636
|
+
});
|
|
637
|
+
} else {
|
|
638
|
+
streaming_call_.reset();
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// This function role is to:
|
|
643
|
+
// - send the message to the ext proc server and wait for the send to get
|
|
644
|
+
// complete and then propagate the status
|
|
645
|
+
// - if a message is already in progress then wait for the in flight message to
|
|
646
|
+
// get complete and then send the previous one if the stream is not closed
|
|
647
|
+
// - Handle the failure mode allow
|
|
648
|
+
auto ExtProcFilter::ExtProcCall::SendMessageToSideStream(std::string payload) {
|
|
649
|
+
return Map(
|
|
650
|
+
TrySeq(
|
|
651
|
+
// Wait until send state is kIdle, then mark kSendInFlight.
|
|
652
|
+
[self = WeakRef()]() -> Poll<StatusFlag> {
|
|
653
|
+
if (self->streaming_call_ == nullptr ||
|
|
654
|
+
self->ext_proc_send_state_ ==
|
|
655
|
+
SideStreamSendState::kSendFailed ||
|
|
656
|
+
self->side_stream_closed_latch_.is_set() ||
|
|
657
|
+
self->drain_requested_) {
|
|
658
|
+
return Failure{};
|
|
659
|
+
}
|
|
660
|
+
if (self->ext_proc_send_state_ != SideStreamSendState::kIdle) {
|
|
661
|
+
return self->ext_proc_send_waiter_.pending();
|
|
662
|
+
}
|
|
663
|
+
self->ext_proc_send_state_ = SideStreamSendState::kSendInFlight;
|
|
664
|
+
return Success{};
|
|
665
|
+
},
|
|
666
|
+
// Push the payload.
|
|
667
|
+
[self = WeakRef(), payload = std::move(payload)]() mutable {
|
|
668
|
+
return self->streaming_call_->PushMessage(std::move(payload));
|
|
669
|
+
}),
|
|
670
|
+
// Reset send state and wake up any waiting senders.
|
|
671
|
+
[self = WeakRef()](StatusFlag status) -> StatusFlag {
|
|
672
|
+
self->ext_proc_send_state_ =
|
|
673
|
+
status.ok() && !self->side_stream_closed_latch_.is_set()
|
|
674
|
+
? SideStreamSendState::kIdle
|
|
675
|
+
: SideStreamSendState::kSendFailed;
|
|
676
|
+
self->ext_proc_send_waiter_.Wake();
|
|
677
|
+
// Always return Success{} so that side-stream send failures don't
|
|
678
|
+
// prematurely abort data-plane read loops (which run under TrySeq)
|
|
679
|
+
// when fail-open (failure_mode_allow) is enabled. Side-stream errors
|
|
680
|
+
// and policy decisions are handled by HandleSideStreamStatus.
|
|
681
|
+
return Success{};
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
// Spawns the read-from-server loop on initiator_.
|
|
686
|
+
// Called from StartChildCall().
|
|
687
|
+
//
|
|
688
|
+
// Pulls server initial metadata, messages, and trailing metadata from
|
|
689
|
+
// downstream and immediately forwards them across inter-activity mechanisms
|
|
690
|
+
// to the handler_ activity.
|
|
691
|
+
void ExtProcFilter::ExtProcCall::SpawnReadFromServerLoop() {
|
|
692
|
+
initiator_.SpawnInfallible("read_from_server", [self = WeakRef()]() {
|
|
693
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
694
|
+
<< self->DebugTag() << "read_from_server task started";
|
|
695
|
+
return Seq(
|
|
696
|
+
self->initiator_.CancelIfFails(TrySeq(
|
|
697
|
+
self->initiator_.PullServerInitialMetadata(),
|
|
698
|
+
[self](std::optional<ServerMetadataHandle> metadata) {
|
|
699
|
+
const bool has_md = metadata.has_value();
|
|
700
|
+
self->server_initial_metadata_latch_.Set(std::move(metadata));
|
|
701
|
+
return Seq(
|
|
702
|
+
If(
|
|
703
|
+
has_md,
|
|
704
|
+
[self]() {
|
|
705
|
+
return ForEach(
|
|
706
|
+
MessagesFrom(self->initiator_),
|
|
707
|
+
[self](MessageHandle message) {
|
|
708
|
+
return Map(
|
|
709
|
+
self->server_to_client_messages_.sender.Push(
|
|
710
|
+
std::move(message)),
|
|
711
|
+
[](bool x) { return StatusFlag(x); });
|
|
712
|
+
});
|
|
713
|
+
},
|
|
714
|
+
Immediate(StatusFlag(Success{}))),
|
|
715
|
+
[self](StatusFlag status) {
|
|
716
|
+
self->server_to_client_messages_.sender.MarkClosed();
|
|
717
|
+
return status;
|
|
718
|
+
});
|
|
719
|
+
})),
|
|
720
|
+
self->initiator_.PullServerTrailingMetadata(),
|
|
721
|
+
[self](ServerMetadataHandle metadata) {
|
|
722
|
+
self->server_trailing_metadata_latch_.Set(std::move(metadata));
|
|
723
|
+
});
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
void ExtProcFilter::ExtProcCall::StartChildCall(ClientMetadataHandle metadata) {
|
|
728
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
729
|
+
<< DebugTag() << "Starting downstream child call";
|
|
730
|
+
initiator_ = ext_proc_filter_->MakeChildCall(std::move(metadata),
|
|
731
|
+
handler_.arena()->Ref());
|
|
732
|
+
handler_.AddChildCall(initiator_);
|
|
733
|
+
SpawnReadFromServerLoop();
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
//
|
|
737
|
+
// Read-from-sidestream Event Handlers
|
|
738
|
+
//
|
|
739
|
+
|
|
740
|
+
StatusFlag
|
|
741
|
+
ExtProcFilter::ExtProcCall::HandleClientInitialMetadataFromSidestream(
|
|
742
|
+
const ExtProcResponse::RequestHeaders& response) {
|
|
743
|
+
if (request_event_state_ != SideStreamRequestEventState::kExpectHeaders) {
|
|
744
|
+
CancelCallWithError(
|
|
745
|
+
absl::InternalError("Received unexpected request headers response from "
|
|
746
|
+
"external processor"));
|
|
747
|
+
return Failure{};
|
|
748
|
+
}
|
|
749
|
+
request_event_state_ = processing_mode().send_request_body
|
|
750
|
+
? SideStreamRequestEventState::kExpectBody
|
|
751
|
+
: SideStreamRequestEventState::kExpectNothing;
|
|
752
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
753
|
+
<< DebugTag()
|
|
754
|
+
<< "Processing external processor response for client initial "
|
|
755
|
+
"metadata";
|
|
756
|
+
if (auto status =
|
|
757
|
+
ApplyHeaderMutations(response.mutation, config().mutation_rules,
|
|
758
|
+
*client_initial_metadata_);
|
|
759
|
+
!status.ok()) {
|
|
760
|
+
CancelCallWithError(status);
|
|
761
|
+
return Failure{};
|
|
762
|
+
}
|
|
763
|
+
StartChildCall(std::move(client_initial_metadata_));
|
|
764
|
+
ext_proc_filter_->RecordClientHeadersDuration(
|
|
765
|
+
(Timestamp::Now() - client_initial_metadata_start_time_).seconds());
|
|
766
|
+
return Success{};
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
StatusFlag ExtProcFilter::ExtProcCall::HandleClientMessageFromSidestream(
|
|
770
|
+
const ExtProcResponse::RequestBody& response) {
|
|
771
|
+
if (request_event_state_ != SideStreamRequestEventState::kExpectBody) {
|
|
772
|
+
CancelCallWithError(absl::InternalError(
|
|
773
|
+
"Received unexpected request body response from external processor"));
|
|
774
|
+
return Failure{};
|
|
775
|
+
}
|
|
776
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
777
|
+
<< DebugTag() << "Parsed request body response, eos: "
|
|
778
|
+
<< response.mutation.end_of_stream << ", eos_without_msg: "
|
|
779
|
+
<< response.mutation.end_of_stream_without_message;
|
|
780
|
+
// TODO(rishesh): Remove this check when we stop using the
|
|
781
|
+
// v3-to-v1 adaptor layer.
|
|
782
|
+
if (outstanding_c2s_messages_ == 0) {
|
|
783
|
+
CancelCallWithError(absl::InternalError(
|
|
784
|
+
"Received unexpected request body response from external processor"));
|
|
785
|
+
return Failure{};
|
|
786
|
+
}
|
|
787
|
+
--outstanding_c2s_messages_;
|
|
788
|
+
// Handle message, if any.
|
|
789
|
+
if (!response.mutation.end_of_stream ||
|
|
790
|
+
!response.mutation.end_of_stream_without_message) {
|
|
791
|
+
auto slice = Slice::FromCopiedString(response.mutation.body);
|
|
792
|
+
auto new_msg = initiator_.arena()->MakePooled<Message>(
|
|
793
|
+
SliceBuffer(std::move(slice)), /*flags=*/0);
|
|
794
|
+
// TODO(rishesh, roth): Spawning this push into the activity means that we
|
|
795
|
+
// won't have flow control feedback here in a pure v3 stack, so we need to
|
|
796
|
+
// fix it before we finish the v3 migration.
|
|
797
|
+
initiator_.SpawnPushMessage(std::move(new_msg));
|
|
798
|
+
}
|
|
799
|
+
// Handle EOS.
|
|
800
|
+
if (response.mutation.end_of_stream) {
|
|
801
|
+
ext_proc_closed_c2s_ = true;
|
|
802
|
+
// TODO(rishesh): Remove this check when we stop using the
|
|
803
|
+
// v3-to-v1 adaptor layer.
|
|
804
|
+
if (outstanding_c2s_messages_ > 0 ||
|
|
805
|
+
(response.mutation.end_of_stream_without_message &&
|
|
806
|
+
!c2s_writes_done_)) {
|
|
807
|
+
CancelCallWithError(absl::InternalError(
|
|
808
|
+
"Client tried to send a message but external processor server has "
|
|
809
|
+
"already force sent half close to the server"));
|
|
810
|
+
return Failure{};
|
|
811
|
+
}
|
|
812
|
+
request_event_state_ = SideStreamRequestEventState::kExpectNothing;
|
|
813
|
+
if (c2s_writes_done_) {
|
|
814
|
+
initiator_.SpawnFinishSends();
|
|
815
|
+
ext_proc_filter_->RecordClientHalfCloseDuration(
|
|
816
|
+
(Timestamp::Now() - client_half_close_start_time_).seconds());
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
return Success{};
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
StatusFlag
|
|
823
|
+
ExtProcFilter::ExtProcCall::HandleServerInitialMetadataFromSidestream(
|
|
824
|
+
const ExtProcResponse::ResponseHeaders& response) {
|
|
825
|
+
if (response_event_state_ != SideStreamResponseEventState::kExpectHeaders) {
|
|
826
|
+
CancelCallWithError(absl::InternalError(
|
|
827
|
+
"Received unexpected response headers response from external "
|
|
828
|
+
"processor"));
|
|
829
|
+
return Failure{};
|
|
830
|
+
}
|
|
831
|
+
if (is_trailers_only_) {
|
|
832
|
+
response_event_state_ = SideStreamResponseEventState::kExpectNothing;
|
|
833
|
+
} else if (processing_mode().send_response_body) {
|
|
834
|
+
response_event_state_ = SideStreamResponseEventState::kExpectBodyOrTrailers;
|
|
835
|
+
} else if (processing_mode().send_response_trailers) {
|
|
836
|
+
response_event_state_ = SideStreamResponseEventState::kExpectTrailers;
|
|
837
|
+
} else {
|
|
838
|
+
response_event_state_ = SideStreamResponseEventState::kExpectNothing;
|
|
839
|
+
}
|
|
840
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
841
|
+
<< DebugTag()
|
|
842
|
+
<< "Processing external processor response for server initial "
|
|
843
|
+
"metadata";
|
|
844
|
+
if (is_trailers_only_) {
|
|
845
|
+
if (server_trailing_metadata_ == nullptr) {
|
|
846
|
+
CancelCallWithError(absl::InternalError(
|
|
847
|
+
"Server trailers not found in trailers-only response"));
|
|
848
|
+
return Failure{};
|
|
849
|
+
}
|
|
850
|
+
if (auto status =
|
|
851
|
+
ApplyHeaderMutations(response.mutation, config().mutation_rules,
|
|
852
|
+
*server_trailing_metadata_);
|
|
853
|
+
!status.ok()) {
|
|
854
|
+
CancelCallWithError(status);
|
|
855
|
+
return Failure{};
|
|
856
|
+
}
|
|
857
|
+
handler_.PushServerTrailingMetadata(std::move(server_trailing_metadata_));
|
|
858
|
+
ext_proc_filter_->RecordServerTrailersDuration(
|
|
859
|
+
(Timestamp::Now() - server_trailing_metadata_start_time_).seconds());
|
|
860
|
+
return Success{};
|
|
861
|
+
}
|
|
862
|
+
if (server_initial_metadata_ == nullptr) {
|
|
863
|
+
CancelCallWithError(
|
|
864
|
+
absl::InternalError("Server initial metadata not found"));
|
|
865
|
+
return Failure{};
|
|
866
|
+
}
|
|
867
|
+
if (auto status =
|
|
868
|
+
ApplyHeaderMutations(response.mutation, config().mutation_rules,
|
|
869
|
+
*server_initial_metadata_);
|
|
870
|
+
!status.ok()) {
|
|
871
|
+
CancelCallWithError(status);
|
|
872
|
+
return Failure{};
|
|
873
|
+
}
|
|
874
|
+
handler_.PushServerInitialMetadata(std::move(server_initial_metadata_));
|
|
875
|
+
ext_proc_filter_->RecordServerHeadersDuration(
|
|
876
|
+
(Timestamp::Now() - server_initial_metadata_start_time_).seconds());
|
|
877
|
+
return Success{};
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
StatusFlag ExtProcFilter::ExtProcCall::HandleServerMessageFromSidestream(
|
|
881
|
+
const ExtProcResponse::ResponseBody& response) {
|
|
882
|
+
if (response_event_state_ !=
|
|
883
|
+
SideStreamResponseEventState::kExpectBodyOrTrailers) {
|
|
884
|
+
CancelCallWithError(absl::InternalError(
|
|
885
|
+
"Received unexpected response body response from external processor"));
|
|
886
|
+
return Failure{};
|
|
887
|
+
}
|
|
888
|
+
// TODO(rishesh): Remove this check when we stop using the v3-to-v1 bridge.
|
|
889
|
+
// We need this check in the short term because of the restriction that the
|
|
890
|
+
// ext_proc server cannot change the number of messages on the stream.
|
|
891
|
+
// However, once that restriction is removed, this check will no longer be
|
|
892
|
+
// correct: even if the server sends a trailers-only response, the ext_proc
|
|
893
|
+
// server should still be allowed to insert its own headers and messages
|
|
894
|
+
// before sending status.
|
|
895
|
+
if (is_trailers_only_) {
|
|
896
|
+
CancelCallWithError(absl::InternalError(
|
|
897
|
+
"Received response body response in a Trailers-Only call"));
|
|
898
|
+
return Failure{};
|
|
899
|
+
}
|
|
900
|
+
if (outstanding_s2c_messages_ == 0) {
|
|
901
|
+
CancelCallWithError(absl::InternalError(
|
|
902
|
+
"Received unexpected response body response from external processor"));
|
|
903
|
+
return Failure{};
|
|
904
|
+
}
|
|
905
|
+
--outstanding_s2c_messages_;
|
|
906
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
907
|
+
<< DebugTag() << "Processing external processor response for server body";
|
|
908
|
+
auto slice = Slice::FromCopiedString(response.mutation.body);
|
|
909
|
+
auto new_msg = handler_.arena()->MakePooled<Message>(
|
|
910
|
+
SliceBuffer(std::move(slice)), /*flags=*/0);
|
|
911
|
+
// TODO(rishesh, roth): Spawning this push into the activity means that we
|
|
912
|
+
// won't have flow control feedback here in a pure v3 stack, so we need to fix
|
|
913
|
+
// it before we finish the v3 migration.
|
|
914
|
+
handler_.SpawnPushMessage(std::move(new_msg));
|
|
915
|
+
return Success{};
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
StatusFlag
|
|
919
|
+
ExtProcFilter::ExtProcCall::HandleServerTrailingMetadataFromSidestream(
|
|
920
|
+
const ExtProcResponse::ResponseTrailers& response) {
|
|
921
|
+
if (response_event_state_ !=
|
|
922
|
+
SideStreamResponseEventState::kExpectBodyOrTrailers &&
|
|
923
|
+
response_event_state_ != SideStreamResponseEventState::kExpectTrailers) {
|
|
924
|
+
CancelCallWithError(absl::InternalError(
|
|
925
|
+
"Received unexpected response trailers response from external "
|
|
926
|
+
"processor"));
|
|
927
|
+
return Failure{};
|
|
928
|
+
}
|
|
929
|
+
if (outstanding_s2c_messages_ > 0) {
|
|
930
|
+
CancelCallWithError(absl::InternalError(
|
|
931
|
+
"Received response trailers response before all outstanding "
|
|
932
|
+
"response body responses were received"));
|
|
933
|
+
return Failure{};
|
|
934
|
+
}
|
|
935
|
+
response_event_state_ = SideStreamResponseEventState::kExpectNothing;
|
|
936
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
937
|
+
<< DebugTag()
|
|
938
|
+
<< "Processing external processor response for server trailing "
|
|
939
|
+
"metadata";
|
|
940
|
+
if (server_trailing_metadata_ == nullptr) {
|
|
941
|
+
CancelCallWithError(
|
|
942
|
+
absl::InternalError("Server trailing metadata not found"));
|
|
943
|
+
return Failure{};
|
|
944
|
+
}
|
|
945
|
+
if (auto status =
|
|
946
|
+
ApplyHeaderMutations(response.mutation, config().mutation_rules,
|
|
947
|
+
*server_trailing_metadata_);
|
|
948
|
+
!status.ok()) {
|
|
949
|
+
CancelCallWithError(status);
|
|
950
|
+
return Failure{};
|
|
951
|
+
}
|
|
952
|
+
handler_.PushServerTrailingMetadata(std::move(server_trailing_metadata_));
|
|
953
|
+
ext_proc_filter_->RecordServerTrailersDuration(
|
|
954
|
+
(Timestamp::Now() - server_trailing_metadata_start_time_).seconds());
|
|
955
|
+
return Success{};
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
StatusFlag ExtProcFilter::ExtProcCall::HandleImmediateResponseFromSidestream(
|
|
959
|
+
const ExtProcResponse::ImmediateResponse& response) {
|
|
960
|
+
if (config().disable_immediate_response) {
|
|
961
|
+
CancelCallWithError(absl::InternalError(
|
|
962
|
+
"unhandled immediate response due to config disabled it"));
|
|
963
|
+
return Failure{};
|
|
964
|
+
}
|
|
965
|
+
request_event_state_ = SideStreamRequestEventState::kExpectNothing;
|
|
966
|
+
response_event_state_ = SideStreamResponseEventState::kExpectNothing;
|
|
967
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
968
|
+
<< DebugTag() << "Processing external processor immediate response";
|
|
969
|
+
auto error_md = CancelledServerMetadataFromStatus(
|
|
970
|
+
static_cast<grpc_status_code>(response.status), response.details);
|
|
971
|
+
(void)ApplyHeaderMutations(response.mutation, config().mutation_rules,
|
|
972
|
+
*error_md);
|
|
973
|
+
handler_.PushServerTrailingMetadata(std::move(error_md));
|
|
974
|
+
return Success{};
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
auto ExtProcFilter::ExtProcCall::ProcessSideStreamResponse(
|
|
978
|
+
absl::string_view payload) {
|
|
979
|
+
// In observability mode, we only log the message and ignore it.
|
|
980
|
+
// We must continue reading the stream to keep it alive.
|
|
981
|
+
if (config().observability_mode) {
|
|
982
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
983
|
+
<< DebugTag()
|
|
984
|
+
<< "message received in observability mode (ignored), size="
|
|
985
|
+
<< payload.size();
|
|
986
|
+
return Immediate(StatusFlag(Success{}));
|
|
987
|
+
}
|
|
988
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
989
|
+
<< DebugTag() << "message received, size=" << payload.size();
|
|
990
|
+
// Parse the response from the external processor.
|
|
991
|
+
auto parsed_response = ExtProcResponse::Parse(payload);
|
|
992
|
+
if (!parsed_response.ok()) {
|
|
993
|
+
HandleSideStreamStatus(parsed_response.status());
|
|
994
|
+
return Immediate(StatusFlag(Failure{}));
|
|
995
|
+
}
|
|
996
|
+
// If the server requests a drain, we half-close the stream to signal
|
|
997
|
+
// we are done sending requests.
|
|
998
|
+
if (parsed_response->request_drain) {
|
|
999
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1000
|
+
<< DebugTag() << "received request_drain=true";
|
|
1001
|
+
drain_requested_ = true;
|
|
1002
|
+
if (streaming_call_ != nullptr) {
|
|
1003
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1004
|
+
<< DebugTag() << "sending half-close";
|
|
1005
|
+
streaming_call_->SendHalfClose();
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
// Dispatch the parsed response to the appropriate processor based on the
|
|
1009
|
+
// response type.
|
|
1010
|
+
return Match(
|
|
1011
|
+
(*parsed_response).response,
|
|
1012
|
+
[&](const ExtProcResponse::ImmediateResponse& response) {
|
|
1013
|
+
return Immediate(HandleImmediateResponseFromSidestream(response));
|
|
1014
|
+
},
|
|
1015
|
+
[&](const ExtProcResponse::RequestHeaders& response) {
|
|
1016
|
+
return Immediate(HandleClientInitialMetadataFromSidestream(response));
|
|
1017
|
+
},
|
|
1018
|
+
[&](const ExtProcResponse::ResponseHeaders& response) {
|
|
1019
|
+
return Immediate(HandleServerInitialMetadataFromSidestream(response));
|
|
1020
|
+
},
|
|
1021
|
+
[&](const ExtProcResponse::ResponseTrailers& response) {
|
|
1022
|
+
return Immediate(HandleServerTrailingMetadataFromSidestream(response));
|
|
1023
|
+
},
|
|
1024
|
+
[&](const ExtProcResponse::RequestBody& response) {
|
|
1025
|
+
return Immediate(HandleClientMessageFromSidestream(response));
|
|
1026
|
+
},
|
|
1027
|
+
[&](const ExtProcResponse::ResponseBody& response) {
|
|
1028
|
+
return Immediate(HandleServerMessageFromSidestream(response));
|
|
1029
|
+
},
|
|
1030
|
+
[](std::monostate) { return Immediate(StatusFlag(Success{})); });
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
bool ExtProcFilter::ExtProcCall::HandleSideStreamStatus(absl::Status status) {
|
|
1034
|
+
if (side_stream_closed_latch_.is_set()) {
|
|
1035
|
+
return true;
|
|
1036
|
+
}
|
|
1037
|
+
side_stream_closed_latch_.Set();
|
|
1038
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1039
|
+
<< DebugTag() << "status received: " << status;
|
|
1040
|
+
const bool has_outstanding_messages =
|
|
1041
|
+
outstanding_c2s_messages_ > 0 || outstanding_s2c_messages_ > 0;
|
|
1042
|
+
const bool must_drain =
|
|
1043
|
+
!config().observability_mode && (processing_mode().send_request_body ||
|
|
1044
|
+
processing_mode().send_response_body);
|
|
1045
|
+
// Check if a clean stream closure violated draining or message-in-flight
|
|
1046
|
+
// requirements.
|
|
1047
|
+
if (status.ok()) {
|
|
1048
|
+
if (must_drain && !drain_requested_) {
|
|
1049
|
+
status = absl::InternalError("Stream closed cleanly without drain");
|
|
1050
|
+
}
|
|
1051
|
+
// TODO(rishesh): removed this check once PH2 work is done
|
|
1052
|
+
else if (has_outstanding_messages && !config().observability_mode) {
|
|
1053
|
+
status = absl::InternalError(
|
|
1054
|
+
"Stream closed cleanly with outstanding messages");
|
|
1055
|
+
}
|
|
1056
|
+
} else if (status.code() != absl::StatusCode::kInternal) {
|
|
1057
|
+
status = absl::InternalError(
|
|
1058
|
+
absl::StrCat("External processor stream failed: ", status.ToString()));
|
|
1059
|
+
}
|
|
1060
|
+
const bool fail_data_plane_stream = !status.ok() && !IsFailOpenAllowed();
|
|
1061
|
+
if (fail_data_plane_stream) {
|
|
1062
|
+
CancelCallWithError(status);
|
|
1063
|
+
return false;
|
|
1064
|
+
}
|
|
1065
|
+
// Not failing, so make sure we process any outstanding processors by
|
|
1066
|
+
// forwarding unmutated metadata.
|
|
1067
|
+
if (request_event_state_ == SideStreamRequestEventState::kExpectHeaders &&
|
|
1068
|
+
client_initial_metadata_ != nullptr) {
|
|
1069
|
+
(void)HandleClientInitialMetadataFromSidestream(
|
|
1070
|
+
ExtProcResponse::RequestHeaders{});
|
|
1071
|
+
}
|
|
1072
|
+
if (response_event_state_ == SideStreamResponseEventState::kExpectHeaders &&
|
|
1073
|
+
((!is_trailers_only_ && server_initial_metadata_ != nullptr) ||
|
|
1074
|
+
(is_trailers_only_ && server_trailing_metadata_ != nullptr))) {
|
|
1075
|
+
(void)HandleServerInitialMetadataFromSidestream(
|
|
1076
|
+
ExtProcResponse::ResponseHeaders{});
|
|
1077
|
+
}
|
|
1078
|
+
if ((response_event_state_ ==
|
|
1079
|
+
SideStreamResponseEventState::kExpectBodyOrTrailers ||
|
|
1080
|
+
response_event_state_ ==
|
|
1081
|
+
SideStreamResponseEventState::kExpectTrailers) &&
|
|
1082
|
+
!is_trailers_only_ && server_trailing_metadata_ != nullptr) {
|
|
1083
|
+
(void)HandleServerTrailingMetadataFromSidestream(
|
|
1084
|
+
ExtProcResponse::ResponseTrailers{});
|
|
1085
|
+
}
|
|
1086
|
+
return true;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
//
|
|
1090
|
+
// Read-from-client Event Handlers
|
|
1091
|
+
//
|
|
1092
|
+
|
|
1093
|
+
auto ExtProcFilter::ExtProcCall::HandleInitialMetadataFromClient(
|
|
1094
|
+
ClientMetadataHandle metadata) {
|
|
1095
|
+
client_initial_metadata_start_time_ = Timestamp::Now();
|
|
1096
|
+
client_initial_metadata_ = std::move(metadata);
|
|
1097
|
+
const bool send_request_headers = processing_mode().send_request_headers;
|
|
1098
|
+
absl::StatusOr<std::string> payload = "";
|
|
1099
|
+
if (send_request_headers) {
|
|
1100
|
+
// Construct ext_proc request for client initial metadata.
|
|
1101
|
+
// Include processing mode in the request if this is the first message
|
|
1102
|
+
// on the stream.
|
|
1103
|
+
std::optional<ExtProcProcessingMode> processing_mode;
|
|
1104
|
+
if (IsFirstMessageOnSideStream()) {
|
|
1105
|
+
processing_mode = config().processing_mode;
|
|
1106
|
+
}
|
|
1107
|
+
upb::Arena arena;
|
|
1108
|
+
EvaluateArgs args(client_initial_metadata_.get(), /*channel_args=*/nullptr);
|
|
1109
|
+
auto* header_attributes = CreateExtProcAttributesProtoStruct(
|
|
1110
|
+
arena.ptr(), config().request_attributes, args,
|
|
1111
|
+
ext_proc_filter_->default_authority_.as_string_view());
|
|
1112
|
+
payload = CreateExtProcClientHeadersRequest(
|
|
1113
|
+
arena.ptr(), client_initial_metadata_.get(),
|
|
1114
|
+
config().forwarding_allowed_headers,
|
|
1115
|
+
config().forwarding_disallowed_headers, header_attributes,
|
|
1116
|
+
config().observability_mode, processing_mode);
|
|
1117
|
+
}
|
|
1118
|
+
// If request body will be sent later and request attributes are
|
|
1119
|
+
// configured, extract initial attributes from client metadata.
|
|
1120
|
+
else if (processing_mode().send_request_body &&
|
|
1121
|
+
!config().request_attributes.empty()) {
|
|
1122
|
+
EvaluateArgs args(client_initial_metadata_.get(), /*channel_args=*/nullptr);
|
|
1123
|
+
request_attributes_ = CreateExtProcAttributesProtoStruct(
|
|
1124
|
+
request_attributes_arena_.ptr(), config().request_attributes, args,
|
|
1125
|
+
ext_proc_filter_->default_authority_.as_string_view());
|
|
1126
|
+
}
|
|
1127
|
+
const bool call_cancelled =
|
|
1128
|
+
!payload.ok() && !HandleSideStreamStatus(payload.status());
|
|
1129
|
+
const bool send_to_sidestream = send_request_headers && payload.ok() &&
|
|
1130
|
+
!side_stream_closed_latch_.is_set();
|
|
1131
|
+
return If(
|
|
1132
|
+
call_cancelled, Immediate(StatusFlag(Failure{})),
|
|
1133
|
+
TrySeq(
|
|
1134
|
+
// Forward initial metadata to backend if not waiting for side-stream
|
|
1135
|
+
// or running in observability mode.
|
|
1136
|
+
If(
|
|
1137
|
+
!send_to_sidestream || config().observability_mode,
|
|
1138
|
+
[self = WeakRef()]() {
|
|
1139
|
+
// client_initial_metadata_ will be null if payload creation
|
|
1140
|
+
// failed with fail-open enabled, in which case
|
|
1141
|
+
// HandleSideStreamStatus() has already forwarded the metadata
|
|
1142
|
+
// and started the child call.
|
|
1143
|
+
if (self->client_initial_metadata_ != nullptr) {
|
|
1144
|
+
self->StartChildCall(
|
|
1145
|
+
std::move(self->client_initial_metadata_));
|
|
1146
|
+
}
|
|
1147
|
+
return Immediate(StatusFlag(Success{}));
|
|
1148
|
+
},
|
|
1149
|
+
Immediate(StatusFlag(Success{}))),
|
|
1150
|
+
// Send client initial metadata payload to the side-stream.
|
|
1151
|
+
If(
|
|
1152
|
+
send_to_sidestream,
|
|
1153
|
+
[self = WeakRef(), payload = std::move(payload)]() mutable {
|
|
1154
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1155
|
+
<< self->DebugTag()
|
|
1156
|
+
<< "Sending client initial metadata to sidestream";
|
|
1157
|
+
return self->SendMessageToSideStream(std::move(*payload));
|
|
1158
|
+
},
|
|
1159
|
+
[self = WeakRef()]() {
|
|
1160
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1161
|
+
<< self->DebugTag()
|
|
1162
|
+
<< "Skipping client initial metadata (processing mode "
|
|
1163
|
+
"disabled)";
|
|
1164
|
+
return Immediate(StatusFlag(Success{}));
|
|
1165
|
+
})));
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
auto ExtProcFilter::ExtProcCall::HandleMessageFromClient(
|
|
1169
|
+
MessageHandle message) {
|
|
1170
|
+
const bool send_request_body = processing_mode().send_request_body &&
|
|
1171
|
+
!side_stream_closed_latch_.is_set();
|
|
1172
|
+
absl::StatusOr<std::string> payload = "";
|
|
1173
|
+
if (!send_request_body) {
|
|
1174
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1175
|
+
<< DebugTag()
|
|
1176
|
+
<< "Client message non-processing mode (processing disabled or "
|
|
1177
|
+
"closed)";
|
|
1178
|
+
}
|
|
1179
|
+
// TODO(rishesh): If the external processor has already closed client
|
|
1180
|
+
// sends (via end_of_stream or end_of_stream_without_message in
|
|
1181
|
+
// ProcessingResponse), any subsequent message from the client cannot be
|
|
1182
|
+
// processed. Since message dropping is not yet supported in Call v3,
|
|
1183
|
+
// fail the call here. Remove this once PH2 is implemented.
|
|
1184
|
+
else if (ext_proc_closed_c2s_) {
|
|
1185
|
+
payload = absl::InternalError(
|
|
1186
|
+
"Client tried to send a message but external processor server has "
|
|
1187
|
+
"already force sent half close to the server");
|
|
1188
|
+
} else if (!drain_requested_) {
|
|
1189
|
+
// Construct message for sidestream.
|
|
1190
|
+
std::string message_bytes;
|
|
1191
|
+
if (message != nullptr) {
|
|
1192
|
+
message_bytes = message->payload()->JoinIntoString();
|
|
1193
|
+
}
|
|
1194
|
+
if (!config().observability_mode) {
|
|
1195
|
+
++outstanding_c2s_messages_;
|
|
1196
|
+
}
|
|
1197
|
+
std::optional<ExtProcProcessingMode> processing_mode;
|
|
1198
|
+
if (IsFirstMessageOnSideStream()) {
|
|
1199
|
+
processing_mode = config().processing_mode;
|
|
1200
|
+
}
|
|
1201
|
+
upb::Arena arena;
|
|
1202
|
+
payload = CreateExtProcClientBodyRequest(
|
|
1203
|
+
arena.ptr(), message_bytes, request_attributes_,
|
|
1204
|
+
config().observability_mode, processing_mode,
|
|
1205
|
+
/*end_of_stream=*/false,
|
|
1206
|
+
/*end_of_stream_without_message=*/false);
|
|
1207
|
+
request_attributes_ = nullptr;
|
|
1208
|
+
}
|
|
1209
|
+
const bool call_cancelled =
|
|
1210
|
+
!payload.ok() && !HandleSideStreamStatus(payload.status());
|
|
1211
|
+
const bool send_to_sidestream = send_request_body && payload.ok() &&
|
|
1212
|
+
!drain_requested_ &&
|
|
1213
|
+
!side_stream_closed_latch_.is_set();
|
|
1214
|
+
return If(
|
|
1215
|
+
call_cancelled, Immediate(StatusFlag(Failure{})),
|
|
1216
|
+
TrySeq(
|
|
1217
|
+
// Wait for side-stream to finish draining if drain mode was
|
|
1218
|
+
// requested.
|
|
1219
|
+
If(
|
|
1220
|
+
drain_requested_ && send_request_body,
|
|
1221
|
+
[self = WeakRef()]() {
|
|
1222
|
+
return TrySeq(self->side_stream_closed_latch_.Wait(),
|
|
1223
|
+
[]() -> StatusFlag { return Success{}; });
|
|
1224
|
+
},
|
|
1225
|
+
Immediate(StatusFlag(Success{}))),
|
|
1226
|
+
Map(TryJoin<ValueOrFailure>(
|
|
1227
|
+
// Forward client message to backend if not waiting for
|
|
1228
|
+
// side-stream or running in observability mode.
|
|
1229
|
+
If(
|
|
1230
|
+
!send_to_sidestream || config().observability_mode,
|
|
1231
|
+
[self = WeakRef(),
|
|
1232
|
+
message = std::move(message)]() mutable {
|
|
1233
|
+
// TODO(rishesh, roth): Spawning this push into the
|
|
1234
|
+
// activity means that we won't have flow control
|
|
1235
|
+
// feedback here in a pure v3 stack, so we need to fix
|
|
1236
|
+
// it before we finish the v3 migration.
|
|
1237
|
+
self->initiator_.SpawnPushMessage(std::move(message));
|
|
1238
|
+
return Immediate(StatusFlag(Success{}));
|
|
1239
|
+
},
|
|
1240
|
+
Immediate(StatusFlag(Success{}))),
|
|
1241
|
+
// Send client message payload to the side-stream.
|
|
1242
|
+
If(
|
|
1243
|
+
send_to_sidestream,
|
|
1244
|
+
[self = WeakRef(),
|
|
1245
|
+
payload = std::move(payload)]() mutable {
|
|
1246
|
+
self->first_body_message_sent_ = true;
|
|
1247
|
+
if (self->config().observability_mode) {
|
|
1248
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1249
|
+
<< self->DebugTag()
|
|
1250
|
+
<< "Client message observability mode";
|
|
1251
|
+
}
|
|
1252
|
+
return self->SendMessageToSideStream(
|
|
1253
|
+
std::move(*payload));
|
|
1254
|
+
},
|
|
1255
|
+
Immediate(StatusFlag(Success{})))),
|
|
1256
|
+
[](auto x) { return x.status(); })));
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
auto ExtProcFilter::ExtProcCall::HandleHalfCloseFromClient() {
|
|
1260
|
+
client_half_close_start_time_ = Timestamp::Now();
|
|
1261
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1262
|
+
<< DebugTag() << "HandleHalfCloseFromClient invoked";
|
|
1263
|
+
c2s_writes_done_ = true;
|
|
1264
|
+
const bool send_request_body =
|
|
1265
|
+
processing_mode().send_request_body && !ext_proc_closed_c2s_ &&
|
|
1266
|
+
!side_stream_closed_latch_.is_set() && !drain_requested_;
|
|
1267
|
+
absl::StatusOr<std::string> payload = "";
|
|
1268
|
+
if (send_request_body) {
|
|
1269
|
+
if (!config().observability_mode) {
|
|
1270
|
+
++outstanding_c2s_messages_;
|
|
1271
|
+
}
|
|
1272
|
+
std::optional<ExtProcProcessingMode> processing_mode;
|
|
1273
|
+
if (IsFirstMessageOnSideStream()) {
|
|
1274
|
+
processing_mode = config().processing_mode;
|
|
1275
|
+
}
|
|
1276
|
+
upb::Arena arena;
|
|
1277
|
+
payload = CreateExtProcClientBodyRequest(
|
|
1278
|
+
arena.ptr(), /*body=*/"", request_attributes_,
|
|
1279
|
+
config().observability_mode, processing_mode,
|
|
1280
|
+
/*end_of_stream=*/true,
|
|
1281
|
+
/*end_of_stream_without_message=*/true);
|
|
1282
|
+
request_attributes_ = nullptr;
|
|
1283
|
+
}
|
|
1284
|
+
const bool call_cancelled =
|
|
1285
|
+
!payload.ok() && !HandleSideStreamStatus(payload.status());
|
|
1286
|
+
const bool send_to_sidestream =
|
|
1287
|
+
send_request_body && payload.ok() && !side_stream_closed_latch_.is_set();
|
|
1288
|
+
return If(call_cancelled, Immediate(StatusFlag(Failure{})),
|
|
1289
|
+
TrySeq(
|
|
1290
|
+
// Wait for side-stream to finish draining if drain mode was
|
|
1291
|
+
// requested.
|
|
1292
|
+
If(
|
|
1293
|
+
drain_requested_ && send_request_body,
|
|
1294
|
+
[self = WeakRef()]() {
|
|
1295
|
+
return TrySeq(self->side_stream_closed_latch_.Wait(),
|
|
1296
|
+
[]() -> StatusFlag { return Success{}; });
|
|
1297
|
+
},
|
|
1298
|
+
Immediate(StatusFlag(Success{}))),
|
|
1299
|
+
// Forward half-close to backend if not waiting for side-stream
|
|
1300
|
+
// or running in observability mode.
|
|
1301
|
+
If(
|
|
1302
|
+
!send_to_sidestream || config().observability_mode,
|
|
1303
|
+
[self = WeakRef()]() {
|
|
1304
|
+
self->initiator_.SpawnFinishSends();
|
|
1305
|
+
return Immediate(StatusFlag(Success{}));
|
|
1306
|
+
},
|
|
1307
|
+
Immediate(StatusFlag(Success{}))),
|
|
1308
|
+
// Send client half-close payload to the side-stream.
|
|
1309
|
+
If(
|
|
1310
|
+
send_to_sidestream,
|
|
1311
|
+
[self = WeakRef(), payload = std::move(payload)]() mutable {
|
|
1312
|
+
self->first_body_message_sent_ = true;
|
|
1313
|
+
return self->SendMessageToSideStream(std::move(*payload));
|
|
1314
|
+
},
|
|
1315
|
+
Immediate(StatusFlag(Success{})))));
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
//
|
|
1319
|
+
// Read-from-server Event Handlers
|
|
1320
|
+
//
|
|
1321
|
+
|
|
1322
|
+
auto ExtProcFilter::ExtProcCall::HandleInitialMetadataFromServer(
|
|
1323
|
+
std::optional<ServerMetadataHandle> metadata) {
|
|
1324
|
+
server_initial_metadata_start_time_ = Timestamp::Now();
|
|
1325
|
+
const bool is_trailers_only =
|
|
1326
|
+
!metadata.has_value() ||
|
|
1327
|
+
(*metadata)->get(GrpcTrailersOnly()).value_or(false);
|
|
1328
|
+
if (is_trailers_only) {
|
|
1329
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1330
|
+
<< DebugTag() << "No server initial metadata (trailers-only response)";
|
|
1331
|
+
is_trailers_only_ = true;
|
|
1332
|
+
} else {
|
|
1333
|
+
server_initial_metadata_ = std::move(*metadata);
|
|
1334
|
+
}
|
|
1335
|
+
const bool send_response_headers =
|
|
1336
|
+
!is_trailers_only && processing_mode().send_response_headers &&
|
|
1337
|
+
!side_stream_closed_latch_.is_set() && !drain_requested_;
|
|
1338
|
+
absl::StatusOr<std::string> payload = "";
|
|
1339
|
+
if (send_response_headers) {
|
|
1340
|
+
// Include processing mode if this is the first message on the
|
|
1341
|
+
// stream.
|
|
1342
|
+
std::optional<ExtProcProcessingMode> processing_mode;
|
|
1343
|
+
if (IsFirstMessageOnSideStream()) {
|
|
1344
|
+
processing_mode = config().processing_mode;
|
|
1345
|
+
}
|
|
1346
|
+
upb::Arena arena;
|
|
1347
|
+
payload = CreateExtProcServerHeadersRequest(
|
|
1348
|
+
arena.ptr(), server_initial_metadata_.get(),
|
|
1349
|
+
config().forwarding_allowed_headers,
|
|
1350
|
+
config().forwarding_disallowed_headers,
|
|
1351
|
+
/*attributes=*/nullptr, config().observability_mode, processing_mode,
|
|
1352
|
+
/*end_of_stream=*/false);
|
|
1353
|
+
}
|
|
1354
|
+
const bool call_cancelled =
|
|
1355
|
+
!payload.ok() && !HandleSideStreamStatus(payload.status());
|
|
1356
|
+
const bool send_to_sidestream = send_response_headers && payload.ok() &&
|
|
1357
|
+
!side_stream_closed_latch_.is_set();
|
|
1358
|
+
return If(
|
|
1359
|
+
call_cancelled, Immediate(StatusFlag(Failure{})),
|
|
1360
|
+
TrySeq(
|
|
1361
|
+
// Forward server initial metadata downstream to client if not
|
|
1362
|
+
// trailers-only and not waiting for side-stream or in observability
|
|
1363
|
+
// mode.
|
|
1364
|
+
If(
|
|
1365
|
+
!is_trailers_only &&
|
|
1366
|
+
(!send_to_sidestream || config().observability_mode),
|
|
1367
|
+
[self = WeakRef()]() {
|
|
1368
|
+
// server_initial_metadata_ will be null if payload creation
|
|
1369
|
+
// failed with fail-open enabled, in which case
|
|
1370
|
+
// HandleSideStreamStatus() has already forwarded the metadata.
|
|
1371
|
+
if (self->server_initial_metadata_ != nullptr) {
|
|
1372
|
+
self->handler_.PushServerInitialMetadata(
|
|
1373
|
+
std::move(self->server_initial_metadata_));
|
|
1374
|
+
}
|
|
1375
|
+
return Immediate(StatusFlag(Success{}));
|
|
1376
|
+
},
|
|
1377
|
+
Immediate(StatusFlag(Success{}))),
|
|
1378
|
+
// Send server initial metadata payload to the side-stream.
|
|
1379
|
+
If(
|
|
1380
|
+
send_to_sidestream,
|
|
1381
|
+
[self = WeakRef(), payload = std::move(payload)]() mutable {
|
|
1382
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1383
|
+
<< self->DebugTag()
|
|
1384
|
+
<< "Sending server initial metadata (observability_mode="
|
|
1385
|
+
<< (self->config().observability_mode ? "true" : "false")
|
|
1386
|
+
<< ")";
|
|
1387
|
+
return self->SendMessageToSideStream(std::move(*payload));
|
|
1388
|
+
},
|
|
1389
|
+
[self = WeakRef(), is_trailers_only]() {
|
|
1390
|
+
if (!is_trailers_only) {
|
|
1391
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1392
|
+
<< self->DebugTag()
|
|
1393
|
+
<< "Skipping server initial metadata (processing "
|
|
1394
|
+
"disabled, stream closed, or drain mode)";
|
|
1395
|
+
}
|
|
1396
|
+
return Immediate(StatusFlag(Success{}));
|
|
1397
|
+
})));
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
auto ExtProcFilter::ExtProcCall::HandleTrailingMetadataFromServer(
|
|
1401
|
+
ServerMetadataHandle metadata) {
|
|
1402
|
+
server_trailing_metadata_start_time_ = Timestamp::Now();
|
|
1403
|
+
server_trailing_metadata_ = std::move(metadata);
|
|
1404
|
+
const bool send_metadata =
|
|
1405
|
+
(is_trailers_only_ || IsStatusOk(*server_trailing_metadata_)) &&
|
|
1406
|
+
!side_stream_closed_latch_.is_set() &&
|
|
1407
|
+
(is_trailers_only_ ? processing_mode().send_response_headers
|
|
1408
|
+
: processing_mode().send_response_trailers) &&
|
|
1409
|
+
!drain_requested_;
|
|
1410
|
+
absl::StatusOr<std::string> payload = "";
|
|
1411
|
+
if (send_metadata) {
|
|
1412
|
+
// Include processing mode if this is the first message on
|
|
1413
|
+
// the stream.
|
|
1414
|
+
std::optional<ExtProcProcessingMode> processing_mode;
|
|
1415
|
+
if (IsFirstMessageOnSideStream()) {
|
|
1416
|
+
processing_mode = config().processing_mode;
|
|
1417
|
+
}
|
|
1418
|
+
upb::Arena arena;
|
|
1419
|
+
payload = is_trailers_only_
|
|
1420
|
+
? CreateExtProcServerHeadersRequest(
|
|
1421
|
+
arena.ptr(), server_trailing_metadata_.get(),
|
|
1422
|
+
config().forwarding_allowed_headers,
|
|
1423
|
+
config().forwarding_disallowed_headers,
|
|
1424
|
+
/*attributes=*/nullptr, config().observability_mode,
|
|
1425
|
+
processing_mode, /*end_of_stream=*/true)
|
|
1426
|
+
: CreateExtProcServerTrailersRequest(
|
|
1427
|
+
arena.ptr(), server_trailing_metadata_.get(),
|
|
1428
|
+
config().forwarding_allowed_headers,
|
|
1429
|
+
config().forwarding_disallowed_headers,
|
|
1430
|
+
/*attributes=*/nullptr, config().observability_mode,
|
|
1431
|
+
processing_mode);
|
|
1432
|
+
}
|
|
1433
|
+
const bool call_cancelled =
|
|
1434
|
+
!payload.ok() && !HandleSideStreamStatus(payload.status());
|
|
1435
|
+
const bool send_to_sidestream =
|
|
1436
|
+
send_metadata && payload.ok() && !side_stream_closed_latch_.is_set();
|
|
1437
|
+
return If(
|
|
1438
|
+
call_cancelled, Immediate(StatusFlag(Failure{})),
|
|
1439
|
+
TrySeq(
|
|
1440
|
+
// Wait for side-stream to finish draining if drain mode was
|
|
1441
|
+
// requested.
|
|
1442
|
+
If(
|
|
1443
|
+
drain_requested_ && send_metadata,
|
|
1444
|
+
[self = WeakRef()]() {
|
|
1445
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1446
|
+
<< self->DebugTag()
|
|
1447
|
+
<< "Handling server trailing metadata in drain mode";
|
|
1448
|
+
return TrySeq(self->side_stream_closed_latch_.Wait(),
|
|
1449
|
+
[]() -> StatusFlag { return Success{}; });
|
|
1450
|
+
},
|
|
1451
|
+
Immediate(StatusFlag(Success{}))),
|
|
1452
|
+
// Forward server trailing metadata downstream to client if not
|
|
1453
|
+
// waiting for side-stream or running in observability mode.
|
|
1454
|
+
If(
|
|
1455
|
+
!send_to_sidestream || config().observability_mode,
|
|
1456
|
+
[self = WeakRef()]() {
|
|
1457
|
+
// server_trailing_metadata_ will be null if payload creation
|
|
1458
|
+
// failed with fail-open enabled, in which case
|
|
1459
|
+
// HandleSideStreamStatus() has already forwarded the metadata.
|
|
1460
|
+
if (self->server_trailing_metadata_ != nullptr) {
|
|
1461
|
+
self->handler_.PushServerTrailingMetadata(
|
|
1462
|
+
std::move(self->server_trailing_metadata_));
|
|
1463
|
+
}
|
|
1464
|
+
return Immediate(StatusFlag(Success{}));
|
|
1465
|
+
},
|
|
1466
|
+
Immediate(StatusFlag(Success{}))),
|
|
1467
|
+
// Send server trailing metadata payload to the side-stream.
|
|
1468
|
+
If(
|
|
1469
|
+
send_to_sidestream,
|
|
1470
|
+
[self = WeakRef(), payload = std::move(payload)]() mutable {
|
|
1471
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1472
|
+
<< self->DebugTag()
|
|
1473
|
+
<< "Sending server trailing metadata (observability_mode="
|
|
1474
|
+
<< (self->config().observability_mode ? "true" : "false")
|
|
1475
|
+
<< ")";
|
|
1476
|
+
return self->SendMessageToSideStream(std::move(*payload));
|
|
1477
|
+
},
|
|
1478
|
+
[self = WeakRef(), send_metadata]() {
|
|
1479
|
+
if (!send_metadata || self->drain_requested_) {
|
|
1480
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1481
|
+
<< self->DebugTag()
|
|
1482
|
+
<< "Skipping server trailing metadata (processing "
|
|
1483
|
+
"disabled or stream closed)";
|
|
1484
|
+
}
|
|
1485
|
+
return Immediate(StatusFlag(Success{}));
|
|
1486
|
+
})));
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
//
|
|
1490
|
+
// ExtProcFilter::ExtProcCall Server Message Processing
|
|
1491
|
+
//
|
|
1492
|
+
|
|
1493
|
+
auto ExtProcFilter::ExtProcCall::HandleMessageFromServer(
|
|
1494
|
+
MessageHandle message) {
|
|
1495
|
+
const bool send_body = processing_mode().send_response_body &&
|
|
1496
|
+
!side_stream_closed_latch_.is_set();
|
|
1497
|
+
absl::StatusOr<std::string> payload = "";
|
|
1498
|
+
if (!send_body) {
|
|
1499
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1500
|
+
<< DebugTag() << "Server message non-processing mode";
|
|
1501
|
+
} else if (!drain_requested_) {
|
|
1502
|
+
// Construct message for sidestream.
|
|
1503
|
+
std::string message_bytes;
|
|
1504
|
+
if (message != nullptr) {
|
|
1505
|
+
message_bytes = message->payload()->JoinIntoString();
|
|
1506
|
+
}
|
|
1507
|
+
if (!config().observability_mode) {
|
|
1508
|
+
++outstanding_s2c_messages_;
|
|
1509
|
+
}
|
|
1510
|
+
std::optional<ExtProcProcessingMode> processing_mode;
|
|
1511
|
+
if (IsFirstMessageOnSideStream()) {
|
|
1512
|
+
processing_mode = config().processing_mode;
|
|
1513
|
+
}
|
|
1514
|
+
upb::Arena arena;
|
|
1515
|
+
payload = CreateExtProcServerBodyRequest(
|
|
1516
|
+
arena.ptr(), message_bytes, /*attributes=*/nullptr,
|
|
1517
|
+
config().observability_mode, processing_mode);
|
|
1518
|
+
}
|
|
1519
|
+
const bool call_cancelled =
|
|
1520
|
+
!payload.ok() && !HandleSideStreamStatus(payload.status());
|
|
1521
|
+
const bool send_to_sidestream = send_body && payload.ok() &&
|
|
1522
|
+
!drain_requested_ &&
|
|
1523
|
+
!side_stream_closed_latch_.is_set();
|
|
1524
|
+
return If(
|
|
1525
|
+
call_cancelled, Immediate(StatusFlag(Failure{})),
|
|
1526
|
+
TrySeq(
|
|
1527
|
+
// Wait for side-stream to finish draining if drain mode was
|
|
1528
|
+
// requested.
|
|
1529
|
+
If(
|
|
1530
|
+
drain_requested_ && send_body,
|
|
1531
|
+
[self = WeakRef()]() {
|
|
1532
|
+
return TrySeq(self->side_stream_closed_latch_.Wait(),
|
|
1533
|
+
[]() -> StatusFlag { return Success{}; });
|
|
1534
|
+
},
|
|
1535
|
+
Immediate(StatusFlag(Success{}))),
|
|
1536
|
+
Map(TryJoin<ValueOrFailure>(
|
|
1537
|
+
// Forward server message downstream to client if not waiting
|
|
1538
|
+
// for side-stream or running in observability mode.
|
|
1539
|
+
If(
|
|
1540
|
+
!send_to_sidestream || config().observability_mode,
|
|
1541
|
+
[self = WeakRef(),
|
|
1542
|
+
message = std::move(message)]() mutable {
|
|
1543
|
+
return self->handler_.PushMessage(std::move(message));
|
|
1544
|
+
},
|
|
1545
|
+
Immediate(StatusFlag(Success{}))),
|
|
1546
|
+
// Send server message payload to the side-stream.
|
|
1547
|
+
If(
|
|
1548
|
+
send_to_sidestream,
|
|
1549
|
+
[self = WeakRef(),
|
|
1550
|
+
payload = std::move(payload)]() mutable {
|
|
1551
|
+
self->first_body_message_sent_ = true;
|
|
1552
|
+
if (self->config().observability_mode) {
|
|
1553
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1554
|
+
<< self->DebugTag()
|
|
1555
|
+
<< "Server message observability mode";
|
|
1556
|
+
}
|
|
1557
|
+
return self->SendMessageToSideStream(
|
|
1558
|
+
std::move(*payload));
|
|
1559
|
+
},
|
|
1560
|
+
Immediate(StatusFlag(Success{})))),
|
|
1561
|
+
[](auto x) { return x.status(); })));
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
// Handle the read-from-client loop on handler_.
|
|
1565
|
+
// Called when the ExtProcCall is created.
|
|
1566
|
+
//
|
|
1567
|
+
// Handles client initial metadata, client messages, and half-close.
|
|
1568
|
+
// Sends each event to the ext_proc side-stream and/or to the server,
|
|
1569
|
+
// based on the configuration.
|
|
1570
|
+
auto ExtProcFilter::ExtProcCall::HandleReadFromClientLoop() {
|
|
1571
|
+
return TrySeq(
|
|
1572
|
+
handler_.PullClientInitialMetadata(),
|
|
1573
|
+
[self = WeakRef()](ClientMetadataHandle metadata) {
|
|
1574
|
+
return self->HandleInitialMetadataFromClient(std::move(metadata));
|
|
1575
|
+
},
|
|
1576
|
+
[self = WeakRef()]() {
|
|
1577
|
+
return ForEach(
|
|
1578
|
+
MessagesFrom(self->handler_), [self](MessageHandle message) {
|
|
1579
|
+
return self->HandleMessageFromClient(std::move(message));
|
|
1580
|
+
});
|
|
1581
|
+
},
|
|
1582
|
+
[self = WeakRef()]() { return self->HandleHalfCloseFromClient(); });
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
// Handle the read-from-server loop on handler_.
|
|
1586
|
+
// Called when the ExtProcCall is created.
|
|
1587
|
+
//
|
|
1588
|
+
// Handles server initial metadata, server messages, and server
|
|
1589
|
+
// trailing metadata received from the initiator_ activity.
|
|
1590
|
+
// Sends each event to the ext_proc side-stream and/or to the client,
|
|
1591
|
+
// based on the configuration.
|
|
1592
|
+
auto ExtProcFilter::ExtProcCall::HandleReadFromServerActivityLoop() {
|
|
1593
|
+
return Seq(
|
|
1594
|
+
TrySeq(
|
|
1595
|
+
server_initial_metadata_latch_.Wait(),
|
|
1596
|
+
[self = WeakRef()](std::optional<ServerMetadataHandle> metadata) {
|
|
1597
|
+
const bool has_md = metadata.has_value();
|
|
1598
|
+
return TrySeq(
|
|
1599
|
+
self->HandleInitialMetadataFromServer(std::move(metadata)),
|
|
1600
|
+
If(
|
|
1601
|
+
has_md,
|
|
1602
|
+
[self]() {
|
|
1603
|
+
return ForEach(
|
|
1604
|
+
std::move(self->server_to_client_messages_.receiver),
|
|
1605
|
+
[self](MessageHandle message) {
|
|
1606
|
+
return self->HandleMessageFromServer(
|
|
1607
|
+
std::move(message));
|
|
1608
|
+
});
|
|
1609
|
+
},
|
|
1610
|
+
Immediate(StatusFlag(Success{}))));
|
|
1611
|
+
}),
|
|
1612
|
+
server_trailing_metadata_latch_.Wait(),
|
|
1613
|
+
[self = WeakRef()](ServerMetadataHandle metadata) {
|
|
1614
|
+
return self->HandleTrailingMetadataFromServer(std::move(metadata));
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
// Continuously pulls response messages from the external processor side-stream
|
|
1619
|
+
// and dispatches them until the stream closes or an error occurs.
|
|
1620
|
+
auto ExtProcFilter::ExtProcCall::HandleReadFromSideStreamLoop() {
|
|
1621
|
+
return TrySeq(
|
|
1622
|
+
// Loop reading response messages from the side-stream until
|
|
1623
|
+
// end-of-stream or error.
|
|
1624
|
+
Loop([self = WeakRef()]() {
|
|
1625
|
+
return Seq(
|
|
1626
|
+
// Pull the next response message from the streaming call.
|
|
1627
|
+
If(self->streaming_call_ == nullptr,
|
|
1628
|
+
Immediate(std::optional<std::string>()),
|
|
1629
|
+
[self]() { return self->streaming_call_->PullMessage(); }),
|
|
1630
|
+
// Process the message; stop loop if end-of-stream (nullopt) or
|
|
1631
|
+
// error.
|
|
1632
|
+
[self](std::optional<std::string> msg) {
|
|
1633
|
+
const bool is_end_of_stream = !msg.has_value();
|
|
1634
|
+
return If(
|
|
1635
|
+
is_end_of_stream, Immediate(LoopCtl<StatusFlag>(Success{})),
|
|
1636
|
+
[self, msg = std::move(msg)]() mutable {
|
|
1637
|
+
return Map(self->ProcessSideStreamResponse(std::move(*msg)),
|
|
1638
|
+
[](StatusFlag status) -> LoopCtl<StatusFlag> {
|
|
1639
|
+
if (!status.ok()) return Failure{};
|
|
1640
|
+
return Continue();
|
|
1641
|
+
});
|
|
1642
|
+
});
|
|
1643
|
+
});
|
|
1644
|
+
}),
|
|
1645
|
+
// Once the message loop ends, pull the side-stream's final status and
|
|
1646
|
+
// handle it. A loop failure has already been reported (either to
|
|
1647
|
+
// HandleSideStreamStatus() or straight to CancelCallWithError()), so we
|
|
1648
|
+
// stop here: handling it a second time would re-run the fail-open path
|
|
1649
|
+
// on a call that we have already failed.
|
|
1650
|
+
[self = WeakRef()]() {
|
|
1651
|
+
return Map(
|
|
1652
|
+
// Obtain the side-stream's final status, synthesizing one if
|
|
1653
|
+
// the stream is already gone.
|
|
1654
|
+
If(self->streaming_call_ == nullptr,
|
|
1655
|
+
Immediate(absl::InternalError("Side stream unavailable")),
|
|
1656
|
+
[self]() {
|
|
1657
|
+
return self->streaming_call_->PullServerTrailingMetadata();
|
|
1658
|
+
}),
|
|
1659
|
+
[self](absl::Status status) -> StatusFlag {
|
|
1660
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1661
|
+
<< self->DebugTag()
|
|
1662
|
+
<< "HandleReadFromSideStreamLoop finished with status: "
|
|
1663
|
+
<< status;
|
|
1664
|
+
return StatusFlag(self->HandleSideStreamStatus(status));
|
|
1665
|
+
});
|
|
1666
|
+
});
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
// Runs the client-read, server-read, and side-stream-read loops until all
|
|
1670
|
+
// complete.
|
|
1671
|
+
auto ExtProcFilter::ExtProcCall::Run() {
|
|
1672
|
+
return Map(TryJoin<absl::StatusOr>(HandleReadFromClientLoop(),
|
|
1673
|
+
HandleReadFromServerActivityLoop(),
|
|
1674
|
+
HandleReadFromSideStreamLoop()),
|
|
1675
|
+
[](const auto& res) { return res.status(); });
|
|
1676
|
+
}
|
|
1677
|
+
|
|
156
1678
|
//
|
|
157
1679
|
// ExtProcFilter
|
|
158
1680
|
//
|
|
@@ -164,6 +1686,9 @@ const grpc_channel_filter ExtProcFilter::kFilterVtable = MakePromiseBasedFilter<
|
|
|
164
1686
|
|
|
165
1687
|
absl::StatusOr<RefCountedPtr<ExtProcFilter>> ExtProcFilter::Create(
|
|
166
1688
|
const ChannelArgs& args, ChannelFilter::Args filter_args) {
|
|
1689
|
+
if (filter_args.config() == nullptr) {
|
|
1690
|
+
return absl::InvalidArgumentError("ext_proc filter config is missing");
|
|
1691
|
+
}
|
|
167
1692
|
if (filter_args.config()->type() != Config::Type()) {
|
|
168
1693
|
return absl::InternalError("ext_proc filter config has wrong type");
|
|
169
1694
|
}
|
|
@@ -174,51 +1699,83 @@ absl::StatusOr<RefCountedPtr<ExtProcFilter>> ExtProcFilter::Create(
|
|
|
174
1699
|
ExtProcFilter::ExtProcFilter(const ChannelArgs& args,
|
|
175
1700
|
RefCountedPtr<const Config> config)
|
|
176
1701
|
: V3InterceptorToV2Bridge<ExtProcFilter>(args),
|
|
177
|
-
config_(std::move(config))
|
|
1702
|
+
config_(std::move(config)),
|
|
1703
|
+
event_engine_(
|
|
1704
|
+
args.GetObjectRef<grpc_event_engine::experimental::EventEngine>()),
|
|
1705
|
+
default_authority_(Slice::FromCopiedString(
|
|
1706
|
+
args.GetString(GRPC_ARG_DEFAULT_AUTHORITY)
|
|
1707
|
+
.value_or(
|
|
1708
|
+
CoreConfiguration::Get()
|
|
1709
|
+
.resolver_registry()
|
|
1710
|
+
.GetDefaultAuthority(
|
|
1711
|
+
args.GetString(GRPC_ARG_SERVER_URI).value_or(""))))),
|
|
1712
|
+
telemetry_storage_([&]() -> InstrumentStorageRefPtr<TelemetryDomain> {
|
|
1713
|
+
auto stats_plugin_group =
|
|
1714
|
+
args.GetObjectRef<GlobalStatsPluginRegistry::StatsPluginGroup>();
|
|
1715
|
+
if (stats_plugin_group == nullptr) return nullptr;
|
|
1716
|
+
auto scope = stats_plugin_group->GetCollectionScope();
|
|
1717
|
+
if (scope == nullptr) return nullptr;
|
|
1718
|
+
return TelemetryDomain::GetStorage(
|
|
1719
|
+
std::move(scope), args.GetString(GRPC_ARG_SERVER_URI).value_or(""));
|
|
1720
|
+
}()) {
|
|
1721
|
+
// TODO(rishesh): If the config requests the
|
|
1722
|
+
// connection.sha256_peer_certificate_digest attribute, compute it here (once
|
|
1723
|
+
// per connection) via ComputeSha256PeerCertificateDigest() and pass it to
|
|
1724
|
+
// CreateExtProcAttributesProtoStruct().
|
|
1725
|
+
}
|
|
178
1726
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
"ext_proc_bypass",
|
|
183
|
-
[self = RefAsSubclass<ExtProcFilter>(), handler]() mutable {
|
|
184
|
-
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
185
|
-
<< "ExtProc: Bypassing filter (stub implementation)";
|
|
186
|
-
return TrySeq(handler.PullClientInitialMetadata(),
|
|
187
|
-
[self, handler](ClientMetadataHandle metadata) mutable {
|
|
188
|
-
CallInitiator initiator = self->MakeChildCall(
|
|
189
|
-
std::move(metadata), handler.arena()->Ref());
|
|
190
|
-
handler.AddChildCall(initiator);
|
|
191
|
-
ForwardCall(handler, initiator);
|
|
192
|
-
return absl::OkStatus();
|
|
193
|
-
});
|
|
194
|
-
});
|
|
1727
|
+
ExtProcFilter::~ExtProcFilter() {
|
|
1728
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1729
|
+
<< "ExtProcFilter " << this << " destroyed";
|
|
195
1730
|
}
|
|
196
1731
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
1732
|
+
void ExtProcFilter::RecordClientHeadersDuration(double duration_seconds) const {
|
|
1733
|
+
if (telemetry_storage_ != nullptr) {
|
|
1734
|
+
telemetry_storage_->Increment(TelemetryDomain::kClientHeadersDuration,
|
|
1735
|
+
duration_seconds);
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
200
1738
|
|
|
201
|
-
ExtProcFilter::
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
<< "creating channel " << this << " for server " << server_->server_uri();
|
|
207
|
-
absl::Status status;
|
|
208
|
-
transport_ = transport_factory->GetTransport(*server_, &status);
|
|
209
|
-
GRPC_CHECK(transport_ != nullptr);
|
|
210
|
-
// TODO(rishesh): Return an error if channel construction fails instead of
|
|
211
|
-
// just logging a message.
|
|
212
|
-
if (!status.ok()) {
|
|
213
|
-
LOG(ERROR) << "Error creating ext_proc channel to " << server_->server_uri()
|
|
214
|
-
<< ": " << status;
|
|
1739
|
+
void ExtProcFilter::RecordClientHalfCloseDuration(
|
|
1740
|
+
double duration_seconds) const {
|
|
1741
|
+
if (telemetry_storage_ != nullptr) {
|
|
1742
|
+
telemetry_storage_->Increment(TelemetryDomain::kClientHalfCloseDuration,
|
|
1743
|
+
duration_seconds);
|
|
215
1744
|
}
|
|
216
1745
|
}
|
|
217
1746
|
|
|
218
|
-
ExtProcFilter::
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
1747
|
+
void ExtProcFilter::RecordServerHeadersDuration(double duration_seconds) const {
|
|
1748
|
+
if (telemetry_storage_ != nullptr) {
|
|
1749
|
+
telemetry_storage_->Increment(TelemetryDomain::kServerHeadersDuration,
|
|
1750
|
+
duration_seconds);
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
void ExtProcFilter::RecordServerTrailersDuration(
|
|
1755
|
+
double duration_seconds) const {
|
|
1756
|
+
if (telemetry_storage_ != nullptr) {
|
|
1757
|
+
telemetry_storage_->Increment(TelemetryDomain::kServerTrailersDuration,
|
|
1758
|
+
duration_seconds);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
void ExtProcFilter::InterceptCall(UnstartedCallHandler unstarted_call_handler) {
|
|
1763
|
+
if (!IsProcessingEnabled(config_->processing_mode)) {
|
|
1764
|
+
PassThrough(std::move(unstarted_call_handler));
|
|
1765
|
+
return;
|
|
1766
|
+
}
|
|
1767
|
+
CallHandler handler = Consume(std::move(unstarted_call_handler));
|
|
1768
|
+
handler.SpawnGuarded(
|
|
1769
|
+
"ext_proc_call",
|
|
1770
|
+
[handler, ext_proc_filter = RefAsSubclass<ExtProcFilter>()]() mutable {
|
|
1771
|
+
GRPC_TRACE_LOG(ext_proc_filter, INFO)
|
|
1772
|
+
<< "[" << Activity::current()->DebugTag()
|
|
1773
|
+
<< " ext_proc_filter=" << ext_proc_filter.get()
|
|
1774
|
+
<< "] InterceptCall promise chain start";
|
|
1775
|
+
auto ext_proc_call = MakeRefCounted<ExtProcCall>(
|
|
1776
|
+
ext_proc_filter, ext_proc_filter->channel()->transport(), handler);
|
|
1777
|
+
return ext_proc_call->Run();
|
|
1778
|
+
});
|
|
222
1779
|
}
|
|
223
1780
|
|
|
224
1781
|
} // namespace grpc_core
|