grpc 1.78.0 → 1.80.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.
Files changed (431) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +22 -8
  3. data/include/grpc/credentials.h +47 -37
  4. data/include/grpc/credentials_cpp.h +39 -0
  5. data/include/grpc/event_engine/event_engine.h +8 -3
  6. data/include/grpc/grpc.h +4 -0
  7. data/include/grpc/impl/call.h +9 -0
  8. data/include/grpc/impl/channel_arg_names.h +7 -0
  9. data/include/grpc/module.modulemap +2 -0
  10. data/include/grpc/private_key_signer.h +104 -0
  11. data/include/grpc/support/port_platform.h +6 -0
  12. data/src/core/call/call_filters.h +101 -78
  13. data/src/core/call/call_spine.h +91 -68
  14. data/src/core/call/call_state.h +60 -4
  15. data/src/core/call/client_call.cc +9 -9
  16. data/src/core/call/client_call.h +1 -1
  17. data/src/core/call/metadata_batch.cc +2 -0
  18. data/src/core/call/metadata_batch.h +48 -1
  19. data/src/core/call/metadata_info.cc +35 -0
  20. data/src/core/call/metadata_info.h +2 -0
  21. data/src/core/call/simple_slice_based_metadata.h +2 -1
  22. data/src/core/channelz/channelz.cc +9 -6
  23. data/src/core/channelz/channelz.h +7 -4
  24. data/src/core/channelz/property_list.h +5 -0
  25. data/src/core/channelz/v2tov1/convert.cc +1 -1
  26. data/src/core/channelz/v2tov1/legacy_api.cc +164 -307
  27. data/src/core/client_channel/buffered_call.cc +7 -3
  28. data/src/core/client_channel/buffered_call.h +11 -5
  29. data/src/core/client_channel/client_channel.cc +106 -44
  30. data/src/core/client_channel/client_channel.h +3 -6
  31. data/src/core/client_channel/client_channel_filter.cc +90 -64
  32. data/src/core/client_channel/client_channel_filter.h +3 -6
  33. data/src/core/client_channel/client_channel_internal.h +5 -0
  34. data/src/core/client_channel/config_selector.h +17 -12
  35. data/src/core/client_channel/dynamic_filters.cc +8 -7
  36. data/src/core/client_channel/dynamic_filters.h +7 -5
  37. data/src/core/client_channel/retry_filter.cc +1 -1
  38. data/src/core/client_channel/retry_filter.h +2 -2
  39. data/src/core/client_channel/subchannel.cc +1682 -266
  40. data/src/core/client_channel/subchannel.h +411 -134
  41. data/src/core/client_channel/subchannel_stream_client.cc +22 -18
  42. data/src/core/client_channel/subchannel_stream_client.h +8 -9
  43. data/src/core/client_channel/subchannel_stream_limiter.cc +76 -0
  44. data/src/core/client_channel/subchannel_stream_limiter.h +51 -0
  45. data/src/core/config/config_vars.cc +9 -1
  46. data/src/core/config/config_vars.h +6 -0
  47. data/src/core/credentials/call/call_creds_registry.h +51 -22
  48. data/src/core/credentials/call/call_creds_registry_init.cc +86 -2
  49. data/src/core/credentials/call/external/aws_external_account_credentials.cc +2 -2
  50. data/src/core/credentials/call/external/external_account_credentials.cc +11 -4
  51. data/src/core/credentials/call/external/file_external_account_credentials.cc +2 -2
  52. data/src/core/credentials/transport/channel_creds_registry.h +71 -20
  53. data/src/core/credentials/transport/channel_creds_registry_init.cc +338 -29
  54. data/src/core/credentials/transport/ssl/ssl_credentials.cc +43 -24
  55. data/src/core/credentials/transport/ssl/ssl_credentials.h +7 -1
  56. data/src/core/credentials/transport/ssl/ssl_security_connector.cc +2 -8
  57. data/src/core/credentials/transport/ssl/ssl_security_connector.h +4 -3
  58. data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.cc +25 -5
  59. data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.h +7 -5
  60. data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc +181 -109
  61. data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.h +55 -42
  62. data/src/core/credentials/transport/tls/grpc_tls_credentials_options.cc +28 -23
  63. data/src/core/credentials/transport/tls/grpc_tls_credentials_options.h +26 -23
  64. data/src/core/credentials/transport/tls/spiffe_utils.cc +2 -2
  65. data/src/core/credentials/transport/tls/ssl_utils.cc +18 -18
  66. data/src/core/credentials/transport/tls/ssl_utils.h +12 -10
  67. data/src/core/credentials/transport/tls/tls_security_connector.cc +106 -74
  68. data/src/core/credentials/transport/tls/tls_security_connector.h +12 -8
  69. data/src/core/credentials/transport/xds/xds_credentials.cc +76 -32
  70. data/src/core/credentials/transport/xds/xds_credentials.h +4 -2
  71. data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +117 -35
  72. data/src/core/ext/filters/fault_injection/fault_injection_filter.h +42 -4
  73. data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +58 -29
  74. data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +19 -11
  75. data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +82 -25
  76. data/src/core/ext/filters/stateful_session/stateful_session_filter.h +28 -3
  77. data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc +9 -7
  78. data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +1 -1
  79. data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.h +7 -1
  80. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +117 -67
  81. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +2 -0
  82. data/src/core/ext/transport/chttp2/transport/flow_control.h +11 -1
  83. data/src/core/ext/transport/chttp2/transport/frame.cc +2 -15
  84. data/src/core/ext/transport/chttp2/transport/frame.h +0 -4
  85. data/src/core/ext/transport/chttp2/transport/goaway.cc +17 -2
  86. data/src/core/ext/transport/chttp2/transport/goaway.h +27 -6
  87. data/src/core/ext/transport/chttp2/transport/header_assembler.h +8 -21
  88. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +101 -40
  89. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +95 -0
  90. data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +923 -772
  91. data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +406 -423
  92. data/src/core/ext/transport/chttp2/transport/http2_settings.cc +1 -0
  93. data/src/core/ext/transport/chttp2/transport/http2_settings.h +8 -1
  94. data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +25 -13
  95. data/src/core/ext/transport/chttp2/transport/http2_transport.cc +71 -24
  96. data/src/core/ext/transport/chttp2/transport/http2_transport.h +25 -49
  97. data/src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h +2 -2
  98. data/src/core/ext/transport/chttp2/transport/incoming_metadata_tracker.h +29 -9
  99. data/src/core/ext/transport/chttp2/transport/internal.h +6 -2
  100. data/src/core/ext/transport/chttp2/transport/keepalive.cc +14 -20
  101. data/src/core/ext/transport/chttp2/transport/keepalive.h +9 -6
  102. data/src/core/ext/transport/chttp2/transport/parsing.cc +11 -0
  103. data/src/core/ext/transport/chttp2/transport/ping_promise.cc +34 -74
  104. data/src/core/ext/transport/chttp2/transport/ping_promise.h +123 -79
  105. data/src/core/ext/transport/chttp2/transport/security_frame.h +233 -3
  106. data/src/core/ext/transport/chttp2/transport/stream.h +152 -73
  107. data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +155 -85
  108. data/src/core/ext/transport/chttp2/transport/transport_common.h +0 -5
  109. data/src/core/ext/transport/chttp2/transport/writable_streams.h +8 -7
  110. data/src/core/ext/transport/chttp2/transport/write_cycle.cc +86 -0
  111. data/src/core/ext/transport/chttp2/transport/write_cycle.h +355 -0
  112. data/src/core/ext/transport/chttp2/transport/writing.cc +31 -29
  113. data/src/core/ext/upb-gen/cel/expr/checked.upb.h +1875 -0
  114. data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.c +409 -0
  115. data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.h +56 -0
  116. data/src/core/ext/upb-gen/cel/expr/syntax.upb.h +2223 -0
  117. data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.c +489 -0
  118. data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.h +60 -0
  119. data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb.h +2 -1
  120. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +130 -18
  121. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +18 -13
  122. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +70 -38
  123. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +20 -17
  124. data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb.h +26 -10
  125. data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c +8 -7
  126. data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb.h +495 -0
  127. data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.c +114 -0
  128. data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.h +36 -0
  129. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +26 -10
  130. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +8 -7
  131. data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb.h +121 -0
  132. data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.c +54 -0
  133. data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.h +32 -0
  134. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb.h +143 -9
  135. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c +18 -6
  136. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +112 -11
  137. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +22 -9
  138. data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb.h +276 -0
  139. data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.c +60 -5
  140. data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.h +4 -0
  141. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +72 -0
  142. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +23 -2
  143. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.h +2 -0
  144. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +129 -13
  145. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +36 -10
  146. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.h +2 -0
  147. data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +30 -0
  148. data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +5 -3
  149. data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb.h +16 -0
  150. data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c +4 -3
  151. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +31 -0
  152. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +5 -3
  153. data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb.h +2 -1
  154. data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +63 -0
  155. data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +12 -7
  156. data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb.h +97 -81
  157. data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c +40 -23
  158. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +604 -228
  159. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +146 -100
  160. data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb.h +30 -0
  161. data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c +5 -3
  162. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +35 -3
  163. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +7 -4
  164. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +66 -14
  165. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +22 -11
  166. data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +87 -0
  167. data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c +29 -2
  168. data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.h +2 -0
  169. data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +0 -1
  170. data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c +0 -1
  171. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +20 -4
  172. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +5 -4
  173. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +239 -60
  174. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +59 -28
  175. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.h +2 -0
  176. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb.h +89 -0
  177. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.c +50 -0
  178. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.h +32 -0
  179. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb.h +135 -0
  180. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.c +53 -0
  181. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.h +32 -0
  182. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb.h +105 -0
  183. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.c +51 -0
  184. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.h +32 -0
  185. 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
  186. 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
  187. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +206 -0
  188. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +41 -8
  189. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.h +2 -0
  190. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +64 -0
  191. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +4 -3
  192. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +64 -0
  193. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.c +31 -5
  194. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.h +2 -0
  195. data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb.h +283 -14
  196. data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c +48 -11
  197. data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.h +2 -0
  198. data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb.h +144 -6
  199. data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c +35 -7
  200. data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.h +2 -0
  201. data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb.h +42 -21
  202. data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c +9 -8
  203. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +164 -1
  204. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +37 -6
  205. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +2 -0
  206. data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb.h +0 -1
  207. data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c +0 -1
  208. data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb.h +0 -1
  209. data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.c +0 -1
  210. data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb.h +26 -11
  211. data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c +8 -8
  212. data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb.h +33 -0
  213. data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.c +14 -3
  214. data/src/core/ext/upb-gen/xds/type/v3/cel.upb.h +90 -10
  215. data/src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.c +18 -7
  216. data/src/core/ext/upbdefs-gen/cel/expr/checked.upbdefs.c +248 -0
  217. data/src/core/ext/upbdefs-gen/cel/expr/checked.upbdefs.h +97 -0
  218. data/src/core/ext/upbdefs-gen/cel/expr/syntax.upbdefs.c +283 -0
  219. data/src/core/ext/upbdefs-gen/cel/expr/syntax.upbdefs.h +107 -0
  220. data/src/core/ext/upbdefs-gen/envoy/config/accesslog/v3/accesslog.upbdefs.c +213 -211
  221. data/src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +635 -614
  222. data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.c +1012 -1000
  223. data/src/core/ext/upbdefs-gen/envoy/config/common/matcher/v3/matcher.upbdefs.c +276 -273
  224. data/src/core/ext/upbdefs-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upbdefs.c +152 -0
  225. data/src/core/ext/upbdefs-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upbdefs.h +47 -0
  226. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/address.upbdefs.c +149 -144
  227. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.c +367 -370
  228. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/cel.upbdefs.c +63 -0
  229. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/cel.upbdefs.h +37 -0
  230. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/grpc_service.upbdefs.c +297 -284
  231. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.c +492 -469
  232. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/proxy_protocol.upbdefs.c +74 -43
  233. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/proxy_protocol.upbdefs.h +10 -0
  234. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/substitution_format_string.upbdefs.c +60 -59
  235. data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +202 -184
  236. data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +5 -0
  237. data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.c +354 -339
  238. data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.h +5 -0
  239. data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/quic_config.upbdefs.c +28 -19
  240. data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/metrics_service.upbdefs.c +30 -27
  241. data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/stats.upbdefs.c +71 -66
  242. data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.c +94 -91
  243. data/src/core/ext/upbdefs-gen/envoy/config/rbac/v3/rbac.upbdefs.c +386 -369
  244. data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route.upbdefs.c +60 -57
  245. data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.c +1974 -1884
  246. data/src/core/ext/upbdefs-gen/envoy/config/tap/v3/common.upbdefs.c +119 -112
  247. data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opentelemetry.upbdefs.c +62 -51
  248. data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/zipkin.upbdefs.c +109 -88
  249. data/src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +54 -36
  250. data/src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +5 -0
  251. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +78 -84
  252. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c +48 -46
  253. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +1041 -984
  254. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -0
  255. data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +304 -290
  256. data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +94 -77
  257. data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +5 -0
  258. data/src/core/ext/upbdefs-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upbdefs.c +246 -193
  259. data/src/core/ext/upbdefs-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upbdefs.h +5 -0
  260. data/src/core/ext/upbdefs-gen/envoy/type/http/v3/cookie.upbdefs.c +37 -23
  261. data/src/core/ext/upbdefs-gen/envoy/type/http/v3/cookie.upbdefs.h +5 -0
  262. data/src/core/ext/upbdefs-gen/envoy/type/tracing/v3/custom_tag.upbdefs.c +5 -3
  263. data/src/core/ext/upbdefs-gen/google/api/http.upbdefs.c +4 -4
  264. data/src/core/ext/upbdefs-gen/google/api/httpbody.upbdefs.c +4 -5
  265. data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.c +113 -87
  266. data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.h +5 -0
  267. data/src/core/ext/upbdefs-gen/udpa/annotations/migrate.upbdefs.c +5 -5
  268. data/src/core/ext/upbdefs-gen/udpa/annotations/security.upbdefs.c +6 -5
  269. data/src/core/ext/upbdefs-gen/udpa/annotations/sensitive.upbdefs.c +5 -5
  270. data/src/core/ext/upbdefs-gen/udpa/annotations/status.upbdefs.c +5 -5
  271. data/src/core/ext/upbdefs-gen/udpa/annotations/versioning.upbdefs.c +5 -5
  272. data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/cel.upbdefs.c +25 -30
  273. data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/http_inputs.upbdefs.c +14 -20
  274. data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/matcher.upbdefs.c +180 -183
  275. data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/string.upbdefs.c +56 -47
  276. data/src/core/ext/upbdefs-gen/xds/type/v3/cel.upbdefs.c +69 -47
  277. data/src/core/filter/filter_chain.h +95 -0
  278. data/src/core/handshaker/http_connect/{http_connect_handshaker.cc → http_connect_client_handshaker.cc} +32 -31
  279. data/src/core/handshaker/http_connect/{http_connect_handshaker.h → http_connect_client_handshaker.h} +4 -4
  280. data/src/core/handshaker/http_connect/http_proxy_mapper.cc +1 -1
  281. data/src/core/handshaker/http_connect/xds_http_proxy_mapper.cc +1 -1
  282. data/src/core/handshaker/security/pipelined_secure_endpoint.cc +14 -13
  283. data/src/core/handshaker/security/secure_endpoint.cc +282 -68
  284. data/src/core/handshaker/security/secure_endpoint.h +0 -7
  285. data/src/core/lib/channel/channel_args.h +1 -1
  286. data/src/core/lib/channel/promise_based_filter.cc +17 -4
  287. data/src/core/lib/channel/promise_based_filter.h +3 -2
  288. data/src/core/lib/debug/trace_flags.cc +2 -0
  289. data/src/core/lib/debug/trace_flags.h +1 -0
  290. data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +35 -8
  291. data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +1 -2
  292. data/src/core/lib/event_engine/event_engine.cc +9 -0
  293. data/src/core/lib/event_engine/extensions/tcp_trace.h +0 -3
  294. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +2 -2
  295. data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +1 -1
  296. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +34 -9
  297. data/src/core/lib/event_engine/posix_engine/posix_engine.h +24 -2
  298. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +1 -3
  299. data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +141 -14
  300. data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +19 -2
  301. data/src/core/lib/event_engine/posix_engine/posix_interface.h +7 -0
  302. data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +21 -3
  303. data/src/core/lib/event_engine/posix_engine/posix_interface_windows.cc +16 -0
  304. data/src/core/lib/experiments/experiments.cc +309 -201
  305. data/src/core/lib/experiments/experiments.h +141 -80
  306. data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +2 -2
  307. data/src/core/lib/iomgr/resolve_address.h +0 -2
  308. data/src/core/lib/iomgr/resolved_address.h +0 -2
  309. data/src/core/lib/iomgr/tcp_posix.cc +13 -5
  310. data/src/core/lib/iomgr/tcp_server.cc +0 -5
  311. data/src/core/lib/iomgr/tcp_server.h +0 -7
  312. data/src/core/lib/iomgr/tcp_server_posix.cc +0 -17
  313. data/src/core/lib/iomgr/tcp_server_utils_posix.h +0 -3
  314. data/src/core/lib/iomgr/tcp_server_windows.cc +12 -51
  315. data/src/core/lib/promise/all_ok.h +17 -12
  316. data/src/core/lib/promise/cancel_callback.h +12 -13
  317. data/src/core/lib/promise/detail/join_state.h +626 -0
  318. data/src/core/lib/promise/detail/promise_factory.h +14 -14
  319. data/src/core/lib/promise/for_each.h +32 -8
  320. data/src/core/lib/promise/if.h +9 -7
  321. data/src/core/lib/promise/loop.h +18 -16
  322. data/src/core/lib/promise/map.h +54 -47
  323. data/src/core/lib/promise/mpsc.h +11 -10
  324. data/src/core/lib/promise/observable.h +6 -6
  325. data/src/core/lib/promise/party.h +25 -19
  326. data/src/core/lib/promise/poll.h +5 -5
  327. data/src/core/lib/promise/prioritized_race.h +10 -7
  328. data/src/core/lib/promise/promise.h +16 -11
  329. data/src/core/lib/promise/race.h +6 -5
  330. data/src/core/lib/promise/seq.h +109 -74
  331. data/src/core/lib/promise/try_join.h +14 -6
  332. data/src/core/lib/promise/try_seq.h +76 -60
  333. data/src/core/lib/resource_quota/api.cc +7 -0
  334. data/src/core/lib/resource_quota/arena.h +1 -1
  335. data/src/core/lib/resource_quota/memory_quota.cc +4 -1
  336. data/src/core/lib/resource_quota/resource_quota.cc +2 -1
  337. data/src/core/lib/resource_quota/resource_quota.h +3 -0
  338. data/src/core/lib/resource_quota/stream_quota.cc +77 -1
  339. data/src/core/lib/resource_quota/stream_quota.h +64 -1
  340. data/src/core/lib/resource_quota/telemetry.h +1 -1
  341. data/src/core/lib/surface/call.cc +13 -0
  342. data/src/core/lib/surface/call_utils.h +58 -43
  343. data/src/core/lib/surface/channel.h +1 -4
  344. data/src/core/lib/surface/completion_queue.cc +13 -6
  345. data/src/core/lib/surface/validate_metadata.cc +20 -15
  346. data/src/core/lib/surface/validate_metadata.h +3 -1
  347. data/src/core/lib/surface/version.cc +2 -2
  348. data/src/core/lib/transport/promise_endpoint.cc +1 -1
  349. data/src/core/lib/transport/promise_endpoint.h +1 -1
  350. data/src/core/lib/transport/transport.h +5 -0
  351. data/src/core/load_balancing/health_check_client.cc +1 -15
  352. data/src/core/load_balancing/health_check_client_internal.h +0 -2
  353. data/src/core/load_balancing/oob_backend_metric.cc +1 -5
  354. data/src/core/load_balancing/oob_backend_metric_internal.h +0 -1
  355. data/src/core/load_balancing/xds/xds_cluster_impl.cc +12 -9
  356. data/src/core/plugin_registry/grpc_plugin_registry.cc +3 -2
  357. data/src/core/resolver/xds/xds_resolver.cc +162 -116
  358. data/src/core/server/server.cc +18 -1
  359. data/src/core/server/server.h +2 -0
  360. data/src/core/server/xds_server_config_fetcher.cc +4 -4
  361. data/src/core/telemetry/call_tracer.cc +87 -2
  362. data/src/core/telemetry/call_tracer.h +46 -8
  363. data/src/core/telemetry/instrument.cc +102 -40
  364. data/src/core/telemetry/instrument.h +246 -65
  365. data/src/core/tsi/fake_transport_security.cc +3 -1
  366. data/src/core/tsi/ssl_transport_security.cc +516 -137
  367. data/src/core/tsi/ssl_transport_security.h +28 -22
  368. data/src/core/tsi/ssl_transport_security_utils.cc +2 -2
  369. data/src/core/tsi/ssl_transport_security_utils.h +2 -2
  370. data/src/core/util/bitset.h +6 -0
  371. data/src/core/util/function_signature.h +3 -1
  372. data/src/core/util/http_client/httpcli_security_connector.cc +2 -1
  373. data/src/core/util/json/json_reader.cc +0 -4
  374. data/src/core/xds/grpc/certificate_provider_store.cc +2 -1
  375. data/src/core/xds/grpc/certificate_provider_store.h +3 -17
  376. data/src/core/xds/grpc/certificate_provider_store_interface.h +61 -0
  377. data/src/core/xds/grpc/xds_bootstrap_grpc.cc +48 -0
  378. data/src/core/xds/grpc/xds_bootstrap_grpc.h +18 -0
  379. data/src/core/xds/grpc/xds_certificate_provider.cc +7 -2
  380. data/src/core/xds/grpc/xds_certificate_provider.h +13 -2
  381. data/src/core/xds/grpc/xds_client_grpc.cc +13 -6
  382. data/src/core/xds/grpc/xds_client_grpc.h +10 -7
  383. data/src/core/xds/grpc/xds_cluster.cc +18 -4
  384. data/src/core/xds/grpc/xds_cluster.h +17 -2
  385. data/src/core/xds/grpc/xds_cluster_parser.cc +36 -11
  386. data/src/core/xds/grpc/xds_common_types.cc +45 -0
  387. data/src/core/xds/grpc/xds_common_types.h +31 -0
  388. data/src/core/xds/grpc/xds_common_types_parser.cc +274 -16
  389. data/src/core/xds/grpc/xds_common_types_parser.h +12 -0
  390. data/src/core/xds/grpc/xds_http_fault_filter.cc +128 -24
  391. data/src/core/xds/grpc/xds_http_fault_filter.h +19 -10
  392. data/src/core/xds/grpc/xds_http_filter.cc +38 -0
  393. data/src/core/xds/grpc/xds_http_filter.h +70 -47
  394. data/src/core/xds/grpc/xds_http_filter_registry.cc +48 -14
  395. data/src/core/xds/grpc/xds_http_filter_registry.h +29 -15
  396. data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +88 -22
  397. data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +22 -11
  398. data/src/core/xds/grpc/xds_http_rbac_filter.cc +36 -20
  399. data/src/core/xds/grpc/xds_http_rbac_filter.h +19 -10
  400. data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +143 -26
  401. data/src/core/xds/grpc/xds_http_stateful_session_filter.h +19 -10
  402. data/src/core/xds/grpc/xds_listener.cc +4 -1
  403. data/src/core/xds/grpc/xds_listener.h +10 -2
  404. data/src/core/xds/grpc/xds_listener_parser.cc +23 -18
  405. data/src/core/xds/grpc/xds_matcher.cc +40 -5
  406. data/src/core/xds/grpc/xds_matcher.h +13 -0
  407. data/src/core/xds/grpc/xds_matcher_action.h +1 -1
  408. data/src/core/xds/grpc/xds_matcher_parse.cc +60 -40
  409. data/src/core/xds/grpc/xds_matcher_parse.h +2 -1
  410. data/src/core/xds/grpc/xds_route_config.cc +12 -1
  411. data/src/core/xds/grpc/xds_route_config.h +15 -2
  412. data/src/core/xds/grpc/xds_route_config_parser.cc +11 -5
  413. data/src/core/xds/grpc/xds_routing.cc +181 -6
  414. data/src/core/xds/grpc/xds_routing.h +57 -0
  415. data/src/core/xds/grpc/xds_server_grpc.cc +55 -43
  416. data/src/core/xds/grpc/xds_server_grpc.h +13 -6
  417. data/src/core/xds/grpc/xds_server_grpc_interface.h +3 -2
  418. data/src/core/xds/grpc/xds_transport_grpc.cc +12 -6
  419. data/src/core/xds/grpc/xds_transport_grpc.h +5 -1
  420. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +12 -8
  421. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +18 -12
  422. data/src/ruby/lib/grpc/grpc.rb +7 -9
  423. data/src/ruby/lib/grpc/version.rb +1 -1
  424. data/src/ruby/pb/generate_proto_ruby.sh +1 -1
  425. data/src/ruby/spec/client_server_spec.rb +1 -1
  426. data/src/ruby/spec/generic/rpc_server_pool_spec.rb +1 -1
  427. data/src/ruby/spec/generic/rpc_server_spec.rb +3 -4
  428. data/src/ruby/spec/spec_helper.rb +1 -1
  429. metadata +64 -14
  430. data/src/core/ext/transport/chttp2/transport/security_frame.cc +0 -31
  431. data/src/core/handshaker/security/legacy_secure_endpoint.cc +0 -597
@@ -21,10 +21,12 @@
21
21
 
22
22
  #include <grpc/grpc_crl_provider.h>
23
23
  #include <grpc/grpc_security_constants.h>
24
+ #include <grpc/private_key_signer.h>
24
25
  #include <grpc/support/port_platform.h>
25
26
  #include <openssl/x509.h>
26
27
 
27
28
  #include <memory>
29
+ #include <string>
28
30
 
29
31
  #include "src/core/credentials/transport/tls/spiffe_utils.h"
30
32
  #include "src/core/tsi/ssl/key_logging/ssl_key_logging.h"
@@ -51,8 +53,13 @@
51
53
  #define TSI_X509_VERIFIED_ROOT_CERT_SUBECT_PEER_PROPERTY \
52
54
  "x509_verified_root_cert_subject"
53
55
 
56
+ namespace tsi {
54
57
  using RootCertInfo = std::variant<std::string, grpc_core::SpiffeBundleMap>;
55
58
 
59
+ using PrivateKey =
60
+ std::variant<std::string, std::shared_ptr<grpc_core::PrivateKeySigner>>;
61
+ } // namespace tsi
62
+
56
63
  // --- tsi_ssl_root_certs_store object ---
57
64
 
58
65
  // This object stores SSL root certificates. It can be shared by multiple SSL
@@ -105,13 +112,17 @@ typedef struct tsi_ssl_client_handshaker_factory
105
112
 
106
113
  // Object that holds a private key / certificate chain pair in PEM format.
107
114
  struct tsi_ssl_pem_key_cert_pair {
108
- // private_key is the NULL-terminated string containing the PEM encoding of
109
- // the client's private key.
110
- const char* private_key;
115
+ // private_key is either the string containing the PEM encoding of
116
+ // the client's private key or an implementation of PrivateKeySigner.
117
+ tsi::PrivateKey private_key;
111
118
 
112
- // cert_chain is the NULL-terminated string containing the PEM encoding of
119
+ // cert_chain is the string containing the PEM encoding of
113
120
  // the client's certificate chain.
114
- const char* cert_chain;
121
+ std::string cert_chain;
122
+
123
+ tsi_ssl_pem_key_cert_pair() = default;
124
+ tsi_ssl_pem_key_cert_pair(tsi::PrivateKey pk, std::string cert_chain_pem)
125
+ : private_key(std::move(pk)), cert_chain(std::move(cert_chain_pem)) {}
115
126
  };
116
127
  // TO BE DEPRECATED.
117
128
  // Creates a client handshaker factory.
@@ -192,7 +203,7 @@ struct tsi_ssl_client_handshaker_options {
192
203
 
193
204
  // root_cert_info is either the string containing the PEM encoding of the
194
205
  // client root certificates or a SPIFFE bundle map.
195
- std::shared_ptr<RootCertInfo> root_cert_info;
206
+ std::shared_ptr<tsi::RootCertInfo> root_cert_info;
196
207
 
197
208
  // TODO(gtcooke94) this ctor is not needed
198
209
  // https://github.com/grpc/grpc/pull/39708/files#r2143735662
@@ -262,7 +273,6 @@ typedef struct tsi_ssl_server_handshaker_factory
262
273
  // Creates a server handshaker factory.
263
274
  // - pem_key_cert_pairs is an array private key / certificate chains of the
264
275
  // server.
265
- // - num_key_cert_pairs is the number of items in the pem_key_cert_pairs array.
266
276
  // - pem_root_certs is the NULL-terminated string containing the PEM encoding
267
277
  // of the client root certificates. This parameter may be NULL if the server
268
278
  // does not want the client to be authenticated with SSL.
@@ -281,11 +291,10 @@ typedef struct tsi_ssl_server_handshaker_factory
281
291
  // - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case
282
292
  // where a parameter is invalid.
283
293
  tsi_result tsi_create_ssl_server_handshaker_factory(
284
- const tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs,
285
- size_t num_key_cert_pairs, const char* pem_client_root_certs,
286
- int force_client_auth, const char* cipher_suites,
287
- const char** alpn_protocols, uint16_t num_alpn_protocols,
288
- tsi_ssl_server_handshaker_factory** factory);
294
+ std::vector<tsi_ssl_pem_key_cert_pair> pem_key_cert_pairs,
295
+ const char* pem_client_root_certs, int force_client_auth,
296
+ const char* cipher_suites, const char** alpn_protocols,
297
+ uint16_t num_alpn_protocols, tsi_ssl_server_handshaker_factory** factory);
289
298
 
290
299
  // TO BE DEPRECATED.
291
300
  // Same as tsi_create_ssl_server_handshaker_factory method except uses
@@ -295,8 +304,8 @@ tsi_result tsi_create_ssl_server_handshaker_factory(
295
304
  // authenticate with an SSL cert. Note that this option is ignored if
296
305
  // pem_client_root_certs is NULL or pem_client_roots_certs_size is 0
297
306
  tsi_result tsi_create_ssl_server_handshaker_factory_ex(
298
- const tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs,
299
- size_t num_key_cert_pairs, const char* pem_client_root_certs,
307
+ std::vector<tsi_ssl_pem_key_cert_pair> pem_key_cert_pairs,
308
+ const char* pem_client_root_certs,
300
309
  tsi_client_certificate_request_type client_certificate_request,
301
310
  const char* cipher_suites, const char** alpn_protocols,
302
311
  uint16_t num_alpn_protocols, tsi_ssl_server_handshaker_factory** factory);
@@ -304,10 +313,7 @@ tsi_result tsi_create_ssl_server_handshaker_factory_ex(
304
313
  struct tsi_ssl_server_handshaker_options {
305
314
  // pem_key_cert_pairs is an array private key / certificate chains of the
306
315
  // server.
307
- const tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs;
308
- // num_key_cert_pairs is the number of items in the pem_key_cert_pairs
309
- // array.
310
- size_t num_key_cert_pairs;
316
+ std::vector<tsi_ssl_pem_key_cert_pair> pem_key_cert_pairs;
311
317
  // client_certificate_request, if set to non-zero will force the client to
312
318
  // authenticate with an SSL cert. Note that this option is ignored if
313
319
  // root_cert_info is NULL
@@ -364,14 +370,12 @@ struct tsi_ssl_server_handshaker_options {
364
370
  // root_cert_info is either the string containing the PEM encoding of the
365
371
  // server root certificates or a SPIFFE bundle map. This parameter may be NULL
366
372
  // if the server does not want the client to be authenticated with SSL.
367
- std::shared_ptr<RootCertInfo> root_cert_info;
373
+ std::shared_ptr<tsi::RootCertInfo> root_cert_info;
368
374
 
369
375
  // TODO(gtcooke94) this ctor is not needed
370
376
  // https://github.com/grpc/grpc/pull/39708/files#r2143735662
371
377
  tsi_ssl_server_handshaker_options()
372
- : pem_key_cert_pairs(nullptr),
373
- num_key_cert_pairs(0),
374
- client_certificate_request(TSI_DONT_REQUEST_CLIENT_CERTIFICATE),
378
+ : client_certificate_request(TSI_DONT_REQUEST_CLIENT_CERTIFICATE),
375
379
  cipher_suites(nullptr),
376
380
  alpn_protocols(nullptr),
377
381
  num_alpn_protocols(0),
@@ -448,6 +452,8 @@ tsi_result tsi_ssl_extract_x509_subject_names_from_pem_cert(
448
452
  tsi_result tsi_ssl_get_cert_chain_contents(STACK_OF(X509) * peer_chain,
449
453
  tsi_peer_property* property);
450
454
 
455
+ namespace tsi {
451
456
  bool IsRootCertInfoEmpty(const RootCertInfo* root_cert_info);
457
+ } // namespace tsi
452
458
 
453
459
  #endif // GRPC_SRC_CORE_TSI_SSL_TRANSPORT_SECURITY_H
@@ -36,7 +36,7 @@
36
36
  #include "absl/status/status.h"
37
37
  #include "absl/status/statusor.h"
38
38
 
39
- namespace grpc_core {
39
+ namespace tsi {
40
40
 
41
41
  const char* SslErrorString(int error) {
42
42
  switch (error) {
@@ -449,4 +449,4 @@ absl::StatusOr<std::string> ParseUriString(GENERAL_NAME* subject_alt_name) {
449
449
  OPENSSL_free(name);
450
450
  return ret;
451
451
  }
452
- } // namespace grpc_core
452
+ } // namespace tsi
@@ -31,7 +31,7 @@
31
31
  #include "absl/status/statusor.h"
32
32
  #include "absl/strings/string_view.h"
33
33
 
34
- namespace grpc_core {
34
+ namespace tsi {
35
35
 
36
36
  // Converts an SSL error status code to a readable string.
37
37
  //
@@ -181,6 +181,6 @@ absl::StatusOr<EVP_PKEY*> ParsePemPrivateKey(absl::string_view private_key_pem);
181
181
 
182
182
  // Safely parses a URI from OpenSSL's GENERAL_NAME to a string representation.
183
183
  absl::StatusOr<std::string> ParseUriString(GENERAL_NAME* subject_alt_name);
184
- } // namespace grpc_core
184
+ } // namespace tsi
185
185
 
186
186
  #endif // GRPC_SRC_CORE_TSI_SSL_TRANSPORT_SECURITY_UTILS_H
@@ -182,6 +182,12 @@ class BitSet {
182
182
  return *this;
183
183
  }
184
184
 
185
+ void Merge(const BitSet& other) {
186
+ for (size_t i = 0; i < kUnits; i++) {
187
+ units_[i] |= other.units_[i];
188
+ }
189
+ }
190
+
185
191
  private:
186
192
  // Given a bit index, return which unit it's stored in.
187
193
  static constexpr size_t unit_for(size_t bit) { return bit / kUnitBits; }
@@ -31,7 +31,9 @@
31
31
  #elif defined(__GNUC__)
32
32
  #define GRPC_FUNCTION_SIGNATURE __PRETTY_FUNCTION__
33
33
  #else
34
- #define GRPC_FUNCTION_SIGNATURE "???()"
34
+ #define GRPC_FUNCTION_SIGNATURE \
35
+ "??" \
36
+ "?()"
35
37
  #endif
36
38
 
37
39
  namespace grpc_core {
@@ -78,7 +78,8 @@ class grpc_httpcli_ssl_channel_security_connector final
78
78
  const tsi_ssl_root_certs_store* root_store) {
79
79
  tsi_ssl_client_handshaker_options options;
80
80
  if (pem_root_certs != nullptr) {
81
- options.root_cert_info = std::make_shared<RootCertInfo>(pem_root_certs);
81
+ options.root_cert_info =
82
+ std::make_shared<tsi::RootCertInfo>(pem_root_certs);
82
83
  }
83
84
  options.root_store = root_store;
84
85
  return tsi_create_ssl_client_handshaker_factory_with_options(
@@ -242,10 +242,6 @@ uint32_t JsonReader::ReadChar() {
242
242
  if (remaining_input_ == 0) return GRPC_JSON_READ_CHAR_EOF;
243
243
  const uint32_t r = *input_++;
244
244
  --remaining_input_;
245
- if (r == 0) {
246
- remaining_input_ = 0;
247
- return GRPC_JSON_READ_CHAR_EOF;
248
- }
249
245
  return r;
250
246
  }
251
247
 
@@ -131,7 +131,8 @@ CertificateProviderStore::CreateCertificateProviderLocked(
131
131
  return nullptr;
132
132
  }
133
133
  return MakeRefCounted<CertificateProviderWrapper>(
134
- factory->CreateCertificateProvider(definition.config), Ref(), name);
134
+ factory->CreateCertificateProvider(definition.config),
135
+ RefAsSubclass<CertificateProviderStore>(), name);
135
136
  }
136
137
 
137
138
  void CertificateProviderStore::ReleaseCertificateProvider(
@@ -20,7 +20,6 @@
20
20
  #define GRPC_SRC_CORE_XDS_GRPC_CERTIFICATE_PROVIDER_STORE_H
21
21
 
22
22
  #include <grpc/grpc_security.h>
23
- #include <grpc/support/port_platform.h>
24
23
 
25
24
  #include <map>
26
25
  #include <string>
@@ -38,6 +37,7 @@
38
37
  #include "src/core/util/unique_type_name.h"
39
38
  #include "src/core/util/useful.h"
40
39
  #include "src/core/util/validation_errors.h"
40
+ #include "src/core/xds/grpc/certificate_provider_store_interface.h"
41
41
  #include "absl/base/thread_annotations.h"
42
42
  #include "absl/strings/string_view.h"
43
43
 
@@ -45,20 +45,8 @@ namespace grpc_core {
45
45
 
46
46
  // Map for xDS based grpc_tls_certificate_provider instances.
47
47
  class CertificateProviderStore final
48
- : public InternallyRefCounted<CertificateProviderStore> {
48
+ : public CertificateProviderStoreInterface {
49
49
  public:
50
- struct PluginDefinition {
51
- std::string plugin_name;
52
- RefCountedPtr<CertificateProviderFactory::Config> config;
53
-
54
- static const JsonLoaderInterface* JsonLoader(const JsonArgs&);
55
- void JsonPostLoad(const Json& json, const JsonArgs& args,
56
- ValidationErrors* errors);
57
- };
58
-
59
- // Maps plugin instance (opaque) name to plugin definition.
60
- typedef std::map<std::string, PluginDefinition> PluginDefinitionMap;
61
-
62
50
  explicit CertificateProviderStore(PluginDefinitionMap plugin_config_map)
63
51
  : plugin_config_map_(std::move(plugin_config_map)) {}
64
52
 
@@ -68,9 +56,7 @@ class CertificateProviderStore final
68
56
  // definition map.
69
57
  // Returns nullptr on failure to get or create a new certificate provider.
70
58
  RefCountedPtr<grpc_tls_certificate_provider> CreateOrGetCertificateProvider(
71
- absl::string_view key);
72
-
73
- void Orphan() override { Unref(); }
59
+ absl::string_view key) override;
74
60
 
75
61
  private:
76
62
  // A thin wrapper around `grpc_tls_certificate_provider` which allows removing
@@ -0,0 +1,61 @@
1
+ //
2
+ // Copyright 2025 gRPC authors.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+
17
+ #ifndef GRPC_SRC_CORE_XDS_GRPC_CERTIFICATE_PROVIDER_STORE_INTERFACE_H
18
+ #define GRPC_SRC_CORE_XDS_GRPC_CERTIFICATE_PROVIDER_STORE_INTERFACE_H
19
+
20
+ #include <map>
21
+ #include <string>
22
+
23
+ #include "src/core/credentials/transport/tls/certificate_provider_factory.h"
24
+ #include "src/core/util/json/json.h"
25
+ #include "src/core/util/json/json_args.h"
26
+ #include "src/core/util/json/json_object_loader.h"
27
+ #include "src/core/util/ref_counted.h"
28
+ #include "src/core/util/ref_counted_ptr.h"
29
+ #include "src/core/util/validation_errors.h"
30
+ #include "absl/strings/string_view.h"
31
+
32
+ namespace grpc_core {
33
+
34
+ // Map for xDS based grpc_tls_certificate_provider instances.
35
+ class CertificateProviderStoreInterface
36
+ : public RefCounted<CertificateProviderStoreInterface> {
37
+ public:
38
+ struct PluginDefinition {
39
+ std::string plugin_name;
40
+ RefCountedPtr<CertificateProviderFactory::Config> config;
41
+
42
+ static const JsonLoaderInterface* JsonLoader(const JsonArgs&);
43
+ void JsonPostLoad(const Json& json, const JsonArgs& args,
44
+ ValidationErrors* errors);
45
+ };
46
+
47
+ // Maps plugin instance (opaque) name to plugin definition.
48
+ using PluginDefinitionMap = std::map<std::string, PluginDefinition>;
49
+
50
+ // If a certificate provider corresponding to the instance name \a key is
51
+ // found, a ref to the grpc_tls_certificate_provider is returned. If no
52
+ // provider is found for the key, a new provider is created from the plugin
53
+ // definition map.
54
+ // Returns nullptr on failure to get or create a new certificate provider.
55
+ virtual RefCountedPtr<grpc_tls_certificate_provider>
56
+ CreateOrGetCertificateProvider(absl::string_view key) = 0;
57
+ };
58
+
59
+ } // namespace grpc_core
60
+
61
+ #endif // GRPC_SRC_CORE_XDS_GRPC_CERTIFICATE_PROVIDER_STORE_INTERFACE_H
@@ -25,6 +25,7 @@
25
25
  #include <vector>
26
26
 
27
27
  #include "src/core/util/down_cast.h"
28
+ #include "src/core/util/env.h"
28
29
  #include "src/core/util/json/json.h"
29
30
  #include "src/core/util/json/json_object_loader.h"
30
31
  #include "src/core/util/json/json_reader.h"
@@ -41,6 +42,15 @@
41
42
 
42
43
  namespace grpc_core {
43
44
 
45
+ // TODO(roth): Remove this once the feature passes interop tests.
46
+ bool XdsExtProcOnClientEnabled() {
47
+ auto value = GetEnv("GRPC_EXPERIMENTAL_XDS_EXT_PROC_ON_CLIENT");
48
+ if (!value.has_value()) return false;
49
+ bool parsed_value;
50
+ bool parse_succeeded = gpr_parse_bool_value(value->c_str(), &parsed_value);
51
+ return parse_succeeded && parsed_value;
52
+ }
53
+
44
54
  //
45
55
  // GrpcXdsBootstrap::GrpcNode::Locality
46
56
  //
@@ -90,6 +100,24 @@ const JsonLoaderInterface* GrpcXdsBootstrap::GrpcAuthority::JsonLoader(
90
100
  return loader;
91
101
  }
92
102
 
103
+ //
104
+ // GrpcXdsBootstrap::AllowedGrpcService
105
+ //
106
+
107
+ const JsonLoaderInterface* GrpcXdsBootstrap::AllowedGrpcService::JsonLoader(
108
+ const JsonArgs&) {
109
+ static const auto* loader = JsonObjectLoader<AllowedGrpcService>().Finish();
110
+ return loader;
111
+ };
112
+
113
+ void GrpcXdsBootstrap::AllowedGrpcService::JsonPostLoad(
114
+ const Json& json, const JsonArgs& args, ValidationErrors* errors) {
115
+ // Parse "channel_creds".
116
+ channel_creds_config = ParseXdsBootstrapChannelCreds(json, args, errors);
117
+ // Parse "call_creds".
118
+ call_creds_configs = ParseXdsBootstrapCallCreds(json, args, errors);
119
+ }
120
+
93
121
  //
94
122
  // GrpcXdsBootstrap
95
123
  //
@@ -106,6 +134,7 @@ absl::StatusOr<std::unique_ptr<GrpcXdsBootstrap>> GrpcXdsBootstrap::Create(
106
134
  public:
107
135
  bool IsEnabled(absl::string_view key) const override {
108
136
  if (key == "federation") return XdsFederationEnabled();
137
+ if (key == "grpc_service") return XdsExtProcOnClientEnabled();
109
138
  return true;
110
139
  }
111
140
  };
@@ -130,6 +159,9 @@ const JsonLoaderInterface* GrpcXdsBootstrap::JsonLoader(const JsonArgs&) {
130
159
  &GrpcXdsBootstrap::
131
160
  client_default_listener_resource_name_template_,
132
161
  "federation")
162
+ .OptionalField("allowed_grpc_services",
163
+ &GrpcXdsBootstrap::allowed_grpc_services_,
164
+ "grpc_service")
133
165
  .Finish();
134
166
  return loader;
135
167
  }
@@ -225,6 +257,22 @@ std::string GrpcXdsBootstrap::ToString() const {
225
257
  plugin_definition.config->ToString()));
226
258
  }
227
259
  parts.push_back("}");
260
+ parts.push_back("allowed_grpc_services={\n");
261
+ for (const auto& [target_uri, creds] : allowed_grpc_services_) {
262
+ parts.push_back(absl::StrCat(" ", target_uri, "={\n"));
263
+ if (creds.channel_creds_config != nullptr) {
264
+ parts.push_back(absl::StrCat(
265
+ " channel_creds={type=", creds.channel_creds_config->type(),
266
+ ", config=", creds.channel_creds_config->ToString(), "},\n"));
267
+ }
268
+ for (const auto& call_creds_config : creds.call_creds_configs) {
269
+ parts.push_back(
270
+ absl::StrCat(" call_creds={type=", call_creds_config->type(),
271
+ ", config=", call_creds_config->ToString(), "},\n"));
272
+ }
273
+ parts.push_back(" },\n");
274
+ }
275
+ parts.push_back("}");
228
276
  return absl::StrJoin(parts, "");
229
277
  }
230
278
 
@@ -42,6 +42,8 @@
42
42
 
43
43
  namespace grpc_core {
44
44
 
45
+ bool XdsExtProcOnClientEnabled();
46
+
45
47
  class GrpcXdsBootstrap final : public XdsBootstrap {
46
48
  public:
47
49
  class GrpcNode final : public Node {
@@ -101,6 +103,15 @@ class GrpcXdsBootstrap final : public XdsBootstrap {
101
103
  bool fallback_on_reachability_only_;
102
104
  };
103
105
 
106
+ struct AllowedGrpcService {
107
+ RefCountedPtr<const ChannelCredsConfig> channel_creds_config;
108
+ std::vector<RefCountedPtr<const CallCredsConfig>> call_creds_configs;
109
+
110
+ static const JsonLoaderInterface* JsonLoader(const JsonArgs&);
111
+ void JsonPostLoad(const Json& json, const JsonArgs& args,
112
+ ValidationErrors* errors);
113
+ };
114
+
104
115
  // Creates bootstrap object from json_string.
105
116
  static absl::StatusOr<std::unique_ptr<GrpcXdsBootstrap>> Create(
106
117
  absl::string_view json_string);
@@ -135,6 +146,11 @@ class GrpcXdsBootstrap final : public XdsBootstrap {
135
146
  const {
136
147
  return certificate_providers_;
137
148
  }
149
+ const std::map<std::string, AllowedGrpcService>& allowed_grpc_services()
150
+ const {
151
+ return allowed_grpc_services_;
152
+ }
153
+
138
154
  const XdsHttpFilterRegistry& http_filter_registry() const {
139
155
  return http_filter_registry_;
140
156
  }
@@ -165,6 +181,8 @@ class GrpcXdsBootstrap final : public XdsBootstrap {
165
181
  std::string server_listener_resource_name_template_;
166
182
  std::map<std::string, GrpcAuthority> authorities_;
167
183
  CertificateProviderStore::PluginDefinitionMap certificate_providers_;
184
+ std::map<std::string, AllowedGrpcService> allowed_grpc_services_;
185
+
168
186
  XdsHttpFilterRegistry http_filter_registry_;
169
187
  XdsClusterSpecifierPluginRegistry cluster_specifier_plugin_registry_;
170
188
  XdsLbPolicyRegistry lb_policy_registry_;
@@ -29,6 +29,8 @@
29
29
  #include "src/core/util/grpc_check.h"
30
30
  #include "absl/functional/bind_front.h"
31
31
 
32
+ using tsi::RootCertInfo;
33
+
32
34
  namespace grpc_core {
33
35
 
34
36
  namespace {
@@ -108,7 +110,8 @@ XdsCertificateProvider::XdsCertificateProvider(
108
110
  absl::string_view root_cert_name, bool use_system_root_certs,
109
111
  RefCountedPtr<grpc_tls_certificate_provider> identity_cert_provider,
110
112
  absl::string_view identity_cert_name,
111
- std::vector<StringMatcher> san_matchers)
113
+ std::vector<StringMatcher> san_matchers, std::string sni,
114
+ bool auto_host_sni, bool auto_sni_san_validation)
112
115
  : distributor_(MakeRefCounted<grpc_tls_certificate_distributor>()),
113
116
  root_cert_provider_(std::move(root_cert_provider)),
114
117
  root_cert_name_(root_cert_name),
@@ -116,7 +119,9 @@ XdsCertificateProvider::XdsCertificateProvider(
116
119
  identity_cert_provider_(std::move(identity_cert_provider)),
117
120
  identity_cert_name_(identity_cert_name),
118
121
  san_matchers_(std::move(san_matchers)),
119
- require_client_certificate_(false) {
122
+ sni_(std::move(sni)),
123
+ auto_host_sni_(auto_host_sni),
124
+ auto_sni_san_validation_(auto_sni_san_validation) {
120
125
  distributor_->SetWatchStatusCallback(
121
126
  absl::bind_front(&XdsCertificateProvider::WatchStatusCallback, this));
122
127
  }
@@ -39,7 +39,11 @@
39
39
  #include "absl/strings/string_view.h"
40
40
 
41
41
  namespace grpc_core {
42
-
42
+ // TODO(roth): Now that we've changed the TLS creds API to configure different
43
+ // providers for root and identity certs, we no longer need to multiplex
44
+ // multiple providers in an XdsCertificateProvider. Consider removing this code
45
+ // and instead just passing down the relevant TLS creds configuration via a
46
+ // channel arg.
43
47
  class XdsCertificateProvider final : public grpc_tls_certificate_provider {
44
48
  public:
45
49
  // ctor for client side
@@ -48,7 +52,8 @@ class XdsCertificateProvider final : public grpc_tls_certificate_provider {
48
52
  absl::string_view root_cert_name, bool use_system_root_certs,
49
53
  RefCountedPtr<grpc_tls_certificate_provider> identity_cert_provider,
50
54
  absl::string_view identity_cert_name,
51
- std::vector<StringMatcher> san_matchers);
55
+ std::vector<StringMatcher> san_matchers, std::string sni,
56
+ bool auto_host_sni, bool auto_sni_san_validation);
52
57
 
53
58
  // ctor for server side
54
59
  XdsCertificateProvider(
@@ -76,6 +81,9 @@ class XdsCertificateProvider final : public grpc_tls_certificate_provider {
76
81
  const std::vector<StringMatcher>& san_matchers() const {
77
82
  return san_matchers_;
78
83
  }
84
+ const std::string& sni() const { return sni_; }
85
+ bool auto_host_sni() const { return auto_host_sni_; }
86
+ bool auto_sni_san_validation() const { return auto_sni_san_validation_; }
79
87
 
80
88
  static absl::string_view ChannelArgName() {
81
89
  return "grpc.internal.xds_certificate_provider";
@@ -104,6 +112,9 @@ class XdsCertificateProvider final : public grpc_tls_certificate_provider {
104
112
  std::string identity_cert_name_;
105
113
  std::vector<StringMatcher> san_matchers_;
106
114
  bool require_client_certificate_ = false;
115
+ std::string sni_;
116
+ bool auto_host_sni_;
117
+ bool auto_sni_san_validation_ = false;
107
118
 
108
119
  grpc_tls_certificate_distributor::TlsCertificatesWatcherInterface*
109
120
  root_cert_watcher_ = nullptr;
@@ -204,7 +204,7 @@ absl::StatusOr<std::string> FindBootstrapContents()
204
204
  << "Got bootstrap file location from GRPC_XDS_BOOTSTRAP "
205
205
  "environment variable: "
206
206
  << *path;
207
- auto contents = LoadFile(*path, /*add_null_terminator=*/true);
207
+ auto contents = LoadFile(*path, /*add_null_terminator=*/false);
208
208
  if (!contents.ok()) return contents.status();
209
209
  return std::string(contents->as_string_view());
210
210
  }
@@ -278,9 +278,13 @@ absl::StatusOr<RefCountedPtr<GrpcXdsClient>> GrpcXdsClient::GetOrCreate(
278
278
  grpc_channel_args* xds_channel_args = args.GetPointer<grpc_channel_args>(
279
279
  GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_CLIENT_CHANNEL_ARGS);
280
280
  auto channel_args = ChannelArgs::FromC(xds_channel_args);
281
+ auto certificate_provider_store = MakeRefCounted<CertificateProviderStore>(
282
+ (*bootstrap)->certificate_providers());
281
283
  return MakeRefCounted<GrpcXdsClient>(
282
284
  key, std::move(*bootstrap), channel_args,
283
- MakeRefCounted<GrpcXdsTransportFactory>(channel_args),
285
+ MakeRefCounted<GrpcXdsTransportFactory>(channel_args,
286
+ certificate_provider_store),
287
+ certificate_provider_store,
284
288
  GetStatsPluginGroupForKeyAndChannelArgs(key, args));
285
289
  }
286
290
  // Otherwise, check the global map to see if the XdsClient instance
@@ -301,9 +305,13 @@ absl::StatusOr<RefCountedPtr<GrpcXdsClient>> GrpcXdsClient::GetOrCreate(
301
305
  bootstrap = std::move(*global_bootstrap);
302
306
  }
303
307
  auto channel_args = ChannelArgs::FromC(g_channel_args);
308
+ auto certificate_provider_store = MakeRefCounted<CertificateProviderStore>(
309
+ bootstrap->certificate_providers());
304
310
  auto xds_client = MakeRefCounted<GrpcXdsClient>(
305
311
  key, std::move(bootstrap), channel_args,
306
- MakeRefCounted<GrpcXdsTransportFactory>(channel_args),
312
+ MakeRefCounted<GrpcXdsTransportFactory>(channel_args,
313
+ certificate_provider_store),
314
+ certificate_provider_store,
307
315
  GetStatsPluginGroupForKeyAndChannelArgs(key, args));
308
316
  g_xds_client_map->emplace(xds_client->key(), xds_client.get());
309
317
  GRPC_TRACE_LOG(xds_client, INFO) << "[xds_client " << xds_client.get()
@@ -330,6 +338,7 @@ GrpcXdsClient::GrpcXdsClient(
330
338
  absl::string_view key, std::shared_ptr<GrpcXdsBootstrap> bootstrap,
331
339
  const ChannelArgs& args,
332
340
  RefCountedPtr<XdsTransportFactory> transport_factory,
341
+ RefCountedPtr<CertificateProviderStore> certificate_provider_store,
333
342
  std::shared_ptr<GlobalStatsPluginRegistry::StatsPluginGroup>
334
343
  stats_plugin_group)
335
344
  : XdsClient(
@@ -342,9 +351,7 @@ GrpcXdsClient::GrpcXdsClient(
342
351
  GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS)
343
352
  .value_or(Duration::Seconds(15)))),
344
353
  key_(key),
345
- certificate_provider_store_(MakeOrphanable<CertificateProviderStore>(
346
- DownCast<const GrpcXdsBootstrap&>(this->bootstrap())
347
- .certificate_providers())),
354
+ certificate_provider_store_(std::move(certificate_provider_store)),
348
355
  stats_plugin_group_(std::move(stats_plugin_group)),
349
356
  registered_metric_callback_(stats_plugin_group_->RegisterCallback(
350
357
  [this](CallbackMetricReporter& reporter) {
@@ -63,12 +63,15 @@ class GrpcXdsClient final : public XdsClient {
63
63
  // work for callers that use interested_parties() but not for callers
64
64
  // that also use certificate_provider_store(), but we should consider
65
65
  // alternatives for that case as well.
66
- GrpcXdsClient(absl::string_view key,
67
- std::shared_ptr<GrpcXdsBootstrap> bootstrap,
68
- const ChannelArgs& args,
69
- RefCountedPtr<XdsTransportFactory> transport_factory,
70
- std::shared_ptr<GlobalStatsPluginRegistry::StatsPluginGroup>
71
- stats_plugin_group);
66
+ // Once we no longer need to inject the transport factory, we probably
67
+ // also won't need to inject the certificate provider store.
68
+ GrpcXdsClient(
69
+ absl::string_view key, std::shared_ptr<GrpcXdsBootstrap> bootstrap,
70
+ const ChannelArgs& args,
71
+ RefCountedPtr<XdsTransportFactory> transport_factory,
72
+ RefCountedPtr<CertificateProviderStore> certificate_provider_store,
73
+ std::shared_ptr<GlobalStatsPluginRegistry::StatsPluginGroup>
74
+ stats_plugin_group);
72
75
 
73
76
  // Helpers for encoding the XdsClient object in channel args.
74
77
  static absl::string_view ChannelArgName() {
@@ -100,7 +103,7 @@ class GrpcXdsClient final : public XdsClient {
100
103
  void Orphaned() override;
101
104
 
102
105
  std::string key_;
103
- OrphanablePtr<CertificateProviderStore> certificate_provider_store_;
106
+ RefCountedPtr<CertificateProviderStore> certificate_provider_store_;
104
107
  std::shared_ptr<GlobalStatsPluginRegistry::StatsPluginGroup>
105
108
  stats_plugin_group_;
106
109
  std::unique_ptr<RegisteredMetricCallback> registered_metric_callback_;
@@ -25,6 +25,22 @@
25
25
 
26
26
  namespace grpc_core {
27
27
 
28
+ std::string XdsClusterResource::UpstreamTlsContext::ToString() const {
29
+ std::vector<std::string> contents;
30
+ if (!common_tls_context.Empty()) {
31
+ contents.push_back(
32
+ absl::StrCat("common_tls_context=", common_tls_context.ToString()));
33
+ }
34
+ contents.push_back(absl::StrCat("sni=", sni));
35
+ if (auto_host_sni) {
36
+ contents.push_back("auto_host_sni=true");
37
+ }
38
+ if (auto_sni_san_validation) {
39
+ contents.push_back("auto_sni_san_validation=true");
40
+ }
41
+ return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
42
+ }
43
+
28
44
  std::string XdsClusterResource::ToString() const {
29
45
  std::vector<std::string> contents;
30
46
  Match(
@@ -58,10 +74,8 @@ std::string XdsClusterResource::ToString() const {
58
74
  lrs_backend_metric_propagation->AsString()));
59
75
  }
60
76
  if (use_http_connect) contents.push_back("use_http_connect=true");
61
- if (!common_tls_context.Empty()) {
62
- contents.push_back(
63
- absl::StrCat("common_tls_context=", common_tls_context.ToString()));
64
- }
77
+ contents.push_back(
78
+ absl::StrCat("upstream_tls_context=", upstream_tls_context.ToString()));
65
79
  if (connection_idle_timeout != Duration::Zero()) {
66
80
  contents.push_back(absl::StrCat("connection_idle_timeout=",
67
81
  connection_idle_timeout.ToString()));