in options.go [95:106]
func WithCredentialsJSON(b []byte) Option {
return func(d *dialerConfig) {
// TODO: Use AlloyDB-specfic scope
c, err := google.CredentialsFromJSON(context.Background(), b, CloudPlatformScope)
if err != nil {
d.err = errtype.NewConfigError(err.Error(), "n/a")
return
}
d.tokenSource = c.TokenSource
d.clientOpts = append(d.clientOpts, apiopt.WithCredentials(c))
}
}