From b430b565deaef49920e88be08504b8788574c080 Mon Sep 17 00:00:00 2001 From: mohanli-ml Date: Tue, 16 Nov 2021 00:46:00 +0000 Subject: [PATCH] feat(transport): pass call credentials to grpc-go for DirectPath --- 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) }