Skip to content

Commit

Permalink
finish fixing build
Browse files Browse the repository at this point in the history
  • Loading branch information
markdroth committed Aug 22, 2024
1 parent 2142806 commit c33b4cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 5 additions & 3 deletions src/core/ext/filters/gcp_auth/gcp_auth_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -144,18 +145,19 @@ GcpAuthenticationFilter::Create(const ChannelArgs& args,

GcpAuthenticationFilter::GcpAuthenticationFilter(
const GcpAuthenticationParsedConfig::Config* filter_config,
RefCountedPtr<XdsConfig> xds_config)
RefCountedPtr<const XdsConfig> xds_config)
: filter_config_(filter_config),
xds_config_(std::move(xds_config)),
cache_(filter_config->cache_size) {}

RefCountedPtr<grpc_call_credentials>
GcpAuthenticationFilter::GetCallCredentials(const std::string& audience) {
MutexLock lock(&mu_);
cache_.GetOrInsert(
return cache_.GetOrInsert(
audience,
[](const std::string& audience) {
return MakeRefCounted<GcpServiceAccountIdentityCredentials>(audience);
return MakeRefCounted<GcpServiceAccountIdentityCallCredentials>(
audience);
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/core/ext/filters/gcp_auth/gcp_auth_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class GcpAuthenticationFilter

GcpAuthenticationFilter(
const GcpAuthenticationParsedConfig::Config* filter_config,
RefCountedPtr<XdsDependencyManager::XdsConfig> xds_config);
RefCountedPtr<const XdsDependencyManager::XdsConfig> xds_config);

class Call {
public:
Expand All @@ -70,7 +70,7 @@ class GcpAuthenticationFilter
const std::string& audience);

const GcpAuthenticationParsedConfig::Config* filter_config_;
const RefCountedPtr<XdsDependencyManager::XdsConfig> xds_config_;
const RefCountedPtr<const XdsDependencyManager::XdsConfig> xds_config_;

Mutex mu_;
LruCache<std::string /*audience*/, RefCountedPtr<grpc_call_credentials>>
Expand Down

0 comments on commit c33b4cd

Please sign in to comment.