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

Passphrase input for encrypted key #11

Closed
silverbackdan opened this issue Jan 20, 2021 · 2 comments · Fixed by #12
Closed

Passphrase input for encrypted key #11

silverbackdan opened this issue Jan 20, 2021 · 2 comments · Fixed by #12

Comments

@silverbackdan
Copy link
Contributor

silverbackdan commented Jan 20, 2021

When using an encrypted key as the secret, I get the error Passphrase required for encrypted key but cannot see an option to pass this in. Is this a feature that's missing or something I am missing? Many thanks.

According to the library you are using it seems we should be able to pass an object but it doesn't appear to work?
https://www.npmjs.com/package/jsonwebtoken#usage

jwt sign --noCopy --expiresIn '100 years' --algorithm 'RS256' -- '{"mercure": {"publish": ["*"]}}' "{key: \"$SECRET_KEY\", \"passphrase\": \"$JWT_PASSPHRASE\" }"

@silverbackdan
Copy link
Contributor Author

I can see that some inputs are converted to objects here:

header = header && parseObjectOption("header", header);

I'm wondering whether a new option for the secret could change the secret variable in this function to an object with key and passphrase to support this? I'll try to fork off this and implement this. I don't have a huge amount of time but I'll do my best

@silverbackdan
Copy link
Contributor Author

Created a PR for this feature now if you're interested. Thanks for the package!

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 a pull request may close this issue.

1 participant