Skip to content

Commit 2b0f2ff

Browse files
authored
feat: enable ALTS hard bound token in DirectPath (#3904)
1 parent 0906eac commit 2b0f2ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,10 @@ public GapicSpannerRpc(final SpannerOptions options) {
368368
boolean isAttemptDirectPathXds = isEnableDirectPathXdsEnv();
369369
if (isAttemptDirectPathXds) {
370370
defaultChannelProviderBuilder.setAttemptDirectPath(true);
371+
// This will let the credentials try to fetch a hard-bound access token if the runtime
372+
// environment supports it.
373+
defaultChannelProviderBuilder.setAllowHardBoundTokenTypes(
374+
Collections.singletonList(InstantiatingGrpcChannelProvider.HardBoundTokenTypes.ALTS));
371375
defaultChannelProviderBuilder.setAttemptDirectPathXds();
372376
}
373377

0 commit comments

Comments
 (0)