nats-io / stan.go

NATS Streaming System
https://nats.io
Apache License 2.0
706 stars 117 forks source link

Proposal: Add UserInfo opt #354

Closed Russiancold closed 3 years ago

Russiancold commented 3 years ago

Is it possible to add any options for providing user credentials directly, not by nats.Conn?

kozlovic commented 3 years ago

Instead of adding individual NATS options, I think it would make more sense to have ability to add NATS options (or array of function Option) so that when stan library creates the NATS connection, it can uses those options (if provided) to setup the NATS connection. Keep in mind that the library would still overwrite some of the options like it does today. Does that sound ok to you?

(PS: for basic user/password connection, you can always pass it to the URL: nats://user:pwd@host:port)

kozlovic commented 3 years ago

@Russiancold Please have a look at PR #355.

Russiancold commented 3 years ago

Looks good! Thanks!