test: use >=32-byte HMAC signing keys in JWTService tests (unblocks pyjwt 2.13.0)#10151
Open
santicomp2014 wants to merge 1 commit into
Open
test: use >=32-byte HMAC signing keys in JWTService tests (unblocks pyjwt 2.13.0)#10151santicomp2014 wants to merge 1 commit into
santicomp2014 wants to merge 1 commit into
Conversation
pyjwt 2.13.0 emits InsecureKeyLengthWarning for HS256 HMAC keys under 32 bytes (RFC 7518 3.2). The JWTService tests use 'test_jwt_signing_key' (20B) and 'invalid_key' (11B); pytest runs filterwarnings=error, so the warning fails the suite and blocks the pyjwt 2.13.0 security bump (#10132). Lengthen both to >=32 bytes (the invalid-key test still uses a *different* key, so it still exercises the signature-mismatch path). Version-independent; production unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Unblocks the pyjwt 2.13.0 security bump (#10132).
pyjwt 2.13.0 adds
InsecureKeyLengthWarningfor HS256 HMAC keys < 32 bytes (RFC 7518 §3.2).JWTServicetests use"test_jwt_signing_key"(20B) and"invalid_key"(11B); pytest runsfilterwarnings=error, so the warning fails Tests and blocks #10132.Lengthens both signing keys to ≥32 bytes. The invalid-key test keeps using a different key, so it still exercises the signature-mismatch path. Version-independent (passes with the current pyjwt 2.10.1). Production unaffected — the warning is never an error there.
Same root cause + fix as lms #7394.
🤖 Generated with Claude Code