Add key removal functions to JWTKeyCollection#240
Merged
Merged
Conversation
gwynne
requested changes
Feb 9, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #240 +/- ##
==========================================
+ Coverage 82.00% 82.21% +0.20%
==========================================
Files 61 61
Lines 1434 1456 +22
==========================================
+ Hits 1176 1197 +21
- Misses 258 259 +1
🚀 New features to boost your workflow:
|
Closed
0xTim
requested changes
Feb 17, 2026
Member
|
@ptoffy some doc clarifications still needed here |
0xTim
approved these changes
Mar 2, 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.
As discussed in #239, key removal functions can be helpful to implement key rotation. A key rotation example will follow.
APIs:
clearDefault(): removes the default signer (might still be in the collection though not as default, so its kid must be specified to use it)removeAll(except:, clearingDefault:): removes all signers besides the ones specified in the list and also clears the default if the parameter set to trueremove(kid:): removes the specified kid from the list (without considering the default)