feat(jwt): [#4191] extend Token.encode() to support custom headers#4192
Merged
provinzkraut merged 1 commit intolitestar-org:v3.0from Jun 1, 2025
Merged
Conversation
75fa443 to
20cec6f
Compare
provinzkraut
requested changes
May 31, 2025
Member
provinzkraut
left a comment
There was a problem hiding this comment.
Two things:
- This is a breaking change (for users that subclass
Token), so it would have to be targeted at thev3branch - I don't think we should add
json_encoderandsort_headers, as they are specific topyjwt, and this is meant as an abstraction overpyjwt, not a drop-in replacement. If you do need to customise howdecodeinteracts withpyjwt, you can simply subclassToken
db00474 to
a98ad84
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v3.0 #4192 +/- ##
==========================================
- Coverage 98.30% 98.30% -0.01%
==========================================
Files 343 343
Lines 15815 15810 -5
Branches 1744 1743 -1
==========================================
- Hits 15547 15542 -5
Misses 130 130
Partials 138 138 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a98ad84 to
5842b20
Compare
Contributor
Author
|
|
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/4192 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Allows passing custom JWT headers (e.g., kid) to Token.encode(). This improves flexibility in cases where custom JWT headers (like
kid) are required.Closes
Fixes #4191