-
-
Notifications
You must be signed in to change notification settings - Fork 436
feat(jwt): [#4191] extend Token.encode() to support custom headers #4192
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
feat(jwt): [#4191] extend Token.encode() to support custom headers #4192
Conversation
75fa443
to
20cec6f
Compare
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.
Two things:
- This is a breaking change (for users that subclass
Token
), so it would have to be targeted at thev3
branch - I don't think we should add
json_encoder
andsort_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 howdecode
interacts 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
e5df94f
to
1f872fb
Compare
|
1f872fb
to
b45cbe7
Compare
83037bd
to
5fa2892
Compare
727b3ec
to
4692923
Compare
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/4192 |
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.
Thanks @s-aleshin!
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