Skip to content

Commit e0f488b

Browse files
authored
Merge branch 'main' into main
2 parents ed135f3 + 42cc961 commit e0f488b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
import java.nio.charset.Charset;
194194
import java.nio.charset.StandardCharsets;
195195
import java.time.Duration;
196+
import java.util.Collections;
196197
import java.util.Comparator;
197198
import java.util.HashMap;
198199
import java.util.List;
@@ -368,6 +369,10 @@ public GapicSpannerRpc(final SpannerOptions options) {
368369
boolean isAttemptDirectPathXds = Boolean.parseBoolean(directPathXdsEnv);
369370
if (isAttemptDirectPathXds) {
370371
defaultChannelProviderBuilder.setAttemptDirectPath(true);
372+
// This will let the credentials try to fetch a hard-bound access token if the runtime
373+
// environment supports it.
374+
defaultChannelProviderBuilder.setAllowHardBoundTokenTypes(
375+
Collections.singletonList(InstantiatingGrpcChannelProvider.HardBoundTokenTypes.ALTS));
371376
defaultChannelProviderBuilder.setAttemptDirectPathXds();
372377
}
373378
if (options.isUseVirtualThreads()) {

0 commit comments

Comments
 (0)