jwt
jwt copied to clipboard
feat(): support for asynchronous version of `secretOrKeyProvider`
PR Checklist
Please check if your PR fulfills the following requirements:
- [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
- [x] Tests for the changes have been added (for bug fixes / features)
- [x] Docs have been added / updated (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:
What is the current behavior?
Issue Number: #235
What is the new behavior?
Allow ability to provide an asynchronous version of secretOrKeyProvider
. However, when using asynchronous verison of secretOrKeyProvider
, synchronous versions of .sing
and .verify
will log a warning message and throw an exception before calling .sing
or .verify
.
Does this PR introduce a breaking change?
[ ] Yes
[x] No
Other information
I'm not sure if this PR contains breaking changes, because synchronous versions of .sing
and .verify
can throw exceptions as well.
Why is this LGTY? Sure there're some points that could be improved, but maybe you elaborate what your points are? I could jump in and fix this.
I have resolved the conflicts and updates the sing
typos in #1486. This feature is required to handle jwks key rotations.
@kamilmysliwiec did you mean to close the issue #235 or this stale PR?
Let's track this here https://github.com/nestjs/jwt/pull/1486