Skip to content
New issue

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

Change Auth struct signature field to Vec<u8> #1337

Merged
merged 3 commits into from
Nov 4, 2024

Conversation

mnordstr
Copy link
Contributor

The signature received from the nkeys::KeyPair sign function is a Vec<u8> and the contents cannot be stored in a String.
This commit changes the type of the signature field in the Auth struct from a Option<String> to a Option<Vec<u8>>.
This allows for JWTs to be used and signed with the nonce in the custom auth callback.

@Jarema
Copy link
Member

Jarema commented Oct 31, 2024

Thanks for the PR!

I need to refresh my memory why it was String in the first place, because I have vague memory of having a reason for that :).

Nonethtless, could you please add a test for this?

@mnordstr
Copy link
Contributor Author

mnordstr commented Nov 2, 2024

Nonethtless, could you please add a test for this?

Test added.

Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good!

Please fix the format error and we're good to merge.

error[internal]: left behind trailing whitespace
   --> /home/runner/work/nats.rs/nats.rs/async-nats/tests/client_tests.rs:900:900:1
    |
900 |             
    | ^^^^^^^^^^^^
    |

warning: rustfmt has failed to format. See previous 1 errors.```

@mnordstr
Copy link
Contributor Author

mnordstr commented Nov 4, 2024

Please fix the format error and we're good to merge.

My bad, now cargo fmt is happy.

@mnordstr mnordstr requested a review from Jarema November 4, 2024 21:06
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT! Thanks for your contribution!

@Jarema Jarema merged commit 21ea5ca into nats-io:main Nov 4, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants