v2.2.0-beta
Pre-release
Pre-release
IMPORTANT: This is a beta release and therefore, is not recommended for production systems. If you discover a bug, have a concern, etc., please create an issue.
What's Changed
JWK (JSON Web Key) Handling Improvements
- JWK is immutable.
- Random JWK is generated when the phrase is empty.
- Added getter method for JWK in
LittleJWT
. - Added JWK validator.
JWKValidator
is resolved using the service container.- Improved JWK creation and validation processes.
- Various changes related to wrapping JWK.
- Throws
IncompatibleHashAlgorithmJWK
when an error message is the wrong key type.
Algorithm and Hash Method Changes
- The algorithm is no longer passed to the hash method but taken by the method.
- Rearranged parameters for the
hash
method inJWTHasher
. AlgorithmBuilder
is responsible for building algorithm instances.
JWT Signing Process Changes
- Signing is done outside of
JsonWebToken
. - Removed
Sign
class. - The JWK is no longer passed through
JsonWebToken
via aSign
instance. - Signing is handled in the
JWTHasher
class. - The HandlesCreate trait now includes
AutoSigns
,HandlesCreateSigned
, andHandlesCreateUnsigned
. - Moved
createJWTBuilder
method intoHandlesCreateUnsigned
trait.
Container and Dependency Injection Improvements
- Uses
Container
type instead ofApplication
. - The
LittleJWT
is created in the container usingLittleJWTBuilder
. - Binds JWK to
Container
instance. - Runs JWK through
JWKValidator
beforeLittleJWT
is created in theContainer
. LittleJWTBuilder
allowsJWKValidator
to be specified.- The default
JWKValidator
can be specified using the container. - A fallback for when JWK validation fails can be specified.
GitHub Actions and Testing
- Fixes for GitHub Actions failures.
- Tests for various JWK creation and validation scenarios.
- Improved test cases for
JWKValidator
.
Full Changelog: v2.1.1-beta...v2.2.0-beta