grpc 1.81.1 → 1.82.0.pre2

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 (861) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +12 -9
  3. data/include/grpc/grpc.h +6 -7
  4. data/include/grpc/impl/channel_arg_names.h +3 -1
  5. data/src/core/call/call_filters.h +2 -2
  6. data/src/core/call/client_call.cc +1 -1
  7. data/src/core/call/interception_chain.h +6 -9
  8. data/src/core/call/metadata.h +1 -1
  9. data/src/core/call/metadata_batch.cc +1 -1
  10. data/src/core/call/metadata_batch.h +17 -1
  11. data/src/core/call/parsed_metadata.h +7 -2
  12. data/src/core/call/server_call.cc +4 -2
  13. data/src/core/call/server_call.h +9 -2
  14. data/src/core/call/status_util.cc +0 -4
  15. data/src/core/call/status_util.h +0 -3
  16. data/src/core/channelz/channel_trace.cc +3 -1
  17. data/src/core/client_channel/backup_poller.cc +1 -1
  18. data/src/core/client_channel/client_channel.cc +6 -14
  19. data/src/core/client_channel/client_channel.h +2 -2
  20. data/src/core/client_channel/client_channel_filter.cc +8 -17
  21. data/src/core/client_channel/client_channel_filter.h +2 -2
  22. data/src/core/client_channel/client_channel_plugin.cc +1 -1
  23. data/src/core/client_channel/config_selector.h +2 -7
  24. data/src/core/client_channel/dynamic_filters.cc +4 -7
  25. data/src/core/client_channel/dynamic_filters.h +1 -3
  26. data/src/core/client_channel/retry_filter.cc +2 -25
  27. data/src/core/client_channel/retry_filter.h +3 -7
  28. data/src/core/client_channel/retry_filter_legacy_call_data.cc +1 -1
  29. data/src/core/client_channel/retry_filter_legacy_call_data.h +2 -2
  30. data/src/core/client_channel/retry_interceptor.cc +7 -35
  31. data/src/core/client_channel/retry_interceptor.h +11 -14
  32. data/src/core/client_channel/retry_service_config.cc +0 -2
  33. data/src/core/client_channel/retry_service_config.h +0 -2
  34. data/src/core/client_channel/retry_throttle.cc +19 -7
  35. data/src/core/client_channel/retry_throttle.h +24 -7
  36. data/src/core/client_channel/subchannel.cc +1 -1
  37. data/src/core/credentials/call/external/external_account_credentials.cc +125 -12
  38. data/src/core/credentials/call/external/external_account_credentials.h +6 -1
  39. data/src/core/credentials/call/jwt/jwt_credentials.cc +11 -1
  40. data/src/core/credentials/call/jwt/jwt_credentials.h +3 -0
  41. data/src/core/credentials/call/oauth2/oauth2_credentials.cc +64 -11
  42. data/src/core/credentials/call/oauth2/oauth2_credentials.h +0 -1
  43. data/src/core/credentials/call/regional_access_boundary_fetcher.cc +411 -0
  44. data/src/core/credentials/call/regional_access_boundary_fetcher.h +158 -0
  45. data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.cc +1 -1
  46. data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.h +7 -1
  47. data/src/core/credentials/transport/insecure/insecure_security_connector.h +1 -1
  48. data/src/core/credentials/transport/local/local_security_connector.cc +1 -1
  49. data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +6 -0
  50. data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +28 -66
  51. data/src/core/ext/filters/fault_injection/fault_injection_filter.h +0 -8
  52. data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +24 -58
  53. data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +24 -19
  54. data/src/core/ext/filters/message_size/message_size_filter.cc +1 -81
  55. data/src/core/ext/filters/message_size/message_size_filter.h +1 -50
  56. data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +13 -56
  57. data/src/core/ext/filters/stateful_session/stateful_session_filter.h +0 -14
  58. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +1 -1
  59. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +175 -51
  60. data/src/core/ext/transport/chttp2/server/chttp2_server.h +10 -1
  61. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +73 -6
  62. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +1 -0
  63. data/src/core/ext/transport/chttp2/transport/flow_control.cc +1 -1
  64. data/src/core/ext/transport/chttp2/transport/flow_control.h +11 -0
  65. data/src/core/ext/transport/chttp2/transport/flow_control_manager.h +2 -4
  66. data/src/core/ext/transport/chttp2/transport/frame.cc +63 -13
  67. data/src/core/ext/transport/chttp2/transport/frame.h +45 -10
  68. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +4 -1
  69. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +11 -3
  70. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +1 -1
  71. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +4 -1
  72. data/src/core/ext/transport/chttp2/transport/header_assembler.h +54 -22
  73. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +53 -5
  74. data/src/core/ext/transport/chttp2/transport/hpack_parse_result.cc +22 -0
  75. data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +20 -0
  76. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +33 -1
  77. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +4 -1
  78. data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +118 -157
  79. data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +6 -13
  80. data/src/core/ext/transport/chttp2/transport/http2_server_transport.cc +2187 -0
  81. data/src/core/ext/transport/chttp2/transport/http2_server_transport.h +748 -0
  82. data/src/core/ext/transport/chttp2/transport/http2_settings.h +19 -4
  83. data/src/core/ext/transport/chttp2/transport/http2_settings_manager.h +0 -2
  84. data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +50 -17
  85. data/src/core/ext/transport/chttp2/transport/http2_transport.cc +13 -15
  86. data/src/core/ext/transport/chttp2/transport/http2_transport.h +16 -48
  87. data/src/core/ext/transport/chttp2/transport/internal.h +14 -0
  88. data/src/core/ext/transport/chttp2/transport/message_assembler.h +1 -2
  89. data/src/core/ext/transport/chttp2/transport/parsing.cc +82 -24
  90. data/src/core/ext/transport/chttp2/transport/read_context.h +452 -0
  91. data/src/core/ext/transport/chttp2/transport/security_frame.h +12 -3
  92. data/src/core/ext/transport/chttp2/transport/stream.h +25 -26
  93. data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +6 -4
  94. data/src/core/ext/transport/chttp2/transport/write_cycle.h +9 -1
  95. data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +16 -2
  96. data/src/core/ext/upb-gen/cel/expr/checked.upb.h +621 -432
  97. data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.c +264 -166
  98. data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.h +0 -13
  99. data/src/core/ext/upb-gen/cel/expr/syntax.upb.h +708 -497
  100. data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.c +294 -176
  101. data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.h +0 -15
  102. data/src/core/ext/upb-gen/envoy/admin/v3/certs.upb.h +262 -181
  103. data/src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.c +84 -58
  104. data/src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.h +0 -5
  105. data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb.h +254 -190
  106. data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.c +107 -53
  107. data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.h +0 -4
  108. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump.upb.h +271 -190
  109. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump.upb_minitable.c +88 -64
  110. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump.upb_minitable.h +0 -5
  111. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb.h +1035 -730
  112. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb_minitable.c +384 -260
  113. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb_minitable.h +0 -19
  114. data/src/core/ext/upb-gen/envoy/admin/v3/init_dump.upb.h +87 -56
  115. data/src/core/ext/upb-gen/envoy/admin/v3/init_dump.upb_minitable.c +26 -16
  116. data/src/core/ext/upb-gen/envoy/admin/v3/init_dump.upb_minitable.h +0 -2
  117. data/src/core/ext/upb-gen/envoy/admin/v3/listeners.upb.h +105 -71
  118. data/src/core/ext/upb-gen/envoy/admin/v3/listeners.upb_minitable.c +30 -22
  119. data/src/core/ext/upb-gen/envoy/admin/v3/listeners.upb_minitable.h +0 -2
  120. data/src/core/ext/upb-gen/envoy/admin/v3/memory.upb.h +31 -29
  121. data/src/core/ext/upb-gen/envoy/admin/v3/memory.upb_minitable.c +19 -7
  122. data/src/core/ext/upb-gen/envoy/admin/v3/memory.upb_minitable.h +0 -1
  123. data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb.h +25 -23
  124. data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb_minitable.c +15 -7
  125. data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb_minitable.h +0 -1
  126. data/src/core/ext/upb-gen/envoy/admin/v3/mutex_stats.upb.h +25 -23
  127. data/src/core/ext/upb-gen/envoy/admin/v3/mutex_stats.upb_minitable.c +15 -7
  128. data/src/core/ext/upb-gen/envoy/admin/v3/mutex_stats.upb_minitable.h +0 -1
  129. data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb.h +201 -165
  130. data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.c +79 -31
  131. data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.h +0 -2
  132. data/src/core/ext/upb-gen/envoy/admin/v3/tap.upb.h +29 -26
  133. data/src/core/ext/upb-gen/envoy/admin/v3/tap.upb_minitable.c +17 -11
  134. data/src/core/ext/upb-gen/envoy/admin/v3/tap.upb_minitable.h +0 -1
  135. data/src/core/ext/upb-gen/envoy/annotations/deprecation.upb.h +46 -29
  136. data/src/core/ext/upb-gen/envoy/annotations/deprecation.upb_minitable.c +37 -19
  137. data/src/core/ext/upb-gen/envoy/annotations/deprecation.upb_minitable.h +4 -4
  138. data/src/core/ext/upb-gen/envoy/annotations/resource.upb.h +34 -27
  139. data/src/core/ext/upb-gen/envoy/annotations/resource.upb_minitable.c +34 -13
  140. data/src/core/ext/upb-gen/envoy/annotations/resource.upb_minitable.h +1 -2
  141. data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb.h +617 -452
  142. data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb_minitable.c +221 -163
  143. data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb_minitable.h +0 -16
  144. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +1339 -970
  145. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +484 -324
  146. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.h +0 -23
  147. data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb.h +181 -135
  148. data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.c +59 -43
  149. data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.h +0 -3
  150. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +1353 -1028
  151. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +535 -361
  152. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.h +0 -25
  153. data/src/core/ext/upb-gen/envoy/config/cluster/v3/filter.upb.h +37 -33
  154. data/src/core/ext/upb-gen/envoy/config/cluster/v3/filter.upb_minitable.c +19 -13
  155. data/src/core/ext/upb-gen/envoy/config/cluster/v3/filter.upb_minitable.h +0 -1
  156. data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb.h +234 -196
  157. data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.c +77 -57
  158. data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.h +0 -1
  159. data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb.h +695 -502
  160. data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c +246 -186
  161. data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.h +0 -15
  162. data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb.h +140 -116
  163. data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.c +53 -43
  164. data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.h +0 -3
  165. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +363 -269
  166. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +131 -89
  167. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.h +0 -8
  168. data/src/core/ext/upb-gen/envoy/config/core/v3/backoff.upb.h +35 -31
  169. data/src/core/ext/upb-gen/envoy/config/core/v3/backoff.upb_minitable.c +15 -13
  170. data/src/core/ext/upb-gen/envoy/config/core/v3/backoff.upb_minitable.h +0 -1
  171. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb.h +1073 -769
  172. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.c +515 -293
  173. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.h +0 -30
  174. data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb.h +25 -23
  175. data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.c +15 -7
  176. data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.h +0 -1
  177. data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb.h +375 -267
  178. data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb_minitable.c +142 -86
  179. data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb_minitable.h +0 -7
  180. data/src/core/ext/upb-gen/envoy/config/core/v3/event_service_config.upb.h +32 -27
  181. data/src/core/ext/upb-gen/envoy/config/core/v3/event_service_config.upb_minitable.c +13 -11
  182. data/src/core/ext/upb-gen/envoy/config/core/v3/event_service_config.upb_minitable.h +0 -1
  183. data/src/core/ext/upb-gen/envoy/config/core/v3/extension.upb.h +29 -26
  184. data/src/core/ext/upb-gen/envoy/config/core/v3/extension.upb_minitable.c +17 -11
  185. data/src/core/ext/upb-gen/envoy/config/core/v3/extension.upb_minitable.h +0 -1
  186. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_method_list.upb.h +87 -56
  187. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_method_list.upb_minitable.c +26 -16
  188. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_method_list.upb_minitable.h +0 -2
  189. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb.h +634 -468
  190. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c +255 -161
  191. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.h +0 -14
  192. data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb.h +672 -474
  193. data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb_minitable.c +228 -130
  194. data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb_minitable.h +0 -9
  195. data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb.h +56 -40
  196. data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb_minitable.c +15 -13
  197. data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb_minitable.h +0 -1
  198. data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb.h +34 -29
  199. data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb_minitable.c +19 -11
  200. data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb_minitable.h +0 -1
  201. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +811 -635
  202. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +347 -221
  203. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.h +0 -16
  204. data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb.h +174 -118
  205. data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.c +62 -38
  206. data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.h +0 -4
  207. data/src/core/ext/upb-gen/envoy/config/core/v3/resolver.upb.h +78 -57
  208. data/src/core/ext/upb-gen/envoy/config/core/v3/resolver.upb_minitable.c +28 -18
  209. data/src/core/ext/upb-gen/envoy/config/core/v3/resolver.upb_minitable.h +0 -2
  210. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_cmsg_headers.upb.h +37 -33
  211. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_cmsg_headers.upb_minitable.c +22 -14
  212. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_cmsg_headers.upb_minitable.h +0 -1
  213. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb.h +159 -119
  214. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.c +47 -35
  215. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.h +0 -5
  216. data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb.h +101 -76
  217. data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb_minitable.c +41 -23
  218. data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb_minitable.h +0 -2
  219. data/src/core/ext/upb-gen/envoy/config/core/v3/udp_socket_config.upb.h +35 -31
  220. data/src/core/ext/upb-gen/envoy/config/core/v3/udp_socket_config.upb_minitable.c +15 -13
  221. data/src/core/ext/upb-gen/envoy/config/core/v3/udp_socket_config.upb_minitable.h +0 -1
  222. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb.h +189 -127
  223. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb_minitable.c +79 -49
  224. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb_minitable.h +0 -4
  225. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +378 -283
  226. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +156 -98
  227. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.h +0 -8
  228. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb.h +354 -255
  229. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb_minitable.c +125 -69
  230. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb_minitable.h +0 -6
  231. data/src/core/ext/upb-gen/envoy/config/listener/v3/api_listener.upb.h +27 -24
  232. data/src/core/ext/upb-gen/envoy/config/listener/v3/api_listener.upb_minitable.c +13 -11
  233. data/src/core/ext/upb-gen/envoy/config/listener/v3/api_listener.upb_minitable.h +0 -1
  234. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +611 -451
  235. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +159 -119
  236. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.h +0 -11
  237. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb.h +468 -321
  238. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.c +157 -99
  239. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.h +0 -6
  240. data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +146 -119
  241. data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +55 -35
  242. data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.h +0 -1
  243. data/src/core/ext/upb-gen/envoy/config/listener/v3/udp_listener_config.upb.h +61 -51
  244. data/src/core/ext/upb-gen/envoy/config/listener/v3/udp_listener_config.upb_minitable.c +16 -16
  245. data/src/core/ext/upb-gen/envoy/config/listener/v3/udp_listener_config.upb_minitable.h +0 -2
  246. data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb.h +43 -39
  247. data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c +25 -13
  248. data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.h +0 -1
  249. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +341 -247
  250. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +130 -84
  251. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.h +0 -8
  252. data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb.h +452 -313
  253. data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.c +144 -100
  254. data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.h +0 -10
  255. data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +666 -493
  256. data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +251 -181
  257. data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.h +0 -12
  258. data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb.h +327 -197
  259. data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c +92 -48
  260. data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.h +0 -3
  261. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +3583 -2532
  262. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +1340 -816
  263. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.h +0 -60
  264. data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb.h +111 -82
  265. data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb_minitable.c +48 -28
  266. data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb_minitable.h +0 -3
  267. data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb.h +548 -410
  268. data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c +214 -148
  269. data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.h +0 -12
  270. data/src/core/ext/upb-gen/envoy/config/trace/v3/datadog.upb.h +59 -50
  271. data/src/core/ext/upb-gen/envoy/config/trace/v3/datadog.upb_minitable.c +30 -20
  272. data/src/core/ext/upb-gen/envoy/config/trace/v3/datadog.upb_minitable.h +0 -2
  273. data/src/core/ext/upb-gen/envoy/config/trace/v3/dynamic_ot.upb.h +29 -26
  274. data/src/core/ext/upb-gen/envoy/config/trace/v3/dynamic_ot.upb_minitable.c +17 -11
  275. data/src/core/ext/upb-gen/envoy/config/trace/v3/dynamic_ot.upb_minitable.h +0 -1
  276. data/src/core/ext/upb-gen/envoy/config/trace/v3/http_tracer.upb.h +60 -49
  277. data/src/core/ext/upb-gen/envoy/config/trace/v3/http_tracer.upb_minitable.c +28 -20
  278. data/src/core/ext/upb-gen/envoy/config/trace/v3/http_tracer.upb_minitable.h +0 -2
  279. data/src/core/ext/upb-gen/envoy/config/trace/v3/lightstep.upb.h +50 -36
  280. data/src/core/ext/upb-gen/envoy/config/trace/v3/lightstep.upb_minitable.c +19 -11
  281. data/src/core/ext/upb-gen/envoy/config/trace/v3/lightstep.upb_minitable.h +0 -1
  282. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +82 -63
  283. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +27 -19
  284. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.h +0 -1
  285. data/src/core/ext/upb-gen/envoy/config/trace/v3/service.upb.h +27 -24
  286. data/src/core/ext/upb-gen/envoy/config/trace/v3/service.upb_minitable.c +13 -11
  287. data/src/core/ext/upb-gen/envoy/config/trace/v3/service.upb_minitable.h +0 -1
  288. data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb.h +70 -58
  289. data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb_minitable.c +32 -22
  290. data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb_minitable.h +0 -2
  291. data/src/core/ext/upb-gen/envoy/config/trace/v3/trace.upb.h +2 -5
  292. data/src/core/ext/upb-gen/envoy/config/trace/v3/trace.upb_minitable.c +1 -1
  293. data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb.h +73 -62
  294. data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb_minitable.c +39 -25
  295. data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb_minitable.h +0 -2
  296. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +49 -45
  297. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +33 -13
  298. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.h +0 -1
  299. data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb.h +771 -588
  300. data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb_minitable.c +383 -185
  301. data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb_minitable.h +0 -16
  302. data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +66 -47
  303. data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c +31 -17
  304. data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.h +0 -2
  305. data/src/core/ext/upb-gen/envoy/extensions/common/matching/v3/extension_matcher.upb.h +69 -58
  306. data/src/core/ext/upb-gen/envoy/extensions/common/matching/v3/extension_matcher.upb_minitable.c +27 -23
  307. data/src/core/ext/upb-gen/envoy/extensions/common/matching/v3/extension_matcher.upb_minitable.h +0 -2
  308. data/src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb.h +151 -119
  309. data/src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.c +45 -39
  310. data/src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.h +0 -5
  311. data/src/core/ext/upb-gen/envoy/extensions/filters/common/matcher/action/v3/skip_action.upb.h +19 -17
  312. data/src/core/ext/upb-gen/envoy/extensions/filters/common/matcher/action/v3/skip_action.upb_minitable.c +1 -3
  313. data/src/core/ext/upb-gen/envoy/extensions/filters/common/matcher/action/v3/skip_action.upb_minitable.h +0 -1
  314. data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb.h +144 -109
  315. data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb_minitable.c +46 -38
  316. data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb_minitable.h +0 -4
  317. data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h +184 -139
  318. data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c +65 -35
  319. data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h +0 -3
  320. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h +129 -106
  321. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c +69 -41
  322. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h +0 -4
  323. data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +83 -71
  324. data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c +40 -26
  325. data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h +0 -2
  326. data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h +148 -101
  327. data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c +45 -27
  328. data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.h +0 -2
  329. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +62 -51
  330. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +35 -21
  331. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.h +0 -2
  332. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +1362 -1024
  333. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +508 -336
  334. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.h +0 -22
  335. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb.h +21 -19
  336. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.c +13 -7
  337. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.h +0 -1
  338. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb.h +35 -31
  339. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.c +15 -13
  340. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.h +0 -1
  341. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb.h +27 -24
  342. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.c +13 -11
  343. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.h +0 -1
  344. data/src/core/ext/upb-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h +27 -24
  345. data/src/core/ext/upb-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb_minitable.c +13 -11
  346. data/src/core/ext/upb-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb_minitable.h +0 -1
  347. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +94 -74
  348. 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 +35 -23
  349. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb_minitable.h +0 -1
  350. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +231 -179
  351. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +88 -66
  352. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.h +0 -6
  353. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.h +21 -19
  354. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb_minitable.c +13 -7
  355. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb_minitable.h +0 -1
  356. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +63 -56
  357. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb_minitable.c +31 -19
  358. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb_minitable.h +0 -1
  359. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +27 -24
  360. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb_minitable.c +13 -11
  361. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb_minitable.h +0 -1
  362. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb.h +27 -24
  363. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb_minitable.c +13 -11
  364. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb_minitable.h +0 -1
  365. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +2 -5
  366. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/cert.upb_minitable.c +1 -1
  367. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +538 -364
  368. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +157 -95
  369. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.h +0 -8
  370. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +150 -110
  371. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.c +69 -49
  372. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.h +0 -4
  373. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +517 -389
  374. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.c +182 -116
  375. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.h +0 -7
  376. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +84 -62
  377. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb_minitable.c +30 -22
  378. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb_minitable.h +0 -2
  379. data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb.h +340 -256
  380. data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c +92 -82
  381. data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.h +0 -5
  382. data/src/core/ext/upb-gen/envoy/service/discovery/v3/ads.upb.h +19 -17
  383. data/src/core/ext/upb-gen/envoy/service/discovery/v3/ads.upb_minitable.c +1 -3
  384. data/src/core/ext/upb-gen/envoy/service/discovery/v3/ads.upb_minitable.h +0 -1
  385. data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb.h +857 -566
  386. data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.c +288 -182
  387. data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.h +0 -15
  388. data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb.h +105 -72
  389. data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb_minitable.c +36 -22
  390. data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb_minitable.h +0 -2
  391. data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb.h +312 -226
  392. data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb_minitable.c +132 -78
  393. data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb_minitable.h +0 -5
  394. data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb.h +82 -61
  395. data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c +35 -19
  396. data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.h +0 -2
  397. data/src/core/ext/upb-gen/envoy/type/http/v3/path_transformation.upb.h +123 -89
  398. data/src/core/ext/upb-gen/envoy/type/http/v3/path_transformation.upb_minitable.c +25 -25
  399. data/src/core/ext/upb-gen/envoy/type/http/v3/path_transformation.upb_minitable.h +0 -4
  400. data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb.h +48 -33
  401. data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb_minitable.c +13 -11
  402. data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb_minitable.h +0 -1
  403. data/src/core/ext/upb-gen/envoy/type/matcher/v3/filter_state.upb.h +42 -36
  404. data/src/core/ext/upb-gen/envoy/type/matcher/v3/filter_state.upb_minitable.c +19 -13
  405. data/src/core/ext/upb-gen/envoy/type/matcher/v3/filter_state.upb_minitable.h +0 -1
  406. data/src/core/ext/upb-gen/envoy/type/matcher/v3/http_inputs.upb.h +101 -79
  407. data/src/core/ext/upb-gen/envoy/type/matcher/v3/http_inputs.upb_minitable.c +61 -31
  408. data/src/core/ext/upb-gen/envoy/type/matcher/v3/http_inputs.upb_minitable.h +0 -5
  409. data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb.h +83 -60
  410. data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb_minitable.c +37 -19
  411. data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb_minitable.h +0 -2
  412. data/src/core/ext/upb-gen/envoy/type/matcher/v3/node.upb.h +56 -40
  413. data/src/core/ext/upb-gen/envoy/type/matcher/v3/node.upb_minitable.c +15 -13
  414. data/src/core/ext/upb-gen/envoy/type/matcher/v3/node.upb_minitable.h +0 -1
  415. data/src/core/ext/upb-gen/envoy/type/matcher/v3/number.upb.h +34 -29
  416. data/src/core/ext/upb-gen/envoy/type/matcher/v3/number.upb_minitable.c +13 -11
  417. data/src/core/ext/upb-gen/envoy/type/matcher/v3/number.upb_minitable.h +0 -1
  418. data/src/core/ext/upb-gen/envoy/type/matcher/v3/path.upb.h +32 -27
  419. data/src/core/ext/upb-gen/envoy/type/matcher/v3/path.upb_minitable.c +13 -11
  420. data/src/core/ext/upb-gen/envoy/type/matcher/v3/path.upb_minitable.h +0 -1
  421. data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb.h +88 -71
  422. data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb_minitable.c +48 -30
  423. data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb_minitable.h +0 -3
  424. data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb.h +37 -30
  425. data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.c +1 -5
  426. data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.h +0 -2
  427. data/src/core/ext/upb-gen/envoy/type/matcher/v3/string.upb.h +95 -71
  428. data/src/core/ext/upb-gen/envoy/type/matcher/v3/string.upb_minitable.c +36 -22
  429. data/src/core/ext/upb-gen/envoy/type/matcher/v3/string.upb_minitable.h +0 -2
  430. data/src/core/ext/upb-gen/envoy/type/matcher/v3/struct.upb.h +79 -56
  431. data/src/core/ext/upb-gen/envoy/type/matcher/v3/struct.upb_minitable.c +26 -18
  432. data/src/core/ext/upb-gen/envoy/type/matcher/v3/struct.upb_minitable.h +0 -2
  433. data/src/core/ext/upb-gen/envoy/type/matcher/v3/value.upb.h +164 -124
  434. data/src/core/ext/upb-gen/envoy/type/matcher/v3/value.upb_minitable.c +54 -40
  435. data/src/core/ext/upb-gen/envoy/type/matcher/v3/value.upb_minitable.h +0 -4
  436. data/src/core/ext/upb-gen/envoy/type/metadata/v3/metadata.upb.h +200 -147
  437. data/src/core/ext/upb-gen/envoy/type/metadata/v3/metadata.upb_minitable.c +47 -41
  438. data/src/core/ext/upb-gen/envoy/type/metadata/v3/metadata.upb_minitable.h +0 -7
  439. data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb.h +160 -130
  440. data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c +89 -47
  441. data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.h +0 -5
  442. data/src/core/ext/upb-gen/envoy/type/v3/hash_policy.upb.h +78 -62
  443. data/src/core/ext/upb-gen/envoy/type/v3/hash_policy.upb_minitable.c +26 -20
  444. data/src/core/ext/upb-gen/envoy/type/v3/hash_policy.upb_minitable.h +0 -3
  445. data/src/core/ext/upb-gen/envoy/type/v3/http.upb.h +2 -5
  446. data/src/core/ext/upb-gen/envoy/type/v3/http.upb_minitable.c +1 -1
  447. data/src/core/ext/upb-gen/envoy/type/v3/http_status.upb.h +21 -19
  448. data/src/core/ext/upb-gen/envoy/type/v3/http_status.upb_minitable.c +13 -7
  449. data/src/core/ext/upb-gen/envoy/type/v3/http_status.upb_minitable.h +0 -1
  450. data/src/core/ext/upb-gen/envoy/type/v3/percent.upb.h +43 -36
  451. data/src/core/ext/upb-gen/envoy/type/v3/percent.upb_minitable.c +22 -12
  452. data/src/core/ext/upb-gen/envoy/type/v3/percent.upb_minitable.h +0 -2
  453. data/src/core/ext/upb-gen/envoy/type/v3/range.upb.h +67 -55
  454. data/src/core/ext/upb-gen/envoy/type/v3/range.upb_minitable.c +36 -18
  455. data/src/core/ext/upb-gen/envoy/type/v3/range.upb_minitable.h +0 -3
  456. data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_strategy.upb.h +62 -51
  457. data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_strategy.upb_minitable.c +33 -19
  458. data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_strategy.upb_minitable.h +0 -2
  459. data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_unit.upb.h +2 -5
  460. data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_unit.upb_minitable.c +1 -1
  461. data/src/core/ext/upb-gen/envoy/type/v3/semantic_version.upb.h +25 -23
  462. data/src/core/ext/upb-gen/envoy/type/v3/semantic_version.upb_minitable.c +15 -7
  463. data/src/core/ext/upb-gen/envoy/type/v3/semantic_version.upb_minitable.h +0 -1
  464. data/src/core/ext/upb-gen/envoy/type/v3/token_bucket.upb.h +37 -33
  465. data/src/core/ext/upb-gen/envoy/type/v3/token_bucket.upb_minitable.c +19 -13
  466. data/src/core/ext/upb-gen/envoy/type/v3/token_bucket.upb_minitable.h +0 -1
  467. data/src/core/ext/upb-gen/google/api/annotations.upb.h +15 -13
  468. data/src/core/ext/upb-gen/google/api/annotations.upb_minitable.c +22 -7
  469. data/src/core/ext/upb-gen/google/api/annotations.upb_minitable.h +1 -1
  470. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb.h +619 -430
  471. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.c +260 -168
  472. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.h +0 -13
  473. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb.h +734 -518
  474. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb_minitable.c +312 -182
  475. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb_minitable.h +0 -16
  476. data/src/core/ext/upb-gen/google/api/http.upb.h +146 -105
  477. data/src/core/ext/upb-gen/google/api/http.upb_minitable.c +65 -29
  478. data/src/core/ext/upb-gen/google/api/http.upb_minitable.h +0 -3
  479. data/src/core/ext/upb-gen/google/api/httpbody.upb.h +52 -37
  480. data/src/core/ext/upb-gen/google/api/httpbody.upb_minitable.c +19 -11
  481. data/src/core/ext/upb-gen/google/api/httpbody.upb_minitable.h +0 -1
  482. data/src/core/ext/upb-gen/google/protobuf/any.upb.h +23 -21
  483. data/src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c +15 -7
  484. data/src/core/ext/upb-gen/google/protobuf/any.upb_minitable.h +0 -1
  485. data/src/core/ext/upb-gen/google/protobuf/descriptor.upb.h +2236 -1514
  486. data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c +824 -406
  487. data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.h +0 -34
  488. data/src/core/ext/upb-gen/google/protobuf/duration.upb.h +23 -21
  489. data/src/core/ext/upb-gen/google/protobuf/duration.upb_minitable.c +15 -7
  490. data/src/core/ext/upb-gen/google/protobuf/duration.upb_minitable.h +0 -1
  491. data/src/core/ext/upb-gen/google/protobuf/empty.upb.h +19 -17
  492. data/src/core/ext/upb-gen/google/protobuf/empty.upb_minitable.c +1 -3
  493. data/src/core/ext/upb-gen/google/protobuf/empty.upb_minitable.h +0 -1
  494. data/src/core/ext/upb-gen/google/protobuf/struct.upb.h +149 -100
  495. data/src/core/ext/upb-gen/google/protobuf/struct.upb_minitable.c +59 -43
  496. data/src/core/ext/upb-gen/google/protobuf/struct.upb_minitable.h +0 -4
  497. data/src/core/ext/upb-gen/google/protobuf/timestamp.upb.h +23 -21
  498. data/src/core/ext/upb-gen/google/protobuf/timestamp.upb_minitable.c +15 -7
  499. data/src/core/ext/upb-gen/google/protobuf/timestamp.upb_minitable.h +0 -1
  500. data/src/core/ext/upb-gen/google/protobuf/wrappers.upb.h +181 -139
  501. data/src/core/ext/upb-gen/google/protobuf/wrappers.upb_minitable.c +99 -53
  502. data/src/core/ext/upb-gen/google/protobuf/wrappers.upb_minitable.h +0 -9
  503. data/src/core/ext/upb-gen/google/rpc/status.upb.h +52 -37
  504. data/src/core/ext/upb-gen/google/rpc/status.upb_minitable.c +19 -11
  505. data/src/core/ext/upb-gen/google/rpc/status.upb_minitable.h +0 -1
  506. data/src/core/ext/upb-gen/src/proto/grpc/channelz/channelz.upb.h +1553 -1157
  507. data/src/core/ext/upb-gen/src/proto/grpc/channelz/channelz.upb_minitable.c +712 -410
  508. data/src/core/ext/upb-gen/src/proto/grpc/channelz/channelz.upb_minitable.h +0 -39
  509. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb.h +189 -125
  510. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.c +59 -35
  511. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.h +0 -3
  512. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +454 -343
  513. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +204 -130
  514. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +0 -11
  515. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb.h +369 -243
  516. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.c +109 -79
  517. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.h +0 -7
  518. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb.h +256 -175
  519. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb_minitable.c +122 -68
  520. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb_minitable.h +0 -8
  521. data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb.h +71 -51
  522. data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb_minitable.c +39 -19
  523. data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb_minitable.h +0 -2
  524. data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb.h +583 -407
  525. data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.c +259 -145
  526. data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.h +0 -12
  527. data/src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb.h +114 -84
  528. data/src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb_minitable.c +52 -30
  529. data/src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb_minitable.h +0 -4
  530. data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb.h +41 -34
  531. data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb_minitable.c +25 -13
  532. data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb_minitable.h +0 -2
  533. data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb.h +309 -230
  534. data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.c +123 -79
  535. data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.h +0 -9
  536. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb.h +98 -63
  537. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.c +51 -23
  538. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.h +0 -3
  539. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb.h +505 -312
  540. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb_minitable.c +159 -87
  541. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb_minitable.h +0 -9
  542. data/src/core/ext/upb-gen/udpa/annotations/migrate.upb.h +128 -91
  543. data/src/core/ext/upb-gen/udpa/annotations/migrate.upb_minitable.c +82 -41
  544. data/src/core/ext/upb-gen/udpa/annotations/migrate.upb_minitable.h +5 -8
  545. data/src/core/ext/upb-gen/udpa/annotations/security.upb.h +36 -29
  546. data/src/core/ext/upb-gen/udpa/annotations/security.upb_minitable.c +36 -13
  547. data/src/core/ext/upb-gen/udpa/annotations/security.upb_minitable.h +1 -2
  548. data/src/core/ext/upb-gen/udpa/annotations/sensitive.upb.h +13 -11
  549. data/src/core/ext/upb-gen/udpa/annotations/sensitive.upb_minitable.c +22 -7
  550. data/src/core/ext/upb-gen/udpa/annotations/sensitive.upb_minitable.h +1 -1
  551. data/src/core/ext/upb-gen/udpa/annotations/status.upb.h +36 -29
  552. data/src/core/ext/upb-gen/udpa/annotations/status.upb_minitable.c +36 -13
  553. data/src/core/ext/upb-gen/udpa/annotations/status.upb_minitable.h +1 -2
  554. data/src/core/ext/upb-gen/udpa/annotations/versioning.upb.h +34 -27
  555. data/src/core/ext/upb-gen/udpa/annotations/versioning.upb_minitable.c +34 -13
  556. data/src/core/ext/upb-gen/udpa/annotations/versioning.upb_minitable.h +1 -2
  557. data/src/core/ext/upb-gen/validate/validate.upb.h +1682 -1130
  558. data/src/core/ext/upb-gen/validate/validate.upb_minitable.c +587 -247
  559. data/src/core/ext/upb-gen/validate/validate.upb_minitable.h +4 -27
  560. data/src/core/ext/upb-gen/xds/annotations/v3/migrate.upb.h +128 -91
  561. data/src/core/ext/upb-gen/xds/annotations/v3/migrate.upb_minitable.c +82 -41
  562. data/src/core/ext/upb-gen/xds/annotations/v3/migrate.upb_minitable.h +5 -8
  563. data/src/core/ext/upb-gen/xds/annotations/v3/security.upb.h +36 -29
  564. data/src/core/ext/upb-gen/xds/annotations/v3/security.upb_minitable.c +36 -13
  565. data/src/core/ext/upb-gen/xds/annotations/v3/security.upb_minitable.h +1 -2
  566. data/src/core/ext/upb-gen/xds/annotations/v3/sensitive.upb.h +13 -11
  567. data/src/core/ext/upb-gen/xds/annotations/v3/sensitive.upb_minitable.c +22 -7
  568. data/src/core/ext/upb-gen/xds/annotations/v3/sensitive.upb_minitable.h +1 -1
  569. data/src/core/ext/upb-gen/xds/annotations/v3/status.upb.h +122 -90
  570. data/src/core/ext/upb-gen/xds/annotations/v3/status.upb_minitable.c +82 -39
  571. data/src/core/ext/upb-gen/xds/annotations/v3/status.upb_minitable.h +3 -7
  572. data/src/core/ext/upb-gen/xds/annotations/v3/versioning.upb.h +34 -27
  573. data/src/core/ext/upb-gen/xds/annotations/v3/versioning.upb_minitable.c +34 -13
  574. data/src/core/ext/upb-gen/xds/annotations/v3/versioning.upb_minitable.h +1 -2
  575. data/src/core/ext/upb-gen/xds/core/v3/authority.upb.h +21 -19
  576. data/src/core/ext/upb-gen/xds/core/v3/authority.upb_minitable.c +13 -7
  577. data/src/core/ext/upb-gen/xds/core/v3/authority.upb_minitable.h +0 -1
  578. data/src/core/ext/upb-gen/xds/core/v3/cidr.upb.h +29 -26
  579. data/src/core/ext/upb-gen/xds/core/v3/cidr.upb_minitable.c +17 -11
  580. data/src/core/ext/upb-gen/xds/core/v3/cidr.upb_minitable.h +0 -1
  581. data/src/core/ext/upb-gen/xds/core/v3/collection_entry.upb.h +70 -58
  582. data/src/core/ext/upb-gen/xds/core/v3/collection_entry.upb_minitable.c +32 -22
  583. data/src/core/ext/upb-gen/xds/core/v3/collection_entry.upb_minitable.h +0 -2
  584. data/src/core/ext/upb-gen/xds/core/v3/context_params.upb.h +53 -34
  585. data/src/core/ext/upb-gen/xds/core/v3/context_params.upb_minitable.c +26 -16
  586. data/src/core/ext/upb-gen/xds/core/v3/context_params.upb_minitable.h +0 -2
  587. data/src/core/ext/upb-gen/xds/core/v3/extension.upb.h +29 -26
  588. data/src/core/ext/upb-gen/xds/core/v3/extension.upb_minitable.c +17 -11
  589. data/src/core/ext/upb-gen/xds/core/v3/extension.upb_minitable.h +0 -1
  590. data/src/core/ext/upb-gen/xds/core/v3/resource.upb.h +37 -33
  591. data/src/core/ext/upb-gen/xds/core/v3/resource.upb_minitable.c +22 -14
  592. data/src/core/ext/upb-gen/xds/core/v3/resource.upb_minitable.h +0 -1
  593. data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb.h +102 -76
  594. data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb_minitable.c +43 -23
  595. data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb_minitable.h +0 -2
  596. data/src/core/ext/upb-gen/xds/core/v3/resource_name.upb.h +33 -30
  597. data/src/core/ext/upb-gen/xds/core/v3/resource_name.upb_minitable.c +19 -11
  598. data/src/core/ext/upb-gen/xds/core/v3/resource_name.upb_minitable.h +0 -1
  599. data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb.h +136 -83
  600. data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb_minitable.c +41 -33
  601. data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb_minitable.h +0 -4
  602. data/src/core/ext/upb-gen/xds/service/orca/v3/orca.upb.h +46 -32
  603. data/src/core/ext/upb-gen/xds/service/orca/v3/orca.upb_minitable.c +20 -12
  604. data/src/core/ext/upb-gen/xds/service/orca/v3/orca.upb_minitable.h +0 -1
  605. data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb.h +29 -26
  606. data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c +20 -12
  607. data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.h +0 -1
  608. data/src/core/ext/upb-gen/xds/type/matcher/v3/domain.upb.h +93 -61
  609. data/src/core/ext/upb-gen/xds/type/matcher/v3/domain.upb_minitable.c +28 -20
  610. data/src/core/ext/upb-gen/xds/type/matcher/v3/domain.upb_minitable.h +0 -2
  611. data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb.h +19 -17
  612. data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.c +1 -3
  613. data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.h +0 -1
  614. data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb.h +105 -71
  615. data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb_minitable.c +32 -22
  616. data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb_minitable.h +0 -2
  617. data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb.h +430 -314
  618. data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c +153 -123
  619. data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.h +0 -10
  620. data/src/core/ext/upb-gen/xds/type/matcher/v3/range.upb.h +307 -199
  621. data/src/core/ext/upb-gen/xds/type/matcher/v3/range.upb_minitable.c +74 -62
  622. data/src/core/ext/upb-gen/xds/type/matcher/v3/range.upb_minitable.h +0 -6
  623. data/src/core/ext/upb-gen/xds/type/matcher/v3/regex.upb.h +52 -42
  624. data/src/core/ext/upb-gen/xds/type/matcher/v3/regex.upb_minitable.c +19 -13
  625. data/src/core/ext/upb-gen/xds/type/matcher/v3/regex.upb_minitable.h +0 -2
  626. data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb.h +95 -71
  627. data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.c +36 -22
  628. data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.h +0 -2
  629. data/src/core/ext/upb-gen/xds/type/v3/cel.upb.h +92 -77
  630. data/src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.c +42 -28
  631. data/src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.h +0 -2
  632. data/src/core/ext/upb-gen/xds/type/v3/range.upb.h +67 -55
  633. data/src/core/ext/upb-gen/xds/type/v3/range.upb_minitable.c +36 -18
  634. data/src/core/ext/upb-gen/xds/type/v3/range.upb_minitable.h +0 -3
  635. data/src/core/ext/upb-gen/xds/type/v3/typed_struct.upb.h +29 -26
  636. data/src/core/ext/upb-gen/xds/type/v3/typed_struct.upb_minitable.c +17 -11
  637. data/src/core/ext/upb-gen/xds/type/v3/typed_struct.upb_minitable.h +0 -1
  638. data/src/core/ext/upbdefs-gen/google/protobuf/descriptor.upbdefs.c +885 -855
  639. data/src/core/filter/composite/composite_filter.cc +10 -3
  640. data/src/core/filter/composite/composite_filter.h +11 -1
  641. data/src/core/filter/filter_args.h +4 -22
  642. data/src/core/handshaker/handshaker.cc +10 -2
  643. data/src/core/handshaker/security/secure_endpoint.cc +73 -5
  644. data/src/core/lib/channel/channel_args.h +12 -6
  645. data/src/core/lib/channel/channel_stack.cc +1 -2
  646. data/src/core/lib/channel/channel_stack.h +1 -7
  647. data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -1
  648. data/src/core/lib/channel/channel_stack_builder_impl.h +0 -7
  649. data/src/core/lib/channel/promise_based_filter.cc +13 -1
  650. data/src/core/lib/channel/promise_based_filter.h +4 -5
  651. data/src/core/lib/event_engine/extensions/chaotic_good_extension.h +0 -13
  652. data/src/core/lib/event_engine/extensions/receive_coalescing_extension.h +48 -0
  653. data/src/core/lib/event_engine/posix.h +2 -0
  654. data/src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.cc +2 -1
  655. data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +11 -8
  656. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +7 -6
  657. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +1 -1
  658. data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +2 -1
  659. data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +10 -10
  660. data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.h +1 -1
  661. data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +1 -1
  662. data/src/core/lib/event_engine/windows/native_windows_dns_resolver.cc +5 -4
  663. data/src/core/lib/experiments/experiments.cc +258 -87
  664. data/src/core/lib/experiments/experiments.h +130 -32
  665. data/src/core/lib/iomgr/buffer_list.h +1 -1
  666. data/src/core/lib/iomgr/ev_epoll1_linux.cc +1 -1
  667. data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +2 -2
  668. data/src/core/lib/iomgr/tcp_posix.cc +2 -1
  669. data/src/core/lib/iomgr/tcp_server_posix.cc +3 -3
  670. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -1
  671. data/src/core/lib/promise/detail/promise_factory.h +8 -8
  672. data/src/core/lib/promise/interceptor_list.h +1 -1
  673. data/src/core/lib/promise/try_seq.h +2 -2
  674. data/src/core/lib/resource_quota/telemetry.cc +54 -0
  675. data/src/core/lib/resource_quota/telemetry.h +5 -23
  676. data/src/core/lib/surface/call.cc +6 -1
  677. data/src/core/lib/surface/call.h +9 -0
  678. data/src/core/lib/surface/version.cc +2 -2
  679. data/src/core/lib/transport/promise_endpoint.h +7 -5
  680. data/src/core/lib/transport/transport.h +31 -4
  681. data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +146 -74
  682. data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.h +88 -0
  683. data/src/core/mitigation_engine/mitigation_engine.h +81 -0
  684. data/src/core/plugin_registry/grpc_plugin_registry.cc +0 -2
  685. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +0 -5
  686. data/src/core/resolver/xds/xds_resolver.cc +23 -133
  687. data/src/core/server/server.cc +40 -18
  688. data/src/core/server/server.h +25 -14
  689. data/src/core/server/server_config_selector_filter.cc +122 -0
  690. data/src/core/server/server_config_selector_filter.h +1 -0
  691. data/src/core/server/xds_server_config_fetcher.cc +6 -0
  692. data/src/core/server/xds_server_config_fetcher_legacy.cc +1333 -0
  693. data/src/core/telemetry/histogram.h +10 -89
  694. data/src/core/telemetry/instrument.h +42 -28
  695. data/src/core/transport/message_size_service_config.cc +123 -0
  696. data/src/core/transport/message_size_service_config.h +85 -0
  697. data/src/core/transport/session_endpoint.cc +29 -4
  698. data/src/core/transport/session_endpoint.h +4 -0
  699. data/src/core/tsi/alts/crypt/gsec.h +4 -2
  700. data/src/core/tsi/ssl_transport_security.cc +6 -4
  701. data/src/core/util/http_client/parser.cc +1 -1
  702. data/src/core/util/lru_cache.h +2 -0
  703. data/src/core/util/ref_counted_string.h +1 -1
  704. data/src/core/util/tchar.cc +13 -7
  705. data/src/core/util/trie_lookup.h +1 -1
  706. data/src/core/xds/grpc/blackboard.cc +58 -0
  707. data/src/core/{filter → xds/grpc}/blackboard.h +30 -11
  708. data/src/core/xds/grpc/xds_common_types.cc +40 -0
  709. data/src/core/xds/grpc/xds_common_types.h +13 -0
  710. data/src/core/xds/grpc/xds_common_types_parser.cc +37 -34
  711. data/src/core/xds/grpc/xds_endpoint_parser.cc +1 -1
  712. data/src/core/xds/grpc/xds_http_composite_filter.cc +34 -18
  713. data/src/core/xds/grpc/xds_http_composite_filter.h +6 -3
  714. data/src/core/xds/grpc/xds_http_fault_filter.cc +0 -149
  715. data/src/core/xds/grpc/xds_http_fault_filter.h +19 -8
  716. data/src/core/xds/grpc/xds_http_filter.cc +2 -1
  717. data/src/core/xds/grpc/xds_http_filter.h +6 -16
  718. data/src/core/xds/grpc/xds_http_filter_registry.cc +0 -2
  719. data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +25 -119
  720. data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +27 -15
  721. data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +0 -149
  722. data/src/core/xds/grpc/xds_http_stateful_session_filter.h +19 -8
  723. data/src/core/xds/grpc/xds_lb_policy_registry.cc +18 -0
  724. data/src/core/xds/grpc/xds_listener_parser.cc +13 -9
  725. data/src/core/xds/grpc/xds_route_config.h +1 -1
  726. data/src/core/xds/grpc/xds_route_config_parser.cc +3 -5
  727. data/src/core/xds/grpc/xds_routing.cc +5 -11
  728. data/src/core/xds/grpc/xds_routing.h +2 -3
  729. data/src/core/xds/xds_client/lrs_client.cc +2 -2
  730. data/src/ruby/ext/grpc/rb_byte_buffer.c +1 -0
  731. data/src/ruby/ext/grpc/rb_call.c +3 -0
  732. data/src/ruby/ext/grpc/rb_call_credentials.c +1 -0
  733. data/src/ruby/ext/grpc/rb_channel.c +1 -0
  734. data/src/ruby/ext/grpc/rb_channel_args.c +1 -0
  735. data/src/ruby/ext/grpc/rb_channel_credentials.c +1 -0
  736. data/src/ruby/ext/grpc/rb_completion_queue.c +1 -0
  737. data/src/ruby/ext/grpc/rb_compression_options.c +1 -0
  738. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +4 -4
  739. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +6 -6
  740. data/src/ruby/ext/grpc/rb_server.c +1 -0
  741. data/src/ruby/ext/grpc/rb_server_credentials.c +1 -0
  742. data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +1 -0
  743. data/src/ruby/ext/grpc/rb_xds_server_credentials.c +1 -0
  744. data/src/ruby/lib/grpc/core/call_credentials.rb +86 -0
  745. data/src/ruby/lib/grpc/core/channel_credentials.rb +69 -0
  746. data/src/ruby/lib/grpc/core/credentials_helper.rb +126 -0
  747. data/src/ruby/lib/grpc/generic/client_stub.rb +86 -73
  748. data/src/ruby/lib/grpc/generic/interceptors.rb +1 -1
  749. data/src/ruby/lib/grpc/version.rb +1 -1
  750. data/src/ruby/lib/grpc.rb +25 -0
  751. data/src/ruby/spec/call_credentials_spec.rb +52 -2
  752. data/src/ruby/spec/credentials_helper_spec.rb +80 -0
  753. data/src/ruby/spec/generic/client_stub_spec.rb +27 -4
  754. data/src/ruby/spec/generic/server_interceptors_spec.rb +17 -3
  755. data/third_party/upb/upb/base/error_handler.h +79 -0
  756. data/third_party/upb/upb/base/internal/log2.h +29 -5
  757. data/third_party/upb/upb/generated_code_support.h +1 -0
  758. data/third_party/upb/upb/hash/common.c +129 -14
  759. data/third_party/upb/upb/hash/common.h +1 -1
  760. data/third_party/upb/upb/hash/ext_table.h +65 -0
  761. data/third_party/upb/upb/lex/strtod.c +14 -5
  762. data/third_party/upb/upb/mem/arena.c +113 -95
  763. data/third_party/upb/upb/mem/internal/arena.h +13 -8
  764. data/third_party/upb/upb/message/accessors.c +2 -3
  765. data/third_party/upb/upb/message/accessors.h +32 -12
  766. data/third_party/upb/upb/message/array.c +51 -2
  767. data/third_party/upb/upb/message/array.h +10 -0
  768. data/third_party/upb/upb/message/copy.c +18 -34
  769. data/third_party/upb/upb/message/internal/accessors.h +15 -49
  770. data/third_party/upb/upb/message/internal/array.h +1 -1
  771. data/third_party/upb/upb/message/internal/map.h +1 -1
  772. data/third_party/upb/upb/message/internal/message.c +8 -1
  773. data/third_party/upb/upb/message/internal/message.h +40 -10
  774. data/third_party/upb/upb/message/message.c +3 -2
  775. data/third_party/upb/upb/message/value.h +0 -6
  776. data/third_party/upb/upb/mini_descriptor/decode.c +78 -59
  777. data/third_party/upb/upb/mini_descriptor/link.c +8 -6
  778. data/third_party/upb/upb/mini_table/extension_registry.c +17 -49
  779. data/third_party/upb/upb/mini_table/extension_registry.h +5 -17
  780. data/third_party/upb/upb/mini_table/generated_registry.c +180 -0
  781. data/third_party/upb/upb/mini_table/generated_registry.h +66 -0
  782. data/third_party/upb/upb/mini_table/internal/extension.h +5 -3
  783. data/third_party/upb/upb/mini_table/internal/field.h +7 -5
  784. data/third_party/upb/upb/mini_table/internal/generated_registry.h +37 -0
  785. data/third_party/upb/upb/mini_table/internal/message.c +0 -18
  786. data/third_party/upb/upb/mini_table/internal/message.h +24 -41
  787. data/third_party/upb/upb/mini_table/internal/size_log2.h +2 -1
  788. data/third_party/upb/upb/mini_table/internal/sub.h +2 -5
  789. data/third_party/upb/upb/mini_table/message.h +34 -13
  790. data/third_party/upb/upb/port/atomic.h +180 -74
  791. data/third_party/upb/upb/port/def.inc +194 -29
  792. data/third_party/upb/upb/port/sanitizers.h +15 -0
  793. data/third_party/upb/upb/port/undef.inc +6 -2
  794. data/third_party/upb/upb/reflection/common.h +0 -6
  795. data/third_party/upb/upb/reflection/def.hpp +8 -12
  796. data/third_party/upb/upb/reflection/def_pool.c +85 -33
  797. data/third_party/upb/upb/reflection/def_pool.h +38 -8
  798. data/third_party/upb/upb/reflection/def_type.h +3 -0
  799. data/third_party/upb/upb/reflection/enum_def.c +45 -33
  800. data/third_party/upb/upb/reflection/enum_def.h +8 -4
  801. data/third_party/upb/upb/reflection/enum_reserved_range.c +7 -3
  802. data/third_party/upb/upb/reflection/enum_value_def.c +14 -29
  803. data/third_party/upb/upb/reflection/enum_value_def.h +5 -4
  804. data/third_party/upb/upb/reflection/extension_range.c +15 -14
  805. data/third_party/upb/upb/reflection/extension_range.h +7 -4
  806. data/third_party/upb/upb/reflection/field_def.c +114 -96
  807. data/third_party/upb/upb/reflection/field_def.h +3 -3
  808. data/third_party/upb/upb/reflection/file_def.c +71 -65
  809. data/third_party/upb/upb/reflection/file_def.h +4 -5
  810. data/third_party/upb/upb/reflection/internal/def_builder.c +22 -14
  811. data/third_party/upb/upb/reflection/internal/def_builder.h +44 -38
  812. data/third_party/upb/upb/reflection/internal/def_pool.h +5 -1
  813. data/third_party/upb/upb/reflection/internal/enum_def.h +6 -4
  814. data/third_party/upb/upb/reflection/internal/enum_reserved_range.h +3 -2
  815. data/third_party/upb/upb/reflection/internal/enum_value_def.h +7 -4
  816. data/third_party/upb/upb/reflection/internal/extension_range.h +4 -3
  817. data/third_party/upb/upb/reflection/internal/field_def.h +15 -12
  818. data/third_party/upb/upb/reflection/internal/file_def.h +8 -1
  819. data/third_party/upb/upb/reflection/internal/message_def.h +10 -7
  820. data/third_party/upb/upb/reflection/internal/message_reserved_range.h +3 -1
  821. data/third_party/upb/upb/reflection/internal/method_def.h +6 -6
  822. data/third_party/upb/upb/reflection/internal/oneof_def.h +6 -6
  823. data/third_party/upb/upb/reflection/internal/service_def.h +9 -6
  824. data/third_party/upb/upb/reflection/internal/upb_edition_defaults.h +1 -1
  825. data/third_party/upb/upb/reflection/message_def.c +46 -53
  826. data/third_party/upb/upb/reflection/message_def.h +6 -7
  827. data/third_party/upb/upb/reflection/message_reserved_range.c +7 -6
  828. data/third_party/upb/upb/reflection/method_def.c +22 -20
  829. data/third_party/upb/upb/reflection/method_def.h +4 -4
  830. data/third_party/upb/upb/reflection/oneof_def.c +17 -15
  831. data/third_party/upb/upb/reflection/oneof_def.h +6 -3
  832. data/third_party/upb/upb/reflection/service_def.c +50 -23
  833. data/third_party/upb/upb/reflection/service_def.h +7 -4
  834. data/third_party/upb/upb/text/internal/encode.c +7 -10
  835. data/third_party/upb/upb/wire/decode.c +269 -430
  836. data/third_party/upb/upb/wire/decode.h +6 -45
  837. data/third_party/upb/upb/wire/decode_fast/combinations.h +7 -3
  838. data/third_party/upb/upb/wire/decode_fast/select.c +7 -2
  839. data/third_party/upb/upb/wire/encode.c +144 -106
  840. data/third_party/upb/upb/wire/encode.h +6 -2
  841. data/third_party/upb/upb/wire/eps_copy_input_stream.c +36 -7
  842. data/third_party/upb/upb/wire/eps_copy_input_stream.h +94 -380
  843. data/third_party/upb/upb/wire/internal/decoder.c +1 -14
  844. data/third_party/upb/upb/wire/internal/decoder.h +84 -24
  845. data/third_party/upb/upb/wire/internal/eps_copy_input_stream.h +339 -0
  846. data/third_party/upb/upb/wire/internal/reader.h +29 -12
  847. data/third_party/upb/upb/wire/reader.c +35 -22
  848. data/third_party/upb/upb/wire/reader.h +11 -18
  849. data/third_party/utf8_range/utf8_range.c +1 -1
  850. data/third_party/utf8_range/utf8_range.h +2 -1
  851. metadata +27 -13
  852. data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +0 -117
  853. data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.h +0 -109
  854. data/src/core/ext/filters/gcp_authentication/gcp_authentication_service_config_parser.cc +0 -80
  855. data/src/core/ext/filters/gcp_authentication/gcp_authentication_service_config_parser.h +0 -86
  856. data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc +0 -83
  857. data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +0 -91
  858. data/src/core/ext/transport/chttp2/transport/incoming_metadata_tracker.h +0 -217
  859. data/src/core/filter/blackboard.cc +0 -33
  860. data/third_party/upb/upb/message/internal/tagged_ptr.h +0 -56
  861. data/third_party/upb/upb/message/tagged_ptr.h +0 -48
@@ -0,0 +1,1333 @@
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
+ private:
165
+ class FilterChainMatchManager;
166
+
167
+ void OnFatalError(absl::Status status) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
168
+
169
+ // Invoked by FilterChainMatchManager that is done fetching all referenced RDS
170
+ // resources. If the calling FilterChainMatchManager is the
171
+ // pending_filter_chain_match_manager_, it is promoted to be the
172
+ // filter_chain_match_manager_ in use.
173
+ void PendingFilterChainMatchManagerReady(
174
+ FilterChainMatchManager* filter_chain_match_manager) {
175
+ MutexLock lock(&mu_);
176
+ PendingFilterChainMatchManagerReadyLocked(filter_chain_match_manager);
177
+ }
178
+ void PendingFilterChainMatchManagerReadyLocked(
179
+ FilterChainMatchManager* filter_chain_match_manager)
180
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&mu_);
181
+
182
+ RefCountedPtr<GrpcXdsClient> xds_client_;
183
+ const std::unique_ptr<ServerConfigFetcher::WatcherInterface>
184
+ server_config_watcher_;
185
+ const grpc_server_xds_status_notifier serving_status_notifier_;
186
+ const std::string listening_address_;
187
+ Mutex mu_;
188
+ RefCountedPtr<FilterChainMatchManager> filter_chain_match_manager_
189
+ ABSL_GUARDED_BY(mu_);
190
+ RefCountedPtr<FilterChainMatchManager> pending_filter_chain_match_manager_
191
+ ABSL_GUARDED_BY(mu_);
192
+ };
193
+
194
+ // A connection manager used by the server listener code to inject channel args
195
+ // to be used for each incoming connection. This implementation chooses the
196
+ // appropriate filter chain from the xDS Listener resource and injects channel
197
+ // args that configure the right mTLS certs and cause the right set of HTTP
198
+ // filters to be injected.
199
+ class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager final
200
+ : public ServerConfigFetcher::ConnectionManager {
201
+ public:
202
+ FilterChainMatchManager(
203
+ RefCountedPtr<GrpcXdsClient> xds_client,
204
+ XdsListenerResource::FilterChainMap filter_chain_map,
205
+ std::optional<XdsListenerResource::FilterChainData> default_filter_chain);
206
+
207
+ ~FilterChainMatchManager() override {
208
+ xds_client_.reset(DEBUG_LOCATION, "FilterChainMatchManager");
209
+ }
210
+
211
+ absl::StatusOr<ChannelArgs> UpdateChannelArgsForConnection(
212
+ const ChannelArgs& args, grpc_endpoint* tcp) override;
213
+
214
+ // Invoked by ListenerWatcher to start fetching referenced RDS resources.
215
+ void StartRdsWatch(RefCountedPtr<ListenerWatcher> listener_watcher)
216
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ListenerWatcher::mu_);
217
+
218
+ const XdsListenerResource::FilterChainMap& filter_chain_map() const {
219
+ return filter_chain_map_;
220
+ }
221
+
222
+ const std::optional<XdsListenerResource::FilterChainData>&
223
+ default_filter_chain() const {
224
+ return default_filter_chain_;
225
+ }
226
+
227
+ private:
228
+ class RouteConfigWatcher;
229
+ struct RdsUpdateState {
230
+ RouteConfigWatcher* watcher;
231
+ std::optional<absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>>
232
+ rds_update;
233
+ };
234
+
235
+ class XdsServerConfigSelector;
236
+ class StaticXdsServerConfigSelectorProvider;
237
+ class DynamicXdsServerConfigSelectorProvider;
238
+
239
+ absl::StatusOr<RefCountedPtr<XdsCertificateProvider>>
240
+ CreateOrGetXdsCertificateProviderFromFilterChainData(
241
+ const XdsListenerResource::FilterChainData* filter_chain);
242
+ void Orphaned() override;
243
+
244
+ // Helper functions invoked by RouteConfigWatcher when there are updates to
245
+ // RDS resources.
246
+ void OnRouteConfigChanged(
247
+ const std::string& resource_name,
248
+ absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
249
+ route_config);
250
+ void OnAmbientError(const std::string& resource_name, absl::Status status);
251
+
252
+ // Executes cb once for each unique filter chain object in the LDS resource.
253
+ void ForEachFilterChain(
254
+ absl::FunctionRef<void(XdsListenerResource::FilterChainData&)> cb);
255
+
256
+ RefCountedPtr<GrpcXdsClient> xds_client_;
257
+ // This ref is only kept around till the FilterChainMatchManager becomes
258
+ // ready.
259
+ RefCountedPtr<ListenerWatcher> listener_watcher_;
260
+ // TODO(roth): Consider holding a ref to the LDS resource and storing
261
+ // a pointer to the filter chain data within that LDS resource, rather
262
+ // than copying the filter chain data here.
263
+ XdsListenerResource::FilterChainMap filter_chain_map_;
264
+ std::optional<XdsListenerResource::FilterChainData> default_filter_chain_;
265
+ Mutex mu_;
266
+ size_t rds_resources_yet_to_fetch_ ABSL_GUARDED_BY(mu_) = 0;
267
+ std::map<std::string /* resource_name */, RdsUpdateState> rds_map_
268
+ ABSL_GUARDED_BY(mu_);
269
+ std::map<const XdsListenerResource::FilterChainData*,
270
+ RefCountedPtr<XdsCertificateProvider>>
271
+ certificate_providers_map_ ABSL_GUARDED_BY(mu_);
272
+ };
273
+
274
+ // A watcher implementation for listening on RDS updates referenced to by a
275
+ // FilterChainMatchManager object. After all referenced RDS resources are
276
+ // fetched (errors are allowed), the FilterChainMatchManager tries to replace
277
+ // the current object. The watcher continues to update the referenced RDS
278
+ // resources so that new XdsServerConfigSelectorProvider objects are created
279
+ // with the latest updates and new connections do not need to wait for the RDS
280
+ // resources to be fetched.
281
+ class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
282
+ RouteConfigWatcher final
283
+ : public XdsRouteConfigResourceType::WatcherInterface {
284
+ public:
285
+ RouteConfigWatcher(
286
+ std::string resource_name,
287
+ WeakRefCountedPtr<FilterChainMatchManager> filter_chain_match_manager)
288
+ : resource_name_(std::move(resource_name)),
289
+ filter_chain_match_manager_(std::move(filter_chain_match_manager)) {}
290
+
291
+ void OnResourceChanged(
292
+ absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
293
+ route_config,
294
+ RefCountedPtr<ReadDelayHandle> /* read_delay_handle */) override {
295
+ filter_chain_match_manager_->OnRouteConfigChanged(resource_name_,
296
+ std::move(route_config));
297
+ }
298
+
299
+ void OnAmbientError(
300
+ absl::Status status,
301
+ RefCountedPtr<ReadDelayHandle> /* read_delay_handle */) override {
302
+ filter_chain_match_manager_->OnAmbientError(resource_name_,
303
+ std::move(status));
304
+ }
305
+
306
+ private:
307
+ std::string resource_name_;
308
+ WeakRefCountedPtr<FilterChainMatchManager> filter_chain_match_manager_;
309
+ };
310
+
311
+ // An implementation of ServerConfigSelector used by
312
+ // StaticXdsServerConfigSelectorProvider and
313
+ // DynamicXdsServerConfigSelectorProvider to parse the RDS update and get
314
+ // per-call configuration based on incoming metadata.
315
+ class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
316
+ XdsServerConfigSelector final : public ServerConfigSelector {
317
+ public:
318
+ static absl::StatusOr<RefCountedPtr<XdsServerConfigSelector>> Create(
319
+ const XdsHttpFilterRegistry& http_filter_registry,
320
+ std::shared_ptr<const XdsRouteConfigResource> rds_update,
321
+ const std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>&
322
+ http_filters);
323
+ ~XdsServerConfigSelector() override = default;
324
+
325
+ absl::StatusOr<CallConfig> GetCallConfig(
326
+ grpc_metadata_batch* metadata) override;
327
+
328
+ private:
329
+ struct VirtualHost {
330
+ struct Route {
331
+ // true if an action other than kNonForwardingAction is configured.
332
+ bool unsupported_action;
333
+ // TODO(roth): Consider holding a ref to the RDS resource and storing
334
+ // a pointer to the matchers within that RDS resource, rather than
335
+ // copying the matchers here.
336
+ XdsRouteConfigResource::Route::Matchers matchers;
337
+ RefCountedPtr<ServiceConfig> method_config;
338
+ };
339
+
340
+ class RouteListIterator final : public XdsRouting::RouteListIterator {
341
+ public:
342
+ explicit RouteListIterator(const std::vector<Route>* routes)
343
+ : routes_(routes) {}
344
+
345
+ size_t Size() const override { return routes_->size(); }
346
+
347
+ const XdsRouteConfigResource::Route::Matchers& GetMatchersForRoute(
348
+ size_t index) const override {
349
+ return (*routes_)[index].matchers;
350
+ }
351
+
352
+ private:
353
+ const std::vector<Route>* routes_;
354
+ };
355
+
356
+ std::vector<std::string> domains;
357
+ std::vector<Route> routes;
358
+ };
359
+
360
+ class VirtualHostListIterator final
361
+ : public XdsRouting::VirtualHostListIterator {
362
+ public:
363
+ explicit VirtualHostListIterator(
364
+ const std::vector<VirtualHost>* virtual_hosts)
365
+ : virtual_hosts_(virtual_hosts) {}
366
+
367
+ size_t Size() const override { return virtual_hosts_->size(); }
368
+
369
+ const std::vector<std::string>& GetDomainsForVirtualHost(
370
+ size_t index) const override {
371
+ return (*virtual_hosts_)[index].domains;
372
+ }
373
+
374
+ private:
375
+ const std::vector<VirtualHost>* virtual_hosts_;
376
+ };
377
+
378
+ std::vector<VirtualHost> virtual_hosts_;
379
+ };
380
+
381
+ // An XdsServerConfigSelectorProvider implementation for when the
382
+ // RouteConfiguration is available inline.
383
+ class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
384
+ StaticXdsServerConfigSelectorProvider final
385
+ : public ServerConfigSelectorProvider {
386
+ public:
387
+ StaticXdsServerConfigSelectorProvider(
388
+ RefCountedPtr<GrpcXdsClient> xds_client,
389
+ absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
390
+ static_resource,
391
+ std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
392
+ http_filters)
393
+ : xds_client_(std::move(xds_client)),
394
+ static_resource_(std::move(static_resource)),
395
+ http_filters_(std::move(http_filters)) {}
396
+
397
+ ~StaticXdsServerConfigSelectorProvider() override {
398
+ xds_client_.reset(DEBUG_LOCATION, "StaticXdsServerConfigSelectorProvider");
399
+ }
400
+
401
+ absl::StatusOr<RefCountedPtr<ServerConfigSelector>> Watch(
402
+ std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
403
+ watcher) override {
404
+ GRPC_CHECK(watcher_ == nullptr);
405
+ watcher_ = std::move(watcher);
406
+ if (!static_resource_.ok()) {
407
+ return static_resource_.status();
408
+ }
409
+ return XdsServerConfigSelector::Create(
410
+ DownCast<const GrpcXdsBootstrap&>(xds_client_->bootstrap())
411
+ .http_filter_registry(),
412
+ static_resource_.value(), http_filters_);
413
+ }
414
+
415
+ void CancelWatch() override { watcher_.reset(); }
416
+
417
+ private:
418
+ void Orphaned() override {}
419
+
420
+ RefCountedPtr<GrpcXdsClient> xds_client_;
421
+ absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
422
+ static_resource_;
423
+ // TODO(roth): Consider holding a ref to the LDS resource and storing
424
+ // a pointer to the HTTP filters within that LDS resource, rather than
425
+ // copying the HTTP filters here.
426
+ std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
427
+ http_filters_;
428
+ std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
429
+ watcher_;
430
+ };
431
+
432
+ // An XdsServerConfigSelectorProvider implementation for when the
433
+ // RouteConfiguration is to be fetched separately via RDS.
434
+ class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
435
+ DynamicXdsServerConfigSelectorProvider final
436
+ : public ServerConfigSelectorProvider {
437
+ public:
438
+ DynamicXdsServerConfigSelectorProvider(
439
+ RefCountedPtr<GrpcXdsClient> xds_client, std::string resource_name,
440
+ absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
441
+ initial_resource,
442
+ std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
443
+ http_filters);
444
+
445
+ ~DynamicXdsServerConfigSelectorProvider() override {
446
+ xds_client_.reset(DEBUG_LOCATION, "DynamicXdsServerConfigSelectorProvider");
447
+ }
448
+
449
+ absl::StatusOr<RefCountedPtr<ServerConfigSelector>> Watch(
450
+ std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
451
+ watcher) override;
452
+ void CancelWatch() override;
453
+
454
+ private:
455
+ class RouteConfigWatcher;
456
+
457
+ void Orphaned() override;
458
+ void OnRouteConfigChanged(
459
+ absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>> rds_update);
460
+ void OnAmbientError(absl::Status status);
461
+
462
+ RefCountedPtr<GrpcXdsClient> xds_client_;
463
+ std::string resource_name_;
464
+ // TODO(roth): Consider holding a ref to the LDS resource and storing
465
+ // a pointer to the HTTP filters within that LDS resource, rather than
466
+ // copying the HTTP filters here.
467
+ std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
468
+ http_filters_;
469
+ RouteConfigWatcher* route_config_watcher_ = nullptr;
470
+ Mutex mu_;
471
+ std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
472
+ watcher_ ABSL_GUARDED_BY(mu_);
473
+ absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>> resource_
474
+ ABSL_GUARDED_BY(mu_);
475
+ };
476
+
477
+ // A watcher implementation for updating the RDS resource used by
478
+ // DynamicXdsServerConfigSelectorProvider
479
+ class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
480
+ DynamicXdsServerConfigSelectorProvider::RouteConfigWatcher final
481
+ : public XdsRouteConfigResourceType::WatcherInterface {
482
+ public:
483
+ explicit RouteConfigWatcher(
484
+ WeakRefCountedPtr<DynamicXdsServerConfigSelectorProvider> parent)
485
+ : parent_(std::move(parent)) {}
486
+
487
+ void OnResourceChanged(
488
+ absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
489
+ route_config,
490
+ RefCountedPtr<ReadDelayHandle> /* read_delay_handle */) override {
491
+ parent_->OnRouteConfigChanged(std::move(route_config));
492
+ }
493
+
494
+ void OnAmbientError(
495
+ absl::Status status,
496
+ RefCountedPtr<ReadDelayHandle> /* read_delay_handle */) override {
497
+ parent_->OnAmbientError(std::move(status));
498
+ }
499
+
500
+ private:
501
+ WeakRefCountedPtr<DynamicXdsServerConfigSelectorProvider> parent_;
502
+ };
503
+
504
+ //
505
+ // XdsServerConfigFetcher
506
+ //
507
+
508
+ XdsServerConfigFetcher::XdsServerConfigFetcher(
509
+ RefCountedPtr<GrpcXdsClient> xds_client,
510
+ grpc_server_xds_status_notifier notifier)
511
+ : xds_client_(std::move(xds_client)), serving_status_notifier_(notifier) {
512
+ GRPC_CHECK(xds_client_ != nullptr);
513
+ }
514
+
515
+ std::string ListenerResourceName(absl::string_view resource_name_template,
516
+ absl::string_view listening_address) {
517
+ std::string tmp;
518
+ if (absl::StartsWith(resource_name_template, "xdstp:")) {
519
+ tmp = URI::PercentEncodePath(listening_address);
520
+ listening_address = tmp;
521
+ }
522
+ return absl::StrReplaceAll(resource_name_template,
523
+ {{"%s", listening_address}});
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(
535
+ xds_client_.get(),
536
+ ListenerResourceName(
537
+ DownCast<const GrpcXdsBootstrap&>(xds_client_->bootstrap())
538
+ .server_listener_resource_name_template(),
539
+ listening_address),
540
+ std::move(listener_watcher));
541
+ MutexLock lock(&mu_);
542
+ listener_watchers_.emplace(watcher_ptr, listener_watcher_ptr);
543
+ }
544
+
545
+ void XdsServerConfigFetcher::CancelWatch(
546
+ ServerConfigFetcher::WatcherInterface* watcher) {
547
+ MutexLock lock(&mu_);
548
+ auto it = listener_watchers_.find(watcher);
549
+ if (it != listener_watchers_.end()) {
550
+ // Cancel the watch on the listener before erasing
551
+ XdsListenerResourceType::CancelWatch(
552
+ xds_client_.get(),
553
+ ListenerResourceName(
554
+ DownCast<const GrpcXdsBootstrap&>(xds_client_->bootstrap())
555
+ .server_listener_resource_name_template(),
556
+ it->second->listening_address()),
557
+ it->second, false /* delay_unsubscription */);
558
+ listener_watchers_.erase(it);
559
+ }
560
+ }
561
+
562
+ //
563
+ // XdsServerConfigFetcher::ListenerWatcher
564
+ //
565
+
566
+ XdsServerConfigFetcher::ListenerWatcher::ListenerWatcher(
567
+ RefCountedPtr<GrpcXdsClient> xds_client,
568
+ std::unique_ptr<ServerConfigFetcher::WatcherInterface>
569
+ server_config_watcher,
570
+ grpc_server_xds_status_notifier serving_status_notifier,
571
+ std::string listening_address)
572
+ : xds_client_(std::move(xds_client)),
573
+ server_config_watcher_(std::move(server_config_watcher)),
574
+ serving_status_notifier_(serving_status_notifier),
575
+ listening_address_(std::move(listening_address)) {}
576
+
577
+ void XdsServerConfigFetcher::ListenerWatcher::OnResourceChanged(
578
+ absl::StatusOr<std::shared_ptr<const XdsListenerResource>> listener,
579
+ RefCountedPtr<ReadDelayHandle> /* read_delay_handle */) {
580
+ if (!listener.ok()) {
581
+ MutexLock lock(&mu_);
582
+ OnFatalError(absl::Status(
583
+ listener.status().code(),
584
+ absl::StrCat("LDS resource: ", listener.status().message())));
585
+ return;
586
+ }
587
+ GRPC_TRACE_LOG(xds_server_config_fetcher, INFO)
588
+ << "[ListenerWatcher " << this << "] Received LDS update from xds client "
589
+ << xds_client_.get() << ": " << (*listener)->ToString();
590
+ auto* tcp_listener =
591
+ std::get_if<XdsListenerResource::TcpListener>(&(*listener)->listener);
592
+ if (tcp_listener == nullptr) {
593
+ MutexLock lock(&mu_);
594
+ OnFatalError(
595
+ absl::FailedPreconditionError("LDS resource is not a TCP listener"));
596
+ return;
597
+ }
598
+ if (tcp_listener->address != listening_address_) {
599
+ MutexLock lock(&mu_);
600
+ OnFatalError(absl::FailedPreconditionError(
601
+ "Address in LDS update does not match listening address"));
602
+ return;
603
+ }
604
+ auto new_filter_chain_match_manager = MakeRefCounted<FilterChainMatchManager>(
605
+ xds_client_.Ref(DEBUG_LOCATION, "FilterChainMatchManager"),
606
+ tcp_listener->filter_chain_map, tcp_listener->default_filter_chain);
607
+ MutexLock lock(&mu_);
608
+ if (filter_chain_match_manager_ == nullptr ||
609
+ !(new_filter_chain_match_manager->filter_chain_map() ==
610
+ filter_chain_match_manager_->filter_chain_map() &&
611
+ new_filter_chain_match_manager->default_filter_chain() ==
612
+ filter_chain_match_manager_->default_filter_chain())) {
613
+ pending_filter_chain_match_manager_ =
614
+ std::move(new_filter_chain_match_manager);
615
+ pending_filter_chain_match_manager_->StartRdsWatch(
616
+ RefAsSubclass<ListenerWatcher>());
617
+ }
618
+ }
619
+
620
+ void XdsServerConfigFetcher::ListenerWatcher::OnAmbientError(
621
+ absl::Status status, RefCountedPtr<ReadDelayHandle> /*read_delay_handle*/) {
622
+ LOG(ERROR) << "ListenerWatcher:" << this
623
+ << " XdsClient reports ambient error: " << status << " for "
624
+ << listening_address_
625
+ << "; ignoring in favor of existing resource";
626
+ }
627
+
628
+ void XdsServerConfigFetcher::ListenerWatcher::OnFatalError(
629
+ absl::Status status) {
630
+ pending_filter_chain_match_manager_.reset();
631
+ if (filter_chain_match_manager_ != nullptr) {
632
+ // The server has started listening already, so we need to gracefully
633
+ // stop serving.
634
+ server_config_watcher_->StopServing();
635
+ filter_chain_match_manager_.reset();
636
+ }
637
+ if (serving_status_notifier_.on_serving_status_update != nullptr) {
638
+ serving_status_notifier_.on_serving_status_update(
639
+ serving_status_notifier_.user_data, listening_address_.c_str(),
640
+ {static_cast<grpc_status_code>(status.raw_code()),
641
+ std::string(status.message()).c_str()});
642
+ } else {
643
+ LOG(ERROR) << "ListenerWatcher:" << this << " Encountered fatal error "
644
+ << status << "; not serving on " << listening_address_;
645
+ }
646
+ }
647
+
648
+ void XdsServerConfigFetcher::ListenerWatcher::
649
+ PendingFilterChainMatchManagerReadyLocked(
650
+ XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager*
651
+ filter_chain_match_manager) {
652
+ if (pending_filter_chain_match_manager_ != filter_chain_match_manager) {
653
+ // This FilterChainMatchManager is no longer the current pending resource.
654
+ // It should get cleaned up eventually. Ignore this update.
655
+ return;
656
+ }
657
+ bool first_good_update = filter_chain_match_manager_ == nullptr;
658
+ // Promote the pending FilterChainMatchManager
659
+ filter_chain_match_manager_ = std::move(pending_filter_chain_match_manager_);
660
+ // TODO(yashykt): Right now, the server_config_watcher_ does not invoke
661
+ // XdsServerConfigFetcher while holding a lock, but that might change in the
662
+ // future in which case we would want to execute this update outside the
663
+ // critical region through a WorkSerializer similar to XdsClient.
664
+ server_config_watcher_->UpdateConnectionManager(filter_chain_match_manager_);
665
+ // Let the logger know about the update if there was no previous good update.
666
+ if (first_good_update) {
667
+ if (serving_status_notifier_.on_serving_status_update != nullptr) {
668
+ serving_status_notifier_.on_serving_status_update(
669
+ serving_status_notifier_.user_data, listening_address_.c_str(),
670
+ {GRPC_STATUS_OK, ""});
671
+ } else {
672
+ LOG(INFO) << "xDS Listener resource obtained; will start serving on "
673
+ << listening_address_;
674
+ }
675
+ }
676
+ }
677
+
678
+ //
679
+ // XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager
680
+ //
681
+
682
+ XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
683
+ FilterChainMatchManager(
684
+ RefCountedPtr<GrpcXdsClient> xds_client,
685
+ XdsListenerResource::FilterChainMap filter_chain_map,
686
+ std::optional<XdsListenerResource::FilterChainData>
687
+ default_filter_chain)
688
+ : xds_client_(std::move(xds_client)),
689
+ filter_chain_map_(std::move(filter_chain_map)),
690
+ default_filter_chain_(std::move(default_filter_chain)) {}
691
+
692
+ void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
693
+ ForEachFilterChain(
694
+ absl::FunctionRef<void(XdsListenerResource::FilterChainData&)> cb) {
695
+ // A given FilterChainData object may appear more than once in the map,
696
+ // but we want to invoke the callback exactly once for each
697
+ // FilterChainData object. Therefore, we start by constructing a set
698
+ // of all FilterChainData objects by address, to weed out duplicates.
699
+ std::set<XdsListenerResource::FilterChainData*> filter_chain_data_set;
700
+ for (const auto& destination_ip : filter_chain_map_.destination_ip_vector) {
701
+ for (const auto& source_type : destination_ip.source_types_array) {
702
+ for (const auto& source_ip : source_type) {
703
+ for (const auto& source_port_pair : source_ip.ports_map) {
704
+ auto* filter_chain_data = source_port_pair.second.data.get();
705
+ filter_chain_data_set.insert(filter_chain_data);
706
+ }
707
+ }
708
+ }
709
+ }
710
+ // Invoke the callback once for each FilterChainData object.
711
+ for (auto* filter_chain_data : filter_chain_data_set) {
712
+ cb(*filter_chain_data);
713
+ }
714
+ // Also invoke the callback for the default filter chain, if present.
715
+ if (default_filter_chain_.has_value()) {
716
+ cb(*default_filter_chain_);
717
+ }
718
+ }
719
+
720
+ void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
721
+ StartRdsWatch(RefCountedPtr<ListenerWatcher> listener_watcher) {
722
+ // Get the set of RDS resources to watch on. Also reverse the list of
723
+ // HTTP filters in each filter chain, since received data moves *up*
724
+ // the stack on the server side.
725
+ std::set<std::string> resource_names;
726
+ ForEachFilterChain(
727
+ [&](XdsListenerResource::FilterChainData& filter_chain_data) {
728
+ auto& hcm = filter_chain_data.http_connection_manager;
729
+ const auto* rds_name = std::get_if<std::string>(&hcm.route_config);
730
+ if (rds_name != nullptr) resource_names.insert(*rds_name);
731
+ std::reverse(hcm.http_filters.begin(), hcm.http_filters.end());
732
+ });
733
+ // Start watching referenced RDS resources.
734
+ struct WatcherToStart {
735
+ std::string resource_name;
736
+ RefCountedPtr<RouteConfigWatcher> watcher;
737
+ };
738
+ std::vector<WatcherToStart> watchers_to_start;
739
+ watchers_to_start.reserve(resource_names.size());
740
+ {
741
+ MutexLock lock(&mu_);
742
+ for (const auto& resource_name : resource_names) {
743
+ ++rds_resources_yet_to_fetch_;
744
+ auto route_config_watcher = MakeRefCounted<RouteConfigWatcher>(
745
+ resource_name, WeakRefAsSubclass<FilterChainMatchManager>());
746
+ rds_map_.emplace(resource_name, RdsUpdateState{route_config_watcher.get(),
747
+ std::nullopt});
748
+ watchers_to_start.push_back(
749
+ WatcherToStart{resource_name, std::move(route_config_watcher)});
750
+ }
751
+ if (rds_resources_yet_to_fetch_ != 0) {
752
+ listener_watcher_ = std::move(listener_watcher);
753
+ listener_watcher = nullptr;
754
+ }
755
+ }
756
+ for (auto& watcher_to_start : watchers_to_start) {
757
+ XdsRouteConfigResourceType::StartWatch(xds_client_.get(),
758
+ watcher_to_start.resource_name,
759
+ std::move(watcher_to_start.watcher));
760
+ }
761
+ // Promote this filter chain match manager if all referenced resources are
762
+ // fetched.
763
+ if (listener_watcher != nullptr) {
764
+ listener_watcher->PendingFilterChainMatchManagerReadyLocked(this);
765
+ }
766
+ }
767
+
768
+ void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
769
+ Orphaned() {
770
+ MutexLock lock(&mu_);
771
+ // Cancel the RDS watches to clear up the weak refs
772
+ for (const auto& entry : rds_map_) {
773
+ XdsRouteConfigResourceType::CancelWatch(xds_client_.get(), entry.first,
774
+ entry.second.watcher,
775
+ false /* delay_unsubscription */);
776
+ }
777
+ // Also give up the ref on ListenerWatcher since it won't be needed anymore
778
+ listener_watcher_.reset();
779
+ }
780
+
781
+ absl::StatusOr<RefCountedPtr<XdsCertificateProvider>>
782
+ XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
783
+ CreateOrGetXdsCertificateProviderFromFilterChainData(
784
+ const XdsListenerResource::FilterChainData* filter_chain) {
785
+ MutexLock lock(&mu_);
786
+ auto it = certificate_providers_map_.find(filter_chain);
787
+ if (it != certificate_providers_map_.end()) return it->second;
788
+ // Configure root cert.
789
+ auto* ca_cert_provider =
790
+ std::get_if<CommonTlsContext::CertificateProviderPluginInstance>(
791
+ &filter_chain->downstream_tls_context.common_tls_context
792
+ .certificate_validation_context.ca_certs);
793
+ absl::string_view root_provider_cert_name;
794
+ RefCountedPtr<grpc_tls_certificate_provider> root_cert_provider;
795
+ if (ca_cert_provider != nullptr) {
796
+ root_provider_cert_name = ca_cert_provider->certificate_name;
797
+ root_cert_provider =
798
+ xds_client_->certificate_provider_store()
799
+ .CreateOrGetCertificateProvider(ca_cert_provider->instance_name);
800
+ if (root_cert_provider == nullptr) {
801
+ return absl::NotFoundError(
802
+ absl::StrCat("Certificate provider instance name: \"",
803
+ ca_cert_provider->instance_name, "\" not recognized."));
804
+ }
805
+ }
806
+ // Configure identity cert.
807
+ absl::string_view identity_provider_instance_name =
808
+ filter_chain->downstream_tls_context.common_tls_context
809
+ .tls_certificate_provider_instance.instance_name;
810
+ absl::string_view identity_provider_cert_name =
811
+ filter_chain->downstream_tls_context.common_tls_context
812
+ .tls_certificate_provider_instance.certificate_name;
813
+ RefCountedPtr<grpc_tls_certificate_provider> identity_cert_provider;
814
+ if (!identity_provider_instance_name.empty()) {
815
+ identity_cert_provider =
816
+ xds_client_->certificate_provider_store()
817
+ .CreateOrGetCertificateProvider(identity_provider_instance_name);
818
+ if (identity_cert_provider == nullptr) {
819
+ return absl::NotFoundError(
820
+ absl::StrCat("Certificate provider instance name: \"",
821
+ identity_provider_instance_name, "\" not recognized."));
822
+ }
823
+ }
824
+ auto xds_cert_provider = MakeRefCounted<XdsCertificateProvider>(
825
+ std::move(root_cert_provider), root_provider_cert_name,
826
+ std::move(identity_cert_provider), identity_provider_cert_name,
827
+ filter_chain->downstream_tls_context.require_client_certificate);
828
+ certificate_providers_map_.emplace(filter_chain, xds_cert_provider);
829
+ return xds_cert_provider;
830
+ }
831
+
832
+ void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
833
+ OnRouteConfigChanged(
834
+ const std::string& resource_name,
835
+ absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
836
+ route_config) {
837
+ RefCountedPtr<ListenerWatcher> listener_watcher;
838
+ {
839
+ MutexLock lock(&mu_);
840
+ auto& state = rds_map_[resource_name];
841
+ if (!state.rds_update.has_value()) {
842
+ if (--rds_resources_yet_to_fetch_ == 0) {
843
+ listener_watcher = std::move(listener_watcher_);
844
+ }
845
+ }
846
+ if (!route_config.ok()) {
847
+ route_config = absl::UnavailableError(
848
+ absl::StrCat("RDS resource ", resource_name, ": ",
849
+ route_config.status().message()));
850
+ }
851
+ state.rds_update = std::move(route_config);
852
+ }
853
+ // Promote the filter chain match manager object if all the referenced
854
+ // resources are fetched.
855
+ if (listener_watcher != nullptr) {
856
+ listener_watcher->PendingFilterChainMatchManagerReady(this);
857
+ }
858
+ }
859
+
860
+ void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
861
+ OnAmbientError(const std::string& resource_name, absl::Status status) {
862
+ LOG(ERROR) << "RouteConfigWatcher:" << this
863
+ << " XdsClient reports ambient error: " << status << " for "
864
+ << resource_name << "; ignoring in favor of existing resource";
865
+ }
866
+
867
+ const XdsListenerResource::FilterChainData* FindFilterChainDataForSourcePort(
868
+ const XdsListenerResource::FilterChainMap::SourcePortsMap& source_ports_map,
869
+ absl::string_view port_str) {
870
+ int port = 0;
871
+ if (!absl::SimpleAtoi(port_str, &port)) return nullptr;
872
+ auto it = source_ports_map.find(port);
873
+ if (it != source_ports_map.end()) {
874
+ return it->second.data.get();
875
+ }
876
+ // Search for the catch-all port 0 since we didn't get a direct match
877
+ it = source_ports_map.find(0);
878
+ if (it != source_ports_map.end()) {
879
+ return it->second.data.get();
880
+ }
881
+ return nullptr;
882
+ }
883
+
884
+ const XdsListenerResource::FilterChainData* FindFilterChainDataForSourceIp(
885
+ const XdsListenerResource::FilterChainMap::SourceIpVector& source_ip_vector,
886
+ const grpc_resolved_address* source_ip, absl::string_view port) {
887
+ const XdsListenerResource::FilterChainMap::SourceIp* best_match = nullptr;
888
+ for (const auto& entry : source_ip_vector) {
889
+ // Special case for catch-all
890
+ if (!entry.prefix_range.has_value()) {
891
+ if (best_match == nullptr) {
892
+ best_match = &entry;
893
+ }
894
+ continue;
895
+ }
896
+ if (best_match != nullptr && best_match->prefix_range.has_value() &&
897
+ best_match->prefix_range->prefix_len >=
898
+ entry.prefix_range->prefix_len) {
899
+ continue;
900
+ }
901
+ if (grpc_sockaddr_match_subnet(source_ip, &entry.prefix_range->address,
902
+ entry.prefix_range->prefix_len)) {
903
+ best_match = &entry;
904
+ }
905
+ }
906
+ if (best_match == nullptr) return nullptr;
907
+ return FindFilterChainDataForSourcePort(best_match->ports_map, port);
908
+ }
909
+
910
+ bool IsLoopbackIp(const grpc_resolved_address* address) {
911
+ const grpc_sockaddr* sock_addr =
912
+ reinterpret_cast<const grpc_sockaddr*>(&address->addr);
913
+ if (sock_addr->sa_family == GRPC_AF_INET) {
914
+ const grpc_sockaddr_in* addr4 =
915
+ reinterpret_cast<const grpc_sockaddr_in*>(sock_addr);
916
+ if (addr4->sin_addr.s_addr == grpc_htonl(INADDR_LOOPBACK)) {
917
+ return true;
918
+ }
919
+ } else if (sock_addr->sa_family == GRPC_AF_INET6) {
920
+ const grpc_sockaddr_in6* addr6 =
921
+ reinterpret_cast<const grpc_sockaddr_in6*>(sock_addr);
922
+ if (memcmp(&addr6->sin6_addr, &in6addr_loopback,
923
+ sizeof(in6addr_loopback)) == 0) {
924
+ return true;
925
+ }
926
+ }
927
+ return false;
928
+ }
929
+
930
+ const XdsListenerResource::FilterChainData* FindFilterChainDataForSourceType(
931
+ const XdsListenerResource::FilterChainMap::ConnectionSourceTypesArray&
932
+ source_types_array,
933
+ grpc_endpoint* tcp, absl::string_view destination_ip) {
934
+ auto source_uri = URI::Parse(grpc_endpoint_get_peer(tcp));
935
+ if (!source_uri.ok() ||
936
+ (source_uri->scheme() != "ipv4" && source_uri->scheme() != "ipv6")) {
937
+ return nullptr;
938
+ }
939
+ std::string host;
940
+ std::string port;
941
+ if (!SplitHostPort(source_uri->path(), &host, &port)) {
942
+ return nullptr;
943
+ }
944
+ auto source_addr = StringToSockaddr(host, 0); // Port doesn't matter here.
945
+ if (!source_addr.ok()) {
946
+ VLOG(2) << "Could not parse \"" << host
947
+ << "\" as socket address: " << source_addr.status();
948
+ return nullptr;
949
+ }
950
+ // Use kAny only if kSameIporLoopback and kExternal are empty
951
+ if (source_types_array[static_cast<int>(
952
+ XdsListenerResource::FilterChainMap::
953
+ ConnectionSourceType::kSameIpOrLoopback)]
954
+ .empty() &&
955
+ source_types_array[static_cast<int>(XdsListenerResource::FilterChainMap::
956
+ ConnectionSourceType::kExternal)]
957
+ .empty()) {
958
+ return FindFilterChainDataForSourceIp(
959
+ source_types_array[static_cast<int>(
960
+ XdsListenerResource::FilterChainMap::ConnectionSourceType::kAny)],
961
+ &*source_addr, port);
962
+ }
963
+ if (IsLoopbackIp(&*source_addr) || host == destination_ip) {
964
+ return FindFilterChainDataForSourceIp(
965
+ source_types_array[static_cast<int>(
966
+ XdsListenerResource::FilterChainMap::ConnectionSourceType::
967
+ kSameIpOrLoopback)],
968
+ &*source_addr, port);
969
+ } else {
970
+ return FindFilterChainDataForSourceIp(
971
+ source_types_array[static_cast<int>(
972
+ XdsListenerResource::FilterChainMap::ConnectionSourceType::
973
+ kExternal)],
974
+ &*source_addr, port);
975
+ }
976
+ }
977
+
978
+ const XdsListenerResource::FilterChainData* FindFilterChainDataForDestinationIp(
979
+ const XdsListenerResource::FilterChainMap::DestinationIpVector
980
+ destination_ip_vector,
981
+ grpc_endpoint* tcp) {
982
+ auto destination_uri = URI::Parse(grpc_endpoint_get_local_address(tcp));
983
+ if (!destination_uri.ok() || (destination_uri->scheme() != "ipv4" &&
984
+ destination_uri->scheme() != "ipv6")) {
985
+ return nullptr;
986
+ }
987
+ std::string host;
988
+ std::string port;
989
+ if (!SplitHostPort(destination_uri->path(), &host, &port)) {
990
+ return nullptr;
991
+ }
992
+ auto destination_addr =
993
+ StringToSockaddr(host, 0); // Port doesn't matter here.
994
+ if (!destination_addr.ok()) {
995
+ VLOG(2) << "Could not parse \"" << host
996
+ << "\" as socket address: " << destination_addr.status();
997
+ return nullptr;
998
+ }
999
+ const XdsListenerResource::FilterChainMap::DestinationIp* best_match =
1000
+ nullptr;
1001
+ for (const auto& entry : destination_ip_vector) {
1002
+ // Special case for catch-all
1003
+ if (!entry.prefix_range.has_value()) {
1004
+ if (best_match == nullptr) {
1005
+ best_match = &entry;
1006
+ }
1007
+ continue;
1008
+ }
1009
+ if (best_match != nullptr && best_match->prefix_range.has_value() &&
1010
+ best_match->prefix_range->prefix_len >=
1011
+ entry.prefix_range->prefix_len) {
1012
+ continue;
1013
+ }
1014
+ if (grpc_sockaddr_match_subnet(&*destination_addr,
1015
+ &entry.prefix_range->address,
1016
+ entry.prefix_range->prefix_len)) {
1017
+ best_match = &entry;
1018
+ }
1019
+ }
1020
+ if (best_match == nullptr) return nullptr;
1021
+ return FindFilterChainDataForSourceType(best_match->source_types_array, tcp,
1022
+ host);
1023
+ }
1024
+
1025
+ absl::StatusOr<ChannelArgs> XdsServerConfigFetcher::ListenerWatcher::
1026
+ FilterChainMatchManager::UpdateChannelArgsForConnection(
1027
+ const ChannelArgs& input_args, grpc_endpoint* tcp) {
1028
+ ChannelArgs args = input_args;
1029
+ const auto* filter_chain = FindFilterChainDataForDestinationIp(
1030
+ filter_chain_map_.destination_ip_vector, tcp);
1031
+ if (filter_chain == nullptr && default_filter_chain_.has_value()) {
1032
+ filter_chain = &default_filter_chain_.value();
1033
+ }
1034
+ if (filter_chain == nullptr) {
1035
+ return absl::UnavailableError("No matching filter chain found");
1036
+ }
1037
+ RefCountedPtr<ServerConfigSelectorProvider> server_config_selector_provider;
1038
+ RefCountedPtr<XdsChannelStackModifier> channel_stack_modifier;
1039
+ RefCountedPtr<XdsCertificateProvider> xds_certificate_provider;
1040
+ // Iterate the list of HTTP filters in reverse since in Core, received data
1041
+ // flows *up* the stack.
1042
+ std::vector<const grpc_channel_filter*> filters;
1043
+ const auto& http_filter_registry =
1044
+ DownCast<const GrpcXdsBootstrap&>(xds_client_->bootstrap())
1045
+ .http_filter_registry();
1046
+ for (const auto& http_filter :
1047
+ filter_chain->http_connection_manager.http_filters) {
1048
+ // Find filter. This is guaranteed to succeed, because it's checked
1049
+ // at config validation time in the XdsApi code.
1050
+ const XdsHttpFilterImpl* filter_impl =
1051
+ http_filter_registry.GetFilterForTopLevelType(
1052
+ http_filter.config_proto_type);
1053
+ GRPC_CHECK_NE(filter_impl, nullptr);
1054
+ // Some filters like the router filter are no-op filters and do not have
1055
+ // an implementation.
1056
+ if (filter_impl->channel_filter() != nullptr) {
1057
+ filters.push_back(filter_impl->channel_filter());
1058
+ }
1059
+ }
1060
+ // Add config selector filter.
1061
+ filters.push_back(&kLegacyServerConfigSelectorFilter);
1062
+ channel_stack_modifier =
1063
+ MakeRefCounted<XdsChannelStackModifier>(std::move(filters));
1064
+ Match(
1065
+ filter_chain->http_connection_manager.route_config,
1066
+ // RDS resource name
1067
+ [&](const std::string& rds_name) {
1068
+ absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
1069
+ initial_resource;
1070
+ {
1071
+ MutexLock lock(&mu_);
1072
+ initial_resource = rds_map_[rds_name].rds_update.value();
1073
+ }
1074
+ server_config_selector_provider =
1075
+ MakeRefCounted<DynamicXdsServerConfigSelectorProvider>(
1076
+ xds_client_.Ref(DEBUG_LOCATION,
1077
+ "DynamicXdsServerConfigSelectorProvider"),
1078
+ rds_name, std::move(initial_resource),
1079
+ filter_chain->http_connection_manager.http_filters);
1080
+ },
1081
+ // inline RouteConfig
1082
+ [&](const std::shared_ptr<const XdsRouteConfigResource>& route_config) {
1083
+ server_config_selector_provider =
1084
+ MakeRefCounted<StaticXdsServerConfigSelectorProvider>(
1085
+ xds_client_.Ref(DEBUG_LOCATION,
1086
+ "StaticXdsServerConfigSelectorProvider"),
1087
+ route_config,
1088
+ filter_chain->http_connection_manager.http_filters);
1089
+ });
1090
+ args = args.SetObject(server_config_selector_provider)
1091
+ .SetObject(channel_stack_modifier);
1092
+ // Add XdsCertificateProvider if credentials are xDS.
1093
+ auto* server_creds = args.GetObject<grpc_server_credentials>();
1094
+ if (server_creds != nullptr &&
1095
+ server_creds->type() == XdsServerCredentials::Type()) {
1096
+ absl::StatusOr<RefCountedPtr<XdsCertificateProvider>> result =
1097
+ CreateOrGetXdsCertificateProviderFromFilterChainData(filter_chain);
1098
+ if (!result.ok()) {
1099
+ return result.status();
1100
+ }
1101
+ xds_certificate_provider = std::move(*result);
1102
+ GRPC_CHECK(xds_certificate_provider != nullptr);
1103
+ args = args.SetObject(xds_certificate_provider);
1104
+ }
1105
+ return args;
1106
+ }
1107
+
1108
+ //
1109
+ // XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::XdsServerConfigSelector
1110
+ //
1111
+
1112
+ absl::StatusOr<
1113
+ RefCountedPtr<XdsServerConfigFetcher::ListenerWatcher::
1114
+ FilterChainMatchManager::XdsServerConfigSelector>>
1115
+ XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1116
+ XdsServerConfigSelector::Create(
1117
+ const XdsHttpFilterRegistry& http_filter_registry,
1118
+ std::shared_ptr<const XdsRouteConfigResource> rds_update,
1119
+ const std::vector<
1120
+ XdsListenerResource::HttpConnectionManager::HttpFilter>&
1121
+ http_filters) {
1122
+ auto config_selector = MakeRefCounted<XdsServerConfigSelector>();
1123
+ for (auto& vhost : rds_update->virtual_hosts) {
1124
+ config_selector->virtual_hosts_.emplace_back();
1125
+ auto& virtual_host = config_selector->virtual_hosts_.back();
1126
+ virtual_host.domains = vhost.domains;
1127
+ for (auto& route : vhost.routes) {
1128
+ virtual_host.routes.emplace_back();
1129
+ auto& config_selector_route = virtual_host.routes.back();
1130
+ config_selector_route.matchers = route.matchers;
1131
+ config_selector_route.unsupported_action =
1132
+ std::get_if<XdsRouteConfigResource::Route::NonForwardingAction>(
1133
+ &route.action) == nullptr;
1134
+ auto result = XdsRouting::GeneratePerHTTPFilterConfigsForMethodConfig(
1135
+ http_filter_registry, http_filters, vhost, route, nullptr,
1136
+ ChannelArgs());
1137
+ if (!result.ok()) return result.status();
1138
+ std::vector<std::string> fields;
1139
+ fields.reserve(result->per_filter_configs.size());
1140
+ for (const auto& p : result->per_filter_configs) {
1141
+ fields.emplace_back(absl::StrCat(" \"", p.first, "\": [\n",
1142
+ absl::StrJoin(p.second, ",\n"),
1143
+ "\n ]"));
1144
+ }
1145
+ if (!fields.empty()) {
1146
+ std::string json = absl::StrCat(
1147
+ "{\n"
1148
+ " \"methodConfig\": [ {\n"
1149
+ " \"name\": [\n"
1150
+ " {}\n"
1151
+ " ],\n"
1152
+ " ",
1153
+ absl::StrJoin(fields, ",\n"),
1154
+ "\n } ]\n"
1155
+ "}");
1156
+ config_selector_route.method_config =
1157
+ ServiceConfigImpl::Create(result->args, json.c_str()).value();
1158
+ }
1159
+ }
1160
+ }
1161
+ return config_selector;
1162
+ }
1163
+
1164
+ absl::StatusOr<ServerConfigSelector::CallConfig>
1165
+ XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1166
+ XdsServerConfigSelector::GetCallConfig(grpc_metadata_batch* metadata) {
1167
+ CallConfig call_config;
1168
+ if (metadata->get_pointer(HttpPathMetadata()) == nullptr) {
1169
+ return absl::InternalError("no path found");
1170
+ }
1171
+ absl::string_view path =
1172
+ metadata->get_pointer(HttpPathMetadata())->as_string_view();
1173
+ if (metadata->get_pointer(HttpAuthorityMetadata()) == nullptr) {
1174
+ return absl::InternalError("no authority found");
1175
+ }
1176
+ absl::string_view authority =
1177
+ metadata->get_pointer(HttpAuthorityMetadata())->as_string_view();
1178
+ auto vhost_index = XdsRouting::FindVirtualHostForDomain(
1179
+ VirtualHostListIterator(&virtual_hosts_), authority);
1180
+ if (!vhost_index.has_value()) {
1181
+ return absl::UnavailableError(
1182
+ absl::StrCat("could not find VirtualHost for ", authority,
1183
+ " in RouteConfiguration"));
1184
+ }
1185
+ auto& virtual_host = virtual_hosts_[vhost_index.value()];
1186
+ auto route_index = XdsRouting::GetRouteForRequest(
1187
+ VirtualHost::RouteListIterator(&virtual_host.routes), path, metadata);
1188
+ if (route_index.has_value()) {
1189
+ auto& route = virtual_host.routes[route_index.value()];
1190
+ // Found the matching route
1191
+ if (route.unsupported_action) {
1192
+ return absl::UnavailableError("matching route has unsupported action");
1193
+ }
1194
+ if (route.method_config != nullptr) {
1195
+ call_config.method_configs =
1196
+ route.method_config->GetMethodParsedConfigVector(grpc_empty_slice());
1197
+ call_config.service_config = route.method_config;
1198
+ }
1199
+ return call_config;
1200
+ }
1201
+ return absl::UnavailableError("no route matched");
1202
+ }
1203
+
1204
+ //
1205
+ // XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::DynamicXdsServerConfigSelectorProvider
1206
+ //
1207
+
1208
+ XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1209
+ DynamicXdsServerConfigSelectorProvider::
1210
+ DynamicXdsServerConfigSelectorProvider(
1211
+ RefCountedPtr<GrpcXdsClient> xds_client, std::string resource_name,
1212
+ absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
1213
+ initial_resource,
1214
+ std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
1215
+ http_filters)
1216
+ : xds_client_(std::move(xds_client)),
1217
+ resource_name_(std::move(resource_name)),
1218
+ http_filters_(std::move(http_filters)),
1219
+ resource_(std::move(initial_resource)) {
1220
+ GRPC_CHECK(!resource_name_.empty());
1221
+ // RouteConfigWatcher is being created here instead of in Watch() to avoid
1222
+ // deadlocks from invoking XdsRouteConfigResourceType::StartWatch whilst in a
1223
+ // critical region.
1224
+ auto route_config_watcher = MakeRefCounted<RouteConfigWatcher>(
1225
+ WeakRefAsSubclass<DynamicXdsServerConfigSelectorProvider>());
1226
+ route_config_watcher_ = route_config_watcher.get();
1227
+ XdsRouteConfigResourceType::StartWatch(xds_client_.get(), resource_name_,
1228
+ std::move(route_config_watcher));
1229
+ }
1230
+
1231
+ void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1232
+ DynamicXdsServerConfigSelectorProvider::Orphaned() {
1233
+ XdsRouteConfigResourceType::CancelWatch(xds_client_.get(), resource_name_,
1234
+ route_config_watcher_,
1235
+ false /* delay_unsubscription */);
1236
+ }
1237
+
1238
+ absl::StatusOr<RefCountedPtr<ServerConfigSelector>>
1239
+ XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1240
+ DynamicXdsServerConfigSelectorProvider::Watch(
1241
+ std::unique_ptr<
1242
+ ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
1243
+ watcher) {
1244
+ absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>> resource;
1245
+ {
1246
+ MutexLock lock(&mu_);
1247
+ GRPC_CHECK(watcher_ == nullptr);
1248
+ watcher_ = std::move(watcher);
1249
+ resource = resource_;
1250
+ }
1251
+ if (!resource.ok()) {
1252
+ return resource.status();
1253
+ }
1254
+ return XdsServerConfigSelector::Create(
1255
+ DownCast<const GrpcXdsBootstrap&>(xds_client_->bootstrap())
1256
+ .http_filter_registry(),
1257
+ resource.value(), http_filters_);
1258
+ }
1259
+
1260
+ void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1261
+ DynamicXdsServerConfigSelectorProvider::CancelWatch() {
1262
+ MutexLock lock(&mu_);
1263
+ watcher_.reset();
1264
+ }
1265
+
1266
+ void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1267
+ DynamicXdsServerConfigSelectorProvider::OnRouteConfigChanged(
1268
+ absl::StatusOr<std::shared_ptr<const XdsRouteConfigResource>>
1269
+ rds_update) {
1270
+ MutexLock lock(&mu_);
1271
+ if (!rds_update.ok()) {
1272
+ rds_update = absl::UnavailableError(absl::StrCat(
1273
+ "RDS resource ", resource_name_, ": ", rds_update.status().message()));
1274
+ }
1275
+ resource_ = std::move(rds_update);
1276
+ if (watcher_ == nullptr) {
1277
+ return;
1278
+ }
1279
+ // Currently server_config_selector_filter does not call into
1280
+ // DynamicXdsServerConfigSelectorProvider while holding a lock, but if that
1281
+ // ever changes, we would want to invoke the update outside the critical
1282
+ // region with the use of a WorkSerializer.
1283
+ if (!resource_.ok()) {
1284
+ watcher_->OnServerConfigSelectorUpdate(resource_.status());
1285
+ } else {
1286
+ watcher_->OnServerConfigSelectorUpdate(XdsServerConfigSelector::Create(
1287
+ DownCast<const GrpcXdsBootstrap&>(xds_client_->bootstrap())
1288
+ .http_filter_registry(),
1289
+ *resource_, http_filters_));
1290
+ }
1291
+ }
1292
+
1293
+ void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1294
+ DynamicXdsServerConfigSelectorProvider::OnAmbientError(
1295
+ absl::Status status) {
1296
+ LOG(ERROR) << "RouteConfigWatcher:" << this
1297
+ << " XdsClient reports ambient error: " << status << " for "
1298
+ << resource_name_ << "; ignoring in favor of existing resource";
1299
+ }
1300
+
1301
+ } // namespace
1302
+ } // namespace grpc_core
1303
+
1304
+ grpc_server_config_fetcher* grpc_server_config_fetcher_xds_create_legacy(
1305
+ grpc_server_xds_status_notifier notifier, const grpc_channel_args* args) {
1306
+ grpc_core::ExecCtx exec_ctx;
1307
+ grpc_core::ChannelArgs channel_args = grpc_core::CoreConfiguration::Get()
1308
+ .channel_args_preconditioning()
1309
+ .PreconditionChannelArgs(args);
1310
+ GRPC_TRACE_LOG(api, INFO)
1311
+ << "grpc_server_config_fetcher_xds_create(notifier={on_serving_status_"
1312
+ "update="
1313
+ << notifier.on_serving_status_update
1314
+ << ", user_data=" << notifier.user_data << "}, args=" << args << ")";
1315
+ auto xds_client = grpc_core::GrpcXdsClient::GetOrCreate(
1316
+ grpc_core::GrpcXdsClient::kServerKey, channel_args,
1317
+ "XdsServerConfigFetcher");
1318
+ if (!xds_client.ok()) {
1319
+ LOG(ERROR) << "Failed to create xds client: " << xds_client.status();
1320
+ return nullptr;
1321
+ }
1322
+ if (grpc_core::DownCast<const grpc_core::GrpcXdsBootstrap&>(
1323
+ (*xds_client)->bootstrap())
1324
+ .server_listener_resource_name_template()
1325
+ .empty()) {
1326
+ LOG(ERROR) << "server_listener_resource_name_template not provided in "
1327
+ "bootstrap file.";
1328
+ return nullptr;
1329
+ }
1330
+ return (new grpc_core::XdsServerConfigFetcher(std::move(*xds_client),
1331
+ notifier))
1332
+ ->c_ptr();
1333
+ }