grpc 1.43.1 → 1.44.0.pre2

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 (382) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +84 -64
  3. data/include/grpc/grpc_security.h +10 -0
  4. data/include/grpc/impl/codegen/compression_types.h +0 -2
  5. data/include/grpc/impl/codegen/grpc_types.h +6 -0
  6. data/src/core/ext/filters/client_channel/backend_metric.h +1 -1
  7. data/src/core/ext/filters/client_channel/client_channel.cc +62 -68
  8. data/src/core/ext/filters/client_channel/client_channel.h +8 -8
  9. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +1 -1
  10. data/src/core/ext/filters/client_channel/config_selector.h +4 -4
  11. data/src/core/ext/filters/client_channel/dynamic_filters.h +1 -1
  12. data/src/core/ext/filters/client_channel/health/health_check_client.cc +16 -14
  13. data/src/core/ext/filters/client_channel/health/health_check_client.h +3 -3
  14. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +1 -1
  15. data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +4 -3
  16. data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +6 -5
  17. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +3 -7
  18. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +31 -32
  19. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +0 -7
  20. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +1 -1
  21. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +1 -1
  22. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +1 -1
  23. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +43 -29
  24. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +6 -2
  25. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +120 -68
  26. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +60 -48
  27. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +62 -61
  28. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +16 -11
  29. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +11 -5
  30. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +19 -15
  31. data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +1 -1
  32. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +14 -12
  33. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +3 -2
  34. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +50 -105
  35. data/src/core/ext/filters/client_channel/lb_policy.cc +15 -14
  36. data/src/core/ext/filters/client_channel/lb_policy.h +19 -3
  37. data/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc +3 -3
  38. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +207 -81
  39. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +22 -12
  40. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +19 -15
  41. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +23 -38
  42. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +118 -207
  43. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +25 -32
  44. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +1 -1
  45. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +82 -73
  46. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +10 -10
  47. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +2 -1
  48. data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +2 -5
  49. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +5 -5
  50. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +157 -67
  51. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +1 -1
  52. data/src/core/ext/filters/client_channel/resolver_result_parsing.h +2 -2
  53. data/src/core/ext/filters/client_channel/retry_filter.cc +37 -64
  54. data/src/core/ext/filters/client_channel/retry_service_config.cc +1 -1
  55. data/src/core/ext/filters/client_channel/retry_service_config.h +1 -1
  56. data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +1 -1
  57. data/src/core/ext/filters/client_channel/subchannel.cc +12 -16
  58. data/src/core/ext/filters/client_channel/subchannel.h +2 -3
  59. data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +37 -48
  60. data/src/core/ext/filters/fault_injection/service_config_parser.cc +6 -8
  61. data/src/core/ext/filters/fault_injection/service_config_parser.h +1 -1
  62. data/src/core/ext/filters/http/client/http_client_filter.cc +51 -122
  63. data/src/core/ext/filters/http/client_authority_filter.cc +8 -24
  64. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +42 -140
  65. data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +5 -25
  66. data/src/core/ext/filters/http/server/http_server_filter.cc +50 -135
  67. data/src/core/ext/filters/message_size/message_size_filter.cc +1 -1
  68. data/src/core/ext/filters/message_size/message_size_filter.h +1 -1
  69. data/src/core/ext/filters/rbac/rbac_filter.cc +157 -0
  70. data/src/core/ext/filters/rbac/rbac_filter.h +74 -0
  71. data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +605 -0
  72. data/src/core/ext/filters/rbac/rbac_service_config_parser.h +70 -0
  73. data/src/core/ext/filters/server_config_selector/server_config_selector.h +3 -2
  74. data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +11 -6
  75. data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +1 -1
  76. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +1 -1
  77. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +89 -29
  78. data/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc +0 -1
  79. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +45 -186
  80. data/src/core/ext/transport/chttp2/transport/frame_data.cc +0 -1
  81. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +341 -279
  82. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +69 -159
  83. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +1 -1
  84. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +2 -0
  85. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +19 -32
  86. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +0 -1
  87. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +94 -1
  88. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +2 -24
  89. data/src/core/ext/transport/chttp2/transport/internal.h +0 -33
  90. data/src/core/ext/transport/chttp2/transport/parsing.cc +0 -6
  91. data/src/core/ext/transport/chttp2/transport/writing.cc +47 -116
  92. data/src/core/ext/transport/inproc/inproc_plugin.cc +0 -4
  93. data/src/core/ext/transport/inproc/inproc_transport.cc +11 -63
  94. data/src/core/ext/transport/inproc/inproc_transport.h +0 -3
  95. data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +61 -0
  96. data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +146 -0
  97. data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +188 -0
  98. data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h +70 -0
  99. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +56 -0
  100. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h +40 -0
  101. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c +154 -0
  102. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h +95 -0
  103. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/eval.upbdefs.c +58 -0
  104. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/eval.upbdefs.h +55 -0
  105. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/explain.upbdefs.c +44 -0
  106. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/explain.upbdefs.h +40 -0
  107. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c +153 -0
  108. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h +100 -0
  109. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/value.upbdefs.c +75 -0
  110. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/value.upbdefs.h +55 -0
  111. data/src/core/ext/xds/upb_utils.h +65 -0
  112. data/src/core/ext/xds/xds_api.cc +81 -3458
  113. data/src/core/ext/xds/xds_api.h +56 -611
  114. data/src/core/ext/xds/xds_bootstrap.cc +189 -125
  115. data/src/core/ext/xds/xds_bootstrap.h +20 -15
  116. data/src/core/ext/xds/xds_certificate_provider.h +1 -0
  117. data/src/core/ext/xds/xds_channel_creds.cc +108 -0
  118. data/src/core/ext/xds/xds_channel_creds.h +50 -0
  119. data/src/core/ext/xds/xds_client.cc +584 -994
  120. data/src/core/ext/xds/xds_client.h +78 -135
  121. data/src/core/ext/xds/xds_cluster.cc +451 -0
  122. data/src/core/ext/xds/xds_cluster.h +111 -0
  123. data/src/core/ext/xds/xds_common_types.cc +388 -0
  124. data/src/core/ext/xds/xds_common_types.h +110 -0
  125. data/src/core/ext/xds/xds_endpoint.cc +364 -0
  126. data/src/core/ext/xds/xds_endpoint.h +135 -0
  127. data/src/core/ext/xds/xds_http_filters.cc +5 -0
  128. data/src/core/ext/xds/xds_http_rbac_filter.cc +563 -0
  129. data/src/core/ext/xds/xds_http_rbac_filter.h +54 -0
  130. data/src/core/ext/xds/xds_listener.cc +1036 -0
  131. data/src/core/ext/xds/xds_listener.h +220 -0
  132. data/src/core/ext/{transport/chttp2/transport/hpack_utils.h → xds/xds_resource_type.cc} +12 -9
  133. data/src/core/ext/xds/xds_resource_type.h +98 -0
  134. data/src/core/ext/xds/xds_resource_type_impl.h +87 -0
  135. data/src/core/ext/xds/xds_route_config.cc +993 -0
  136. data/src/core/ext/xds/xds_route_config.h +215 -0
  137. data/src/core/ext/xds/xds_routing.cc +11 -8
  138. data/src/core/ext/xds/xds_routing.h +8 -5
  139. data/src/core/ext/xds/xds_server_config_fetcher.cc +159 -99
  140. data/src/core/lib/address_utils/parse_address.cc +20 -0
  141. data/src/core/lib/address_utils/parse_address.h +5 -0
  142. data/src/core/lib/address_utils/sockaddr_utils.cc +33 -36
  143. data/src/core/lib/address_utils/sockaddr_utils.h +1 -16
  144. data/src/core/lib/backoff/backoff.cc +4 -30
  145. data/src/core/lib/backoff/backoff.h +3 -3
  146. data/src/core/lib/channel/channel_args.cc +0 -1
  147. data/src/core/lib/channel/channel_stack.cc +8 -0
  148. data/src/core/lib/channel/channel_stack.h +1 -1
  149. data/src/core/lib/channel/channel_stack_builder.cc +5 -9
  150. data/src/core/lib/channel/channel_stack_builder.h +4 -7
  151. data/src/core/lib/channel/channelz.cc +1 -0
  152. data/src/core/lib/compression/compression.cc +19 -111
  153. data/src/core/lib/compression/compression_internal.cc +142 -202
  154. data/src/core/lib/compression/compression_internal.h +64 -69
  155. data/src/core/lib/compression/message_compress.cc +11 -11
  156. data/src/core/lib/compression/message_compress.h +2 -2
  157. data/src/core/lib/gpr/useful.h +4 -0
  158. data/src/core/lib/gprpp/bitset.h +7 -0
  159. data/src/core/lib/gprpp/chunked_vector.h +45 -3
  160. data/src/core/lib/gprpp/status_helper.cc +20 -28
  161. data/src/core/lib/gprpp/status_helper.h +6 -19
  162. data/src/core/lib/gprpp/table.h +11 -0
  163. data/src/core/lib/http/httpcli.cc +37 -46
  164. data/src/core/lib/http/httpcli.h +3 -15
  165. data/src/core/lib/iomgr/call_combiner.cc +15 -4
  166. data/src/core/lib/iomgr/closure.h +29 -9
  167. data/src/core/lib/iomgr/combiner.cc +25 -3
  168. data/src/core/lib/iomgr/error.cc +2 -0
  169. data/src/core/lib/iomgr/error.h +3 -0
  170. data/src/core/lib/iomgr/event_engine/iomgr.cc +3 -2
  171. data/src/core/lib/iomgr/event_engine/resolved_address_internal.cc +6 -0
  172. data/src/core/lib/iomgr/event_engine/resolved_address_internal.h +2 -0
  173. data/src/core/lib/iomgr/event_engine/resolver.cc +66 -48
  174. data/src/core/lib/iomgr/event_engine/resolver.h +56 -0
  175. data/src/core/lib/iomgr/exec_ctx.cc +22 -9
  176. data/src/core/lib/iomgr/executor.cc +10 -1
  177. data/src/core/lib/iomgr/fork_posix.cc +3 -2
  178. data/src/core/lib/iomgr/iomgr_custom.cc +4 -1
  179. data/src/core/lib/iomgr/iomgr_posix.cc +2 -2
  180. data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +2 -2
  181. data/src/core/lib/iomgr/iomgr_windows.cc +2 -2
  182. data/src/core/lib/iomgr/port.h +2 -2
  183. data/src/core/lib/iomgr/resolve_address.cc +5 -24
  184. data/src/core/lib/iomgr/resolve_address.h +47 -44
  185. data/src/core/lib/iomgr/resolve_address_custom.cc +131 -109
  186. data/src/core/lib/iomgr/resolve_address_custom.h +101 -19
  187. data/src/core/lib/iomgr/resolve_address_impl.h +59 -0
  188. data/src/core/lib/iomgr/resolve_address_posix.cc +82 -66
  189. data/src/core/lib/iomgr/resolve_address_posix.h +47 -0
  190. data/src/core/lib/iomgr/resolve_address_windows.cc +93 -74
  191. data/src/core/lib/iomgr/resolve_address_windows.h +47 -0
  192. data/src/core/lib/iomgr/resolved_address.h +39 -0
  193. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -0
  194. data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +1 -0
  195. data/src/core/lib/iomgr/unix_sockets_posix.cc +22 -34
  196. data/src/core/lib/iomgr/unix_sockets_posix.h +4 -7
  197. data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +6 -15
  198. data/src/core/lib/matchers/matchers.cc +1 -1
  199. data/src/core/lib/promise/activity.h +49 -20
  200. data/src/core/lib/promise/detail/status.h +5 -0
  201. data/src/core/{ext/filters/client_channel → lib/resolver}/resolver.cc +17 -25
  202. data/src/core/{ext/filters/client_channel → lib/resolver}/resolver.h +43 -44
  203. data/src/core/{ext/filters/client_channel → lib/resolver}/resolver_factory.h +10 -5
  204. data/src/core/{ext/filters/client_channel → lib/resolver}/resolver_registry.cc +3 -2
  205. data/src/core/{ext/filters/client_channel → lib/resolver}/resolver_registry.h +4 -5
  206. data/src/core/{ext/filters/client_channel → lib/resolver}/server_address.cc +1 -1
  207. data/src/core/{ext/filters/client_channel → lib/resolver}/server_address.h +4 -4
  208. data/src/core/lib/resource_quota/api.h +0 -1
  209. data/src/core/lib/{gprpp → resource_quota}/arena.cc +16 -13
  210. data/src/core/lib/{gprpp → resource_quota}/arena.h +24 -13
  211. data/src/core/lib/security/authorization/evaluate_args.cc +30 -15
  212. data/src/core/lib/security/authorization/evaluate_args.h +1 -0
  213. data/src/core/lib/security/authorization/grpc_authorization_engine.cc +60 -0
  214. data/src/core/lib/security/authorization/grpc_authorization_engine.h +62 -0
  215. data/src/core/lib/security/authorization/matchers.cc +227 -0
  216. data/src/core/lib/security/authorization/matchers.h +211 -0
  217. data/src/core/lib/security/authorization/rbac_policy.cc +442 -0
  218. data/src/core/lib/security/authorization/rbac_policy.h +170 -0
  219. data/src/core/lib/security/context/security_context.cc +4 -2
  220. data/src/core/lib/security/context/security_context.h +1 -1
  221. data/src/core/lib/security/credentials/composite/composite_credentials.cc +5 -5
  222. data/src/core/lib/security/credentials/composite/composite_credentials.h +4 -3
  223. data/src/core/lib/security/credentials/credentials.h +10 -20
  224. data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +6 -9
  225. data/src/core/lib/security/credentials/external/external_account_credentials.cc +7 -9
  226. data/src/core/lib/security/credentials/external/external_account_credentials.h +2 -7
  227. data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +2 -3
  228. data/src/core/lib/security/credentials/fake/fake_credentials.cc +5 -4
  229. data/src/core/lib/security/credentials/fake/fake_credentials.h +8 -7
  230. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +2 -5
  231. data/src/core/lib/security/credentials/iam/iam_credentials.cc +16 -19
  232. data/src/core/lib/security/credentials/iam/iam_credentials.h +6 -5
  233. data/src/core/lib/security/credentials/jwt/json_token.cc +4 -6
  234. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +16 -28
  235. data/src/core/lib/security/credentials/jwt/jwt_credentials.h +8 -8
  236. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +6 -13
  237. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +44 -57
  238. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +13 -15
  239. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +6 -7
  240. data/src/core/lib/security/credentials/plugin/plugin_credentials.h +5 -4
  241. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +1 -10
  242. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +6 -0
  243. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +7 -0
  244. data/src/core/lib/security/credentials/xds/xds_credentials.h +1 -1
  245. data/src/core/lib/security/security_connector/security_connector.cc +0 -4
  246. data/src/core/lib/security/security_connector/security_connector.h +5 -1
  247. data/src/core/lib/security/security_connector/ssl_utils.cc +14 -24
  248. data/src/core/lib/security/security_connector/ssl_utils.h +5 -14
  249. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +2 -3
  250. data/src/core/lib/security/transport/auth_filters.h +7 -0
  251. data/src/core/lib/security/transport/client_auth_filter.cc +53 -33
  252. data/src/core/lib/security/transport/server_auth_filter.cc +40 -35
  253. data/src/core/{ext → lib}/service_config/service_config.cc +2 -2
  254. data/src/core/{ext → lib}/service_config/service_config.h +4 -4
  255. data/src/core/{ext → lib}/service_config/service_config_call_data.h +5 -5
  256. data/src/core/{ext → lib}/service_config/service_config_parser.cc +1 -1
  257. data/src/core/{ext → lib}/service_config/service_config_parser.h +3 -3
  258. data/src/core/lib/slice/slice.cc +3 -1
  259. data/src/core/lib/slice/slice.h +43 -13
  260. data/src/core/lib/slice/slice_intern.cc +3 -101
  261. data/src/core/lib/slice/slice_internal.h +1 -2
  262. data/src/core/lib/slice/slice_refcount.h +4 -13
  263. data/src/core/lib/slice/slice_refcount_base.h +0 -16
  264. data/src/core/lib/surface/call.cc +140 -382
  265. data/src/core/lib/surface/call.h +4 -4
  266. data/src/core/lib/surface/channel.cc +42 -44
  267. data/src/core/lib/surface/channel.h +4 -4
  268. data/src/core/lib/surface/init.cc +0 -2
  269. data/src/core/lib/surface/lame_client.cc +0 -1
  270. data/src/core/lib/surface/server.cc +12 -29
  271. data/src/core/lib/surface/server.h +2 -2
  272. data/src/core/lib/surface/version.cc +2 -2
  273. data/src/core/lib/transport/error_utils.h +14 -0
  274. data/src/core/lib/transport/metadata_batch.h +799 -717
  275. data/src/core/lib/transport/parsed_metadata.cc +2 -0
  276. data/src/core/lib/transport/parsed_metadata.h +95 -92
  277. data/src/core/lib/transport/timeout_encoding.cc +200 -66
  278. data/src/core/lib/transport/timeout_encoding.h +40 -10
  279. data/src/core/lib/transport/transport.h +1 -1
  280. data/src/core/lib/transport/transport_op_string.cc +6 -39
  281. data/src/core/lib/uri/uri_parser.cc +223 -53
  282. data/src/core/lib/uri/uri_parser.h +36 -23
  283. data/src/core/plugin_registry/grpc_plugin_registry.cc +4 -3
  284. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +1 -1
  285. data/src/core/tsi/ssl/session_cache/ssl_session.h +2 -4
  286. data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +3 -5
  287. data/src/core/tsi/ssl_transport_security.cc +53 -13
  288. data/src/core/tsi/ssl_transport_security.h +18 -6
  289. data/src/ruby/ext/grpc/extconf.rb +10 -3
  290. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +2 -0
  291. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +3 -0
  292. data/src/ruby/lib/grpc/version.rb +1 -1
  293. data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +2 -1
  294. data/third_party/abseil-cpp/absl/base/internal/fast_type_id.h +48 -0
  295. data/third_party/abseil-cpp/absl/random/bernoulli_distribution.h +200 -0
  296. data/third_party/abseil-cpp/absl/random/beta_distribution.h +427 -0
  297. data/third_party/abseil-cpp/absl/random/discrete_distribution.cc +98 -0
  298. data/third_party/abseil-cpp/absl/random/discrete_distribution.h +247 -0
  299. data/third_party/abseil-cpp/absl/random/distributions.h +452 -0
  300. data/third_party/abseil-cpp/absl/random/exponential_distribution.h +165 -0
  301. data/third_party/abseil-cpp/absl/random/gaussian_distribution.cc +104 -0
  302. data/third_party/abseil-cpp/absl/random/gaussian_distribution.h +275 -0
  303. data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +92 -0
  304. data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +268 -0
  305. data/third_party/abseil-cpp/absl/random/internal/fastmath.h +57 -0
  306. data/third_party/abseil-cpp/absl/random/internal/generate_real.h +144 -0
  307. data/third_party/abseil-cpp/absl/random/internal/iostream_state_saver.h +245 -0
  308. data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +150 -0
  309. data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +308 -0
  310. data/third_party/abseil-cpp/absl/random/internal/platform.h +171 -0
  311. data/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc +253 -0
  312. data/third_party/abseil-cpp/absl/random/internal/pool_urbg.h +131 -0
  313. data/third_party/abseil-cpp/absl/random/internal/randen.cc +91 -0
  314. data/third_party/abseil-cpp/absl/random/internal/randen.h +102 -0
  315. data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +221 -0
  316. data/third_party/abseil-cpp/absl/random/internal/randen_detect.h +33 -0
  317. data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +239 -0
  318. data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc +526 -0
  319. data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.h +50 -0
  320. data/third_party/abseil-cpp/absl/random/internal/randen_round_keys.cc +462 -0
  321. data/third_party/abseil-cpp/absl/random/internal/randen_slow.cc +471 -0
  322. data/third_party/abseil-cpp/absl/random/internal/randen_slow.h +40 -0
  323. data/third_party/abseil-cpp/absl/random/internal/randen_traits.h +88 -0
  324. data/third_party/abseil-cpp/absl/random/internal/salted_seed_seq.h +167 -0
  325. data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +267 -0
  326. data/third_party/abseil-cpp/absl/random/internal/seed_material.h +104 -0
  327. data/third_party/abseil-cpp/absl/random/internal/traits.h +101 -0
  328. data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +244 -0
  329. data/third_party/abseil-cpp/absl/random/internal/wide_multiply.h +111 -0
  330. data/third_party/abseil-cpp/absl/random/log_uniform_int_distribution.h +257 -0
  331. data/third_party/abseil-cpp/absl/random/poisson_distribution.h +258 -0
  332. data/third_party/abseil-cpp/absl/random/random.h +189 -0
  333. data/third_party/abseil-cpp/absl/random/seed_gen_exception.cc +46 -0
  334. data/third_party/abseil-cpp/absl/random/seed_gen_exception.h +55 -0
  335. data/third_party/abseil-cpp/absl/random/seed_sequences.cc +29 -0
  336. data/third_party/abseil-cpp/absl/random/seed_sequences.h +110 -0
  337. data/third_party/abseil-cpp/absl/random/uniform_int_distribution.h +275 -0
  338. data/third_party/abseil-cpp/absl/random/uniform_real_distribution.h +202 -0
  339. data/third_party/abseil-cpp/absl/random/zipf_distribution.h +271 -0
  340. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +1 -0
  341. data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +13 -0
  342. data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +21 -0
  343. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/cipher.c +12 -0
  344. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +1 -2
  345. data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +2 -2
  346. data/third_party/boringssl-with-bazel/src/crypto/mem.c +1 -1
  347. data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c +29 -0
  348. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +0 -1
  349. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c +1 -1
  350. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +1 -1
  351. data/third_party/boringssl-with-bazel/src/include/openssl/base64.h +8 -0
  352. data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +13 -1
  353. data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +10 -0
  354. data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +1 -1
  355. data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +9 -4
  356. data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +6 -1
  357. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +23 -2
  358. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +4 -0
  359. data/third_party/xxhash/xxhash.h +607 -352
  360. metadata +149 -77
  361. data/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h +0 -107
  362. data/src/core/ext/transport/chttp2/transport/hpack_utils.cc +0 -46
  363. data/src/core/ext/transport/chttp2/transport/popularity_count.h +0 -60
  364. data/src/core/lib/compression/algorithm_metadata.h +0 -62
  365. data/src/core/lib/compression/compression_args.cc +0 -140
  366. data/src/core/lib/compression/compression_args.h +0 -58
  367. data/src/core/lib/compression/stream_compression.cc +0 -81
  368. data/src/core/lib/compression/stream_compression.h +0 -117
  369. data/src/core/lib/compression/stream_compression_gzip.cc +0 -231
  370. data/src/core/lib/compression/stream_compression_gzip.h +0 -28
  371. data/src/core/lib/compression/stream_compression_identity.cc +0 -91
  372. data/src/core/lib/compression/stream_compression_identity.h +0 -29
  373. data/src/core/lib/security/credentials/credentials_metadata.cc +0 -61
  374. data/src/core/lib/slice/static_slice.cc +0 -377
  375. data/src/core/lib/slice/static_slice.h +0 -300
  376. data/src/core/lib/transport/metadata.cc +0 -714
  377. data/src/core/lib/transport/metadata.h +0 -449
  378. data/src/core/lib/transport/metadata_batch.cc +0 -99
  379. data/src/core/lib/transport/static_metadata.cc +0 -1032
  380. data/src/core/lib/transport/static_metadata.h +0 -322
  381. data/src/core/lib/transport/status_metadata.cc +0 -63
  382. data/src/core/lib/transport/status_metadata.h +0 -48
@@ -25,7 +25,6 @@
25
25
  #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
26
26
  #include "src/core/ext/transport/chttp2/transport/context_list.h"
27
27
  #include "src/core/ext/transport/chttp2/transport/internal.h"
28
- #include "src/core/lib/compression/stream_compression.h"
29
28
  #include "src/core/lib/debug/stats.h"
30
29
  #include "src/core/lib/profiling/timers.h"
31
30
  #include "src/core/lib/slice/slice_internal.h"
@@ -164,16 +163,10 @@ static void report_stall(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
164
163
  "%s:%p stream %d moved to stalled list by %s. This is FULLY expected "
165
164
  "to happen in a healthy program that is not seeing flow control stalls."
166
165
  " However, if you know that there are unwanted stalls, here is some "
167
- "helpful data: [fc:pending=%" PRIdPTR ":pending-compressed=%" PRIdPTR
168
- ":flowed=%" PRId64 ":peer_initwin=%d:t_win=%" PRId64
169
- ":s_win=%d:s_delta=%" PRId64 "]",
166
+ "helpful data: [fc:pending=%" PRIdPTR ":flowed=%" PRId64
167
+ ":peer_initwin=%d:t_win=%" PRId64 ":s_win=%d:s_delta=%" PRId64 "]",
170
168
  t->peer_string.c_str(), t, s->id, staller,
171
- s->flow_controlled_buffer.length,
172
- s->stream_compression_method ==
173
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS
174
- ? 0
175
- : s->compressed_data_buffer.length,
176
- s->flow_controlled_bytes_flowed,
169
+ s->flow_controlled_buffer.length, s->flow_controlled_bytes_flowed,
177
170
  t->settings[GRPC_ACKED_SETTINGS]
178
171
  [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE],
179
172
  t->flow_control->remote_window(),
@@ -192,10 +185,30 @@ static uint32_t target_write_size(grpc_chttp2_transport* /*t*/) {
192
185
  return 1024 * 1024;
193
186
  }
194
187
 
188
+ namespace {
189
+
190
+ class CountDefaultMetadataEncoder {
191
+ public:
192
+ size_t count() const { return count_; }
193
+
194
+ void Encode(const grpc_core::Slice&, const grpc_core::Slice&) {}
195
+
196
+ template <typename Which>
197
+ void Encode(Which, const typename Which::ValueType&) {
198
+ count_++;
199
+ }
200
+
201
+ private:
202
+ size_t count_ = 0;
203
+ };
204
+
205
+ } // namespace
206
+
195
207
  // Returns true if initial_metadata contains only default headers.
196
208
  static bool is_default_initial_metadata(grpc_metadata_batch* initial_metadata) {
197
- return initial_metadata->default_count() ==
198
- initial_metadata->non_deadline_count();
209
+ CountDefaultMetadataEncoder enc;
210
+ initial_metadata->Encode(&enc);
211
+ return enc.count() == initial_metadata->count();
199
212
  }
200
213
 
201
214
  namespace {
@@ -344,7 +357,7 @@ class DataSendContext {
344
357
 
345
358
  bool AnyOutgoing() const { return max_outgoing() > 0; }
346
359
 
347
- void FlushUncompressedBytes() {
360
+ void FlushBytes() {
348
361
  uint32_t send_bytes = static_cast<uint32_t>(
349
362
  std::min(size_t(max_outgoing()), s_->flow_controlled_buffer.length));
350
363
  is_last_frame_ = send_bytes == s_->flow_controlled_buffer.length &&
@@ -357,60 +370,6 @@ class DataSendContext {
357
370
  s_->sending_bytes += send_bytes;
358
371
  }
359
372
 
360
- void FlushCompressedBytes() {
361
- GPR_DEBUG_ASSERT(s_->stream_compression_method !=
362
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS);
363
-
364
- uint32_t send_bytes = static_cast<uint32_t>(
365
- std::min(size_t(max_outgoing()), s_->compressed_data_buffer.length));
366
- bool is_last_data_frame =
367
- (send_bytes == s_->compressed_data_buffer.length &&
368
- s_->flow_controlled_buffer.length == 0 &&
369
- s_->fetching_send_message == nullptr);
370
- if (is_last_data_frame && s_->send_trailing_metadata != nullptr &&
371
- s_->stream_compression_ctx != nullptr) {
372
- if (GPR_UNLIKELY(!grpc_stream_compress(
373
- s_->stream_compression_ctx, &s_->flow_controlled_buffer,
374
- &s_->compressed_data_buffer, nullptr, MAX_SIZE_T,
375
- GRPC_STREAM_COMPRESSION_FLUSH_FINISH))) {
376
- gpr_log(GPR_ERROR, "Stream compression failed.");
377
- }
378
- grpc_stream_compression_context_destroy(s_->stream_compression_ctx);
379
- s_->stream_compression_ctx = nullptr;
380
- /* After finish, bytes in s->compressed_data_buffer may be
381
- * more than max_outgoing. Start another round of the current
382
- * while loop so that send_bytes and is_last_data_frame are
383
- * recalculated. */
384
- return;
385
- }
386
- is_last_frame_ = is_last_data_frame &&
387
- s_->send_trailing_metadata != nullptr &&
388
- s_->send_trailing_metadata->empty();
389
- grpc_chttp2_encode_data(s_->id, &s_->compressed_data_buffer, send_bytes,
390
- is_last_frame_, &s_->stats.outgoing, &t_->outbuf);
391
- s_->flow_control->SentData(send_bytes);
392
- if (s_->compressed_data_buffer.length == 0) {
393
- s_->sending_bytes += s_->uncompressed_data_size;
394
- }
395
- }
396
-
397
- void CompressMoreBytes() {
398
- GPR_DEBUG_ASSERT(s_->stream_compression_method !=
399
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS);
400
-
401
- if (s_->stream_compression_ctx == nullptr) {
402
- s_->stream_compression_ctx =
403
- grpc_stream_compression_context_create(s_->stream_compression_method);
404
- }
405
- s_->uncompressed_data_size = s_->flow_controlled_buffer.length;
406
- if (GPR_UNLIKELY(!grpc_stream_compress(
407
- s_->stream_compression_ctx, &s_->flow_controlled_buffer,
408
- &s_->compressed_data_buffer, nullptr, MAX_SIZE_T,
409
- GRPC_STREAM_COMPRESSION_FLUSH_SYNC))) {
410
- gpr_log(GPR_ERROR, "Stream compression failed.");
411
- }
412
- }
413
-
414
373
  bool is_last_frame() const { return is_last_frame_; }
415
374
 
416
375
  void CallCallbacks() {
@@ -455,7 +414,6 @@ class StreamWriteContext {
455
414
  // https://github.com/grpc/proposal/blob/master/A6-client-retries.md#when-retries-are-valid
456
415
  if (!t_->is_client && s_->fetching_send_message == nullptr &&
457
416
  s_->flow_controlled_buffer.length == 0 &&
458
- compressed_data_buffer_len() == 0 &&
459
417
  s_->send_trailing_metadata != nullptr &&
460
418
  is_default_initial_metadata(s_->send_initial_metadata)) {
461
419
  ConvertInitialMetadataToTrailingMetadata();
@@ -486,13 +444,6 @@ class StreamWriteContext {
486
444
  "send_initial_metadata_finished");
487
445
  }
488
446
 
489
- size_t compressed_data_buffer_len() {
490
- return s_->stream_compression_method ==
491
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS
492
- ? 0
493
- : s_->compressed_data_buffer.length;
494
- }
495
-
496
447
  void FlushWindowUpdates() {
497
448
  /* send any window updates */
498
449
  const uint32_t stream_announce = s_->flow_control->MaybeSendUpdate();
@@ -508,8 +459,7 @@ class StreamWriteContext {
508
459
  void FlushData() {
509
460
  if (!s_->sent_initial_metadata) return;
510
461
 
511
- if (s_->flow_controlled_buffer.length == 0 &&
512
- compressed_data_buffer_len() == 0) {
462
+ if (s_->flow_controlled_buffer.length == 0) {
513
463
  return; // early out: nothing to do
514
464
  }
515
465
 
@@ -526,22 +476,9 @@ class StreamWriteContext {
526
476
  return; // early out: nothing to do
527
477
  }
528
478
 
529
- if (s_->stream_compression_method ==
530
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS) {
531
- while (s_->flow_controlled_buffer.length > 0 &&
532
- data_send_context.max_outgoing() > 0) {
533
- data_send_context.FlushUncompressedBytes();
534
- }
535
- } else {
536
- while ((s_->flow_controlled_buffer.length > 0 ||
537
- s_->compressed_data_buffer.length > 0) &&
538
- data_send_context.max_outgoing() > 0) {
539
- if (s_->compressed_data_buffer.length > 0) {
540
- data_send_context.FlushCompressedBytes();
541
- } else {
542
- data_send_context.CompressMoreBytes();
543
- }
544
- }
479
+ while (s_->flow_controlled_buffer.length > 0 &&
480
+ data_send_context.max_outgoing() > 0) {
481
+ data_send_context.FlushBytes();
545
482
  }
546
483
  grpc_chttp2_reset_ping_clock(t_);
547
484
  if (data_send_context.is_last_frame()) {
@@ -549,8 +486,7 @@ class StreamWriteContext {
549
486
  }
550
487
  data_send_context.CallCallbacks();
551
488
  stream_became_writable_ = true;
552
- if (s_->flow_controlled_buffer.length > 0 ||
553
- compressed_data_buffer_len() > 0) {
489
+ if (s_->flow_controlled_buffer.length > 0) {
554
490
  GRPC_CHTTP2_STREAM_REF(s_, "chttp2_writing:fork");
555
491
  grpc_chttp2_list_add_writable_stream(t_, s_);
556
492
  }
@@ -563,13 +499,20 @@ class StreamWriteContext {
563
499
  if (s_->send_trailing_metadata == nullptr) return;
564
500
  if (s_->fetching_send_message != nullptr) return;
565
501
  if (s_->flow_controlled_buffer.length != 0) return;
566
- if (compressed_data_buffer_len() != 0) return;
567
502
 
568
503
  GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "sending trailing_metadata"));
569
504
  if (s_->send_trailing_metadata->empty()) {
570
505
  grpc_chttp2_encode_data(s_->id, &s_->flow_controlled_buffer, 0, true,
571
506
  &s_->stats.outgoing, &t_->outbuf);
572
507
  } else {
508
+ if (send_status_.has_value()) {
509
+ s_->send_trailing_metadata->Set(grpc_core::HttpStatusMetadata(),
510
+ *send_status_);
511
+ }
512
+ if (send_content_type_.has_value()) {
513
+ s_->send_trailing_metadata->Set(grpc_core::ContentTypeMetadata(),
514
+ *send_content_type_);
515
+ }
573
516
  t_->hpack_compressor.EncodeHeaders(
574
517
  grpc_core::HPackCompressor::EncodeHeaderOptions{
575
518
  s_->id, true,
@@ -580,12 +523,7 @@ class StreamWriteContext {
580
523
  t_->settings[GRPC_PEER_SETTINGS]
581
524
  [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE],
582
525
  &s_->stats.outgoing},
583
- grpc_core::ConcatMetadata(
584
- grpc_core::MetadataArray(
585
- extra_headers_for_trailing_metadata_,
586
- num_extra_headers_for_trailing_metadata_),
587
- *s_->send_trailing_metadata),
588
- &t_->outbuf);
526
+ *s_->send_trailing_metadata, &t_->outbuf);
589
527
  }
590
528
  write_context_->IncTrailingMetadataWrites();
591
529
  grpc_chttp2_reset_ping_clock(t_);
@@ -605,18 +543,10 @@ class StreamWriteContext {
605
543
  gpr_log(GPR_INFO, "not sending initial_metadata (Trailers-Only)"));
606
544
  // When sending Trailers-Only, we need to move the :status and
607
545
  // content-type headers to the trailers.
608
- if (s_->send_initial_metadata->legacy_index()->named.status != nullptr) {
609
- extra_headers_for_trailing_metadata_
610
- [num_extra_headers_for_trailing_metadata_++] =
611
- &s_->send_initial_metadata->legacy_index()->named.status->md;
612
- }
613
- if (s_->send_initial_metadata->legacy_index()->named.content_type !=
614
- nullptr) {
615
- extra_headers_for_trailing_metadata_
616
- [num_extra_headers_for_trailing_metadata_++] =
617
- &s_->send_initial_metadata->legacy_index()
618
- ->named.content_type->md;
619
- }
546
+ send_status_ =
547
+ s_->send_initial_metadata->get(grpc_core::HttpStatusMetadata());
548
+ send_content_type_ =
549
+ s_->send_initial_metadata->get(grpc_core::ContentTypeMetadata());
620
550
  }
621
551
 
622
552
  void SentLastFrame() {
@@ -641,8 +571,9 @@ class StreamWriteContext {
641
571
  grpc_chttp2_transport* const t_;
642
572
  grpc_chttp2_stream* const s_;
643
573
  bool stream_became_writable_ = false;
644
- grpc_mdelem* extra_headers_for_trailing_metadata_[2];
645
- size_t num_extra_headers_for_trailing_metadata_ = 0;
574
+ absl::optional<uint32_t> send_status_;
575
+ absl::optional<grpc_core::ContentTypeMetadata::ValueType> send_content_type_ =
576
+ {};
646
577
  };
647
578
  } // namespace
648
579
 
@@ -22,7 +22,3 @@
22
22
  #include "src/core/lib/debug/trace.h"
23
23
 
24
24
  grpc_core::TraceFlag grpc_inproc_trace(false, "inproc");
25
-
26
- void grpc_inproc_plugin_init(void) { grpc_inproc_transport_init(); }
27
-
28
- void grpc_inproc_plugin_shutdown(void) { grpc_inproc_transport_shutdown(); }
@@ -46,12 +46,6 @@
46
46
  } while (0)
47
47
 
48
48
  namespace {
49
- grpc_slice g_empty_slice;
50
- grpc_slice g_fake_path_key;
51
- grpc_slice g_fake_path_value;
52
- grpc_slice g_fake_auth_key;
53
- grpc_slice g_fake_auth_value;
54
-
55
49
  struct inproc_stream;
56
50
  bool cancel_stream_locked(inproc_stream* s, grpc_error_handle error);
57
51
  void maybe_process_ops_locked(inproc_stream* s, grpc_error_handle error);
@@ -280,13 +274,10 @@ struct inproc_stream {
280
274
 
281
275
  void log_metadata(const grpc_metadata_batch* md_batch, bool is_client,
282
276
  bool is_initial) {
283
- md_batch->ForEach([=](grpc_mdelem md) {
284
- char* key = grpc_slice_to_c_string(GRPC_MDKEY(md));
285
- char* value = grpc_slice_to_c_string(GRPC_MDVALUE(md));
286
- gpr_log(GPR_INFO, "INPROC:%s:%s: %s: %s", is_initial ? "HDR" : "TRL",
287
- is_client ? "CLI" : "SVR", key, value);
288
- gpr_free(key);
289
- gpr_free(value);
277
+ std::string prefix = absl::StrCat(
278
+ "INPROC:", is_initial ? "HDR:" : "TRL:", is_client ? "CLI:" : "SVR:");
279
+ md_batch->Log([&prefix](absl::string_view key, absl::string_view value) {
280
+ gpr_log(GPR_INFO, "%s", absl::StrCat(prefix, key, ": ", value).c_str());
290
281
  });
291
282
  }
292
283
 
@@ -296,19 +287,9 @@ class CopySink {
296
287
  public:
297
288
  explicit CopySink(grpc_metadata_batch* dst) : dst_(dst) {}
298
289
 
299
- void Encode(grpc_mdelem md) {
300
- // Differently to grpc_metadata_batch_copy, we always copy slices here so
301
- // that we don't need to deal with the plethora of edge cases in that world.
302
- // TODO(ctiller): revisit this when deleting mdelem.
303
- md = grpc_mdelem_from_slices(grpc_slice_intern(GRPC_MDKEY(md)),
304
- grpc_slice_copy(GRPC_MDVALUE(md)));
305
- // Error unused in non-debug builds.
306
- grpc_error_handle GRPC_UNUSED error = dst_->Append(md);
307
- // The only way that Append() can fail is if
308
- // there's a duplicate entry for a callout. However, that can't be
309
- // the case here, because we would not have been allowed to create
310
- // a source batch that had that kind of conflict.
311
- GPR_DEBUG_ASSERT(error == GRPC_ERROR_NONE);
290
+ void Encode(const grpc_core::Slice& key, const grpc_core::Slice& value) {
291
+ dst_->Append(key.as_string_view(), value.AsOwned(),
292
+ [](absl::string_view, const grpc_core::Slice&) {});
312
293
  }
313
294
 
314
295
  template <class T, class V>
@@ -462,14 +443,10 @@ void fail_helper_locked(inproc_stream* s, grpc_error_handle error) {
462
443
  // If this is a server, provide initial metadata with a path and authority
463
444
  // since it expects that as well as no error yet
464
445
  grpc_metadata_batch fake_md(s->arena);
465
- grpc_linked_mdelem* path_md =
466
- static_cast<grpc_linked_mdelem*>(s->arena->Alloc(sizeof(*path_md)));
467
- path_md->md = grpc_mdelem_from_slices(g_fake_path_key, g_fake_path_value);
468
- GPR_ASSERT(fake_md.LinkTail(path_md) == GRPC_ERROR_NONE);
469
- grpc_linked_mdelem* auth_md =
470
- static_cast<grpc_linked_mdelem*>(s->arena->Alloc(sizeof(*auth_md)));
471
- auth_md->md = grpc_mdelem_from_slices(g_fake_auth_key, g_fake_auth_value);
472
- GPR_ASSERT(fake_md.LinkTail(auth_md) == GRPC_ERROR_NONE);
446
+ fake_md.Set(grpc_core::HttpPathMetadata(),
447
+ grpc_core::Slice::FromStaticString("/"));
448
+ fake_md.Set(grpc_core::HttpAuthorityMetadata(),
449
+ grpc_core::Slice::FromStaticString("inproc-fail"));
473
450
 
474
451
  (void)fill_in_metadata(
475
452
  s, &fake_md, 0,
@@ -1260,26 +1237,6 @@ void inproc_transports_create(grpc_transport** server_transport,
1260
1237
  }
1261
1238
  } // namespace
1262
1239
 
1263
- /*******************************************************************************
1264
- * GLOBAL INIT AND DESTROY
1265
- */
1266
- void grpc_inproc_transport_init(void) {
1267
- grpc_core::ExecCtx exec_ctx;
1268
- g_empty_slice = grpc_core::ExternallyManagedSlice();
1269
-
1270
- grpc_slice key_tmp = grpc_slice_from_static_string(":path");
1271
- g_fake_path_key = grpc_slice_intern(key_tmp);
1272
- grpc_slice_unref_internal(key_tmp);
1273
-
1274
- g_fake_path_value = grpc_slice_from_static_string("/");
1275
-
1276
- grpc_slice auth_tmp = grpc_slice_from_static_string(":authority");
1277
- g_fake_auth_key = grpc_slice_intern(auth_tmp);
1278
- grpc_slice_unref_internal(auth_tmp);
1279
-
1280
- g_fake_auth_value = grpc_slice_from_static_string("inproc-fail");
1281
- }
1282
-
1283
1240
  grpc_channel* grpc_inproc_channel_create(grpc_server* server,
1284
1241
  const grpc_channel_args* args,
1285
1242
  void* /*reserved*/) {
@@ -1358,12 +1315,3 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server,
1358
1315
 
1359
1316
  return channel;
1360
1317
  }
1361
-
1362
- void grpc_inproc_transport_shutdown(void) {
1363
- grpc_core::ExecCtx exec_ctx;
1364
- grpc_slice_unref_internal(g_empty_slice);
1365
- grpc_slice_unref_internal(g_fake_path_key);
1366
- grpc_slice_unref_internal(g_fake_path_value);
1367
- grpc_slice_unref_internal(g_fake_auth_key);
1368
- grpc_slice_unref_internal(g_fake_auth_value);
1369
- }
@@ -29,7 +29,4 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server,
29
29
 
30
30
  extern grpc_core::TraceFlag grpc_inproc_trace;
31
31
 
32
- void grpc_inproc_transport_init(void);
33
- void grpc_inproc_transport_shutdown(void);
34
-
35
32
  #endif /* GRPC_CORE_EXT_TRANSPORT_INPROC_INPROC_TRANSPORT_H */
@@ -0,0 +1,61 @@
1
+ /* This file was generated by upbc (the upb compiler) from the input
2
+ * file:
3
+ *
4
+ * envoy/extensions/filters/http/rbac/v3/rbac.proto
5
+ *
6
+ * Do not edit -- your changes will be discarded when the file is
7
+ * regenerated. */
8
+
9
+ #include <stddef.h>
10
+ #include "upb/msg_internal.h"
11
+ #include "envoy/extensions/filters/http/rbac/v3/rbac.upb.h"
12
+ #include "envoy/config/rbac/v3/rbac.upb.h"
13
+ #include "udpa/annotations/status.upb.h"
14
+ #include "udpa/annotations/versioning.upb.h"
15
+
16
+ #include "upb/port_def.inc"
17
+
18
+ static const upb_msglayout_sub envoy_extensions_filters_http_rbac_v3_RBAC_submsgs[1] = {
19
+ {.submsg = &envoy_config_rbac_v3_RBAC_msginit},
20
+ };
21
+
22
+ static const upb_msglayout_field envoy_extensions_filters_http_rbac_v3_RBAC__fields[3] = {
23
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
24
+ {2, UPB_SIZE(16, 32), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
25
+ {3, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
26
+ };
27
+
28
+ const upb_msglayout envoy_extensions_filters_http_rbac_v3_RBAC_msginit = {
29
+ &envoy_extensions_filters_http_rbac_v3_RBAC_submsgs[0],
30
+ &envoy_extensions_filters_http_rbac_v3_RBAC__fields[0],
31
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
32
+ };
33
+
34
+ static const upb_msglayout_sub envoy_extensions_filters_http_rbac_v3_RBACPerRoute_submsgs[1] = {
35
+ {.submsg = &envoy_extensions_filters_http_rbac_v3_RBAC_msginit},
36
+ };
37
+
38
+ static const upb_msglayout_field envoy_extensions_filters_http_rbac_v3_RBACPerRoute__fields[1] = {
39
+ {2, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
40
+ };
41
+
42
+ const upb_msglayout envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit = {
43
+ &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_submsgs[0],
44
+ &envoy_extensions_filters_http_rbac_v3_RBACPerRoute__fields[0],
45
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 0, 255,
46
+ };
47
+
48
+ static const upb_msglayout *messages_layout[2] = {
49
+ &envoy_extensions_filters_http_rbac_v3_RBAC_msginit,
50
+ &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit,
51
+ };
52
+
53
+ const upb_msglayout_file envoy_extensions_filters_http_rbac_v3_rbac_proto_upb_file_layout = {
54
+ messages_layout,
55
+ NULL,
56
+ 2,
57
+ 0,
58
+ };
59
+
60
+ #include "upb/port_undef.inc"
61
+
@@ -0,0 +1,146 @@
1
+ /* This file was generated by upbc (the upb compiler) from the input
2
+ * file:
3
+ *
4
+ * envoy/extensions/filters/http/rbac/v3/rbac.proto
5
+ *
6
+ * Do not edit -- your changes will be discarded when the file is
7
+ * regenerated. */
8
+
9
+ #ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPB_H_
10
+ #define ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPB_H_
11
+
12
+ #include "upb/msg_internal.h"
13
+ #include "upb/decode.h"
14
+ #include "upb/decode_fast.h"
15
+ #include "upb/encode.h"
16
+
17
+ #include "upb/port_def.inc"
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+ struct envoy_extensions_filters_http_rbac_v3_RBAC;
24
+ struct envoy_extensions_filters_http_rbac_v3_RBACPerRoute;
25
+ typedef struct envoy_extensions_filters_http_rbac_v3_RBAC envoy_extensions_filters_http_rbac_v3_RBAC;
26
+ typedef struct envoy_extensions_filters_http_rbac_v3_RBACPerRoute envoy_extensions_filters_http_rbac_v3_RBACPerRoute;
27
+ extern const upb_msglayout envoy_extensions_filters_http_rbac_v3_RBAC_msginit;
28
+ extern const upb_msglayout envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit;
29
+ struct envoy_config_rbac_v3_RBAC;
30
+ extern const upb_msglayout envoy_config_rbac_v3_RBAC_msginit;
31
+
32
+
33
+ /* envoy.extensions.filters.http.rbac.v3.RBAC */
34
+
35
+ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBAC *envoy_extensions_filters_http_rbac_v3_RBAC_new(upb_arena *arena) {
36
+ return (envoy_extensions_filters_http_rbac_v3_RBAC *)_upb_msg_new(&envoy_extensions_filters_http_rbac_v3_RBAC_msginit, arena);
37
+ }
38
+ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBAC *envoy_extensions_filters_http_rbac_v3_RBAC_parse(const char *buf, size_t size,
39
+ upb_arena *arena) {
40
+ envoy_extensions_filters_http_rbac_v3_RBAC *ret = envoy_extensions_filters_http_rbac_v3_RBAC_new(arena);
41
+ if (!ret) return NULL;
42
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, arena)) return NULL;
43
+ return ret;
44
+ }
45
+ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBAC *envoy_extensions_filters_http_rbac_v3_RBAC_parse_ex(const char *buf, size_t size,
46
+ const upb_extreg *extreg, int options,
47
+ upb_arena *arena) {
48
+ envoy_extensions_filters_http_rbac_v3_RBAC *ret = envoy_extensions_filters_http_rbac_v3_RBAC_new(arena);
49
+ if (!ret) return NULL;
50
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, extreg, options, arena)) {
51
+ return NULL;
52
+ }
53
+ return ret;
54
+ }
55
+ UPB_INLINE char *envoy_extensions_filters_http_rbac_v3_RBAC_serialize(const envoy_extensions_filters_http_rbac_v3_RBAC *msg, upb_arena *arena, size_t *len) {
56
+ return upb_encode(msg, &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, arena, len);
57
+ }
58
+
59
+ UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBAC_has_rules(const envoy_extensions_filters_http_rbac_v3_RBAC *msg) { return _upb_hasbit(msg, 1); }
60
+ UPB_INLINE const struct envoy_config_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_rules(const envoy_extensions_filters_http_rbac_v3_RBAC *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_rbac_v3_RBAC*); }
61
+ UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBAC_has_shadow_rules(const envoy_extensions_filters_http_rbac_v3_RBAC *msg) { return _upb_hasbit(msg, 2); }
62
+ UPB_INLINE const struct envoy_config_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_shadow_rules(const envoy_extensions_filters_http_rbac_v3_RBAC *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_rbac_v3_RBAC*); }
63
+ UPB_INLINE upb_strview envoy_extensions_filters_http_rbac_v3_RBAC_shadow_rules_stat_prefix(const envoy_extensions_filters_http_rbac_v3_RBAC *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
64
+
65
+ UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_set_rules(envoy_extensions_filters_http_rbac_v3_RBAC *msg, struct envoy_config_rbac_v3_RBAC* value) {
66
+ _upb_sethas(msg, 1);
67
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_rbac_v3_RBAC*) = value;
68
+ }
69
+ UPB_INLINE struct envoy_config_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_mutable_rules(envoy_extensions_filters_http_rbac_v3_RBAC *msg, upb_arena *arena) {
70
+ struct envoy_config_rbac_v3_RBAC* sub = (struct envoy_config_rbac_v3_RBAC*)envoy_extensions_filters_http_rbac_v3_RBAC_rules(msg);
71
+ if (sub == NULL) {
72
+ sub = (struct envoy_config_rbac_v3_RBAC*)_upb_msg_new(&envoy_config_rbac_v3_RBAC_msginit, arena);
73
+ if (!sub) return NULL;
74
+ envoy_extensions_filters_http_rbac_v3_RBAC_set_rules(msg, sub);
75
+ }
76
+ return sub;
77
+ }
78
+ UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_set_shadow_rules(envoy_extensions_filters_http_rbac_v3_RBAC *msg, struct envoy_config_rbac_v3_RBAC* value) {
79
+ _upb_sethas(msg, 2);
80
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_rbac_v3_RBAC*) = value;
81
+ }
82
+ UPB_INLINE struct envoy_config_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_mutable_shadow_rules(envoy_extensions_filters_http_rbac_v3_RBAC *msg, upb_arena *arena) {
83
+ struct envoy_config_rbac_v3_RBAC* sub = (struct envoy_config_rbac_v3_RBAC*)envoy_extensions_filters_http_rbac_v3_RBAC_shadow_rules(msg);
84
+ if (sub == NULL) {
85
+ sub = (struct envoy_config_rbac_v3_RBAC*)_upb_msg_new(&envoy_config_rbac_v3_RBAC_msginit, arena);
86
+ if (!sub) return NULL;
87
+ envoy_extensions_filters_http_rbac_v3_RBAC_set_shadow_rules(msg, sub);
88
+ }
89
+ return sub;
90
+ }
91
+ UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_set_shadow_rules_stat_prefix(envoy_extensions_filters_http_rbac_v3_RBAC *msg, upb_strview value) {
92
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
93
+ }
94
+
95
+ /* envoy.extensions.filters.http.rbac.v3.RBACPerRoute */
96
+
97
+ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBACPerRoute *envoy_extensions_filters_http_rbac_v3_RBACPerRoute_new(upb_arena *arena) {
98
+ return (envoy_extensions_filters_http_rbac_v3_RBACPerRoute *)_upb_msg_new(&envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, arena);
99
+ }
100
+ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBACPerRoute *envoy_extensions_filters_http_rbac_v3_RBACPerRoute_parse(const char *buf, size_t size,
101
+ upb_arena *arena) {
102
+ envoy_extensions_filters_http_rbac_v3_RBACPerRoute *ret = envoy_extensions_filters_http_rbac_v3_RBACPerRoute_new(arena);
103
+ if (!ret) return NULL;
104
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, arena)) return NULL;
105
+ return ret;
106
+ }
107
+ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBACPerRoute *envoy_extensions_filters_http_rbac_v3_RBACPerRoute_parse_ex(const char *buf, size_t size,
108
+ const upb_extreg *extreg, int options,
109
+ upb_arena *arena) {
110
+ envoy_extensions_filters_http_rbac_v3_RBACPerRoute *ret = envoy_extensions_filters_http_rbac_v3_RBACPerRoute_new(arena);
111
+ if (!ret) return NULL;
112
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, extreg, options, arena)) {
113
+ return NULL;
114
+ }
115
+ return ret;
116
+ }
117
+ UPB_INLINE char *envoy_extensions_filters_http_rbac_v3_RBACPerRoute_serialize(const envoy_extensions_filters_http_rbac_v3_RBACPerRoute *msg, upb_arena *arena, size_t *len) {
118
+ return upb_encode(msg, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, arena, len);
119
+ }
120
+
121
+ UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBACPerRoute_has_rbac(const envoy_extensions_filters_http_rbac_v3_RBACPerRoute *msg) { return _upb_hasbit(msg, 1); }
122
+ UPB_INLINE const envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBACPerRoute_rbac(const envoy_extensions_filters_http_rbac_v3_RBACPerRoute *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_extensions_filters_http_rbac_v3_RBAC*); }
123
+
124
+ UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBACPerRoute_set_rbac(envoy_extensions_filters_http_rbac_v3_RBACPerRoute *msg, envoy_extensions_filters_http_rbac_v3_RBAC* value) {
125
+ _upb_sethas(msg, 1);
126
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_extensions_filters_http_rbac_v3_RBAC*) = value;
127
+ }
128
+ UPB_INLINE struct envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBACPerRoute_mutable_rbac(envoy_extensions_filters_http_rbac_v3_RBACPerRoute *msg, upb_arena *arena) {
129
+ struct envoy_extensions_filters_http_rbac_v3_RBAC* sub = (struct envoy_extensions_filters_http_rbac_v3_RBAC*)envoy_extensions_filters_http_rbac_v3_RBACPerRoute_rbac(msg);
130
+ if (sub == NULL) {
131
+ sub = (struct envoy_extensions_filters_http_rbac_v3_RBAC*)_upb_msg_new(&envoy_extensions_filters_http_rbac_v3_RBAC_msginit, arena);
132
+ if (!sub) return NULL;
133
+ envoy_extensions_filters_http_rbac_v3_RBACPerRoute_set_rbac(msg, sub);
134
+ }
135
+ return sub;
136
+ }
137
+
138
+ extern const upb_msglayout_file envoy_extensions_filters_http_rbac_v3_rbac_proto_upb_file_layout;
139
+
140
+ #ifdef __cplusplus
141
+ } /* extern "C" */
142
+ #endif
143
+
144
+ #include "upb/port_undef.inc"
145
+
146
+ #endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPB_H_ */