From c06faf5ee58f90117105fd1099e0d52816dede59 Mon Sep 17 00:00:00 2001 From: Mohan Li <67390330+mohanli-ml@users.noreply.github.com> Date: Wed, 8 Dec 2021 14:25:47 -0800 Subject: [PATCH] feat(transport): pass call credentials to grpc-go for DirectPath (#1297) --- transport/grpc/dial.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/grpc/dial.go b/transport/grpc/dial.go index 0334ef4f694..d6a34fc6f05 100644 --- a/transport/grpc/dial.go +++ b/transport/grpc/dial.go @@ -142,7 +142,7 @@ func dial(ctx context.Context, insecure bool, o *internal.DialSettings) (*grpc.C // Attempt Direct Path: if o.EnableDirectPath && checkDirectPathEndPoint(endpoint) && isTokenSourceDirectPathCompatible(creds.TokenSource, o) && metadata.OnGCE() { grpcOpts = []grpc.DialOption{ - grpc.WithCredentialsBundle(grpcgoogle.NewComputeEngineCredentials())} + grpc.WithCredentialsBundle(grpcgoogle.NewDefaultCredentialsWithOptions(grpcgoogle.DefaultCredentialsOptions{oauth.TokenSource{creds.TokenSource}}))} if timeoutDialerOption != nil { grpcOpts = append(grpcOpts, timeoutDialerOption) }