mnetship / ratsio

NATS & NATS Streaming Server client library for Rust
MIT License
50 stars 22 forks source link

Adding support for NATS 2.0 JWT security #1

Closed autodidaddict closed 4 years ago

autodidaddict commented 5 years ago

Updated the client to support authenticating to NATS using JSON Web Tokens (JWT), verified through nkey signatures. Upped version number to 0.3.0 per semver guidelines because I removed the from_options call and just made it the connect call (because it was already making a TCP connection in from_options and I needed to accommodate the new logic of waiting for INFO before sending a CONNECT).

This should now put your client pretty close to parity with the current Go client, minus a few of the bells and whistles they add because they develop Go-first.

mnetship commented 4 years ago

Hi @autodidaddict, thank you for your contribution. i have merged your changes locally. when i try to build i get errors. I would like to release your additions as soon as they compile and test successfully. Please help me fix the merged code.

Furthermore, it seems that you need to select a different nkeys version to compile tests. [As indicated in the error below.]

cargo test
    Updating crates.io index
error: failed to select a version for the requirement `nkeys = "^0.0.3"`
  candidate versions found which didn't match: 0.0.8, 0.0.7, 0.0.6
  location searched: crates.io index