We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using the nk utility as described in https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth#generating-nkeys-and-configuring-the-server it seems ok to cut/paste the seed into a file and load it with the nkeys_seed parameter of nats.py. However, most editors (and shell redirect) will add a newline at the end of the seed, and that will make nkeys.from_seed() in https://github.com/nats-io/nats.py/blob/main/nats/aio/client.py#L515 fail with nkeys: invalid seed . This could be more robust if the file reading included a stripping of whitespace at end of line before decoding and turning it into a bytearray
nk
nkeys_seed
nats.py
nkeys.from_seed()
nkeys: invalid seed
In order for nats.py to work with user nkeys generated with the nk utility the file could be generated like this:
printf "%s" $(nk -gen user) > file
And to get the pubkey for using in the server config:
nk -pubout -inkey file
Perhaps the file loading code behind the nkeys_seed parameter could sanitize the file before load ?
The text was updated successfully, but these errors were encountered:
#426 just add a strip line will do this work
Sorry, something went wrong.
No branches or pull requests
When using the
nk
utility as described in https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth#generating-nkeys-and-configuring-the-server it seems ok to cut/paste the seed into a file and load it with thenkeys_seed
parameter ofnats.py
. However, most editors (and shell redirect) will add a newline at the end of the seed, and that will makenkeys.from_seed()
in https://github.com/nats-io/nats.py/blob/main/nats/aio/client.py#L515 fail withnkeys: invalid seed
. This could be more robust if the file reading included a stripping of whitespace at end of line before decoding and turning it into a bytearrayIn order for nats.py to work with user nkeys generated with the
nk
utility the file could be generated like this:printf "%s" $(nk -gen user) > file
And to get the pubkey for using in the server config:
nk -pubout -inkey file
Perhaps the file loading code behind the nkeys_seed parameter could sanitize the file before load ?
The text was updated successfully, but these errors were encountered: