Skip to content

Commit 029bc79

Browse files
authored
fix(spanner): add env var to allow disabling directpath bound token (#13265)
Inspired by #13153. The token issuing side is still behind so hopefully it's not too late to add this knob out of extra caution. Users will be able to use it to turn off this flow if anything goes wrong.
1 parent a33d766 commit 029bc79

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spanner/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,9 @@ func allClientOpts(numChannels int, compression string, userOpts ...option.Clien
689689
if enableDirectPathXds, _ := strconv.ParseBool(os.Getenv("GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS")); enableDirectPathXds {
690690
clientDefaultOpts = append(clientDefaultOpts, internaloption.AllowNonDefaultServiceAccount(true))
691691
clientDefaultOpts = append(clientDefaultOpts, internaloption.EnableDirectPath(true), internaloption.EnableDirectPathXds())
692-
clientDefaultOpts = append(clientDefaultOpts, internaloption.AllowHardBoundTokens("ALTS"))
692+
if disableBoundToken, _ := strconv.ParseBool(os.Getenv("GOOGLE_SPANNER_DISABLE_DIRECT_ACCESS_BOUND_TOKEN")); !disableBoundToken {
693+
clientDefaultOpts = append(clientDefaultOpts, internaloption.AllowHardBoundTokens("ALTS"))
694+
}
693695
}
694696
if compression == "gzip" {
695697
userOpts = append(userOpts, option.WithGRPCDialOption(grpc.WithDefaultCallOptions(

0 commit comments

Comments
 (0)