grpc 1.78.1 → 1.80.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 +22 -8
- data/include/grpc/credentials.h +47 -37
- data/include/grpc/credentials_cpp.h +39 -0
- data/include/grpc/event_engine/event_engine.h +8 -3
- data/include/grpc/grpc.h +4 -0
- data/include/grpc/impl/call.h +9 -0
- data/include/grpc/impl/channel_arg_names.h +7 -0
- data/include/grpc/module.modulemap +2 -0
- data/include/grpc/private_key_signer.h +104 -0
- data/include/grpc/support/port_platform.h +6 -0
- data/src/core/call/call_filters.h +101 -78
- data/src/core/call/call_spine.h +91 -68
- data/src/core/call/call_state.h +60 -4
- data/src/core/call/client_call.cc +9 -9
- data/src/core/call/client_call.h +1 -1
- data/src/core/call/metadata_batch.cc +2 -0
- data/src/core/call/metadata_batch.h +48 -1
- data/src/core/call/metadata_info.cc +35 -0
- data/src/core/call/metadata_info.h +2 -0
- data/src/core/call/simple_slice_based_metadata.h +2 -1
- data/src/core/channelz/channelz.cc +9 -6
- data/src/core/channelz/channelz.h +7 -4
- data/src/core/channelz/property_list.h +5 -0
- data/src/core/channelz/v2tov1/convert.cc +1 -1
- data/src/core/channelz/v2tov1/legacy_api.cc +164 -307
- data/src/core/client_channel/buffered_call.cc +7 -3
- data/src/core/client_channel/buffered_call.h +11 -5
- data/src/core/client_channel/client_channel.cc +106 -44
- data/src/core/client_channel/client_channel.h +3 -6
- data/src/core/client_channel/client_channel_filter.cc +90 -64
- data/src/core/client_channel/client_channel_filter.h +3 -6
- data/src/core/client_channel/client_channel_internal.h +5 -0
- data/src/core/client_channel/config_selector.h +17 -12
- data/src/core/client_channel/dynamic_filters.cc +8 -7
- data/src/core/client_channel/dynamic_filters.h +7 -5
- data/src/core/client_channel/retry_filter.cc +1 -1
- data/src/core/client_channel/retry_filter.h +2 -2
- data/src/core/client_channel/subchannel.cc +1682 -266
- data/src/core/client_channel/subchannel.h +411 -134
- data/src/core/client_channel/subchannel_stream_client.cc +22 -18
- data/src/core/client_channel/subchannel_stream_client.h +8 -9
- data/src/core/client_channel/subchannel_stream_limiter.cc +76 -0
- data/src/core/client_channel/subchannel_stream_limiter.h +51 -0
- data/src/core/config/config_vars.cc +9 -1
- data/src/core/config/config_vars.h +6 -0
- data/src/core/credentials/call/call_creds_registry.h +51 -22
- data/src/core/credentials/call/call_creds_registry_init.cc +86 -2
- data/src/core/credentials/call/external/aws_external_account_credentials.cc +2 -2
- data/src/core/credentials/call/external/external_account_credentials.cc +11 -4
- data/src/core/credentials/call/external/file_external_account_credentials.cc +2 -2
- data/src/core/credentials/transport/channel_creds_registry.h +71 -20
- data/src/core/credentials/transport/channel_creds_registry_init.cc +338 -29
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +43 -24
- data/src/core/credentials/transport/ssl/ssl_credentials.h +7 -1
- data/src/core/credentials/transport/ssl/ssl_security_connector.cc +2 -8
- data/src/core/credentials/transport/ssl/ssl_security_connector.h +4 -3
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.cc +25 -5
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.h +7 -5
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc +181 -109
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.h +55 -42
- data/src/core/credentials/transport/tls/grpc_tls_credentials_options.cc +28 -23
- data/src/core/credentials/transport/tls/grpc_tls_credentials_options.h +26 -23
- data/src/core/credentials/transport/tls/spiffe_utils.cc +2 -2
- data/src/core/credentials/transport/tls/ssl_utils.cc +18 -18
- data/src/core/credentials/transport/tls/ssl_utils.h +12 -10
- data/src/core/credentials/transport/tls/tls_security_connector.cc +106 -74
- data/src/core/credentials/transport/tls/tls_security_connector.h +12 -8
- data/src/core/credentials/transport/xds/xds_credentials.cc +76 -32
- data/src/core/credentials/transport/xds/xds_credentials.h +4 -2
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +117 -35
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +42 -4
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +58 -29
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +19 -11
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +82 -25
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +28 -3
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc +9 -7
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +1 -1
- data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.h +7 -1
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +117 -67
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +2 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +11 -1
- data/src/core/ext/transport/chttp2/transport/frame.cc +2 -15
- data/src/core/ext/transport/chttp2/transport/frame.h +0 -4
- data/src/core/ext/transport/chttp2/transport/goaway.cc +17 -2
- data/src/core/ext/transport/chttp2/transport/goaway.h +27 -6
- data/src/core/ext/transport/chttp2/transport/header_assembler.h +8 -21
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +101 -40
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +95 -0
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +923 -772
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +406 -423
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +8 -1
- data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +25 -13
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +71 -24
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +25 -49
- data/src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h +2 -2
- data/src/core/ext/transport/chttp2/transport/incoming_metadata_tracker.h +29 -9
- data/src/core/ext/transport/chttp2/transport/internal.h +6 -2
- data/src/core/ext/transport/chttp2/transport/keepalive.cc +14 -20
- data/src/core/ext/transport/chttp2/transport/keepalive.h +9 -6
- data/src/core/ext/transport/chttp2/transport/parsing.cc +11 -0
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +34 -74
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +123 -79
- data/src/core/ext/transport/chttp2/transport/security_frame.h +233 -3
- data/src/core/ext/transport/chttp2/transport/stream.h +152 -73
- data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +155 -85
- data/src/core/ext/transport/chttp2/transport/transport_common.h +0 -5
- data/src/core/ext/transport/chttp2/transport/writable_streams.h +8 -7
- data/src/core/ext/transport/chttp2/transport/write_cycle.cc +86 -0
- data/src/core/ext/transport/chttp2/transport/write_cycle.h +355 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +31 -29
- data/src/core/ext/upb-gen/cel/expr/checked.upb.h +1875 -0
- data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.c +409 -0
- data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.h +56 -0
- data/src/core/ext/upb-gen/cel/expr/syntax.upb.h +2223 -0
- data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.c +489 -0
- data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.h +60 -0
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb.h +2 -1
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +130 -18
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +18 -13
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +70 -38
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +20 -17
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb.h +26 -10
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c +8 -7
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb.h +495 -0
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.c +114 -0
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.h +36 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +26 -10
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +8 -7
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb.h +121 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.c +54 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb.h +143 -9
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c +18 -6
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +112 -11
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +22 -9
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb.h +276 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.c +60 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.h +4 -0
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +72 -0
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +23 -2
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +129 -13
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +36 -10
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +30 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +5 -3
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb.h +16 -0
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c +4 -3
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +31 -0
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +5 -3
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb.h +2 -1
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +63 -0
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +12 -7
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb.h +97 -81
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c +40 -23
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +604 -228
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +146 -100
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb.h +30 -0
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c +5 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +35 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +7 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +66 -14
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +22 -11
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +87 -0
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c +29 -2
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +20 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +5 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +239 -60
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +59 -28
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb.h +89 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.c +50 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb.h +135 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.c +53 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb.h +105 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.c +51 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb_minitable.c +6 -3
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +206 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +41 -8
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +64 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +4 -3
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +64 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.c +31 -5
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb.h +283 -14
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c +48 -11
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb.h +144 -6
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c +35 -7
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb.h +42 -21
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c +9 -8
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +164 -1
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +37 -6
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb.h +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb.h +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb.h +26 -11
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c +8 -8
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb.h +33 -0
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.c +14 -3
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb.h +90 -10
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.c +18 -7
- data/src/core/ext/upbdefs-gen/cel/expr/checked.upbdefs.c +248 -0
- data/src/core/ext/upbdefs-gen/cel/expr/checked.upbdefs.h +97 -0
- data/src/core/ext/upbdefs-gen/cel/expr/syntax.upbdefs.c +283 -0
- data/src/core/ext/upbdefs-gen/cel/expr/syntax.upbdefs.h +107 -0
- data/src/core/ext/upbdefs-gen/envoy/config/accesslog/v3/accesslog.upbdefs.c +213 -211
- data/src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +635 -614
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.c +1012 -1000
- data/src/core/ext/upbdefs-gen/envoy/config/common/matcher/v3/matcher.upbdefs.c +276 -273
- data/src/core/ext/upbdefs-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upbdefs.c +152 -0
- data/src/core/ext/upbdefs-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upbdefs.h +47 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/address.upbdefs.c +149 -144
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.c +367 -370
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/cel.upbdefs.c +63 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/cel.upbdefs.h +37 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/grpc_service.upbdefs.c +297 -284
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.c +492 -469
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/proxy_protocol.upbdefs.c +74 -43
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/proxy_protocol.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/substitution_format_string.upbdefs.c +60 -59
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +202 -184
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.c +354 -339
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/quic_config.upbdefs.c +28 -19
- data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/metrics_service.upbdefs.c +30 -27
- data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/stats.upbdefs.c +71 -66
- data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.c +94 -91
- data/src/core/ext/upbdefs-gen/envoy/config/rbac/v3/rbac.upbdefs.c +386 -369
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route.upbdefs.c +60 -57
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.c +1974 -1884
- data/src/core/ext/upbdefs-gen/envoy/config/tap/v3/common.upbdefs.c +119 -112
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opentelemetry.upbdefs.c +62 -51
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/zipkin.upbdefs.c +109 -88
- data/src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +54 -36
- data/src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +78 -84
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c +48 -46
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +1041 -984
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +304 -290
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +94 -77
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upbdefs.c +246 -193
- data/src/core/ext/upbdefs-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/type/http/v3/cookie.upbdefs.c +37 -23
- data/src/core/ext/upbdefs-gen/envoy/type/http/v3/cookie.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/type/tracing/v3/custom_tag.upbdefs.c +5 -3
- data/src/core/ext/upbdefs-gen/google/api/http.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-gen/google/api/httpbody.upbdefs.c +4 -5
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.c +113 -87
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/udpa/annotations/migrate.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/security.upbdefs.c +6 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/sensitive.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/status.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/versioning.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/cel.upbdefs.c +25 -30
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/http_inputs.upbdefs.c +14 -20
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/matcher.upbdefs.c +180 -183
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/string.upbdefs.c +56 -47
- data/src/core/ext/upbdefs-gen/xds/type/v3/cel.upbdefs.c +69 -47
- data/src/core/filter/filter_chain.h +95 -0
- data/src/core/handshaker/http_connect/{http_connect_handshaker.cc → http_connect_client_handshaker.cc} +32 -31
- data/src/core/handshaker/http_connect/{http_connect_handshaker.h → http_connect_client_handshaker.h} +4 -4
- data/src/core/handshaker/http_connect/http_proxy_mapper.cc +1 -1
- data/src/core/handshaker/http_connect/xds_http_proxy_mapper.cc +1 -1
- data/src/core/handshaker/security/pipelined_secure_endpoint.cc +14 -13
- data/src/core/handshaker/security/secure_endpoint.cc +282 -68
- data/src/core/handshaker/security/secure_endpoint.h +0 -7
- data/src/core/lib/channel/channel_args.h +1 -1
- data/src/core/lib/channel/promise_based_filter.cc +17 -4
- data/src/core/lib/channel/promise_based_filter.h +3 -2
- 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/cf_engine/cfstream_endpoint.cc +35 -8
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +1 -2
- data/src/core/lib/event_engine/event_engine.cc +9 -0
- data/src/core/lib/event_engine/extensions/tcp_trace.h +0 -3
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +2 -2
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +1 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +34 -9
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +24 -2
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +1 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +141 -14
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +19 -2
- data/src/core/lib/event_engine/posix_engine/posix_interface.h +7 -0
- data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +21 -3
- data/src/core/lib/event_engine/posix_engine/posix_interface_windows.cc +16 -0
- data/src/core/lib/experiments/experiments.cc +309 -201
- data/src/core/lib/experiments/experiments.h +141 -80
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +2 -2
- data/src/core/lib/iomgr/resolve_address.h +0 -2
- data/src/core/lib/iomgr/resolved_address.h +0 -2
- data/src/core/lib/iomgr/tcp_posix.cc +13 -5
- data/src/core/lib/iomgr/tcp_server.cc +0 -5
- data/src/core/lib/iomgr/tcp_server.h +0 -7
- data/src/core/lib/iomgr/tcp_server_posix.cc +0 -17
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +0 -3
- data/src/core/lib/iomgr/tcp_server_windows.cc +12 -51
- data/src/core/lib/promise/all_ok.h +17 -12
- data/src/core/lib/promise/cancel_callback.h +12 -13
- data/src/core/lib/promise/detail/join_state.h +626 -0
- data/src/core/lib/promise/detail/promise_factory.h +14 -14
- data/src/core/lib/promise/for_each.h +32 -8
- data/src/core/lib/promise/if.h +9 -7
- data/src/core/lib/promise/loop.h +18 -16
- data/src/core/lib/promise/map.h +54 -47
- data/src/core/lib/promise/mpsc.h +11 -10
- data/src/core/lib/promise/observable.h +6 -6
- data/src/core/lib/promise/party.h +25 -19
- data/src/core/lib/promise/poll.h +5 -5
- data/src/core/lib/promise/prioritized_race.h +10 -7
- data/src/core/lib/promise/promise.h +16 -11
- data/src/core/lib/promise/race.h +6 -5
- data/src/core/lib/promise/seq.h +109 -74
- data/src/core/lib/promise/try_join.h +14 -6
- data/src/core/lib/promise/try_seq.h +76 -60
- data/src/core/lib/resource_quota/api.cc +7 -0
- data/src/core/lib/resource_quota/arena.h +1 -1
- data/src/core/lib/resource_quota/memory_quota.cc +4 -1
- data/src/core/lib/resource_quota/resource_quota.cc +2 -1
- data/src/core/lib/resource_quota/resource_quota.h +3 -0
- data/src/core/lib/resource_quota/stream_quota.cc +77 -1
- data/src/core/lib/resource_quota/stream_quota.h +64 -1
- data/src/core/lib/resource_quota/telemetry.h +1 -1
- data/src/core/lib/surface/call.cc +13 -0
- data/src/core/lib/surface/call_utils.h +58 -43
- data/src/core/lib/surface/channel.h +1 -4
- data/src/core/lib/surface/completion_queue.cc +13 -6
- data/src/core/lib/surface/validate_metadata.cc +20 -15
- data/src/core/lib/surface/validate_metadata.h +3 -1
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/promise_endpoint.cc +1 -1
- data/src/core/lib/transport/promise_endpoint.h +1 -1
- data/src/core/lib/transport/transport.h +5 -0
- data/src/core/load_balancing/health_check_client.cc +1 -15
- data/src/core/load_balancing/health_check_client_internal.h +0 -2
- data/src/core/load_balancing/oob_backend_metric.cc +1 -5
- data/src/core/load_balancing/oob_backend_metric_internal.h +0 -1
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +12 -9
- data/src/core/plugin_registry/grpc_plugin_registry.cc +3 -2
- data/src/core/resolver/xds/xds_resolver.cc +162 -116
- data/src/core/server/server.cc +18 -1
- data/src/core/server/server.h +2 -0
- data/src/core/server/xds_server_config_fetcher.cc +4 -4
- data/src/core/telemetry/call_tracer.cc +87 -2
- data/src/core/telemetry/call_tracer.h +46 -8
- data/src/core/telemetry/instrument.cc +102 -40
- data/src/core/telemetry/instrument.h +246 -65
- data/src/core/tsi/fake_transport_security.cc +3 -1
- data/src/core/tsi/ssl_transport_security.cc +516 -137
- data/src/core/tsi/ssl_transport_security.h +28 -22
- data/src/core/tsi/ssl_transport_security_utils.cc +2 -2
- data/src/core/tsi/ssl_transport_security_utils.h +2 -2
- data/src/core/util/bitset.h +6 -0
- data/src/core/util/function_signature.h +3 -1
- data/src/core/util/http_client/httpcli_security_connector.cc +2 -1
- data/src/core/util/json/json_reader.cc +0 -4
- data/src/core/xds/grpc/certificate_provider_store.cc +2 -1
- data/src/core/xds/grpc/certificate_provider_store.h +3 -17
- data/src/core/xds/grpc/certificate_provider_store_interface.h +61 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +48 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +18 -0
- data/src/core/xds/grpc/xds_certificate_provider.cc +7 -2
- data/src/core/xds/grpc/xds_certificate_provider.h +13 -2
- data/src/core/xds/grpc/xds_client_grpc.cc +13 -6
- data/src/core/xds/grpc/xds_client_grpc.h +10 -7
- data/src/core/xds/grpc/xds_cluster.cc +18 -4
- data/src/core/xds/grpc/xds_cluster.h +17 -2
- data/src/core/xds/grpc/xds_cluster_parser.cc +36 -11
- data/src/core/xds/grpc/xds_common_types.cc +45 -0
- data/src/core/xds/grpc/xds_common_types.h +31 -0
- data/src/core/xds/grpc/xds_common_types_parser.cc +274 -16
- data/src/core/xds/grpc/xds_common_types_parser.h +12 -0
- data/src/core/xds/grpc/xds_http_fault_filter.cc +128 -24
- data/src/core/xds/grpc/xds_http_fault_filter.h +19 -10
- data/src/core/xds/grpc/xds_http_filter.cc +38 -0
- data/src/core/xds/grpc/xds_http_filter.h +70 -47
- data/src/core/xds/grpc/xds_http_filter_registry.cc +48 -14
- data/src/core/xds/grpc/xds_http_filter_registry.h +29 -15
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +88 -22
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +22 -11
- data/src/core/xds/grpc/xds_http_rbac_filter.cc +36 -20
- data/src/core/xds/grpc/xds_http_rbac_filter.h +19 -10
- data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +143 -26
- data/src/core/xds/grpc/xds_http_stateful_session_filter.h +19 -10
- data/src/core/xds/grpc/xds_listener.cc +4 -1
- data/src/core/xds/grpc/xds_listener.h +10 -2
- data/src/core/xds/grpc/xds_listener_parser.cc +23 -18
- data/src/core/xds/grpc/xds_matcher.cc +40 -5
- data/src/core/xds/grpc/xds_matcher.h +13 -0
- data/src/core/xds/grpc/xds_matcher_action.h +1 -1
- data/src/core/xds/grpc/xds_matcher_parse.cc +60 -40
- data/src/core/xds/grpc/xds_matcher_parse.h +2 -1
- data/src/core/xds/grpc/xds_route_config.cc +12 -1
- data/src/core/xds/grpc/xds_route_config.h +15 -2
- data/src/core/xds/grpc/xds_route_config_parser.cc +11 -5
- data/src/core/xds/grpc/xds_routing.cc +181 -6
- data/src/core/xds/grpc/xds_routing.h +57 -0
- data/src/core/xds/grpc/xds_server_grpc.cc +55 -43
- data/src/core/xds/grpc/xds_server_grpc.h +13 -6
- data/src/core/xds/grpc/xds_server_grpc_interface.h +3 -2
- data/src/core/xds/grpc/xds_transport_grpc.cc +12 -6
- data/src/core/xds/grpc/xds_transport_grpc.h +5 -1
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +12 -8
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +18 -12
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +1 -1
- metadata +42 -6
- data/src/core/ext/transport/chttp2/transport/security_frame.cc +0 -31
- data/src/core/handshaker/security/legacy_secure_endpoint.cc +0 -597
|
@@ -23,8 +23,10 @@
|
|
|
23
23
|
#include <stdint.h>
|
|
24
24
|
#include <time.h>
|
|
25
25
|
|
|
26
|
-
#include <
|
|
26
|
+
#include <memory>
|
|
27
|
+
#include <optional>
|
|
27
28
|
#include <utility>
|
|
29
|
+
#include <variant>
|
|
28
30
|
#include <vector>
|
|
29
31
|
|
|
30
32
|
#include "src/core/credentials/transport/tls/spiffe_utils.h"
|
|
@@ -33,13 +35,12 @@
|
|
|
33
35
|
#include "src/core/lib/iomgr/error.h"
|
|
34
36
|
#include "src/core/lib/iomgr/exec_ctx.h"
|
|
35
37
|
#include "src/core/lib/slice/slice.h"
|
|
36
|
-
#include "src/core/lib/slice/slice_internal.h"
|
|
37
38
|
#include "src/core/tsi/ssl_transport_security_utils.h"
|
|
39
|
+
#include "src/core/util/down_cast.h"
|
|
38
40
|
#include "src/core/util/grpc_check.h"
|
|
39
41
|
#include "src/core/util/load_file.h"
|
|
40
42
|
#include "src/core/util/match.h"
|
|
41
43
|
#include "src/core/util/stat.h"
|
|
42
|
-
#include "src/core/util/status_helper.h"
|
|
43
44
|
#include "absl/log/log.h"
|
|
44
45
|
#include "absl/status/status.h"
|
|
45
46
|
#include "absl/strings/string_view.h"
|
|
@@ -47,14 +48,14 @@
|
|
|
47
48
|
namespace grpc_core {
|
|
48
49
|
namespace {
|
|
49
50
|
|
|
50
|
-
absl::Status ValidateRootCertificates(const RootCertInfo* root_cert_info) {
|
|
51
|
+
absl::Status ValidateRootCertificates(const tsi::RootCertInfo* root_cert_info) {
|
|
51
52
|
if (root_cert_info == nullptr) return absl::OkStatus();
|
|
52
53
|
return Match(
|
|
53
54
|
*root_cert_info,
|
|
54
55
|
[&](const std::string& root_certificates) {
|
|
55
56
|
if (root_certificates.empty()) return absl::OkStatus();
|
|
56
57
|
absl::StatusOr<std::vector<X509*>> parsed_roots =
|
|
57
|
-
ParsePemCertificateChain(root_certificates);
|
|
58
|
+
tsi::ParsePemCertificateChain(root_certificates);
|
|
58
59
|
if (!parsed_roots.ok()) {
|
|
59
60
|
return absl::Status(
|
|
60
61
|
parsed_roots.status().code(),
|
|
@@ -74,11 +75,13 @@ absl::Status ValidateRootCertificates(const RootCertInfo* root_cert_info) {
|
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
absl::Status ValidatePemKeyCertPair(absl::string_view cert_chain,
|
|
77
|
-
|
|
78
|
-
if (cert_chain.empty() && private_key
|
|
78
|
+
const PrivateKey& private_key) {
|
|
79
|
+
if (cert_chain.empty() && IsPrivateKeyEmpty(private_key)) {
|
|
80
|
+
return absl::OkStatus();
|
|
81
|
+
}
|
|
79
82
|
// Check that the cert chain consists of valid PEM blocks.
|
|
80
83
|
absl::StatusOr<std::vector<X509*>> parsed_certs =
|
|
81
|
-
ParsePemCertificateChain(cert_chain);
|
|
84
|
+
tsi::ParsePemCertificateChain(cert_chain);
|
|
82
85
|
if (!parsed_certs.ok()) {
|
|
83
86
|
return absl::Status(
|
|
84
87
|
parsed_certs.status().code(),
|
|
@@ -88,9 +91,12 @@ absl::Status ValidatePemKeyCertPair(absl::string_view cert_chain,
|
|
|
88
91
|
for (X509* x509 : *parsed_certs) {
|
|
89
92
|
X509_free(x509);
|
|
90
93
|
}
|
|
94
|
+
const std::string* private_key_string =
|
|
95
|
+
std::get_if<std::string>(&private_key);
|
|
96
|
+
if (private_key_string == nullptr) return absl::OkStatus();
|
|
91
97
|
// Check that the private key consists of valid PEM blocks.
|
|
92
98
|
absl::StatusOr<EVP_PKEY*> parsed_private_key =
|
|
93
|
-
ParsePemPrivateKey(
|
|
99
|
+
tsi::ParsePemPrivateKey(*private_key_string);
|
|
94
100
|
if (!parsed_private_key.ok()) {
|
|
95
101
|
return absl::Status(parsed_private_key.status().code(),
|
|
96
102
|
absl::StrCat("Failed to parse private key as PEM: ",
|
|
@@ -101,8 +107,8 @@ absl::Status ValidatePemKeyCertPair(absl::string_view cert_chain,
|
|
|
101
107
|
}
|
|
102
108
|
|
|
103
109
|
bool HasRootCertInfoChanged(
|
|
104
|
-
const absl::StatusOr<std::shared_ptr<RootCertInfo>>& old,
|
|
105
|
-
const absl::StatusOr<std::shared_ptr<RootCertInfo>>& updated) {
|
|
110
|
+
const absl::StatusOr<std::shared_ptr<tsi::RootCertInfo>>& old,
|
|
111
|
+
const absl::StatusOr<std::shared_ptr<tsi::RootCertInfo>>& updated) {
|
|
106
112
|
if (old.status() != updated.status()) return true; // Status changed.
|
|
107
113
|
if (!old.ok()) return false; // Both have same non-OK status.
|
|
108
114
|
// Both have OK status.
|
|
@@ -112,84 +118,6 @@ bool HasRootCertInfoChanged(
|
|
|
112
118
|
return **old != **updated;
|
|
113
119
|
}
|
|
114
120
|
|
|
115
|
-
} // namespace
|
|
116
|
-
|
|
117
|
-
StaticDataCertificateProvider::StaticDataCertificateProvider(
|
|
118
|
-
std::string root_certificate, PemKeyCertPairList pem_key_cert_pairs)
|
|
119
|
-
: distributor_(MakeRefCounted<grpc_tls_certificate_distributor>()),
|
|
120
|
-
root_cert_info_(std::make_shared<RootCertInfo>(root_certificate)),
|
|
121
|
-
pem_key_cert_pairs_(std::move(pem_key_cert_pairs)) {
|
|
122
|
-
distributor_->SetWatchStatusCallback([this](std::string cert_name,
|
|
123
|
-
bool root_being_watched,
|
|
124
|
-
bool identity_being_watched) {
|
|
125
|
-
MutexLock lock(&mu_);
|
|
126
|
-
std::shared_ptr<RootCertInfo> root_cert_info;
|
|
127
|
-
std::optional<PemKeyCertPairList> pem_key_cert_pairs;
|
|
128
|
-
StaticDataCertificateProvider::WatcherInfo& info = watcher_info_[cert_name];
|
|
129
|
-
if (!info.root_being_watched && root_being_watched &&
|
|
130
|
-
!IsRootCertInfoEmpty(root_cert_info_.get())) {
|
|
131
|
-
root_cert_info = root_cert_info_;
|
|
132
|
-
}
|
|
133
|
-
info.root_being_watched = root_being_watched;
|
|
134
|
-
if (!info.identity_being_watched && identity_being_watched &&
|
|
135
|
-
!pem_key_cert_pairs_.empty()) {
|
|
136
|
-
pem_key_cert_pairs = pem_key_cert_pairs_;
|
|
137
|
-
}
|
|
138
|
-
info.identity_being_watched = identity_being_watched;
|
|
139
|
-
if (!info.root_being_watched && !info.identity_being_watched) {
|
|
140
|
-
watcher_info_.erase(cert_name);
|
|
141
|
-
}
|
|
142
|
-
const bool root_has_update = root_cert_info != nullptr;
|
|
143
|
-
const bool identity_has_update = pem_key_cert_pairs.has_value();
|
|
144
|
-
if (root_has_update || identity_has_update) {
|
|
145
|
-
distributor_->SetKeyMaterials(cert_name, std::move(root_cert_info),
|
|
146
|
-
std::move(pem_key_cert_pairs));
|
|
147
|
-
}
|
|
148
|
-
grpc_error_handle root_cert_error;
|
|
149
|
-
grpc_error_handle identity_cert_error;
|
|
150
|
-
if (root_being_watched && !root_has_update) {
|
|
151
|
-
root_cert_error =
|
|
152
|
-
GRPC_ERROR_CREATE("Unable to get latest root certificates.");
|
|
153
|
-
}
|
|
154
|
-
if (identity_being_watched && !identity_has_update) {
|
|
155
|
-
identity_cert_error =
|
|
156
|
-
GRPC_ERROR_CREATE("Unable to get latest identity certificates.");
|
|
157
|
-
}
|
|
158
|
-
if (!root_cert_error.ok() || !identity_cert_error.ok()) {
|
|
159
|
-
distributor_->SetErrorForCert(cert_name, root_cert_error,
|
|
160
|
-
identity_cert_error);
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
StaticDataCertificateProvider::~StaticDataCertificateProvider() {
|
|
166
|
-
// Reset distributor's callback to make sure the callback won't be invoked
|
|
167
|
-
// again after this object(provider) is destroyed.
|
|
168
|
-
distributor_->SetWatchStatusCallback(nullptr);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
UniqueTypeName StaticDataCertificateProvider::type() const {
|
|
172
|
-
static UniqueTypeName::Factory kFactory("StaticData");
|
|
173
|
-
return kFactory.Create();
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
absl::Status StaticDataCertificateProvider::ValidateCredentials() const {
|
|
177
|
-
absl::Status status = ValidateRootCertificates(root_cert_info_.get());
|
|
178
|
-
if (!status.ok()) {
|
|
179
|
-
return status;
|
|
180
|
-
}
|
|
181
|
-
for (const PemKeyCertPair& pair : pem_key_cert_pairs_) {
|
|
182
|
-
absl::Status status =
|
|
183
|
-
ValidatePemKeyCertPair(pair.cert_chain(), pair.private_key());
|
|
184
|
-
if (!status.ok()) {
|
|
185
|
-
return status;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
return absl::OkStatus();
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
namespace {
|
|
192
|
-
|
|
193
121
|
gpr_timespec TimeoutSecondsToDeadline(int64_t seconds) {
|
|
194
122
|
return gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
|
|
195
123
|
gpr_time_from_seconds(seconds, GPR_TIMESPAN));
|
|
@@ -244,7 +172,7 @@ FileWatcherCertificateProvider::FileWatcherCertificateProvider(
|
|
|
244
172
|
bool root_being_watched,
|
|
245
173
|
bool identity_being_watched) {
|
|
246
174
|
MutexLock lock(&mu_);
|
|
247
|
-
absl::StatusOr<std::shared_ptr<RootCertInfo>> roots = nullptr;
|
|
175
|
+
absl::StatusOr<std::shared_ptr<tsi::RootCertInfo>> roots = nullptr;
|
|
248
176
|
std::optional<PemKeyCertPairList> pem_key_cert_pairs;
|
|
249
177
|
FileWatcherCertificateProvider::WatcherInfo& info =
|
|
250
178
|
watcher_info_[cert_name];
|
|
@@ -316,12 +244,12 @@ absl::Status FileWatcherCertificateProvider::ValidateCredentials() const {
|
|
|
316
244
|
}
|
|
317
245
|
|
|
318
246
|
void FileWatcherCertificateProvider::ForceUpdate() {
|
|
319
|
-
absl::StatusOr<std::shared_ptr<RootCertInfo>> root_cert_info = nullptr;
|
|
247
|
+
absl::StatusOr<std::shared_ptr<tsi::RootCertInfo>> root_cert_info = nullptr;
|
|
320
248
|
std::optional<PemKeyCertPairList> pem_key_cert_pairs;
|
|
321
249
|
if (!spiffe_bundle_map_path_.empty()) {
|
|
322
250
|
auto map = SpiffeBundleMap::FromFile(spiffe_bundle_map_path_);
|
|
323
251
|
if (map.ok()) {
|
|
324
|
-
root_cert_info = std::make_shared<RootCertInfo>(std::move(*map));
|
|
252
|
+
root_cert_info = std::make_shared<tsi::RootCertInfo>(std::move(*map));
|
|
325
253
|
} else {
|
|
326
254
|
root_cert_info = absl::InvalidArgumentError(
|
|
327
255
|
absl::StrFormat("spiffe bundle map file %s failed to load: %s",
|
|
@@ -332,7 +260,7 @@ void FileWatcherCertificateProvider::ForceUpdate() {
|
|
|
332
260
|
ReadRootCertificatesFromFile(root_cert_path_);
|
|
333
261
|
if (root_certificate.has_value()) {
|
|
334
262
|
root_cert_info =
|
|
335
|
-
std::make_shared<RootCertInfo>(std::move(*root_certificate));
|
|
263
|
+
std::make_shared<tsi::RootCertInfo>(std::move(*root_certificate));
|
|
336
264
|
}
|
|
337
265
|
}
|
|
338
266
|
if (!private_key_path_.empty()) {
|
|
@@ -365,7 +293,7 @@ void FileWatcherCertificateProvider::ForceUpdate() {
|
|
|
365
293
|
for (const auto& p : watcher_info_) {
|
|
366
294
|
const std::string& cert_name = p.first;
|
|
367
295
|
const WatcherInfo& info = p.second;
|
|
368
|
-
std::shared_ptr<RootCertInfo> root_to_report;
|
|
296
|
+
std::shared_ptr<tsi::RootCertInfo> root_to_report;
|
|
369
297
|
std::optional<PemKeyCertPairList> identity_to_report;
|
|
370
298
|
// Set key materials to the distributor if their contents changed.
|
|
371
299
|
if (info.root_being_watched && root_changed) {
|
|
@@ -488,27 +416,140 @@ int64_t FileWatcherCertificateProvider::TestOnlyGetRefreshIntervalSecond()
|
|
|
488
416
|
return refresh_interval_sec_;
|
|
489
417
|
}
|
|
490
418
|
|
|
491
|
-
|
|
419
|
+
InMemoryCertificateProvider::InMemoryCertificateProvider()
|
|
420
|
+
: distributor_(MakeRefCounted<grpc_tls_certificate_distributor>()) {
|
|
421
|
+
distributor_->SetWatchStatusCallback([this](std::string cert_name,
|
|
422
|
+
bool root_being_watched,
|
|
423
|
+
bool identity_being_watched) {
|
|
424
|
+
MutexLock lock(&mu_);
|
|
425
|
+
std::shared_ptr<tsi::RootCertInfo> roots;
|
|
426
|
+
std::optional<PemKeyCertPairList> pem_key_cert_pairs;
|
|
427
|
+
WatcherInfo& info = watcher_info_[cert_name];
|
|
428
|
+
if (!info.root_being_watched && root_being_watched &&
|
|
429
|
+
root_certificates_.ok() && *root_certificates_ != nullptr) {
|
|
430
|
+
roots = *root_certificates_;
|
|
431
|
+
}
|
|
432
|
+
info.root_being_watched = root_being_watched;
|
|
433
|
+
if (!info.identity_being_watched && identity_being_watched &&
|
|
434
|
+
!pem_key_cert_pairs_.empty()) {
|
|
435
|
+
pem_key_cert_pairs = pem_key_cert_pairs_;
|
|
436
|
+
}
|
|
437
|
+
info.identity_being_watched = identity_being_watched;
|
|
438
|
+
if (!info.root_being_watched && !info.identity_being_watched) {
|
|
439
|
+
watcher_info_.erase(cert_name);
|
|
440
|
+
}
|
|
441
|
+
if (roots != nullptr || pem_key_cert_pairs.has_value()) {
|
|
442
|
+
distributor_->SetKeyMaterials(cert_name, roots, pem_key_cert_pairs);
|
|
443
|
+
}
|
|
444
|
+
grpc_error_handle root_cert_error;
|
|
445
|
+
grpc_error_handle identity_cert_error;
|
|
446
|
+
if (root_being_watched && roots == nullptr) {
|
|
447
|
+
root_cert_error =
|
|
448
|
+
GRPC_ERROR_CREATE("Unable to get latest root certificates.");
|
|
449
|
+
}
|
|
450
|
+
if (identity_being_watched && !pem_key_cert_pairs.has_value()) {
|
|
451
|
+
identity_cert_error =
|
|
452
|
+
GRPC_ERROR_CREATE("Unable to get latest identity certificates.");
|
|
453
|
+
}
|
|
454
|
+
if (!root_cert_error.ok() || !identity_cert_error.ok()) {
|
|
455
|
+
distributor_->SetErrorForCert(cert_name, root_cert_error,
|
|
456
|
+
identity_cert_error);
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
}
|
|
492
460
|
|
|
493
|
-
|
|
461
|
+
absl::Status InMemoryCertificateProvider::Update(
|
|
462
|
+
std::optional<std::shared_ptr<tsi::RootCertInfo>> root_cert_info,
|
|
463
|
+
std::optional<const PemKeyCertPairList> pem_key_cert_pairs) {
|
|
464
|
+
MutexLock lock(&mu_);
|
|
465
|
+
const bool root_changed =
|
|
466
|
+
root_cert_info.has_value() &&
|
|
467
|
+
HasRootCertInfoChanged(root_certificates_, *root_cert_info);
|
|
468
|
+
if (root_changed) {
|
|
469
|
+
root_certificates_ = std::move(*root_cert_info);
|
|
470
|
+
}
|
|
471
|
+
const bool identity_cert_changed = pem_key_cert_pairs.has_value() &&
|
|
472
|
+
pem_key_cert_pairs_ != pem_key_cert_pairs;
|
|
473
|
+
if (identity_cert_changed) {
|
|
474
|
+
pem_key_cert_pairs_ = *pem_key_cert_pairs;
|
|
475
|
+
}
|
|
476
|
+
if (root_changed || identity_cert_changed) {
|
|
477
|
+
grpc_error_handle root_cert_error =
|
|
478
|
+
GRPC_ERROR_CREATE("Unable to get latest root certificates.");
|
|
479
|
+
grpc_error_handle identity_cert_error =
|
|
480
|
+
GRPC_ERROR_CREATE("Unable to get latest identity certificates.");
|
|
481
|
+
for (const auto& p : watcher_info_) {
|
|
482
|
+
const std::string& cert_name = p.first;
|
|
483
|
+
const WatcherInfo& info = p.second;
|
|
484
|
+
std::shared_ptr<tsi::RootCertInfo> root_to_report;
|
|
485
|
+
std::optional<PemKeyCertPairList> identity_to_report;
|
|
486
|
+
// Set key materials to the distributor if their contents changed.
|
|
487
|
+
if (info.root_being_watched && root_changed) {
|
|
488
|
+
root_to_report =
|
|
489
|
+
root_certificates_.ok() ? *root_certificates_ : nullptr;
|
|
490
|
+
}
|
|
491
|
+
if (info.identity_being_watched && !pem_key_cert_pairs_.empty() &&
|
|
492
|
+
identity_cert_changed) {
|
|
493
|
+
identity_to_report = pem_key_cert_pairs_;
|
|
494
|
+
}
|
|
495
|
+
if (root_to_report != nullptr || identity_to_report.has_value()) {
|
|
496
|
+
distributor_->SetKeyMaterials(cert_name, std::move(root_to_report),
|
|
497
|
+
std::move(identity_to_report));
|
|
498
|
+
}
|
|
499
|
+
// Report errors to the distributor if the contents are empty.
|
|
500
|
+
const bool report_root_error =
|
|
501
|
+
info.root_being_watched &&
|
|
502
|
+
(!root_certificates_.ok() || *root_certificates_ == nullptr);
|
|
503
|
+
const bool report_identity_error =
|
|
504
|
+
info.identity_being_watched && pem_key_cert_pairs_.empty();
|
|
505
|
+
if (report_root_error || report_identity_error) {
|
|
506
|
+
distributor_->SetErrorForCert(
|
|
507
|
+
cert_name, report_root_error ? root_cert_error : absl::OkStatus(),
|
|
508
|
+
report_identity_error ? identity_cert_error : absl::OkStatus());
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
return absl::OkStatus();
|
|
513
|
+
}
|
|
494
514
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
grpc_core::PemKeyCertPairList identity_pairs_core;
|
|
500
|
-
if (pem_key_cert_pairs != nullptr) {
|
|
501
|
-
identity_pairs_core = std::move(pem_key_cert_pairs->pem_key_cert_pairs);
|
|
502
|
-
delete pem_key_cert_pairs;
|
|
515
|
+
absl::Status InMemoryCertificateProvider::ValidateCredentials() const {
|
|
516
|
+
MutexLock lock(&mu_);
|
|
517
|
+
if (!root_certificates_.ok()) {
|
|
518
|
+
return root_certificates_.status();
|
|
503
519
|
}
|
|
504
|
-
|
|
505
|
-
if (
|
|
506
|
-
|
|
520
|
+
absl::Status status = ValidateRootCertificates(root_certificates_->get());
|
|
521
|
+
if (!status.ok()) {
|
|
522
|
+
return status;
|
|
523
|
+
}
|
|
524
|
+
for (const PemKeyCertPair& pair : pem_key_cert_pairs_) {
|
|
525
|
+
absl::Status status =
|
|
526
|
+
ValidatePemKeyCertPair(pair.cert_chain(), pair.private_key());
|
|
527
|
+
if (!status.ok()) {
|
|
528
|
+
return status;
|
|
529
|
+
}
|
|
507
530
|
}
|
|
508
|
-
return
|
|
509
|
-
std::move(root_cert_core), std::move(identity_pairs_core));
|
|
531
|
+
return absl::OkStatus();
|
|
510
532
|
}
|
|
511
533
|
|
|
534
|
+
absl::Status InMemoryCertificateProvider::UpdateRoot(
|
|
535
|
+
std::shared_ptr<tsi::RootCertInfo> root_certificates) {
|
|
536
|
+
return Update(root_certificates, std::nullopt);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
absl::Status InMemoryCertificateProvider::UpdateIdentityKeyCertPair(
|
|
540
|
+
const PemKeyCertPairList& pem_key_cert_pairs) {
|
|
541
|
+
return Update(std::nullopt, pem_key_cert_pairs);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
UniqueTypeName InMemoryCertificateProvider::type() const {
|
|
545
|
+
static UniqueTypeName::Factory kFactory("InMemory");
|
|
546
|
+
return kFactory.Create();
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
} // namespace grpc_core
|
|
550
|
+
|
|
551
|
+
/// -- Wrapper APIs declared in grpc_security.h -- *
|
|
552
|
+
|
|
512
553
|
grpc_tls_certificate_provider*
|
|
513
554
|
grpc_tls_certificate_provider_file_watcher_create(
|
|
514
555
|
const char* private_key_path, const char* identity_certificate_path,
|
|
@@ -523,6 +564,37 @@ grpc_tls_certificate_provider_file_watcher_create(
|
|
|
523
564
|
refresh_interval_sec);
|
|
524
565
|
}
|
|
525
566
|
|
|
567
|
+
grpc_tls_certificate_provider*
|
|
568
|
+
grpc_tls_certificate_provider_in_memory_create() {
|
|
569
|
+
grpc_core::ExecCtx exec_ctx;
|
|
570
|
+
return new grpc_core::InMemoryCertificateProvider();
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
bool grpc_tls_certificate_provider_in_memory_set_root_certificate(
|
|
574
|
+
grpc_tls_certificate_provider* provider, const char* root_cert) {
|
|
575
|
+
grpc_core::ExecCtx exec_ctx;
|
|
576
|
+
auto in_memory_provider =
|
|
577
|
+
grpc_core::DownCast<grpc_core::InMemoryCertificateProvider*>(provider);
|
|
578
|
+
return in_memory_provider
|
|
579
|
+
->UpdateRoot(std::make_shared<tsi::RootCertInfo>(root_cert))
|
|
580
|
+
.ok();
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
bool grpc_tls_certificate_provider_in_memory_set_identity_certificate(
|
|
584
|
+
grpc_tls_certificate_provider* provider,
|
|
585
|
+
grpc_tls_identity_pairs* pem_key_cert_pairs) {
|
|
586
|
+
grpc_core::ExecCtx exec_ctx;
|
|
587
|
+
grpc_core::PemKeyCertPairList identity_pairs_core;
|
|
588
|
+
if (pem_key_cert_pairs != nullptr) {
|
|
589
|
+
identity_pairs_core = std::move(pem_key_cert_pairs->pem_key_cert_pairs);
|
|
590
|
+
delete pem_key_cert_pairs;
|
|
591
|
+
}
|
|
592
|
+
auto in_memory_provider =
|
|
593
|
+
grpc_core::DownCast<grpc_core::InMemoryCertificateProvider*>(provider);
|
|
594
|
+
return in_memory_provider->UpdateIdentityKeyCertPair(identity_pairs_core)
|
|
595
|
+
.ok();
|
|
596
|
+
}
|
|
597
|
+
|
|
526
598
|
void grpc_tls_certificate_provider_release(
|
|
527
599
|
grpc_tls_certificate_provider* provider) {
|
|
528
600
|
GRPC_TRACE_LOG(api, INFO)
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
#include <string>
|
|
28
28
|
|
|
29
29
|
#include "src/core/credentials/transport/tls/grpc_tls_certificate_distributor.h"
|
|
30
|
-
#include "src/core/credentials/transport/tls/spiffe_utils.h"
|
|
31
30
|
#include "src/core/credentials/transport/tls/ssl_utils.h"
|
|
32
31
|
#include "src/core/util/grpc_check.h"
|
|
33
32
|
#include "src/core/util/ref_counted.h"
|
|
@@ -91,46 +90,6 @@ struct grpc_tls_certificate_provider
|
|
|
91
90
|
|
|
92
91
|
namespace grpc_core {
|
|
93
92
|
|
|
94
|
-
// A basic provider class that will get credentials from string during
|
|
95
|
-
// initialization.
|
|
96
|
-
class StaticDataCertificateProvider final
|
|
97
|
-
: public grpc_tls_certificate_provider {
|
|
98
|
-
public:
|
|
99
|
-
StaticDataCertificateProvider(std::string root_certificate,
|
|
100
|
-
PemKeyCertPairList pem_key_cert_pairs);
|
|
101
|
-
|
|
102
|
-
~StaticDataCertificateProvider() override;
|
|
103
|
-
|
|
104
|
-
RefCountedPtr<grpc_tls_certificate_distributor> distributor() const override {
|
|
105
|
-
return distributor_;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
UniqueTypeName type() const override;
|
|
109
|
-
|
|
110
|
-
absl::Status ValidateCredentials() const;
|
|
111
|
-
|
|
112
|
-
private:
|
|
113
|
-
struct WatcherInfo {
|
|
114
|
-
bool root_being_watched = false;
|
|
115
|
-
bool identity_being_watched = false;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
int CompareImpl(const grpc_tls_certificate_provider* other) const override {
|
|
119
|
-
// TODO(yashykt): Maybe do something better here.
|
|
120
|
-
return QsortCompare(static_cast<const grpc_tls_certificate_provider*>(this),
|
|
121
|
-
other);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
|
|
125
|
-
std::shared_ptr<RootCertInfo> root_cert_info_;
|
|
126
|
-
PemKeyCertPairList pem_key_cert_pairs_;
|
|
127
|
-
// Guards members below.
|
|
128
|
-
Mutex mu_;
|
|
129
|
-
// Stores each cert_name we get from the distributor callback and its watcher
|
|
130
|
-
// information.
|
|
131
|
-
std::map<std::string, WatcherInfo> watcher_info_;
|
|
132
|
-
};
|
|
133
|
-
|
|
134
93
|
// A provider class that will watch the credential changes on the file system.
|
|
135
94
|
class FileWatcherCertificateProvider final
|
|
136
95
|
: public grpc_tls_certificate_provider {
|
|
@@ -201,13 +160,67 @@ class FileWatcherCertificateProvider final
|
|
|
201
160
|
// - Otherwise, holds either a SpiffeBundleMap or a string root cert
|
|
202
161
|
// TODO(gtcooke94) - refactor the handling for string root cert files such
|
|
203
162
|
// that their failure is a non-ok status rather than a nullptr
|
|
204
|
-
absl::StatusOr<std::shared_ptr<RootCertInfo>> root_cert_info_
|
|
163
|
+
absl::StatusOr<std::shared_ptr<tsi::RootCertInfo>> root_cert_info_
|
|
205
164
|
ABSL_GUARDED_BY(mu_) = nullptr;
|
|
206
165
|
// Stores each cert_name we get from the distributor callback and its watcher
|
|
207
166
|
// information.
|
|
208
167
|
std::map<std::string, WatcherInfo> watcher_info_ ABSL_GUARDED_BY(mu_);
|
|
209
168
|
};
|
|
210
169
|
|
|
170
|
+
// Implements a provider that uses in-memory data that can be modified in a
|
|
171
|
+
// thread-safe manner.
|
|
172
|
+
class InMemoryCertificateProvider final : public grpc_tls_certificate_provider {
|
|
173
|
+
public:
|
|
174
|
+
InMemoryCertificateProvider();
|
|
175
|
+
InMemoryCertificateProvider(const InMemoryCertificateProvider&) = delete;
|
|
176
|
+
InMemoryCertificateProvider(InMemoryCertificateProvider&&) = delete;
|
|
177
|
+
InMemoryCertificateProvider& operator=(const InMemoryCertificateProvider&) =
|
|
178
|
+
delete;
|
|
179
|
+
InMemoryCertificateProvider& operator=(InMemoryCertificateProvider&&) =
|
|
180
|
+
delete;
|
|
181
|
+
|
|
182
|
+
RefCountedPtr<grpc_tls_certificate_distributor> distributor() const override {
|
|
183
|
+
return distributor_;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
UniqueTypeName type() const override;
|
|
187
|
+
absl::Status ValidateCredentials() const;
|
|
188
|
+
|
|
189
|
+
// Update the certificate information for this provider.
|
|
190
|
+
// Users should verify the status retuned to confirm that the update was
|
|
191
|
+
// successful.
|
|
192
|
+
absl::Status UpdateRoot(std::shared_ptr<tsi::RootCertInfo> root_certificates);
|
|
193
|
+
absl::Status UpdateIdentityKeyCertPair(
|
|
194
|
+
const PemKeyCertPairList& pem_key_cert_pairs);
|
|
195
|
+
|
|
196
|
+
private:
|
|
197
|
+
struct WatcherInfo {
|
|
198
|
+
bool root_being_watched = false;
|
|
199
|
+
bool identity_being_watched = false;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
int CompareImpl(const grpc_tls_certificate_provider* other) const override {
|
|
203
|
+
return QsortCompare(static_cast<const grpc_tls_certificate_provider*>(this),
|
|
204
|
+
other);
|
|
205
|
+
}
|
|
206
|
+
absl::Status Update(
|
|
207
|
+
std::optional<std::shared_ptr<tsi::RootCertInfo>> root_cert_info,
|
|
208
|
+
std::optional<const PemKeyCertPairList> pem_key_cert_pairs);
|
|
209
|
+
|
|
210
|
+
RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
|
|
211
|
+
|
|
212
|
+
// Guards pem_key_cert_pairs_, root_certificates_ and watcher_info_.
|
|
213
|
+
mutable Mutex mu_;
|
|
214
|
+
// The most-recent credential data. It will be empty if the most recent read
|
|
215
|
+
// attempt failed.
|
|
216
|
+
PemKeyCertPairList pem_key_cert_pairs_ ABSL_GUARDED_BY(mu_);
|
|
217
|
+
absl::StatusOr<std::shared_ptr<tsi::RootCertInfo>> root_certificates_
|
|
218
|
+
ABSL_GUARDED_BY(mu_);
|
|
219
|
+
// Stores each cert_name we get from the distributor callback and its watcher
|
|
220
|
+
// information.
|
|
221
|
+
std::map<std::string, WatcherInfo> watcher_info_ ABSL_GUARDED_BY(mu_);
|
|
222
|
+
};
|
|
223
|
+
|
|
211
224
|
// Checks if the private key matches the certificate's public key.
|
|
212
225
|
// Returns a not-OK status on failure, or a bool indicating
|
|
213
226
|
// whether the key/cert pair matches.
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
#include "src/core/util/grpc_check.h"
|
|
31
31
|
#include "absl/log/log.h"
|
|
32
32
|
|
|
33
|
-
/// -- Wrapper APIs declared in
|
|
33
|
+
/// -- Wrapper APIs declared in credentials.h -- *
|
|
34
34
|
|
|
35
35
|
grpc_tls_credentials_options* grpc_tls_credentials_options_create() {
|
|
36
36
|
grpc_core::ExecCtx exec_ctx;
|
|
@@ -61,34 +61,12 @@ void grpc_tls_credentials_options_set_verify_server_cert(
|
|
|
61
61
|
options->set_verify_server_cert(verify_server_cert);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
void grpc_tls_credentials_options_set_certificate_provider(
|
|
65
|
-
grpc_tls_credentials_options* options,
|
|
66
|
-
grpc_tls_certificate_provider* provider) {
|
|
67
|
-
GRPC_CHECK_NE(options, nullptr);
|
|
68
|
-
GRPC_CHECK_NE(provider, nullptr);
|
|
69
|
-
grpc_core::ExecCtx exec_ctx;
|
|
70
|
-
options->set_certificate_provider(
|
|
71
|
-
provider->Ref(DEBUG_LOCATION, "set_certificate_provider"));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
void grpc_tls_credentials_options_watch_root_certs(
|
|
75
|
-
grpc_tls_credentials_options* options) {
|
|
76
|
-
GRPC_CHECK_NE(options, nullptr);
|
|
77
|
-
options->set_watch_root_cert(true);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
64
|
void grpc_tls_credentials_options_set_root_cert_name(
|
|
81
65
|
grpc_tls_credentials_options* options, const char* root_cert_name) {
|
|
82
66
|
GRPC_CHECK_NE(options, nullptr);
|
|
83
67
|
options->set_root_cert_name(root_cert_name);
|
|
84
68
|
}
|
|
85
69
|
|
|
86
|
-
void grpc_tls_credentials_options_watch_identity_key_cert_pairs(
|
|
87
|
-
grpc_tls_credentials_options* options) {
|
|
88
|
-
GRPC_CHECK_NE(options, nullptr);
|
|
89
|
-
options->set_watch_identity_pair(true);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
70
|
void grpc_tls_credentials_options_set_identity_cert_name(
|
|
93
71
|
grpc_tls_credentials_options* options, const char* identity_cert_name) {
|
|
94
72
|
GRPC_CHECK_NE(options, nullptr);
|
|
@@ -159,3 +137,30 @@ void grpc_tls_credentials_options_set_max_tls_version(
|
|
|
159
137
|
GRPC_CHECK_NE(options, nullptr);
|
|
160
138
|
options->set_max_tls_version(max_tls_version);
|
|
161
139
|
}
|
|
140
|
+
|
|
141
|
+
void grpc_tls_credentials_options_set_identity_certificate_provider(
|
|
142
|
+
grpc_tls_credentials_options* options,
|
|
143
|
+
grpc_tls_certificate_provider* provider) {
|
|
144
|
+
GRPC_CHECK_NE(options, nullptr);
|
|
145
|
+
GRPC_CHECK_NE(provider, nullptr);
|
|
146
|
+
grpc_core::ExecCtx exec_ctx;
|
|
147
|
+
options->set_identity_certificate_provider(
|
|
148
|
+
provider->Ref(DEBUG_LOCATION, "set_identity_certificate_provider"));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
void grpc_tls_credentials_options_set_root_certificate_provider(
|
|
152
|
+
grpc_tls_credentials_options* options,
|
|
153
|
+
grpc_tls_certificate_provider* provider) {
|
|
154
|
+
GRPC_CHECK_NE(options, nullptr);
|
|
155
|
+
GRPC_CHECK_NE(provider, nullptr);
|
|
156
|
+
grpc_core::ExecCtx exec_ctx;
|
|
157
|
+
options->set_root_certificate_provider(
|
|
158
|
+
provider->Ref(DEBUG_LOCATION, "set_root_certificate_provider"));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
GRPCAPI void grpc_tls_credentials_options_set_sni_override(
|
|
162
|
+
grpc_tls_credentials_options* options,
|
|
163
|
+
std::optional<std::string> sni_override) {
|
|
164
|
+
GRPC_CHECK_NE(options, nullptr);
|
|
165
|
+
options->set_sni_override(sni_override);
|
|
166
|
+
}
|