-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat: adds type support for JWK formatted public keys #80
feat: adds type support for JWK formatted public keys #80
Conversation
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.
Thank you for the contribution!
I have some reservations about listing the JWK members that are generally used to encode private or symmetric key material.
Also, I suggest making the data type extensible, with a [x: string]: any
catch-all
On a style note, since this interface may be used by IDEs to provide auto-complete, it may be nice to see some known string patterns for use
and key_ops
. For example:
use?: "enc" | "sig" | string
On the other hand, this looks like overkill :)
What do you think?
Hey @mirceanis I totally agree to your suggestions ;) Actually I'm myself not really familiar with the JWK specs (so, thanks a lot for that input) but rather just copied them from what my Visual Studio Code suggested - there's a generic typed But if you'd like, I'll happily add your suggestions to it ;) I particularly would go with the generic |
removes private key related props adds a generic JsonWebKey prop Co-authored-by: Mircea Nistor <[email protected]>
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.
Looks great, thank you!
# [2.2.0](2.1.2...2.2.0) (2021-02-26) ### Features * add type definition for JWK formatted public keys ([#80](#80)) ([f9b9c8d](f9b9c8d))
🎉 This PR is included in version 2.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
e.g. used in did:elem
my linter has "fixed" the comment indentation ;)
JsonWebKey type has been adapted by lib.dom (used in browsers)