GoogleDefaultCreds: check xdstp URI authority (#29901)

pull/29867/head^2
Mark D. Roth 3 years ago committed by GitHub
parent 569e397025
commit 61c3e34a4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/core/lib/security/credentials/google_default/google_default_credentials.cc

@ -93,7 +93,8 @@ bool IsXdsNonCfeCluster(const char* xds_cluster) {
if (!absl::StartsWith(xds_cluster, "xdstp:")) return true;
auto uri = grpc_core::URI::Parse(xds_cluster);
if (!uri.ok()) return true; // Shouldn't happen, but assume ALTS.
return !absl::StartsWith(uri->path(),
return uri->authority() != "traffic-director-c2p.xds.googleapis.com" ||
!absl::StartsWith(uri->path(),
"/envoy.config.cluster.v3.Cluster/google_cfe_");
}

Loading…
Cancel
Save