xds_bootstrap.cc
Go to the documentation of this file.
1 //
2 // Copyright 2019 gRPC authors.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
18 
20 
21 #include <stdlib.h>
22 
23 #include <utility>
24 #include <vector>
25 
26 #include "absl/memory/memory.h"
27 #include "absl/strings/match.h"
28 #include "absl/strings/str_cat.h"
29 #include "absl/strings/str_format.h"
30 #include "absl/strings/str_join.h"
31 #include "absl/strings/string_view.h"
32 
33 #include <grpc/support/alloc.h>
34 
38 #include "src/core/lib/gpr/env.h"
43 
44 namespace grpc_core {
45 
46 // TODO(donnadionne): check to see if federation is enabled, this will be
47 // removed once federation is fully integrated and enabled by default.
49  char* value = gpr_getenv("GRPC_EXPERIMENTAL_XDS_FEDERATION");
50  bool parsed_value;
51  bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
52  gpr_free(value);
53  return parse_succeeded && parsed_value;
54 }
55 
56 namespace {
57 
58 const absl::string_view kServerFeatureXdsV3 = "xds_v3";
59 const absl::string_view kServerFeatureIgnoreResourceDeletion =
60  "ignore_resource_deletion";
61 
62 grpc_error_handle ParseChannelCreds(const Json::Object& json, size_t idx,
63  XdsBootstrap::XdsServer* server) {
64  std::vector<grpc_error_handle> error_list;
66  ParseJsonObjectField(json, "type", &type, &error_list);
67  const Json::Object* config_ptr = nullptr;
68  ParseJsonObjectField(json, "config", &config_ptr, &error_list,
69  /*required=*/false);
70  // Select the first channel creds type that we support.
71  if (server->channel_creds_type.empty() &&
73  Json config;
74  if (config_ptr != nullptr) config = *config_ptr;
75  if (!CoreConfiguration::Get().channel_creds_registry().IsValidConfig(
76  type, config)) {
78  "invalid config for channel creds type \"", type, "\"")));
79  }
80  server->channel_creds_type = std::move(type);
81  server->channel_creds_config = std::move(config);
82  }
84  absl::StrCat("errors parsing index ", idx), &error_list);
85 }
86 
87 grpc_error_handle ParseChannelCredsArray(const Json::Array& json,
88  XdsBootstrap::XdsServer* server) {
89  std::vector<grpc_error_handle> error_list;
90  for (size_t i = 0; i < json.size(); ++i) {
91  const Json& child = json.at(i);
92  if (child.type() != Json::Type::OBJECT) {
93  error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
94  absl::StrCat("array element ", i, " is not an object")));
95  } else {
97  ParseChannelCreds(child.object_value(), i, server);
98  if (!GRPC_ERROR_IS_NONE(parse_error)) error_list.push_back(parse_error);
99  }
100  }
101  if (server->channel_creds_type.empty()) {
102  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
103  "no known creds type found in \"channel_creds\""));
104  }
105  return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"channel_creds\" array",
106  &error_list);
107 }
108 
109 } // namespace
110 
111 //
112 // XdsBootstrap::XdsServer
113 //
114 
116  const Json& json, grpc_error_handle* error) {
117  std::vector<grpc_error_handle> error_list;
119  ParseJsonObjectField(json.object_value(), "server_uri", &server.server_uri,
120  &error_list);
121  const Json::Array* creds_array = nullptr;
122  ParseJsonObjectField(json.object_value(), "channel_creds", &creds_array,
123  &error_list);
124  if (creds_array != nullptr) {
126  ParseChannelCredsArray(*creds_array, &server);
127  if (!GRPC_ERROR_IS_NONE(parse_error)) error_list.push_back(parse_error);
128  }
129  const Json::Array* server_features_array = nullptr;
130  ParseJsonObjectField(json.object_value(), "server_features",
131  &server_features_array, &error_list, /*required=*/false);
132  if (server_features_array != nullptr) {
133  for (const Json& feature_json : *server_features_array) {
134  if (feature_json.type() == Json::Type::STRING &&
135  (feature_json.string_value() == kServerFeatureXdsV3 ||
136  feature_json.string_value() ==
137  kServerFeatureIgnoreResourceDeletion)) {
138  server.server_features.insert(feature_json.string_value());
139  }
140  }
141  }
143  "errors parsing xds server", &error_list);
144  return server;
145 }
146 
148  Json::Object channel_creds_json{{"type", channel_creds_type}};
149  if (channel_creds_config.type() != Json::Type::JSON_NULL) {
150  channel_creds_json["config"] = channel_creds_config;
151  }
152  Json::Object json{
153  {"server_uri", server_uri},
154  {"channel_creds", Json::Array{std::move(channel_creds_json)}},
155  };
156  if (!server_features.empty()) {
157  Json::Array server_features_json;
158  for (auto& feature : server_features) {
159  server_features_json.emplace_back(feature);
160  }
161  json["server_features"] = std::move(server_features_json);
162  }
163  return json;
164 }
165 
167  return server_features.find(std::string(kServerFeatureXdsV3)) !=
168  server_features.end();
169 }
170 
172  return server_features.find(std::string(
173  kServerFeatureIgnoreResourceDeletion)) != server_features.end();
174 }
175 
176 //
177 // XdsBootstrap
178 //
179 
180 std::unique_ptr<XdsBootstrap> XdsBootstrap::Create(
181  absl::string_view json_string, grpc_error_handle* error) {
182  Json json = Json::Parse(json_string, error);
183  if (!GRPC_ERROR_IS_NONE(*error)) {
184  grpc_error_handle error_out =
186  "Failed to parse bootstrap JSON string", error, 1);
188  *error = error_out;
189  return nullptr;
190  }
191  return absl::make_unique<XdsBootstrap>(std::move(json), error);
192 }
193 
195  if (json.type() != Json::Type::OBJECT) {
197  "malformed JSON in bootstrap file");
198  return;
199  }
200  std::vector<grpc_error_handle> error_list;
201  auto it = json.mutable_object()->find("xds_servers");
202  if (it == json.mutable_object()->end()) {
203  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
204  "\"xds_servers\" field not present"));
205  } else if (it->second.type() != Json::Type::ARRAY) {
206  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
207  "\"xds_servers\" field is not an array"));
208  } else {
210  if (!GRPC_ERROR_IS_NONE(parse_error)) error_list.push_back(parse_error);
211  }
212  it = json.mutable_object()->find("node");
213  if (it != json.mutable_object()->end()) {
214  if (it->second.type() != Json::Type::OBJECT) {
215  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
216  "\"node\" field is not an object"));
217  } else {
219  if (!GRPC_ERROR_IS_NONE(parse_error)) error_list.push_back(parse_error);
220  }
221  }
222  if (XdsFederationEnabled()) {
223  it = json.mutable_object()->find("authorities");
224  if (it != json.mutable_object()->end()) {
225  if (it->second.type() != Json::Type::OBJECT) {
226  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
227  "\"authorities\" field is not an object"));
228  } else {
230  if (!GRPC_ERROR_IS_NONE(parse_error)) error_list.push_back(parse_error);
231  }
232  }
233  it = json.mutable_object()->find(
234  "client_default_listener_resource_name_template");
235  if (it != json.mutable_object()->end()) {
236  if (it->second.type() != Json::Type::STRING) {
237  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
238  "\"client_default_listener_resource_name_template\" field is not a "
239  "string"));
240  } else {
242  std::move(*it->second.mutable_string_value());
243  }
244  }
245  }
246  it = json.mutable_object()->find("server_listener_resource_name_template");
247  if (it != json.mutable_object()->end()) {
248  if (it->second.type() != Json::Type::STRING) {
249  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
250  "\"server_listener_resource_name_template\" field is not a string"));
251  } else {
253  std::move(*it->second.mutable_string_value());
254  }
255  }
256  it = json.mutable_object()->find("certificate_providers");
257  if (it != json.mutable_object()->end()) {
258  if (it->second.type() != Json::Type::OBJECT) {
259  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
260  "\"certificate_providers\" field is not an object"));
261  } else {
263  if (!GRPC_ERROR_IS_NONE(parse_error)) error_list.push_back(parse_error);
264  }
265  }
266  *error = GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing xds bootstrap file",
267  &error_list);
268 }
269 
271  const std::string& name) const {
272  auto it = authorities_.find(name);
273  if (it != authorities_.end()) {
274  return &it->second;
275  }
276  return nullptr;
277 }
278 
280  const XdsBootstrap::XdsServer& server) const {
281  if (server == servers_[0]) return true;
282  for (auto& authority : authorities_) {
283  for (auto& xds_server : authority.second.xds_servers) {
284  if (server == xds_server) return true;
285  }
286  }
287  return false;
288 }
289 
291  Json* json, std::vector<XdsServer>* servers) {
292  std::vector<grpc_error_handle> error_list;
293  for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
294  Json& child = json->mutable_array()->at(i);
295  if (child.type() != Json::Type::OBJECT) {
296  error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
297  absl::StrCat("array element ", i, " is not an object")));
298  } else {
300  servers->emplace_back(XdsServer::Parse(child, &parse_error));
302  error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
303  absl::StrCat("errors parsing index ", i)));
304  error_list.push_back(parse_error);
305  }
306  }
307  }
308  return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"xds_servers\" array",
309  &error_list);
310 }
311 
313  std::vector<grpc_error_handle> error_list;
314  for (auto& p : *(json->mutable_object())) {
315  if (p.second.type() != Json::Type::OBJECT) {
316  error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
317  "field:authorities element error: element is not a object"));
318  continue;
319  }
320  grpc_error_handle parse_error = ParseAuthority(&p.second, p.first);
321  if (!GRPC_ERROR_IS_NONE(parse_error)) error_list.push_back(parse_error);
322  }
323  return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"authorities\"",
324  &error_list);
325 }
326 
328  const std::string& name) {
329  std::vector<grpc_error_handle> error_list;
330  Authority authority;
331  auto it =
332  json->mutable_object()->find("client_listener_resource_name_template");
333  if (it != json->mutable_object()->end()) {
334  if (it->second.type() != Json::Type::STRING) {
335  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
336  "\"client_listener_resource_name_template\" field is not a string"));
337  } else {
338  std::string expected_prefix = absl::StrCat("xdstp://", name, "/");
339  if (!absl::StartsWith(it->second.string_value(), expected_prefix)) {
340  error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
341  absl::StrCat("\"client_listener_resource_name_template\" field "
342  "must begin with \"",
343  expected_prefix, "\"")));
344  } else {
346  std::move(*it->second.mutable_string_value());
347  }
348  }
349  }
350  it = json->mutable_object()->find("xds_servers");
351  if (it != json->mutable_object()->end()) {
352  if (it->second.type() != Json::Type::ARRAY) {
353  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
354  "\"xds_servers\" field is not an array"));
355  } else {
357  ParseXdsServerList(&it->second, &authority.xds_servers);
358  if (!GRPC_ERROR_IS_NONE(parse_error)) error_list.push_back(parse_error);
359  }
360  }
361  if (error_list.empty()) {
362  authorities_[name] = std::move(authority);
363  }
365  absl::StrCat("errors parsing authority ", name), &error_list);
366 }
367 
369  std::vector<grpc_error_handle> error_list;
370  node_ = absl::make_unique<Node>();
371  auto it = json->mutable_object()->find("id");
372  if (it != json->mutable_object()->end()) {
373  if (it->second.type() != Json::Type::STRING) {
374  error_list.push_back(
375  GRPC_ERROR_CREATE_FROM_STATIC_STRING("\"id\" field is not a string"));
376  } else {
377  node_->id = std::move(*it->second.mutable_string_value());
378  }
379  }
380  it = json->mutable_object()->find("cluster");
381  if (it != json->mutable_object()->end()) {
382  if (it->second.type() != Json::Type::STRING) {
383  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
384  "\"cluster\" field is not a string"));
385  } else {
386  node_->cluster = std::move(*it->second.mutable_string_value());
387  }
388  }
389  it = json->mutable_object()->find("locality");
390  if (it != json->mutable_object()->end()) {
391  if (it->second.type() != Json::Type::OBJECT) {
392  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
393  "\"locality\" field is not an object"));
394  } else {
396  if (!GRPC_ERROR_IS_NONE(parse_error)) error_list.push_back(parse_error);
397  }
398  }
399  it = json->mutable_object()->find("metadata");
400  if (it != json->mutable_object()->end()) {
401  if (it->second.type() != Json::Type::OBJECT) {
402  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
403  "\"metadata\" field is not an object"));
404  } else {
405  node_->metadata = std::move(it->second);
406  }
407  }
408  return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"node\" object",
409  &error_list);
410 }
411 
413  std::vector<grpc_error_handle> error_list;
414  auto it = json->mutable_object()->find("region");
415  if (it != json->mutable_object()->end()) {
416  if (it->second.type() != Json::Type::STRING) {
417  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
418  "\"region\" field is not a string"));
419  } else {
420  node_->locality_region = std::move(*it->second.mutable_string_value());
421  }
422  }
423  it = json->mutable_object()->find("zone");
424  if (it != json->mutable_object()->end()) {
425  if (it->second.type() != Json::Type::STRING) {
426  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
427  "\"zone\" field is not a string"));
428  } else {
429  node_->locality_zone = std::move(*it->second.mutable_string_value());
430  }
431  }
432  it = json->mutable_object()->find("sub_zone");
433  if (it != json->mutable_object()->end()) {
434  if (it->second.type() != Json::Type::STRING) {
435  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
436  "\"sub_zone\" field is not a string"));
437  } else {
438  node_->locality_sub_zone = std::move(*it->second.mutable_string_value());
439  }
440  }
441  return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"locality\" object",
442  &error_list);
443 }
444 
446  std::vector<grpc_error_handle> error_list;
447  for (auto& certificate_provider : *(json->mutable_object())) {
448  if (certificate_provider.second.type() != Json::Type::OBJECT) {
449  error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
450  "element \"", certificate_provider.first, "\" is not an object")));
451  } else {
453  certificate_provider.first, &certificate_provider.second);
454  if (!GRPC_ERROR_IS_NONE(parse_error)) error_list.push_back(parse_error);
455  }
456  }
458  "errors parsing \"certificate_providers\" object", &error_list);
459 }
460 
462  const std::string& instance_name, Json* certificate_provider_json) {
463  std::vector<grpc_error_handle> error_list;
464  auto it = certificate_provider_json->mutable_object()->find("plugin_name");
465  if (it == certificate_provider_json->mutable_object()->end()) {
466  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
467  "\"plugin_name\" field not present"));
468  } else if (it->second.type() != Json::Type::STRING) {
469  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
470  "\"plugin_name\" field is not a string"));
471  } else {
472  std::string plugin_name = std::move(*(it->second.mutable_string_value()));
473  CertificateProviderFactory* factory =
475  plugin_name);
476  if (factory == nullptr) {
477  error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
478  absl::StrCat("Unrecognized plugin name: ", plugin_name)));
479  } else {
481  it = certificate_provider_json->mutable_object()->find("config");
482  if (it != certificate_provider_json->mutable_object()->end()) {
483  if (it->second.type() != Json::Type::OBJECT) {
484  error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
485  "\"config\" field is not an object"));
486  } else {
488  config = factory->CreateCertificateProviderConfig(it->second,
489  &parse_error);
491  error_list.push_back(parse_error);
492  }
493  }
494  } else {
495  // "config" is an optional field, so create an empty JSON object.
498  &parse_error);
499  if (!GRPC_ERROR_IS_NONE(parse_error)) error_list.push_back(parse_error);
500  }
501  certificate_providers_.insert(
502  {instance_name, {std::move(plugin_name), std::move(config)}});
503  }
504  }
506  absl::StrCat("errors parsing element \"", instance_name, "\""),
507  &error_list);
508 }
509 
511  std::vector<std::string> parts;
512  if (node_ != nullptr) {
513  parts.push_back(absl::StrFormat(
514  "node={\n"
515  " id=\"%s\",\n"
516  " cluster=\"%s\",\n"
517  " locality={\n"
518  " region=\"%s\",\n"
519  " zone=\"%s\",\n"
520  " sub_zone=\"%s\"\n"
521  " },\n"
522  " metadata=%s,\n"
523  "},\n",
524  node_->id, node_->cluster, node_->locality_region, node_->locality_zone,
525  node_->locality_sub_zone, node_->metadata.Dump()));
526  }
527  parts.push_back(
528  absl::StrFormat("servers=[\n"
529  " {\n"
530  " uri=\"%s\",\n"
531  " creds_type=%s,\n",
532  server().server_uri, server().channel_creds_type));
533  if (server().channel_creds_config.type() != Json::Type::JSON_NULL) {
534  parts.push_back(absl::StrFormat(" creds_config=%s,",
535  server().channel_creds_config.Dump()));
536  }
537  if (!server().server_features.empty()) {
538  parts.push_back(absl::StrCat(" server_features=[",
539  absl::StrJoin(server().server_features, ", "),
540  "],\n"));
541  }
542  parts.push_back(" }\n],\n");
544  parts.push_back(absl::StrFormat(
545  "client_default_listener_resource_name_template=\"%s\",\n",
547  }
549  parts.push_back(
550  absl::StrFormat("server_listener_resource_name_template=\"%s\",\n",
552  }
553  parts.push_back("authorities={\n");
554  for (const auto& entry : authorities_) {
555  parts.push_back(absl::StrFormat(" %s={\n", entry.first));
556  parts.push_back(
557  absl::StrFormat(" client_listener_resource_name_template=\"%s\",\n",
558  entry.second.client_listener_resource_name_template));
559  parts.push_back(
560  absl::StrFormat(" servers=[\n"
561  " {\n"
562  " uri=\"%s\",\n"
563  " creds_type=%s,\n",
564  entry.second.xds_servers[0].server_uri,
565  entry.second.xds_servers[0].channel_creds_type));
566  parts.push_back(" },\n");
567  }
568  parts.push_back("}");
569  parts.push_back("certificate_providers={\n");
570  for (const auto& entry : certificate_providers_) {
571  parts.push_back(
572  absl::StrFormat(" %s={\n"
573  " plugin_name=%s\n"
574  " config=%s\n"
575  " },\n",
576  entry.first, entry.second.plugin_name,
577  entry.second.config->ToString()));
578  }
579  parts.push_back("}");
580  return absl::StrJoin(parts, "");
581 }
582 
583 } // namespace grpc_core
grpc_core::Json::Array
std::vector< Json > Array
Definition: src/core/lib/json/json.h:55
grpc_core::CoreConfiguration::channel_creds_registry
const ChannelCredsRegistry & channel_creds_registry() const
Definition: core_configuration.h:149
grpc_core::XdsBootstrap::certificate_providers_
CertificateProviderStore::PluginDefinitionMap certificate_providers_
Definition: xds_bootstrap.h:136
grpc_core::XdsBootstrap::XdsServer::ToJson
Json::Object ToJson() const
Definition: xds_bootstrap.cc:147
grpc_core::XdsBootstrap::ParseAuthority
grpc_error_handle ParseAuthority(Json *json, const std::string &name)
Definition: xds_bootstrap.cc:327
grpc_core::XdsBootstrap::Create
static std::unique_ptr< XdsBootstrap > Create(absl::string_view json_string, grpc_error_handle *error)
Definition: xds_bootstrap.cc:180
regen-readme.it
it
Definition: regen-readme.py:15
GRPC_ERROR_NONE
#define GRPC_ERROR_NONE
Definition: error.h:234
core_configuration.h
grpc_core::Json::type
Type type() const
Definition: src/core/lib/json/json.h:174
absl::StrCat
std::string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: abseil-cpp/absl/strings/str_cat.cc:98
absl::StrFormat
ABSL_MUST_USE_RESULT std::string StrFormat(const FormatSpec< Args... > &format, const Args &... args)
Definition: abseil-cpp/absl/strings/str_format.h:338
grpc_core::XdsBootstrap::servers_
std::vector< XdsServer > servers_
Definition: xds_bootstrap.h:131
grpc_core::Json::Type::OBJECT
@ OBJECT
grpc_core
Definition: call_metric_recorder.h:31
grpc_core::XdsBootstrap::node_
std::unique_ptr< Node > node_
Definition: xds_bootstrap.h:132
string.h
absl::StartsWith
bool StartsWith(absl::string_view text, absl::string_view prefix) noexcept
Definition: third_party/abseil-cpp/absl/strings/match.h:58
grpc_core::XdsBootstrap::ParseNode
grpc_error_handle ParseNode(Json *json)
Definition: xds_bootstrap.cc:368
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
gpr_free
GPRAPI void gpr_free(void *ptr)
Definition: alloc.cc:51
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
error
grpc_error_handle error
Definition: retry_filter.cc:499
grpc_core::XdsBootstrap::XdsServer::IgnoreResourceDeletion
bool IgnoreResourceDeletion() const
Definition: xds_bootstrap.cc:171
grpc_core::Json::object_value
const Object & object_value() const
Definition: src/core/lib/json/json.h:177
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING
#define GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(desc, errs, count)
Definition: error.h:307
grpc_core::XdsBootstrap::ParseXdsServerList
grpc_error_handle ParseXdsServerList(Json *json, std::vector< XdsServer > *servers)
Definition: xds_bootstrap.cc:290
setup.name
name
Definition: setup.py:542
env.h
run_xds_tests.server_uri
string server_uri
Definition: run_xds_tests.py:3320
grpc_core::Json::mutable_object
Object * mutable_object()
Definition: src/core/lib/json/json.h:178
channel_creds_registry.h
grpc_core::XdsBootstrap::XdsBootstrap
XdsBootstrap(Json json, grpc_error_handle *error)
Definition: xds_bootstrap.cc:194
gpr_parse_bool_value
bool gpr_parse_bool_value(const char *value, bool *dst)
Definition: string.cc:325
grpc_core::XdsBootstrap::server_listener_resource_name_template_
std::string server_listener_resource_name_template_
Definition: xds_bootstrap.h:134
GRPC_ERROR_CREATE_FROM_VECTOR
#define GRPC_ERROR_CREATE_FROM_VECTOR(desc, error_list)
Definition: error.h:314
gpr_getenv
char * gpr_getenv(const char *name)
grpc_core::CertificateProviderFactory::CreateCertificateProviderConfig
virtual RefCountedPtr< Config > CreateCertificateProviderConfig(const Json &config_json, grpc_error_handle *error)=0
grpc_core::RefCountedPtr
Definition: ref_counted_ptr.h:35
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
absl::StrJoin
std::string StrJoin(Iterator start, Iterator end, absl::string_view sep, Formatter &&fmt)
Definition: abseil-cpp/absl/strings/str_join.h:239
grpc_core::CoreConfiguration::Get
static const CoreConfiguration & Get()
Definition: core_configuration.h:82
config
struct config_s config
Json
JSON (JavaScript Object Notation).
Definition: third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h:227
grpc_core::ChannelCredsRegistry::IsSupported
bool IsSupported(const std::string &creds_type) const
Definition: channel_creds_registry.h:79
grpc_core::XdsBootstrap::server
const XdsServer & server() const
Definition: xds_bootstrap.h:101
grpc_core::XdsBootstrap::XdsServer::ShouldUseV3
bool ShouldUseV3() const
Definition: xds_bootstrap.cc:166
xds_bootstrap.h
grpc_core::XdsBootstrap::ParseCertificateProvider
grpc_error_handle ParseCertificateProvider(const std::string &instance_name, Json *certificate_provider_json)
Definition: xds_bootstrap.cc:461
json_util.h
grpc_core::XdsBootstrap::ParseCertificateProviders
grpc_error_handle ParseCertificateProviders(Json *json)
Definition: xds_bootstrap.cc:445
grpc_core::XdsBootstrap::Authority::client_listener_resource_name_template
std::string client_listener_resource_name_template
Definition: xds_bootstrap.h:84
googletest-filter-unittest.child
child
Definition: bloaty/third_party/googletest/googletest/test/googletest-filter-unittest.py:62
grpc_core::Json::Type::ARRAY
@ ARRAY
grpc_core::XdsFederationEnabled
bool XdsFederationEnabled()
Definition: xds_bootstrap.cc:48
grpc_core::XdsBootstrap::ToString
std::string ToString() const
Definition: xds_bootstrap.cc:510
setup.idx
idx
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:197
GRPC_ERROR_CREATE_FROM_STATIC_STRING
#define GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc)
Definition: error.h:291
grpc_core::Json::Parse
static Json Parse(absl::string_view json_str, grpc_error_handle *error)
Definition: json_reader.cc:899
value
const char * value
Definition: hpack_parser_table.cc:165
grpc_core::Json::Object
std::map< std::string, Json > Object
Definition: src/core/lib/json/json.h:54
grpc_core::XdsBootstrap::XdsServerExists
bool XdsServerExists(const XdsServer &server) const
Definition: xds_bootstrap.cc:279
grpc_core::XdsBootstrap::XdsServer
Definition: xds_bootstrap.h:52
server
Definition: examples/python/async_streaming/server.py:1
grpc_core::XdsBootstrap::ParseLocality
grpc_error_handle ParseLocality(Json *json)
Definition: xds_bootstrap.cc:412
grpc_core::XdsBootstrap::client_default_listener_resource_name_template_
std::string client_default_listener_resource_name_template_
Definition: xds_bootstrap.h:133
GRPC_ERROR_CREATE_FROM_CPP_STRING
#define GRPC_ERROR_CREATE_FROM_CPP_STRING(desc)
Definition: error.h:297
grpc_core::Json::Type::JSON_NULL
@ JSON_NULL
alloc.h
certificate_provider_registry.h
certificate_provider_factory.h
GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING
#define GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(desc, error_list)
Definition: error.h:317
GRPC_ERROR_UNREF
#define GRPC_ERROR_UNREF(err)
Definition: error.h:262
ref_counted_ptr.h
grpc_core::XdsBootstrap::Authority::xds_servers
std::vector< XdsServer > xds_servers
Definition: xds_bootstrap.h:85
config_s
Definition: bloaty/third_party/zlib/deflate.c:120
grpc_core::XdsBootstrap::authorities_
std::map< std::string, Authority > authorities_
Definition: xds_bootstrap.h:135
grpc_core::XdsBootstrap::LookupAuthority
const Authority * LookupAuthority(const std::string &name) const
Definition: xds_bootstrap.cc:270
grpc_core::XdsBootstrap::Authority
Definition: xds_bootstrap.h:83
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
grpc_core::CertificateProviderFactory
Definition: certificate_provider_factory.h:37
grpc_core::Json::mutable_array
Array * mutable_array()
Definition: src/core/lib/json/json.h:180
grpc_error
Definition: error_internal.h:42
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
grpc_core::XdsBootstrap::ParseAuthorities
grpc_error_handle ParseAuthorities(Json *json)
Definition: xds_bootstrap.cc:312
grpc_core::CertificateProviderRegistry::LookupCertificateProviderFactory
static CertificateProviderFactory * LookupCertificateProviderFactory(absl::string_view name)
Definition: certificate_provider_registry.cc:70
grpc_core::XdsBootstrap::XdsServer::Parse
static XdsServer Parse(const Json &json, grpc_error_handle *error)
Definition: xds_bootstrap.cc:115
grpc_core::Json::Type::STRING
@ STRING
run_interop_tests.servers
servers
Definition: run_interop_tests.py:1288
grpc_core::ParseJsonObjectField
bool ParseJsonObjectField(const Json::Object &object, absl::string_view field_name, T *output, std::vector< grpc_error_handle > *error_list, bool required=true)
Definition: src/core/lib/json/json_util.h:136
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
GRPC_ERROR_IS_NONE
#define GRPC_ERROR_IS_NONE(err)
Definition: error.h:241
parse_error
@ parse_error
Definition: pem_info.c:88
port_platform.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:55