From 09d0f23032488dfa55c7a4c1c571a4f36bd94728 Mon Sep 17 00:00:00 2001 From: meeral-k <108340829+meeral-k@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:32:19 +0000 Subject: [PATCH] feat: allow non default service account in DirectPath (#2312) Copying over from: https://togithub.com/googleapis/java-bigtable/pull/2012 Bigtable already sets the flag to allow non-default SA in DirectPath on the service side, we also need to set the option on the client side to make this feature work. Related Spanner PR: https://togithub.com/googleapis/java-spanner/pull/2635. --- .../bigtable/data/v2/stub/EnhancedBigtableStubSettings.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java index 4415894132..46933c1690 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java @@ -370,7 +370,11 @@ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProvi if (isDirectpathEnabled) { // Attempts direct access to CBT service over gRPC to improve throughput, // whether the attempt is allowed is totally controlled by service owner. - grpcTransportProviderBuilder.setAttemptDirectPathXds().setAttemptDirectPath(true); + grpcTransportProviderBuilder + .setAttemptDirectPathXds() + .setAttemptDirectPath(true) + // Allow using non-default service account in DirectPath. + .setAllowNonDefaultServiceAccount(true); } return grpcTransportProviderBuilder .setChannelPoolSettings(