Skip to content

Adding support for multiple keys during parsing#2

Merged
faogustavo merged 2 commits intomainfrom
gv/RND-575
Mar 20, 2026
Merged

Adding support for multiple keys during parsing#2
faogustavo merged 2 commits intomainfrom
gv/RND-575

Conversation

@faogustavo
Copy link
Collaborator

  • Created SigningKey and EncryptionKey
  • Those new types will be the default values used to sign and verify the keys
  • They already include the algorithm used, and have subtypes to handle signing/encrypt/verify/decrypt
  • Created JwtKeyRegistry to store multiple keys
  • The registry can be used both during creation and validation of JWTs
  • Users can create and maintain these registries on their own and provide us an instance to sign/verify
  • Added KeyID support
  • Now, if the JWT has the kid header, the key with that id in the registry will take precedence to be used
  • If there is no key with same id, it will fallback to the default key for the defined algorithm
  • Created new helper functions on top of the Signing and Encryption algorithms.
  • You can use the algorithm to generate or parse a key
  • Added tests to all new features and improved old tests by using the new keys helpers

- Created `SigningKey` and `EncryptionKey`
- Those new types will be the default values used to sign and verify the keys
- They already include the algorithm used, and have subtypes to handle signing/encrypt/verify/decrypt
- Created JwtKeyRegistry to store multiple keys
- The registry can be used both during creation and validation of JWTs
- Users can create and maintain these registries on their own and provide us an instance to sign/verify
- Added KeyID support
- Now, if the JWT has the kid header, the key with that id in the registry will take precedence to be used
- If there is no key with same id, it will fallback to the default key for the defined algorithm
- Created new helper functions on top of the Signing and Encryption algorithms.
- You can use the algorithm to generate or parse a key
- Added tests to all new features and improved old tests by using the new keys helpers
@github-actions
Copy link

github-actions bot commented Mar 20, 2026

TestsPassed ✅SkippedFailed
JUnit Test Report1040 ran1040 passed0 skipped0 failed

@faogustavo faogustavo merged commit 4d73986 into main Mar 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant