feat(security): generate random JWT secrets when not configured#2974
Merged
feat(security): generate random JWT secrets when not configured#2974
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2974 +/- ##
============================================
- Coverage 71.81% 71.80% -0.02%
Complexity 930 930
============================================
Files 1116 1116
Lines 92601 92616 +15
Branches 70122 70149 +27
============================================
- Hits 66500 66499 -1
- Misses 23539 23551 +12
- Partials 2562 2566 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
c4dc790 to
27883d8
Compare
mmodzelewski
previously approved these changes
Mar 18, 2026
27883d8 to
66b3792
Compare
66b3792 to
1edfe36
Compare
mmodzelewski
previously approved these changes
Mar 18, 2026
mmodzelewski
previously approved these changes
Mar 20, 2026
hubcio
requested changes
Mar 20, 2026
mmodzelewski
approved these changes
Mar 20, 2026
hubcio
approved these changes
Mar 20, 2026
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.
Deploying the HTTP server with hardcoded default JWT secrets
is a security risk — every instance shares the same signing
key. Empty defaults now trigger secure random secret
generation at startup, with a warning logged showing a
redacted preview of the generated value.
When both encoding and decoding secrets are empty, a single
random secret is generated and used for both (symmetric
HMAC). Tokens are invalidated on restart, nudging operators
to set persistent secrets in production.