grpc 1.83.1 → 1.84.0
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 +21 -17
- data/include/grpc/credentials.h +10 -0
- data/include/grpc/grpc_security_constants.h +2 -0
- data/include/grpc/impl/channel_arg_names.h +9 -0
- data/src/core/call/call_filters.h +4 -2
- data/src/core/call/client_call.cc +20 -8
- data/src/core/call/client_call.h +4 -0
- data/src/core/call/interception_chain.cc +2 -0
- data/src/core/call/interception_chain.h +14 -1
- data/src/core/call/metadata.cc +1 -3
- data/src/core/call/metadata_batch.h +13 -5
- data/src/core/call/server_call.cc +31 -14
- data/src/core/call/server_call.h +4 -0
- data/src/core/channelz/text_encode.cc +9 -4
- data/src/core/channelz/v2tov1/convert.cc +2 -2
- data/src/core/client_channel/backup_poller.cc +1 -2
- data/src/core/client_channel/client_channel.cc +6 -33
- data/src/core/client_channel/client_channel_filter.cc +22 -55
- data/src/core/client_channel/client_channel_filter.h +2 -2
- data/src/core/client_channel/client_channel_service_config.cc +3 -19
- data/src/core/client_channel/direct_channel.cc +7 -1
- data/src/core/client_channel/direct_channel.h +2 -2
- data/src/core/client_channel/load_balanced_call_destination.cc +5 -3
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +5 -12
- data/src/core/client_channel/subchannel.cc +310 -1058
- data/src/core/client_channel/subchannel.h +44 -329
- data/src/core/client_channel/subchannel_metrics.cc +48 -0
- data/src/core/client_channel/subchannel_metrics.h +60 -0
- data/src/core/credentials/call/external/file_external_account_credentials.cc +1 -1
- data/src/core/credentials/call/external/url_external_account_credentials.cc +2 -3
- data/src/core/credentials/call/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +8 -24
- data/src/core/credentials/call/gcp_service_account_identity/gcp_service_account_identity_credentials.h +3 -6
- data/src/core/credentials/call/gdch_service_account/gdch_service_account_credentials.cc +525 -0
- data/src/core/credentials/call/gdch_service_account/gdch_service_account_credentials.h +138 -0
- data/src/core/credentials/call/json_util.h +1 -0
- data/src/core/credentials/call/jwt/json_token.cc +10 -2
- data/src/core/credentials/call/jwt/jwt_verifier.cc +15 -1
- data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.cc +1 -1
- data/src/core/credentials/call/oauth2/oauth2_credentials.cc +42 -79
- data/src/core/credentials/call/oauth2/oauth2_credentials.h +2 -5
- data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.cc +52 -31
- data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.h +21 -8
- data/src/core/credentials/transport/google_default/google_default_credentials.cc +3 -4
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +59 -72
- data/src/core/credentials/transport/ssl/ssl_credentials.h +9 -8
- data/src/core/credentials/transport/ssl/ssl_security_connector.cc +12 -6
- data/src/core/credentials/transport/ssl/ssl_security_connector.h +4 -4
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.cc +29 -18
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.h +9 -6
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc +45 -56
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.h +5 -4
- data/src/core/credentials/transport/tls/grpc_tls_certificate_selector.h +26 -0
- data/src/core/credentials/transport/tls/grpc_tls_crl_provider.cc +1 -1
- data/src/core/credentials/transport/tls/load_system_roots.h +2 -6
- data/src/core/credentials/transport/tls/load_system_roots_fallback.cc +2 -4
- data/src/core/credentials/transport/tls/load_system_roots_supported.cc +13 -15
- data/src/core/credentials/transport/tls/load_system_roots_supported.h +3 -2
- data/src/core/credentials/transport/tls/load_system_roots_windows.cc +5 -8
- data/src/core/credentials/transport/tls/spiffe_utils.cc +1 -1
- data/src/core/credentials/transport/tls/ssl_utils.cc +39 -28
- data/src/core/credentials/transport/tls/ssl_utils.h +12 -49
- data/src/core/credentials/transport/tls/tls_security_connector.cc +48 -33
- data/src/core/credentials/transport/tls/tls_security_connector.h +31 -10
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +15 -11
- data/src/core/ext/filters/http/http_filters_plugin.cc +20 -9
- data/src/core/ext/filters/rbac/rbac_filter.cc +43 -21
- data/src/core/ext/filters/rbac/rbac_filter.h +21 -3
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +2 -2
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +1 -1
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +6 -20
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +32 -67
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +78 -4
- data/src/core/ext/transport/chttp2/transport/frame.h +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +3 -4
- data/src/core/ext/transport/chttp2/transport/goaway.h +7 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +5 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +3 -1
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +141 -130
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +22 -22
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.cc +402 -269
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.h +80 -49
- data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +1 -2
- data/src/core/ext/transport/chttp2/transport/http2_status.h +38 -37
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +178 -5
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +345 -5
- data/src/core/ext/transport/chttp2/transport/parsing.cc +5 -5
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +3 -2
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +25 -5
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +3 -4
- data/src/core/ext/transport/chttp2/transport/read_context.h +30 -3
- data/src/core/ext/transport/chttp2/transport/stream.h +65 -23
- data/src/core/ext/transport/chttp2/transport/writing.cc +0 -3
- data/src/core/ext/transport/inproc/inproc_transport.cc +1 -5
- data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +4 -17
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb.h +1912 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb_minitable.c +300 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb_minitable.h +37 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upb.h +187 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upb_minitable.c +64 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upb_minitable.h +31 -0
- data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb.h +2362 -0
- data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb_minitable.c +556 -0
- data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb_minitable.h +47 -0
- data/src/core/ext/upb-gen/{src/proto/grpc/channelz → grpc/channelz/v1}/channelz.upb.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc/channelz → grpc/channelz/v1}/channelz.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/{src/proto/grpc/channelz → grpc/channelz/v1}/channelz.upb_minitable.h +5 -5
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upbdefs.c +453 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upbdefs.h +67 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upbdefs.c +142 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upbdefs.h +37 -0
- data/src/core/ext/upbdefs-gen/grpc/channelz/v1/channelz.upbdefs.c +715 -0
- data/src/core/ext/upbdefs-gen/{src/proto/grpc/channelz → grpc/channelz/v1}/channelz.upbdefs.h +44 -44
- data/src/core/filter/auth/server_auth_filter.cc +2 -3
- data/src/core/filter/composite/composite_filter.cc +45 -33
- data/src/core/filter/composite/composite_filter.h +5 -4
- data/src/core/filter/ext_proc/ext_proc_filter.cc +224 -0
- data/src/core/filter/ext_proc/ext_proc_filter.h +155 -0
- data/src/core/filter/ext_proc/ext_proc_messages.cc +701 -0
- data/src/core/filter/ext_proc/ext_proc_messages.h +297 -0
- data/src/core/filter/filter_args.h +13 -2
- data/src/core/handshaker/http_connect/http_proxy_mapper.cc +30 -3
- data/src/core/handshaker/security/security_handshaker.cc +9 -6
- data/src/core/lib/channel/channel_stack.cc +3 -0
- data/src/core/lib/channel/channel_stack.h +2 -0
- data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -2
- data/src/core/lib/channel/promise_based_filter.cc +132 -20
- data/src/core/lib/channel/promise_based_filter.h +42 -12
- data/src/core/lib/compression/compression_internal.cc +4 -5
- data/src/core/lib/debug/trace_flags.cc +8 -0
- data/src/core/lib/debug/trace_flags.h +3 -0
- data/src/core/lib/event_engine/ares_resolver.cc +54 -50
- data/src/core/lib/event_engine/ares_resolver.h +3 -2
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +3 -3
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +4 -10
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +74 -33
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +4 -4
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +6 -2
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +3 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +3 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +1 -3
- data/src/core/lib/experiments/experiments.cc +60 -96
- data/src/core/lib/experiments/experiments.h +34 -50
- data/src/core/lib/iomgr/cfstream_handle.cc +2 -6
- data/src/core/lib/iomgr/endpoint_cfstream.cc +3 -10
- data/src/core/lib/iomgr/error.cc +2 -6
- data/src/core/lib/iomgr/error_cfstream.cc +1 -1
- data/src/core/lib/iomgr/ev_poll_posix.cc +5 -9
- data/src/core/lib/iomgr/event_engine_shims/closure.cc +1 -1
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +1 -2
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.cc +1 -2
- data/src/core/lib/iomgr/iomgr_posix.cc +0 -4
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +0 -4
- data/src/core/lib/iomgr/iomgr_windows.cc +0 -4
- data/src/core/lib/iomgr/socket_factory_posix.h +1 -1
- data/src/core/lib/iomgr/socket_utils_posix.cc +3 -0
- data/src/core/lib/iomgr/socket_utils_posix.h +3 -0
- data/src/core/lib/iomgr/systemd_utils.cc +0 -1
- data/src/core/lib/iomgr/tcp_client.h +1 -1
- data/src/core/lib/iomgr/tcp_posix.cc +23 -15
- data/src/core/lib/iomgr/tcp_server.h +1 -1
- data/src/core/lib/iomgr/tcp_server_posix.cc +2 -3
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +0 -1
- data/src/core/lib/iomgr/tcp_server_windows.cc +0 -1
- data/src/core/lib/iomgr/tcp_windows.cc +5 -10
- data/src/core/lib/iomgr/unix_sockets_posix.cc +2 -4
- data/src/core/lib/iomgr/unix_sockets_posix.h +3 -1
- data/src/core/lib/iomgr/vsock.h +3 -1
- data/src/core/lib/resource_quota/memory_quota.cc +1 -1
- data/src/core/lib/security/authorization/rbac_policy.cc +139 -56
- data/src/core/lib/security/authorization/rbac_policy.h +21 -3
- data/src/core/lib/surface/call.cc +3 -9
- data/src/core/lib/surface/call_utils.h +113 -0
- data/src/core/lib/surface/channel_create.cc +1 -1
- data/src/core/lib/surface/channel_create.h +0 -2
- data/src/core/lib/surface/channel_init.cc +77 -38
- data/src/core/lib/surface/channel_init.h +30 -16
- data/src/core/lib/surface/filter_stack_call.cc +5 -10
- data/src/core/lib/surface/init.cc +13 -27
- data/src/core/lib/surface/version.cc +1 -1
- data/src/core/lib/transport/error_utils.cc +0 -27
- data/src/core/lib/transport/error_utils.h +0 -16
- data/src/core/lib/transport/transport.h +7 -5
- data/src/core/load_balancing/pick_first/pick_first.cc +2 -0
- data/src/core/load_balancing/rls/rls.cc +28 -11
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +33 -42
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.h +0 -2
- data/src/core/load_balancing/xds/cds.cc +3 -1
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +0 -1
- data/src/core/mitigation_engine/mitigation.h +14 -5
- data/src/core/mitigation_engine/mitigation_engine.h +7 -3
- data/src/core/mitigation_engine/mitigation_provider.h +2 -1
- data/src/core/plugin_registry/grpc_plugin_registry.cc +39 -8
- data/src/core/resolver/dns/{event_engine/event_engine_client_channel_resolver.cc → dns_resolver.cc} +42 -41
- data/src/core/resolver/dns/{event_engine/event_engine_client_channel_resolver.h → dns_resolver.h} +8 -5
- data/src/core/resolver/dns/{event_engine/service_config_helper.cc → service_config_helper.cc} +1 -1
- data/src/core/resolver/dns/{event_engine/service_config_helper.h → service_config_helper.h} +3 -3
- data/src/core/resolver/endpoint_addresses.h +3 -0
- data/src/core/resolver/google_c2p/google_c2p_resolver.cc +2 -1
- data/src/core/resolver/xds/xds_resolver.cc +35 -9
- data/src/core/server/server.cc +2 -6
- data/src/core/server/server_config_selector.h +18 -3
- data/src/core/server/server_config_selector_filter.cc +178 -91
- data/src/core/server/server_config_selector_filter.h +58 -3
- data/src/core/server/xds_server_config_fetcher.cc +196 -129
- data/src/core/server/xds_server_config_fetcher.h +49 -0
- data/src/core/server/xds_server_config_fetcher_legacy.cc +41 -37
- data/src/core/telemetry/histogram.h +94 -14
- data/src/core/telemetry/instrument.cc +179 -74
- data/src/core/telemetry/instrument.h +78 -30
- data/src/core/telemetry/metrics.h +5 -0
- data/src/core/{resolver/dns/dns_resolver_plugin.h → telemetry/telemetry_label.h} +12 -8
- data/src/core/tsi/alts/crypt/aes_gcm.cc +10 -13
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +2 -2
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +3 -1
- data/src/core/tsi/ssl_telemetry_utils.cc +216 -259
- data/src/core/tsi/ssl_telemetry_utils.h +12 -2
- data/src/core/tsi/ssl_transport_security.cc +238 -80
- data/src/core/tsi/ssl_transport_security.h +63 -33
- data/src/core/tsi/tls_telemetry.cc +31 -0
- data/src/core/tsi/tls_telemetry.h +47 -0
- data/src/core/tsi/transport_security.cc +2 -2
- data/src/core/tsi/transport_security.h +1 -1
- data/src/core/tsi/transport_security_interface.h +1 -1
- data/src/core/{resolver/dns/native/dns_resolver.h → util/address_sorting_init.cc} +21 -8
- data/src/core/{resolver/dns/c_ares/grpc_ares_wrapper_posix.cc → util/address_sorting_init.h} +7 -8
- data/src/core/util/http_client/httpcli.cc +16 -53
- data/src/core/util/http_client/httpcli.h +0 -7
- data/src/core/util/http_client/httpcli_security_connector.cc +13 -8
- data/src/core/util/linux/cpu.cc +1 -1
- data/src/core/util/load_file.cc +3 -9
- data/src/core/util/load_file.h +3 -4
- data/src/core/util/matchers.h +8 -0
- data/src/core/util/posix/cpu.cc +1 -1
- data/src/core/util/status_helper.cc +0 -20
- data/src/core/util/status_helper.h +3 -14
- data/src/core/xds/grpc/xds_audit_logger_registry.cc +51 -31
- data/src/core/xds/grpc/xds_audit_logger_registry.h +17 -3
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +2 -10
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +8 -6
- data/src/core/xds/grpc/xds_bootstrap_grpc_builder.cc +488 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc_builder.h +97 -0
- data/src/core/xds/grpc/xds_certificate_provider.cc +7 -7
- data/src/core/xds/grpc/xds_client_grpc.cc +4 -8
- data/src/core/xds/grpc/xds_client_grpc.h +0 -4
- data/src/core/xds/grpc/xds_cluster.h +1 -0
- data/src/core/xds/grpc/xds_cluster_parser.cc +1 -5
- data/src/core/xds/grpc/xds_cluster_parser.h +0 -2
- data/src/core/xds/grpc/xds_cluster_specifier_plugin.cc +0 -2
- data/src/core/xds/grpc/xds_cluster_specifier_plugin.h +0 -2
- data/src/core/xds/grpc/xds_common_types.cc +0 -91
- data/src/core/xds/grpc/xds_common_types.h +1 -47
- data/src/core/xds/grpc/xds_common_types_parser.cc +84 -378
- data/src/core/xds/grpc/xds_common_types_parser.h +9 -11
- data/src/core/xds/grpc/xds_endpoint_parser.cc +0 -2
- data/src/core/xds/grpc/xds_grpc_service_parser.cc +177 -0
- data/src/core/{resolver/dns/c_ares/dns_resolver_ares.h → xds/grpc/xds_grpc_service_parser.h} +14 -9
- data/src/core/xds/grpc/xds_http_composite_filter.cc +26 -21
- data/src/core/xds/grpc/xds_http_composite_filter.h +4 -3
- data/src/core/xds/grpc/xds_http_ext_proc_filter.cc +418 -0
- data/src/core/xds/grpc/xds_http_ext_proc_filter.h +89 -0
- data/src/core/xds/grpc/xds_http_fault_filter.cc +9 -12
- data/src/core/xds/grpc/xds_http_fault_filter.h +1 -4
- data/src/core/xds/grpc/xds_http_filter.cc +2 -1
- data/src/core/xds/grpc/xds_http_filter.h +6 -5
- data/src/core/xds/grpc/xds_http_filter_registry.cc +10 -127
- data/src/core/xds/grpc/xds_http_filter_registry.h +7 -59
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +13 -14
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +3 -2
- data/src/core/xds/grpc/xds_http_rbac_filter.cc +403 -25
- data/src/core/xds/grpc/xds_http_rbac_filter.h +1 -3
- data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +8 -13
- data/src/core/xds/grpc/xds_http_stateful_session_filter.h +1 -4
- data/src/core/xds/grpc/xds_lb_policy_registry.cc +0 -292
- data/src/core/xds/grpc/xds_lb_policy_registry.h +7 -3
- data/src/core/xds/grpc/xds_listener.cc +2 -0
- data/src/core/xds/grpc/xds_listener.h +5 -0
- data/src/core/xds/grpc/xds_listener_parser.cc +16 -11
- data/src/core/xds/grpc/xds_matcher_parse.h +3 -1
- data/src/core/xds/grpc/xds_metadata_parser.cc +6 -1
- data/src/core/xds/grpc/xds_metadata_parser.h +2 -0
- data/src/core/xds/grpc/xds_route_config.cc +2 -0
- data/src/core/xds/grpc/xds_route_config.h +3 -1
- data/src/core/xds/grpc/xds_route_config_parser.cc +13 -79
- data/src/core/xds/grpc/xds_route_config_parser.h +0 -3
- data/src/core/xds/grpc/xds_routing.cc +116 -69
- data/src/core/xds/grpc/xds_routing.h +19 -8
- data/src/core/xds/grpc/xds_tls_context.cc +117 -0
- data/src/core/xds/grpc/xds_tls_context.h +76 -0
- data/src/core/xds/grpc/xds_tls_context_parser.cc +275 -0
- data/src/core/xds/grpc/xds_tls_context_parser.h +35 -0
- data/src/core/xds/grpc/xds_transport_grpc.cc +41 -38
- data/src/core/xds/grpc/xds_transport_grpc.h +4 -2
- data/src/ruby/ext/grpc/rb_call.c +26 -15
- data/src/ruby/ext/grpc/rb_completion_queue.c +6 -5
- 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/test/client.rb +5 -4
- data/src/ruby/spec/call_spec.rb +14 -0
- data/src/ruby/spec/generic/server_interceptors_spec.rb +3 -6
- metadata +50 -35
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/channelz.upbdefs.c +0 -716
- data/src/core/lib/iomgr/resolve_address.cc +0 -59
- data/src/core/lib/iomgr/resolve_address.h +0 -125
- data/src/core/lib/iomgr/resolve_address_impl.h +0 -58
- data/src/core/lib/iomgr/resolve_address_posix.cc +0 -184
- data/src/core/lib/iomgr/resolve_address_posix.h +0 -78
- data/src/core/lib/iomgr/resolve_address_windows.cc +0 -169
- data/src/core/lib/iomgr/resolve_address_windows.h +0 -76
- data/src/core/resolver/dns/c_ares/dns_resolver_ares.cc +0 -781
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver.h +0 -93
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +0 -203
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +0 -838
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc +0 -1237
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h +0 -130
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +0 -35
- data/src/core/resolver/dns/dns_resolver_plugin.cc +0 -64
- data/src/core/resolver/dns/native/dns_resolver.cc +0 -173
- data/src/core/util/json/json_util.cc +0 -101
- data/src/core/util/json/json_util.h +0 -163
|
@@ -54,14 +54,8 @@ const char* GetStatusIntPropertyUrl(StatusIntProperty key) {
|
|
|
54
54
|
switch (key) {
|
|
55
55
|
case StatusIntProperty::kStreamId:
|
|
56
56
|
return TYPE_URL(TYPE_INT_TAG "stream_id");
|
|
57
|
-
case StatusIntProperty::kRpcStatus:
|
|
58
|
-
return TYPE_URL(TYPE_INT_TAG "grpc_status");
|
|
59
57
|
case StatusIntProperty::kHttp2Error:
|
|
60
58
|
return TYPE_URL(TYPE_INT_TAG "http2_error");
|
|
61
|
-
case StatusIntProperty::ChannelConnectivityState:
|
|
62
|
-
return TYPE_URL(TYPE_INT_TAG "channel_connectivity_state");
|
|
63
|
-
case StatusIntProperty::kLbPolicyDrop:
|
|
64
|
-
return TYPE_URL(TYPE_INT_TAG "lb_policy_drop");
|
|
65
59
|
}
|
|
66
60
|
GPR_UNREACHABLE_CODE(return "unknown");
|
|
67
61
|
}
|
|
@@ -80,8 +74,6 @@ absl::Status StatusCreate(absl::StatusCode code, absl::string_view msg,
|
|
|
80
74
|
return s;
|
|
81
75
|
}
|
|
82
76
|
|
|
83
|
-
namespace {
|
|
84
|
-
|
|
85
77
|
absl::Status ReplaceStatusCode(const absl::Status& status,
|
|
86
78
|
absl::StatusCode code) {
|
|
87
79
|
absl::Status new_status(code, status.message());
|
|
@@ -92,23 +84,13 @@ absl::Status ReplaceStatusCode(const absl::Status& status,
|
|
|
92
84
|
return new_status;
|
|
93
85
|
}
|
|
94
86
|
|
|
95
|
-
} // namespace
|
|
96
|
-
|
|
97
87
|
void StatusSetInt(absl::Status* status, StatusIntProperty key, intptr_t value) {
|
|
98
|
-
if (key == StatusIntProperty::kRpcStatus) {
|
|
99
|
-
// When setting the RPC status, just replace the top-level status code.
|
|
100
|
-
*status = ReplaceStatusCode(*status, static_cast<absl::StatusCode>(value));
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
88
|
status->SetPayload(GetStatusIntPropertyUrl(key),
|
|
104
89
|
absl::Cord(std::to_string(value)));
|
|
105
90
|
}
|
|
106
91
|
|
|
107
92
|
std::optional<intptr_t> StatusGetInt(const absl::Status& status,
|
|
108
93
|
StatusIntProperty key) {
|
|
109
|
-
if (key == StatusIntProperty::kRpcStatus) {
|
|
110
|
-
return static_cast<intptr_t>(status.code());
|
|
111
|
-
}
|
|
112
94
|
auto p = status.GetPayload(GetStatusIntPropertyUrl(key));
|
|
113
95
|
if (p.has_value()) {
|
|
114
96
|
auto sv = p->TryFlat();
|
|
@@ -156,8 +138,6 @@ void StatusAddChild(absl::Status* status, absl::Status child) {
|
|
|
156
138
|
*status = std::move(new_status);
|
|
157
139
|
}
|
|
158
140
|
|
|
159
|
-
std::vector<absl::Status> StatusGetChildren(absl::Status status) { return {}; }
|
|
160
|
-
|
|
161
141
|
std::string StatusToString(const absl::Status& status) {
|
|
162
142
|
if (status.ok()) {
|
|
163
143
|
return "OK";
|
|
@@ -64,19 +64,9 @@ enum class StatusIntProperty {
|
|
|
64
64
|
/// wire stream
|
|
65
65
|
// TODO(tjagtap): Remove this when the PH2 migration is done.
|
|
66
66
|
kStreamId,
|
|
67
|
-
/// grpc status code representing this error
|
|
68
|
-
// TODO(roth): Remove this after error_flatten experiment is removed.
|
|
69
|
-
kRpcStatus,
|
|
70
67
|
/// http2 error code associated with the error (see the HTTP2 RFC)
|
|
71
68
|
// TODO(tjagtap): Remove this as part of creating a new HTTP/2 error type.
|
|
72
69
|
kHttp2Error,
|
|
73
|
-
/// channel connectivity state associated with the error
|
|
74
|
-
// TODO(roth): Remove this when the promise migration is done.
|
|
75
|
-
ChannelConnectivityState,
|
|
76
|
-
/// LB policy drop
|
|
77
|
-
// TODO(roth): Replace this with something else, possibly a call
|
|
78
|
-
// context element.
|
|
79
|
-
kLbPolicyDrop,
|
|
80
70
|
};
|
|
81
71
|
|
|
82
72
|
/// Creates a status with given additional information
|
|
@@ -92,13 +82,12 @@ GRPC_MUST_USE_RESULT
|
|
|
92
82
|
std::optional<intptr_t> StatusGetInt(const absl::Status& status,
|
|
93
83
|
StatusIntProperty key);
|
|
94
84
|
|
|
85
|
+
absl::Status ReplaceStatusCode(const absl::Status& status,
|
|
86
|
+
absl::StatusCode code);
|
|
87
|
+
|
|
95
88
|
/// Adds a child status to status
|
|
96
89
|
void StatusAddChild(absl::Status* status, absl::Status child);
|
|
97
90
|
|
|
98
|
-
/// Returns all children status from a status
|
|
99
|
-
GRPC_MUST_USE_RESULT std::vector<absl::Status> StatusGetChildren(
|
|
100
|
-
absl::Status status);
|
|
101
|
-
|
|
102
91
|
/// Returns a string representation from status
|
|
103
92
|
/// Error status will be like
|
|
104
93
|
/// STATUS[:MESSAGE] [{PAYLOADS[, children:[CHILDREN-STATUS-LISTS]]}]
|
|
@@ -16,9 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
#include "src/core/xds/grpc/xds_audit_logger_registry.h"
|
|
18
18
|
|
|
19
|
-
#include <grpc/support/port_platform.h>
|
|
20
|
-
|
|
21
|
-
#include <optional>
|
|
22
19
|
#include <string>
|
|
23
20
|
#include <utility>
|
|
24
21
|
|
|
@@ -29,42 +26,64 @@
|
|
|
29
26
|
#include "src/core/util/validation_errors.h"
|
|
30
27
|
#include "src/core/xds/grpc/xds_common_types.h"
|
|
31
28
|
#include "src/core/xds/grpc/xds_common_types_parser.h"
|
|
32
|
-
#include "absl/status/status.h"
|
|
33
|
-
#include "absl/status/statusor.h"
|
|
34
29
|
#include "absl/strings/string_view.h"
|
|
35
30
|
|
|
36
31
|
namespace grpc_core {
|
|
37
32
|
|
|
38
|
-
namespace {
|
|
39
|
-
|
|
40
33
|
using experimental::AuditLoggerRegistry;
|
|
41
34
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
std::shared_ptr<const experimental::AuditLoggerFactory::Config>
|
|
36
|
+
XdsAuditLoggerRegistry::ParseXdsAuditLoggerConfig(
|
|
37
|
+
const XdsResourceType::DecodeContext& context,
|
|
38
|
+
const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig*
|
|
39
|
+
logger_config,
|
|
40
|
+
ValidationErrors* errors) const {
|
|
41
|
+
const auto* typed_extension_config =
|
|
42
|
+
envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_audit_logger(
|
|
43
|
+
logger_config);
|
|
44
|
+
ValidationErrors::ScopedField field(errors, ".audit_logger");
|
|
45
|
+
if (typed_extension_config == nullptr) {
|
|
46
|
+
errors->AddError("field not present");
|
|
47
|
+
return nullptr;
|
|
52
48
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
ValidationErrors::ScopedField field2(errors, ".typed_config");
|
|
50
|
+
const auto* typed_config =
|
|
51
|
+
envoy_config_core_v3_TypedExtensionConfig_typed_config(
|
|
52
|
+
typed_extension_config);
|
|
53
|
+
auto extension = ExtractXdsExtension(context, typed_config, errors);
|
|
54
|
+
if (!extension.has_value()) return nullptr;
|
|
55
|
+
absl::string_view name;
|
|
56
|
+
Json config;
|
|
57
|
+
Match(
|
|
58
|
+
extension->value,
|
|
59
|
+
// Built-in logger types.
|
|
60
|
+
[&](absl::string_view serialized_value) {
|
|
61
|
+
auto it = audit_logger_config_factories_.find(extension->type);
|
|
62
|
+
if (it == audit_logger_config_factories_.end()) return;
|
|
63
|
+
name = it->second->name();
|
|
64
|
+
config = Json::FromObject(it->second->ConvertXdsAuditLoggerConfig(
|
|
65
|
+
context, serialized_value, errors));
|
|
66
|
+
},
|
|
67
|
+
// Custom logger types.
|
|
68
|
+
[&](Json json) {
|
|
69
|
+
if (!AuditLoggerRegistry::FactoryExists(extension->type)) return;
|
|
70
|
+
name = extension->type;
|
|
71
|
+
config = json;
|
|
72
|
+
});
|
|
73
|
+
if (name.empty()) {
|
|
74
|
+
if (!envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_is_optional(
|
|
75
|
+
logger_config)) {
|
|
76
|
+
errors->AddError("unsupported audit logger type");
|
|
77
|
+
}
|
|
78
|
+
return nullptr;
|
|
59
79
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
std::make_unique<StdoutLoggerConfigFactory>());
|
|
80
|
+
// Validate the converted config.
|
|
81
|
+
auto parsed_config = AuditLoggerRegistry::ParseConfig(name, config);
|
|
82
|
+
if (!parsed_config.ok()) {
|
|
83
|
+
errors->AddError(parsed_config.status().message());
|
|
84
|
+
return nullptr;
|
|
85
|
+
}
|
|
86
|
+
return std::move(*parsed_config);
|
|
68
87
|
}
|
|
69
88
|
|
|
70
89
|
Json XdsAuditLoggerRegistry::ConvertXdsAuditLoggerConfig(
|
|
@@ -120,4 +139,5 @@ Json XdsAuditLoggerRegistry::ConvertXdsAuditLoggerConfig(
|
|
|
120
139
|
}
|
|
121
140
|
return Json::FromObject({{std::string(name), std::move(config)}});
|
|
122
141
|
}
|
|
142
|
+
|
|
123
143
|
} // namespace grpc_core
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
#ifndef GRPC_SRC_CORE_XDS_GRPC_XDS_AUDIT_LOGGER_REGISTRY_H
|
|
18
18
|
#define GRPC_SRC_CORE_XDS_GRPC_XDS_AUDIT_LOGGER_REGISTRY_H
|
|
19
19
|
|
|
20
|
-
#include <grpc/support/port_platform.h>
|
|
21
|
-
|
|
22
20
|
#include <map>
|
|
23
21
|
#include <memory>
|
|
22
|
+
#include <utility>
|
|
24
23
|
|
|
25
24
|
#include "envoy/config/rbac/v3/rbac.upb.h"
|
|
25
|
+
#include "src/core/lib/security/authorization/audit_logging.h"
|
|
26
26
|
#include "src/core/util/json/json.h"
|
|
27
27
|
#include "src/core/util/validation_errors.h"
|
|
28
28
|
#include "src/core/xds/xds_client/xds_resource_type.h"
|
|
@@ -46,8 +46,22 @@ class XdsAuditLoggerRegistry final {
|
|
|
46
46
|
virtual absl::string_view name() = 0;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
XdsAuditLoggerRegistry();
|
|
49
|
+
XdsAuditLoggerRegistry() = default;
|
|
50
|
+
|
|
51
|
+
template <typename T>
|
|
52
|
+
void RegisterFactory(std::unique_ptr<T> factory) {
|
|
53
|
+
audit_logger_config_factories_.emplace(T::Type(), std::move(factory));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
std::shared_ptr<const experimental::AuditLoggerFactory::Config>
|
|
57
|
+
ParseXdsAuditLoggerConfig(
|
|
58
|
+
const XdsResourceType::DecodeContext& context,
|
|
59
|
+
const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig*
|
|
60
|
+
logger_config,
|
|
61
|
+
ValidationErrors* errors) const;
|
|
50
62
|
|
|
63
|
+
// TODO(roth): Remove this method when removing the
|
|
64
|
+
// xds_server_filter_chain_per_route experiment.
|
|
51
65
|
Json ConvertXdsAuditLoggerConfig(
|
|
52
66
|
const XdsResourceType::DecodeContext& context,
|
|
53
67
|
const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig*
|
|
@@ -16,16 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
#include "src/core/xds/grpc/xds_bootstrap_grpc.h"
|
|
18
18
|
|
|
19
|
-
#include <
|
|
20
|
-
#include <stdlib.h>
|
|
21
|
-
|
|
22
|
-
#include <optional>
|
|
19
|
+
#include <memory>
|
|
23
20
|
#include <string>
|
|
24
|
-
#include <utility>
|
|
25
|
-
#include <vector>
|
|
26
21
|
|
|
27
22
|
#include "src/core/config/experiment_env_var.h"
|
|
28
|
-
#include "src/core/util/down_cast.h"
|
|
29
23
|
#include "src/core/util/json/json.h"
|
|
30
24
|
#include "src/core/util/json/json_object_loader.h"
|
|
31
25
|
#include "src/core/util/json/json_reader.h"
|
|
@@ -227,9 +221,7 @@ absl::StatusOr<std::unique_ptr<GrpcXdsBootstrap>> GrpcXdsBootstrap::Create(
|
|
|
227
221
|
return true;
|
|
228
222
|
}
|
|
229
223
|
};
|
|
230
|
-
|
|
231
|
-
if (!bootstrap.ok()) return bootstrap.status();
|
|
232
|
-
return std::make_unique<GrpcXdsBootstrap>(std::move(*bootstrap));
|
|
224
|
+
return LoadFromJson<std::unique_ptr<GrpcXdsBootstrap>>(*json, XdsJsonArgs());
|
|
233
225
|
}
|
|
234
226
|
|
|
235
227
|
const JsonLoaderInterface* GrpcXdsBootstrap::JsonLoader(const JsonArgs&) {
|
|
@@ -17,8 +17,6 @@
|
|
|
17
17
|
#ifndef GRPC_SRC_CORE_XDS_GRPC_XDS_BOOTSTRAP_GRPC_H
|
|
18
18
|
#define GRPC_SRC_CORE_XDS_GRPC_XDS_BOOTSTRAP_GRPC_H
|
|
19
19
|
|
|
20
|
-
#include <grpc/support/port_platform.h>
|
|
21
|
-
|
|
22
20
|
#include <map>
|
|
23
21
|
#include <memory>
|
|
24
22
|
#include <optional>
|
|
@@ -44,6 +42,8 @@ namespace grpc_core {
|
|
|
44
42
|
|
|
45
43
|
bool XdsExtProcOnClientEnabled();
|
|
46
44
|
|
|
45
|
+
class GrpcXdsBootstrapBuilder;
|
|
46
|
+
|
|
47
47
|
class GrpcXdsBootstrap final : public XdsBootstrap {
|
|
48
48
|
public:
|
|
49
49
|
class GrpcNode final : public Node {
|
|
@@ -124,10 +124,6 @@ class GrpcXdsBootstrap final : public XdsBootstrap {
|
|
|
124
124
|
ValidationErrors* errors);
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
// Creates bootstrap object from json_string.
|
|
128
|
-
static absl::StatusOr<std::unique_ptr<GrpcXdsBootstrap>> Create(
|
|
129
|
-
absl::string_view json_string);
|
|
130
|
-
|
|
131
127
|
static const JsonLoaderInterface* JsonLoader(const JsonArgs&);
|
|
132
128
|
void JsonPostLoad(const Json& json, const JsonArgs& args,
|
|
133
129
|
ValidationErrors* errors);
|
|
@@ -187,6 +183,12 @@ class GrpcXdsBootstrap final : public XdsBootstrap {
|
|
|
187
183
|
}
|
|
188
184
|
|
|
189
185
|
private:
|
|
186
|
+
friend class GrpcXdsBootstrapBuilder;
|
|
187
|
+
|
|
188
|
+
// External callers should use GrpcXdsBootstrapBuilder::Build() instead.
|
|
189
|
+
static absl::StatusOr<std::unique_ptr<GrpcXdsBootstrap>> Create(
|
|
190
|
+
absl::string_view json_string);
|
|
191
|
+
|
|
190
192
|
std::vector<GrpcXdsServer> servers_;
|
|
191
193
|
std::optional<GrpcNode> node_;
|
|
192
194
|
std::string client_default_listener_resource_name_template_;
|