Skip to content

Commit 0e7c9ec

Browse files
aplrclaude
andcommitted
gcp/cloudsql: use WithIAMAuthNTokenSources in NewDialerWithIAM
WithTokenSource should not be combined with WithIAMAuthN; use the dedicated WithIAMAuthNTokenSources instead, passing the same token source for both the API client and the IAM login token. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7140ee1 commit 0e7c9ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gcp/cloudsql/cloudsql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func NewDialer(ctx context.Context, ts oauth2.TokenSource) (*cloudsqlconn.Dialer
104104
// The returned cleanup function must be called when the dialer is no longer needed.
105105
func NewDialerWithIAM(ctx context.Context, ts oauth2.TokenSource) (*cloudsqlconn.Dialer, func(), error) {
106106
d, err := cloudsqlconn.NewDialer(ctx,
107-
cloudsqlconn.WithTokenSource(ts),
107+
cloudsqlconn.WithIAMAuthNTokenSources(ts, ts),
108108
cloudsqlconn.WithIAMAuthN(),
109109
)
110110
if err != nil {

0 commit comments

Comments
 (0)