-
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
Document decomposeJwt #117
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.
Even thought I like the decomposeUnverifiedJwt
name better, I don't love the breaking change requiring a major version bump. Thoughts on leaving decomposeJwt
and marking as @deprecated
then having it call into decomposeUnverifiedJwt
? I found https://github.com/gund/eslint-plugin-deprecation, but not sure how many toolchains look at @deprecated
in JSDoc comments.
Should we update verifyJwt
calls to take either a jwt: string
or a decomposedJwt: DecomposedJwt
to avoid double parsing, or does it not really help peformance since we would need to validate the DecomposedJwt
parts were valid anyway?
Also, should we have a top level import like JwtParser
(next to JwtRsaVerifier
and CognitoJwtVerifier
). That would have a method decomposeUntrusted(jwt: string): DecomposedJwt
to be the primary interface? Supporting issue #82 will probably require this pre-parsing and using some value of the payload to find the correct issuer for verification. This could come in a later PR or major version.
Valid idea for sure. We would eventually remove
Mmmm good thought. It would shave a few cycles off, but only synchronous work. You're gonna have a hard time even measuring that improvement I think. And It would be at the expense of making the interface more complicated. Think I'm not inclined to it.
Interesting idea! Would also make it easier to support verifying ALB JWTs. |
I'm fine with the major version and keeping the interface less complicated. We can roll the other ideas into the next minor release. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [aws-jwt-verify](https://togithub.com/awslabs/aws-jwt-verify) | [`3.4.0` -> `4.0.0`](https://renovatebot.com/diffs/npm/aws-jwt-verify/3.4.0/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/aws-jwt-verify/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/aws-jwt-verify/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/aws-jwt-verify/4.0.0/compatibility-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/aws-jwt-verify/4.0.0/confidence-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>awslabs/aws-jwt-verify</summary> ### [`v4.0.0`](https://togithub.com/awslabs/aws-jwt-verify/releases/tag/v4.0.0) [Compare Source](https://togithub.com/awslabs/aws-jwt-verify/compare/v3.4.0...v4.0.0) #### What's Changed - Bump webpack from 5.70.0 to 5.76.1 in /tests/vite-app by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/awslabs/aws-jwt-verify/pull/116](https://togithub.com/awslabs/aws-jwt-verify/pull/116) - Document decomposeJwt by [@​ottokruse](https://togithub.com/ottokruse) in [https://github.com/awslabs/aws-jwt-verify/pull/117](https://togithub.com/awslabs/aws-jwt-verify/pull/117) - v4.0.0 by [@​ottokruse](https://togithub.com/ottokruse) in [https://github.com/awslabs/aws-jwt-verify/pull/118](https://togithub.com/awslabs/aws-jwt-verify/pull/118) NOTE: [#​117](https://togithub.com/awslabs/aws-jwt-verify/issues/117) constitutes a breaking change, hence we created new major version v4.0.0, but you will only be impacted by this change, if you were doing this: `import { decomposeJwt } from "aws-jwt-verify/jwt"` That method has been renamed (to make it more clear) and must now be imported like so: `import { decomposeUnverifiedJwt } from "aws-jwt-verify/jwt";` Happy coding! **Full Changelog**: awslabs/aws-jwt-verify@v3.4.0...v4.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/weareinreach/InReach). PR-URL: #313 Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Issue #, if available: #82
Description of changes: Document the
decomposeJwt
functionBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.