Skip to content
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

[Claims] Add all possible backend claims to ClerkJWT #56

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

kageiit
Copy link
Contributor

@kageiit kageiit commented Jul 23, 2024

According to the clerk docs - https://clerk.com/docs/backend-requests/resources/session-tokens

There are additional claims in the JWT token for backend requests that can be useful to glean information about the user's active organization and permissions.

Implementation inspired from the official clerk go sdk - https://github.com/clerk/clerk-sdk-go/blob/3411ef39ca0f1f01a91fd6fa766c032d2f9683a9/clerk/session_claims.go#L16

Updated the unit tests to reflect the new claims

Related to #52

@kageiit kageiit changed the title [Claims] Add all possible backend clains to ClerkJWT [Claims] Add all possible backend claims to ClerkJWT Jul 23, 2024
Copy link
Owner

@DarrenBaldwin07 DarrenBaldwin07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TY LGTM! Will include in 0.3.2 release (likely in a couple weeks)

src/validators/authorizer.rs Show resolved Hide resolved
@DarrenBaldwin07 DarrenBaldwin07 merged commit ae045de into DarrenBaldwin07:main Jul 30, 2024
1 check passed
@kageiit kageiit deleted the other_jwt_claims branch July 30, 2024 22:38
@aarondemolder
Copy link

Also related to #52 I could see that adding custom claims here generally would be valuable - it does not look like it was included in these PRs? Is this planned?

@kageiit
Copy link
Contributor Author

kageiit commented Aug 27, 2024

Also related to #52 I could see that adding custom claims here generally would be valuable - it does not look like it was included in these PRs? Is this planned?

I added support in #63

This should be useful for additional fields in custom templates

@aarondemolder
Copy link

@kageiit fantastic! Thanks for doing so so quickly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants