-
Notifications
You must be signed in to change notification settings - Fork 346
feat(types,shared): JWT v2 - Support new organization claims structure #5549
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
Conversation
🦋 Changeset detectedLatest commit: c1cb785 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
f78f4c5
to
3908d07
Compare
packages/shared/src/authorization.ts
Outdated
createCheckAuthorization, | ||
validateReverificationConfig, | ||
resolveAuthState, | ||
resolveSignedInAuthStateFromJWTClaims, |
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.
🙃 maybe use a new module
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.
Not sure if there is a better module to put this, as much of this is tied and the new changes that will be added as part of JWT v2 schema are in a way tied to authorization 🤔
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.
Maybe we could move it to a new module with JWT related things? Although the claims are authorization related, the logic here is not doing any authorization, just mapping the JWT payload to a new format. 🤔
I was also wondering if we shouldn't name this mapping here from claims -> signed in properties
to payload -> claims
, so claims would always have the same format regardless of the JWTPayload version, and then auth objects or JWT clients can use the claims to build their properties:
const __experimental_resolveClaimsFromJWTPayload = (payload: JwtPayload): JwtClaims
What do you think?
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.
Maybe we could move it to a new module with JWT related things? Although the claims are authorization related, the logic here is not doing any authorization, just mapping the JWT payload to a new format.
Hmm yeah that's fair 👍
I was also wondering if we shouldn't name this mapping here from claims -> signed in properties to payload -> claims, so claims would always have the same format regardless of the JWTPayload version
The thing here is that the JWT claims will not be in the same format and it will be different depending on version also, it's also gonna be kinda of confusing when __experimental_resolveClaimsFromJWTPayload
returns something different than the actual claims found on the token, that's why I've gone with claims -> signed in properties
.
3908d07
to
f6d4166
Compare
0402c79
to
7fd491f
Compare
ad5308b
to
9b0506b
Compare
9b0506b
to
07dcd05
Compare
…sions on authObject backwards compatible
5e9abef
to
9e968f8
Compare
!snapshot |
Hey @octoper - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact |
!snapshot |
Hey @octoper - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact |
Description
This PR adds support for the new JWT v2 schema and also renames
ver
claim tov
.Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change