feat: signJWT, verifyJWT and decodeJWT utils#39
Open
johannschopplich wants to merge 1 commit into
Open
Conversation
Author
|
@pi0 Here it is, again! Feel free to rename methods, move methods around – I'm happy to learn from your methodology. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
Note
I accidentally closed the PR #23. This PR includes the same changes.
#17
❓ Type of change
📚 Description
Resolves #17.
The following JWT utilities will be available with this PR (migrated from
unjwt):signJWTverifyJWTdecodeJWTI have kept the code as simple as possible to cover the basic needs for JWT signing, verification and decoding. Method parameters have a balance between sensible defaults and customization.
Example usage:
Please verify if the general direction of this PR makes sense to you. If you, I'm willing to add tests as best as I can.
Notes
crypto.webandcrypto.nodetocrypto-web, respectivelycrypto-node, because unbuild v2 complained about the file extensions.unjwtpackage – explicitly withoutuncrypto, since I rely onunenvto resolve the usage von the Web Crypto API.jose, I successfully migrated to these new utilities. No user got logged out. 😋Questions
atobandbtoaare available in latest Node and worker versions, so I haven't added any usage ofbuffer. Is that OK for you?📝 Checklist