Repository navigation
Conversation
FanWu-ai
marked this pull request as ready for review
October 19, 2026 08:24
auvipy
self-requested a review
October 19, 2026 08:53
This branch has not been deployed
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.
Summary
PyJWKClientdrops JWKs whosekidis explicitly an empty string, even when the token header contains the same value. This prevents it from selecting a key thatPyJWKSet[""]can already retrieve and that PyJWT can already use to sign and verify tokens.RFC 7517 §4.5 defines
kidas a case-sensitive string with an unspecified structure; it does not require a nonempty value. Keep explicitly empty string IDs in the signing-key filter while retaining its existing handling of missing IDs, null IDs, and other false-valued inputs. The key-use filter and exact key-ID matching are unchanged.The 14 regression cases cover signed-token lookup across all four cache settings, both allowed key-use values, coexistence with a nonempty key ID, excluded malformed/missing IDs, encryption keys, and a missing token ID. Six cases fail on the original source; the eight negative controls pass. A changelog entry is included.
Related work
Closed, unmerged draft #1073 and issue #1072 discussed the broader case of absent key IDs and choosing a sole key when a token omits
kid. This change deliberately does not add that fallback: a token withoutkidstill cannot select a key whose ID is"".Validation
Based on master
16231abfd1d8eab4953e8779b3017b859c88565e, on Linux:git diff --checkpassed.The lint environment needed writable cache-directory environment variables passed through tox; no project configuration or check was changed. The remaining interpreter/OS matrix has not run locally, and no hosted CI pass is claimed.
AI assistance was used to prepare, test, and review this change; no human review is claimed.