Skip to content

Commit 9143e84

Browse files
authored
Merge pull request #43 from rockspore/create-pull-request/patch-a19b234
Automated fix for refs/heads/external_account_creds
2 parents a19b234 + f61b1b7 commit 9143e84

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/core/credentials/call/external/aws_external_account_credentials.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ void AwsExternalAccountCredentials::AwsFetchBody::RetrieveSigningKeys() {
292292
return;
293293
}
294294
if (role_name_.empty()) {
295-
AsyncFinish(
296-
absl::UnauthenticatedError("Missing role name when retrieving signing keys."));
295+
AsyncFinish(absl::UnauthenticatedError(
296+
"Missing role name when retrieving signing keys."));
297297
return;
298298
}
299299
std::string url_with_role_name = absl::StrCat(creds_->url_, "/", role_name_);

src/core/credentials/call/external/external_account_credentials.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,13 @@ void ExternalAccountCredentials::HttpFetchBody::OnHttpResponse(
109109
absl::string_view response_body(self->response_.body,
110110
self->response_.body_length);
111111
if (self->response_.status != 200) {
112-
grpc_status_code status_code = grpc_http2_status_to_grpc_status(self->response_.status);
112+
grpc_status_code status_code =
113+
grpc_http2_status_to_grpc_status(self->response_.status);
113114
if (status_code != GRPC_STATUS_UNAVAILABLE) {
114115
status_code = GRPC_STATUS_UNAUTHENTICATED;
115116
}
116-
self->Finish(absl::Status(static_cast<absl::StatusCode>(status_code),
117+
self->Finish(absl::Status(
118+
static_cast<absl::StatusCode>(status_code),
117119
absl::StrCat("Call to HTTP server ended with status ",
118120
self->response_.status, " [", response_body, "]")));
119121
return;

test/core/credentials/call/call_credentials_test.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,8 +2404,7 @@ int external_account_creds_httpcli_post_failure_token_exchange_bad_request(
24042404
absl::string_view /*body*/, Timestamp /*deadline*/, grpc_closure* on_done,
24052405
grpc_http_response* response) {
24062406
if (uri.path() == "/token") {
2407-
*response = http_response(400,
2408-
"");
2407+
*response = http_response(400, "");
24092408
} else if (uri.path() == "/service_account_impersonation") {
24102409
*response = http_response(
24112410
200,
@@ -3294,8 +3293,7 @@ TEST_F(ExternalAccountCredentialsTest,
32943293
HttpRequest::SetOverride(nullptr, nullptr, nullptr);
32953294
}
32963295

3297-
TEST_F(ExternalAccountCredentialsTest,
3298-
FailureTokenExchangeResponseNotOk) {
3296+
TEST_F(ExternalAccountCredentialsTest, FailureTokenExchangeResponseNotOk) {
32993297
ExecCtx exec_ctx;
33003298
Json credential_source = Json::FromString("");
33013299
TestExternalAccountCredentials::ServiceAccountImpersonation
@@ -3322,7 +3320,8 @@ TEST_F(ExternalAccountCredentialsTest,
33223320
external_account_creds_httpcli_post_failure_token_exchange_bad_request,
33233321
httpcli_put_should_not_be_called);
33243322
grpc_error_handle expected_error = absl::UnauthenticatedError(
3325-
"error fetching oauth2 token: Call to HTTP server ended with status 400 []");
3323+
"error fetching oauth2 token: Call to HTTP server ended with status 400 "
3324+
"[]");
33263325
auto state = RequestMetadataState::NewInstance(expected_error, {});
33273326
state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
33283327
kTestPath);

0 commit comments

Comments
 (0)