diff --git a/src/core/BUILD b/src/core/BUILD index c411bf45c4a17..d003d86249416 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -5016,6 +5016,7 @@ grpc_cc_library( "channel_args", "channel_fwd", "context", + "gcp_service_account_identity_credentials", "grpc_resolver_xds_attributes", "grpc_service_config", "json", diff --git a/src/core/ext/filters/gcp_auth/gcp_auth_filter.cc b/src/core/ext/filters/gcp_auth/gcp_auth_filter.cc index 4cba19616596c..e2b693163591c 100644 --- a/src/core/ext/filters/gcp_auth/gcp_auth_filter.cc +++ b/src/core/ext/filters/gcp_auth/gcp_auth_filter.cc @@ -29,6 +29,7 @@ #include "src/core/lib/promise/context.h" #include "src/core/lib/resource_quota/arena.h" #include "src/core/lib/security/context/security_context.h" +#include "src/core/lib/security/credentials/gcp_service_account_identity/gcp_service_account_identity_credentials.h" #include "src/core/lib/transport/transport.h" #include "src/core/resolver/xds/xds_resolver_attributes.h" #include "src/core/service_config/service_config.h" @@ -144,7 +145,7 @@ GcpAuthenticationFilter::Create(const ChannelArgs& args, GcpAuthenticationFilter::GcpAuthenticationFilter( const GcpAuthenticationParsedConfig::Config* filter_config, - RefCountedPtr xds_config) + RefCountedPtr xds_config) : filter_config_(filter_config), xds_config_(std::move(xds_config)), cache_(filter_config->cache_size) {} @@ -152,10 +153,11 @@ GcpAuthenticationFilter::GcpAuthenticationFilter( RefCountedPtr GcpAuthenticationFilter::GetCallCredentials(const std::string& audience) { MutexLock lock(&mu_); - cache_.GetOrInsert( + return cache_.GetOrInsert( audience, [](const std::string& audience) { - return MakeRefCounted(audience); + return MakeRefCounted( + audience); }); } diff --git a/src/core/ext/filters/gcp_auth/gcp_auth_filter.h b/src/core/ext/filters/gcp_auth/gcp_auth_filter.h index 2bbd241341879..88ccf25d77154 100644 --- a/src/core/ext/filters/gcp_auth/gcp_auth_filter.h +++ b/src/core/ext/filters/gcp_auth/gcp_auth_filter.h @@ -51,7 +51,7 @@ class GcpAuthenticationFilter GcpAuthenticationFilter( const GcpAuthenticationParsedConfig::Config* filter_config, - RefCountedPtr xds_config); + RefCountedPtr xds_config); class Call { public: @@ -70,7 +70,7 @@ class GcpAuthenticationFilter const std::string& audience); const GcpAuthenticationParsedConfig::Config* filter_config_; - const RefCountedPtr xds_config_; + const RefCountedPtr xds_config_; Mutex mu_; LruCache>