grpc 1.26.0 → 1.28.0

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 (829) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +1699 -1482
  3. data/etc/roots.pem +44 -0
  4. data/include/grpc/grpc_security.h +37 -15
  5. data/include/grpc/grpc_security_constants.h +27 -0
  6. data/include/grpc/impl/codegen/grpc_types.h +19 -0
  7. data/include/grpc/impl/codegen/port_platform.h +8 -1
  8. data/include/grpc/impl/codegen/sync.h +5 -3
  9. data/include/grpc/impl/codegen/sync_abseil.h +36 -0
  10. data/include/grpc/module.modulemap +3 -0
  11. data/{src/core/lib/json/json_common.h → include/grpc/support/sync_abseil.h} +7 -15
  12. data/src/core/ext/filters/client_channel/client_channel.cc +74 -32
  13. data/src/core/ext/filters/client_channel/client_channel_channelz.cc +31 -47
  14. data/src/core/ext/filters/client_channel/client_channel_channelz.h +1 -3
  15. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +1 -1
  16. data/src/core/ext/filters/client_channel/http_proxy.cc +8 -5
  17. data/src/core/ext/filters/client_channel/lb_policy.cc +4 -3
  18. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +291 -0
  19. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +83 -0
  20. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +224 -367
  21. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +88 -121
  22. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +28 -57
  23. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +18 -21
  24. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +9 -13
  25. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +85 -83
  26. data/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +623 -767
  27. data/src/core/ext/filters/client_channel/lb_policy_factory.h +3 -3
  28. data/src/core/ext/filters/client_channel/lb_policy_registry.cc +43 -75
  29. data/src/core/ext/filters/client_channel/lb_policy_registry.h +1 -1
  30. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +57 -70
  31. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +1 -1
  32. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +1 -1
  33. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +1 -1
  34. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +3 -3
  35. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +2 -2
  36. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +1 -1
  37. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +3 -3
  38. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +31 -7
  39. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +228 -286
  40. data/src/core/ext/filters/client_channel/resolver_result_parsing.h +2 -2
  41. data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +37 -176
  42. data/src/core/ext/filters/client_channel/resolving_lb_policy.h +7 -11
  43. data/src/core/ext/filters/client_channel/service_config.cc +91 -160
  44. data/src/core/ext/filters/client_channel/service_config.h +14 -21
  45. data/src/core/ext/filters/client_channel/xds/xds_api.cc +1426 -229
  46. data/src/core/ext/filters/client_channel/xds/xds_api.h +214 -115
  47. data/src/core/ext/filters/client_channel/xds/xds_bootstrap.cc +236 -339
  48. data/src/core/ext/filters/client_channel/xds/xds_bootstrap.h +32 -45
  49. data/src/core/ext/filters/client_channel/xds/xds_channel.h +3 -1
  50. data/src/core/ext/filters/client_channel/xds/xds_channel_secure.cc +14 -9
  51. data/src/core/ext/filters/client_channel/xds/xds_client.cc +986 -252
  52. data/src/core/ext/filters/client_channel/xds/xds_client.h +84 -36
  53. data/src/core/ext/filters/client_channel/xds/xds_client_stats.cc +53 -131
  54. data/src/core/ext/filters/client_channel/xds/xds_client_stats.h +119 -152
  55. data/src/core/ext/filters/message_size/message_size_filter.cc +32 -35
  56. data/src/core/ext/filters/message_size/message_size_filter.h +1 -1
  57. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +3 -6
  58. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +6 -8
  59. data/src/core/ext/transport/chttp2/transport/writing.cc +1 -1
  60. data/src/core/ext/transport/inproc/inproc_transport.cc +22 -42
  61. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +17 -0
  62. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +30 -0
  63. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +27 -0
  64. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +54 -0
  65. data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c +46 -21
  66. data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h +116 -29
  67. data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.c +4 -362
  68. data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h +14 -1337
  69. data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.c +390 -0
  70. data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.h +1411 -0
  71. data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c +29 -8
  72. data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h +60 -0
  73. data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c +1 -0
  74. data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c +1 -0
  75. data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c +5 -3
  76. data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h +6 -2
  77. data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c +48 -5
  78. data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h +154 -4
  79. data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c +19 -15
  80. data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h +46 -32
  81. data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c +26 -4
  82. data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h +70 -0
  83. data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c +42 -25
  84. data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h +83 -25
  85. data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c +1 -0
  86. data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c +43 -7
  87. data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h +115 -0
  88. data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c +1 -0
  89. data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.c +7 -68
  90. data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.h +14 -201
  91. data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.c +91 -0
  92. data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.h +240 -0
  93. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c +1 -71
  94. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h +3 -228
  95. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.c +88 -0
  96. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.h +258 -0
  97. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c +1 -0
  98. data/src/core/ext/upb-generated/envoy/api/v2/lds.upb.c +30 -0
  99. data/src/core/ext/upb-generated/envoy/api/v2/lds.upb.h +53 -0
  100. data/src/core/ext/upb-generated/envoy/api/v2/listener.upb.c +104 -0
  101. data/src/core/ext/upb-generated/envoy/api/v2/listener.upb.h +383 -0
  102. data/src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.c +17 -0
  103. data/src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.h +33 -0
  104. data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.c +144 -0
  105. data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.h +527 -0
  106. data/src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.c +42 -0
  107. data/src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.h +112 -0
  108. data/src/core/ext/upb-generated/envoy/api/v2/rds.upb.c +29 -0
  109. data/src/core/ext/upb-generated/envoy/api/v2/rds.upb.h +53 -0
  110. data/src/core/ext/upb-generated/envoy/api/v2/route.upb.c +62 -0
  111. data/src/core/ext/upb-generated/envoy/api/v2/route.upb.h +199 -0
  112. data/src/core/ext/upb-generated/envoy/api/v2/route/route.upb.c +17 -0
  113. data/src/core/ext/upb-generated/envoy/api/v2/route/route.upb.h +33 -0
  114. data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.c +793 -0
  115. data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.h +2936 -0
  116. data/src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.c +58 -0
  117. data/src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.h +134 -0
  118. data/src/core/ext/upb-generated/envoy/api/v2/srds.upb.c +27 -0
  119. data/src/core/ext/upb-generated/envoy/api/v2/srds.upb.h +53 -0
  120. data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.c +227 -0
  121. data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.h +725 -0
  122. data/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.c +296 -0
  123. data/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.h +1072 -0
  124. data/src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.c +32 -0
  125. data/src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.h +65 -0
  126. data/src/core/ext/upb-generated/envoy/type/matcher/regex.upb.c +47 -0
  127. data/src/core/ext/upb-generated/envoy/type/matcher/regex.upb.h +108 -0
  128. data/src/core/ext/upb-generated/envoy/type/matcher/string.upb.c +52 -0
  129. data/src/core/ext/upb-generated/envoy/type/matcher/string.upb.h +133 -0
  130. data/src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.c +87 -0
  131. data/src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.h +258 -0
  132. data/src/core/ext/upb-generated/envoy/type/range.upb.c +11 -0
  133. data/src/core/ext/upb-generated/envoy/type/range.upb.h +27 -0
  134. data/src/core/ext/upb-generated/envoy/type/semantic_version.upb.c +28 -0
  135. data/src/core/ext/upb-generated/envoy/type/semantic_version.upb.h +62 -0
  136. data/src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.c +88 -0
  137. data/src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.h +249 -0
  138. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +30 -27
  139. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +64 -52
  140. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +13 -5
  141. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +34 -0
  142. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +48 -0
  143. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +104 -0
  144. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +17 -0
  145. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +30 -0
  146. data/src/core/ext/upb-generated/validate/validate.upb.c +38 -34
  147. data/src/core/ext/upb-generated/validate/validate.upb.h +129 -99
  148. data/src/core/lib/channel/channel_trace.cc +32 -41
  149. data/src/core/lib/channel/channel_trace.h +3 -3
  150. data/src/core/lib/channel/channelz.cc +158 -248
  151. data/src/core/lib/channel/channelz.h +17 -10
  152. data/src/core/lib/channel/channelz_registry.cc +47 -74
  153. data/src/core/lib/channel/channelz_registry.h +4 -4
  154. data/src/core/lib/gpr/sync_abseil.cc +114 -0
  155. data/src/core/lib/gpr/sync_posix.cc +8 -5
  156. data/src/core/lib/gpr/sync_windows.cc +4 -2
  157. data/src/core/lib/gpr/time_precise.cc +1 -1
  158. data/src/core/lib/gprpp/host_port.cc +1 -1
  159. data/src/core/lib/gprpp/inlined_vector.h +1 -210
  160. data/src/core/lib/gprpp/memory.h +2 -6
  161. data/src/core/lib/gprpp/optional.h +6 -21
  162. data/src/core/lib/gprpp/string_view.h +5 -110
  163. data/src/core/lib/gprpp/sync.h +9 -0
  164. data/src/core/lib/iomgr/buffer_list.cc +36 -35
  165. data/src/core/lib/iomgr/error.h +4 -4
  166. data/src/core/lib/iomgr/ev_epollex_linux.cc +12 -4
  167. data/src/core/lib/iomgr/executor.cc +1 -1
  168. data/src/core/lib/iomgr/fork_posix.cc +4 -0
  169. data/src/core/lib/iomgr/load_file.cc +1 -0
  170. data/src/core/lib/iomgr/poller/eventmanager_libuv.cc +87 -0
  171. data/src/core/lib/iomgr/poller/eventmanager_libuv.h +88 -0
  172. data/src/core/lib/iomgr/socket_utils_common_posix.cc +14 -0
  173. data/src/core/lib/iomgr/socket_utils_posix.h +12 -0
  174. data/src/core/lib/iomgr/tcp_client_posix.cc +17 -17
  175. data/src/core/lib/iomgr/tcp_client_posix.h +6 -6
  176. data/src/core/lib/iomgr/tcp_custom.h +3 -0
  177. data/src/core/lib/iomgr/tcp_posix.cc +608 -56
  178. data/src/core/lib/iomgr/tcp_server_custom.cc +15 -2
  179. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +8 -0
  180. data/src/core/lib/iomgr/work_serializer.cc +155 -0
  181. data/src/core/lib/iomgr/work_serializer.h +65 -0
  182. data/src/core/lib/json/json.h +208 -68
  183. data/src/core/lib/json/json_reader.cc +511 -319
  184. data/src/core/lib/json/json_writer.cc +201 -110
  185. data/src/core/lib/security/credentials/alts/check_gcp_environment.cc +1 -1
  186. data/src/core/lib/security/credentials/composite/composite_credentials.cc +7 -0
  187. data/src/core/lib/security/credentials/composite/composite_credentials.h +5 -1
  188. data/src/core/lib/security/credentials/credentials.h +10 -1
  189. data/src/core/lib/security/credentials/fake/fake_credentials.h +2 -1
  190. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +10 -8
  191. data/src/core/lib/security/credentials/jwt/json_token.cc +26 -56
  192. data/src/core/lib/security/credentials/jwt/json_token.h +2 -1
  193. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +8 -18
  194. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +149 -159
  195. data/src/core/lib/security/credentials/jwt/jwt_verifier.h +2 -3
  196. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +38 -35
  197. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +1 -1
  198. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +6 -4
  199. data/src/core/lib/security/credentials/plugin/plugin_credentials.h +2 -1
  200. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +20 -0
  201. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +9 -0
  202. data/src/core/lib/security/credentials/tls/{spiffe_credentials.cc → tls_credentials.cc} +23 -24
  203. data/src/core/lib/security/credentials/tls/{spiffe_credentials.h → tls_credentials.h} +9 -9
  204. data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +13 -0
  205. data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +22 -2
  206. data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +2 -2
  207. data/src/core/lib/security/security_connector/load_system_roots_linux.cc +2 -2
  208. data/src/core/lib/security/security_connector/local/local_security_connector.cc +31 -6
  209. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +3 -15
  210. data/src/core/lib/security/security_connector/ssl_utils.cc +48 -4
  211. data/src/core/lib/security/security_connector/ssl_utils.h +12 -1
  212. data/src/core/lib/security/security_connector/tls/{spiffe_security_connector.cc → tls_security_connector.cc} +106 -70
  213. data/src/core/lib/security/security_connector/tls/{spiffe_security_connector.h → tls_security_connector.h} +22 -19
  214. data/src/core/lib/security/transport/client_auth_filter.cc +33 -0
  215. data/src/core/lib/security/transport/security_handshaker.cc +2 -2
  216. data/src/core/lib/security/util/json_util.cc +22 -15
  217. data/src/core/lib/security/util/json_util.h +2 -2
  218. data/src/core/lib/surface/completion_queue.cc +22 -1
  219. data/src/core/lib/surface/version.cc +1 -1
  220. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +1 -1
  221. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +12 -2
  222. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +1 -1
  223. data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +3 -3
  224. data/src/core/tsi/fake_transport_security.cc +7 -3
  225. data/src/core/tsi/fake_transport_security.h +2 -0
  226. data/src/core/tsi/grpc_shadow_boringssl.h +1333 -1319
  227. data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +1 -1
  228. data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +1 -1
  229. data/src/core/tsi/ssl_transport_security.cc +145 -8
  230. data/src/core/tsi/ssl_transport_security.h +15 -1
  231. data/src/core/tsi/transport_security.cc +13 -0
  232. data/src/core/tsi/transport_security_grpc.cc +2 -2
  233. data/src/core/tsi/transport_security_grpc.h +2 -2
  234. data/src/core/tsi/transport_security_interface.h +12 -0
  235. data/src/ruby/bin/math_pb.rb +5 -5
  236. data/src/ruby/ext/grpc/rb_call_credentials.c +4 -1
  237. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +2 -0
  238. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +4 -1
  239. data/src/ruby/lib/grpc/version.rb +1 -1
  240. data/src/ruby/pb/grpc/health/v1/health_pb.rb +3 -3
  241. data/src/ruby/pb/src/proto/grpc/testing/empty_pb.rb +1 -1
  242. data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +23 -13
  243. data/third_party/abseil-cpp/absl/algorithm/algorithm.h +159 -0
  244. data/third_party/abseil-cpp/absl/base/attributes.h +621 -0
  245. data/third_party/abseil-cpp/absl/base/call_once.h +226 -0
  246. data/third_party/abseil-cpp/absl/base/casts.h +184 -0
  247. data/third_party/abseil-cpp/absl/base/config.h +671 -0
  248. data/third_party/abseil-cpp/absl/base/const_init.h +76 -0
  249. data/third_party/abseil-cpp/absl/base/dynamic_annotations.cc +129 -0
  250. data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +389 -0
  251. data/third_party/abseil-cpp/absl/base/internal/atomic_hook.h +200 -0
  252. data/third_party/abseil-cpp/absl/base/internal/bits.h +218 -0
  253. data/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +107 -0
  254. data/third_party/abseil-cpp/absl/base/internal/cycleclock.h +94 -0
  255. data/third_party/abseil-cpp/absl/base/internal/endian.h +266 -0
  256. data/third_party/abseil-cpp/absl/base/internal/errno_saver.h +43 -0
  257. data/third_party/abseil-cpp/absl/base/internal/hide_ptr.h +51 -0
  258. data/third_party/abseil-cpp/absl/base/internal/identity.h +37 -0
  259. data/third_party/abseil-cpp/absl/base/internal/inline_variable.h +107 -0
  260. data/third_party/abseil-cpp/absl/base/internal/invoke.h +187 -0
  261. data/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h +107 -0
  262. data/third_party/abseil-cpp/absl/base/internal/per_thread_tls.h +52 -0
  263. data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +240 -0
  264. data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +183 -0
  265. data/third_party/abseil-cpp/absl/base/internal/scheduling_mode.h +58 -0
  266. data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +233 -0
  267. data/third_party/abseil-cpp/absl/base/internal/spinlock.h +243 -0
  268. data/third_party/abseil-cpp/absl/base/internal/spinlock_akaros.inc +35 -0
  269. data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +66 -0
  270. data/third_party/abseil-cpp/absl/base/internal/spinlock_posix.inc +46 -0
  271. data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.cc +81 -0
  272. data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h +93 -0
  273. data/third_party/abseil-cpp/absl/base/internal/spinlock_win32.inc +37 -0
  274. data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +416 -0
  275. data/third_party/abseil-cpp/absl/base/internal/sysinfo.h +66 -0
  276. data/third_party/abseil-cpp/absl/base/internal/thread_annotations.h +271 -0
  277. data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +152 -0
  278. data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +259 -0
  279. data/third_party/abseil-cpp/absl/base/internal/throw_delegate.cc +108 -0
  280. data/third_party/abseil-cpp/absl/base/internal/throw_delegate.h +75 -0
  281. data/third_party/abseil-cpp/absl/base/internal/tsan_mutex_interface.h +66 -0
  282. data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +158 -0
  283. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +140 -0
  284. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +124 -0
  285. data/third_party/abseil-cpp/absl/base/log_severity.cc +27 -0
  286. data/third_party/abseil-cpp/absl/base/log_severity.h +121 -0
  287. data/third_party/abseil-cpp/absl/base/macros.h +220 -0
  288. data/third_party/abseil-cpp/absl/base/optimization.h +181 -0
  289. data/third_party/abseil-cpp/absl/base/options.h +211 -0
  290. data/third_party/abseil-cpp/absl/base/policy_checks.h +111 -0
  291. data/third_party/abseil-cpp/absl/base/port.h +26 -0
  292. data/third_party/abseil-cpp/absl/base/thread_annotations.h +280 -0
  293. data/third_party/abseil-cpp/absl/container/inlined_vector.h +848 -0
  294. data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +265 -0
  295. data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +892 -0
  296. data/third_party/abseil-cpp/absl/memory/memory.h +695 -0
  297. data/third_party/abseil-cpp/absl/meta/type_traits.h +759 -0
  298. data/third_party/abseil-cpp/absl/numeric/int128.cc +404 -0
  299. data/third_party/abseil-cpp/absl/numeric/int128.h +1091 -0
  300. data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +302 -0
  301. data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +308 -0
  302. data/third_party/abseil-cpp/absl/strings/ascii.cc +200 -0
  303. data/third_party/abseil-cpp/absl/strings/ascii.h +242 -0
  304. data/third_party/abseil-cpp/absl/strings/charconv.cc +984 -0
  305. data/third_party/abseil-cpp/absl/strings/charconv.h +119 -0
  306. data/third_party/abseil-cpp/absl/strings/escaping.cc +949 -0
  307. data/third_party/abseil-cpp/absl/strings/escaping.h +164 -0
  308. data/third_party/abseil-cpp/absl/strings/internal/char_map.h +156 -0
  309. data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +359 -0
  310. data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.h +423 -0
  311. data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +504 -0
  312. data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.h +99 -0
  313. data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +180 -0
  314. data/third_party/abseil-cpp/absl/strings/internal/escaping.h +58 -0
  315. data/third_party/abseil-cpp/absl/strings/internal/memutil.cc +112 -0
  316. data/third_party/abseil-cpp/absl/strings/internal/memutil.h +148 -0
  317. data/third_party/abseil-cpp/absl/strings/internal/ostringstream.cc +36 -0
  318. data/third_party/abseil-cpp/absl/strings/internal/ostringstream.h +89 -0
  319. data/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h +73 -0
  320. data/third_party/abseil-cpp/absl/strings/internal/stl_type_traits.h +248 -0
  321. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +388 -0
  322. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +432 -0
  323. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +245 -0
  324. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +209 -0
  325. data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +326 -0
  326. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +51 -0
  327. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +415 -0
  328. data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +493 -0
  329. data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.h +23 -0
  330. data/third_party/abseil-cpp/absl/strings/internal/str_format/output.cc +72 -0
  331. data/third_party/abseil-cpp/absl/strings/internal/str_format/output.h +104 -0
  332. data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +334 -0
  333. data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +333 -0
  334. data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +314 -0
  335. data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +455 -0
  336. data/third_party/abseil-cpp/absl/strings/internal/utf8.cc +53 -0
  337. data/third_party/abseil-cpp/absl/strings/internal/utf8.h +50 -0
  338. data/third_party/abseil-cpp/absl/strings/match.cc +40 -0
  339. data/third_party/abseil-cpp/absl/strings/match.h +90 -0
  340. data/third_party/abseil-cpp/absl/strings/numbers.cc +965 -0
  341. data/third_party/abseil-cpp/absl/strings/numbers.h +266 -0
  342. data/third_party/abseil-cpp/absl/strings/str_cat.cc +246 -0
  343. data/third_party/abseil-cpp/absl/strings/str_cat.h +408 -0
  344. data/third_party/abseil-cpp/absl/strings/str_format.h +537 -0
  345. data/third_party/abseil-cpp/absl/strings/str_join.h +293 -0
  346. data/third_party/abseil-cpp/absl/strings/str_replace.cc +82 -0
  347. data/third_party/abseil-cpp/absl/strings/str_replace.h +219 -0
  348. data/third_party/abseil-cpp/absl/strings/str_split.cc +139 -0
  349. data/third_party/abseil-cpp/absl/strings/str_split.h +513 -0
  350. data/third_party/abseil-cpp/absl/strings/string_view.cc +235 -0
  351. data/third_party/abseil-cpp/absl/strings/string_view.h +622 -0
  352. data/third_party/abseil-cpp/absl/strings/strip.h +91 -0
  353. data/third_party/abseil-cpp/absl/strings/substitute.cc +171 -0
  354. data/third_party/abseil-cpp/absl/strings/substitute.h +693 -0
  355. data/third_party/abseil-cpp/absl/types/bad_optional_access.cc +48 -0
  356. data/third_party/abseil-cpp/absl/types/bad_optional_access.h +78 -0
  357. data/third_party/abseil-cpp/absl/types/internal/optional.h +396 -0
  358. data/third_party/abseil-cpp/absl/types/internal/span.h +128 -0
  359. data/third_party/abseil-cpp/absl/types/optional.h +776 -0
  360. data/third_party/abseil-cpp/absl/types/span.h +713 -0
  361. data/third_party/abseil-cpp/absl/utility/utility.h +350 -0
  362. data/{src/boringssl → third_party/boringssl-with-bazel}/err_data.c +0 -0
  363. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_bitstr.c +0 -0
  364. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_bool.c +0 -0
  365. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_d2i_fp.c +0 -0
  366. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_dup.c +0 -0
  367. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_enum.c +0 -0
  368. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_gentm.c +0 -0
  369. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_i2d_fp.c +0 -0
  370. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_int.c +0 -0
  371. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_mbstr.c +0 -0
  372. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_object.c +0 -0
  373. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_octet.c +0 -0
  374. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_print.c +0 -0
  375. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_strnid.c +0 -0
  376. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_time.c +3 -4
  377. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_type.c +0 -0
  378. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_utctm.c +0 -0
  379. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_utf8.c +0 -0
  380. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/asn1_lib.c +0 -0
  381. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/asn1_locl.h +0 -0
  382. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/asn1_par.c +0 -0
  383. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/asn_pack.c +0 -0
  384. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/f_enum.c +0 -0
  385. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/f_int.c +0 -0
  386. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/f_string.c +0 -0
  387. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_dec.c +0 -0
  388. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_enc.c +0 -0
  389. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_fre.c +0 -0
  390. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_new.c +0 -0
  391. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_typ.c +0 -0
  392. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_utl.c +0 -0
  393. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/time_support.c +0 -0
  394. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/base64/base64.c +0 -0
  395. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/bio.c +0 -0
  396. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/bio_mem.c +0 -0
  397. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/connect.c +3 -4
  398. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/fd.c +0 -1
  399. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/file.c +5 -6
  400. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/hexdump.c +0 -0
  401. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/internal.h +0 -0
  402. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/pair.c +0 -1
  403. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/printf.c +0 -0
  404. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/socket.c +0 -0
  405. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/socket_helper.c +0 -0
  406. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bn_extra/bn_asn1.c +0 -0
  407. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bn_extra/convert.c +0 -0
  408. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/buf/buf.c +10 -69
  409. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/asn1_compat.c +0 -0
  410. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/ber.c +0 -0
  411. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/cbb.c +41 -2
  412. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/cbs.c +60 -3
  413. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/internal.h +0 -0
  414. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/unicode.c +0 -0
  415. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/chacha/chacha.c +0 -0
  416. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/chacha/internal.h +0 -0
  417. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/cipher_extra.c +0 -0
  418. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/derive_key.c +0 -0
  419. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_aesccm.c +0 -0
  420. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_aesctrhmac.c +0 -0
  421. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_aesgcmsiv.c +8 -0
  422. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_chacha20poly1305.c +0 -0
  423. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_null.c +0 -0
  424. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_rc2.c +0 -0
  425. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_rc4.c +0 -0
  426. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_tls.c +0 -0
  427. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/internal.h +0 -0
  428. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/tls_cbc.c +0 -0
  429. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cmac/cmac.c +0 -0
  430. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/conf/conf.c +0 -0
  431. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/conf/conf_def.h +0 -0
  432. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/conf/internal.h +0 -0
  433. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-aarch64-fuchsia.c +0 -0
  434. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-aarch64-linux.c +0 -0
  435. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-arm-linux.c +0 -1
  436. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-arm-linux.h +0 -0
  437. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-arm.c +0 -0
  438. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-intel.c +0 -0
  439. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-ppc64le.c +0 -0
  440. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/crypto.c +0 -0
  441. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/curve25519/spake25519.c +0 -0
  442. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dh/check.c +3 -3
  443. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dh/dh.c +1 -2
  444. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dh/dh_asn1.c +0 -0
  445. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dh/params.c +0 -0
  446. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/digest_extra/digest_extra.c +0 -0
  447. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dsa/dsa.c +0 -0
  448. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dsa/dsa_asn1.c +0 -0
  449. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ec_extra/ec_asn1.c +0 -0
  450. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ec_extra/ec_derive.c +2 -3
  451. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ecdh_extra/ecdh_extra.c +0 -0
  452. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ecdsa_extra/ecdsa_asn1.c +0 -0
  453. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/engine/engine.c +0 -0
  454. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/err/err.c +6 -6
  455. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/err/internal.h +0 -0
  456. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/digestsign.c +0 -0
  457. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/evp.c +0 -0
  458. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/evp_asn1.c +0 -0
  459. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/evp_ctx.c +0 -0
  460. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/internal.h +0 -0
  461. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_dsa_asn1.c +0 -0
  462. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_ec.c +0 -1
  463. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_ec_asn1.c +0 -0
  464. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_ed25519.c +0 -0
  465. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_ed25519_asn1.c +0 -0
  466. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_rsa.c +14 -2
  467. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_rsa_asn1.c +0 -0
  468. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_x25519.c +0 -0
  469. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_x25519_asn1.c +1 -2
  470. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/pbkdf.c +0 -0
  471. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/print.c +0 -0
  472. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/scrypt.c +0 -0
  473. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/sign.c +0 -0
  474. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ex_data.c +0 -0
  475. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/aes.c +108 -0
  476. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/aes_nohw.c +1282 -0
  477. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/aes/internal.h +5 -7
  478. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/aes/key_wrap.c +0 -0
  479. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/aes/mode_wrappers.c +0 -2
  480. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bcm.c +2 -0
  481. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/add.c +0 -0
  482. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/asm/x86_64-gcc.c +0 -0
  483. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/bn.c +0 -0
  484. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/bytes.c +0 -0
  485. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/cmp.c +0 -0
  486. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/ctx.c +0 -0
  487. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/div.c +0 -0
  488. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/div_extra.c +0 -0
  489. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/exponentiation.c +0 -0
  490. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/gcd.c +0 -0
  491. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/gcd_extra.c +0 -0
  492. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/generic.c +0 -0
  493. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/internal.h +0 -0
  494. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/jacobi.c +0 -0
  495. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/montgomery.c +0 -0
  496. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/montgomery_inv.c +0 -0
  497. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/mul.c +0 -0
  498. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/prime.c +11 -12
  499. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/random.c +0 -0
  500. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/rsaz_exp.c +0 -0
  501. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/rsaz_exp.h +0 -0
  502. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/shift.c +0 -0
  503. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/sqrt.c +0 -0
  504. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/aead.c +0 -0
  505. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/cipher.c +0 -0
  506. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/e_aes.c +3 -5
  507. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/e_des.c +0 -0
  508. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/internal.h +0 -0
  509. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/delocate.h +0 -0
  510. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/des/des.c +0 -0
  511. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/des/internal.h +0 -0
  512. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/digest/digest.c +0 -0
  513. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/digest/digests.c +0 -0
  514. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/digest/internal.h +0 -0
  515. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/digest/md32_common.h +0 -0
  516. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/ec.c +0 -0
  517. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/ec_key.c +1 -1
  518. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/ec_montgomery.c +0 -0
  519. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/felem.c +0 -0
  520. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/internal.h +0 -0
  521. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/oct.c +0 -0
  522. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/p224-64.c +0 -0
  523. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/p256-x86_64-table.h +0 -0
  524. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/p256-x86_64.c +0 -0
  525. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/p256-x86_64.h +0 -0
  526. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/scalar.c +0 -0
  527. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/simple.c +0 -0
  528. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/simple_mul.c +0 -0
  529. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/util.c +0 -0
  530. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/wnaf.c +0 -0
  531. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ecdh/ecdh.c +0 -0
  532. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ecdsa/ecdsa.c +0 -0
  533. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/fips_shared_support.c +0 -0
  534. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/hmac/hmac.c +0 -0
  535. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/is_fips.c +0 -0
  536. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/md4/md4.c +0 -0
  537. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/md5/internal.h +0 -0
  538. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/md5/md5.c +0 -0
  539. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/cbc.c +0 -0
  540. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/cfb.c +0 -0
  541. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/ctr.c +0 -0
  542. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/gcm.c +45 -193
  543. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm_nohw.c +304 -0
  544. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/internal.h +8 -18
  545. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/ofb.c +0 -0
  546. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/polyval.c +0 -0
  547. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rand/ctrdrbg.c +0 -0
  548. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rand/internal.h +0 -0
  549. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rand/rand.c +0 -0
  550. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rand/urandom.c +0 -0
  551. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/blinding.c +0 -0
  552. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/internal.h +0 -0
  553. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/padding.c +0 -0
  554. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/rsa.c +7 -1
  555. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/rsa_impl.c +60 -51
  556. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/self_check/self_check.c +0 -0
  557. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/internal.h +0 -0
  558. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/sha1-altivec.c +0 -0
  559. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/sha1.c +0 -0
  560. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/sha256.c +0 -0
  561. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/sha512.c +0 -0
  562. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/tls/internal.h +0 -0
  563. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/tls/kdf.c +0 -0
  564. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/hkdf/hkdf.c +0 -0
  565. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/hrss/hrss.c +210 -311
  566. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/hrss/internal.h +0 -1
  567. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/internal.h +21 -1
  568. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/lhash/lhash.c +0 -0
  569. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/mem.c +70 -0
  570. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/obj/obj.c +16 -21
  571. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/obj/obj_dat.h +27 -6
  572. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/obj/obj_xref.c +0 -0
  573. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_all.c +0 -0
  574. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_info.c +0 -1
  575. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_lib.c +7 -7
  576. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_oth.c +0 -1
  577. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_pk8.c +0 -1
  578. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_pkey.c +0 -1
  579. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_x509.c +0 -0
  580. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_xaux.c +0 -0
  581. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs7/internal.h +0 -0
  582. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs7/pkcs7.c +0 -0
  583. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs7/pkcs7_x509.c +1 -1
  584. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs8/internal.h +0 -0
  585. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs8/p5_pbev2.c +0 -0
  586. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs8/pkcs8.c +0 -0
  587. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs8/pkcs8_x509.c +0 -0
  588. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/poly1305/internal.h +0 -0
  589. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/poly1305/poly1305.c +2 -2
  590. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/poly1305/poly1305_arm.c +21 -20
  591. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/poly1305/poly1305_vec.c +34 -17
  592. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pool/internal.h +0 -0
  593. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pool/pool.c +1 -2
  594. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/deterministic.c +0 -0
  595. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/forkunsafe.c +0 -0
  596. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/fuchsia.c +0 -0
  597. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/rand_extra.c +0 -0
  598. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/windows.c +0 -0
  599. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rc4/rc4.c +0 -0
  600. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/refcount_c11.c +0 -0
  601. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/refcount_lock.c +0 -0
  602. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rsa_extra/rsa_asn1.c +0 -0
  603. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rsa_extra/rsa_print.c +0 -0
  604. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/siphash/siphash.c +3 -1
  605. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/stack/stack.c +0 -0
  606. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/thread.c +0 -0
  607. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/thread_none.c +0 -0
  608. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/thread_pthread.c +0 -0
  609. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/thread_win.c +0 -0
  610. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/a_digest.c +0 -0
  611. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/a_sign.c +0 -0
  612. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/a_strex.c +0 -0
  613. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/a_verify.c +0 -1
  614. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/algorithm.c +0 -0
  615. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/asn1_gen.c +0 -0
  616. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/by_dir.c +1 -1
  617. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/by_file.c +0 -1
  618. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/charmap.h +0 -0
  619. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/i2d_pr.c +0 -0
  620. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/internal.h +0 -0
  621. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/rsa_pss.c +0 -0
  622. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/t_crl.c +0 -0
  623. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/t_req.c +0 -0
  624. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/t_x509.c +0 -0
  625. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/t_x509a.c +0 -0
  626. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/vpm_int.h +0 -0
  627. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509.c +0 -0
  628. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_att.c +0 -0
  629. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_cmp.c +0 -1
  630. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_d2.c +0 -0
  631. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_def.c +0 -0
  632. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_ext.c +0 -0
  633. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_lu.c +0 -0
  634. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_obj.c +1 -1
  635. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_r2x.c +0 -1
  636. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_req.c +0 -1
  637. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_set.c +0 -0
  638. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_trs.c +1 -2
  639. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_txt.c +0 -0
  640. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_v3.c +0 -0
  641. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_vfy.c +0 -1
  642. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_vpm.c +3 -4
  643. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509cset.c +0 -0
  644. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509name.c +0 -0
  645. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509rset.c +0 -0
  646. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509spki.c +0 -0
  647. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_algor.c +0 -0
  648. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_all.c +0 -1
  649. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_attrib.c +0 -0
  650. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_crl.c +0 -0
  651. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_exten.c +0 -0
  652. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_info.c +0 -0
  653. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_name.c +0 -0
  654. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_pkey.c +0 -0
  655. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_pubkey.c +0 -0
  656. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_req.c +0 -0
  657. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_sig.c +0 -0
  658. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_spki.c +0 -0
  659. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_val.c +0 -0
  660. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_x509.c +0 -0
  661. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_x509a.c +0 -0
  662. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/ext_dat.h +0 -0
  663. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/internal.h +0 -0
  664. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_cache.c +0 -0
  665. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_data.c +0 -0
  666. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_int.h +0 -0
  667. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_lib.c +0 -0
  668. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_map.c +0 -0
  669. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_node.c +0 -0
  670. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_tree.c +0 -0
  671. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_akey.c +0 -0
  672. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_akeya.c +0 -0
  673. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_alt.c +3 -3
  674. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_bcons.c +0 -0
  675. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_bitst.c +0 -0
  676. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_conf.c +0 -0
  677. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_cpols.c +0 -0
  678. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_crld.c +0 -0
  679. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_enum.c +2 -2
  680. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_extku.c +0 -0
  681. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_genn.c +0 -0
  682. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_ia5.c +0 -0
  683. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_info.c +4 -5
  684. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_int.c +0 -0
  685. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_lib.c +0 -0
  686. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_ncons.c +0 -0
  687. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_ocsp.c +0 -0
  688. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pci.c +0 -0
  689. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pcia.c +0 -0
  690. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pcons.c +0 -0
  691. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pku.c +0 -0
  692. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pmaps.c +0 -0
  693. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_prn.c +0 -0
  694. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_purp.c +2 -3
  695. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_skey.c +0 -0
  696. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_sxnet.c +0 -0
  697. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_utl.c +11 -12
  698. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/aead.h +0 -0
  699. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/aes.h +0 -0
  700. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/arm_arch.h +0 -0
  701. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/asn1.h +0 -0
  702. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/asn1_mac.h +0 -0
  703. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/asn1t.h +0 -0
  704. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/base.h +0 -0
  705. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/base64.h +0 -0
  706. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/bio.h +0 -0
  707. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/blowfish.h +0 -0
  708. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/bn.h +32 -20
  709. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/buf.h +9 -9
  710. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/buffer.h +0 -0
  711. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/bytestring.h +34 -0
  712. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/cast.h +0 -0
  713. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/chacha.h +0 -0
  714. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/cipher.h +0 -0
  715. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/cmac.h +0 -0
  716. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/conf.h +0 -0
  717. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/cpu.h +0 -0
  718. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/crypto.h +0 -0
  719. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/curve25519.h +0 -0
  720. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/des.h +0 -0
  721. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/dh.h +0 -0
  722. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/digest.h +0 -0
  723. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/dsa.h +0 -0
  724. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/dtls1.h +0 -0
  725. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/e_os2.h +0 -0
  726. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ec.h +11 -4
  727. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ec_key.h +4 -2
  728. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ecdh.h +0 -0
  729. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ecdsa.h +0 -0
  730. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/engine.h +0 -0
  731. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/err.h +11 -9
  732. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/evp.h +20 -0
  733. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ex_data.h +0 -0
  734. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/hkdf.h +0 -0
  735. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/hmac.h +0 -0
  736. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/hrss.h +0 -0
  737. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/is_boringssl.h +0 -0
  738. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/lhash.h +0 -0
  739. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/md4.h +0 -0
  740. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/md5.h +0 -0
  741. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/mem.h +17 -2
  742. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/nid.h +9 -0
  743. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/obj.h +0 -0
  744. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/obj_mac.h +0 -0
  745. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/objects.h +0 -0
  746. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/opensslconf.h +0 -0
  747. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/opensslv.h +0 -0
  748. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ossl_typ.h +0 -0
  749. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pem.h +0 -0
  750. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pkcs12.h +0 -0
  751. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pkcs7.h +0 -0
  752. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pkcs8.h +0 -0
  753. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/poly1305.h +5 -7
  754. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pool.h +0 -0
  755. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/rand.h +0 -0
  756. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/rc4.h +0 -0
  757. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ripemd.h +0 -0
  758. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/rsa.h +0 -0
  759. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/safestack.h +0 -0
  760. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/sha.h +0 -0
  761. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/siphash.h +0 -0
  762. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/span.h +0 -0
  763. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/srtp.h +0 -0
  764. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ssl.h +10 -20
  765. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ssl3.h +0 -0
  766. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/stack.h +0 -0
  767. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/thread.h +0 -0
  768. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/tls1.h +0 -3
  769. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/type_check.h +0 -0
  770. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/x509.h +0 -0
  771. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/x509_vfy.h +0 -0
  772. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/x509v3.h +0 -0
  773. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/bio_ssl.cc +0 -0
  774. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/d1_both.cc +0 -1
  775. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/d1_lib.cc +0 -0
  776. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/d1_pkt.cc +0 -1
  777. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/d1_srtp.cc +0 -0
  778. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/dtls_method.cc +0 -1
  779. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/dtls_record.cc +0 -0
  780. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/handoff.cc +126 -29
  781. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/handshake.cc +5 -4
  782. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/handshake_client.cc +24 -13
  783. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/handshake_server.cc +1 -5
  784. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/internal.h +32 -26
  785. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/s3_both.cc +0 -0
  786. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/s3_lib.cc +2 -3
  787. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/s3_pkt.cc +0 -1
  788. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_aead_ctx.cc +0 -0
  789. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_asn1.cc +1 -2
  790. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_buffer.cc +34 -15
  791. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_cert.cc +0 -1
  792. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_cipher.cc +0 -1
  793. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_file.cc +0 -0
  794. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_key_share.cc +0 -0
  795. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_lib.cc +13 -14
  796. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_privkey.cc +0 -0
  797. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_session.cc +2 -1
  798. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_stat.cc +0 -0
  799. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_transcript.cc +0 -0
  800. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_versions.cc +1 -1
  801. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_x509.cc +0 -0
  802. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/t1_enc.cc +0 -0
  803. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/t1_lib.cc +11 -171
  804. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls13_both.cc +0 -0
  805. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls13_client.cc +3 -4
  806. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls13_enc.cc +5 -1
  807. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls13_server.cc +78 -101
  808. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls_method.cc +1 -1
  809. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls_record.cc +7 -2
  810. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/curve25519.c +0 -0
  811. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/curve25519_32.h +0 -0
  812. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/curve25519_64.h +0 -0
  813. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/curve25519_tables.h +0 -0
  814. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/internal.h +0 -0
  815. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/p256.c +0 -0
  816. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/p256_32.h +0 -0
  817. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/p256_64.h +0 -0
  818. data/third_party/upb/upb/decode.c +4 -0
  819. data/third_party/upb/upb/port.c +0 -1
  820. data/third_party/upb/upb/port_def.inc +1 -3
  821. data/third_party/upb/upb/table.c +2 -1
  822. metadata +680 -505
  823. data/src/core/lib/iomgr/logical_thread.cc +0 -103
  824. data/src/core/lib/iomgr/logical_thread.h +0 -52
  825. data/src/core/lib/json/json.cc +0 -94
  826. data/src/core/lib/json/json_reader.h +0 -146
  827. data/src/core/lib/json/json_string.cc +0 -367
  828. data/src/core/lib/json/json_writer.h +0 -84
  829. data/third_party/boringssl/crypto/fipsmodule/aes/aes.c +0 -860
@@ -23,6 +23,10 @@
23
23
 
24
24
  #include <stdint.h>
25
25
 
26
+ #include <set>
27
+
28
+ #include "absl/types/optional.h"
29
+
26
30
  #include <grpc/slice_buffer.h>
27
31
 
28
32
  #include "src/core/ext/filters/client_channel/server_address.h"
@@ -31,151 +35,246 @@
31
35
 
32
36
  namespace grpc_core {
33
37
 
34
- class XdsPriorityListUpdate {
38
+ class XdsClient;
39
+
40
+ class XdsApi {
35
41
  public:
36
- struct LocalityMap {
37
- struct Locality {
38
- bool operator==(const Locality& other) const {
39
- return *name == *other.name && serverlist == other.serverlist &&
40
- lb_weight == other.lb_weight && priority == other.priority;
41
- }
42
+ static const char* kLdsTypeUrl;
43
+ static const char* kRdsTypeUrl;
44
+ static const char* kCdsTypeUrl;
45
+ static const char* kEdsTypeUrl;
46
+
47
+ struct RdsUpdate {
48
+ // The name to use in the CDS request.
49
+ std::string cluster_name;
50
+
51
+ bool operator==(const RdsUpdate& other) const {
52
+ return cluster_name == other.cluster_name;
53
+ }
54
+ };
55
+
56
+ // TODO(roth): When we can use absl::variant<>, consider using that
57
+ // here, to enforce the fact that only one of the two fields can be set.
58
+ struct LdsUpdate {
59
+ // The name to use in the RDS request.
60
+ std::string route_config_name;
61
+ // The name to use in the CDS request. Present if the LDS response has it
62
+ // inlined.
63
+ absl::optional<RdsUpdate> rds_update;
64
+
65
+ bool operator==(const LdsUpdate& other) const {
66
+ return route_config_name == other.route_config_name &&
67
+ rds_update == other.rds_update;
68
+ }
69
+ };
70
+
71
+ using LdsUpdateMap = std::map<std::string /*server_name*/, LdsUpdate>;
72
+
73
+ using RdsUpdateMap = std::map<std::string /*route_config_name*/, RdsUpdate>;
74
+
75
+ struct CdsUpdate {
76
+ // The name to use in the EDS request.
77
+ // If empty, the cluster name will be used.
78
+ std::string eds_service_name;
79
+ // The LRS server to use for load reporting.
80
+ // If not set, load reporting will be disabled.
81
+ // If set to the empty string, will use the same server we obtained the CDS
82
+ // data from.
83
+ absl::optional<std::string> lrs_load_reporting_server_name;
84
+ };
42
85
 
43
- // This comparator only compares the locality names.
44
- struct Less {
45
- bool operator()(const Locality& lhs, const Locality& rhs) const {
46
- return XdsLocalityName::Less()(lhs.name, rhs.name);
86
+ using CdsUpdateMap = std::map<std::string /*cluster_name*/, CdsUpdate>;
87
+
88
+ class PriorityListUpdate {
89
+ public:
90
+ struct LocalityMap {
91
+ struct Locality {
92
+ bool operator==(const Locality& other) const {
93
+ return *name == *other.name && serverlist == other.serverlist &&
94
+ lb_weight == other.lb_weight && priority == other.priority;
47
95
  }
96
+
97
+ // This comparator only compares the locality names.
98
+ struct Less {
99
+ bool operator()(const Locality& lhs, const Locality& rhs) const {
100
+ return XdsLocalityName::Less()(lhs.name, rhs.name);
101
+ }
102
+ };
103
+
104
+ RefCountedPtr<XdsLocalityName> name;
105
+ ServerAddressList serverlist;
106
+ uint32_t lb_weight;
107
+ uint32_t priority;
48
108
  };
49
109
 
50
- RefCountedPtr<XdsLocalityName> name;
51
- ServerAddressList serverlist;
52
- uint32_t lb_weight;
53
- uint32_t priority;
110
+ bool Contains(const RefCountedPtr<XdsLocalityName>& name) const {
111
+ return localities.find(name) != localities.end();
112
+ }
113
+
114
+ size_t size() const { return localities.size(); }
115
+
116
+ std::map<RefCountedPtr<XdsLocalityName>, Locality, XdsLocalityName::Less>
117
+ localities;
54
118
  };
55
119
 
56
- bool Contains(const RefCountedPtr<XdsLocalityName>& name) const {
57
- return localities.find(name) != localities.end();
120
+ bool operator==(const PriorityListUpdate& other) const;
121
+ bool operator!=(const PriorityListUpdate& other) const {
122
+ return !(*this == other);
58
123
  }
59
124
 
60
- size_t size() const { return localities.size(); }
125
+ void Add(LocalityMap::Locality locality);
61
126
 
62
- std::map<RefCountedPtr<XdsLocalityName>, Locality, XdsLocalityName::Less>
63
- localities;
64
- };
127
+ const LocalityMap* Find(uint32_t priority) const;
65
128
 
66
- bool operator==(const XdsPriorityListUpdate& other) const;
67
- bool operator!=(const XdsPriorityListUpdate& other) const {
68
- return !(*this == other);
69
- }
129
+ bool Contains(uint32_t priority) const {
130
+ return priority < priorities_.size();
131
+ }
132
+ bool Contains(const RefCountedPtr<XdsLocalityName>& name);
70
133
 
71
- void Add(LocalityMap::Locality locality);
134
+ bool empty() const { return priorities_.empty(); }
135
+ size_t size() const { return priorities_.size(); }
72
136
 
73
- const LocalityMap* Find(uint32_t priority) const;
137
+ // Callers should make sure the priority list is non-empty.
138
+ uint32_t LowestPriority() const {
139
+ return static_cast<uint32_t>(priorities_.size()) - 1;
140
+ }
74
141
 
75
- bool Contains(uint32_t priority) const {
76
- return priority < priorities_.size();
77
- }
78
- bool Contains(const RefCountedPtr<XdsLocalityName>& name);
142
+ private:
143
+ InlinedVector<LocalityMap, 2> priorities_;
144
+ };
79
145
 
80
- bool empty() const { return priorities_.empty(); }
81
- size_t size() const { return priorities_.size(); }
146
+ // There are two phases of accessing this class's content:
147
+ // 1. to initialize in the control plane combiner;
148
+ // 2. to use in the data plane combiner.
149
+ // So no additional synchronization is needed.
150
+ class DropConfig : public RefCounted<DropConfig> {
151
+ public:
152
+ struct DropCategory {
153
+ bool operator==(const DropCategory& other) const {
154
+ return name == other.name &&
155
+ parts_per_million == other.parts_per_million;
156
+ }
82
157
 
83
- // Callers should make sure the priority list is non-empty.
84
- uint32_t LowestPriority() const {
85
- return static_cast<uint32_t>(priorities_.size()) - 1;
86
- }
158
+ std::string name;
159
+ const uint32_t parts_per_million;
160
+ };
87
161
 
88
- private:
89
- InlinedVector<LocalityMap, 2> priorities_;
90
- };
162
+ using DropCategoryList = InlinedVector<DropCategory, 2>;
91
163
 
92
- // There are two phases of accessing this class's content:
93
- // 1. to initialize in the control plane combiner;
94
- // 2. to use in the data plane combiner.
95
- // So no additional synchronization is needed.
96
- class XdsDropConfig : public RefCounted<XdsDropConfig> {
97
- public:
98
- struct DropCategory {
99
- bool operator==(const DropCategory& other) const {
100
- return strcmp(name.get(), other.name.get()) == 0 &&
101
- parts_per_million == other.parts_per_million;
164
+ void AddCategory(std::string name, uint32_t parts_per_million) {
165
+ drop_category_list_.emplace_back(
166
+ DropCategory{std::move(name), parts_per_million});
167
+ if (parts_per_million == 1000000) drop_all_ = true;
102
168
  }
103
169
 
104
- grpc_core::UniquePtr<char> name;
105
- const uint32_t parts_per_million;
106
- };
170
+ // The only method invoked from the data plane combiner.
171
+ bool ShouldDrop(const std::string** category_name) const;
107
172
 
108
- using DropCategoryList = InlinedVector<DropCategory, 2>;
173
+ const DropCategoryList& drop_category_list() const {
174
+ return drop_category_list_;
175
+ }
109
176
 
110
- void AddCategory(grpc_core::UniquePtr<char> name,
111
- uint32_t parts_per_million) {
112
- drop_category_list_.emplace_back(
113
- DropCategory{std::move(name), parts_per_million});
114
- }
177
+ bool drop_all() const { return drop_all_; }
115
178
 
116
- // The only method invoked from the data plane combiner.
117
- bool ShouldDrop(const grpc_core::UniquePtr<char>** category_name) const;
179
+ bool operator==(const DropConfig& other) const {
180
+ return drop_category_list_ == other.drop_category_list_;
181
+ }
182
+ bool operator!=(const DropConfig& other) const { return !(*this == other); }
118
183
 
119
- const DropCategoryList& drop_category_list() const {
120
- return drop_category_list_;
121
- }
184
+ private:
185
+ DropCategoryList drop_category_list_;
186
+ bool drop_all_ = false;
187
+ };
122
188
 
123
- bool operator==(const XdsDropConfig& other) const {
124
- return drop_category_list_ == other.drop_category_list_;
125
- }
126
- bool operator!=(const XdsDropConfig& other) const {
127
- return !(*this == other);
128
- }
189
+ struct EdsUpdate {
190
+ PriorityListUpdate priority_list_update;
191
+ RefCountedPtr<DropConfig> drop_config;
192
+ };
129
193
 
130
- private:
131
- DropCategoryList drop_category_list_;
132
- };
194
+ using EdsUpdateMap = std::map<std::string /*eds_service_name*/, EdsUpdate>;
133
195
 
134
- struct EdsUpdate {
135
- XdsPriorityListUpdate priority_list_update;
136
- RefCountedPtr<XdsDropConfig> drop_config;
137
- bool drop_all = false;
138
- };
196
+ struct ClusterLoadReport {
197
+ XdsClusterDropStats::DroppedRequestsMap dropped_requests;
198
+ std::map<RefCountedPtr<XdsLocalityName>, XdsClusterLocalityStats::Snapshot,
199
+ XdsLocalityName::Less>
200
+ locality_stats;
201
+ grpc_millis load_report_interval;
202
+ };
203
+ using ClusterLoadReportMap = std::map<
204
+ std::pair<std::string /*cluster_name*/, std::string /*eds_service_name*/>,
205
+ ClusterLoadReport>;
206
+
207
+ XdsApi(XdsClient* client, TraceFlag* tracer, const XdsBootstrap::Node* node);
208
+
209
+ // Creates a request to nack an unsupported resource type.
210
+ // Takes ownership of \a error.
211
+ grpc_slice CreateUnsupportedTypeNackRequest(const std::string& type_url,
212
+ const std::string& nonce,
213
+ grpc_error* error);
214
+
215
+ // Creates an LDS request querying \a server_name.
216
+ // Takes ownership of \a error.
217
+ grpc_slice CreateLdsRequest(const std::string& server_name,
218
+ const std::string& version,
219
+ const std::string& nonce, grpc_error* error,
220
+ bool populate_node);
221
+
222
+ // Creates an RDS request querying \a route_config_name.
223
+ // Takes ownership of \a error.
224
+ grpc_slice CreateRdsRequest(const std::string& route_config_name,
225
+ const std::string& version,
226
+ const std::string& nonce, grpc_error* error,
227
+ bool populate_node);
228
+
229
+ // Creates a CDS request querying \a cluster_names.
230
+ // Takes ownership of \a error.
231
+ grpc_slice CreateCdsRequest(const std::set<StringView>& cluster_names,
232
+ const std::string& version,
233
+ const std::string& nonce, grpc_error* error,
234
+ bool populate_node);
235
+
236
+ // Creates an EDS request querying \a eds_service_names.
237
+ // Takes ownership of \a error.
238
+ grpc_slice CreateEdsRequest(const std::set<StringView>& eds_service_names,
239
+ const std::string& version,
240
+ const std::string& nonce, grpc_error* error,
241
+ bool populate_node);
242
+
243
+ // Parses the ADS response and outputs the validated update for either CDS or
244
+ // EDS. If the response can't be parsed at the top level, \a type_url will
245
+ // point to an empty string; otherwise, it will point to the received data.
246
+ grpc_error* ParseAdsResponse(
247
+ const grpc_slice& encoded_response,
248
+ const std::string& expected_server_name,
249
+ const std::string& expected_route_config_name,
250
+ const std::set<StringView>& expected_cluster_names,
251
+ const std::set<StringView>& expected_eds_service_names,
252
+ absl::optional<LdsUpdate>* lds_update,
253
+ absl::optional<RdsUpdate>* rds_update, CdsUpdateMap* cds_update_map,
254
+ EdsUpdateMap* eds_update_map, std::string* version, std::string* nonce,
255
+ std::string* type_url);
256
+
257
+ // Creates an LRS request querying \a server_name.
258
+ grpc_slice CreateLrsInitialRequest(const std::string& server_name);
259
+
260
+ // Creates an LRS request sending a client-side load report.
261
+ grpc_slice CreateLrsRequest(ClusterLoadReportMap cluster_load_report_map);
262
+
263
+ // Parses the LRS response and returns \a
264
+ // load_reporting_interval for client-side load reporting. If there is any
265
+ // error, the output config is invalid.
266
+ grpc_error* ParseLrsResponse(const grpc_slice& encoded_response,
267
+ std::set<std::string>* cluster_names,
268
+ grpc_millis* load_reporting_interval);
139
269
 
140
- struct CdsUpdate {
141
- // The name to use in the EDS request.
142
- // If null, the cluster name will be used.
143
- grpc_core::UniquePtr<char> eds_service_name;
144
- // The LRS server to use for load reporting.
145
- // If null, load reporting will be disabled.
146
- // If set to the empty string, will use the same server we obtained
147
- // the CDS data from.
148
- grpc_core::UniquePtr<char> lrs_load_reporting_server_name;
270
+ private:
271
+ XdsClient* client_;
272
+ TraceFlag* tracer_;
273
+ const XdsBootstrap::Node* node_;
274
+ const std::string build_version_;
275
+ const std::string user_agent_name_;
149
276
  };
150
277
 
151
- // Creates an EDS request querying \a service_name.
152
- grpc_slice XdsEdsRequestCreateAndEncode(const char* server_name,
153
- const XdsBootstrap::Node* node,
154
- const char* build_version);
155
-
156
- // Parses the EDS response and returns the args to update locality map. If there
157
- // is any error, the output update is invalid.
158
- grpc_error* XdsEdsResponseDecodeAndParse(const grpc_slice& encoded_response,
159
- EdsUpdate* update);
160
-
161
- // Creates an LRS request querying \a server_name.
162
- grpc_slice XdsLrsRequestCreateAndEncode(const char* server_name,
163
- const XdsBootstrap::Node* node,
164
- const char* build_version);
165
-
166
- // Creates an LRS request sending client-side load reports. If all the counters
167
- // in \a client_stats are zero, returns empty slice.
168
- grpc_slice XdsLrsRequestCreateAndEncode(const char* server_name,
169
- XdsClientStats* client_stats);
170
-
171
- // Parses the LRS response and returns \a cluster_name and \a
172
- // load_reporting_interval for client-side load reporting. If there is any
173
- // error, the output config is invalid.
174
- grpc_error* XdsLrsResponseDecodeAndParse(
175
- const grpc_slice& encoded_response,
176
- grpc_core::UniquePtr<char>* cluster_name,
177
- grpc_millis* load_reporting_interval);
178
-
179
278
  } // namespace grpc_core
180
279
 
181
280
  #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_API_H */
@@ -29,136 +29,198 @@
29
29
 
30
30
  namespace grpc_core {
31
31
 
32
- std::unique_ptr<XdsBootstrap> XdsBootstrap::ReadFromFile(grpc_error** error) {
32
+ namespace {
33
+
34
+ UniquePtr<char> BootstrapString(const XdsBootstrap& bootstrap) {
35
+ gpr_strvec v;
36
+ gpr_strvec_init(&v);
37
+ char* tmp;
38
+ if (bootstrap.node() != nullptr) {
39
+ gpr_asprintf(&tmp,
40
+ "node={\n"
41
+ " id=\"%s\",\n"
42
+ " cluster=\"%s\",\n"
43
+ " locality={\n"
44
+ " region=\"%s\",\n"
45
+ " zone=\"%s\",\n"
46
+ " subzone=\"%s\"\n"
47
+ " },\n"
48
+ " metadata=%s,\n"
49
+ "},\n",
50
+ bootstrap.node()->id.c_str(),
51
+ bootstrap.node()->cluster.c_str(),
52
+ bootstrap.node()->locality_region.c_str(),
53
+ bootstrap.node()->locality_zone.c_str(),
54
+ bootstrap.node()->locality_subzone.c_str(),
55
+ bootstrap.node()->metadata.Dump().c_str());
56
+ gpr_strvec_add(&v, tmp);
57
+ }
58
+ gpr_asprintf(&tmp,
59
+ "servers=[\n"
60
+ " {\n"
61
+ " uri=\"%s\",\n"
62
+ " creds=[\n",
63
+ bootstrap.server().server_uri.c_str());
64
+ gpr_strvec_add(&v, tmp);
65
+ for (size_t i = 0; i < bootstrap.server().channel_creds.size(); ++i) {
66
+ const auto& creds = bootstrap.server().channel_creds[i];
67
+ gpr_asprintf(&tmp, " {type=\"%s\", config=%s},\n", creds.type.c_str(),
68
+ creds.config.Dump().c_str());
69
+ gpr_strvec_add(&v, tmp);
70
+ }
71
+ gpr_strvec_add(&v, gpr_strdup(" ]\n }\n]"));
72
+ UniquePtr<char> result(gpr_strvec_flatten(&v, nullptr));
73
+ gpr_strvec_destroy(&v);
74
+ return result;
75
+ }
76
+
77
+ } // namespace
78
+
79
+ std::unique_ptr<XdsBootstrap> XdsBootstrap::ReadFromFile(XdsClient* client,
80
+ TraceFlag* tracer,
81
+ grpc_error** error) {
33
82
  grpc_core::UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP"));
34
83
  if (path == nullptr) {
35
84
  *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
36
- "GRPC_XDS_BOOTSTRAP env var not set");
85
+ "Environment variable GRPC_XDS_BOOTSTRAP not defined");
37
86
  return nullptr;
38
87
  }
88
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer)) {
89
+ gpr_log(GPR_INFO,
90
+ "[xds_client %p] Got bootstrap file location from "
91
+ "GRPC_XDS_BOOTSTRAP environment variable: %s",
92
+ client, path.get());
93
+ }
39
94
  grpc_slice contents;
40
95
  *error = grpc_load_file(path.get(), /*add_null_terminator=*/true, &contents);
41
96
  if (*error != GRPC_ERROR_NONE) return nullptr;
42
- return MakeUnique<XdsBootstrap>(contents, error);
97
+ StringView contents_str_view = StringViewFromSlice(contents);
98
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer)) {
99
+ UniquePtr<char> str = StringViewToCString(contents_str_view);
100
+ gpr_log(GPR_DEBUG, "[xds_client %p] Bootstrap file contents: %s", client,
101
+ str.get());
102
+ }
103
+ Json json = Json::Parse(contents_str_view, error);
104
+ grpc_slice_unref_internal(contents);
105
+ if (*error != GRPC_ERROR_NONE) {
106
+ char* msg;
107
+ gpr_asprintf(&msg, "Failed to parse bootstrap file %s", path.get());
108
+ grpc_error* error_out =
109
+ GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(msg, error, 1);
110
+ gpr_free(msg);
111
+ GRPC_ERROR_UNREF(*error);
112
+ *error = error_out;
113
+ return nullptr;
114
+ }
115
+ std::unique_ptr<XdsBootstrap> result =
116
+ absl::make_unique<XdsBootstrap>(std::move(json), error);
117
+ if (*error == GRPC_ERROR_NONE && GRPC_TRACE_FLAG_ENABLED(*tracer)) {
118
+ gpr_log(GPR_INFO,
119
+ "[xds_client %p] Bootstrap config for creating xds client:\n%s",
120
+ client, BootstrapString(*result).get());
121
+ }
122
+ return result;
43
123
  }
44
124
 
45
- XdsBootstrap::XdsBootstrap(grpc_slice contents, grpc_error** error)
46
- : contents_(contents) {
47
- tree_ = grpc_json_parse_string_with_len(
48
- reinterpret_cast<char*>(GPR_SLICE_START_PTR(contents_)),
49
- GPR_SLICE_LENGTH(contents_));
50
- if (tree_ == nullptr) {
51
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
52
- "failed to parse bootstrap file JSON");
53
- return;
54
- }
55
- if (tree_->type != GRPC_JSON_OBJECT || tree_->key != nullptr) {
125
+ XdsBootstrap::XdsBootstrap(Json json, grpc_error** error) {
126
+ if (json.type() != Json::Type::OBJECT) {
56
127
  *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
57
128
  "malformed JSON in bootstrap file");
58
129
  return;
59
130
  }
60
131
  InlinedVector<grpc_error*, 1> error_list;
61
- bool seen_xds_server = false;
62
- bool seen_node = false;
63
- for (grpc_json* child = tree_->child; child != nullptr; child = child->next) {
64
- if (child->key == nullptr) {
65
- error_list.push_back(
66
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("JSON key is null"));
67
- } else if (strcmp(child->key, "xds_server") == 0) {
68
- if (child->type != GRPC_JSON_OBJECT) {
69
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
70
- "\"xds_server\" field is not an object"));
71
- }
72
- if (seen_xds_server) {
73
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
74
- "duplicate \"xds_server\" field"));
75
- }
76
- seen_xds_server = true;
77
- grpc_error* parse_error = ParseXdsServer(child);
78
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
79
- } else if (strcmp(child->key, "node") == 0) {
80
- if (child->type != GRPC_JSON_OBJECT) {
81
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
82
- "\"node\" field is not an object"));
83
- }
84
- if (seen_node) {
85
- error_list.push_back(
86
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("duplicate \"node\" field"));
87
- }
88
- seen_node = true;
89
- grpc_error* parse_error = ParseNode(child);
132
+ auto it = json.mutable_object()->find("xds_servers");
133
+ if (it == json.mutable_object()->end()) {
134
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
135
+ "\"xds_servers\" field not present"));
136
+ } else if (it->second.type() != Json::Type::ARRAY) {
137
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
138
+ "\"xds_servers\" field is not an array"));
139
+ } else {
140
+ grpc_error* parse_error = ParseXdsServerList(&it->second);
141
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
142
+ }
143
+ it = json.mutable_object()->find("node");
144
+ if (it != json.mutable_object()->end()) {
145
+ if (it->second.type() != Json::Type::OBJECT) {
146
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
147
+ "\"node\" field is not an object"));
148
+ } else {
149
+ grpc_error* parse_error = ParseNode(&it->second);
90
150
  if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
91
151
  }
92
152
  }
93
- if (!seen_xds_server) {
94
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
95
- "\"xds_server\" field not present"));
96
- }
97
153
  *error = GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing xds bootstrap file",
98
154
  &error_list);
99
155
  }
100
156
 
101
- XdsBootstrap::~XdsBootstrap() {
102
- grpc_json_destroy(tree_);
103
- grpc_slice_unref_internal(contents_);
104
- }
105
-
106
- grpc_error* XdsBootstrap::ParseXdsServer(grpc_json* json) {
157
+ grpc_error* XdsBootstrap::ParseXdsServerList(Json* json) {
107
158
  InlinedVector<grpc_error*, 1> error_list;
108
- server_uri_ = nullptr;
109
- bool seen_channel_creds = false;
110
- for (grpc_json* child = json->child; child != nullptr; child = child->next) {
111
- if (child->key == nullptr) {
112
- error_list.push_back(
113
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("JSON key is null"));
114
- } else if (strcmp(child->key, "server_uri") == 0) {
115
- if (child->type != GRPC_JSON_STRING) {
116
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
117
- "\"server_uri\" field is not a string"));
118
- }
119
- if (server_uri_ != nullptr) {
120
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
121
- "duplicate \"server_uri\" field"));
122
- }
123
- server_uri_ = child->value;
124
- } else if (strcmp(child->key, "channel_creds") == 0) {
125
- if (child->type != GRPC_JSON_ARRAY) {
126
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
127
- "\"channel_creds\" field is not an array"));
128
- }
129
- if (seen_channel_creds) {
130
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
131
- "duplicate \"channel_creds\" field"));
132
- }
133
- seen_channel_creds = true;
134
- grpc_error* parse_error = ParseChannelCredsArray(child);
159
+ for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
160
+ Json& child = json->mutable_array()->at(i);
161
+ if (child.type() != Json::Type::OBJECT) {
162
+ char* msg;
163
+ gpr_asprintf(&msg, "array element %" PRIuPTR " is not an object", i);
164
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg));
165
+ gpr_free(msg);
166
+ } else {
167
+ grpc_error* parse_error = ParseXdsServer(&child, i);
135
168
  if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
136
169
  }
137
170
  }
138
- if (server_uri_ == nullptr) {
171
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"xds_servers\" array",
172
+ &error_list);
173
+ }
174
+
175
+ grpc_error* XdsBootstrap::ParseXdsServer(Json* json, size_t idx) {
176
+ InlinedVector<grpc_error*, 1> error_list;
177
+ servers_.emplace_back();
178
+ XdsServer& server = servers_[servers_.size() - 1];
179
+ auto it = json->mutable_object()->find("server_uri");
180
+ if (it == json->mutable_object()->end()) {
139
181
  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
140
182
  "\"server_uri\" field not present"));
183
+ } else if (it->second.type() != Json::Type::STRING) {
184
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
185
+ "\"server_uri\" field is not a string"));
186
+ } else {
187
+ server.server_uri = std::move(*it->second.mutable_string_value());
141
188
  }
142
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"xds_server\" object",
143
- &error_list);
189
+ it = json->mutable_object()->find("channel_creds");
190
+ if (it != json->mutable_object()->end()) {
191
+ if (it->second.type() != Json::Type::ARRAY) {
192
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
193
+ "\"channel_creds\" field is not an array"));
194
+ } else {
195
+ grpc_error* parse_error = ParseChannelCredsArray(&it->second, &server);
196
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
197
+ }
198
+ }
199
+ // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
200
+ // string is not static in this case.
201
+ if (error_list.empty()) return GRPC_ERROR_NONE;
202
+ char* msg;
203
+ gpr_asprintf(&msg, "errors parsing index %" PRIuPTR, idx);
204
+ grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
205
+ gpr_free(msg);
206
+ for (size_t i = 0; i < error_list.size(); ++i) {
207
+ error = grpc_error_add_child(error, error_list[i]);
208
+ }
209
+ return error;
144
210
  }
145
211
 
146
- grpc_error* XdsBootstrap::ParseChannelCredsArray(grpc_json* json) {
212
+ grpc_error* XdsBootstrap::ParseChannelCredsArray(Json* json,
213
+ XdsServer* server) {
147
214
  InlinedVector<grpc_error*, 1> error_list;
148
- size_t idx = 0;
149
- for (grpc_json *child = json->child; child != nullptr;
150
- child = child->next, ++idx) {
151
- if (child->key != nullptr) {
152
- char* msg;
153
- gpr_asprintf(&msg, "array element %" PRIuPTR " key is not null", idx);
154
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg));
155
- }
156
- if (child->type != GRPC_JSON_OBJECT) {
215
+ for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
216
+ Json& child = json->mutable_array()->at(i);
217
+ if (child.type() != Json::Type::OBJECT) {
157
218
  char* msg;
158
- gpr_asprintf(&msg, "array element %" PRIuPTR " is not an object", idx);
219
+ gpr_asprintf(&msg, "array element %" PRIuPTR " is not an object", i);
159
220
  error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg));
221
+ gpr_free(msg);
160
222
  } else {
161
- grpc_error* parse_error = ParseChannelCreds(child, idx);
223
+ grpc_error* parse_error = ParseChannelCreds(&child, i, server);
162
224
  if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
163
225
  }
164
226
  }
@@ -166,36 +228,32 @@ grpc_error* XdsBootstrap::ParseChannelCredsArray(grpc_json* json) {
166
228
  &error_list);
167
229
  }
168
230
 
169
- grpc_error* XdsBootstrap::ParseChannelCreds(grpc_json* json, size_t idx) {
231
+ grpc_error* XdsBootstrap::ParseChannelCreds(Json* json, size_t idx,
232
+ XdsServer* server) {
170
233
  InlinedVector<grpc_error*, 1> error_list;
171
234
  ChannelCreds channel_creds;
172
- for (grpc_json* child = json->child; child != nullptr; child = child->next) {
173
- if (child->key == nullptr) {
174
- error_list.push_back(
175
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("JSON key is null"));
176
- } else if (strcmp(child->key, "type") == 0) {
177
- if (child->type != GRPC_JSON_STRING) {
178
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
179
- "\"type\" field is not a string"));
180
- }
181
- if (channel_creds.type != nullptr) {
182
- error_list.push_back(
183
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("duplicate \"type\" field"));
184
- }
185
- channel_creds.type = child->value;
186
- } else if (strcmp(child->key, "config") == 0) {
187
- if (child->type != GRPC_JSON_OBJECT) {
188
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
189
- "\"config\" field is not an object"));
190
- }
191
- if (channel_creds.config != nullptr) {
192
- error_list.push_back(
193
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("duplicate \"config\" field"));
194
- }
195
- channel_creds.config = child;
235
+ auto it = json->mutable_object()->find("type");
236
+ if (it == json->mutable_object()->end()) {
237
+ error_list.push_back(
238
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("\"type\" field not present"));
239
+ } else if (it->second.type() != Json::Type::STRING) {
240
+ error_list.push_back(
241
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("\"type\" field is not a string"));
242
+ } else {
243
+ channel_creds.type = std::move(*it->second.mutable_string_value());
244
+ }
245
+ it = json->mutable_object()->find("config");
246
+ if (it != json->mutable_object()->end()) {
247
+ if (it->second.type() != Json::Type::OBJECT) {
248
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
249
+ "\"config\" field is not an object"));
250
+ } else {
251
+ channel_creds.config = std::move(it->second);
196
252
  }
197
253
  }
198
- if (channel_creds.type != nullptr) channel_creds_.push_back(channel_creds);
254
+ if (!channel_creds.type.empty()) {
255
+ server->channel_creds.emplace_back(std::move(channel_creds));
256
+ }
199
257
  // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
200
258
  // string is not static in this case.
201
259
  if (error_list.empty()) return GRPC_ERROR_NONE;
@@ -209,242 +267,81 @@ grpc_error* XdsBootstrap::ParseChannelCreds(grpc_json* json, size_t idx) {
209
267
  return error;
210
268
  }
211
269
 
212
- grpc_error* XdsBootstrap::ParseNode(grpc_json* json) {
270
+ grpc_error* XdsBootstrap::ParseNode(Json* json) {
213
271
  InlinedVector<grpc_error*, 1> error_list;
214
- node_ = MakeUnique<Node>();
215
- bool seen_metadata = false;
216
- bool seen_locality = false;
217
- for (grpc_json* child = json->child; child != nullptr; child = child->next) {
218
- if (child->key == nullptr) {
272
+ node_ = absl::make_unique<Node>();
273
+ auto it = json->mutable_object()->find("id");
274
+ if (it != json->mutable_object()->end()) {
275
+ if (it->second.type() != Json::Type::STRING) {
219
276
  error_list.push_back(
220
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("JSON key is null"));
221
- } else if (strcmp(child->key, "id") == 0) {
222
- if (child->type != GRPC_JSON_STRING) {
223
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
224
- "\"id\" field is not a string"));
225
- }
226
- if (node_->id != nullptr) {
227
- error_list.push_back(
228
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("duplicate \"id\" field"));
229
- }
230
- node_->id = child->value;
231
- } else if (strcmp(child->key, "cluster") == 0) {
232
- if (child->type != GRPC_JSON_STRING) {
233
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
234
- "\"cluster\" field is not a string"));
235
- }
236
- if (node_->cluster != nullptr) {
237
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
238
- "duplicate \"cluster\" field"));
239
- }
240
- node_->cluster = child->value;
241
- } else if (strcmp(child->key, "locality") == 0) {
242
- if (child->type != GRPC_JSON_OBJECT) {
243
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
244
- "\"locality\" field is not an object"));
245
- }
246
- if (seen_locality) {
247
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
248
- "duplicate \"locality\" field"));
249
- }
250
- seen_locality = true;
251
- grpc_error* parse_error = ParseLocality(child);
252
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
253
- } else if (strcmp(child->key, "metadata") == 0) {
254
- if (child->type != GRPC_JSON_OBJECT) {
255
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
256
- "\"metadata\" field is not an object"));
257
- }
258
- if (seen_metadata) {
259
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
260
- "duplicate \"metadata\" field"));
261
- }
262
- seen_metadata = true;
263
- InlinedVector<grpc_error*, 1> parse_errors =
264
- ParseMetadataStruct(child, &node_->metadata);
265
- if (!parse_errors.empty()) {
266
- grpc_error* parse_error = GRPC_ERROR_CREATE_FROM_VECTOR(
267
- "errors parsing \"metadata\" object", &parse_errors);
268
- error_list.push_back(parse_error);
269
- }
277
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("\"id\" field is not a string"));
278
+ } else {
279
+ node_->id = std::move(*it->second.mutable_string_value());
270
280
  }
271
281
  }
272
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"node\" object",
273
- &error_list);
274
- }
275
-
276
- grpc_error* XdsBootstrap::ParseLocality(grpc_json* json) {
277
- InlinedVector<grpc_error*, 1> error_list;
278
- node_->locality_region = nullptr;
279
- node_->locality_zone = nullptr;
280
- node_->locality_subzone = nullptr;
281
- for (grpc_json* child = json->child; child != nullptr; child = child->next) {
282
- if (child->key == nullptr) {
283
- error_list.push_back(
284
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("JSON key is null"));
285
- } else if (strcmp(child->key, "region") == 0) {
286
- if (child->type != GRPC_JSON_STRING) {
287
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
288
- "\"region\" field is not a string"));
289
- }
290
- if (node_->locality_region != nullptr) {
291
- error_list.push_back(
292
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("duplicate \"region\" field"));
293
- }
294
- node_->locality_region = child->value;
295
- } else if (strcmp(child->key, "zone") == 0) {
296
- if (child->type != GRPC_JSON_STRING) {
297
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
298
- "\"zone\" field is not a string"));
299
- }
300
- if (node_->locality_zone != nullptr) {
301
- error_list.push_back(
302
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("duplicate \"zone\" field"));
303
- }
304
- node_->locality_zone = child->value;
305
- } else if (strcmp(child->key, "subzone") == 0) {
306
- if (child->type != GRPC_JSON_STRING) {
307
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
308
- "\"subzone\" field is not a string"));
309
- }
310
- if (node_->locality_subzone != nullptr) {
311
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
312
- "duplicate \"subzone\" field"));
313
- }
314
- node_->locality_subzone = child->value;
282
+ it = json->mutable_object()->find("cluster");
283
+ if (it != json->mutable_object()->end()) {
284
+ if (it->second.type() != Json::Type::STRING) {
285
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
286
+ "\"cluster\" field is not a string"));
287
+ } else {
288
+ node_->cluster = std::move(*it->second.mutable_string_value());
315
289
  }
316
290
  }
317
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"locality\" object",
318
- &error_list);
319
- }
320
-
321
- InlinedVector<grpc_error*, 1> XdsBootstrap::ParseMetadataStruct(
322
- grpc_json* json,
323
- std::map<const char*, XdsBootstrap::MetadataValue, StringLess>* result) {
324
- InlinedVector<grpc_error*, 1> error_list;
325
- for (grpc_json* child = json->child; child != nullptr; child = child->next) {
326
- if (child->key == nullptr) {
327
- error_list.push_back(
328
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("JSON key is null"));
329
- continue;
291
+ it = json->mutable_object()->find("locality");
292
+ if (it != json->mutable_object()->end()) {
293
+ if (it->second.type() != Json::Type::OBJECT) {
294
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
295
+ "\"locality\" field is not an object"));
296
+ } else {
297
+ grpc_error* parse_error = ParseLocality(&it->second);
298
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
330
299
  }
331
- if (result->find(child->key) != result->end()) {
332
- char* msg;
333
- gpr_asprintf(&msg, "duplicate metadata key \"%s\"", child->key);
334
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg));
335
- gpr_free(msg);
300
+ }
301
+ it = json->mutable_object()->find("metadata");
302
+ if (it != json->mutable_object()->end()) {
303
+ if (it->second.type() != Json::Type::OBJECT) {
304
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
305
+ "\"metadata\" field is not an object"));
306
+ } else {
307
+ node_->metadata = std::move(it->second);
336
308
  }
337
- MetadataValue& value = (*result)[child->key];
338
- grpc_error* parse_error = ParseMetadataValue(child, 0, &value);
339
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
340
309
  }
341
- return error_list;
310
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"node\" object",
311
+ &error_list);
342
312
  }
343
313
 
344
- InlinedVector<grpc_error*, 1> XdsBootstrap::ParseMetadataList(
345
- grpc_json* json, std::vector<MetadataValue>* result) {
314
+ grpc_error* XdsBootstrap::ParseLocality(Json* json) {
346
315
  InlinedVector<grpc_error*, 1> error_list;
347
- size_t idx = 0;
348
- for (grpc_json *child = json->child; child != nullptr;
349
- child = child->next, ++idx) {
350
- if (child->key != nullptr) {
351
- char* msg;
352
- gpr_asprintf(&msg, "JSON key is non-null for index %" PRIuPTR, idx);
353
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg));
354
- gpr_free(msg);
316
+ auto it = json->mutable_object()->find("region");
317
+ if (it != json->mutable_object()->end()) {
318
+ if (it->second.type() != Json::Type::STRING) {
319
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
320
+ "\"region\" field is not a string"));
321
+ } else {
322
+ node_->locality_region = std::move(*it->second.mutable_string_value());
355
323
  }
356
- result->emplace_back();
357
- grpc_error* parse_error = ParseMetadataValue(child, idx, &result->back());
358
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
359
324
  }
360
- return error_list;
361
- }
362
-
363
- grpc_error* XdsBootstrap::ParseMetadataValue(grpc_json* json, size_t idx,
364
- MetadataValue* result) {
365
- grpc_error* error = GRPC_ERROR_NONE;
366
- auto context_func = [json, idx]() {
367
- char* context;
368
- if (json->key != nullptr) {
369
- gpr_asprintf(&context, "key \"%s\"", json->key);
325
+ it = json->mutable_object()->find("zone");
326
+ if (it != json->mutable_object()->end()) {
327
+ if (it->second.type() != Json::Type::STRING) {
328
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
329
+ "\"zone\" field is not a string"));
370
330
  } else {
371
- gpr_asprintf(&context, "index %" PRIuPTR, idx);
331
+ node_->locality_zone = std::move(*it->second.mutable_string_value());
372
332
  }
373
- return context;
374
- };
375
- switch (json->type) {
376
- case GRPC_JSON_STRING:
377
- result->type = MetadataValue::Type::STRING;
378
- result->string_value = json->value;
379
- break;
380
- case GRPC_JSON_NUMBER:
381
- result->type = MetadataValue::Type::DOUBLE;
382
- errno = 0; // To distinguish error.
383
- result->double_value = strtod(json->value, nullptr);
384
- if (errno != 0) {
385
- char* context = context_func();
386
- char* msg;
387
- gpr_asprintf(&msg, "error parsing numeric value for %s: \"%s\"",
388
- context, json->value);
389
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
390
- gpr_free(context);
391
- gpr_free(msg);
392
- }
393
- break;
394
- case GRPC_JSON_TRUE:
395
- result->type = MetadataValue::Type::BOOL;
396
- result->bool_value = true;
397
- break;
398
- case GRPC_JSON_FALSE:
399
- result->type = MetadataValue::Type::BOOL;
400
- result->bool_value = false;
401
- break;
402
- case GRPC_JSON_NULL:
403
- result->type = MetadataValue::Type::MD_NULL;
404
- break;
405
- case GRPC_JSON_ARRAY: {
406
- result->type = MetadataValue::Type::LIST;
407
- InlinedVector<grpc_error*, 1> error_list =
408
- ParseMetadataList(json, &result->list_value);
409
- if (!error_list.empty()) {
410
- // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
411
- // string is not static in this case.
412
- char* context = context_func();
413
- char* msg;
414
- gpr_asprintf(&msg, "errors parsing struct for %s", context);
415
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
416
- gpr_free(context);
417
- gpr_free(msg);
418
- for (size_t i = 0; i < error_list.size(); ++i) {
419
- error = grpc_error_add_child(error, error_list[i]);
420
- }
421
- }
422
- break;
423
- }
424
- case GRPC_JSON_OBJECT: {
425
- result->type = MetadataValue::Type::STRUCT;
426
- InlinedVector<grpc_error*, 1> error_list =
427
- ParseMetadataStruct(json, &result->struct_value);
428
- if (!error_list.empty()) {
429
- // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
430
- // string is not static in this case.
431
- char* context = context_func();
432
- char* msg;
433
- gpr_asprintf(&msg, "errors parsing struct for %s", context);
434
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
435
- gpr_free(context);
436
- gpr_free(msg);
437
- for (size_t i = 0; i < error_list.size(); ++i) {
438
- error = grpc_error_add_child(error, error_list[i]);
439
- GRPC_ERROR_UNREF(error_list[i]);
440
- }
441
- }
442
- break;
333
+ }
334
+ it = json->mutable_object()->find("subzone");
335
+ if (it != json->mutable_object()->end()) {
336
+ if (it->second.type() != Json::Type::STRING) {
337
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
338
+ "\"subzone\" field is not a string"));
339
+ } else {
340
+ node_->locality_subzone = std::move(*it->second.mutable_string_value());
443
341
  }
444
- default:
445
- break;
446
342
  }
447
- return error;
343
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"locality\" object",
344
+ &error_list);
448
345
  }
449
346
 
450
347
  } // namespace grpc_core