-
Notifications
You must be signed in to change notification settings - Fork 39
Feature/migrate to typescript #53
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
base: master
Are you sure you want to change the base?
Conversation
Updated multiple packages to their latest versions, including `express`, `body-parser`, `cookie`, and others. Added new dependencies like `call-bind-apply-helpers` and `dunder-proto` for compatibility and functionality improvements. Ensured licenses and integrity hashes are up-to-date.
Hey @DanOnCall can you also update the PR description with required testing you have done to validate the changes made. |
|
||
### BREAKING CHANGES | ||
|
||
- **Export Method:** The library now uses a named export (`export const jwtAuthz`) instead of `module.exports`. CommonJS consumers must update their `require` statements from `const jwtAuthz = require('express-jwt-authz');` to `const { jwtAuthz } = require('express-jwt-authz');`. ES Module imports (`import { jwtAuthz } from ...`) remain unchanged. |
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.
Hey @DanOnCall
Can you also add a migration guide from v2 to v3 to follow up this changelog.
That would assist developers in quickly grasping the changes required to to move to v3.
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 added such document. Thanks for pointing this out. 🙏
package.json
Outdated
@@ -41,7 +55,6 @@ | |||
"node": ">=6" |
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.
@DanOnCall have we verified if this supported node version with new major version still holds true ?
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.
Great catch! Thank you. I bumped the supported min version to 14 and documented the reasoning in the changelog.
All done! Thanks for your review 🙏 |
Please see the
Changelog.md
file for an outline of the changes this PR introduces. In summary:express-jwt
.3.0.0
.Testing Done
The existing test suite was migrated to TypeScript and expanded to validate all new and existing functionality. All tests pass successfully.
The testing strategy includes:
checkAllScopes
,customUserKey
,customScopeKey
, andfailWithError
.403
error response or callnext(err)
as expected.This ensures the v3.0.0 release is robust, type-safe, and backward-compatible with supported Express versions.