grpc 1.49.0.pre1 → 1.50.0.pre1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (271) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +54 -153
  3. data/include/grpc/event_engine/endpoint_config.h +11 -5
  4. data/include/grpc/event_engine/event_engine.h +1 -1
  5. data/include/grpc/impl/codegen/atm_gcc_atomic.h +19 -28
  6. data/include/grpc/impl/codegen/atm_gcc_sync.h +0 -2
  7. data/include/grpc/impl/codegen/atm_windows.h +0 -2
  8. data/include/grpc/impl/codegen/grpc_types.h +6 -0
  9. data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +3 -3
  10. data/src/core/ext/filters/client_channel/backup_poller.cc +4 -6
  11. data/src/core/ext/filters/client_channel/client_channel.cc +41 -22
  12. data/src/core/ext/filters/client_channel/client_channel.h +1 -1
  13. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +0 -16
  14. data/src/core/ext/filters/client_channel/http_proxy.cc +12 -19
  15. data/src/core/ext/filters/client_channel/http_proxy.h +3 -2
  16. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +6 -4
  17. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +5 -4
  18. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +0 -2
  19. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +114 -103
  20. data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +20 -11
  21. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +106 -108
  22. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +16 -0
  23. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +20 -13
  24. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +165 -257
  25. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +218 -231
  26. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +10 -6
  27. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +389 -444
  28. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +16 -16
  29. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +8 -13
  30. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +87 -96
  31. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +38 -37
  32. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +106 -186
  33. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +106 -93
  34. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +170 -218
  35. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +2 -2
  36. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +1 -1
  37. data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +38 -18
  38. data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +84 -37
  39. data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +11 -0
  40. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +1 -0
  41. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +5 -3
  42. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +5 -4
  43. data/src/core/ext/filters/client_channel/retry_filter.cc +25 -29
  44. data/src/core/ext/filters/client_channel/subchannel.cc +38 -33
  45. data/src/core/ext/filters/client_channel/subchannel.h +12 -3
  46. data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +1 -2
  47. data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +23 -16
  48. data/src/core/ext/filters/fault_injection/fault_injection_filter.h +8 -0
  49. data/src/core/ext/filters/http/client/http_client_filter.cc +1 -2
  50. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +2 -4
  51. data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +0 -2
  52. data/src/core/ext/filters/http/server/http_server_filter.cc +1 -2
  53. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +12 -8
  54. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +32 -26
  55. data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +1 -1
  56. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +25 -130
  57. data/src/core/ext/transport/chttp2/transport/decode_huff.cc +287 -0
  58. data/src/core/ext/transport/chttp2/transport/decode_huff.h +1018 -0
  59. data/src/core/ext/transport/chttp2/transport/flow_control.cc +83 -51
  60. data/src/core/ext/transport/chttp2/transport/flow_control.h +11 -6
  61. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -2
  62. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +2 -20
  63. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +28 -28
  64. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +1 -10
  65. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +11 -6
  66. data/src/core/ext/transport/chttp2/transport/internal.h +2 -0
  67. data/src/core/ext/transport/chttp2/transport/parsing.cc +44 -0
  68. data/src/core/ext/transport/chttp2/transport/writing.cc +3 -14
  69. data/src/core/ext/transport/inproc/inproc_transport.cc +1 -3
  70. data/src/core/ext/xds/certificate_provider_store.cc +63 -3
  71. data/src/core/ext/xds/certificate_provider_store.h +9 -1
  72. data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +5 -5
  73. data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +1 -1
  74. data/src/core/ext/xds/xds_api.cc +21 -17
  75. data/src/core/ext/xds/xds_api.h +7 -0
  76. data/src/core/ext/xds/xds_bootstrap.cc +5 -537
  77. data/src/core/ext/xds/xds_bootstrap.h +39 -111
  78. data/src/core/ext/xds/xds_bootstrap_grpc.cc +370 -0
  79. data/src/core/ext/xds/xds_bootstrap_grpc.h +169 -0
  80. data/src/core/ext/xds/xds_client.cc +219 -145
  81. data/src/core/ext/xds/xds_client.h +19 -17
  82. data/src/core/ext/xds/xds_client_grpc.cc +18 -80
  83. data/src/core/ext/xds/xds_client_grpc.h +2 -25
  84. data/src/core/ext/xds/xds_client_stats.cc +4 -4
  85. data/src/core/ext/xds/xds_cluster.cc +87 -79
  86. data/src/core/ext/xds/xds_cluster.h +5 -5
  87. data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +3 -1
  88. data/src/core/ext/xds/xds_common_types.cc +13 -5
  89. data/src/core/ext/xds/xds_endpoint.cc +8 -6
  90. data/src/core/ext/xds/xds_endpoint.h +3 -4
  91. data/src/core/ext/xds/xds_lb_policy_registry.cc +4 -2
  92. data/src/core/ext/xds/xds_listener.cc +25 -20
  93. data/src/core/ext/xds/xds_listener.h +3 -4
  94. data/src/core/ext/xds/xds_resource_type.h +11 -8
  95. data/src/core/ext/xds/xds_route_config.cc +15 -16
  96. data/src/core/ext/xds/xds_route_config.h +3 -3
  97. data/src/core/ext/xds/xds_server_config_fetcher.cc +7 -5
  98. data/src/core/ext/xds/xds_transport_grpc.cc +15 -7
  99. data/src/core/lib/backoff/backoff.cc +2 -4
  100. data/src/core/lib/channel/call_finalization.h +1 -3
  101. data/src/core/lib/channel/channel_args.h +114 -14
  102. data/src/core/lib/channel/channel_trace.cc +3 -4
  103. data/src/core/lib/channel/promise_based_filter.cc +18 -19
  104. data/src/core/lib/channel/status_util.cc +27 -0
  105. data/src/core/lib/channel/status_util.h +10 -0
  106. data/src/core/lib/config/core_configuration.cc +5 -1
  107. data/src/core/lib/config/core_configuration.h +33 -0
  108. data/src/core/lib/debug/stats.cc +26 -30
  109. data/src/core/lib/debug/stats.h +2 -12
  110. data/src/core/lib/debug/stats_data.cc +118 -614
  111. data/src/core/lib/debug/stats_data.h +67 -465
  112. data/src/core/lib/debug/trace.cc +0 -2
  113. data/src/core/lib/event_engine/channel_args_endpoint_config.cc +12 -20
  114. data/src/core/lib/event_engine/channel_args_endpoint_config.h +13 -7
  115. data/src/core/lib/event_engine/forkable.cc +19 -16
  116. data/src/core/lib/event_engine/poller.h +14 -12
  117. data/src/core/lib/event_engine/posix_engine/timer_manager.cc +53 -32
  118. data/src/core/lib/event_engine/posix_engine/timer_manager.h +23 -1
  119. data/src/core/lib/event_engine/thread_pool.cc +131 -94
  120. data/src/core/lib/event_engine/thread_pool.h +56 -23
  121. data/src/core/lib/event_engine/time_util.cc +30 -0
  122. data/src/core/lib/event_engine/time_util.h +32 -0
  123. data/src/core/lib/event_engine/utils.cc +0 -5
  124. data/src/core/lib/event_engine/utils.h +0 -4
  125. data/src/core/lib/event_engine/windows/iocp.cc +13 -7
  126. data/src/core/lib/event_engine/windows/iocp.h +2 -1
  127. data/src/core/lib/event_engine/windows/win_socket.cc +1 -1
  128. data/src/core/lib/experiments/config.cc +146 -0
  129. data/src/core/lib/experiments/config.h +43 -0
  130. data/src/core/lib/experiments/experiments.cc +75 -0
  131. data/src/core/lib/experiments/experiments.h +56 -0
  132. data/src/core/lib/gpr/alloc.cc +1 -9
  133. data/src/core/lib/gpr/log_windows.cc +0 -1
  134. data/src/core/lib/gpr/string_util_windows.cc +3 -30
  135. data/src/core/lib/gpr/sync_abseil.cc +0 -14
  136. data/src/core/lib/gpr/sync_posix.cc +0 -14
  137. data/src/core/lib/gpr/time_posix.cc +0 -6
  138. data/src/core/lib/gpr/time_precise.h +1 -1
  139. data/src/core/lib/gpr/tmpfile_windows.cc +5 -7
  140. data/src/core/lib/gpr/useful.h +11 -0
  141. data/src/core/lib/{gpr → gprpp}/env.h +25 -12
  142. data/src/core/lib/{gpr → gprpp}/env_linux.cc +20 -15
  143. data/src/core/lib/{gpr → gprpp}/env_posix.cc +11 -10
  144. data/src/core/lib/gprpp/env_windows.cc +56 -0
  145. data/src/core/lib/gprpp/fork.cc +14 -22
  146. data/src/core/lib/gprpp/fork.h +0 -8
  147. data/src/core/lib/gprpp/global_config_env.cc +7 -6
  148. data/src/core/lib/gprpp/notification.h +67 -0
  149. data/src/core/lib/gprpp/packed_table.h +40 -0
  150. data/src/core/lib/gprpp/ref_counted_ptr.h +20 -33
  151. data/src/core/lib/gprpp/sorted_pack.h +98 -0
  152. data/src/core/lib/gprpp/status_helper.h +6 -0
  153. data/src/core/lib/gprpp/table.h +9 -1
  154. data/src/core/lib/gprpp/tchar.cc +49 -0
  155. data/src/core/lib/gprpp/tchar.h +33 -0
  156. data/src/core/lib/gprpp/time.cc +21 -0
  157. data/src/core/lib/gprpp/time.h +55 -0
  158. data/src/core/lib/gprpp/validation_errors.cc +61 -0
  159. data/src/core/lib/gprpp/validation_errors.h +110 -0
  160. data/src/core/{ext/filters/client_channel → lib/handshaker}/proxy_mapper.h +3 -3
  161. data/src/core/{ext/filters/client_channel → lib/handshaker}/proxy_mapper_registry.cc +14 -36
  162. data/src/core/lib/handshaker/proxy_mapper_registry.h +75 -0
  163. data/src/core/lib/iomgr/call_combiner.cc +0 -8
  164. data/src/core/lib/iomgr/closure.h +0 -1
  165. data/src/core/lib/iomgr/endpoint_pair_posix.cc +14 -10
  166. data/src/core/lib/iomgr/endpoint_pair_windows.cc +2 -2
  167. data/src/core/lib/iomgr/ev_epoll1_linux.cc +1 -38
  168. data/src/core/lib/iomgr/ev_poll_posix.cc +2 -17
  169. data/src/core/lib/iomgr/exec_ctx.cc +0 -10
  170. data/src/core/lib/iomgr/exec_ctx.h +7 -31
  171. data/src/core/lib/iomgr/iocp_windows.cc +1 -2
  172. data/src/core/lib/iomgr/iomgr.cc +6 -8
  173. data/src/core/lib/iomgr/iomgr_fwd.h +1 -0
  174. data/src/core/lib/iomgr/pollset.h +1 -1
  175. data/src/core/lib/iomgr/pollset_set.h +0 -1
  176. data/src/core/lib/iomgr/resolve_address.h +1 -0
  177. data/src/core/lib/iomgr/resolve_address_impl.h +1 -0
  178. data/src/core/lib/iomgr/resolve_address_posix.cc +5 -0
  179. data/src/core/lib/iomgr/resolve_address_windows.cc +5 -0
  180. data/src/core/lib/iomgr/sockaddr_utils_posix.cc +2 -1
  181. data/src/core/lib/iomgr/socket_utils_common_posix.cc +12 -34
  182. data/src/core/lib/iomgr/socket_utils_posix.cc +83 -1
  183. data/src/core/lib/iomgr/socket_utils_posix.h +98 -6
  184. data/src/core/lib/iomgr/tcp_client.cc +6 -7
  185. data/src/core/lib/iomgr/tcp_client.h +11 -11
  186. data/src/core/lib/iomgr/tcp_client_cfstream.cc +6 -6
  187. data/src/core/lib/iomgr/tcp_client_posix.cc +33 -29
  188. data/src/core/lib/iomgr/tcp_client_posix.h +12 -9
  189. data/src/core/lib/iomgr/tcp_client_windows.cc +6 -6
  190. data/src/core/lib/iomgr/tcp_posix.cc +131 -114
  191. data/src/core/lib/iomgr/tcp_posix.h +3 -1
  192. data/src/core/lib/iomgr/tcp_server.cc +5 -4
  193. data/src/core/lib/iomgr/tcp_server.h +9 -6
  194. data/src/core/lib/iomgr/tcp_server_posix.cc +17 -28
  195. data/src/core/lib/iomgr/tcp_server_utils_posix.h +2 -2
  196. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +3 -3
  197. data/src/core/lib/iomgr/tcp_server_windows.cc +6 -7
  198. data/src/core/lib/iomgr/tcp_windows.cc +0 -1
  199. data/src/core/lib/iomgr/tcp_windows.h +0 -1
  200. data/src/core/lib/iomgr/timer_generic.cc +4 -4
  201. data/src/core/lib/iomgr/timer_manager.cc +1 -2
  202. data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +0 -2
  203. data/src/core/lib/json/json_object_loader.cc +21 -52
  204. data/src/core/lib/json/json_object_loader.h +56 -76
  205. data/src/core/lib/json/json_util.cc +2 -1
  206. data/src/core/lib/load_balancing/lb_policy.h +5 -5
  207. data/src/core/lib/load_balancing/lb_policy_registry.cc +29 -55
  208. data/src/core/lib/load_balancing/lb_policy_registry.h +23 -11
  209. data/src/core/lib/promise/activity.h +2 -3
  210. data/src/core/lib/promise/context.h +1 -1
  211. data/src/core/lib/promise/sleep.cc +16 -4
  212. data/src/core/lib/promise/sleep.h +8 -2
  213. data/src/core/lib/resolver/resolver.h +13 -3
  214. data/src/core/lib/resource_quota/api.cc +9 -0
  215. data/src/core/lib/resource_quota/api.h +6 -0
  216. data/src/core/lib/resource_quota/arena.cc +1 -3
  217. data/src/core/lib/resource_quota/memory_quota.cc +8 -24
  218. data/src/core/lib/resource_quota/memory_quota.h +6 -19
  219. data/src/core/lib/resource_quota/periodic_update.cc +2 -3
  220. data/src/core/{ext/xds → lib/security/certificate_provider}/certificate_provider_factory.h +3 -3
  221. data/src/core/lib/security/certificate_provider/certificate_provider_registry.cc +60 -0
  222. data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +70 -0
  223. data/src/core/lib/security/credentials/channel_creds_registry_init.cc +1 -0
  224. data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +15 -16
  225. data/src/core/lib/security/credentials/external/external_account_credentials.cc +2 -1
  226. data/src/core/lib/security/credentials/google_default/credentials_generic.cc +5 -8
  227. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +6 -6
  228. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +3 -2
  229. data/src/core/lib/security/credentials/jwt/jwt_verifier.h +1 -1
  230. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +1 -2
  231. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +4 -3
  232. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +4 -2
  233. data/src/core/lib/security/credentials/tls/tls_utils.cc +3 -1
  234. data/src/core/lib/security/transport/client_auth_filter.cc +12 -1
  235. data/src/core/lib/security/transport/secure_endpoint.cc +0 -4
  236. data/src/core/lib/surface/call.cc +1 -11
  237. data/src/core/lib/surface/channel.cc +3 -2
  238. data/src/core/lib/surface/completion_queue.cc +16 -28
  239. data/src/core/lib/surface/completion_queue.h +1 -1
  240. data/src/core/lib/surface/completion_queue_factory.cc +5 -0
  241. data/src/core/lib/surface/init.cc +16 -11
  242. data/src/core/lib/surface/init_internally.cc +24 -0
  243. data/src/core/lib/surface/init_internally.h +28 -0
  244. data/src/core/lib/surface/server.cc +1 -7
  245. data/src/core/lib/surface/server.h +4 -6
  246. data/src/core/lib/surface/version.cc +2 -2
  247. data/src/core/lib/transport/bdp_estimator.cc +1 -3
  248. data/src/core/lib/transport/metadata_batch.cc +2 -3
  249. data/src/core/lib/transport/metadata_batch.h +9 -7
  250. data/src/core/lib/transport/parsed_metadata.h +4 -2
  251. data/src/core/lib/transport/status_conversion.cc +1 -3
  252. data/src/core/lib/transport/tcp_connect_handshaker.cc +9 -5
  253. data/src/core/lib/transport/transport.h +0 -1
  254. data/src/core/lib/transport/transport_impl.h +0 -1
  255. data/src/core/plugin_registry/grpc_plugin_registry.cc +23 -46
  256. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +13 -25
  257. data/src/ruby/ext/grpc/extconf.rb +1 -1
  258. data/src/ruby/lib/grpc/version.rb +1 -1
  259. data/src/ruby/spec/channel_spec.rb +5 -0
  260. data/src/ruby/spec/generic/server_interceptors_spec.rb +1 -1
  261. data/src/ruby/spec/user_agent_spec.rb +1 -1
  262. metadata +31 -17
  263. data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +0 -56
  264. data/src/core/ext/xds/certificate_provider_registry.cc +0 -103
  265. data/src/core/ext/xds/certificate_provider_registry.h +0 -59
  266. data/src/core/lib/event_engine/promise.h +0 -78
  267. data/src/core/lib/gpr/env_windows.cc +0 -74
  268. data/src/core/lib/gpr/string_windows.h +0 -32
  269. data/src/core/lib/profiling/basic_timers.cc +0 -295
  270. data/src/core/lib/profiling/stap_timers.cc +0 -50
  271. data/src/core/lib/profiling/timers.h +0 -94
@@ -27,53 +27,10 @@
27
27
 
28
28
  extern void grpc_register_extra_plugins(void);
29
29
 
30
- void grpc_chttp2_plugin_init(void);
31
- void grpc_chttp2_plugin_shutdown(void);
32
- void grpc_client_channel_init(void);
33
- void grpc_client_channel_shutdown(void);
34
- void grpc_lb_policy_grpclb_init(void);
35
- void grpc_lb_policy_grpclb_shutdown(void);
36
- void grpc_lb_policy_priority_init(void);
37
- void grpc_lb_policy_priority_shutdown(void);
38
- void grpc_lb_policy_outlier_detection_init(void);
39
- void grpc_lb_policy_outlier_detection_shutdown(void);
40
- void grpc_lb_policy_weighted_target_init(void);
41
- void grpc_lb_policy_weighted_target_shutdown(void);
42
- void grpc_lb_policy_pick_first_init(void);
43
- void grpc_lb_policy_pick_first_shutdown(void);
44
- void grpc_lb_policy_round_robin_init(void);
45
- void grpc_lb_policy_round_robin_shutdown(void);
46
30
  void grpc_resolver_dns_ares_init(void);
47
31
  void grpc_resolver_dns_ares_shutdown(void);
48
- namespace grpc_core {
49
- void GrpcLbPolicyRingHashInit(void);
50
- void GrpcLbPolicyRingHashShutdown(void);
51
- #ifndef GRPC_NO_RLS
52
- void RlsLbPluginInit();
53
- void RlsLbPluginShutdown();
54
- #endif // !GRPC_NO_RLS
55
- } // namespace grpc_core
56
32
 
57
33
  void grpc_register_built_in_plugins(void) {
58
- grpc_register_plugin(grpc_client_channel_init, grpc_client_channel_shutdown);
59
- grpc_register_plugin(grpc_lb_policy_grpclb_init,
60
- grpc_lb_policy_grpclb_shutdown);
61
- #ifndef GRPC_NO_RLS
62
- grpc_register_plugin(grpc_core::RlsLbPluginInit,
63
- grpc_core::RlsLbPluginShutdown);
64
- #endif // !GRPC_NO_RLS
65
- grpc_register_plugin(grpc_lb_policy_outlier_detection_init,
66
- grpc_lb_policy_outlier_detection_shutdown);
67
- grpc_register_plugin(grpc_lb_policy_priority_init,
68
- grpc_lb_policy_priority_shutdown);
69
- grpc_register_plugin(grpc_lb_policy_weighted_target_init,
70
- grpc_lb_policy_weighted_target_shutdown);
71
- grpc_register_plugin(grpc_lb_policy_pick_first_init,
72
- grpc_lb_policy_pick_first_shutdown);
73
- grpc_register_plugin(grpc_lb_policy_round_robin_init,
74
- grpc_lb_policy_round_robin_shutdown);
75
- grpc_register_plugin(grpc_core::GrpcLbPolicyRingHashInit,
76
- grpc_core::GrpcLbPolicyRingHashShutdown);
77
34
  grpc_register_plugin(grpc_resolver_dns_ares_init,
78
35
  grpc_resolver_dns_ares_shutdown);
79
36
  grpc_register_extra_plugins();
@@ -88,8 +45,7 @@ extern void SecurityRegisterHandshakerFactories(
88
45
  extern void RegisterClientAuthorityFilter(CoreConfiguration::Builder* builder);
89
46
  extern void RegisterChannelIdleFilters(CoreConfiguration::Builder* builder);
90
47
  extern void RegisterDeadlineFilter(CoreConfiguration::Builder* builder);
91
- extern void RegisterGrpcLbLoadReportingFilter(
92
- CoreConfiguration::Builder* builder);
48
+ extern void RegisterGrpcLbPolicy(CoreConfiguration::Builder* builder);
93
49
  extern void RegisterHttpFilters(CoreConfiguration::Builder* builder);
94
50
  extern void RegisterMessageSizeFilter(CoreConfiguration::Builder* builder);
95
51
  extern void RegisterSecurityFilters(CoreConfiguration::Builder* builder);
@@ -102,6 +58,17 @@ extern void RegisterNativeDnsResolver(CoreConfiguration::Builder* builder);
102
58
  extern void RegisterAresDnsResolver(CoreConfiguration::Builder* builder);
103
59
  extern void RegisterSockaddrResolver(CoreConfiguration::Builder* builder);
104
60
  extern void RegisterFakeResolver(CoreConfiguration::Builder* builder);
61
+ extern void RegisterPriorityLbPolicy(CoreConfiguration::Builder* builder);
62
+ extern void RegisterOutlierDetectionLbPolicy(
63
+ CoreConfiguration::Builder* builder);
64
+ extern void RegisterWeightedTargetLbPolicy(CoreConfiguration::Builder* builder);
65
+ extern void RegisterPickFirstLbPolicy(CoreConfiguration::Builder* builder);
66
+ extern void RegisterRoundRobinLbPolicy(CoreConfiguration::Builder* builder);
67
+ extern void RegisterRingHashLbPolicy(CoreConfiguration::Builder* builder);
68
+ extern void RegisterHttpProxyMapper(CoreConfiguration::Builder* builder);
69
+ #ifndef GRPC_NO_RLS
70
+ extern void RegisterRlsLbPolicy(CoreConfiguration::Builder* builder);
71
+ #endif // !GRPC_NO_RLS
105
72
  #ifdef GPR_SUPPORT_BINDER_TRANSPORT
106
73
  extern void RegisterBinderResolver(CoreConfiguration::Builder* builder);
107
74
  #endif
@@ -112,11 +79,17 @@ void BuildCoreConfiguration(CoreConfiguration::Builder* builder) {
112
79
  // the start of the handshaker list.
113
80
  RegisterHttpConnectHandshaker(builder);
114
81
  RegisterTCPConnectHandshaker(builder);
82
+ RegisterPriorityLbPolicy(builder);
83
+ RegisterOutlierDetectionLbPolicy(builder);
84
+ RegisterWeightedTargetLbPolicy(builder);
85
+ RegisterPickFirstLbPolicy(builder);
86
+ RegisterRoundRobinLbPolicy(builder);
87
+ RegisterRingHashLbPolicy(builder);
115
88
  BuildClientChannelConfiguration(builder);
116
89
  SecurityRegisterHandshakerFactories(builder);
117
90
  RegisterClientAuthorityFilter(builder);
118
91
  RegisterChannelIdleFilters(builder);
119
- RegisterGrpcLbLoadReportingFilter(builder);
92
+ RegisterGrpcLbPolicy(builder);
120
93
  RegisterHttpFilters(builder);
121
94
  RegisterDeadlineFilter(builder);
122
95
  RegisterMessageSizeFilter(builder);
@@ -127,9 +100,13 @@ void BuildCoreConfiguration(CoreConfiguration::Builder* builder) {
127
100
  RegisterNativeDnsResolver(builder);
128
101
  RegisterSockaddrResolver(builder);
129
102
  RegisterFakeResolver(builder);
103
+ RegisterHttpProxyMapper(builder);
130
104
  #ifdef GPR_SUPPORT_BINDER_TRANSPORT
131
105
  RegisterBinderResolver(builder);
132
106
  #endif
107
+ #ifndef GRPC_NO_RLS
108
+ RegisterRlsLbPolicy(builder);
109
+ #endif // !GRPC_NO_RLS
133
110
  // Run last so it gets a consistent location.
134
111
  // TODO(ctiller): Is this actually necessary?
135
112
  RegisterSecurityFilters(builder);
@@ -26,37 +26,12 @@ namespace grpc_core {
26
26
  void XdsClientGlobalInit();
27
27
  void XdsClientGlobalShutdown();
28
28
  } // namespace grpc_core
29
- void grpc_certificate_provider_registry_init(void);
30
- void grpc_certificate_provider_registry_shutdown(void);
31
- namespace grpc_core {
32
- void FileWatcherCertificateProviderInit();
33
- void FileWatcherCertificateProviderShutdown();
34
- } // namespace grpc_core
35
- void grpc_lb_policy_cds_init(void);
36
- void grpc_lb_policy_cds_shutdown(void);
37
- void grpc_lb_policy_xds_cluster_impl_init(void);
38
- void grpc_lb_policy_xds_cluster_impl_shutdown(void);
39
- void grpc_lb_policy_xds_cluster_resolver_init(void);
40
- void grpc_lb_policy_xds_cluster_resolver_shutdown(void);
41
- void grpc_lb_policy_xds_cluster_manager_init(void);
42
- void grpc_lb_policy_xds_cluster_manager_shutdown(void);
43
29
  #endif
44
30
 
45
31
  void grpc_register_extra_plugins() {
46
32
  #ifndef GRPC_NO_XDS
47
33
  grpc_register_plugin(grpc_core::XdsClientGlobalInit,
48
34
  grpc_core::XdsClientGlobalShutdown);
49
- grpc_register_plugin(grpc_certificate_provider_registry_init,
50
- grpc_certificate_provider_registry_shutdown);
51
- grpc_register_plugin(grpc_core::FileWatcherCertificateProviderInit,
52
- grpc_core::FileWatcherCertificateProviderShutdown);
53
- grpc_register_plugin(grpc_lb_policy_cds_init, grpc_lb_policy_cds_shutdown);
54
- grpc_register_plugin(grpc_lb_policy_xds_cluster_impl_init,
55
- grpc_lb_policy_xds_cluster_impl_shutdown);
56
- grpc_register_plugin(grpc_lb_policy_xds_cluster_resolver_init,
57
- grpc_lb_policy_xds_cluster_resolver_shutdown);
58
- grpc_register_plugin(grpc_lb_policy_xds_cluster_manager_init,
59
- grpc_lb_policy_xds_cluster_manager_shutdown);
60
35
  #endif
61
36
  }
62
37
 
@@ -68,6 +43,14 @@ extern void RegisterXdsChannelStackModifier(
68
43
  extern void RegisterChannelDefaultCreds(CoreConfiguration::Builder* builder);
69
44
  extern void RegisterXdsResolver(CoreConfiguration::Builder* builder);
70
45
  extern void RegisterCloud2ProdResolver(CoreConfiguration::Builder* builder);
46
+ extern void RegisterXdsClusterManagerLbPolicy(
47
+ CoreConfiguration::Builder* builder);
48
+ extern void RegisterXdsClusterImplLbPolicy(CoreConfiguration::Builder* builder);
49
+ extern void RegisterCdsLbPolicy(CoreConfiguration::Builder* builder);
50
+ extern void RegisterXdsClusterResolverLbPolicy(
51
+ CoreConfiguration::Builder* builder);
52
+ extern void RegisterFileWatcherCertificateProvider(
53
+ CoreConfiguration::Builder* builder);
71
54
  #endif
72
55
  void RegisterExtraFilters(CoreConfiguration::Builder* builder) {
73
56
  // Use builder to avoid unused-parameter warning.
@@ -80,6 +63,11 @@ void RegisterExtraFilters(CoreConfiguration::Builder* builder) {
80
63
  RegisterChannelDefaultCreds(builder);
81
64
  RegisterXdsResolver(builder);
82
65
  RegisterCloud2ProdResolver(builder);
66
+ RegisterXdsClusterManagerLbPolicy(builder);
67
+ RegisterXdsClusterImplLbPolicy(builder);
68
+ RegisterCdsLbPolicy(builder);
69
+ RegisterXdsClusterResolverLbPolicy(builder);
70
+ RegisterFileWatcherCertificateProvider(builder);
83
71
  #endif
84
72
  }
85
73
  } // namespace grpc_core
@@ -86,7 +86,6 @@ end
86
86
 
87
87
  env_append 'CPPFLAGS', '-DGPR_BACKWARDS_COMPATIBILITY_MODE'
88
88
  env_append 'CPPFLAGS', '-DGRPC_XDS_USER_AGENT_NAME_SUFFIX="\"RUBY\""'
89
- env_append 'CPPFLAGS', '-DGRPC_RUBY_WINDOWS_UCRT' if windows_ucrt
90
89
 
91
90
  require_relative '../../lib/grpc/version'
92
91
  env_append 'CPPFLAGS', '-DGRPC_XDS_USER_AGENT_VERSION_SUFFIX="\"' + GRPC::VERSION + '\""'
@@ -111,6 +110,7 @@ unless windows
111
110
  exit 1 unless $? == 0
112
111
  end
113
112
 
113
+ $CFLAGS << ' -DGRPC_RUBY_WINDOWS_UCRT' if windows_ucrt
114
114
  $CFLAGS << ' -I' + File.join(grpc_root, 'include')
115
115
 
116
116
  ext_export_file = File.join(grpc_root, 'src', 'ruby', 'ext', 'grpc', 'ext-export')
@@ -14,5 +14,5 @@
14
14
 
15
15
  # GRPC contains the General RPC module.
16
16
  module GRPC
17
- VERSION = '1.49.0.pre1'
17
+ VERSION = '1.50.0.pre1'
18
18
  end
@@ -154,14 +154,19 @@ describe GRPC::Core::Channel do
154
154
  end
155
155
 
156
156
  it 'raises an error if called on a closed channel' do
157
+ STDERR.puts "#{Time.now}: begin: raises an error if called on a closed channel"
157
158
  ch = GRPC::Core::Channel.new(fake_host, nil, :this_channel_is_insecure)
159
+ STDERR.puts "#{Time.now}: created channel"
158
160
  ch.close
161
+ STDERR.puts "#{Time.now}: closed channel"
159
162
 
160
163
  deadline = Time.now + 5
161
164
  blk = proc do
162
165
  ch.create_call(nil, nil, 'phony_method', nil, deadline)
166
+ STDERR.puts "#{Time.now}: created call"
163
167
  end
164
168
  expect(&blk).to raise_error(RuntimeError)
169
+ STDERR.puts "#{Time.now}: finished: raises an error if called on a closed channel"
165
170
  end
166
171
 
167
172
  it 'raises if grpc was initialized in another process' do
@@ -17,7 +17,7 @@ describe 'Server Interceptors' do
17
17
  let(:interceptor) { TestServerInterceptor.new }
18
18
  let(:request) { EchoMsg.new }
19
19
  let(:trailing_metadata) { {} }
20
- let(:service) { EchoService.new(trailing_metadata) }
20
+ let(:service) { EchoService.new(**trailing_metadata) }
21
21
  let(:interceptors) { [] }
22
22
 
23
23
  before(:each) do
@@ -49,7 +49,7 @@ describe 'user agent' do
49
49
  it 'client sends expected user agent' do
50
50
  stub = UserAgentEchoServiceStub.new("localhost:#{@port}",
51
51
  :this_channel_is_insecure,
52
- {})
52
+ channel_args: {})
53
53
  response = stub.an_rpc(EchoMsg.new)
54
54
  expected_user_agent_prefix = "grpc-ruby/#{GRPC::VERSION}"
55
55
  expect(response.msg.start_with?(expected_user_agent_prefix)).to be true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.49.0.pre1
4
+ version: 1.50.0.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - gRPC Authors
8
8
  autorequire:
9
9
  bindir: src/ruby/bin
10
10
  cert_chain: []
11
- date: 2022-08-18 00:00:00.000000000 Z
11
+ date: 2022-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -338,9 +338,6 @@ files:
338
338
  - src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
339
339
  - src/core/ext/filters/client_channel/local_subchannel_pool.cc
340
340
  - src/core/ext/filters/client_channel/local_subchannel_pool.h
341
- - src/core/ext/filters/client_channel/proxy_mapper.h
342
- - src/core/ext/filters/client_channel/proxy_mapper_registry.cc
343
- - src/core/ext/filters/client_channel/proxy_mapper_registry.h
344
341
  - src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc
345
342
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
346
343
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
@@ -418,6 +415,8 @@ files:
418
415
  - src/core/ext/transport/chttp2/transport/chttp2_transport.h
419
416
  - src/core/ext/transport/chttp2/transport/context_list.cc
420
417
  - src/core/ext/transport/chttp2/transport/context_list.h
418
+ - src/core/ext/transport/chttp2/transport/decode_huff.cc
419
+ - src/core/ext/transport/chttp2/transport/decode_huff.h
421
420
  - src/core/ext/transport/chttp2/transport/flow_control.cc
422
421
  - src/core/ext/transport/chttp2/transport/flow_control.h
423
422
  - src/core/ext/transport/chttp2/transport/frame.h
@@ -1025,9 +1024,6 @@ files:
1025
1024
  - src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h
1026
1025
  - src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c
1027
1026
  - src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h
1028
- - src/core/ext/xds/certificate_provider_factory.h
1029
- - src/core/ext/xds/certificate_provider_registry.cc
1030
- - src/core/ext/xds/certificate_provider_registry.h
1031
1027
  - src/core/ext/xds/certificate_provider_store.cc
1032
1028
  - src/core/ext/xds/certificate_provider_store.h
1033
1029
  - src/core/ext/xds/file_watcher_certificate_provider_factory.cc
@@ -1037,6 +1033,8 @@ files:
1037
1033
  - src/core/ext/xds/xds_api.h
1038
1034
  - src/core/ext/xds/xds_bootstrap.cc
1039
1035
  - src/core/ext/xds/xds_bootstrap.h
1036
+ - src/core/ext/xds/xds_bootstrap_grpc.cc
1037
+ - src/core/ext/xds/xds_bootstrap_grpc.h
1040
1038
  - src/core/ext/xds/xds_certificate_provider.cc
1041
1039
  - src/core/ext/xds/xds_certificate_provider.h
1042
1040
  - src/core/ext/xds/xds_channel_args.h
@@ -1145,13 +1143,14 @@ files:
1145
1143
  - src/core/lib/event_engine/posix_engine/timer_heap.h
1146
1144
  - src/core/lib/event_engine/posix_engine/timer_manager.cc
1147
1145
  - src/core/lib/event_engine/posix_engine/timer_manager.h
1148
- - src/core/lib/event_engine/promise.h
1149
1146
  - src/core/lib/event_engine/resolved_address.cc
1150
1147
  - src/core/lib/event_engine/slice.cc
1151
1148
  - src/core/lib/event_engine/slice_buffer.cc
1152
1149
  - src/core/lib/event_engine/socket_notifier.h
1153
1150
  - src/core/lib/event_engine/thread_pool.cc
1154
1151
  - src/core/lib/event_engine/thread_pool.h
1152
+ - src/core/lib/event_engine/time_util.cc
1153
+ - src/core/lib/event_engine/time_util.h
1155
1154
  - src/core/lib/event_engine/trace.cc
1156
1155
  - src/core/lib/event_engine/trace.h
1157
1156
  - src/core/lib/event_engine/utils.cc
@@ -1162,6 +1161,10 @@ files:
1162
1161
  - src/core/lib/event_engine/windows/win_socket.h
1163
1162
  - src/core/lib/event_engine/windows/windows_engine.cc
1164
1163
  - src/core/lib/event_engine/windows/windows_engine.h
1164
+ - src/core/lib/experiments/config.cc
1165
+ - src/core/lib/experiments/config.h
1166
+ - src/core/lib/experiments/experiments.cc
1167
+ - src/core/lib/experiments/experiments.h
1165
1168
  - src/core/lib/gpr/alloc.cc
1166
1169
  - src/core/lib/gpr/alloc.h
1167
1170
  - src/core/lib/gpr/atm.cc
@@ -1169,10 +1172,6 @@ files:
1169
1172
  - src/core/lib/gpr/cpu_linux.cc
1170
1173
  - src/core/lib/gpr/cpu_posix.cc
1171
1174
  - src/core/lib/gpr/cpu_windows.cc
1172
- - src/core/lib/gpr/env.h
1173
- - src/core/lib/gpr/env_linux.cc
1174
- - src/core/lib/gpr/env_posix.cc
1175
- - src/core/lib/gpr/env_windows.cc
1176
1175
  - src/core/lib/gpr/log.cc
1177
1176
  - src/core/lib/gpr/log_android.cc
1178
1177
  - src/core/lib/gpr/log_linux.cc
@@ -1186,7 +1185,6 @@ files:
1186
1185
  - src/core/lib/gpr/string_posix.cc
1187
1186
  - src/core/lib/gpr/string_util_windows.cc
1188
1187
  - src/core/lib/gpr/string_windows.cc
1189
- - src/core/lib/gpr/string_windows.h
1190
1188
  - src/core/lib/gpr/sync.cc
1191
1189
  - src/core/lib/gpr/sync_abseil.cc
1192
1190
  - src/core/lib/gpr/sync_posix.cc
@@ -1210,6 +1208,10 @@ files:
1210
1208
  - src/core/lib/gprpp/cpp_impl_of.h
1211
1209
  - src/core/lib/gprpp/debug_location.h
1212
1210
  - src/core/lib/gprpp/dual_ref_counted.h
1211
+ - src/core/lib/gprpp/env.h
1212
+ - src/core/lib/gprpp/env_linux.cc
1213
+ - src/core/lib/gprpp/env_posix.cc
1214
+ - src/core/lib/gprpp/env_windows.cc
1213
1215
  - src/core/lib/gprpp/examine_stack.cc
1214
1216
  - src/core/lib/gprpp/examine_stack.h
1215
1217
  - src/core/lib/gprpp/fork.cc
@@ -1227,11 +1229,14 @@ files:
1227
1229
  - src/core/lib/gprpp/mpscq.cc
1228
1230
  - src/core/lib/gprpp/mpscq.h
1229
1231
  - src/core/lib/gprpp/no_destruct.h
1232
+ - src/core/lib/gprpp/notification.h
1230
1233
  - src/core/lib/gprpp/orphanable.h
1231
1234
  - src/core/lib/gprpp/overload.h
1235
+ - src/core/lib/gprpp/packed_table.h
1232
1236
  - src/core/lib/gprpp/ref_counted.h
1233
1237
  - src/core/lib/gprpp/ref_counted_ptr.h
1234
1238
  - src/core/lib/gprpp/single_set_ptr.h
1239
+ - src/core/lib/gprpp/sorted_pack.h
1235
1240
  - src/core/lib/gprpp/stat.h
1236
1241
  - src/core/lib/gprpp/stat_posix.cc
1237
1242
  - src/core/lib/gprpp/stat_windows.cc
@@ -1239,6 +1244,8 @@ files:
1239
1244
  - src/core/lib/gprpp/status_helper.h
1240
1245
  - src/core/lib/gprpp/sync.h
1241
1246
  - src/core/lib/gprpp/table.h
1247
+ - src/core/lib/gprpp/tchar.cc
1248
+ - src/core/lib/gprpp/tchar.h
1242
1249
  - src/core/lib/gprpp/thd.h
1243
1250
  - src/core/lib/gprpp/thd_posix.cc
1244
1251
  - src/core/lib/gprpp/thd_windows.cc
@@ -1249,8 +1256,13 @@ files:
1249
1256
  - src/core/lib/gprpp/time_util.cc
1250
1257
  - src/core/lib/gprpp/time_util.h
1251
1258
  - src/core/lib/gprpp/unique_type_name.h
1259
+ - src/core/lib/gprpp/validation_errors.cc
1260
+ - src/core/lib/gprpp/validation_errors.h
1252
1261
  - src/core/lib/gprpp/work_serializer.cc
1253
1262
  - src/core/lib/gprpp/work_serializer.h
1263
+ - src/core/lib/handshaker/proxy_mapper.h
1264
+ - src/core/lib/handshaker/proxy_mapper_registry.cc
1265
+ - src/core/lib/handshaker/proxy_mapper_registry.h
1254
1266
  - src/core/lib/http/format_request.cc
1255
1267
  - src/core/lib/http/format_request.h
1256
1268
  - src/core/lib/http/httpcli.cc
@@ -1408,9 +1420,6 @@ files:
1408
1420
  - src/core/lib/load_balancing/subchannel_interface.h
1409
1421
  - src/core/lib/matchers/matchers.cc
1410
1422
  - src/core/lib/matchers/matchers.h
1411
- - src/core/lib/profiling/basic_timers.cc
1412
- - src/core/lib/profiling/stap_timers.cc
1413
- - src/core/lib/profiling/timers.h
1414
1423
  - src/core/lib/promise/activity.cc
1415
1424
  - src/core/lib/promise/activity.h
1416
1425
  - src/core/lib/promise/arena_promise.h
@@ -1466,6 +1475,9 @@ files:
1466
1475
  - src/core/lib/security/authorization/matchers.h
1467
1476
  - src/core/lib/security/authorization/rbac_policy.cc
1468
1477
  - src/core/lib/security/authorization/rbac_policy.h
1478
+ - src/core/lib/security/certificate_provider/certificate_provider_factory.h
1479
+ - src/core/lib/security/certificate_provider/certificate_provider_registry.cc
1480
+ - src/core/lib/security/certificate_provider/certificate_provider_registry.h
1469
1481
  - src/core/lib/security/context/security_context.cc
1470
1482
  - src/core/lib/security/context/security_context.h
1471
1483
  - src/core/lib/security/credentials/alts/alts_credentials.cc
@@ -1615,6 +1627,8 @@ files:
1615
1627
  - src/core/lib/surface/event_string.h
1616
1628
  - src/core/lib/surface/init.cc
1617
1629
  - src/core/lib/surface/init.h
1630
+ - src/core/lib/surface/init_internally.cc
1631
+ - src/core/lib/surface/init_internally.h
1618
1632
  - src/core/lib/surface/lame_client.cc
1619
1633
  - src/core/lib/surface/lame_client.h
1620
1634
  - src/core/lib/surface/metadata_array.cc
@@ -1,56 +0,0 @@
1
- /*
2
- *
3
- * Copyright 2017 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
- #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H
20
- #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H
21
-
22
- #include <grpc/support/port_platform.h>
23
-
24
- #include <memory>
25
- #include <string>
26
-
27
- #include "absl/strings/string_view.h"
28
- #include "absl/types/optional.h"
29
-
30
- #include "src/core/ext/filters/client_channel/proxy_mapper.h"
31
- #include "src/core/lib/channel/channel_args.h"
32
- #include "src/core/lib/iomgr/resolved_address.h"
33
-
34
- namespace grpc_core {
35
-
36
- class ProxyMapperRegistry {
37
- public:
38
- static void Init();
39
- static void Shutdown();
40
-
41
- /// Registers a new proxy mapper.
42
- /// If \a at_start is true, the new mapper will be at the beginning of
43
- /// the list. Otherwise, it will be added to the end.
44
- static void Register(bool at_start,
45
- std::unique_ptr<ProxyMapperInterface> mapper);
46
-
47
- static absl::optional<std::string> MapName(absl::string_view server_uri,
48
- ChannelArgs* args);
49
-
50
- static absl::optional<grpc_resolved_address> MapAddress(
51
- const grpc_resolved_address& address, ChannelArgs* args);
52
- };
53
-
54
- } // namespace grpc_core
55
-
56
- #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H */
@@ -1,103 +0,0 @@
1
- //
2
- //
3
- // Copyright 2020 gRPC authors.
4
- //
5
- // Licensed under the Apache License, Version 2.0 (the "License");
6
- // you may not use this file except in compliance with the License.
7
- // You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing, software
12
- // distributed under the License is distributed on an "AS IS" BASIS,
13
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- // See the License for the specific language governing permissions and
15
- // limitations under the License.
16
- //
17
- //
18
-
19
- #include <grpc/support/port_platform.h>
20
-
21
- #include "src/core/ext/xds/certificate_provider_registry.h"
22
-
23
- #include <string.h>
24
-
25
- #include <algorithm>
26
- #include <utility>
27
- #include <vector>
28
-
29
- #include <grpc/support/log.h>
30
-
31
- namespace grpc_core {
32
-
33
- namespace {
34
-
35
- class RegistryState {
36
- public:
37
- void RegisterCertificateProviderFactory(
38
- std::unique_ptr<CertificateProviderFactory> factory) {
39
- gpr_log(GPR_DEBUG, "registering certificate provider factory for \"%s\"",
40
- factory->name());
41
- for (size_t i = 0; i < factories_.size(); ++i) {
42
- GPR_ASSERT(strcmp(factories_[i]->name(), factory->name()) != 0);
43
- }
44
- factories_.push_back(std::move(factory));
45
- }
46
-
47
- CertificateProviderFactory* LookupCertificateProviderFactory(
48
- absl::string_view name) const {
49
- for (size_t i = 0; i < factories_.size(); ++i) {
50
- if (name == factories_[i]->name()) {
51
- return factories_[i].get();
52
- }
53
- }
54
- return nullptr;
55
- }
56
-
57
- private:
58
- std::vector<std::unique_ptr<CertificateProviderFactory>> factories_;
59
- };
60
-
61
- RegistryState* g_state = nullptr;
62
-
63
- } // namespace
64
-
65
- //
66
- // CertificateProviderRegistry
67
- //
68
-
69
- CertificateProviderFactory*
70
- CertificateProviderRegistry::LookupCertificateProviderFactory(
71
- absl::string_view name) {
72
- GPR_ASSERT(g_state != nullptr);
73
- return g_state->LookupCertificateProviderFactory(name);
74
- }
75
-
76
- void CertificateProviderRegistry::InitRegistry() {
77
- if (g_state == nullptr) g_state = new RegistryState();
78
- }
79
-
80
- void CertificateProviderRegistry::ShutdownRegistry() {
81
- delete g_state;
82
- g_state = nullptr;
83
- }
84
-
85
- void CertificateProviderRegistry::RegisterCertificateProviderFactory(
86
- std::unique_ptr<CertificateProviderFactory> factory) {
87
- InitRegistry();
88
- g_state->RegisterCertificateProviderFactory(std::move(factory));
89
- }
90
-
91
- } // namespace grpc_core
92
-
93
- //
94
- // Plugin registration
95
- //
96
-
97
- void grpc_certificate_provider_registry_init() {
98
- grpc_core::CertificateProviderRegistry::InitRegistry();
99
- }
100
-
101
- void grpc_certificate_provider_registry_shutdown() {
102
- grpc_core::CertificateProviderRegistry::ShutdownRegistry();
103
- }
@@ -1,59 +0,0 @@
1
- //
2
- //
3
- // Copyright 2020 gRPC authors.
4
- //
5
- // Licensed under the Apache License, Version 2.0 (the "License");
6
- // you may not use this file except in compliance with the License.
7
- // You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing, software
12
- // distributed under the License is distributed on an "AS IS" BASIS,
13
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- // See the License for the specific language governing permissions and
15
- // limitations under the License.
16
- //
17
- //
18
-
19
- #ifndef GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_REGISTRY_H
20
- #define GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_REGISTRY_H
21
-
22
- #include <grpc/support/port_platform.h>
23
-
24
- #include <memory>
25
-
26
- #include "absl/strings/string_view.h"
27
-
28
- #include "src/core/ext/xds/certificate_provider_factory.h"
29
-
30
- namespace grpc_core {
31
-
32
- // Global registry for all the certificate provider plugins.
33
- class CertificateProviderRegistry {
34
- public:
35
- // Returns the factory for the plugin keyed by name.
36
- static CertificateProviderFactory* LookupCertificateProviderFactory(
37
- absl::string_view name);
38
-
39
- // The following methods are used to create and populate the
40
- // CertificateProviderRegistry. NOT THREAD SAFE -- to be used only during
41
- // global gRPC initialization and shutdown.
42
-
43
- // Global initialization of the registry.
44
- static void InitRegistry();
45
-
46
- // Global shutdown of the registry.
47
- static void ShutdownRegistry();
48
-
49
- // Register a provider with the registry. Can only be called after calling
50
- // InitRegistry(). The key of the factory is extracted from factory
51
- // parameter with method CertificateProviderFactory::name. If the same key
52
- // is registered twice, an exception is raised.
53
- static void RegisterCertificateProviderFactory(
54
- std::unique_ptr<CertificateProviderFactory> factory);
55
- };
56
-
57
- } // namespace grpc_core
58
-
59
- #endif // GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_REGISTRY_H