Giter Club home page Giter Club logo

Comments (5)

mmmries avatar mmmries commented on May 24, 2024

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.

mmmries avatar mmmries commented on May 24, 2024

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.

lubien avatar lubien commented on May 24, 2024

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 the negotiate_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.

mmmries avatar mmmries commented on May 24, 2024

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.

lubien avatar lubien commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.