Skip to content

Commit

Permalink
[call creds] revert grpc#37544 and grpc#37531 (grpc#37567)
Browse files Browse the repository at this point in the history
The changes in grpc#37531 are causing test failures under run_tests.py (but not bazel), and grpc#37544 was built on top of grpc#37531, so both need to be reverted.

Closes grpc#37567

COPYBARA_INTEGRATE_REVIEW=grpc#37567 from markdroth:call_creds_revert d086e06
PiperOrigin-RevId: 666978406
  • Loading branch information
markdroth authored and paulosjca committed Aug 25, 2024
1 parent 4fb80e2 commit b8bf7ea
Show file tree
Hide file tree
Showing 17 changed files with 110 additions and 1,191 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions build_autogenerated.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion doc/trace_flags.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 1 addition & 49 deletions src/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4335,17 +4335,14 @@ grpc_cc_library(
deps = [
"arena_promise",
"context",
"default_event_engine",
"metadata",
"poll",
"pollset_set",
"ref_counted",
"time",
"useful",
"//:backoff",
"//:gpr",
"//:grpc_security_base",
"//:grpc_trace",
"//:httpcli",
"//:iomgr",
"//:orphanable",
Expand All @@ -4354,52 +4351,6 @@ grpc_cc_library(
],
)

grpc_cc_library(
name = "gcp_service_account_identity_credentials",
srcs = [
"lib/security/credentials/gcp_service_account_identity/gcp_service_account_identity_credentials.cc",
],
hdrs = [
"lib/security/credentials/gcp_service_account_identity/gcp_service_account_identity_credentials.h",
],
external_deps = [
"absl/functional:any_invocable",
"absl/status",
"absl/status:statusor",
"absl/strings",
],
language = "c++",
deps = [
"activity",
"arena_promise",
"closure",
"error",
"json",
"json_args",
"json_object_loader",
"json_reader",
"metadata",
"pollset_set",
"ref_counted",
"slice",
"status_conversion",
"status_helper",
"time",
"token_fetcher_credentials",
"unique_type_name",
"//:gpr",
"//:grpc_base",
"//:grpc_core_credentials_header",
"//:grpc_security_base",
"//:httpcli",
"//:iomgr",
"//:orphanable",
"//:promise",
"//:ref_counted_ptr",
"//:uri_parser",
],
)

grpc_cc_library(
name = "grpc_oauth2_credentials",
srcs = [
Expand Down Expand Up @@ -4485,6 +4436,7 @@ grpc_cc_library(
language = "c++",
deps = [
"closure",
"default_event_engine",
"env",
"error",
"error_utils",
Expand Down
2 changes: 0 additions & 2 deletions src/core/lib/debug/trace_flags.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/core/lib/debug/trace_flags.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/core/lib/debug/trace_flags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,6 @@ timer:
timer_check:
default: false
description: more detailed trace of timer logic in grpc internals.
token_fetcher_credentials:
default: false
description: Token fetcher call credentials framework, used for (e.g.) oauth2 token fetcher credentials.
tsi:
default: false
description: TSI transport security.
Expand Down
2 changes: 1 addition & 1 deletion src/core/lib/promise/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION auto CheckDelayed(Promise promise) {
delayed = true;
return Pending{};
}
return std::make_tuple(std::move(r.value()), delayed);
return std::make_tuple(r.value(), delayed);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h>

#include "src/core/lib/event_engine/default_event_engine.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/credentials/external/aws_external_account_credentials.h"
Expand Down Expand Up @@ -590,7 +591,10 @@ ExternalAccountCredentials::Create(
ExternalAccountCredentials::ExternalAccountCredentials(
Options options, std::vector<std::string> scopes,
std::shared_ptr<grpc_event_engine::experimental::EventEngine> event_engine)
: TokenFetcherCredentials(std::move(event_engine)),
: event_engine_(
event_engine == nullptr
? grpc_event_engine::experimental::GetDefaultEventEngine()
: std::move(event_engine)),
options_(std::move(options)) {
if (scopes.empty()) {
scopes.push_back(GOOGLE_CLOUD_PLATFORM_DEFAULT_SCOPE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ class ExternalAccountCredentials : public TokenFetcherCredentials {

absl::string_view audience() const { return options_.audience; }

grpc_event_engine::experimental::EventEngine& event_engine() const {
return *event_engine_;
}

private:
OrphanablePtr<FetchRequest> FetchToken(
Timestamp deadline,
Expand All @@ -200,6 +204,7 @@ class ExternalAccountCredentials : public TokenFetcherCredentials {
Timestamp deadline,
absl::AnyInvocable<void(absl::StatusOr<std::string>)> on_done) = 0;

std::shared_ptr<grpc_event_engine::experimental::EventEngine> event_engine_;
Options options_;
std::vector<std::string> scopes_;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <grpc/support/json.h>
#include <grpc/support/port_platform.h>

#include "src/core/lib/event_engine/default_event_engine.h"
#include "src/core/lib/gprpp/load_file.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/slice/slice_internal.h"
Expand Down

This file was deleted.

Loading

0 comments on commit b8bf7ea

Please sign in to comment.