@@ -68,6 +68,7 @@ type settings struct {
6868 JSEventPrefix string `json:"jetstream_event_prefix"`
6969 InboxPrefix string `json:"inbox_prefix"`
7070 UserJwt string `json:"user_jwt"`
71+ UserSeed string `json:"user_seed"`
7172 ColorScheme string `json:"color_scheme"`
7273 TLSFirst bool `json:"tls_first"`
7374 WinCertStoreType string `json:"windows_cert_store"`
@@ -379,7 +380,10 @@ func (c *Context) NATSOptions(opts ...nats.Option) ([]nats.Option, error) {
379380
380381 nopts = append (nopts , nko )
381382
382- case c .UserJWT () != "" :
383+ case c .UserJWT () != "" && c .UserSeed () != "" :
384+ nopts = append (nopts , nats .UserJWTAndSeed (c .UserJWT (), c .UserSeed ()))
385+
386+ case c .UserJWT () != "" && c .UserSeed () == "" :
383387 userCB := func () (string , error ) {
384388 return c .UserJWT (), nil
385389 }
@@ -963,11 +967,25 @@ func WithUserJWT(p string) Option {
963967 }
964968}
965969
970+ // WithUserSeed sets the user seed
971+ func WithUserSeed (p string ) Option {
972+ return func (s * settings ) {
973+ if p != "" {
974+ s .UserSeed = p
975+ }
976+ }
977+ }
978+
966979// UserJWT retrieves the configured user jwt, empty if not set
967980func (c * Context ) UserJWT () string {
968981 return c .config .UserJwt
969982}
970983
984+ // UserSeed retrieves the configured user seed, empty if not set
985+ func (c * Context ) UserSeed () string {
986+ return c .config .UserSeed
987+ }
988+
971989// WithSocksProxy sets the SOCKS5 Proxy.
972990// To explicitly remove an already configured proxy, use the string "none".
973991func WithSocksProxy (p string ) Option {
0 commit comments