grpc 1.85.4 → 1.86.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 (626) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +13 -9
  3. data/etc/roots.pem +0 -583
  4. data/include/grpc/channel_factory.h +78 -0
  5. data/include/grpc/credentials.h +21 -0
  6. data/include/grpc/grpc.h +7 -0
  7. data/include/grpc/grpc_security_constants.h +2 -0
  8. data/include/grpc/module.modulemap +1 -0
  9. data/src/core/call/call_filters.cc +4 -1
  10. data/src/core/call/call_filters.h +3 -1
  11. data/src/core/call/call_spine.h +12 -6
  12. data/src/core/call/call_state.h +3 -3
  13. data/src/core/call/client_call.cc +4 -1
  14. data/src/core/call/client_call.h +1 -0
  15. data/src/core/call/filter_fusion.h +2 -15
  16. data/src/core/call/interception_chain.h +2 -7
  17. data/src/core/call/metadata_batch.cc +5 -0
  18. data/src/core/call/metadata_batch.h +13 -3
  19. data/src/core/call/request_buffer.cc +1 -1
  20. data/src/core/call/server_call.cc +3 -3
  21. data/src/core/call/server_call.h +15 -0
  22. data/src/core/channelz/channelz_registry.cc +4 -4
  23. data/src/core/client_channel/backup_poller.cc +1 -2
  24. data/src/core/client_channel/channel_factory.cc +110 -0
  25. data/src/core/client_channel/channel_factory.h +45 -0
  26. data/src/core/client_channel/global_subchannel_pool.cc +2 -2
  27. data/src/core/client_channel/lame_channel.cc +59 -0
  28. data/src/core/client_channel/lame_channel.h +86 -0
  29. data/src/core/credentials/call/external/aws_request_signer.cc +2 -1
  30. data/src/core/credentials/call/external/url_external_account_credentials.cc +6 -17
  31. data/src/core/credentials/call/external/url_external_account_credentials.h +0 -1
  32. data/src/core/credentials/call/jwt/jwt_verifier.cc +25 -13
  33. data/src/core/credentials/transport/tls/grpc_tls_credentials_options.cc +14 -0
  34. data/src/core/credentials/transport/tls/grpc_tls_credentials_options.h +12 -2
  35. data/src/core/credentials/transport/tls/ssl_utils.cc +20 -0
  36. data/src/core/credentials/transport/tls/ssl_utils.h +4 -0
  37. data/src/core/credentials/transport/tls/tls_security_connector.cc +6 -2
  38. data/src/core/ext/filters/rbac/rbac_filter.cc +3 -41
  39. data/src/core/ext/filters/rbac/rbac_filter.h +2 -11
  40. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -2
  41. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +31 -24
  42. data/src/core/ext/transport/chttp2/server/chttp2_server.h +1 -2
  43. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +69 -102
  44. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +1 -1
  45. data/src/core/ext/transport/chttp2/transport/flow_control.h +2 -2
  46. data/src/core/ext/transport/chttp2/transport/flow_control_manager.h +1 -1
  47. data/src/core/ext/transport/chttp2/transport/frame.cc +15 -19
  48. data/src/core/ext/transport/chttp2/transport/frame.h +1 -1
  49. data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +18 -61
  50. data/src/core/ext/transport/chttp2/transport/frame_goaway.h +0 -4
  51. data/src/core/ext/transport/chttp2/transport/frame_security.cc +1 -2
  52. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +9 -0
  53. data/src/core/ext/transport/chttp2/transport/goaway.cc +1 -1
  54. data/src/core/ext/transport/chttp2/transport/goaway.h +0 -5
  55. data/src/core/ext/transport/chttp2/transport/header_assembler.h +1 -5
  56. data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +34 -19
  57. data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +5 -2
  58. data/src/core/ext/transport/chttp2/transport/http2_server_transport.cc +134 -82
  59. data/src/core/ext/transport/chttp2/transport/http2_server_transport.h +30 -15
  60. data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +4 -3
  61. data/src/core/ext/transport/chttp2/transport/http2_transport.cc +9 -33
  62. data/src/core/ext/transport/chttp2/transport/http2_transport.h +1 -6
  63. data/src/core/ext/transport/chttp2/transport/http2_transport_stats.h +60 -0
  64. data/src/core/ext/transport/chttp2/transport/internal.h +6 -1
  65. data/src/core/ext/transport/chttp2/transport/keepalive.h +1 -4
  66. data/src/core/ext/transport/chttp2/transport/parsing.cc +4 -8
  67. data/src/core/ext/transport/chttp2/transport/ping_promise.cc +35 -11
  68. data/src/core/ext/transport/chttp2/transport/ping_promise.h +52 -47
  69. data/src/core/ext/transport/chttp2/transport/read_context.h +19 -5
  70. data/src/core/ext/transport/chttp2/transport/security_frame.h +7 -6
  71. data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +7 -5
  72. data/src/core/ext/transport/chttp2/transport/transport_common.cc +47 -0
  73. data/src/core/ext/transport/chttp2/transport/transport_common.h +29 -0
  74. data/src/core/ext/transport/chttp2/transport/writable_streams.h +1 -1
  75. data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +1 -7
  76. data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb.h +16 -0
  77. data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.c +4 -3
  78. data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb.h +129 -81
  79. data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.c +50 -39
  80. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +411 -163
  81. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +95 -44
  82. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.h +3 -0
  83. data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb.h +41 -8
  84. data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.c +8 -5
  85. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +427 -222
  86. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +97 -66
  87. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.h +1 -0
  88. data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb.h +130 -99
  89. data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.c +29 -27
  90. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +49 -33
  91. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +19 -8
  92. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb.h +95 -3
  93. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.c +33 -6
  94. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.h +1 -0
  95. data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb.h +93 -11
  96. data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb_minitable.c +8 -5
  97. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +656 -134
  98. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +117 -51
  99. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.h +2 -0
  100. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb.h +45 -23
  101. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.c +19 -10
  102. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +99 -34
  103. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +12 -7
  104. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +344 -273
  105. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +62 -69
  106. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.h +1 -3
  107. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +53 -22
  108. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +9 -7
  109. data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb.h +108 -0
  110. data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.c +26 -2
  111. data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.h +1 -0
  112. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +809 -231
  113. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +183 -77
  114. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.h +3 -0
  115. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +151 -26
  116. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +17 -9
  117. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +24 -8
  118. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +6 -5
  119. data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb.h +2 -1
  120. data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb.h +224 -16
  121. data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb_minitable.c +83 -10
  122. data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb_minitable.h +2 -0
  123. data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb.h +95 -79
  124. data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb_minitable.c +23 -22
  125. data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h +34 -18
  126. data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c +10 -9
  127. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h +243 -2
  128. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c +53 -5
  129. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h +3 -0
  130. data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h +53 -22
  131. data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c +9 -7
  132. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +23 -7
  133. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +9 -4
  134. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +516 -215
  135. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +99 -60
  136. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.h +1 -0
  137. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +60 -28
  138. 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 +12 -10
  139. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +109 -0
  140. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +32 -2
  141. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.h +1 -0
  142. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb.h +37 -4
  143. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb_minitable.c +7 -4
  144. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +65 -47
  145. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +29 -12
  146. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +20 -4
  147. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb_minitable.c +6 -3
  148. data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb.h +776 -88
  149. data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb_minitable.c +195 -35
  150. data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb_minitable.h +5 -0
  151. data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb.h +23 -7
  152. data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb_minitable.c +10 -3
  153. data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb.h +44 -0
  154. data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.c +11 -2
  155. data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.h +1 -0
  156. data/src/core/ext/upb-gen/envoy/type/v3/scope.upb.h +218 -0
  157. data/src/core/ext/upb-gen/envoy/type/v3/scope.upb_minitable.c +70 -0
  158. data/src/core/ext/upb-gen/envoy/type/v3/scope.upb_minitable.h +31 -0
  159. data/src/core/ext/upbdefs-gen/envoy/admin/v3/clusters.upbdefs.c +30 -24
  160. data/src/core/ext/upbdefs-gen/envoy/admin/v3/server_info.upbdefs.c +166 -152
  161. data/src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +467 -422
  162. data/src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +15 -0
  163. data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +120 -110
  164. data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.c +912 -857
  165. data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.h +5 -0
  166. data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/outlier_detection.upbdefs.c +26 -19
  167. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/address.upbdefs.c +59 -54
  168. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.c +356 -346
  169. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.h +5 -0
  170. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/http_service.upbdefs.c +49 -37
  171. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.c +599 -483
  172. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.h +10 -0
  173. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/socket_option.upbdefs.c +65 -49
  174. data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +165 -161
  175. data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.c +369 -327
  176. data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.h +5 -15
  177. data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/stats.upbdefs.c +129 -121
  178. data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.c +224 -204
  179. data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.h +5 -0
  180. data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.c +2046 -1932
  181. data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.h +15 -0
  182. data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opentelemetry.upbdefs.c +70 -37
  183. data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/zipkin.upbdefs.c +7 -3
  184. data/src/core/ext/upbdefs-gen/envoy/data/accesslog/v3/accesslog.upbdefs.c +5 -3
  185. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/composite/v3/composite.upbdefs.c +121 -78
  186. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/composite/v3/composite.upbdefs.h +10 -0
  187. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upbdefs.c +165 -160
  188. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +121 -118
  189. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c +68 -37
  190. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h +15 -0
  191. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c +48 -40
  192. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c +44 -37
  193. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +919 -870
  194. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -0
  195. data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upbdefs.c +26 -14
  196. data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +44 -36
  197. data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +372 -371
  198. data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c +32 -28
  199. data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/address.upbdefs.c +17 -15
  200. data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/status_code_input.upbdefs.c +4 -1
  201. data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/status_code_input.upbdefs.h +5 -0
  202. data/src/core/ext/upbdefs-gen/envoy/type/v3/scope.upbdefs.c +76 -0
  203. data/src/core/ext/upbdefs-gen/envoy/type/v3/scope.upbdefs.h +37 -0
  204. data/src/core/ext/upbdefs-gen/envoy/type/v3/token_bucket.upbdefs.c +1 -1
  205. data/src/core/filter/ext_proc/ext_proc_filter.cc +537 -259
  206. data/src/core/filter/ext_proc/ext_proc_filter.h +47 -14
  207. data/src/core/filter/ext_proc/ext_proc_messages.cc +38 -17
  208. data/src/core/filter/ext_proc/ext_proc_messages.h +19 -7
  209. data/src/core/filter/filter_args.h +5 -60
  210. data/src/core/handshaker/http_connect/http_connect_client_handshaker.cc +1 -1
  211. data/src/core/handshaker/security/pipelined_secure_endpoint.cc +23 -22
  212. data/src/core/handshaker/security/secure_endpoint.cc +16 -16
  213. data/src/core/lib/channel/channel_stack.cc +0 -12
  214. data/src/core/lib/channel/channel_stack.h +0 -8
  215. data/src/core/lib/channel/promise_based_filter.cc +57 -44
  216. data/src/core/lib/channel/promise_based_filter.h +29 -41
  217. data/src/core/lib/event_engine/ares_resolver.cc +10 -4
  218. data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +1 -1
  219. data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +3 -3
  220. data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +1 -5
  221. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +10 -12
  222. data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.cc +3 -17
  223. data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +21 -1
  224. data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +5 -5
  225. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +10 -12
  226. data/src/core/lib/event_engine/posix_engine/posix_interface.h +1 -1
  227. data/src/core/lib/event_engine/posix_engine/timer.cc +2 -2
  228. data/src/core/lib/event_engine/shim.cc +1 -6
  229. data/src/core/lib/event_engine/shim.h +0 -5
  230. data/src/core/lib/event_engine/windows/windows_engine.cc +4 -4
  231. data/src/core/lib/event_engine/windows/windows_listener.cc +1 -1
  232. data/src/core/lib/experiments/experiments.cc +141 -246
  233. data/src/core/lib/experiments/experiments.h +42 -109
  234. data/src/core/lib/iomgr/iomgr_windows.cc +1 -6
  235. data/src/core/lib/iomgr/tcp_posix.cc +21 -21
  236. data/src/core/lib/iomgr/tcp_server_posix.cc +64 -242
  237. data/src/core/lib/iomgr/tcp_server_windows.cc +0 -469
  238. data/src/core/lib/promise/activity.cc +8 -8
  239. data/src/core/lib/promise/activity.h +5 -5
  240. data/src/core/lib/promise/inter_activity_pipe.h +3 -3
  241. data/src/core/lib/promise/party.cc +5 -5
  242. data/src/core/lib/promise/status_flag.h +7 -2
  243. data/src/core/lib/resource_quota/memory_quota.cc +2 -2
  244. data/src/core/lib/security/authorization/rbac_policy.h +2 -2
  245. data/src/core/lib/surface/call.cc +13 -3
  246. data/src/core/lib/surface/call.h +23 -6
  247. data/src/core/lib/surface/channel_create.cc +7 -1
  248. data/src/core/lib/surface/channel_init.h +1 -8
  249. data/src/core/lib/surface/filter_stack_call.cc +16 -0
  250. data/src/core/lib/surface/filter_stack_call.h +1 -0
  251. data/src/core/lib/surface/init.cc +3 -3
  252. data/src/core/lib/surface/legacy_channel.cc +4 -1
  253. data/src/core/lib/surface/version.cc +1 -1
  254. data/src/core/lib/transport/transport.cc +15 -8
  255. data/src/core/lib/transport/transport_framing_endpoint_extension.h +8 -2
  256. data/src/core/load_balancing/autosharding/autosharding.cc +0 -8
  257. data/src/core/load_balancing/outlier_detection/outlier_detection.cc +99 -8
  258. data/src/core/load_balancing/outlier_detection/outlier_detection_metrics.cc +38 -0
  259. data/src/core/load_balancing/outlier_detection/outlier_detection_metrics.h +55 -0
  260. data/src/core/load_balancing/ring_hash/ring_hash.cc +2 -1
  261. data/src/core/load_balancing/rls/rls.cc +21 -1
  262. data/src/core/load_balancing/xds/cds.cc +4 -51
  263. data/src/core/plugin_registry/grpc_plugin_registry.cc +10 -13
  264. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +0 -7
  265. data/src/core/resolver/xds/xds_resolver.cc +1 -1
  266. data/src/core/server/server.cc +60 -4
  267. data/src/core/server/server_config_selector.h +4 -18
  268. data/src/core/server/server_config_selector_filter.cc +20 -146
  269. data/src/core/server/server_config_selector_filter.h +2 -2
  270. data/src/core/server/xds_server_config_fetcher.cc +5 -20
  271. data/src/core/transport/auth_context.cc +15 -5
  272. data/src/core/transport/auth_context.h +5 -0
  273. data/src/core/tsi/ssl_telemetry_utils.cc +9 -1
  274. data/src/core/tsi/ssl_transport_security.cc +158 -52
  275. data/src/core/tsi/ssl_transport_security.h +18 -2
  276. data/src/core/tsi/ssl_transport_security_utils.cc +123 -12
  277. data/src/core/tsi/ssl_transport_security_utils.h +19 -0
  278. data/src/core/util/latent_see.cc +65 -3
  279. data/src/core/util/latent_see.h +57 -12
  280. data/src/core/util/linux/cpu.cc +12 -6
  281. data/src/core/util/mpscq.cc +2 -2
  282. data/src/core/util/sync_abseil.cc +3 -3
  283. data/src/core/util/trie_lookup.h +5 -1
  284. data/src/core/util/windows/env.cc +1 -0
  285. data/src/core/util/work_serializer.cc +1 -1
  286. data/src/core/xds/grpc/file_watcher_certificate_provider_factory.cc +10 -9
  287. data/src/core/xds/grpc/file_watcher_certificate_provider_factory.h +3 -3
  288. data/src/core/xds/grpc/streaming_call_promise_wrapper.cc +5 -2
  289. data/src/core/xds/grpc/streaming_call_promise_wrapper.h +2 -5
  290. data/src/core/xds/grpc/xds_audit_logger_registry.cc +0 -54
  291. data/src/core/xds/grpc/xds_audit_logger_registry.h +0 -8
  292. data/src/core/xds/grpc/xds_bootstrap_grpc_builder.cc +2 -28
  293. data/src/core/xds/grpc/xds_bootstrap_grpc_builder.h +0 -20
  294. data/src/core/xds/grpc/xds_client_grpc.cc +4 -4
  295. data/src/core/xds/grpc/xds_client_grpc.h +1 -1
  296. data/src/core/xds/grpc/xds_cluster_parser.cc +5 -1
  297. data/src/core/xds/grpc/xds_common_types_parser.cc +12 -0
  298. data/src/core/xds/grpc/xds_endpoint_parser.cc +3 -3
  299. data/src/core/xds/grpc/xds_http_composite_filter.cc +0 -5
  300. data/src/core/xds/grpc/xds_http_composite_filter.h +1 -27
  301. data/src/core/xds/grpc/xds_http_ext_proc_filter.cc +1 -5
  302. data/src/core/xds/grpc/xds_http_ext_proc_filter.h +3 -29
  303. data/src/core/xds/grpc/xds_http_fault_filter.cc +0 -4
  304. data/src/core/xds/grpc/xds_http_fault_filter.h +0 -26
  305. data/src/core/xds/grpc/xds_http_filter.h +1 -63
  306. data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +0 -5
  307. data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +1 -27
  308. data/src/core/xds/grpc/xds_http_rbac_filter.cc +0 -527
  309. data/src/core/xds/grpc/xds_http_rbac_filter.h +0 -15
  310. data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +0 -5
  311. data/src/core/xds/grpc/xds_http_stateful_session_filter.h +0 -26
  312. data/src/core/xds/grpc/xds_listener.cc +0 -2
  313. data/src/core/xds/grpc/xds_listener.h +0 -2
  314. data/src/core/xds/grpc/xds_listener_parser.cc +0 -7
  315. data/src/core/xds/grpc/xds_matcher.cc +17 -11
  316. data/src/core/xds/grpc/xds_matcher.h +2 -1
  317. data/src/core/xds/grpc/xds_matcher_context.cc +3 -0
  318. data/src/core/xds/grpc/xds_matcher_context.h +1 -1
  319. data/src/core/xds/grpc/xds_matcher_input.cc +19 -1
  320. data/src/core/xds/grpc/xds_matcher_parse.cc +3 -2
  321. data/src/core/xds/grpc/xds_route_config.cc +0 -2
  322. data/src/core/xds/grpc/xds_route_config.h +0 -2
  323. data/src/core/xds/grpc/xds_route_config_parser.cc +0 -5
  324. data/src/core/xds/grpc/xds_routing.cc +1 -112
  325. data/src/core/xds/grpc/xds_routing.h +0 -26
  326. data/src/core/xds/grpc/xds_transport_factory_grpc.cc +236 -0
  327. data/src/core/xds/grpc/xds_transport_factory_grpc.h +95 -0
  328. data/src/core/xds/grpc/xds_transport_grpc.cc +78 -241
  329. data/src/core/xds/grpc/xds_transport_grpc.h +41 -51
  330. data/src/core/xds/xds_client/lrs_client.cc +3 -5
  331. data/src/core/xds/xds_client/lrs_client.h +2 -1
  332. data/src/core/xds/xds_client/xds_client.cc +36 -23
  333. data/src/core/xds/xds_client/xds_client.h +6 -5
  334. data/src/core/xds/xds_client/xds_transport.h +110 -108
  335. data/src/core/xds/xds_client/xds_transport_factory.h +43 -0
  336. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +4 -0
  337. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +6 -0
  338. data/src/ruby/lib/grpc/generic/rpc_server.rb +2 -2
  339. data/src/ruby/lib/grpc/version.rb +1 -1
  340. data/third_party/boringssl-with-bazel/crypto/asn1/a_type.cc +54 -19
  341. data/third_party/boringssl-with-bazel/crypto/asn1/asn1_lib.cc +1 -1
  342. data/third_party/boringssl-with-bazel/crypto/asn1/internal.h +58 -12
  343. data/third_party/boringssl-with-bazel/crypto/asn1/tasn_dec.cc +13 -13
  344. data/third_party/boringssl-with-bazel/crypto/asn1/tasn_enc.cc +13 -11
  345. data/third_party/boringssl-with-bazel/crypto/asn1/tasn_fre.cc +14 -18
  346. data/third_party/boringssl-with-bazel/crypto/asn1/tasn_new.cc +31 -35
  347. data/third_party/boringssl-with-bazel/crypto/asn1/tasn_typ.cc +0 -2
  348. data/third_party/boringssl-with-bazel/crypto/asn1/tasn_utl.cc +17 -24
  349. data/third_party/boringssl-with-bazel/crypto/bio/bio.cc +0 -1
  350. data/third_party/boringssl-with-bazel/crypto/bio/bio_mem.cc +9 -3
  351. data/third_party/boringssl-with-bazel/crypto/bio/connect.cc +3 -3
  352. data/third_party/boringssl-with-bazel/crypto/bio/fd.cc +0 -1
  353. data/third_party/boringssl-with-bazel/crypto/bio/file.cc +0 -1
  354. data/third_party/boringssl-with-bazel/crypto/bio/internal.h +2 -3
  355. data/third_party/boringssl-with-bazel/crypto/bio/pair.cc +0 -1
  356. data/third_party/boringssl-with-bazel/crypto/bio/socket.cc +1 -1
  357. data/third_party/boringssl-with-bazel/crypto/bytestring/cbb.cc +70 -45
  358. data/third_party/boringssl-with-bazel/crypto/bytestring/cbs.cc +15 -34
  359. data/third_party/boringssl-with-bazel/crypto/bytestring/internal.h +5 -0
  360. data/third_party/boringssl-with-bazel/crypto/cipher/e_aesgcmsiv.cc +20 -165
  361. data/third_party/boringssl-with-bazel/crypto/cipher/e_tls.cc +7 -4
  362. data/third_party/boringssl-with-bazel/crypto/cipher/internal.h +159 -0
  363. data/third_party/boringssl-with-bazel/crypto/curve25519/curve25519.cc +295 -16
  364. data/third_party/boringssl-with-bazel/crypto/curve25519/internal.h +25 -14
  365. data/third_party/boringssl-with-bazel/crypto/dh/params.cc +1 -1
  366. data/third_party/boringssl-with-bazel/crypto/ec/hash_to_curve.cc +208 -36
  367. data/third_party/boringssl-with-bazel/crypto/err/err.cc +3 -2
  368. data/third_party/boringssl-with-bazel/crypto/evp/evp.cc +3 -0
  369. data/third_party/boringssl-with-bazel/crypto/evp/evp_kem.cc +25 -6
  370. data/third_party/boringssl-with-bazel/crypto/evp/internal.h +15 -11
  371. data/third_party/boringssl-with-bazel/crypto/evp/p_ec.cc +121 -0
  372. data/third_party/boringssl-with-bazel/crypto/evp/p_mlkem.cc +34 -9
  373. data/third_party/boringssl-with-bazel/crypto/evp/p_rsa.cc +76 -8
  374. data/third_party/boringssl-with-bazel/crypto/evp/p_xwing.cc +47 -20
  375. data/third_party/boringssl-with-bazel/crypto/ex_data.cc +1 -1
  376. data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/aes_nohw.cc.inc +1 -1
  377. data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/gcm.cc.inc +2 -2
  378. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bcm.cc +1 -0
  379. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/add.cc.inc +9 -4
  380. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/asm/x86_64-gcc.cc.inc +4 -4
  381. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/exponentiation.cc.inc +2 -2
  382. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/internal.h +12 -6
  383. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/jacobi.cc.inc +1 -1
  384. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/montgomery_inv.cc.inc +4 -4
  385. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/prime.cc.inc +3 -3
  386. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/rsaz_exp.cc.inc +6 -6
  387. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/sqrt.cc.inc +21 -21
  388. data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/aead.cc.inc +4 -2
  389. data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/cipher.cc.inc +97 -132
  390. data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/internal.h +7 -6
  391. data/third_party/boringssl-with-bazel/crypto/fipsmodule/dh/dh.cc.inc +3 -3
  392. data/third_party/boringssl-with-bazel/crypto/fipsmodule/dh/internal.h +1 -1
  393. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/ec.cc.inc +77 -17
  394. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/ec_montgomery.cc.inc +13 -13
  395. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/felem.cc.inc +117 -34
  396. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/internal.h +67 -18
  397. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/oct.cc.inc +29 -151
  398. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256-nistz.cc.inc +740 -0
  399. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256-nistz.h +207 -0
  400. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256.cc.inc +407 -519
  401. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/simple.cc.inc +27 -28
  402. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ecdsa/ecdsa.cc.inc +1 -1
  403. data/third_party/boringssl-with-bazel/crypto/fipsmodule/entropy/jitter.cc.inc +1 -1
  404. data/third_party/boringssl-with-bazel/crypto/fipsmodule/fips_shared_support.cc +4 -4
  405. data/third_party/boringssl-with-bazel/crypto/fipsmodule/keccak/internal.h +70 -1
  406. data/third_party/boringssl-with-bazel/crypto/fipsmodule/keccak/keccak.cc.inc +292 -52
  407. data/third_party/boringssl-with-bazel/crypto/fipsmodule/mldsa/mldsa.cc.inc +226 -69
  408. data/third_party/boringssl-with-bazel/crypto/fipsmodule/mlkem/mlkem.cc.inc +238 -83
  409. data/third_party/boringssl-with-bazel/crypto/fipsmodule/rsa/rsa_impl.cc.inc +6 -6
  410. data/third_party/boringssl-with-bazel/crypto/fipsmodule/sha/sha1.cc.inc +2 -2
  411. data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/fors.cc.inc +1 -1
  412. data/third_party/boringssl-with-bazel/crypto/hpke/hpke.cc +327 -272
  413. data/third_party/boringssl-with-bazel/crypto/hrss/hrss.cc +14 -14
  414. data/third_party/boringssl-with-bazel/crypto/internal.h +63 -0
  415. data/third_party/boringssl-with-bazel/crypto/mem_internal.h +38 -3
  416. data/third_party/boringssl-with-bazel/crypto/obj/obj_dat.h +97 -1
  417. data/third_party/boringssl-with-bazel/crypto/pem/internal.h +86 -0
  418. data/third_party/boringssl-with-bazel/crypto/pem/pem_all.cc +8 -5
  419. data/third_party/boringssl-with-bazel/crypto/pem/pem_lib.cc +41 -73
  420. data/third_party/boringssl-with-bazel/crypto/pem/pem_pk8.cc +3 -0
  421. data/third_party/boringssl-with-bazel/crypto/pem/pem_pkey.cc +10 -4
  422. data/third_party/boringssl-with-bazel/crypto/pem/pem_x509.cc +3 -0
  423. data/third_party/boringssl-with-bazel/crypto/pem/pem_xaux.cc +3 -0
  424. data/third_party/boringssl-with-bazel/crypto/pkcs7/pkcs7.cc +1 -1
  425. data/third_party/boringssl-with-bazel/crypto/pkcs7/pkcs7_x509.cc +2 -2
  426. data/third_party/boringssl-with-bazel/crypto/pkcs8/pkcs8_x509.cc +1 -1
  427. data/third_party/boringssl-with-bazel/crypto/poly1305/internal.h +17 -0
  428. data/third_party/boringssl-with-bazel/crypto/poly1305/poly1305_arm.cc +1 -13
  429. data/third_party/boringssl-with-bazel/crypto/poly1305/poly1305_vec.cc +3 -3
  430. data/third_party/boringssl-with-bazel/crypto/slhdsa/slhdsa.cc +23 -6
  431. data/third_party/boringssl-with-bazel/crypto/stack/stack.cc +7 -0
  432. data/third_party/boringssl-with-bazel/crypto/trust_token/internal.h +1 -1
  433. data/third_party/boringssl-with-bazel/crypto/x509/a_verify.cc +14 -7
  434. data/third_party/boringssl-with-bazel/crypto/x509/internal.h +110 -76
  435. data/third_party/boringssl-with-bazel/crypto/x509/name_print.cc +1 -1
  436. data/third_party/boringssl-with-bazel/crypto/x509/rsa_pss.cc +1 -1
  437. data/third_party/boringssl-with-bazel/crypto/x509/t_req.cc +1 -1
  438. data/third_party/boringssl-with-bazel/crypto/x509/t_x509.cc +6 -5
  439. data/third_party/boringssl-with-bazel/crypto/x509/v3_crld.cc +11 -53
  440. data/third_party/boringssl-with-bazel/crypto/x509/v3_ncons.cc +5 -5
  441. data/third_party/boringssl-with-bazel/crypto/x509/v3_purp.cc +16 -39
  442. data/third_party/boringssl-with-bazel/crypto/x509/v3_skey.cc +1 -1
  443. data/third_party/boringssl-with-bazel/crypto/x509/v3_utl.cc +12 -16
  444. data/third_party/boringssl-with-bazel/crypto/x509/x509_cmp.cc +9 -11
  445. data/third_party/boringssl-with-bazel/crypto/x509/x509_mtc.cc +598 -0
  446. data/third_party/boringssl-with-bazel/crypto/x509/x509_obj.cc +9 -8
  447. data/third_party/boringssl-with-bazel/crypto/x509/x509_set.cc +14 -18
  448. data/third_party/boringssl-with-bazel/crypto/x509/x509_vfy.cc +315 -390
  449. data/third_party/boringssl-with-bazel/crypto/x509/x509_vpm.cc +1 -1
  450. data/third_party/boringssl-with-bazel/crypto/x509/x509name.cc +31 -29
  451. data/third_party/boringssl-with-bazel/crypto/x509/x_all.cc +10 -9
  452. data/third_party/boringssl-with-bazel/crypto/x509/x_crl.cc +3 -53
  453. data/third_party/boringssl-with-bazel/crypto/x509/x_name.cc +37 -59
  454. data/third_party/boringssl-with-bazel/crypto/x509/x_pubkey.cc +29 -47
  455. data/third_party/boringssl-with-bazel/crypto/x509/x_req.cc +2 -1
  456. data/third_party/boringssl-with-bazel/crypto/x509/x_x509.cc +53 -53
  457. data/third_party/boringssl-with-bazel/gen/boringssl_prefix_symbols_internal_x86_64_win_asm.inc +24 -0
  458. data/third_party/boringssl-with-bazel/gen/boringssl_prefix_symbols_internal_x86_win_asm.inc +24 -0
  459. data/third_party/boringssl-with-bazel/gen/crypto/err_data.cc +509 -497
  460. data/third_party/boringssl-with-bazel/include/openssl/aead.h +7 -19
  461. data/third_party/boringssl-with-bazel/include/openssl/asm_base.h +1 -1
  462. data/third_party/boringssl-with-bazel/include/openssl/asn1.h +6 -10
  463. data/third_party/boringssl-with-bazel/include/openssl/base.h +43 -16
  464. data/third_party/boringssl-with-bazel/include/openssl/bio.h +25 -10
  465. data/third_party/boringssl-with-bazel/include/openssl/bytestring.h +33 -1
  466. data/third_party/boringssl-with-bazel/include/openssl/cipher.h +11 -9
  467. data/third_party/boringssl-with-bazel/include/openssl/configuration.h +18 -0
  468. data/third_party/boringssl-with-bazel/include/openssl/curve25519.h +36 -0
  469. data/third_party/boringssl-with-bazel/include/openssl/digest.h +4 -4
  470. data/third_party/boringssl-with-bazel/include/openssl/ec.h +35 -1
  471. data/third_party/boringssl-with-bazel/include/openssl/ec_key.h +2 -2
  472. data/third_party/boringssl-with-bazel/include/openssl/evp.h +120 -3
  473. data/third_party/boringssl-with-bazel/include/openssl/evp_errors.h +1 -0
  474. data/third_party/boringssl-with-bazel/include/openssl/hmac.h +2 -2
  475. data/third_party/boringssl-with-bazel/include/openssl/hpke.h +38 -7
  476. data/third_party/boringssl-with-bazel/include/openssl/mem.h +5 -5
  477. data/third_party/boringssl-with-bazel/include/openssl/nid.h +42 -0
  478. data/third_party/boringssl-with-bazel/include/openssl/pem.h +650 -351
  479. data/third_party/boringssl-with-bazel/include/openssl/posix_time.h +4 -4
  480. data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols.h +130 -4
  481. data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols_internal_S.h +48 -0
  482. data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols_internal_c.h +24 -0
  483. data/third_party/boringssl-with-bazel/include/openssl/rsa.h +1 -1
  484. data/third_party/boringssl-with-bazel/include/openssl/slhdsa.h +25 -1
  485. data/third_party/boringssl-with-bazel/include/openssl/ssl.h +256 -87
  486. data/third_party/boringssl-with-bazel/include/openssl/stack.h +9 -0
  487. data/third_party/boringssl-with-bazel/include/openssl/types.h +18 -0
  488. data/third_party/boringssl-with-bazel/include/openssl/x509.h +40 -21
  489. data/third_party/boringssl-with-bazel/ssl/bio_ssl.cc +3 -5
  490. data/third_party/boringssl-with-bazel/ssl/d1_both.cc +146 -81
  491. data/third_party/boringssl-with-bazel/ssl/d1_lib.cc +39 -34
  492. data/third_party/boringssl-with-bazel/ssl/d1_pkt.cc +6 -6
  493. data/third_party/boringssl-with-bazel/ssl/d1_srtp.cc +10 -8
  494. data/third_party/boringssl-with-bazel/ssl/dtls_method.cc +4 -4
  495. data/third_party/boringssl-with-bazel/ssl/dtls_record.cc +15 -14
  496. data/third_party/boringssl-with-bazel/ssl/encrypted_client_hello.cc +41 -25
  497. data/third_party/boringssl-with-bazel/ssl/extensions.cc +153 -171
  498. data/third_party/boringssl-with-bazel/ssl/handoff.cc +79 -64
  499. data/third_party/boringssl-with-bazel/ssl/handshake.cc +15 -16
  500. data/third_party/boringssl-with-bazel/ssl/handshake_client.cc +35 -78
  501. data/third_party/boringssl-with-bazel/ssl/handshake_server.cc +75 -155
  502. data/third_party/boringssl-with-bazel/ssl/internal.h +419 -308
  503. data/third_party/boringssl-with-bazel/ssl/s3_both.cc +17 -150
  504. data/third_party/boringssl-with-bazel/ssl/s3_lib.cc +2 -3
  505. data/third_party/boringssl-with-bazel/ssl/s3_pkt.cc +10 -9
  506. data/third_party/boringssl-with-bazel/ssl/ssl_asn1.cc +13 -13
  507. data/third_party/boringssl-with-bazel/ssl/ssl_buffer.cc +8 -8
  508. data/third_party/boringssl-with-bazel/ssl/ssl_cert.cc +58 -24
  509. data/third_party/boringssl-with-bazel/ssl/ssl_cipher.cc +198 -26
  510. data/third_party/boringssl-with-bazel/ssl/ssl_credential.cc +164 -37
  511. data/third_party/boringssl-with-bazel/ssl/ssl_file.cc +10 -8
  512. data/third_party/boringssl-with-bazel/ssl/ssl_key_share.cc +2 -95
  513. data/third_party/boringssl-with-bazel/ssl/ssl_lib.cc +785 -472
  514. data/third_party/boringssl-with-bazel/ssl/ssl_privkey.cc +78 -67
  515. data/third_party/boringssl-with-bazel/ssl/ssl_session.cc +187 -150
  516. data/third_party/boringssl-with-bazel/ssl/ssl_stat.cc +6 -3
  517. data/third_party/boringssl-with-bazel/ssl/ssl_transcript.cc +1 -1
  518. data/third_party/boringssl-with-bazel/ssl/ssl_versions.cc +25 -19
  519. data/third_party/boringssl-with-bazel/ssl/ssl_x509.cc +148 -114
  520. data/third_party/boringssl-with-bazel/ssl/t1_enc.cc +28 -19
  521. data/third_party/boringssl-with-bazel/ssl/tls13_both.cc +24 -22
  522. data/third_party/boringssl-with-bazel/ssl/tls13_client.cc +30 -30
  523. data/third_party/boringssl-with-bazel/ssl/tls13_enc.cc +17 -16
  524. data/third_party/boringssl-with-bazel/ssl/tls13_server.cc +55 -63
  525. data/third_party/boringssl-with-bazel/ssl/tls_method.cc +12 -12
  526. data/third_party/boringssl-with-bazel/ssl/tls_record.cc +23 -20
  527. data/third_party/boringssl-with-bazel/third_party/fiat/p256_64.h +38 -0
  528. data/third_party/boringssl-with-bazel/third_party/fiat/p256_64_msvc.h +2 -0
  529. data/third_party/boringssl-with-bazel/third_party/fiat/p256_field.c.inc +26 -0
  530. data/third_party/boringssl-with-bazel/third_party/fiat/p256_point.br.c.inc +0 -54
  531. data/third_party/cares/cares/include/ares.h +8 -0
  532. data/third_party/cares/cares/include/ares_dns_record.h +3 -2
  533. data/third_party/cares/cares/include/ares_version.h +3 -3
  534. data/third_party/cares/cares/src/lib/ares_addrinfo_localhost.c +20 -20
  535. data/third_party/cares/cares/src/lib/ares_cancel.c +17 -8
  536. data/third_party/cares/cares/src/lib/ares_close_sockets.c +81 -16
  537. data/third_party/cares/cares/src/lib/ares_conn.c +256 -10
  538. data/third_party/cares/cares/src/lib/ares_conn.h +40 -3
  539. data/third_party/cares/cares/src/lib/ares_cookie.c +2 -2
  540. data/third_party/cares/cares/src/lib/ares_destroy.c +75 -10
  541. data/third_party/cares/cares/src/lib/ares_getaddrinfo.c +85 -10
  542. data/third_party/cares/cares/src/lib/ares_gethostbyaddr.c +5 -0
  543. data/third_party/cares/cares/src/lib/ares_gethostbyname.c +4 -0
  544. data/third_party/cares/cares/src/lib/ares_getnameinfo.c +10 -2
  545. data/third_party/cares/cares/src/lib/ares_hosts_file.c +8 -0
  546. data/third_party/cares/cares/src/lib/ares_inet_net_pton.h +28 -0
  547. data/third_party/cares/cares/src/lib/ares_init.c +55 -10
  548. data/third_party/cares/cares/src/lib/ares_library_init.c +25 -7
  549. data/third_party/cares/cares/src/lib/ares_options.c +38 -10
  550. data/third_party/cares/cares/src/lib/ares_parse_into_addrinfo.c +1 -1
  551. data/third_party/cares/cares/src/lib/ares_private.h +186 -27
  552. data/third_party/cares/cares/src/lib/ares_process.c +604 -112
  553. data/third_party/cares/cares/src/lib/ares_qcache.c +200 -36
  554. data/third_party/cares/cares/src/lib/ares_query.c +5 -0
  555. data/third_party/cares/cares/src/lib/ares_search.c +10 -0
  556. data/third_party/cares/cares/src/lib/ares_send.c +81 -10
  557. data/third_party/cares/cares/src/lib/ares_set_socket_functions.c +3 -1
  558. data/third_party/cares/cares/src/lib/ares_socket.c +28 -0
  559. data/third_party/cares/cares/src/lib/ares_socket.h +23 -0
  560. data/third_party/cares/cares/src/lib/ares_sysconfig.c +6 -3
  561. data/third_party/cares/cares/src/lib/ares_sysconfig_files.c +33 -11
  562. data/third_party/cares/cares/src/lib/ares_sysconfig_win.c +132 -80
  563. data/third_party/cares/cares/src/lib/ares_timeout.c +11 -0
  564. data/third_party/cares/cares/src/lib/ares_update_servers.c +55 -11
  565. data/third_party/cares/cares/src/lib/dsa/ares_array.c +20 -5
  566. data/third_party/cares/cares/src/lib/dsa/ares_htable.c +8 -4
  567. data/third_party/cares/cares/src/lib/dsa/ares_htable_dict.c +2 -0
  568. data/third_party/cares/cares/src/lib/dsa/ares_llist.c +4 -1
  569. data/third_party/cares/cares/src/lib/event/ares_event_configchg.c +5 -2
  570. data/third_party/cares/cares/src/lib/event/ares_event_select.c +14 -1
  571. data/third_party/cares/cares/src/lib/event/ares_event_thread.c +8 -0
  572. data/third_party/cares/cares/src/lib/event/ares_event_wake_pipe.c +7 -1
  573. data/third_party/cares/cares/src/lib/event/ares_event_win32.c +3 -0
  574. data/third_party/cares/cares/src/lib/include/ares_mem.h +3 -0
  575. data/third_party/cares/cares/src/lib/include/ares_str.h +17 -0
  576. data/third_party/cares/cares/src/lib/inet_net_pton.c +37 -28
  577. data/third_party/cares/cares/src/lib/legacy/ares_expand_name.c +1 -1
  578. data/third_party/cares/cares/src/lib/legacy/ares_parse_a_reply.c +5 -2
  579. data/third_party/cares/cares/src/lib/legacy/ares_parse_aaaa_reply.c +5 -2
  580. data/third_party/cares/cares/src/lib/legacy/ares_parse_ns_reply.c +2 -2
  581. data/third_party/cares/cares/src/lib/legacy/ares_parse_ptr_reply.c +2 -2
  582. data/third_party/cares/cares/src/lib/legacy/ares_parse_uri_reply.c +1 -1
  583. data/third_party/cares/cares/src/lib/record/ares_dns_mapping.c +19 -4
  584. data/third_party/cares/cares/src/lib/record/ares_dns_multistring.c +3 -1
  585. data/third_party/cares/cares/src/lib/record/ares_dns_name.c +67 -4
  586. data/third_party/cares/cares/src/lib/record/ares_dns_parse.c +62 -34
  587. data/third_party/cares/cares/src/lib/record/ares_dns_private.h +4 -0
  588. data/third_party/cares/cares/src/lib/record/ares_dns_record.c +47 -7
  589. data/third_party/cares/cares/src/lib/record/ares_dns_write.c +13 -5
  590. data/third_party/cares/cares/src/lib/str/ares_buf.c +33 -16
  591. data/third_party/cares/cares/src/lib/str/ares_str.c +54 -0
  592. data/third_party/cares/cares/src/lib/util/ares_iface_ips.c +22 -10
  593. data/third_party/cares/cares/src/lib/util/ares_iface_ips.h +1 -0
  594. data/third_party/cares/cares/src/lib/util/ares_math.c +17 -2
  595. data/third_party/cares/cares/src/lib/util/ares_math.h +32 -7
  596. data/third_party/cares/cares/src/lib/util/ares_rand.c +4 -4
  597. data/third_party/cares/cares/src/lib/util/ares_threads.c +1 -2
  598. data/third_party/cares/cares/src/lib/util/ares_time.h +1 -0
  599. data/third_party/cares/cares/src/lib/util/ares_uri.c +9 -3
  600. data/third_party/zlib/compress.c +34 -10
  601. data/third_party/zlib/crc32.c +49 -115
  602. data/third_party/zlib/deflate.c +107 -61
  603. data/third_party/zlib/deflate.h +7 -1
  604. data/third_party/zlib/gzguts.h +33 -31
  605. data/third_party/zlib/infback.c +20 -67
  606. data/third_party/zlib/inffast.c +7 -6
  607. data/third_party/zlib/inffixed.h +91 -91
  608. data/third_party/zlib/inflate.c +38 -151
  609. data/third_party/zlib/inflate.h +1 -1
  610. data/third_party/zlib/inftrees.c +134 -9
  611. data/third_party/zlib/inftrees.h +3 -1
  612. data/third_party/zlib/trees.c +14 -12
  613. data/third_party/zlib/uncompr.c +39 -23
  614. data/third_party/zlib/zconf.h +27 -19
  615. data/third_party/zlib/zlib.h +215 -96
  616. data/third_party/zlib/zutil.c +49 -35
  617. data/third_party/zlib/zutil.h +87 -10
  618. metadata +23 -9
  619. data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +0 -916
  620. data/src/core/ext/filters/rbac/rbac_service_config_parser.h +0 -84
  621. data/src/core/server/xds_channel_stack_modifier.cc +0 -108
  622. data/src/core/server/xds_channel_stack_modifier.h +0 -62
  623. data/src/core/server/xds_server_config_fetcher_legacy.cc +0 -1340
  624. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256_internal.h +0 -193
  625. data/third_party/boringssl-with-bazel/crypto/kyber/internal.h +0 -165
  626. data/third_party/boringssl-with-bazel/crypto/kyber/kyber.cc +0 -870
@@ -1,1340 +0,0 @@
1
- //
2
- //
3
- // Copyright 2020 gRPC authors.
4
- //
5
- // Licensed under the Apache License, Version 2.0 (the "License");
6
- // you may not use this file except in compliance with the License.
7
- // You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing, software
12
- // distributed under the License is distributed on an "AS IS" BASIS,
13
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- // See the License for the specific language governing permissions and
15
- // limitations under the License.
16
- //
17
- //
18
-
19
- #include <grpc/credentials.h>
20
- #include <grpc/grpc.h>
21
- #include <grpc/grpc_security.h>
22
- #include <grpc/slice.h>
23
- #include <grpc/status.h>
24
- #include <grpc/support/port_platform.h>
25
- #include <string.h>
26
-
27
- #include <algorithm>
28
- #include <map>
29
- #include <memory>
30
- #include <optional>
31
- #include <set>
32
- #include <string>
33
- #include <utility>
34
- #include <variant>
35
- #include <vector>
36
-
37
- #include "src/core/call/metadata_batch.h"
38
- #include "src/core/config/core_configuration.h"
39
- #include "src/core/credentials/transport/tls/grpc_tls_certificate_distributor.h"
40
- #include "src/core/credentials/transport/tls/grpc_tls_certificate_provider.h"
41
- #include "src/core/credentials/transport/transport_credentials.h"
42
- #include "src/core/credentials/transport/xds/xds_credentials.h"
43
- #include "src/core/lib/address_utils/parse_address.h"
44
- #include "src/core/lib/address_utils/sockaddr_utils.h"
45
- #include "src/core/lib/channel/channel_args.h"
46
- #include "src/core/lib/channel/channel_args_preconditioning.h"
47
- #include "src/core/lib/channel/channel_fwd.h"
48
- #include "src/core/lib/debug/trace.h"
49
- #include "src/core/lib/iomgr/endpoint.h"
50
- #include "src/core/lib/iomgr/exec_ctx.h"
51
- #include "src/core/lib/iomgr/iomgr_fwd.h"
52
- #include "src/core/lib/iomgr/resolved_address.h"
53
- #include "src/core/lib/iomgr/sockaddr.h"
54
- #include "src/core/lib/iomgr/socket_utils.h"
55
- #include "src/core/server/server.h"
56
- #include "src/core/server/server_config_selector.h"
57
- #include "src/core/server/server_config_selector_filter.h"
58
- #include "src/core/server/xds_channel_stack_modifier.h"
59
- #include "src/core/service_config/service_config.h"
60
- #include "src/core/service_config/service_config_impl.h"
61
- #include "src/core/util/debug_location.h"
62
- #include "src/core/util/down_cast.h"
63
- #include "src/core/util/grpc_check.h"
64
- #include "src/core/util/host_port.h"
65
- #include "src/core/util/match.h"
66
- #include "src/core/util/ref_counted_ptr.h"
67
- #include "src/core/util/sync.h"
68
- #include "src/core/util/unique_type_name.h"
69
- #include "src/core/util/uri.h"
70
- #include "src/core/xds/grpc/certificate_provider_store.h"
71
- #include "src/core/xds/grpc/xds_bootstrap_grpc.h"
72
- #include "src/core/xds/grpc/xds_certificate_provider.h"
73
- #include "src/core/xds/grpc/xds_client_grpc.h"
74
- #include "src/core/xds/grpc/xds_common_types.h"
75
- #include "src/core/xds/grpc/xds_http_filter.h"
76
- #include "src/core/xds/grpc/xds_http_filter_registry.h"
77
- #include "src/core/xds/grpc/xds_listener.h"
78
- #include "src/core/xds/grpc/xds_listener_parser.h"
79
- #include "src/core/xds/grpc/xds_route_config.h"
80
- #include "src/core/xds/grpc/xds_route_config_parser.h"
81
- #include "src/core/xds/grpc/xds_routing.h"
82
- #include "src/core/xds/xds_client/xds_client.h"
83
- #include "absl/base/thread_annotations.h"
84
- #include "absl/log/log.h"
85
- #include "absl/status/status.h"
86
- #include "absl/status/statusor.h"
87
- #include "absl/strings/match.h"
88
- #include "absl/strings/numbers.h"
89
- #include "absl/strings/str_cat.h"
90
- #include "absl/strings/str_join.h"
91
- #include "absl/strings/str_replace.h"
92
- #include "absl/strings/string_view.h"
93
-
94
- namespace grpc_core {
95
- namespace {
96
-
97
- using ReadDelayHandle = XdsClient::ReadDelayHandle;
98
-
99
- // A server config fetcher that fetches the information for configuring server
100
- // listeners from the xDS control plane.
101
- class XdsServerConfigFetcher final : public ServerConfigFetcher {
102
- public:
103
- XdsServerConfigFetcher(RefCountedPtr<GrpcXdsClient> xds_client,
104
- grpc_server_xds_status_notifier notifier);
105
-
106
- ~XdsServerConfigFetcher() override {
107
- xds_client_.reset(DEBUG_LOCATION, "XdsServerConfigFetcher");
108
- }
109
-
110
- void StartWatch(
111
- std::string listening_address,
112
- std::unique_ptr<ServerConfigFetcher::WatcherInterface> watcher) override;
113
-
114
- void CancelWatch(ServerConfigFetcher::WatcherInterface* watcher) override;
115
-
116
- // Return the interested parties from the xds client so that it can be polled.
117
- grpc_pollset_set* interested_parties() override {
118
- return xds_client_->interested_parties();
119
- }
120
-
121
- private:
122
- class ListenerWatcher;
123
-
124
- RefCountedPtr<GrpcXdsClient> xds_client_;
125
- const grpc_server_xds_status_notifier serving_status_notifier_;
126
- Mutex mu_;
127
- std::map<ServerConfigFetcher::WatcherInterface*, ListenerWatcher*>
128
- listener_watchers_ ABSL_GUARDED_BY(mu_);
129
- };
130
-
131
- // A watcher implementation for listening on LDS updates from the xDS control
132
- // plane. When a good LDS update is received, it creates a
133
- // FilterChainMatchManager object that would replace the existing (if any)
134
- // FilterChainMatchManager object after all referenced RDS resources are
135
- // fetched. Note that a good update also causes the server listener to start
136
- // listening if it isn't already. If an error LDS update is received (NACKed
137
- // resource, timeouts), the previous good FilterChainMatchManager, if any,
138
- // continues to be used. If there isn't any previous good update or if the
139
- // update received was a fatal error (resource does not exist), the server
140
- // listener is made to stop listening.
141
- class XdsServerConfigFetcher::ListenerWatcher final
142
- : public XdsListenerResourceType::WatcherInterface {
143
- public:
144
- ListenerWatcher(RefCountedPtr<GrpcXdsClient> xds_client,
145
- std::unique_ptr<ServerConfigFetcher::WatcherInterface>
146
- server_config_watcher,
147
- grpc_server_xds_status_notifier serving_status_notifier,
148
- std::string listening_address);
149
-
150
- ~ListenerWatcher() override {
151
- xds_client_.reset(DEBUG_LOCATION, "ListenerWatcher");
152
- }
153
-
154
- void OnResourceChanged(
155
- absl::StatusOr<std::shared_ptr<const XdsListenerResource>> listener,
156
- RefCountedPtr<ReadDelayHandle> read_delay_handle) override;
157
-
158
- void OnAmbientError(
159
- absl::Status status,
160
- RefCountedPtr<ReadDelayHandle> read_delay_handle) override;
161
-
162
- const std::string& listening_address() const { return listening_address_; }
163
-
164
- std::string ResourceName() const;
165
-
166
- private:
167
- class FilterChainMatchManager;
168
-
169
- void OnFatalError(absl::Status status) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
170
-
171
- // Invoked by FilterChainMatchManager that is done fetching all referenced RDS
172
- // resources. If the calling FilterChainMatchManager is the
173
- // pending_filter_chain_match_manager_, it is promoted to be the
174
- // filter_chain_match_manager_ in use.
175
- void PendingFilterChainMatchManagerReady(
176
- FilterChainMatchManager* filter_chain_match_manager) {
177
- MutexLock lock(mu_);
178
- PendingFilterChainMatchManagerReadyLocked(filter_chain_match_manager);
179
- }
180
- void PendingFilterChainMatchManagerReadyLocked(
181
- FilterChainMatchManager* filter_chain_match_manager)
182
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&mu_);
183
-
184
- RefCountedPtr<GrpcXdsClient> xds_client_;
185
- const std::unique_ptr<ServerConfigFetcher::WatcherInterface>
186
- server_config_watcher_;
187
- const grpc_server_xds_status_notifier serving_status_notifier_;
188
- const std::string listening_address_;
189
- Mutex mu_;
190
- RefCountedPtr<FilterChainMatchManager> filter_chain_match_manager_
191
- ABSL_GUARDED_BY(mu_);
192
- RefCountedPtr<FilterChainMatchManager> pending_filter_chain_match_manager_
193
- ABSL_GUARDED_BY(mu_);
194
- };
195
-
196
- // A connection manager used by the server listener code to inject channel args
197
- // to be used for each incoming connection. This implementation chooses the
198
- // appropriate filter chain from the xDS Listener resource and injects channel
199
- // args that configure the right mTLS certs and cause the right set of HTTP
200
- // filters to be injected.
201
- class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager final
202
- : public ServerConfigFetcher::ConnectionManager {
203
- public:
204
- FilterChainMatchManager(
205
- RefCountedPtr<GrpcXdsClient> xds_client,
206
- XdsListenerResource::FilterChainMap filter_chain_map,
207
- std::optional<XdsListenerResource::FilterChainData> default_filter_chain);
208
-
209
- ~FilterChainMatchManager() override {
210
- xds_client_.reset(DEBUG_LOCATION, "FilterChainMatchManager");
211
- }
212
-
213
- absl::StatusOr<ChannelArgs> UpdateChannelArgsForConnection(
214
- const ChannelArgs& args, grpc_endpoint* tcp) override;
215
-
216
- // Invoked by ListenerWatcher to start fetching referenced RDS resources.
217
- void StartRdsWatch(RefCountedPtr<ListenerWatcher> listener_watcher)
218
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ListenerWatcher::mu_);
219
-
220
- const XdsListenerResource::FilterChainMap& filter_chain_map() const {
221
- return filter_chain_map_;
222
- }
223
-
224
- const std::optional<XdsListenerResource::FilterChainData>&
225
- default_filter_chain() const {
226
- return default_filter_chain_;
227
- }
228
-
229
- private:
230
- class RouteConfigWatcher;
231
- struct RdsUpdateState {
232
- RouteConfigWatcher* watcher;
233
- std::optional<absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>>
234
- rds_update;
235
- };
236
-
237
- class XdsServerConfigSelector;
238
- class StaticXdsServerConfigSelectorProvider;
239
- class DynamicXdsServerConfigSelectorProvider;
240
-
241
- absl::StatusOr<RefCountedPtr<XdsCertificateProvider>>
242
- CreateOrGetXdsCertificateProviderFromFilterChainData(
243
- const XdsListenerResource::FilterChainData* filter_chain);
244
- void Orphaned() override;
245
-
246
- // Helper functions invoked by RouteConfigWatcher when there are updates to
247
- // RDS resources.
248
- void OnRouteConfigChanged(
249
- const std::string& resource_name,
250
- absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
251
- route_config);
252
- void OnAmbientError(const std::string& resource_name, absl::Status status);
253
-
254
- // Executes cb once for each unique filter chain object in the LDS resource.
255
- void ForEachFilterChain(
256
- absl::FunctionRef<void(XdsListenerResource::FilterChainData&)> cb);
257
-
258
- RefCountedPtr<GrpcXdsClient> xds_client_;
259
- // This ref is only kept around till the FilterChainMatchManager becomes
260
- // ready.
261
- RefCountedPtr<ListenerWatcher> listener_watcher_;
262
- // TODO(roth): Consider holding a ref to the LDS resource and storing
263
- // a pointer to the filter chain data within that LDS resource, rather
264
- // than copying the filter chain data here.
265
- XdsListenerResource::FilterChainMap filter_chain_map_;
266
- std::optional<XdsListenerResource::FilterChainData> default_filter_chain_;
267
- Mutex mu_;
268
- size_t rds_resources_yet_to_fetch_ ABSL_GUARDED_BY(mu_) = 0;
269
- std::map<std::string /* resource_name */, RdsUpdateState> rds_map_
270
- ABSL_GUARDED_BY(mu_);
271
- std::map<const XdsListenerResource::FilterChainData*,
272
- RefCountedPtr<XdsCertificateProvider>>
273
- certificate_providers_map_ ABSL_GUARDED_BY(mu_);
274
- };
275
-
276
- // A watcher implementation for listening on RDS updates referenced to by a
277
- // FilterChainMatchManager object. After all referenced RDS resources are
278
- // fetched (errors are allowed), the FilterChainMatchManager tries to replace
279
- // the current object. The watcher continues to update the referenced RDS
280
- // resources so that new XdsServerConfigSelectorProvider objects are created
281
- // with the latest updates and new connections do not need to wait for the RDS
282
- // resources to be fetched.
283
- class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
284
- RouteConfigWatcher final
285
- : public XdsRouteConfigResourceType::WatcherInterface {
286
- public:
287
- RouteConfigWatcher(
288
- std::string resource_name,
289
- WeakRefCountedPtr<FilterChainMatchManager> filter_chain_match_manager)
290
- : resource_name_(std::move(resource_name)),
291
- filter_chain_match_manager_(std::move(filter_chain_match_manager)) {}
292
-
293
- void OnResourceChanged(
294
- absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
295
- route_config,
296
- RefCountedPtr<ReadDelayHandle> /* read_delay_handle */) override {
297
- filter_chain_match_manager_->OnRouteConfigChanged(resource_name_,
298
- std::move(route_config));
299
- }
300
-
301
- void OnAmbientError(
302
- absl::Status status,
303
- RefCountedPtr<ReadDelayHandle> /* read_delay_handle */) override {
304
- filter_chain_match_manager_->OnAmbientError(resource_name_,
305
- std::move(status));
306
- }
307
-
308
- private:
309
- std::string resource_name_;
310
- WeakRefCountedPtr<FilterChainMatchManager> filter_chain_match_manager_;
311
- };
312
-
313
- // An implementation of ServerConfigSelector used by
314
- // StaticXdsServerConfigSelectorProvider and
315
- // DynamicXdsServerConfigSelectorProvider to parse the RDS update and get
316
- // per-call configuration based on incoming metadata.
317
- class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
318
- XdsServerConfigSelector final : public ServerConfigSelector {
319
- public:
320
- static absl::StatusOr<RefCountedPtr<XdsServerConfigSelector>> Create(
321
- const XdsHttpFilterRegistry& http_filter_registry,
322
- std::shared_ptr<const XdsRouteConfigResource> rds_update,
323
- const std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>&
324
- http_filters);
325
- ~XdsServerConfigSelector() override = default;
326
-
327
- // Not used.
328
- std::unique_ptr<ConnectionState> BuildFilterChains(
329
- FilterChainBuilder& /*builder*/) override {
330
- return nullptr;
331
- }
332
-
333
- absl::StatusOr<CallConfig> GetCallConfig(
334
- const ConnectionState* /*state*/, grpc_metadata_batch* metadata) override;
335
-
336
- private:
337
- struct VirtualHost {
338
- struct Route {
339
- // true if an action other than kNonForwardingAction is configured.
340
- bool unsupported_action;
341
- // TODO(roth): Consider holding a ref to the RDS resource and storing
342
- // a pointer to the matchers within that RDS resource, rather than
343
- // copying the matchers here.
344
- XdsRouteConfigResource::Route::Matchers matchers;
345
- RefCountedPtr<ServiceConfig> method_config;
346
- };
347
-
348
- class RouteListIterator final : public XdsRouting::RouteListIterator {
349
- public:
350
- explicit RouteListIterator(const std::vector<Route>* routes)
351
- : routes_(routes) {}
352
-
353
- size_t Size() const override { return routes_->size(); }
354
-
355
- const XdsRouteConfigResource::Route::Matchers& GetMatchersForRoute(
356
- size_t index) const override {
357
- return (*routes_)[index].matchers;
358
- }
359
-
360
- private:
361
- const std::vector<Route>* routes_;
362
- };
363
-
364
- std::vector<std::string> domains;
365
- std::vector<Route> routes;
366
- };
367
-
368
- class VirtualHostListIterator final
369
- : public XdsRouting::VirtualHostListIterator {
370
- public:
371
- explicit VirtualHostListIterator(
372
- const std::vector<VirtualHost>* virtual_hosts)
373
- : virtual_hosts_(virtual_hosts) {}
374
-
375
- size_t Size() const override { return virtual_hosts_->size(); }
376
-
377
- const std::vector<std::string>& GetDomainsForVirtualHost(
378
- size_t index) const override {
379
- return (*virtual_hosts_)[index].domains;
380
- }
381
-
382
- private:
383
- const std::vector<VirtualHost>* virtual_hosts_;
384
- };
385
-
386
- std::vector<VirtualHost> virtual_hosts_;
387
- };
388
-
389
- // An XdsServerConfigSelectorProvider implementation for when the
390
- // RouteConfiguration is available inline.
391
- class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
392
- StaticXdsServerConfigSelectorProvider final
393
- : public ServerConfigSelectorProvider {
394
- public:
395
- StaticXdsServerConfigSelectorProvider(
396
- RefCountedPtr<GrpcXdsClient> xds_client,
397
- absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
398
- static_resource,
399
- std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
400
- http_filters)
401
- : xds_client_(std::move(xds_client)),
402
- static_resource_(std::move(static_resource)),
403
- http_filters_(std::move(http_filters)) {}
404
-
405
- ~StaticXdsServerConfigSelectorProvider() override {
406
- xds_client_.reset(DEBUG_LOCATION, "StaticXdsServerConfigSelectorProvider");
407
- }
408
-
409
- absl::StatusOr<RefCountedPtr<ServerConfigSelector>> Watch(
410
- std::shared_ptr<ServerConfigSelectorWatcher> watcher) override {
411
- GRPC_CHECK(watcher_ == nullptr);
412
- watcher_ = std::move(watcher);
413
- if (!static_resource_.ok()) {
414
- return static_resource_.status();
415
- }
416
- return XdsServerConfigSelector::Create(
417
- DownCast<const GrpcXdsBootstrap&>(xds_client_->bootstrap())
418
- .http_filter_registry(),
419
- static_resource_.value(), http_filters_);
420
- }
421
-
422
- void CancelWatch(
423
- std::shared_ptr<ServerConfigSelectorWatcher> watcher) override {
424
- GRPC_CHECK(watcher == watcher_);
425
- watcher_.reset();
426
- }
427
-
428
- private:
429
- void Orphaned() override {}
430
-
431
- RefCountedPtr<GrpcXdsClient> xds_client_;
432
- absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
433
- static_resource_;
434
- // TODO(roth): Consider holding a ref to the LDS resource and storing
435
- // a pointer to the HTTP filters within that LDS resource, rather than
436
- // copying the HTTP filters here.
437
- std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
438
- http_filters_;
439
- std::shared_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
440
- watcher_;
441
- };
442
-
443
- // An XdsServerConfigSelectorProvider implementation for when the
444
- // RouteConfiguration is to be fetched separately via RDS.
445
- class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
446
- DynamicXdsServerConfigSelectorProvider final
447
- : public ServerConfigSelectorProvider {
448
- public:
449
- DynamicXdsServerConfigSelectorProvider(
450
- RefCountedPtr<GrpcXdsClient> xds_client, std::string resource_name,
451
- absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
452
- initial_resource,
453
- std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
454
- http_filters);
455
-
456
- ~DynamicXdsServerConfigSelectorProvider() override {
457
- xds_client_.reset(DEBUG_LOCATION, "DynamicXdsServerConfigSelectorProvider");
458
- }
459
-
460
- absl::StatusOr<RefCountedPtr<ServerConfigSelector>> Watch(
461
- std::shared_ptr<ServerConfigSelectorWatcher> watcher) override;
462
- void CancelWatch(
463
- std::shared_ptr<ServerConfigSelectorWatcher> watcher) override;
464
-
465
- private:
466
- class RouteConfigWatcher;
467
-
468
- void Orphaned() override;
469
- void OnRouteConfigChanged(
470
- absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>> rds_update);
471
- void OnAmbientError(absl::Status status);
472
-
473
- RefCountedPtr<GrpcXdsClient> xds_client_;
474
- std::string resource_name_;
475
- // TODO(roth): Consider holding a ref to the LDS resource and storing
476
- // a pointer to the HTTP filters within that LDS resource, rather than
477
- // copying the HTTP filters here.
478
- std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
479
- http_filters_;
480
- RouteConfigWatcher* route_config_watcher_ = nullptr;
481
- Mutex mu_;
482
- std::shared_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
483
- watcher_ ABSL_GUARDED_BY(mu_);
484
- absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>> resource_
485
- ABSL_GUARDED_BY(mu_);
486
- };
487
-
488
- // A watcher implementation for updating the RDS resource used by
489
- // DynamicXdsServerConfigSelectorProvider
490
- class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
491
- DynamicXdsServerConfigSelectorProvider::RouteConfigWatcher final
492
- : public XdsRouteConfigResourceType::WatcherInterface {
493
- public:
494
- explicit RouteConfigWatcher(
495
- WeakRefCountedPtr<DynamicXdsServerConfigSelectorProvider> parent)
496
- : parent_(std::move(parent)) {}
497
-
498
- void OnResourceChanged(
499
- absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
500
- route_config,
501
- RefCountedPtr<ReadDelayHandle> /* read_delay_handle */) override {
502
- parent_->OnRouteConfigChanged(std::move(route_config));
503
- }
504
-
505
- void OnAmbientError(
506
- absl::Status status,
507
- RefCountedPtr<ReadDelayHandle> /* read_delay_handle */) override {
508
- parent_->OnAmbientError(std::move(status));
509
- }
510
-
511
- private:
512
- WeakRefCountedPtr<DynamicXdsServerConfigSelectorProvider> parent_;
513
- };
514
-
515
- //
516
- // XdsServerConfigFetcher
517
- //
518
-
519
- XdsServerConfigFetcher::XdsServerConfigFetcher(
520
- RefCountedPtr<GrpcXdsClient> xds_client,
521
- grpc_server_xds_status_notifier notifier)
522
- : xds_client_(std::move(xds_client)), serving_status_notifier_(notifier) {
523
- GRPC_CHECK(xds_client_ != nullptr);
524
- }
525
-
526
- void XdsServerConfigFetcher::StartWatch(
527
- std::string listening_address,
528
- std::unique_ptr<ServerConfigFetcher::WatcherInterface> watcher) {
529
- ServerConfigFetcher::WatcherInterface* watcher_ptr = watcher.get();
530
- auto listener_watcher = MakeRefCounted<ListenerWatcher>(
531
- xds_client_.Ref(DEBUG_LOCATION, "ListenerWatcher"), std::move(watcher),
532
- serving_status_notifier_, listening_address);
533
- auto* listener_watcher_ptr = listener_watcher.get();
534
- XdsListenerResourceType::StartWatch(xds_client_.get(),
535
- listener_watcher_ptr->ResourceName(),
536
- std::move(listener_watcher));
537
- MutexLock lock(mu_);
538
- listener_watchers_.emplace(watcher_ptr, listener_watcher_ptr);
539
- }
540
-
541
- void XdsServerConfigFetcher::CancelWatch(
542
- ServerConfigFetcher::WatcherInterface* watcher) {
543
- MutexLock lock(mu_);
544
- auto it = listener_watchers_.find(watcher);
545
- if (it != listener_watchers_.end()) {
546
- // Cancel the watch on the listener before erasing
547
- XdsListenerResourceType::CancelWatch(xds_client_.get(),
548
- it->second->ResourceName(), it->second,
549
- false /* delay_unsubscription */);
550
- listener_watchers_.erase(it);
551
- }
552
- }
553
-
554
- //
555
- // XdsServerConfigFetcher::ListenerWatcher
556
- //
557
-
558
- XdsServerConfigFetcher::ListenerWatcher::ListenerWatcher(
559
- RefCountedPtr<GrpcXdsClient> xds_client,
560
- std::unique_ptr<ServerConfigFetcher::WatcherInterface>
561
- server_config_watcher,
562
- grpc_server_xds_status_notifier serving_status_notifier,
563
- std::string listening_address)
564
- : xds_client_(std::move(xds_client)),
565
- server_config_watcher_(std::move(server_config_watcher)),
566
- serving_status_notifier_(serving_status_notifier),
567
- listening_address_(std::move(listening_address)) {}
568
-
569
- void XdsServerConfigFetcher::ListenerWatcher::OnResourceChanged(
570
- absl::StatusOr<std::shared_ptr<const XdsListenerResource>> listener,
571
- RefCountedPtr<ReadDelayHandle> /* read_delay_handle */) {
572
- if (!listener.ok()) {
573
- MutexLock lock(mu_);
574
- OnFatalError(AddMessagePrefix(absl::StrCat("LDS resource ", ResourceName()),
575
- listener.status()));
576
- return;
577
- }
578
- GRPC_TRACE_LOG(xds_server_config_fetcher, INFO)
579
- << "[ListenerWatcher " << this << "] Received LDS update from xds client "
580
- << xds_client_.get() << ": " << (*listener)->ToString();
581
- auto* tcp_listener =
582
- std::get_if<XdsListenerResource::TcpListener>(&(*listener)->listener);
583
- if (tcp_listener == nullptr) {
584
- MutexLock lock(mu_);
585
- OnFatalError(absl::FailedPreconditionError(absl::StrCat(
586
- "LDS resource ", ResourceName(), " is not a TCP listener")));
587
- return;
588
- }
589
- if (tcp_listener->address != listening_address_) {
590
- MutexLock lock(mu_);
591
- OnFatalError(absl::FailedPreconditionError(
592
- absl::StrCat("LDS resource ", ResourceName(),
593
- " address does not match listening address")));
594
- return;
595
- }
596
- auto new_filter_chain_match_manager = MakeRefCounted<FilterChainMatchManager>(
597
- xds_client_.Ref(DEBUG_LOCATION, "FilterChainMatchManager"),
598
- tcp_listener->filter_chain_map, tcp_listener->default_filter_chain);
599
- MutexLock lock(mu_);
600
- if (filter_chain_match_manager_ == nullptr ||
601
- !(new_filter_chain_match_manager->filter_chain_map() ==
602
- filter_chain_match_manager_->filter_chain_map() &&
603
- new_filter_chain_match_manager->default_filter_chain() ==
604
- filter_chain_match_manager_->default_filter_chain())) {
605
- pending_filter_chain_match_manager_ =
606
- std::move(new_filter_chain_match_manager);
607
- pending_filter_chain_match_manager_->StartRdsWatch(
608
- RefAsSubclass<ListenerWatcher>());
609
- }
610
- }
611
-
612
- void XdsServerConfigFetcher::ListenerWatcher::OnAmbientError(
613
- absl::Status status, RefCountedPtr<ReadDelayHandle> /*read_delay_handle*/) {
614
- LOG(ERROR) << "ListenerWatcher:" << this
615
- << " XdsClient reports ambient error: " << status << " for "
616
- << listening_address_
617
- << "; ignoring in favor of existing resource";
618
- }
619
-
620
- void XdsServerConfigFetcher::ListenerWatcher::OnFatalError(
621
- absl::Status status) {
622
- pending_filter_chain_match_manager_.reset();
623
- if (filter_chain_match_manager_ != nullptr) {
624
- // The server has started listening already, so we need to gracefully
625
- // stop serving.
626
- server_config_watcher_->StopServing();
627
- filter_chain_match_manager_.reset();
628
- }
629
- if (serving_status_notifier_.on_serving_status_update != nullptr) {
630
- serving_status_notifier_.on_serving_status_update(
631
- serving_status_notifier_.user_data, listening_address_.c_str(),
632
- {static_cast<grpc_status_code>(status.raw_code()),
633
- std::string(status.message()).c_str()});
634
- } else {
635
- LOG(ERROR) << "ListenerWatcher:" << this << " Encountered fatal error "
636
- << status << "; not serving on " << listening_address_;
637
- }
638
- }
639
-
640
- std::string XdsServerConfigFetcher::ListenerWatcher::ResourceName() const {
641
- absl::string_view resource_name_template =
642
- DownCast<const GrpcXdsBootstrap&>(xds_client_->bootstrap())
643
- .server_listener_resource_name_template();
644
- absl::string_view listening_address = listening_address_;
645
- std::string tmp;
646
- if (absl::StartsWith(resource_name_template, "xdstp:")) {
647
- tmp = URI::PercentEncodePath(listening_address);
648
- listening_address = tmp;
649
- }
650
- return absl::StrReplaceAll(resource_name_template,
651
- {{"%s", listening_address}});
652
- }
653
-
654
- void XdsServerConfigFetcher::ListenerWatcher::
655
- PendingFilterChainMatchManagerReadyLocked(
656
- XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager*
657
- filter_chain_match_manager) {
658
- if (pending_filter_chain_match_manager_ != filter_chain_match_manager) {
659
- // This FilterChainMatchManager is no longer the current pending resource.
660
- // It should get cleaned up eventually. Ignore this update.
661
- return;
662
- }
663
- bool first_good_update = filter_chain_match_manager_ == nullptr;
664
- // Promote the pending FilterChainMatchManager
665
- filter_chain_match_manager_ = std::move(pending_filter_chain_match_manager_);
666
- // TODO(yashykt): Right now, the server_config_watcher_ does not invoke
667
- // XdsServerConfigFetcher while holding a lock, but that might change in the
668
- // future in which case we would want to execute this update outside the
669
- // critical region through a WorkSerializer similar to XdsClient.
670
- server_config_watcher_->UpdateConnectionManager(filter_chain_match_manager_);
671
- // Let the logger know about the update if there was no previous good update.
672
- if (first_good_update) {
673
- if (serving_status_notifier_.on_serving_status_update != nullptr) {
674
- serving_status_notifier_.on_serving_status_update(
675
- serving_status_notifier_.user_data, listening_address_.c_str(),
676
- {GRPC_STATUS_OK, ""});
677
- } else {
678
- LOG(INFO) << "xDS Listener resource obtained; will start serving on "
679
- << listening_address_;
680
- }
681
- }
682
- }
683
-
684
- //
685
- // XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager
686
- //
687
-
688
- XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
689
- FilterChainMatchManager(
690
- RefCountedPtr<GrpcXdsClient> xds_client,
691
- XdsListenerResource::FilterChainMap filter_chain_map,
692
- std::optional<XdsListenerResource::FilterChainData>
693
- default_filter_chain)
694
- : xds_client_(std::move(xds_client)),
695
- filter_chain_map_(std::move(filter_chain_map)),
696
- default_filter_chain_(std::move(default_filter_chain)) {}
697
-
698
- void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
699
- ForEachFilterChain(
700
- absl::FunctionRef<void(XdsListenerResource::FilterChainData&)> cb) {
701
- // A given FilterChainData object may appear more than once in the map,
702
- // but we want to invoke the callback exactly once for each
703
- // FilterChainData object. Therefore, we start by constructing a set
704
- // of all FilterChainData objects by address, to weed out duplicates.
705
- std::set<XdsListenerResource::FilterChainData*> filter_chain_data_set;
706
- for (const auto& destination_ip : filter_chain_map_.destination_ip_vector) {
707
- for (const auto& source_type : destination_ip.source_types_array) {
708
- for (const auto& source_ip : source_type) {
709
- for (const auto& source_port_pair : source_ip.ports_map) {
710
- auto* filter_chain_data = source_port_pair.second.data.get();
711
- filter_chain_data_set.insert(filter_chain_data);
712
- }
713
- }
714
- }
715
- }
716
- // Invoke the callback once for each FilterChainData object.
717
- for (auto* filter_chain_data : filter_chain_data_set) {
718
- cb(*filter_chain_data);
719
- }
720
- // Also invoke the callback for the default filter chain, if present.
721
- if (default_filter_chain_.has_value()) {
722
- cb(*default_filter_chain_);
723
- }
724
- }
725
-
726
- void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
727
- StartRdsWatch(RefCountedPtr<ListenerWatcher> listener_watcher) {
728
- // Get the set of RDS resources to watch on. Also reverse the list of
729
- // HTTP filters in each filter chain, since received data moves *up*
730
- // the stack on the server side.
731
- std::set<std::string> resource_names;
732
- ForEachFilterChain(
733
- [&](XdsListenerResource::FilterChainData& filter_chain_data) {
734
- auto& hcm = filter_chain_data.http_connection_manager;
735
- const auto* rds_name = std::get_if<std::string>(&hcm.route_config);
736
- if (rds_name != nullptr) resource_names.insert(*rds_name);
737
- std::reverse(hcm.http_filters.begin(), hcm.http_filters.end());
738
- });
739
- // Start watching referenced RDS resources.
740
- struct WatcherToStart {
741
- std::string resource_name;
742
- RefCountedPtr<RouteConfigWatcher> watcher;
743
- };
744
- std::vector<WatcherToStart> watchers_to_start;
745
- watchers_to_start.reserve(resource_names.size());
746
- {
747
- MutexLock lock(mu_);
748
- for (const auto& resource_name : resource_names) {
749
- ++rds_resources_yet_to_fetch_;
750
- auto route_config_watcher = MakeRefCounted<RouteConfigWatcher>(
751
- resource_name, WeakRefAsSubclass<FilterChainMatchManager>());
752
- rds_map_.emplace(resource_name, RdsUpdateState{route_config_watcher.get(),
753
- std::nullopt});
754
- watchers_to_start.push_back(
755
- WatcherToStart{resource_name, std::move(route_config_watcher)});
756
- }
757
- if (rds_resources_yet_to_fetch_ != 0) {
758
- listener_watcher_ = std::move(listener_watcher);
759
- listener_watcher = nullptr;
760
- }
761
- }
762
- for (auto& watcher_to_start : watchers_to_start) {
763
- XdsRouteConfigResourceType::StartWatch(xds_client_.get(),
764
- watcher_to_start.resource_name,
765
- std::move(watcher_to_start.watcher));
766
- }
767
- // Promote this filter chain match manager if all referenced resources are
768
- // fetched.
769
- if (listener_watcher != nullptr) {
770
- listener_watcher->PendingFilterChainMatchManagerReadyLocked(this);
771
- }
772
- }
773
-
774
- void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
775
- Orphaned() {
776
- MutexLock lock(mu_);
777
- // Cancel the RDS watches to clear up the weak refs
778
- for (const auto& entry : rds_map_) {
779
- XdsRouteConfigResourceType::CancelWatch(xds_client_.get(), entry.first,
780
- entry.second.watcher,
781
- false /* delay_unsubscription */);
782
- }
783
- // Also give up the ref on ListenerWatcher since it won't be needed anymore
784
- listener_watcher_.reset();
785
- }
786
-
787
- absl::StatusOr<RefCountedPtr<XdsCertificateProvider>>
788
- XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
789
- CreateOrGetXdsCertificateProviderFromFilterChainData(
790
- const XdsListenerResource::FilterChainData* filter_chain) {
791
- MutexLock lock(mu_);
792
- auto it = certificate_providers_map_.find(filter_chain);
793
- if (it != certificate_providers_map_.end()) return it->second;
794
- // Configure root cert.
795
- auto* ca_cert_provider =
796
- std::get_if<CommonTlsContext::CertificateProviderPluginInstance>(
797
- &filter_chain->downstream_tls_context.common_tls_context
798
- .certificate_validation_context.ca_certs);
799
- absl::string_view root_provider_cert_name;
800
- RefCountedPtr<grpc_tls_certificate_provider> root_cert_provider;
801
- if (ca_cert_provider != nullptr) {
802
- root_provider_cert_name = ca_cert_provider->certificate_name;
803
- root_cert_provider =
804
- xds_client_->certificate_provider_store()
805
- .CreateOrGetCertificateProvider(ca_cert_provider->instance_name);
806
- if (root_cert_provider == nullptr) {
807
- return absl::NotFoundError(
808
- absl::StrCat("Certificate provider instance name: \"",
809
- ca_cert_provider->instance_name, "\" not recognized."));
810
- }
811
- }
812
- // Configure identity cert.
813
- absl::string_view identity_provider_instance_name =
814
- filter_chain->downstream_tls_context.common_tls_context
815
- .tls_certificate_provider_instance.instance_name;
816
- absl::string_view identity_provider_cert_name =
817
- filter_chain->downstream_tls_context.common_tls_context
818
- .tls_certificate_provider_instance.certificate_name;
819
- RefCountedPtr<grpc_tls_certificate_provider> identity_cert_provider;
820
- if (!identity_provider_instance_name.empty()) {
821
- identity_cert_provider =
822
- xds_client_->certificate_provider_store()
823
- .CreateOrGetCertificateProvider(identity_provider_instance_name);
824
- if (identity_cert_provider == nullptr) {
825
- return absl::NotFoundError(
826
- absl::StrCat("Certificate provider instance name: \"",
827
- identity_provider_instance_name, "\" not recognized."));
828
- }
829
- }
830
- auto xds_cert_provider = MakeRefCounted<XdsCertificateProvider>(
831
- std::move(root_cert_provider), root_provider_cert_name,
832
- std::move(identity_cert_provider), identity_provider_cert_name,
833
- filter_chain->downstream_tls_context.require_client_certificate);
834
- certificate_providers_map_.emplace(filter_chain, xds_cert_provider);
835
- return xds_cert_provider;
836
- }
837
-
838
- void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
839
- OnRouteConfigChanged(
840
- const std::string& resource_name,
841
- absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
842
- route_config) {
843
- RefCountedPtr<ListenerWatcher> listener_watcher;
844
- {
845
- MutexLock lock(mu_);
846
- auto& state = rds_map_[resource_name];
847
- if (!state.rds_update.has_value()) {
848
- if (--rds_resources_yet_to_fetch_ == 0) {
849
- listener_watcher = std::move(listener_watcher_);
850
- }
851
- }
852
- if (!route_config.ok()) {
853
- route_config = absl::UnavailableError(
854
- absl::StrCat("RDS resource ", resource_name, ": ",
855
- route_config.status().message()));
856
- }
857
- state.rds_update = std::move(route_config);
858
- }
859
- // Promote the filter chain match manager object if all the referenced
860
- // resources are fetched.
861
- if (listener_watcher != nullptr) {
862
- listener_watcher->PendingFilterChainMatchManagerReady(this);
863
- }
864
- }
865
-
866
- void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
867
- OnAmbientError(const std::string& resource_name, absl::Status status) {
868
- LOG(ERROR) << "RouteConfigWatcher:" << this
869
- << " XdsClient reports ambient error: " << status << " for "
870
- << resource_name << "; ignoring in favor of existing resource";
871
- }
872
-
873
- const XdsListenerResource::FilterChainData* FindFilterChainDataForSourcePort(
874
- const XdsListenerResource::FilterChainMap::SourcePortsMap& source_ports_map,
875
- absl::string_view port_str) {
876
- int port = 0;
877
- if (!absl::SimpleAtoi(port_str, &port)) return nullptr;
878
- auto it = source_ports_map.find(port);
879
- if (it != source_ports_map.end()) {
880
- return it->second.data.get();
881
- }
882
- // Search for the catch-all port 0 since we didn't get a direct match
883
- it = source_ports_map.find(0);
884
- if (it != source_ports_map.end()) {
885
- return it->second.data.get();
886
- }
887
- return nullptr;
888
- }
889
-
890
- const XdsListenerResource::FilterChainData* FindFilterChainDataForSourceIp(
891
- const XdsListenerResource::FilterChainMap::SourceIpVector& source_ip_vector,
892
- const grpc_resolved_address* source_ip, absl::string_view port) {
893
- const XdsListenerResource::FilterChainMap::SourceIp* best_match = nullptr;
894
- for (const auto& entry : source_ip_vector) {
895
- // Special case for catch-all
896
- if (!entry.prefix_range.has_value()) {
897
- if (best_match == nullptr) {
898
- best_match = &entry;
899
- }
900
- continue;
901
- }
902
- if (best_match != nullptr && best_match->prefix_range.has_value() &&
903
- best_match->prefix_range->prefix_len >=
904
- entry.prefix_range->prefix_len) {
905
- continue;
906
- }
907
- if (grpc_sockaddr_match_subnet(source_ip, &entry.prefix_range->address,
908
- entry.prefix_range->prefix_len)) {
909
- best_match = &entry;
910
- }
911
- }
912
- if (best_match == nullptr) return nullptr;
913
- return FindFilterChainDataForSourcePort(best_match->ports_map, port);
914
- }
915
-
916
- bool IsLoopbackIp(const grpc_resolved_address* address) {
917
- const grpc_sockaddr* sock_addr =
918
- reinterpret_cast<const grpc_sockaddr*>(&address->addr);
919
- if (sock_addr->sa_family == GRPC_AF_INET) {
920
- const grpc_sockaddr_in* addr4 =
921
- reinterpret_cast<const grpc_sockaddr_in*>(sock_addr);
922
- if (addr4->sin_addr.s_addr == grpc_htonl(INADDR_LOOPBACK)) {
923
- return true;
924
- }
925
- } else if (sock_addr->sa_family == GRPC_AF_INET6) {
926
- const grpc_sockaddr_in6* addr6 =
927
- reinterpret_cast<const grpc_sockaddr_in6*>(sock_addr);
928
- if (memcmp(&addr6->sin6_addr, &in6addr_loopback,
929
- sizeof(in6addr_loopback)) == 0) {
930
- return true;
931
- }
932
- }
933
- return false;
934
- }
935
-
936
- const XdsListenerResource::FilterChainData* FindFilterChainDataForSourceType(
937
- const XdsListenerResource::FilterChainMap::ConnectionSourceTypesArray&
938
- source_types_array,
939
- grpc_endpoint* tcp, absl::string_view destination_ip) {
940
- auto source_uri = URI::Parse(grpc_endpoint_get_peer(tcp));
941
- if (!source_uri.ok() ||
942
- (source_uri->scheme() != "ipv4" && source_uri->scheme() != "ipv6")) {
943
- return nullptr;
944
- }
945
- std::string host;
946
- std::string port;
947
- if (!SplitHostPort(source_uri->path(), &host, &port)) {
948
- return nullptr;
949
- }
950
- auto source_addr = StringToSockaddr(host, 0); // Port doesn't matter here.
951
- if (!source_addr.ok()) {
952
- VLOG(2) << "Could not parse \"" << host
953
- << "\" as socket address: " << source_addr.status();
954
- return nullptr;
955
- }
956
- // Use kAny only if kSameIporLoopback and kExternal are empty
957
- if (source_types_array[static_cast<int>(
958
- XdsListenerResource::FilterChainMap::
959
- ConnectionSourceType::kSameIpOrLoopback)]
960
- .empty() &&
961
- source_types_array[static_cast<int>(XdsListenerResource::FilterChainMap::
962
- ConnectionSourceType::kExternal)]
963
- .empty()) {
964
- return FindFilterChainDataForSourceIp(
965
- source_types_array[static_cast<int>(
966
- XdsListenerResource::FilterChainMap::ConnectionSourceType::kAny)],
967
- &*source_addr, port);
968
- }
969
- if (IsLoopbackIp(&*source_addr) || host == destination_ip) {
970
- return FindFilterChainDataForSourceIp(
971
- source_types_array[static_cast<int>(
972
- XdsListenerResource::FilterChainMap::ConnectionSourceType::
973
- kSameIpOrLoopback)],
974
- &*source_addr, port);
975
- } else {
976
- return FindFilterChainDataForSourceIp(
977
- source_types_array[static_cast<int>(
978
- XdsListenerResource::FilterChainMap::ConnectionSourceType::
979
- kExternal)],
980
- &*source_addr, port);
981
- }
982
- }
983
-
984
- const XdsListenerResource::FilterChainData* FindFilterChainDataForDestinationIp(
985
- const XdsListenerResource::FilterChainMap::DestinationIpVector
986
- destination_ip_vector,
987
- grpc_endpoint* tcp) {
988
- auto destination_uri = URI::Parse(grpc_endpoint_get_local_address(tcp));
989
- if (!destination_uri.ok() || (destination_uri->scheme() != "ipv4" &&
990
- destination_uri->scheme() != "ipv6")) {
991
- return nullptr;
992
- }
993
- std::string host;
994
- std::string port;
995
- if (!SplitHostPort(destination_uri->path(), &host, &port)) {
996
- return nullptr;
997
- }
998
- auto destination_addr =
999
- StringToSockaddr(host, 0); // Port doesn't matter here.
1000
- if (!destination_addr.ok()) {
1001
- VLOG(2) << "Could not parse \"" << host
1002
- << "\" as socket address: " << destination_addr.status();
1003
- return nullptr;
1004
- }
1005
- const XdsListenerResource::FilterChainMap::DestinationIp* best_match =
1006
- nullptr;
1007
- for (const auto& entry : destination_ip_vector) {
1008
- // Special case for catch-all
1009
- if (!entry.prefix_range.has_value()) {
1010
- if (best_match == nullptr) {
1011
- best_match = &entry;
1012
- }
1013
- continue;
1014
- }
1015
- if (best_match != nullptr && best_match->prefix_range.has_value() &&
1016
- best_match->prefix_range->prefix_len >=
1017
- entry.prefix_range->prefix_len) {
1018
- continue;
1019
- }
1020
- if (grpc_sockaddr_match_subnet(&*destination_addr,
1021
- &entry.prefix_range->address,
1022
- entry.prefix_range->prefix_len)) {
1023
- best_match = &entry;
1024
- }
1025
- }
1026
- if (best_match == nullptr) return nullptr;
1027
- return FindFilterChainDataForSourceType(best_match->source_types_array, tcp,
1028
- host);
1029
- }
1030
-
1031
- absl::StatusOr<ChannelArgs> XdsServerConfigFetcher::ListenerWatcher::
1032
- FilterChainMatchManager::UpdateChannelArgsForConnection(
1033
- const ChannelArgs& input_args, grpc_endpoint* tcp) {
1034
- ChannelArgs args = input_args;
1035
- const auto* filter_chain = FindFilterChainDataForDestinationIp(
1036
- filter_chain_map_.destination_ip_vector, tcp);
1037
- if (filter_chain == nullptr && default_filter_chain_.has_value()) {
1038
- filter_chain = &default_filter_chain_.value();
1039
- }
1040
- if (filter_chain == nullptr) {
1041
- return absl::UnavailableError("No matching filter chain found");
1042
- }
1043
- RefCountedPtr<ServerConfigSelectorProvider> server_config_selector_provider;
1044
- RefCountedPtr<XdsChannelStackModifier> channel_stack_modifier;
1045
- RefCountedPtr<XdsCertificateProvider> xds_certificate_provider;
1046
- // Iterate the list of HTTP filters in reverse since in Core, received data
1047
- // flows *up* the stack.
1048
- std::vector<const grpc_channel_filter*> filters;
1049
- const auto& http_filter_registry =
1050
- DownCast<const GrpcXdsBootstrap&>(xds_client_->bootstrap())
1051
- .http_filter_registry();
1052
- for (const auto& http_filter :
1053
- filter_chain->http_connection_manager.http_filters) {
1054
- // Find filter. This is guaranteed to succeed, because it's checked
1055
- // at config validation time in the XdsApi code.
1056
- const XdsHttpFilterFactory* factory =
1057
- http_filter_registry.GetFilterForTopLevelType(
1058
- http_filter.config_proto_type);
1059
- GRPC_CHECK_NE(factory, nullptr);
1060
- // Some filters like the router filter are no-op filters and do not have
1061
- // an implementation.
1062
- if (factory->channel_filter() != nullptr) {
1063
- filters.push_back(factory->channel_filter());
1064
- }
1065
- }
1066
- // Add config selector filter.
1067
- filters.push_back(&kLegacyServerConfigSelectorFilter);
1068
- channel_stack_modifier =
1069
- MakeRefCounted<XdsChannelStackModifier>(std::move(filters));
1070
- Match(
1071
- filter_chain->http_connection_manager.route_config,
1072
- // RDS resource name
1073
- [&](const std::string& rds_name) {
1074
- absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
1075
- initial_resource;
1076
- {
1077
- MutexLock lock(mu_);
1078
- initial_resource = rds_map_[rds_name].rds_update.value();
1079
- }
1080
- server_config_selector_provider =
1081
- MakeRefCounted<DynamicXdsServerConfigSelectorProvider>(
1082
- xds_client_.Ref(DEBUG_LOCATION,
1083
- "DynamicXdsServerConfigSelectorProvider"),
1084
- rds_name, std::move(initial_resource),
1085
- filter_chain->http_connection_manager.http_filters);
1086
- },
1087
- // inline RouteConfig
1088
- [&](const std::shared_ptr<const XdsRouteConfigResource>& route_config) {
1089
- server_config_selector_provider =
1090
- MakeRefCounted<StaticXdsServerConfigSelectorProvider>(
1091
- xds_client_.Ref(DEBUG_LOCATION,
1092
- "StaticXdsServerConfigSelectorProvider"),
1093
- route_config,
1094
- filter_chain->http_connection_manager.http_filters);
1095
- });
1096
- args = args.SetObject(server_config_selector_provider)
1097
- .SetObject(channel_stack_modifier);
1098
- // Add XdsCertificateProvider if credentials are xDS.
1099
- auto* server_creds = args.GetObject<grpc_server_credentials>();
1100
- if (server_creds != nullptr &&
1101
- server_creds->type() == XdsServerCredentials::Type()) {
1102
- absl::StatusOr<RefCountedPtr<XdsCertificateProvider>> result =
1103
- CreateOrGetXdsCertificateProviderFromFilterChainData(filter_chain);
1104
- if (!result.ok()) {
1105
- return result.status();
1106
- }
1107
- xds_certificate_provider = std::move(*result);
1108
- GRPC_CHECK(xds_certificate_provider != nullptr);
1109
- args = args.SetObject(xds_certificate_provider);
1110
- }
1111
- return args;
1112
- }
1113
-
1114
- //
1115
- // XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::XdsServerConfigSelector
1116
- //
1117
-
1118
- absl::StatusOr<
1119
- RefCountedPtr<XdsServerConfigFetcher::ListenerWatcher::
1120
- FilterChainMatchManager::XdsServerConfigSelector>>
1121
- XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1122
- XdsServerConfigSelector::Create(
1123
- const XdsHttpFilterRegistry& http_filter_registry,
1124
- std::shared_ptr<const XdsRouteConfigResource> rds_update,
1125
- const std::vector<
1126
- XdsListenerResource::HttpConnectionManager::HttpFilter>&
1127
- http_filters) {
1128
- auto config_selector = MakeRefCounted<XdsServerConfigSelector>();
1129
- for (auto& vhost : rds_update->virtual_hosts) {
1130
- config_selector->virtual_hosts_.emplace_back();
1131
- auto& virtual_host = config_selector->virtual_hosts_.back();
1132
- virtual_host.domains = vhost.domains;
1133
- for (auto& route : vhost.routes) {
1134
- virtual_host.routes.emplace_back();
1135
- auto& config_selector_route = virtual_host.routes.back();
1136
- config_selector_route.matchers = route.matchers;
1137
- config_selector_route.unsupported_action =
1138
- std::get_if<XdsRouteConfigResource::Route::NonForwardingAction>(
1139
- &route.action) == nullptr;
1140
- auto result = XdsRouting::GeneratePerHTTPFilterConfigsForMethodConfig(
1141
- http_filter_registry, http_filters, vhost, route, nullptr,
1142
- ChannelArgs());
1143
- if (!result.ok()) return result.status();
1144
- std::vector<std::string> fields;
1145
- fields.reserve(result->per_filter_configs.size());
1146
- for (const auto& p : result->per_filter_configs) {
1147
- fields.emplace_back(absl::StrCat(" \"", p.first, "\": [\n",
1148
- absl::StrJoin(p.second, ",\n"),
1149
- "\n ]"));
1150
- }
1151
- if (!fields.empty()) {
1152
- std::string json = absl::StrCat(
1153
- "{\n"
1154
- " \"methodConfig\": [ {\n"
1155
- " \"name\": [\n"
1156
- " {}\n"
1157
- " ],\n"
1158
- " ",
1159
- absl::StrJoin(fields, ",\n"),
1160
- "\n } ]\n"
1161
- "}");
1162
- config_selector_route.method_config =
1163
- ServiceConfigImpl::Create(result->args, json.c_str()).value();
1164
- }
1165
- }
1166
- }
1167
- return config_selector;
1168
- }
1169
-
1170
- absl::StatusOr<ServerConfigSelector::CallConfig>
1171
- XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1172
- XdsServerConfigSelector::GetCallConfig(const ConnectionState* /*state*/,
1173
- grpc_metadata_batch* metadata) {
1174
- CallConfig call_config;
1175
- if (metadata->get_pointer(HttpPathMetadata()) == nullptr) {
1176
- return absl::InternalError("no path found");
1177
- }
1178
- absl::string_view path =
1179
- metadata->get_pointer(HttpPathMetadata())->as_string_view();
1180
- if (metadata->get_pointer(HttpAuthorityMetadata()) == nullptr) {
1181
- return absl::InternalError("no authority found");
1182
- }
1183
- absl::string_view authority =
1184
- metadata->get_pointer(HttpAuthorityMetadata())->as_string_view();
1185
- auto vhost_index = XdsRouting::FindVirtualHostForDomain(
1186
- VirtualHostListIterator(&virtual_hosts_), authority);
1187
- if (!vhost_index.has_value()) {
1188
- return absl::UnavailableError(
1189
- absl::StrCat("could not find VirtualHost for ", authority,
1190
- " in RouteConfiguration"));
1191
- }
1192
- auto& virtual_host = virtual_hosts_[vhost_index.value()];
1193
- auto route_index = XdsRouting::GetRouteForRequest(
1194
- VirtualHost::RouteListIterator(&virtual_host.routes), path, metadata);
1195
- if (route_index.has_value()) {
1196
- auto& route = virtual_host.routes[route_index.value()];
1197
- // Found the matching route
1198
- if (route.unsupported_action) {
1199
- return absl::UnavailableError("matching route has unsupported action");
1200
- }
1201
- if (route.method_config != nullptr) {
1202
- call_config.method_configs =
1203
- route.method_config->GetMethodParsedConfigVector(grpc_empty_slice());
1204
- call_config.service_config = route.method_config;
1205
- }
1206
- return call_config;
1207
- }
1208
- return absl::UnavailableError("no route matched");
1209
- }
1210
-
1211
- //
1212
- // XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::DynamicXdsServerConfigSelectorProvider
1213
- //
1214
-
1215
- XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1216
- DynamicXdsServerConfigSelectorProvider::
1217
- DynamicXdsServerConfigSelectorProvider(
1218
- RefCountedPtr<GrpcXdsClient> xds_client, std::string resource_name,
1219
- absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
1220
- initial_resource,
1221
- std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
1222
- http_filters)
1223
- : xds_client_(std::move(xds_client)),
1224
- resource_name_(std::move(resource_name)),
1225
- http_filters_(std::move(http_filters)),
1226
- resource_(std::move(initial_resource)) {
1227
- GRPC_CHECK(!resource_name_.empty());
1228
- // RouteConfigWatcher is being created here instead of in Watch() to avoid
1229
- // deadlocks from invoking XdsRouteConfigResourceType::StartWatch whilst in a
1230
- // critical region.
1231
- auto route_config_watcher = MakeRefCounted<RouteConfigWatcher>(
1232
- WeakRefAsSubclass<DynamicXdsServerConfigSelectorProvider>());
1233
- route_config_watcher_ = route_config_watcher.get();
1234
- XdsRouteConfigResourceType::StartWatch(xds_client_.get(), resource_name_,
1235
- std::move(route_config_watcher));
1236
- }
1237
-
1238
- void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1239
- DynamicXdsServerConfigSelectorProvider::Orphaned() {
1240
- XdsRouteConfigResourceType::CancelWatch(xds_client_.get(), resource_name_,
1241
- route_config_watcher_,
1242
- false /* delay_unsubscription */);
1243
- }
1244
-
1245
- absl::StatusOr<RefCountedPtr<ServerConfigSelector>>
1246
- XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1247
- DynamicXdsServerConfigSelectorProvider::Watch(
1248
- std::shared_ptr<ServerConfigSelectorWatcher> watcher) {
1249
- absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>> resource;
1250
- {
1251
- MutexLock lock(mu_);
1252
- GRPC_CHECK(watcher_ == nullptr);
1253
- watcher_ = std::move(watcher);
1254
- resource = resource_;
1255
- }
1256
- if (!resource.ok()) {
1257
- return resource.status();
1258
- }
1259
- return XdsServerConfigSelector::Create(
1260
- DownCast<const GrpcXdsBootstrap&>(xds_client_->bootstrap())
1261
- .http_filter_registry(),
1262
- resource.value(), http_filters_);
1263
- }
1264
-
1265
- void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1266
- DynamicXdsServerConfigSelectorProvider::CancelWatch(
1267
- std::shared_ptr<ServerConfigSelectorWatcher> watcher) {
1268
- MutexLock lock(mu_);
1269
- GRPC_CHECK(watcher == watcher_);
1270
- watcher_.reset();
1271
- }
1272
-
1273
- void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1274
- DynamicXdsServerConfigSelectorProvider::OnRouteConfigChanged(
1275
- absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
1276
- rds_update) {
1277
- MutexLock lock(mu_);
1278
- if (!rds_update.ok()) {
1279
- rds_update = absl::UnavailableError(absl::StrCat(
1280
- "RDS resource ", resource_name_, ": ", rds_update.status().message()));
1281
- }
1282
- resource_ = std::move(rds_update);
1283
- if (watcher_ == nullptr) {
1284
- return;
1285
- }
1286
- // Currently server_config_selector_filter does not call into
1287
- // DynamicXdsServerConfigSelectorProvider while holding a lock, but if that
1288
- // ever changes, we would want to invoke the update outside the critical
1289
- // region with the use of a WorkSerializer.
1290
- if (!resource_.ok()) {
1291
- watcher_->OnServerConfigSelectorUpdate(resource_.status());
1292
- } else {
1293
- watcher_->OnServerConfigSelectorUpdate(XdsServerConfigSelector::Create(
1294
- DownCast<const GrpcXdsBootstrap&>(xds_client_->bootstrap())
1295
- .http_filter_registry(),
1296
- *resource_, http_filters_));
1297
- }
1298
- }
1299
-
1300
- void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1301
- DynamicXdsServerConfigSelectorProvider::OnAmbientError(
1302
- absl::Status status) {
1303
- LOG(ERROR) << "RouteConfigWatcher:" << this
1304
- << " XdsClient reports ambient error: " << status << " for "
1305
- << resource_name_ << "; ignoring in favor of existing resource";
1306
- }
1307
-
1308
- } // namespace
1309
- } // namespace grpc_core
1310
-
1311
- grpc_server_config_fetcher* grpc_server_config_fetcher_xds_create_legacy(
1312
- grpc_server_xds_status_notifier notifier, const grpc_channel_args* args) {
1313
- grpc_core::ExecCtx exec_ctx;
1314
- grpc_core::ChannelArgs channel_args = grpc_core::CoreConfiguration::Get()
1315
- .channel_args_preconditioning()
1316
- .PreconditionChannelArgs(args);
1317
- GRPC_TRACE_LOG(api, INFO)
1318
- << "grpc_server_config_fetcher_xds_create(notifier={on_serving_status_"
1319
- "update="
1320
- << notifier.on_serving_status_update
1321
- << ", user_data=" << notifier.user_data << "}, args=" << args << ")";
1322
- auto xds_client = grpc_core::GrpcXdsClient::GetOrCreate(
1323
- grpc_core::GrpcXdsClient::kServerKey, channel_args,
1324
- "XdsServerConfigFetcher");
1325
- if (!xds_client.ok()) {
1326
- LOG(ERROR) << "Failed to create xds client: " << xds_client.status();
1327
- return nullptr;
1328
- }
1329
- if (grpc_core::DownCast<const grpc_core::GrpcXdsBootstrap&>(
1330
- (*xds_client)->bootstrap())
1331
- .server_listener_resource_name_template()
1332
- .empty()) {
1333
- LOG(ERROR) << "server_listener_resource_name_template not provided in "
1334
- "bootstrap file.";
1335
- return nullptr;
1336
- }
1337
- return (new grpc_core::XdsServerConfigFetcher(std::move(*xds_client),
1338
- notifier))
1339
- ->c_ptr();
1340
- }