Comments (5)
Hmmmm I've never thought about forcing a connection to use auth. Is that supported in the protocol? I thought we always did an initial handshake first and we could only send the credentials as our response to that handshake?
from nats.ex.
Looking at the client protocol it indicates that auth_token
, user
, or pass
should only be sent if auth_required
is set. Do other nats clients allow the client for force authentication?
If we did want to support this, I think I would avoid modifying the server_settings
and instead I would handle this logic in the negotiate_settings
function. So that function will always see the server settings and user_settings in a consistent way.
from nats.ex.
Do other nats clients allow the client for force authentication?
Yes, Go client does: https://github.com/nats-io/nats.go/blob/main/nats.go#L2248
Which we happen to use on our CLI: https://github.com/superfly/flyctl/blob/master/logs/nats.go#L78
Since our NATs server does not ask for auth_required
.
If we did want to support this, I think I would avoid modifying the
server_settings
and instead I would handle this logic in thenegotiate_settings
function. So that function will always see the server settings and user_settings in a consistent way.
Got it. I can take a stab at this if this is wanted.
from nats.ex.
Hey @lubien thank you for opening the PR. Can you clarify a few things for me?
Yes, Go client does: https://github.com/nats-io/nats.go/blob/main/nats.go#L2248
I'm not very familiar with Go, but it looks like that code will sent the auth credentials as long as they have been provided by the user in the nc.Opts
? Is that right? So I wonder if we should change the Elixir client to follow that same convention and skip checking the server_settings.auth_required
? We would just send the credentials if the use has specified them?
Since our NATs server does not ask for auth_required.
So your NATS server is configured in a way that it does not send "auth_required": true
in the INFO message, but it does actually require credentials in order to connect successfully? I'm happy to follow the conventions in the go client, I just want to make sure I'm understanding how your NATS server is setup.
from nats.ex.
will sent the auth credentials as long as they have been provided by the user in the
nc.Opts
?
Yes, that's my understanding too. Disclaimer: I'm very new to Go
So your NATS server is configured in a way that it does not send
"auth_required": true
in the INFO message, but it does actually require credentials in order to connect successfully?
Yes, that's how we built that. We just expect it to be sent.
Thanks for your time, really :)
from nats.ex.
Related Issues (20)
- Connection establishing prinout HOT 3
- Outdated Changelog HOT 2
- Relax or update nimble_parsec dep HOT 4
- add JetStream Support HOT 9
- add Headers Support HOT 9
- Add `request_multi` HOT 6
- Expect an erlang client HOT 4
- Idle Heartbeat Header Parsing HOT 3
- Include Server Info In Connection State
- Validate the port number on connection settings
- IPv6 Support? HOT 5
- Make inbox optional HOT 2
- Support OK message HOT 2
- Quickly return for `no responders` HOT 7
- Jetstream Support and Broadway Integration Officially HOT 10
- ConsumerSupervisor does not restart killed child
- Getting [warn] Using execute/3 with a single HOT 6
- Streaming support HOT 3
- Reconnect Functionality HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nats.ex.