All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
-
Non retrocompatible changes
-
Because
nimbus-jose-jwt
changed the API it provides to validate claims, theJwtValidator
implementations provided by this lib don't take anadditionalValidations: List[(JWTClaimsSet, SecurityContext) => Option[BadJWTException]]
parameter anymore and this lib also doesn't provide theProvidedValidations
helpers anymore.Now, the
JwtValidator
implementations expect aclaimsVerifier: JWTClaimsSetVerifier[SecurityContext]
which is the interface provided bynimbus-jose-jwt
to declare your claims validation rules.
For more info about this interface and how to express your validations rules, see validating-jwt-access-tokens#claims.
You can also find some examples in the tests of this lib and in the code of theAwsCognitoJwtValidator
andAuth0JwtValidator
classes. -
The
JwtValidator
interface changed:- from
def validate(jwtToken: JwtToken): Either[BadJWTException, (JwtToken, JWTClaimsSet)]
- to
def validate(jwtToken: JwtToken): Either[InvalidToken, JWTClaimsSet]
The
JwtToken
which was returned by the function was the same as the one passed in parameter. This was useless information. - from
-
Because of the changes in the API of
nimbus-jose-jwt
, we can't provide these errors anymore:MissingExpirationClaim
InvalidTokenUseClaim
InvalidTokenIssuerClaim
InvalidTokenSubject
InvalidAudienceClaim
The
BadJWTException
errors sum type is now replaced by a single classInvalidToken
which contains the cause. -
The
ConfigurableJwtValidator
constructor is now private. You have to replacenew ConfigurableJwtValidator(...)
byConfigurableJwtValidator(...)
-
The
AwsCognitoJwtValidator
constructor is now private. You have to replacenew AwsCognitoJwtValidator(...)
byAwsCognitoJwtValidator(...)
-
The
Auth0JwtValidator
constructor is now private. You have to replacenew Auth0JwtValidator(...)
byAuth0JwtValidator(...)
-
The
SupportedJWSAlgorithm
sum type as been moved fromcom.guizmaii.scalajwt.utils.SupportedJWSAlgorithms.SupportedJWSAlgorithm
tocom.guizmaii.scalajwt.SupportedJWSAlgorithm
-
-
Other changes
- Drop support for Scala 2.11
- Add more tests, especially on
Auth0JwtValidator
- Update dependencies
- Replace Bintray by Maven Central
- Configure Github Actions && sbt-ci-release
- Remove TravisCI
- Update README
- Update dependencies
- Update Scala 2.13 and 2.12
- Update dependencies, sbt and sbt plugins
- Add Scala 2.13 in the CI build matrix and update the Scala 2.12 version used
- Update
nimbus-jose-jwt
,scalatest
,scalafmt
andsbt-scoverage
- Replace hand written scalac flag by
sbt-tpolecat
- Add support for Scala 2.13
- Update Nimbus version from 5.10 to 8.17
- Update SBT to 1.3.10
- Fix Scala 2.11 version publishing
- Improve
scalafmt
configuration - Update Scala 2.12 version
- Improve
scalacOptions
config - Update dependencies
- Improve documentation
- Add
requiredAudience
validation - Add
Auth0JwtValidator
- Add
HS256
tokens support - Improve performance by replacing the
Try
by atry catch
block - Update sbt to v1.0.4
- Add missing
final
s - Rename
ProvidedAdditionalChelcks
toProvidedValidations
- Reorganize code
- Improve documentation
- Update travis config
- Update dependencies
- Update SBT and its plugins
- Update dependencies
- Only handle
RS256
signed tokens for now
- Handle every possible
Exception
- Handle the case where the JWT token is invalid
- Cover
ConfigurableJwtValidator
with tests - Update scalafmt
- Update Nimbus from v4.39.2 to v4.41.1
- Update Scala from v2.12.2 to v2.12.3
- Add
AwsCognitoJwtValidator
- Reorganize files
- Rollback to sbt-bintray v0.3.0 because of this issue: sbt/sbt-bintray#104
- Config sbt-bintray && Scala cross version compilation
- First JwtValidator impl:
ConfigurableJwtValidator