grpc 1.75.0.pre1 → 1.76.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 +18 -5
- data/include/grpc/credentials.h +21 -5
- data/src/core/call/call_filters.cc +4 -4
- data/src/core/call/call_filters.h +36 -36
- data/src/core/call/call_spine.h +27 -27
- data/src/core/call/client_call.cc +6 -5
- data/src/core/call/filter_fusion.h +5 -5
- data/src/core/call/metadata_batch.h +3 -3
- data/src/core/call/security_context.cc +1 -1
- data/src/core/call/server_call.cc +4 -4
- data/src/core/call/server_call.h +1 -1
- data/src/core/channelz/channelz.cc +12 -18
- data/src/core/channelz/channelz.h +32 -16
- data/src/core/channelz/channelz_registry.h +11 -0
- data/src/core/channelz/property_list.cc +18 -0
- data/src/core/channelz/property_list.h +10 -1
- data/src/core/channelz/text_encode.cc +66 -0
- data/src/core/channelz/text_encode.h +29 -0
- data/src/core/channelz/v2tov1/convert.cc +11 -0
- data/src/core/channelz/v2tov1/legacy_api.cc +15 -8
- data/src/core/channelz/ztrace_collector.h +247 -86
- data/src/core/client_channel/backup_poller.cc +5 -6
- data/src/core/client_channel/client_channel.cc +20 -13
- data/src/core/client_channel/client_channel_filter.cc +53 -45
- data/src/core/client_channel/client_channel_filter.h +2 -2
- data/src/core/client_channel/client_channel_internal.h +3 -4
- data/src/core/client_channel/config_selector.h +3 -3
- data/src/core/client_channel/dynamic_filters.cc +3 -3
- data/src/core/client_channel/global_subchannel_pool.cc +0 -37
- data/src/core/client_channel/global_subchannel_pool.h +0 -27
- data/src/core/client_channel/load_balanced_call_destination.cc +7 -7
- data/src/core/client_channel/local_subchannel_pool.cc +4 -4
- data/src/core/client_channel/retry_filter.h +3 -3
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +5 -5
- data/src/core/client_channel/subchannel.cc +8 -8
- data/src/core/client_channel/subchannel_stream_client.cc +4 -4
- data/src/core/config/config_vars.cc +30 -1
- data/src/core/config/config_vars.h +21 -0
- data/src/core/config/core_configuration.cc +5 -5
- data/src/core/config/core_configuration.h +7 -7
- data/src/core/config/load_config.cc +12 -0
- data/src/core/config/load_config.h +2 -0
- data/src/core/credentials/call/call_credentials.h +2 -2
- data/src/core/credentials/call/call_creds_util.cc +4 -3
- data/src/core/credentials/call/composite/composite_call_credentials.cc +4 -4
- data/src/core/credentials/call/external/aws_external_account_credentials.cc +3 -3
- data/src/core/credentials/call/external/external_account_credentials.cc +1 -1
- data/src/core/credentials/call/external/url_external_account_credentials.cc +1 -1
- data/src/core/credentials/call/iam/iam_credentials.cc +4 -4
- data/src/core/credentials/call/jwt/json_token.cc +3 -3
- data/src/core/credentials/call/jwt/jwt_credentials.cc +2 -2
- data/src/core/credentials/call/jwt/jwt_verifier.cc +14 -13
- data/src/core/credentials/call/oauth2/oauth2_credentials.cc +20 -12
- data/src/core/credentials/call/plugin/plugin_credentials.cc +2 -2
- data/src/core/credentials/transport/alts/alts_credentials.cc +4 -4
- data/src/core/credentials/transport/alts/alts_security_connector.cc +14 -12
- data/src/core/credentials/transport/alts/grpc_alts_credentials_client_options.cc +22 -2
- data/src/core/credentials/transport/alts/grpc_alts_credentials_options.cc +10 -1
- data/src/core/credentials/transport/alts/grpc_alts_credentials_options.h +31 -0
- data/src/core/credentials/transport/alts/grpc_alts_credentials_server_options.cc +8 -3
- data/src/core/credentials/transport/composite/composite_channel_credentials.cc +5 -5
- data/src/core/credentials/transport/fake/fake_security_connector.cc +2 -2
- data/src/core/credentials/transport/google_default/google_default_credentials.cc +78 -28
- data/src/core/credentials/transport/insecure/insecure_security_connector.cc +3 -3
- data/src/core/credentials/transport/local/local_security_connector.cc +8 -8
- data/src/core/credentials/transport/security_connector.cc +5 -5
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +12 -12
- data/src/core/credentials/transport/ssl/ssl_credentials.h +2 -2
- data/src/core/credentials/transport/ssl/ssl_security_connector.cc +3 -3
- data/src/core/credentials/transport/tls/certificate_provider_registry.cc +2 -2
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.cc +24 -24
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc +5 -5
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.h +2 -2
- data/src/core/credentials/transport/tls/grpc_tls_certificate_verifier.cc +2 -2
- data/src/core/credentials/transport/tls/grpc_tls_certificate_verifier.h +2 -2
- data/src/core/credentials/transport/tls/grpc_tls_credentials_options.cc +17 -17
- data/src/core/credentials/transport/tls/ssl_utils.cc +14 -9
- data/src/core/credentials/transport/tls/tls_credentials.cc +2 -2
- data/src/core/credentials/transport/tls/tls_security_connector.cc +11 -11
- data/src/core/credentials/transport/transport_credentials.cc +2 -2
- data/src/core/credentials/transport/transport_credentials.h +2 -2
- data/src/core/credentials/transport/xds/xds_credentials.cc +5 -5
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +2 -0
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +1 -1
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +8 -8
- data/src/core/ext/filters/http/message_compress/compression_filter.h +3 -3
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +7 -7
- data/src/core/ext/transport/chttp2/alpn/alpn.cc +2 -2
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +10 -9
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +10 -7
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +5 -5
- data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +6 -6
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +96 -88
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +3 -3
- data/src/core/ext/transport/chttp2/transport/flow_control.h +12 -7
- data/src/core/ext/transport/chttp2/transport/flow_control_manager.h +60 -0
- data/src/core/ext/transport/chttp2/transport/frame.cc +32 -10
- data/src/core/ext/transport/chttp2/transport/frame.h +16 -2
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +4 -4
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +3 -3
- data/src/core/ext/transport/chttp2/transport/header_assembler.h +28 -12
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +4 -2
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +8 -8
- data/src/core/ext/transport/chttp2/transport/hpack_parse_result.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +27 -27
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +2 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +4 -4
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +543 -366
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +198 -277
- data/src/core/ext/transport/chttp2/transport/http2_settings_manager.cc +3 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings_manager.h +11 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +179 -0
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +51 -23
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +13 -6
- data/src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h +115 -71
- data/src/core/ext/transport/chttp2/transport/internal.h +6 -14
- data/src/core/ext/transport/chttp2/transport/message_assembler.h +7 -7
- data/src/core/ext/transport/chttp2/transport/parsing.cc +17 -15
- data/src/core/ext/transport/chttp2/transport/ping_callbacks.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +62 -26
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +58 -22
- data/src/core/ext/transport/chttp2/transport/stream.h +207 -0
- data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +328 -187
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +7 -7
- data/src/core/ext/transport/chttp2/transport/transport_common.cc +17 -1
- data/src/core/ext/transport/chttp2/transport/transport_common.h +52 -0
- data/src/core/ext/transport/chttp2/transport/varint.h +2 -2
- data/src/core/ext/transport/chttp2/transport/writable_streams.h +181 -79
- data/src/core/ext/transport/chttp2/transport/write_size_policy.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/writing.cc +3 -3
- data/src/core/ext/transport/inproc/inproc_transport.cc +1 -1
- data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +3 -3
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb.h +740 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb_minitable.c +218 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb_minitable.h +46 -0
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb.h +87 -55
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.c +23 -21
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/channelz.upbdefs.c +80 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/channelz.upbdefs.h +47 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/service.upbdefs.c +129 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/service.upbdefs.h +72 -0
- data/src/core/filter/auth/server_auth_filter.cc +2 -2
- data/src/core/handshaker/handshaker.cc +3 -3
- data/src/core/handshaker/http_connect/http_proxy_mapper.cc +2 -2
- data/src/core/handshaker/security/legacy_secure_endpoint.cc +2 -2
- data/src/core/handshaker/security/pipelined_secure_endpoint.cc +31 -8
- data/src/core/handshaker/security/secure_endpoint.cc +16 -6
- data/src/core/handshaker/security/security_handshaker.cc +3 -3
- data/src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc +2 -2
- data/src/core/lib/channel/channel_stack.cc +8 -5
- data/src/core/lib/channel/channel_stack.h +3 -0
- data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -0
- data/src/core/lib/channel/connected_channel.cc +2 -2
- data/src/core/lib/channel/promise_based_filter.cc +69 -64
- data/src/core/lib/channel/promise_based_filter.h +16 -15
- data/src/core/lib/compression/compression_internal.cc +2 -2
- data/src/core/lib/compression/message_compress.cc +7 -7
- data/src/core/lib/event_engine/ares_resolver.cc +22 -20
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +2 -2
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +2 -2
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +2 -2
- data/src/core/lib/event_engine/extensions/channelz.h +2 -2
- data/src/core/lib/event_engine/extensions/supports_fd.h +5 -5
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +8 -8
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +10 -10
- data/src/core/lib/event_engine/posix_engine/lockfree_event.cc +2 -2
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +23 -22
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +11 -11
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +168 -170
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +33 -54
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +4 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +5 -5
- data/src/core/lib/event_engine/posix_engine/posix_interface.h +1 -1
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +1 -1
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +3 -3
- data/src/core/lib/event_engine/resolved_address.cc +3 -3
- data/src/core/lib/event_engine/shim.cc +8 -11
- data/src/core/lib/event_engine/shim.h +2 -1
- data/src/core/lib/event_engine/slice.cc +2 -2
- data/src/core/lib/event_engine/tcp_socket_utils.cc +11 -11
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +7 -7
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +31 -31
- data/src/core/lib/event_engine/windows/iocp.cc +10 -10
- data/src/core/lib/event_engine/windows/win_socket.cc +6 -6
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +11 -11
- data/src/core/lib/event_engine/windows/windows_engine.cc +16 -14
- data/src/core/lib/event_engine/windows/windows_listener.cc +7 -7
- data/src/core/lib/experiments/experiments.cc +105 -18
- data/src/core/lib/experiments/experiments.h +43 -11
- data/src/core/lib/iomgr/call_combiner.cc +3 -3
- data/src/core/lib/iomgr/endpoint_cfstream.cc +6 -6
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +5 -5
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +15 -14
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +15 -15
- data/src/core/lib/iomgr/ev_poll_posix.cc +11 -11
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +5 -4
- data/src/core/lib/iomgr/event_engine_shims/endpoint.h +1 -1
- data/src/core/lib/iomgr/iocp_windows.cc +8 -8
- data/src/core/lib/iomgr/iomgr_windows.cc +3 -3
- data/src/core/lib/iomgr/lockfree_event.cc +2 -2
- data/src/core/lib/iomgr/polling_entity.cc +3 -3
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +2 -2
- data/src/core/lib/iomgr/socket_windows.cc +4 -4
- data/src/core/lib/iomgr/tcp_client_posix.cc +4 -4
- data/src/core/lib/iomgr/tcp_client_windows.cc +4 -4
- data/src/core/lib/iomgr/tcp_posix.cc +42 -42
- data/src/core/lib/iomgr/tcp_server.cc +5 -0
- data/src/core/lib/iomgr/tcp_server.h +7 -0
- data/src/core/lib/iomgr/tcp_server_posix.cc +47 -27
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +3 -0
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +5 -5
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +2 -2
- data/src/core/lib/iomgr/tcp_server_windows.cc +68 -29
- data/src/core/lib/iomgr/tcp_windows.cc +7 -7
- data/src/core/lib/iomgr/timer_generic.cc +2 -2
- data/src/core/lib/iomgr/timer_manager.cc +2 -2
- data/src/core/lib/iomgr/unix_sockets_posix.cc +2 -2
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +2 -2
- data/src/core/lib/promise/activity.cc +2 -2
- data/src/core/lib/promise/activity.h +6 -6
- data/src/core/lib/promise/context.h +2 -2
- data/src/core/lib/promise/detail/join_state.h +9 -9
- data/src/core/lib/promise/detail/seq_state.h +13 -13
- data/src/core/lib/promise/detail/status.h +2 -2
- data/src/core/lib/promise/for_each.h +5 -5
- data/src/core/lib/promise/interceptor_list.h +2 -2
- data/src/core/lib/promise/latch.h +7 -7
- data/src/core/lib/promise/mpsc.cc +26 -26
- data/src/core/lib/promise/mpsc.h +2 -2
- data/src/core/lib/promise/observable.h +4 -4
- data/src/core/lib/promise/party.cc +32 -25
- data/src/core/lib/promise/party.h +16 -19
- data/src/core/lib/promise/pipe.h +15 -15
- data/src/core/lib/promise/poll.h +5 -4
- data/src/core/lib/promise/promise.h +0 -2
- data/src/core/lib/promise/sleep.cc +3 -1
- data/src/core/lib/promise/status_flag.h +7 -7
- data/src/core/lib/promise/try_join.h +2 -2
- data/src/core/lib/promise/try_seq.h +2 -2
- data/src/core/lib/resource_quota/arena.h +15 -2
- data/src/core/lib/resource_quota/connection_quota.cc +9 -7
- data/src/core/lib/resource_quota/memory_quota.cc +45 -24
- data/src/core/lib/resource_quota/memory_quota.h +48 -16
- data/src/core/lib/resource_quota/telemetry.h +54 -0
- data/src/core/lib/resource_quota/thread_quota.cc +2 -2
- data/src/core/lib/resource_tracker/resource_tracker.cc +33 -0
- data/src/core/lib/resource_tracker/resource_tracker.h +46 -0
- data/src/core/lib/security/authorization/audit_logging.cc +5 -5
- data/src/core/lib/security/authorization/grpc_authorization_engine.cc +2 -2
- data/src/core/lib/security/authorization/stdout_logger.cc +3 -3
- data/src/core/lib/surface/byte_buffer_reader.cc +2 -2
- data/src/core/lib/surface/call.cc +16 -14
- data/src/core/lib/surface/call.h +1 -1
- data/src/core/lib/surface/call_utils.cc +2 -2
- data/src/core/lib/surface/call_utils.h +2 -2
- data/src/core/lib/surface/channel.cc +4 -4
- data/src/core/lib/surface/channel_create.cc +10 -6
- data/src/core/lib/surface/channel_init.cc +80 -23
- data/src/core/lib/surface/channel_init.h +26 -11
- data/src/core/lib/surface/completion_queue.cc +17 -16
- data/src/core/lib/surface/completion_queue_factory.cc +7 -7
- data/src/core/lib/surface/connection_context.h +45 -2
- data/src/core/lib/surface/filter_stack_call.cc +12 -23
- data/src/core/lib/surface/filter_stack_call.h +3 -4
- data/src/core/lib/surface/legacy_channel.cc +7 -7
- data/src/core/lib/surface/validate_metadata.h +2 -2
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.h +3 -3
- data/src/core/lib/transport/promise_endpoint.cc +3 -3
- data/src/core/lib/transport/promise_endpoint.h +8 -8
- data/src/core/lib/transport/timeout_encoding.cc +4 -4
- data/src/core/load_balancing/child_policy_handler.cc +4 -4
- data/src/core/load_balancing/endpoint_list.cc +2 -2
- data/src/core/load_balancing/grpclb/grpclb.cc +24 -24
- data/src/core/load_balancing/health_check_client.cc +4 -4
- data/src/core/load_balancing/health_check_client_internal.h +2 -2
- data/src/core/load_balancing/lb_policy_registry.cc +2 -2
- data/src/core/load_balancing/oob_backend_metric.cc +4 -4
- data/src/core/load_balancing/oob_backend_metric_internal.h +2 -2
- data/src/core/load_balancing/outlier_detection/outlier_detection.cc +2 -2
- data/src/core/load_balancing/pick_first/pick_first.cc +14 -14
- data/src/core/load_balancing/priority/priority.cc +23 -24
- data/src/core/load_balancing/ring_hash/ring_hash.cc +3 -3
- data/src/core/load_balancing/rls/rls.cc +13 -13
- data/src/core/load_balancing/round_robin/round_robin.cc +9 -9
- data/src/core/load_balancing/weighted_round_robin/static_stride_scheduler.cc +3 -3
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +33 -26
- data/src/core/load_balancing/weighted_target/weighted_target.cc +5 -5
- data/src/core/load_balancing/xds/cds.cc +76 -32
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +3 -3
- data/src/core/load_balancing/xds/xds_override_host.cc +4 -4
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +2 -2
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +33 -33
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc +10 -10
- data/src/core/resolver/dns/dns_resolver_plugin.cc +6 -3
- data/src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +2 -2
- data/src/core/resolver/endpoint_addresses.cc +3 -3
- data/src/core/resolver/endpoint_addresses.h +3 -0
- data/src/core/resolver/fake/fake_resolver.cc +2 -2
- data/src/core/resolver/google_c2p/google_c2p_resolver.cc +41 -54
- data/src/core/resolver/polling_resolver.cc +3 -3
- data/src/core/resolver/resolver_registry.cc +5 -4
- data/src/core/resolver/xds/xds_dependency_manager.cc +5 -5
- data/src/core/resolver/xds/xds_resolver.cc +9 -9
- data/src/core/server/server.cc +38 -38
- data/src/core/server/server_call_tracer_filter.h +4 -4
- data/src/core/server/server_config_selector_filter.cc +2 -2
- data/src/core/server/xds_server_config_fetcher.cc +9 -8
- data/src/core/service_config/service_config_impl.h +2 -2
- data/src/core/telemetry/call_tracer.cc +39 -49
- data/src/core/telemetry/call_tracer.h +199 -22
- data/src/core/telemetry/histogram.h +205 -0
- data/src/core/telemetry/instrument.cc +719 -0
- data/src/core/telemetry/instrument.h +932 -0
- data/src/core/telemetry/metrics.cc +13 -5
- data/src/core/telemetry/metrics.h +3 -1
- data/src/core/telemetry/stats_data.cc +0 -19
- data/src/core/telemetry/stats_data.h +0 -19
- data/src/core/transport/auth_context.cc +2 -2
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +78 -45
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +1 -0
- data/src/core/tsi/alts/handshaker/alts_shared_resource.cc +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +39 -31
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +7 -7
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +3 -3
- data/src/core/tsi/fake_transport_security.cc +4 -4
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +4 -4
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +9 -9
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +3 -3
- data/src/core/tsi/ssl_transport_security.cc +26 -25
- data/src/core/tsi/ssl_transport_security_utils.cc +9 -9
- data/src/core/util/chunked_vector.h +4 -4
- data/src/core/util/event_log.cc +2 -2
- data/src/core/util/gcp_metadata_query.cc +2 -2
- data/src/core/util/grpc_check.cc +22 -0
- data/src/core/util/grpc_check.h +103 -0
- data/src/core/util/http_client/httpcli.cc +3 -3
- data/src/core/util/http_client/parser.cc +4 -4
- data/src/core/util/latent_see.h +7 -4
- data/src/core/util/lru_cache.h +4 -4
- data/src/core/util/memory_usage.h +16 -0
- data/src/core/util/posix/directory_reader.cc +3 -2
- data/src/core/util/posix/sync.cc +24 -24
- data/src/core/util/postmortem_emit.cc +52 -0
- data/src/core/util/postmortem_emit.h +30 -0
- data/src/core/util/ref_counted_ptr.h +5 -0
- data/src/core/util/trie_lookup.h +170 -0
- data/src/core/util/unique_ptr_with_bitset.h +5 -5
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +6 -1
- data/src/core/xds/grpc/xds_certificate_provider.cc +3 -3
- data/src/core/xds/grpc/xds_client_grpc.cc +34 -15
- data/src/core/xds/grpc/xds_client_grpc.h +4 -1
- data/src/core/xds/grpc/xds_cluster_parser.cc +2 -2
- data/src/core/xds/grpc/xds_cluster_specifier_plugin.cc +2 -2
- data/src/core/xds/grpc/xds_endpoint_parser.cc +2 -2
- data/src/core/xds/grpc/xds_http_filter_registry.cc +4 -3
- data/src/core/xds/grpc/xds_listener_parser.cc +3 -3
- data/src/core/xds/grpc/xds_matcher.cc +277 -0
- data/src/core/xds/grpc/xds_matcher.h +432 -0
- data/src/core/xds/grpc/xds_matcher_action.cc +47 -0
- data/src/core/xds/grpc/xds_matcher_action.h +48 -0
- data/src/core/xds/grpc/xds_matcher_context.cc +29 -0
- data/src/core/xds/grpc/xds_matcher_context.h +46 -0
- data/src/core/xds/grpc/xds_matcher_input.cc +79 -0
- data/src/core/xds/grpc/xds_matcher_input.h +105 -0
- data/src/core/xds/grpc/xds_matcher_parse.cc +356 -0
- data/src/core/xds/grpc/xds_matcher_parse.h +39 -0
- data/src/core/xds/grpc/xds_metadata.cc +4 -3
- data/src/core/xds/grpc/xds_route_config_parser.cc +6 -6
- data/src/core/xds/grpc/xds_routing.cc +3 -3
- data/src/core/xds/grpc/xds_transport_grpc.cc +10 -10
- data/src/core/xds/xds_client/lrs_client.cc +6 -6
- data/src/core/xds/xds_client/xds_client.cc +9 -9
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +2 -2
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/abseil-cpp/absl/container/internal/node_slot_policy.h +95 -0
- data/third_party/abseil-cpp/absl/container/node_hash_map.h +687 -0
- metadata +37 -2
@@ -31,8 +31,8 @@
|
|
31
31
|
#include <memory>
|
32
32
|
#include <optional>
|
33
33
|
#include <string>
|
34
|
+
#include <utility>
|
34
35
|
|
35
|
-
#include "absl/log/check.h"
|
36
36
|
#include "absl/log/log.h"
|
37
37
|
#include "absl/status/statusor.h"
|
38
38
|
#include "absl/strings/match.h"
|
@@ -60,6 +60,7 @@
|
|
60
60
|
#include "src/core/load_balancing/grpclb/grpclb.h"
|
61
61
|
#include "src/core/load_balancing/xds/xds_channel_args.h"
|
62
62
|
#include "src/core/util/env.h"
|
63
|
+
#include "src/core/util/grpc_check.h"
|
63
64
|
#include "src/core/util/http_client/httpcli.h"
|
64
65
|
#include "src/core/util/http_client/parser.h"
|
65
66
|
#include "src/core/util/json/json.h"
|
@@ -221,7 +222,7 @@ static int is_metadata_server_reachable() {
|
|
221
222
|
auto uri = grpc_core::URI::Create("http", /*user_info=*/"",
|
222
223
|
GRPC_COMPUTE_ENGINE_DETECTION_HOST, "/",
|
223
224
|
{} /* query params */, "" /* fragment */);
|
224
|
-
|
225
|
+
GRPC_CHECK(uri.ok()); // params are hardcoded
|
225
226
|
auto http_request = grpc_core::HttpRequest::Get(
|
226
227
|
std::move(*uri), nullptr /* channel args */, &detector.pollent, &request,
|
227
228
|
grpc_core::Timestamp::Now() + max_detection_delay,
|
@@ -339,6 +340,8 @@ static bool metadata_server_available() {
|
|
339
340
|
return static_cast<bool>(g_metadata_server_available);
|
340
341
|
}
|
341
342
|
|
343
|
+
namespace {
|
344
|
+
|
342
345
|
// A grpc_call_credentials implementation that uses two
|
343
346
|
// underlying credentials: one for TLS and one for ALTS.
|
344
347
|
// The implementation will pick the right credentials based on the auth
|
@@ -398,24 +401,42 @@ class GoogleDefaultCallCredentialsWrapper : public grpc_call_credentials {
|
|
398
401
|
grpc_core::RefCountedPtr<grpc_call_credentials> alts_credentials_;
|
399
402
|
};
|
400
403
|
|
401
|
-
|
402
|
-
|
404
|
+
enum class DefaultCallCredentialsCreationMethod {
|
405
|
+
kNone,
|
406
|
+
kFromEnviromentPathValue,
|
407
|
+
kFromWellKnownFile,
|
408
|
+
kFromDefaultGCE,
|
409
|
+
};
|
410
|
+
|
411
|
+
absl::StatusOr<std::pair<grpc_core::RefCountedPtr<grpc_call_credentials>,
|
412
|
+
DefaultCallCredentialsCreationMethod>>
|
413
|
+
CreateGoogleDefaultCallCredentials() {
|
414
|
+
DefaultCallCredentialsCreationMethod default_credentials_type;
|
403
415
|
grpc_core::RefCountedPtr<grpc_call_credentials> call_creds;
|
404
|
-
grpc_error_handle
|
416
|
+
grpc_error_handle return_status;
|
417
|
+
grpc_error_handle child_error;
|
405
418
|
|
406
419
|
// First, try the environment variable.
|
407
420
|
auto path_from_env = grpc_core::GetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR);
|
408
421
|
if (path_from_env.has_value()) {
|
409
|
-
|
410
|
-
if (
|
411
|
-
|
422
|
+
child_error = create_default_creds_from_path(*path_from_env, &call_creds);
|
423
|
+
if (child_error.ok()) {
|
424
|
+
default_credentials_type =
|
425
|
+
DefaultCallCredentialsCreationMethod::kFromEnviromentPathValue;
|
426
|
+
return std::pair(call_creds, default_credentials_type);
|
427
|
+
}
|
428
|
+
return_status = grpc_error_add_child(return_status, child_error);
|
412
429
|
}
|
413
430
|
|
414
431
|
// Then the well-known file.
|
415
|
-
|
432
|
+
child_error = create_default_creds_from_path(
|
416
433
|
grpc_get_well_known_google_credentials_file_path(), &call_creds);
|
417
|
-
if (
|
418
|
-
|
434
|
+
if (child_error.ok()) {
|
435
|
+
default_credentials_type =
|
436
|
+
DefaultCallCredentialsCreationMethod::kFromWellKnownFile;
|
437
|
+
return std::pair(call_creds, default_credentials_type);
|
438
|
+
}
|
439
|
+
return_status = grpc_error_add_child(return_status, child_error);
|
419
440
|
|
420
441
|
update_tenancy();
|
421
442
|
|
@@ -423,18 +444,26 @@ static grpc_core::RefCountedPtr<grpc_call_credentials> make_default_call_creds(
|
|
423
444
|
call_creds = grpc_core::RefCountedPtr<grpc_call_credentials>(
|
424
445
|
grpc_google_compute_engine_credentials_create(nullptr));
|
425
446
|
if (call_creds == nullptr) {
|
426
|
-
|
427
|
-
|
428
|
-
|
447
|
+
return_status = GRPC_ERROR_CREATE(GRPC_GOOGLE_CREDENTIAL_CREATION_ERROR);
|
448
|
+
return_status = grpc_error_add_child(
|
449
|
+
return_status,
|
450
|
+
GRPC_ERROR_CREATE("Failed to get credentials from network"));
|
451
|
+
return return_status;
|
429
452
|
}
|
453
|
+
default_credentials_type =
|
454
|
+
DefaultCallCredentialsCreationMethod::kFromDefaultGCE;
|
430
455
|
}
|
431
456
|
|
432
|
-
return call_creds;
|
457
|
+
return std::pair(call_creds, default_credentials_type);
|
433
458
|
}
|
434
459
|
|
460
|
+
} // namespace
|
461
|
+
|
435
462
|
grpc_channel_credentials* grpc_google_default_credentials_create(
|
436
463
|
grpc_call_credentials* call_creds_for_tls,
|
437
|
-
|
464
|
+
grpc_google_default_credentials_options* options) {
|
465
|
+
DefaultCallCredentialsCreationMethod default_credentials_type =
|
466
|
+
DefaultCallCredentialsCreationMethod::kNone;
|
438
467
|
grpc_channel_credentials* result = nullptr;
|
439
468
|
grpc_core::RefCountedPtr<grpc_call_credentials> call_creds(
|
440
469
|
call_creds_for_tls);
|
@@ -445,33 +474,54 @@ grpc_channel_credentials* grpc_google_default_credentials_create(
|
|
445
474
|
<< "grpc_google_default_credentials_create(" << call_creds_for_tls << ")";
|
446
475
|
|
447
476
|
if (call_creds == nullptr) {
|
448
|
-
|
477
|
+
auto create_default_creds_status = CreateGoogleDefaultCallCredentials();
|
478
|
+
|
479
|
+
if (!create_default_creds_status.ok()) {
|
480
|
+
LOG(ERROR) << "Could not create google default credentials: "
|
481
|
+
<< grpc_core::StatusToString(
|
482
|
+
create_default_creds_status.status());
|
483
|
+
} else {
|
484
|
+
call_creds = create_default_creds_status->first;
|
485
|
+
default_credentials_type = create_default_creds_status->second;
|
486
|
+
}
|
449
487
|
}
|
450
488
|
|
451
489
|
if (call_creds != nullptr) {
|
452
490
|
// Create google default credentials.
|
453
491
|
grpc_channel_credentials* ssl_creds =
|
454
492
|
grpc_ssl_credentials_create(nullptr, nullptr, nullptr, nullptr);
|
455
|
-
|
456
|
-
grpc_alts_credentials_options*
|
493
|
+
GRPC_CHECK_NE(ssl_creds, nullptr);
|
494
|
+
grpc_alts_credentials_options* credentials_options =
|
457
495
|
grpc_alts_credentials_client_options_create();
|
458
496
|
grpc_channel_credentials* alts_creds =
|
459
|
-
grpc_alts_credentials_create(
|
460
|
-
grpc_alts_credentials_options_destroy(
|
497
|
+
grpc_alts_credentials_create(credentials_options);
|
498
|
+
grpc_alts_credentials_options_destroy(credentials_options);
|
461
499
|
auto creds =
|
462
500
|
grpc_core::MakeRefCounted<grpc_google_default_channel_credentials>(
|
463
501
|
grpc_core::RefCountedPtr<grpc_channel_credentials>(alts_creds),
|
464
502
|
grpc_core::RefCountedPtr<grpc_channel_credentials>(ssl_creds));
|
465
|
-
if (
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
503
|
+
if (options != nullptr) {
|
504
|
+
if (options->create_hard_bound_credentials &&
|
505
|
+
default_credentials_type ==
|
506
|
+
DefaultCallCredentialsCreationMethod::kFromDefaultGCE) {
|
507
|
+
grpc_google_compute_engine_credentials_options alts_options = {};
|
508
|
+
alts_options.alts_hard_bound = true;
|
509
|
+
grpc_core::RefCountedPtr<grpc_call_credentials> alts_call_creds(
|
510
|
+
grpc_google_compute_engine_credentials_create(&alts_options));
|
511
|
+
call_creds =
|
512
|
+
grpc_core::MakeRefCounted<GoogleDefaultCallCredentialsWrapper>(
|
513
|
+
std::move(call_creds), std::move(alts_call_creds));
|
514
|
+
} else if (options->call_creds_for_alts != nullptr) {
|
515
|
+
grpc_core::RefCountedPtr<grpc_call_credentials> alts_call_creds(
|
516
|
+
options->call_creds_for_alts);
|
517
|
+
call_creds =
|
518
|
+
grpc_core::MakeRefCounted<GoogleDefaultCallCredentialsWrapper>(
|
519
|
+
std::move(call_creds), std::move(alts_call_creds));
|
520
|
+
}
|
471
521
|
}
|
472
522
|
result = grpc_composite_channel_credentials_create(
|
473
523
|
creds.get(), call_creds.get(), nullptr);
|
474
|
-
|
524
|
+
GRPC_CHECK_NE(result, nullptr);
|
475
525
|
} else {
|
476
526
|
LOG(ERROR) << "Could not create google default credentials: "
|
477
527
|
<< grpc_core::StatusToString(error);
|
@@ -22,7 +22,6 @@
|
|
22
22
|
#include <grpc/support/port_platform.h>
|
23
23
|
#include <string.h>
|
24
24
|
|
25
|
-
#include "absl/log/check.h"
|
26
25
|
#include "src/core/handshaker/security/security_handshaker.h"
|
27
26
|
#include "src/core/lib/channel/channel_args.h"
|
28
27
|
#include "src/core/lib/iomgr/exec_ctx.h"
|
@@ -30,6 +29,7 @@
|
|
30
29
|
#include "src/core/transport/auth_context.h"
|
31
30
|
#include "src/core/tsi/local_transport_security.h"
|
32
31
|
#include "src/core/util/debug_location.h"
|
32
|
+
#include "src/core/util/grpc_check.h"
|
33
33
|
#include "src/core/util/ref_counted_ptr.h"
|
34
34
|
|
35
35
|
namespace grpc_core {
|
@@ -69,7 +69,7 @@ void InsecureChannelSecurityConnector::add_handshakers(
|
|
69
69
|
HandshakeManager* handshake_manager) {
|
70
70
|
tsi_handshaker* handshaker = nullptr;
|
71
71
|
// Re-use local_tsi_handshaker_create as a minimalist handshaker.
|
72
|
-
|
72
|
+
GRPC_CHECK(tsi_local_handshaker_create(&handshaker) == TSI_OK);
|
73
73
|
handshake_manager->Add(SecurityHandshakerCreate(handshaker, this, args));
|
74
74
|
}
|
75
75
|
|
@@ -96,7 +96,7 @@ void InsecureServerSecurityConnector::add_handshakers(
|
|
96
96
|
HandshakeManager* handshake_manager) {
|
97
97
|
tsi_handshaker* handshaker = nullptr;
|
98
98
|
// Re-use local_tsi_handshaker_create as a minimalist handshaker.
|
99
|
-
|
99
|
+
GRPC_CHECK(tsi_local_handshaker_create(&handshaker) == TSI_OK);
|
100
100
|
handshake_manager->Add(SecurityHandshakerCreate(handshaker, this, args));
|
101
101
|
}
|
102
102
|
|
@@ -29,7 +29,6 @@
|
|
29
29
|
#include <string>
|
30
30
|
#include <utility>
|
31
31
|
|
32
|
-
#include "absl/log/check.h"
|
33
32
|
#include "absl/log/log.h"
|
34
33
|
#include "absl/status/status.h"
|
35
34
|
#include "absl/status/statusor.h"
|
@@ -60,6 +59,7 @@
|
|
60
59
|
#include "src/core/tsi/transport_security.h"
|
61
60
|
#include "src/core/tsi/transport_security_interface.h"
|
62
61
|
#include "src/core/util/debug_location.h"
|
62
|
+
#include "src/core/util/grpc_check.h"
|
63
63
|
#include "src/core/util/ref_counted_ptr.h"
|
64
64
|
#include "src/core/util/uri.h"
|
65
65
|
|
@@ -77,12 +77,12 @@ grpc_core::RefCountedPtr<grpc_auth_context> local_auth_context_create(
|
|
77
77
|
grpc_auth_context_add_cstring_property(
|
78
78
|
ctx.get(), GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
|
79
79
|
GRPC_LOCAL_TRANSPORT_SECURITY_TYPE);
|
80
|
-
|
81
|
-
|
82
|
-
|
80
|
+
GRPC_CHECK(grpc_auth_context_set_peer_identity_property_name(
|
81
|
+
ctx.get(), GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME) == 1);
|
82
|
+
GRPC_CHECK_EQ(peer->property_count, 1u);
|
83
83
|
const tsi_peer_property* prop = &peer->properties[0];
|
84
|
-
|
85
|
-
|
84
|
+
GRPC_CHECK_NE(prop, nullptr);
|
85
|
+
GRPC_CHECK_EQ(strcmp(prop->name, TSI_SECURITY_LEVEL_PEER_PROPERTY), 0);
|
86
86
|
grpc_auth_context_add_property(ctx.get(),
|
87
87
|
GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME,
|
88
88
|
prop->value.data, prop->value.length);
|
@@ -186,7 +186,7 @@ class grpc_local_channel_security_connector final
|
|
186
186
|
grpc_pollset_set* /*interested_parties*/,
|
187
187
|
grpc_core::HandshakeManager* handshake_manager) override {
|
188
188
|
tsi_handshaker* handshaker = nullptr;
|
189
|
-
|
189
|
+
GRPC_CHECK(tsi_local_handshaker_create(&handshaker) == TSI_OK);
|
190
190
|
handshake_manager->Add(
|
191
191
|
grpc_core::SecurityHandshakerCreate(handshaker, this, args));
|
192
192
|
}
|
@@ -241,7 +241,7 @@ class grpc_local_server_security_connector final
|
|
241
241
|
grpc_pollset_set* /*interested_parties*/,
|
242
242
|
grpc_core::HandshakeManager* handshake_manager) override {
|
243
243
|
tsi_handshaker* handshaker = nullptr;
|
244
|
-
|
244
|
+
GRPC_CHECK(tsi_local_handshaker_create(&handshaker) == TSI_OK);
|
245
245
|
handshake_manager->Add(
|
246
246
|
grpc_core::SecurityHandshakerCreate(handshaker, this, args));
|
247
247
|
}
|
@@ -23,11 +23,11 @@
|
|
23
23
|
|
24
24
|
#include <utility>
|
25
25
|
|
26
|
-
#include "absl/log/check.h"
|
27
26
|
#include "absl/log/log.h"
|
28
27
|
#include "src/core/credentials/transport/transport_credentials.h"
|
29
28
|
#include "src/core/lib/channel/channel_args.h"
|
30
29
|
#include "src/core/util/debug_location.h"
|
30
|
+
#include "src/core/util/grpc_check.h"
|
31
31
|
#include "src/core/util/useful.h"
|
32
32
|
|
33
33
|
grpc_channel_security_connector::grpc_channel_security_connector(
|
@@ -42,8 +42,8 @@ int grpc_channel_security_connector::channel_security_connector_cmp(
|
|
42
42
|
const grpc_channel_security_connector* other) const {
|
43
43
|
const grpc_channel_security_connector* other_sc =
|
44
44
|
static_cast<const grpc_channel_security_connector*>(other);
|
45
|
-
|
46
|
-
|
45
|
+
GRPC_CHECK_NE(channel_creds(), nullptr);
|
46
|
+
GRPC_CHECK_NE(other_sc->channel_creds(), nullptr);
|
47
47
|
int c = channel_creds()->cmp(other_sc->channel_creds());
|
48
48
|
if (c != 0) return c;
|
49
49
|
return grpc_core::QsortCompare(request_metadata_creds(),
|
@@ -64,8 +64,8 @@ int grpc_server_security_connector::server_security_connector_cmp(
|
|
64
64
|
const grpc_server_security_connector* other) const {
|
65
65
|
const grpc_server_security_connector* other_sc =
|
66
66
|
static_cast<const grpc_server_security_connector*>(other);
|
67
|
-
|
68
|
-
|
67
|
+
GRPC_CHECK_NE(server_creds(), nullptr);
|
68
|
+
GRPC_CHECK_NE(other_sc->server_creds(), nullptr);
|
69
69
|
return grpc_core::QsortCompare(server_creds(), other_sc->server_creds());
|
70
70
|
}
|
71
71
|
|
@@ -28,7 +28,6 @@
|
|
28
28
|
#include <string>
|
29
29
|
#include <utility>
|
30
30
|
|
31
|
-
#include "absl/log/check.h"
|
32
31
|
#include "absl/log/log.h"
|
33
32
|
#include "src/core/credentials/transport/tls/ssl_utils.h"
|
34
33
|
#include "src/core/lib/channel/channel_args.h"
|
@@ -36,6 +35,7 @@
|
|
36
35
|
#include "src/core/tsi/ssl/session_cache/ssl_session_cache.h"
|
37
36
|
#include "src/core/tsi/ssl_transport_security.h"
|
38
37
|
#include "src/core/tsi/transport_security_interface.h"
|
38
|
+
#include "src/core/util/grpc_check.h"
|
39
39
|
|
40
40
|
//
|
41
41
|
// SSL Channel Credentials.
|
@@ -143,8 +143,8 @@ void grpc_ssl_credentials::build_config(
|
|
143
143
|
const grpc_ssl_verify_peer_options* verify_options) {
|
144
144
|
config_.pem_root_certs = gpr_strdup(pem_root_certs);
|
145
145
|
if (pem_key_cert_pair != nullptr) {
|
146
|
-
|
147
|
-
|
146
|
+
GRPC_CHECK_NE(pem_key_cert_pair->private_key, nullptr);
|
147
|
+
GRPC_CHECK_NE(pem_key_cert_pair->cert_chain, nullptr);
|
148
148
|
config_.pem_key_cert_pair = static_cast<tsi_ssl_pem_key_cert_pair*>(
|
149
149
|
gpr_zalloc(sizeof(tsi_ssl_pem_key_cert_pair)));
|
150
150
|
config_.pem_key_cert_pair->cert_chain =
|
@@ -226,7 +226,7 @@ grpc_channel_credentials* grpc_ssl_credentials_create(
|
|
226
226
|
<< ", pem_key_cert_pair=" << pem_key_cert_pair
|
227
227
|
<< ", verify_options=" << verify_options << ", reserved=" << reserved
|
228
228
|
<< ")";
|
229
|
-
|
229
|
+
GRPC_CHECK_EQ(reserved, nullptr);
|
230
230
|
|
231
231
|
return new grpc_ssl_credentials(
|
232
232
|
pem_root_certs, pem_key_cert_pair,
|
@@ -241,7 +241,7 @@ grpc_channel_credentials* grpc_ssl_credentials_create_ex(
|
|
241
241
|
<< ", pem_key_cert_pair=" << pem_key_cert_pair
|
242
242
|
<< ", verify_options=" << verify_options << ", reserved=" << reserved
|
243
243
|
<< ")";
|
244
|
-
|
244
|
+
GRPC_CHECK_EQ(reserved, nullptr);
|
245
245
|
|
246
246
|
return new grpc_ssl_credentials(pem_root_certs, pem_key_cert_pair,
|
247
247
|
verify_options);
|
@@ -291,13 +291,13 @@ tsi_ssl_pem_key_cert_pair* grpc_convert_grpc_to_tsi_cert_pairs(
|
|
291
291
|
size_t num_key_cert_pairs) {
|
292
292
|
tsi_ssl_pem_key_cert_pair* tsi_pairs = nullptr;
|
293
293
|
if (num_key_cert_pairs > 0) {
|
294
|
-
|
294
|
+
GRPC_CHECK_NE(pem_key_cert_pairs, nullptr);
|
295
295
|
tsi_pairs = static_cast<tsi_ssl_pem_key_cert_pair*>(
|
296
296
|
gpr_zalloc(num_key_cert_pairs * sizeof(tsi_ssl_pem_key_cert_pair)));
|
297
297
|
}
|
298
298
|
for (size_t i = 0; i < num_key_cert_pairs; i++) {
|
299
|
-
|
300
|
-
|
299
|
+
GRPC_CHECK_NE(pem_key_cert_pairs[i].private_key, nullptr);
|
300
|
+
GRPC_CHECK_NE(pem_key_cert_pairs[i].cert_chain, nullptr);
|
301
301
|
tsi_pairs[i].cert_chain = gpr_strdup(pem_key_cert_pairs[i].cert_chain);
|
302
302
|
tsi_pairs[i].private_key = gpr_strdup(pem_key_cert_pairs[i].private_key);
|
303
303
|
}
|
@@ -334,14 +334,14 @@ grpc_ssl_server_certificate_config* grpc_ssl_server_certificate_config_create(
|
|
334
334
|
gpr_zalloc(sizeof(grpc_ssl_server_certificate_config)));
|
335
335
|
config->pem_root_certs = gpr_strdup(pem_root_certs);
|
336
336
|
if (num_key_cert_pairs > 0) {
|
337
|
-
|
337
|
+
GRPC_CHECK_NE(pem_key_cert_pairs, nullptr);
|
338
338
|
config->pem_key_cert_pairs = static_cast<grpc_ssl_pem_key_cert_pair*>(
|
339
339
|
gpr_zalloc(num_key_cert_pairs * sizeof(grpc_ssl_pem_key_cert_pair)));
|
340
340
|
}
|
341
341
|
config->num_key_cert_pairs = num_key_cert_pairs;
|
342
342
|
for (size_t i = 0; i < num_key_cert_pairs; i++) {
|
343
|
-
|
344
|
-
|
343
|
+
GRPC_CHECK_NE(pem_key_cert_pairs[i].private_key, nullptr);
|
344
|
+
GRPC_CHECK_NE(pem_key_cert_pairs[i].cert_chain, nullptr);
|
345
345
|
config->pem_key_cert_pairs[i].cert_chain =
|
346
346
|
gpr_strdup(pem_key_cert_pairs[i].cert_chain);
|
347
347
|
config->pem_key_cert_pairs[i].private_key =
|
@@ -425,7 +425,7 @@ grpc_server_credentials* grpc_ssl_server_credentials_create_ex(
|
|
425
425
|
<< ", num_key_cert_pairs=" << (unsigned long)num_key_cert_pairs
|
426
426
|
<< ", client_certificate_request=" << client_certificate_request
|
427
427
|
<< ", reserved=" << reserved << ")";
|
428
|
-
|
428
|
+
GRPC_CHECK_EQ(reserved, nullptr);
|
429
429
|
|
430
430
|
grpc_ssl_server_certificate_config* cert_config =
|
431
431
|
grpc_ssl_server_certificate_config_create(
|
@@ -25,12 +25,12 @@
|
|
25
25
|
#include <grpc/support/port_platform.h>
|
26
26
|
#include <stddef.h>
|
27
27
|
|
28
|
-
#include "absl/log/check.h"
|
29
28
|
#include "src/core/credentials/transport/security_connector.h"
|
30
29
|
#include "src/core/credentials/transport/ssl/ssl_security_connector.h"
|
31
30
|
#include "src/core/credentials/transport/transport_credentials.h"
|
32
31
|
#include "src/core/lib/channel/channel_args.h"
|
33
32
|
#include "src/core/tsi/ssl_transport_security.h"
|
33
|
+
#include "src/core/util/grpc_check.h"
|
34
34
|
#include "src/core/util/ref_counted_ptr.h"
|
35
35
|
#include "src/core/util/unique_type_name.h"
|
36
36
|
#include "src/core/util/useful.h"
|
@@ -115,7 +115,7 @@ class grpc_ssl_server_credentials final : public grpc_server_credentials {
|
|
115
115
|
|
116
116
|
grpc_ssl_certificate_config_reload_status FetchCertConfig(
|
117
117
|
grpc_ssl_server_certificate_config** config) {
|
118
|
-
|
118
|
+
GRPC_DCHECK(has_cert_config_fetcher());
|
119
119
|
return certificate_config_fetcher_.cb(certificate_config_fetcher_.user_data,
|
120
120
|
config);
|
121
121
|
}
|
@@ -26,7 +26,6 @@
|
|
26
26
|
#include <string>
|
27
27
|
#include <utility>
|
28
28
|
|
29
|
-
#include "absl/log/check.h"
|
30
29
|
#include "absl/log/log.h"
|
31
30
|
#include "absl/status/status.h"
|
32
31
|
#include "absl/strings/str_cat.h"
|
@@ -50,6 +49,7 @@
|
|
50
49
|
#include "src/core/tsi/transport_security.h"
|
51
50
|
#include "src/core/tsi/transport_security_interface.h"
|
52
51
|
#include "src/core/util/debug_location.h"
|
52
|
+
#include "src/core/util/grpc_check.h"
|
53
53
|
#include "src/core/util/host_port.h"
|
54
54
|
#include "src/core/util/ref_counted_ptr.h"
|
55
55
|
#include "src/core/util/sync.h"
|
@@ -357,7 +357,7 @@ class grpc_ssl_server_security_connector
|
|
357
357
|
tsi_ssl_server_handshaker_factory* new_handshaker_factory = nullptr;
|
358
358
|
const grpc_ssl_server_credentials* server_creds =
|
359
359
|
static_cast<const grpc_ssl_server_credentials*>(this->server_creds());
|
360
|
-
|
360
|
+
GRPC_DCHECK_NE(config->pem_root_certs, nullptr);
|
361
361
|
tsi_ssl_server_handshaker_options options;
|
362
362
|
options.pem_key_cert_pairs = grpc_convert_grpc_to_tsi_cert_pairs(
|
363
363
|
config->pem_key_cert_pairs, config->num_key_cert_pairs);
|
@@ -425,7 +425,7 @@ grpc_core::RefCountedPtr<grpc_server_security_connector>
|
|
425
425
|
grpc_ssl_server_security_connector_create(
|
426
426
|
grpc_core::RefCountedPtr<grpc_server_credentials> server_credentials,
|
427
427
|
const grpc_core::ChannelArgs& args) {
|
428
|
-
|
428
|
+
GRPC_CHECK(server_credentials != nullptr);
|
429
429
|
grpc_core::RefCountedPtr<grpc_ssl_server_security_connector> c =
|
430
430
|
grpc_core::MakeRefCounted<grpc_ssl_server_security_connector>(
|
431
431
|
std::move(server_credentials));
|
@@ -23,8 +23,8 @@
|
|
23
23
|
#include <string>
|
24
24
|
#include <utility>
|
25
25
|
|
26
|
-
#include "absl/log/check.h"
|
27
26
|
#include "absl/log/log.h"
|
27
|
+
#include "src/core/util/grpc_check.h"
|
28
28
|
|
29
29
|
namespace grpc_core {
|
30
30
|
|
@@ -32,7 +32,7 @@ void CertificateProviderRegistry::Builder::RegisterCertificateProviderFactory(
|
|
32
32
|
std::unique_ptr<CertificateProviderFactory> factory) {
|
33
33
|
absl::string_view name = factory->name();
|
34
34
|
VLOG(2) << "registering certificate provider factory for \"" << name << "\"";
|
35
|
-
|
35
|
+
GRPC_CHECK(factories_.emplace(name, std::move(factory)).second);
|
36
36
|
}
|
37
37
|
|
38
38
|
CertificateProviderRegistry CertificateProviderRegistry::Builder::Build() {
|
@@ -20,10 +20,10 @@
|
|
20
20
|
#include <grpc/grpc_security.h>
|
21
21
|
#include <grpc/support/port_platform.h>
|
22
22
|
|
23
|
-
#include "absl/log/check.h"
|
24
23
|
#include "absl/status/status.h"
|
25
24
|
#include "src/core/credentials/transport/tls/spiffe_utils.h"
|
26
25
|
#include "src/core/tsi/ssl_transport_security.h"
|
26
|
+
#include "src/core/util/grpc_check.h"
|
27
27
|
|
28
28
|
bool grpc_tls_certificate_distributor::CertificateInfo::AreRootsEmpty() {
|
29
29
|
return IsRootCertInfoEmpty(roots.get());
|
@@ -32,17 +32,17 @@ bool grpc_tls_certificate_distributor::CertificateInfo::AreRootsEmpty() {
|
|
32
32
|
void grpc_tls_certificate_distributor::SetKeyMaterials(
|
33
33
|
const std::string& cert_name, std::shared_ptr<RootCertInfo> roots,
|
34
34
|
std::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pairs) {
|
35
|
-
|
35
|
+
GRPC_CHECK(roots != nullptr || pem_key_cert_pairs.has_value());
|
36
36
|
grpc_core::MutexLock lock(&mu_);
|
37
37
|
auto& cert_info = certificate_info_map_[cert_name];
|
38
38
|
if (roots != nullptr) {
|
39
39
|
// Successful credential updates will clear any pre-existing error.
|
40
40
|
cert_info.SetRootError(absl::OkStatus());
|
41
41
|
for (auto* watcher_ptr : cert_info.root_cert_watchers) {
|
42
|
-
|
42
|
+
GRPC_CHECK_NE(watcher_ptr, nullptr);
|
43
43
|
const auto watcher_it = watchers_.find(watcher_ptr);
|
44
|
-
|
45
|
-
|
44
|
+
GRPC_CHECK(watcher_it != watchers_.end());
|
45
|
+
GRPC_CHECK(watcher_it->second.root_cert_name.has_value());
|
46
46
|
std::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pairs_to_report;
|
47
47
|
if (pem_key_cert_pairs.has_value() &&
|
48
48
|
watcher_it->second.identity_cert_name == cert_name) {
|
@@ -63,10 +63,10 @@ void grpc_tls_certificate_distributor::SetKeyMaterials(
|
|
63
63
|
// Successful credential updates will clear any pre-existing error.
|
64
64
|
cert_info.SetIdentityError(absl::OkStatus());
|
65
65
|
for (const auto watcher_ptr : cert_info.identity_cert_watchers) {
|
66
|
-
|
66
|
+
GRPC_CHECK_NE(watcher_ptr, nullptr);
|
67
67
|
const auto watcher_it = watchers_.find(watcher_ptr);
|
68
|
-
|
69
|
-
|
68
|
+
GRPC_CHECK(watcher_it != watchers_.end());
|
69
|
+
GRPC_CHECK(watcher_it->second.identity_cert_name.has_value());
|
70
70
|
std::shared_ptr<RootCertInfo> roots_to_report;
|
71
71
|
if (roots != nullptr && watcher_it->second.root_cert_name == cert_name) {
|
72
72
|
// In this case, We've already sent the credential updates at the time
|
@@ -105,14 +105,14 @@ void grpc_tls_certificate_distributor::SetErrorForCert(
|
|
105
105
|
const std::string& cert_name,
|
106
106
|
std::optional<grpc_error_handle> root_cert_error,
|
107
107
|
std::optional<grpc_error_handle> identity_cert_error) {
|
108
|
-
|
108
|
+
GRPC_CHECK(root_cert_error.has_value() || identity_cert_error.has_value());
|
109
109
|
grpc_core::MutexLock lock(&mu_);
|
110
110
|
CertificateInfo& cert_info = certificate_info_map_[cert_name];
|
111
111
|
if (root_cert_error.has_value()) {
|
112
112
|
for (auto* watcher_ptr : cert_info.root_cert_watchers) {
|
113
|
-
|
113
|
+
GRPC_CHECK_NE(watcher_ptr, nullptr);
|
114
114
|
const auto watcher_it = watchers_.find(watcher_ptr);
|
115
|
-
|
115
|
+
GRPC_CHECK(watcher_it != watchers_.end());
|
116
116
|
// identity_cert_error_to_report is the error of the identity cert this
|
117
117
|
// watcher is watching, if there is any.
|
118
118
|
grpc_error_handle identity_cert_error_to_report;
|
@@ -130,9 +130,9 @@ void grpc_tls_certificate_distributor::SetErrorForCert(
|
|
130
130
|
}
|
131
131
|
if (identity_cert_error.has_value()) {
|
132
132
|
for (auto* watcher_ptr : cert_info.identity_cert_watchers) {
|
133
|
-
|
133
|
+
GRPC_CHECK_NE(watcher_ptr, nullptr);
|
134
134
|
const auto watcher_it = watchers_.find(watcher_ptr);
|
135
|
-
|
135
|
+
GRPC_CHECK(watcher_it != watchers_.end());
|
136
136
|
// root_error_to_report is the error of the roots this watcher
|
137
137
|
// is watching, if there is any.
|
138
138
|
grpc_error_handle root_error_to_report;
|
@@ -153,11 +153,11 @@ void grpc_tls_certificate_distributor::SetErrorForCert(
|
|
153
153
|
};
|
154
154
|
|
155
155
|
void grpc_tls_certificate_distributor::SetError(grpc_error_handle error) {
|
156
|
-
|
156
|
+
GRPC_CHECK(!error.ok());
|
157
157
|
grpc_core::MutexLock lock(&mu_);
|
158
158
|
for (const auto& watcher : watchers_) {
|
159
159
|
const auto watcher_ptr = watcher.first;
|
160
|
-
|
160
|
+
GRPC_CHECK_NE(watcher_ptr, nullptr);
|
161
161
|
const auto& watcher_info = watcher.second;
|
162
162
|
watcher_ptr->OnError(
|
163
163
|
watcher_info.root_cert_name.has_value() ? error : absl::OkStatus(),
|
@@ -178,16 +178,16 @@ void grpc_tls_certificate_distributor::WatchTlsCertificates(
|
|
178
178
|
bool already_watching_identity_for_root_cert = false;
|
179
179
|
bool start_watching_identity_cert = false;
|
180
180
|
bool already_watching_root_for_identity_cert = false;
|
181
|
-
|
181
|
+
GRPC_CHECK(root_cert_name.has_value() || identity_cert_name.has_value());
|
182
182
|
TlsCertificatesWatcherInterface* watcher_ptr = watcher.get();
|
183
|
-
|
183
|
+
GRPC_CHECK_NE(watcher_ptr, nullptr);
|
184
184
|
// Update watchers_ and certificate_info_map_.
|
185
185
|
{
|
186
186
|
grpc_core::MutexLock lock(&mu_);
|
187
187
|
const auto watcher_it = watchers_.find(watcher_ptr);
|
188
188
|
// The caller needs to cancel the watcher first if it wants to re-register
|
189
189
|
// the watcher.
|
190
|
-
|
190
|
+
GRPC_CHECK(watcher_it == watchers_.end());
|
191
191
|
watchers_[watcher_ptr] = {std::move(watcher), root_cert_name,
|
192
192
|
identity_cert_name};
|
193
193
|
std::shared_ptr<RootCertInfo> updated_roots;
|
@@ -274,7 +274,7 @@ void grpc_tls_certificate_distributor::CancelTlsCertificatesWatch(
|
|
274
274
|
watchers_.erase(it);
|
275
275
|
if (root_cert_name.has_value()) {
|
276
276
|
auto it = certificate_info_map_.find(*root_cert_name);
|
277
|
-
|
277
|
+
GRPC_CHECK(it != certificate_info_map_.end());
|
278
278
|
CertificateInfo& cert_info = it->second;
|
279
279
|
cert_info.root_cert_watchers.erase(watcher);
|
280
280
|
stop_watching_root_cert = cert_info.root_cert_watchers.empty();
|
@@ -286,7 +286,7 @@ void grpc_tls_certificate_distributor::CancelTlsCertificatesWatch(
|
|
286
286
|
}
|
287
287
|
if (identity_cert_name.has_value()) {
|
288
288
|
auto it = certificate_info_map_.find(*identity_cert_name);
|
289
|
-
|
289
|
+
GRPC_CHECK(it != certificate_info_map_.end());
|
290
290
|
CertificateInfo& cert_info = it->second;
|
291
291
|
cert_info.identity_cert_watchers.erase(watcher);
|
292
292
|
stop_watching_identity_cert = cert_info.identity_cert_watchers.empty();
|
@@ -330,13 +330,13 @@ grpc_tls_identity_pairs* grpc_tls_identity_pairs_create() {
|
|
330
330
|
void grpc_tls_identity_pairs_add_pair(grpc_tls_identity_pairs* pairs,
|
331
331
|
const char* private_key,
|
332
332
|
const char* cert_chain) {
|
333
|
-
|
334
|
-
|
335
|
-
|
333
|
+
GRPC_CHECK_NE(pairs, nullptr);
|
334
|
+
GRPC_CHECK_NE(private_key, nullptr);
|
335
|
+
GRPC_CHECK_NE(cert_chain, nullptr);
|
336
336
|
pairs->pem_key_cert_pairs.emplace_back(private_key, cert_chain);
|
337
337
|
}
|
338
338
|
|
339
339
|
void grpc_tls_identity_pairs_destroy(grpc_tls_identity_pairs* pairs) {
|
340
|
-
|
340
|
+
GRPC_CHECK_NE(pairs, nullptr);
|
341
341
|
delete pairs;
|
342
342
|
}
|
@@ -27,7 +27,6 @@
|
|
27
27
|
#include <utility>
|
28
28
|
#include <vector>
|
29
29
|
|
30
|
-
#include "absl/log/check.h"
|
31
30
|
#include "absl/log/log.h"
|
32
31
|
#include "absl/status/status.h"
|
33
32
|
#include "absl/strings/string_view.h"
|
@@ -39,6 +38,7 @@
|
|
39
38
|
#include "src/core/lib/slice/slice.h"
|
40
39
|
#include "src/core/lib/slice/slice_internal.h"
|
41
40
|
#include "src/core/tsi/ssl_transport_security_utils.h"
|
41
|
+
#include "src/core/util/grpc_check.h"
|
42
42
|
#include "src/core/util/load_file.h"
|
43
43
|
#include "src/core/util/match.h"
|
44
44
|
#include "src/core/util/stat.h"
|
@@ -216,17 +216,17 @@ FileWatcherCertificateProvider::FileWatcherCertificateProvider(
|
|
216
216
|
refresh_interval_sec_ = kMinimumFileWatcherRefreshIntervalSeconds;
|
217
217
|
}
|
218
218
|
// Private key and identity cert files must be both set or both unset.
|
219
|
-
|
219
|
+
GRPC_CHECK(private_key_path_.empty() == identity_certificate_path_.empty());
|
220
220
|
// Must be watching either root or identity certs.
|
221
221
|
bool watching_root =
|
222
222
|
!root_cert_path_.empty() || !spiffe_bundle_map_path_.empty();
|
223
|
-
|
223
|
+
GRPC_CHECK(!private_key_path_.empty() || watching_root);
|
224
224
|
gpr_event_init(&shutdown_event_);
|
225
225
|
ForceUpdate();
|
226
226
|
auto thread_lambda = [](void* arg) {
|
227
227
|
FileWatcherCertificateProvider* provider =
|
228
228
|
static_cast<FileWatcherCertificateProvider*>(arg);
|
229
|
-
|
229
|
+
GRPC_CHECK_NE(provider, nullptr);
|
230
230
|
while (true) {
|
231
231
|
void* value = gpr_event_wait(
|
232
232
|
&provider->shutdown_event_,
|
@@ -494,7 +494,7 @@ int64_t FileWatcherCertificateProvider::TestOnlyGetRefreshIntervalSecond()
|
|
494
494
|
|
495
495
|
grpc_tls_certificate_provider* grpc_tls_certificate_provider_static_data_create(
|
496
496
|
const char* root_certificate, grpc_tls_identity_pairs* pem_key_cert_pairs) {
|
497
|
-
|
497
|
+
GRPC_CHECK(root_certificate != nullptr || pem_key_cert_pairs != nullptr);
|
498
498
|
grpc_core::ExecCtx exec_ctx;
|
499
499
|
grpc_core::PemKeyCertPairList identity_pairs_core;
|
500
500
|
if (pem_key_cert_pairs != nullptr) {
|