aws_external_account_credentials.cc
Go to the documentation of this file.
1 //
2 // Copyright 2020 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 //
17 
19 
20 #include <string.h>
21 
22 #include <map>
23 #include <utility>
24 
25 #include "absl/memory/memory.h"
26 #include "absl/status/status.h"
27 #include "absl/status/statusor.h"
28 #include "absl/strings/str_cat.h"
29 #include "absl/strings/str_format.h"
30 #include "absl/strings/str_replace.h"
31 #include "absl/strings/string_view.h"
32 
33 #include <grpc/grpc.h>
34 #include <grpc/grpc_security.h>
35 #include <grpc/support/alloc.h>
36 #include <grpc/support/log.h>
38 
39 #include "src/core/lib/gpr/env.h"
43 #include "src/core/lib/json/json.h"
46 
47 namespace grpc_core {
48 
49 namespace {
50 
51 const char* kExpectedEnvironmentId = "aws1";
52 
53 const char* kRegionEnvVar = "AWS_REGION";
54 const char* kDefaultRegionEnvVar = "AWS_DEFAULT_REGION";
55 const char* kAccessKeyIdEnvVar = "AWS_ACCESS_KEY_ID";
56 const char* kSecretAccessKeyEnvVar = "AWS_SECRET_ACCESS_KEY";
57 const char* kSessionTokenEnvVar = "AWS_SESSION_TOKEN";
58 
59 std::string UrlEncode(const absl::string_view& s) {
60  const char* hex = "0123456789ABCDEF";
62  result.reserve(s.length());
63  for (auto c : s) {
64  if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') ||
65  (c >= 'a' && c <= 'z') || c == '-' || c == '_' || c == '!' ||
66  c == '\'' || c == '(' || c == ')' || c == '*' || c == '~' || c == '.') {
67  result.push_back(c);
68  } else {
69  result.push_back('%');
70  result.push_back(hex[static_cast<unsigned char>(c) >> 4]);
71  result.push_back(hex[static_cast<unsigned char>(c) & 15]);
72  }
73  }
74  return result;
75 }
76 
77 } // namespace
78 
79 RefCountedPtr<AwsExternalAccountCredentials>
81  std::vector<std::string> scopes,
83  auto creds = MakeRefCounted<AwsExternalAccountCredentials>(
84  std::move(options), std::move(scopes), error);
85  if (GRPC_ERROR_IS_NONE(*error)) {
86  return creds;
87  } else {
88  return nullptr;
89  }
90 }
91 
93  Options options, std::vector<std::string> scopes, grpc_error_handle* error)
95  audience_ = options.audience;
96  auto it = options.credential_source.object_value().find("environment_id");
97  if (it == options.credential_source.object_value().end()) {
99  "environment_id field not present.");
100  return;
101  }
102  if (it->second.type() != Json::Type::STRING) {
104  "environment_id field must be a string.");
105  return;
106  }
107  if (it->second.string_value() != kExpectedEnvironmentId) {
108  *error =
109  GRPC_ERROR_CREATE_FROM_STATIC_STRING("environment_id does not match.");
110  return;
111  }
112  it = options.credential_source.object_value().find("region_url");
113  if (it == options.credential_source.object_value().end()) {
114  *error =
115  GRPC_ERROR_CREATE_FROM_STATIC_STRING("region_url field not present.");
116  return;
117  }
118  if (it->second.type() != Json::Type::STRING) {
120  "region_url field must be a string.");
121  return;
122  }
123  region_url_ = it->second.string_value();
124  it = options.credential_source.object_value().find("url");
125  if (it != options.credential_source.object_value().end() &&
126  it->second.type() == Json::Type::STRING) {
127  url_ = it->second.string_value();
128  }
129  it = options.credential_source.object_value().find(
130  "regional_cred_verification_url");
131  if (it == options.credential_source.object_value().end()) {
133  "regional_cred_verification_url field not present.");
134  return;
135  }
136  if (it->second.type() != Json::Type::STRING) {
138  "regional_cred_verification_url field must be a string.");
139  return;
140  }
141  regional_cred_verification_url_ = it->second.string_value();
142  it =
143  options.credential_source.object_value().find("imdsv2_session_token_url");
144  if (it != options.credential_source.object_value().end() &&
145  it->second.type() == Json::Type::STRING) {
146  imdsv2_session_token_url_ = it->second.string_value();
147  }
148 }
149 
151  HTTPRequestContext* ctx, const Options& /*options*/,
153  if (ctx == nullptr) {
155  "",
157  "Missing HTTPRequestContext to start subject token retrieval."));
158  return;
159  }
160  ctx_ = ctx;
161  cb_ = cb;
162  if (!imdsv2_session_token_url_.empty()) {
164  } else if (signer_ != nullptr) {
166  } else {
167  RetrieveRegion();
168  }
169 }
170 
173  if (!uri.ok()) {
174  return;
175  }
176  grpc_http_header* headers =
177  static_cast<grpc_http_header*>(gpr_malloc(sizeof(grpc_http_header)));
178  headers[0].key = gpr_strdup("x-aws-ec2-metadata-token-ttl-seconds");
179  headers[0].value = gpr_strdup("300");
181  memset(&request, 0, sizeof(grpc_http_request));
182  request.hdr_count = 1;
183  request.hdrs = headers;
185  ctx_->response = {};
187  nullptr);
188  RefCountedPtr<grpc_channel_credentials> http_request_creds;
189  if (uri->scheme() == "http") {
190  http_request_creds = RefCountedPtr<grpc_channel_credentials>(
192  } else {
193  http_request_creds = CreateHttpRequestSSLCredentials();
194  }
195  http_request_ =
196  HttpRequest::Put(std::move(*uri), nullptr /* channel args */,
198  &ctx_->response, std::move(http_request_creds));
199  http_request_->Start();
201 }
202 
204  void* arg, grpc_error_handle error) {
206  static_cast<AwsExternalAccountCredentials*>(arg);
208 }
209 
212  if (!GRPC_ERROR_IS_NONE(error)) {
214  return;
215  }
218  if (signer_ != nullptr) {
220  } else {
221  RetrieveRegion();
222  }
223 }
224 
227  if (!imdsv2_session_token_.empty()) {
228  GPR_ASSERT(request->hdr_count == 0);
229  GPR_ASSERT(request->hdrs == nullptr);
230  grpc_http_header* headers =
231  static_cast<grpc_http_header*>(gpr_malloc(sizeof(grpc_http_header)));
232  headers[0].key = gpr_strdup("x-aws-ec2-metadata-token");
233  headers[0].value = gpr_strdup(imdsv2_session_token_.c_str());
234  request->hdr_count = 1;
235  request->hdrs = headers;
236  }
237 }
238 
240  UniquePtr<char> region_from_env(gpr_getenv(kRegionEnvVar));
241  if (region_from_env == nullptr) {
242  region_from_env = UniquePtr<char>(gpr_getenv(kDefaultRegionEnvVar));
243  }
244  if (region_from_env != nullptr) {
245  region_ = std::string(region_from_env.get());
246  if (url_.empty()) {
248  } else {
250  }
251  return;
252  }
254  if (!uri.ok()) {
257  "Invalid region url. %s", uri.status().ToString())));
258  return;
259  }
261  memset(&request, 0, sizeof(grpc_http_request));
263  ctx_->response = {};
265  GRPC_CLOSURE_INIT(&ctx_->closure, OnRetrieveRegion, this, nullptr);
266  RefCountedPtr<grpc_channel_credentials> http_request_creds;
267  if (uri->scheme() == "http") {
268  http_request_creds = RefCountedPtr<grpc_channel_credentials>(
270  } else {
271  http_request_creds = CreateHttpRequestSSLCredentials();
272  }
273  http_request_ =
274  HttpRequest::Get(std::move(*uri), nullptr /* channel args */,
276  &ctx_->response, std::move(http_request_creds));
277  http_request_->Start();
279 }
280 
284  static_cast<AwsExternalAccountCredentials*>(arg);
286 }
287 
290  if (!GRPC_ERROR_IS_NONE(error)) {
292  return;
293  }
294  // Remove the last letter of availability zone to get pure region
295  absl::string_view response_body(ctx_->response.body,
297  region_ = std::string(response_body.substr(0, response_body.size() - 1));
298  if (url_.empty()) {
300  } else {
302  }
303 }
304 
307  if (!uri.ok()) {
310  absl::StrFormat("Invalid url: %s.", uri.status().ToString())));
311  return;
312  }
314  memset(&request, 0, sizeof(grpc_http_request));
316  ctx_->response = {};
319  // TODO(ctiller): use the caller's resource quota.
320  RefCountedPtr<grpc_channel_credentials> http_request_creds;
321  if (uri->scheme() == "http") {
322  http_request_creds = RefCountedPtr<grpc_channel_credentials>(
324  } else {
325  http_request_creds = CreateHttpRequestSSLCredentials();
326  }
327  http_request_ =
328  HttpRequest::Get(std::move(*uri), nullptr /* channel args */,
330  &ctx_->response, std::move(http_request_creds));
331  http_request_->Start();
333 }
334 
336  void* arg, grpc_error_handle error) {
338  static_cast<AwsExternalAccountCredentials*>(arg);
340 }
341 
344  if (!GRPC_ERROR_IS_NONE(error)) {
346  return;
347  }
350 }
351 
353  UniquePtr<char> access_key_id_from_env(gpr_getenv(kAccessKeyIdEnvVar));
354  UniquePtr<char> secret_access_key_from_env(
355  gpr_getenv(kSecretAccessKeyEnvVar));
356  UniquePtr<char> token_from_env(gpr_getenv(kSessionTokenEnvVar));
357  if (access_key_id_from_env != nullptr &&
358  secret_access_key_from_env != nullptr && token_from_env != nullptr) {
359  access_key_id_ = std::string(access_key_id_from_env.get());
360  secret_access_key_ = std::string(secret_access_key_from_env.get());
361  token_ = std::string(token_from_env.get());
363  return;
364  }
365  if (role_name_.empty()) {
368  "Missing role name when retrieving signing keys."));
369  return;
370  }
371  std::string url_with_role_name = absl::StrCat(url_, "/", role_name_);
372  absl::StatusOr<URI> uri = URI::Parse(url_with_role_name);
373  if (!uri.ok()) {
376  "Invalid url with role name: %s.", uri.status().ToString())));
377  return;
378  }
380  memset(&request, 0, sizeof(grpc_http_request));
382  ctx_->response = {};
385  // TODO(ctiller): use the caller's resource quota.
386  RefCountedPtr<grpc_channel_credentials> http_request_creds;
387  if (uri->scheme() == "http") {
388  http_request_creds = RefCountedPtr<grpc_channel_credentials>(
390  } else {
391  http_request_creds = CreateHttpRequestSSLCredentials();
392  }
393  http_request_ =
394  HttpRequest::Get(std::move(*uri), nullptr /* channel args */,
396  &ctx_->response, std::move(http_request_creds));
397  http_request_->Start();
399 }
400 
402  void* arg, grpc_error_handle error) {
404  static_cast<AwsExternalAccountCredentials*>(arg);
406 }
407 
410  if (!GRPC_ERROR_IS_NONE(error)) {
412  return;
413  }
414  absl::string_view response_body(ctx_->response.body,
416  Json json = Json::Parse(response_body, &error);
417  if (!GRPC_ERROR_IS_NONE(error) || json.type() != Json::Type::OBJECT) {
420  "Invalid retrieve signing keys response.", &error, 1));
422  return;
423  }
424  auto it = json.object_value().find("AccessKeyId");
425  if (it != json.object_value().end() &&
426  it->second.type() == Json::Type::STRING) {
427  access_key_id_ = it->second.string_value();
428  } else {
431  "Missing or invalid AccessKeyId in %s.", response_body)));
432  return;
433  }
434  it = json.object_value().find("SecretAccessKey");
435  if (it != json.object_value().end() &&
436  it->second.type() == Json::Type::STRING) {
437  secret_access_key_ = it->second.string_value();
438  } else {
441  "Missing or invalid SecretAccessKey in %s.", response_body)));
442  return;
443  }
444  it = json.object_value().find("Token");
445  if (it != json.object_value().end() &&
446  it->second.type() == Json::Type::STRING) {
447  token_ = it->second.string_value();
448  } else {
451  "Missing or invalid Token in %s.", response_body)));
452  return;
453  }
455 }
456 
459  if (signer_ == nullptr) {
461  regional_cred_verification_url_, {{"{region}", region_}});
462  signer_ = absl::make_unique<AwsRequestSigner>(
465  std::map<std::string, std::string>(), &error);
466  if (!GRPC_ERROR_IS_NONE(error)) {
469  "Creating aws request signer failed.", &error, 1));
471  return;
472  }
473  }
474  auto signed_headers = signer_->GetSignedRequestHeaders();
475  if (!GRPC_ERROR_IS_NONE(error)) {
478  "Invalid getting signed request"
479  "headers.",
480  &error, 1));
482  return;
483  }
484  // Construct subject token
485  Json::Array headers;
486  headers.push_back(Json(
487  {{"key", "Authorization"}, {"value", signed_headers["Authorization"]}}));
488  headers.push_back(Json({{"key", "host"}, {"value", signed_headers["host"]}}));
489  headers.push_back(
490  Json({{"key", "x-amz-date"}, {"value", signed_headers["x-amz-date"]}}));
491  headers.push_back(Json({{"key", "x-amz-security-token"},
492  {"value", signed_headers["x-amz-security-token"]}}));
493  headers.push_back(
494  Json({{"key", "x-goog-cloud-target-resource"}, {"value", audience_}}));
495  Json::Object object{{"url", Json(cred_verification_url_)},
496  {"method", Json("POST")},
497  {"headers", Json(headers)}};
498  Json subject_token_json(object);
499  std::string subject_token = UrlEncode(subject_token_json.Dump());
501 }
502 
504  std::string subject_token, grpc_error_handle error) {
505  // Reset context
506  ctx_ = nullptr;
507  // Move object state into local variables.
508  auto cb = cb_;
509  cb_ = nullptr;
510  // Invoke the callback.
511  if (!GRPC_ERROR_IS_NONE(error)) {
512  cb("", error);
513  } else {
514  cb(subject_token, GRPC_ERROR_NONE);
515  }
516 }
517 
518 } // namespace grpc_core
grpc_core::AwsExternalAccountCredentials::RetrieveRoleName
void RetrieveRoleName()
Definition: aws_external_account_credentials.cc:305
grpc_core::Json::Array
std::vector< Json > Array
Definition: src/core/lib/json/json.h:55
GRPC_CLOSURE_INIT
#define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler)
Definition: closure.h:115
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
grpc_core::AwsExternalAccountCredentials::http_request_
OrphanablePtr< HttpRequest > http_request_
Definition: aws_external_account_credentials.h:75
cleanup.Json
Json
Definition: cleanup.py:49
regen-readme.it
it
Definition: regen-readme.py:15
GRPC_ERROR_NONE
#define GRPC_ERROR_NONE
Definition: error.h:234
log.h
grpc_core::AwsExternalAccountCredentials::signer_
std::unique_ptr< AwsRequestSigner > signer_
Definition: aws_external_account_credentials.h:91
grpc_core::AwsExternalAccountCredentials::ctx_
HTTPRequestContext * ctx_
Definition: aws_external_account_credentials.h:94
grpc_core::AwsExternalAccountCredentials::region_url_
std::string region_url_
Definition: aws_external_account_credentials.h:78
ctx
Definition: benchmark-async.c:30
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
memset
return memset(p, 0, total)
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::AwsExternalAccountCredentials::RetrieveSubjectToken
void RetrieveSubjectToken(HTTPRequestContext *ctx, const Options &options, std::function< void(std::string, grpc_error_handle)> cb) override
Definition: aws_external_account_credentials.cc:150
grpc_core::Json::Type::OBJECT
@ OBJECT
grpc_core
Definition: call_metric_recorder.h:31
grpc_http_response::body
char * body
Definition: src/core/lib/http/parser.h:96
grpc_core::ExternalAccountCredentials::HTTPRequestContext::pollent
grpc_polling_entity * pollent
Definition: external_account_credentials.h:81
string.h
options
double_dict options[]
Definition: capstone_test.c:55
benchmark.request
request
Definition: benchmark.py:77
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
grpc_core::ExternalAccountCredentials::HTTPRequestContext
Definition: external_account_credentials.h:74
grpc_core::AwsExternalAccountCredentials::OnRetrieveImdsV2SessionTokenInternal
void OnRetrieveImdsV2SessionTokenInternal(grpc_error_handle error)
Definition: aws_external_account_credentials.cc:210
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::ExternalAccountCredentials
Definition: external_account_credentials.h:45
grpc_core::Json::object_value
const Object & object_value() const
Definition: src/core/lib/json/json.h:177
gpr_malloc
GPRAPI void * gpr_malloc(size_t size)
Definition: alloc.cc:29
closure.h
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING
#define GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(desc, errs, count)
Definition: error.h:307
ctx
static struct test_ctx ctx
Definition: test-ipc-send-recv.c:65
env.h
absl::FormatConversionChar::s
@ s
grpc_core::AwsExternalAccountCredentials::RetrieveImdsV2SessionToken
void RetrieveImdsV2SessionToken()
Definition: aws_external_account_credentials.cc:171
grpc_core::CreateHttpRequestSSLCredentials
RefCountedPtr< grpc_channel_credentials > CreateHttpRequestSSLCredentials()
Definition: httpcli_security_connector.cc:208
grpc_security.h
grpc_core::AwsExternalAccountCredentials::OnRetrieveRegion
static void OnRetrieveRegion(void *arg, grpc_error_handle error)
Definition: aws_external_account_credentials.cc:281
grpc_core::URI::Parse
static absl::StatusOr< URI > Parse(absl::string_view uri_text)
Definition: uri_parser.cc:209
grpc_core::AwsExternalAccountCredentials::OnRetrieveRoleNameInternal
void OnRetrieveRoleNameInternal(grpc_error_handle error)
Definition: aws_external_account_credentials.cc:342
credentials.h
grpc_core::AwsExternalAccountCredentials::RetrieveSigningKeys
void RetrieveSigningKeys()
Definition: aws_external_account_credentials.cc:352
grpc_core::AwsExternalAccountCredentials::Create
static RefCountedPtr< AwsExternalAccountCredentials > Create(Options options, std::vector< std::string > scopes, grpc_error_handle *error)
Definition: aws_external_account_credentials.cc:80
grpc_core::AwsExternalAccountCredentials::audience_
std::string audience_
Definition: aws_external_account_credentials.h:74
memory.h
string_util.h
grpc_core::AwsExternalAccountCredentials::RetrieveRegion
void RetrieveRegion()
Definition: aws_external_account_credentials.cc:239
grpc_http_request_destroy
void grpc_http_request_destroy(grpc_http_request *request)
Definition: src/core/lib/http/parser.cc:422
grpc_core::AwsExternalAccountCredentials::regional_cred_verification_url_
std::string regional_cred_verification_url_
Definition: aws_external_account_credentials.h:80
grpc_http_header::key
char * key
Definition: src/core/lib/http/parser.h:37
gpr_getenv
char * gpr_getenv(const char *name)
grpc_core::RefCountedPtr< grpc_channel_credentials >
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
grpc_http_header
Definition: src/core/lib/http/parser.h:36
absl::string_view::size
constexpr size_type size() const noexcept
Definition: abseil-cpp/absl/strings/string_view.h:277
Json
JSON (JavaScript Object Notation).
Definition: third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h:227
grpc_core::AwsExternalAccountCredentials::url_
std::string url_
Definition: aws_external_account_credentials.h:79
grpc_core::AwsExternalAccountCredentials::OnRetrieveRoleName
static void OnRetrieveRoleName(void *arg, grpc_error_handle error)
Definition: aws_external_account_credentials.cc:335
httpcli_ssl_credentials.h
grpc.h
grpc_core::AwsExternalAccountCredentials
Definition: aws_external_account_credentials.h:37
grpc_insecure_credentials_create
GRPCAPI grpc_channel_credentials * grpc_insecure_credentials_create()
Definition: core/lib/security/credentials/insecure/insecure_credentials.cc:64
arg
Definition: cmdline.cc:40
grpc_core::ExternalAccountCredentials::HTTPRequestContext::closure
grpc_closure closure
Definition: external_account_credentials.h:85
grpc_http_response_destroy
void grpc_http_response_destroy(grpc_http_response *response)
Definition: src/core/lib/http/parser.cc:434
grpc_core::AwsExternalAccountCredentials::OnRetrieveSigningKeysInternal
void OnRetrieveSigningKeysInternal(grpc_error_handle error)
Definition: aws_external_account_credentials.cc:408
grpc_core::AwsExternalAccountCredentials::FinishRetrieveSubjectToken
void FinishRetrieveSubjectToken(std::string subject_token, grpc_error_handle error)
Definition: aws_external_account_credentials.cc:503
grpc_core::AwsExternalAccountCredentials::OnRetrieveRegionInternal
void OnRetrieveRegionInternal(grpc_error_handle error)
Definition: aws_external_account_credentials.cc:288
json.h
grpc_core::ExternalAccountCredentials::HTTPRequestContext::deadline
Timestamp deadline
Definition: external_account_credentials.h:82
grpc_core::UniquePtr
std::unique_ptr< T, DefaultDeleteChar > UniquePtr
Definition: src/core/lib/gprpp/memory.h:43
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
grpc_core::AwsExternalAccountCredentials::imdsv2_session_token_
std::string imdsv2_session_token_
Definition: aws_external_account_credentials.h:89
grpc_core::ExternalAccountCredentials::HTTPRequestContext::response
grpc_http_response response
Definition: external_account_credentials.h:86
grpc_core::Json::Object
std::map< std::string, Json > Object
Definition: src/core/lib/json/json.h:54
absl::chars_format::hex
@ hex
absl::StatusOr::ok
ABSL_MUST_USE_RESULT bool ok() const
Definition: abseil-cpp/absl/status/statusor.h:491
grpc_core::AwsExternalAccountCredentials::OnRetrieveImdsV2SessionToken
static void OnRetrieveImdsV2SessionToken(void *arg, grpc_error_handle error)
Definition: aws_external_account_credentials.cc:203
GRPC_ERROR_REF
#define GRPC_ERROR_REF(err)
Definition: error.h:261
grpc_core::HttpRequest::Get
static OrphanablePtr< HttpRequest > Get(URI uri, const grpc_channel_args *args, grpc_polling_entity *pollent, const grpc_http_request *request, Timestamp deadline, grpc_closure *on_done, grpc_http_response *response, RefCountedPtr< grpc_channel_credentials > channel_creds) GRPC_MUST_USE_RESULT
Definition: httpcli.cc:69
grpc_core::AwsExternalAccountCredentials::imdsv2_session_token_url_
std::string imdsv2_session_token_url_
Definition: aws_external_account_credentials.h:81
grpc_core::AwsExternalAccountCredentials::token_
std::string token_
Definition: aws_external_account_credentials.h:88
grpc_http_response::body_length
size_t body_length
Definition: src/core/lib/http/parser.h:92
grpc_core::AwsExternalAccountCredentials::cb_
std::function< void(std::string, grpc_error_handle)> cb_
Definition: aws_external_account_credentials.h:95
grpc_core::AwsExternalAccountCredentials::AwsExternalAccountCredentials
AwsExternalAccountCredentials(Options options, std::vector< std::string > scopes, grpc_error_handle *error)
Definition: aws_external_account_credentials.cc:92
GRPC_ERROR_CREATE_FROM_CPP_STRING
#define GRPC_ERROR_CREATE_FROM_CPP_STRING(desc)
Definition: error.h:297
alloc.h
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
absl::StrReplaceAll
std::string StrReplaceAll(absl::string_view s, strings_internal::FixedMapping replacements)
Definition: abseil-cpp/absl/strings/str_replace.cc:71
grpc_http_header::value
char * value
Definition: src/core/lib/http/parser.h:38
arg
struct arg arg
GRPC_ERROR_UNREF
#define GRPC_ERROR_UNREF(err)
Definition: error.h:262
grpc_core::AwsExternalAccountCredentials::BuildSubjectToken
void BuildSubjectToken()
Definition: aws_external_account_credentials.cc:457
grpc_core::AwsExternalAccountCredentials::secret_access_key_
std::string secret_access_key_
Definition: aws_external_account_credentials.h:87
grpc_core::AwsExternalAccountCredentials::OnRetrieveSigningKeys
static void OnRetrieveSigningKeys(void *arg, grpc_error_handle error)
Definition: aws_external_account_credentials.cc:401
gpr_strdup
GPRAPI char * gpr_strdup(const char *src)
Definition: string.cc:39
grpc_core::AwsExternalAccountCredentials::role_name_
std::string role_name_
Definition: aws_external_account_credentials.h:85
grpc_core::AwsExternalAccountCredentials::AddMetadataRequestHeaders
void AddMetadataRequestHeaders(grpc_http_request *request)
Definition: aws_external_account_credentials.cc:225
absl::StatusOr
Definition: abseil-cpp/absl/status/statusor.h:187
uri_parser.h
grpc_core::AwsExternalAccountCredentials::cred_verification_url_
std::string cred_verification_url_
Definition: aws_external_account_credentials.h:92
grpc_core::HttpRequest::Put
static OrphanablePtr< HttpRequest > Put(URI uri, const grpc_channel_args *args, grpc_polling_entity *pollent, const grpc_http_request *request, Timestamp deadline, grpc_closure *on_done, grpc_http_response *response, RefCountedPtr< grpc_channel_credentials > channel_creds) GRPC_MUST_USE_RESULT
Definition: httpcli.cc:119
grpc_error
Definition: error_internal.h:42
function
std::function< bool(GrpcTool *, int, const char **, const CliCredentials &, GrpcToolOutputCallback)> function
Definition: grpc_tool.cc:250
aws_external_account_credentials.h
absl::string_view::substr
constexpr string_view substr(size_type pos=0, size_type n=npos) const
Definition: abseil-cpp/absl/strings/string_view.h:399
grpc_core::AwsExternalAccountCredentials::access_key_id_
std::string access_key_id_
Definition: aws_external_account_credentials.h:86
grpc_core::AwsExternalAccountCredentials::region_
std::string region_
Definition: aws_external_account_credentials.h:84
grpc_core::Json::Dump
std::string Dump(int indent=0) const
Definition: json_writer.cc:336
cb
OPENSSL_EXPORT pem_password_cb * cb
Definition: pem.h:351
grpc_core::Json::Type::STRING
@ STRING
absl::StatusOr::status
const Status & status() const &
Definition: abseil-cpp/absl/status/statusor.h:678
grpc_core::ExternalAccountCredentials::Options
Definition: external_account_credentials.h:49
GRPC_ERROR_IS_NONE
#define GRPC_ERROR_IS_NONE(err)
Definition: error.h:241
grpc_http_request
Definition: src/core/lib/http/parser.h:69
port_platform.h


grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:45