-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Add support for Ed25519 #1900
Add support for Ed25519 #1900
Conversation
Hi @horvski, thanks for working on this. I don't have time to review this in depth yet, but on the surface it looks like a reasonable new function. Can I ask why you decided to name it Also in future please file an issue before issuing a PR (see |
Hi @hairyhenderson, no problem.
I will keep that in mind in the future, thanks. |
I also added signing and verifying with the key pair, to ensure that the encoding and decoding work as expected. This may be better off being split into separate unit tests. I figured this was good for now though, to at least know that the key pair was working. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've had a bit of a closer look, and made some review comments - thanks again for working on this @horvski!
In order to make this fully usable in gomplate, it'll need to also be added as a function (in funcs/crypto.go
, etc...).
It'll also need documentation. I can handle those parts if you're not up for it, though it'll take me some time to get to it.
BTW you'll also need to rebase for the CI to pass |
Sorry for the delay - I've taken another pass and added some comments. If you rebase again the tests should pass! |
No worries! Sounds good, I'll do that now. I agree with your recent review, and yes, I think we should rename the file. I'll do that before I rebase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one more minor change in the docs, otherwise this LGTM!
Can you also please regenerate the docs by running make docs/content/functions/crypto.md
and committing the updated file?
description: the random seed encoded in either base64 or hex | ||
examples: | ||
- | | ||
$ gomplate -i '{{ crypto.Ed25519GenerateKeyFromSeed base64 MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA= }}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ gomplate -i '{{ crypto.Ed25519GenerateKeyFromSeed base64 MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA= }}' | |
$ gomplate -i '{{ crypto.Ed25519GenerateKeyFromSeed "base64" MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA= }}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the encoding need to be in quotes and the seed does not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I missed that - they both need to be in quotes as they're both strings 😉
I ran the command that you mentioned to create the new docs, but am getting this error:
My guess is that since my fork does not have the semantic versioning, that's where the first error is coming from. The command seems to continue after this though, and I am not sure why it fails. I got two different errors, but I can't get the first one again for some reason. At first, it was saying that crypto.md is already up to date. Now when I am running it, it keeps deleting the file and I have to git restore it. Any clue of what I am doing wrong here? |
I was able to duplicate this locally - it's because of |
This can be safely ignored - it's from the Makefile, here. It might be happening because of how you forked the repo (maybe you didn't pull down tags? or maybe it's because you're working from your |
description: the random seed encoded in either base64 or hex | ||
examples: | ||
- | | ||
$ gomplate -i '{{ crypto.Ed25519GenerateKeyFromSeed "base64" MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA= }}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry - I missed that the second value was also not in quotes 🤦♂️
$ gomplate -i '{{ crypto.Ed25519GenerateKeyFromSeed "base64" MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA= }}' | |
$ gomplate -i '{{ crypto.Ed25519GenerateKeyFromSeed "base64" "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=" }}' |
@horvski just one final thing to fix, then a rebase, and it'll be good to go! Thanks for your patience and persistence on this 🙇♂️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @horvski! LGTM
No description provided.