Skip to content

Commit a5fdfb0

Browse files
committed
Use option.WithAuthCredentialsFile for Google API auth
1 parent 8aeee5e commit a5fdfb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kms/cloudkms/cloudkms.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ func New(ctx context.Context, opts apiv1.Options) (*CloudKMS, error) {
113113
return nil, err
114114
}
115115
if f := u.Get("credentials-file"); f != "" {
116-
cloudOpts = append(cloudOpts, option.WithCredentialsFile(f))
116+
cloudOpts = append(cloudOpts, option.WithAuthCredentialsFile(option.ServiceAccount, f))
117117
}
118118
}
119119

120120
// Deprecated way to set configuration parameters.
121121
if opts.CredentialsFile != "" {
122-
cloudOpts = append(cloudOpts, option.WithCredentialsFile(opts.CredentialsFile))
122+
cloudOpts = append(cloudOpts, option.WithAuthCredentialsFile(option.ServiceAccount, opts.CredentialsFile))
123123
}
124124

125125
client, err := newKeyManagementClient(ctx, cloudOpts...)

0 commit comments

Comments
 (0)