File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1 Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 193193import java .nio .charset .Charset ;
194194import java .nio .charset .StandardCharsets ;
195195import java .time .Duration ;
196+ import java .util .Collections ;
196197import java .util .Comparator ;
197198import java .util .HashMap ;
198199import 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 ()) {
You can’t perform that action at this time.
0 commit comments