- Bug Fixes
- with_validation - Fixed an issue where validations were automatically passed if the validation key was not in the payload
-
Enhancements
- Bumped JOSE dependency to 1.7.3 adding native
libsodium
,keccakf1600
andlibdecaf
support. Documentation updated to account for that. - Generated claims are available after signing (thanks to @lnikkila)
- Using
credo
lint checker
- Bumped JOSE dependency to 1.7.3 adding native
-
Bug fixes
- Fix validation of
iat
on the same second (thanks to @lnikkila) - Fix using
@on_load
to better supportexrm
(thanks to @tonyarkles)
- Fix validation of
-
Deprecations:
Joken.Plug
:on_verifying
option has been replaced byverify
. The private option,joken_on_verifying
has been replaced withjoken_verify
as well.on_verifying
andjoken_on_verifying
will be removed in a future version.- Configuration of
none
algorithm is no longer done automatically. To allow thenone
algorithm, setallow_none_algorithm
as before and callJoken.Signer.configure_unsecured_signing()
once during your application's start
- Bug Fixes
- with_validation - Fixed an issue where validations were automatically passed if the validation key was not in the payload
- Enhancements
- Add EdDSA support: Ed25519, Ed25519ph, Ed448, Ed448ph
- Bug Fixes
- with_validation - Fixed an issue where validations were automatically passed if the validation key was not in the payload
-
Enhancements
-
The
none
algorithm can be used if and only ifallow_none_algorithm
exists as an application variable on thejoken
app and is set totrue
. Otherwise an error is thrown -
Joken: added
peek/2
,get_data/1
,with_header_arg/3
,with_header_args/2
,none/1
-
-
Bug fixes
- Ensures
Plug
is loading before loadingJoken.Plug
- Ensures
- Bug Fixes
Joken.Plug
- Fixed capture of defaulton_error
function causing compilation errors
-
Enhancements
- Updated API to allow for more flexibility for signing and verifying tokens
- Joken.Plug has been added.
- Small fixes to make sure Joken works with Elixir 1.1
- Added support for the following signing algorithms:
- ES256
- ES384
- ES512
- PS256
- PS384
- PS512
- RS256
- RS384
- RS512
-
Breaking
- The new API is completely different than the old one. Take a look here to find out how to go from 0.15 to 0.16
encode
anddecode
in the Joken module have been renamed tosign
andverify
.- This release also deprecates plugJWT. Use
Joken.Plug
instead
- Enhancements
- Add options parameter to
Joken.Config.validate_claim
- Moved validation helpers functions to
Joken.Helpers
- Add options parameter to
- Enhancements
- Using the Dict Protocol for accessing data
-
Enhancements
- The
Joken.Config
behaviour handles the configuration of the secret_key, algorithm, encode and decode functions, as well as functions for adding and validating claims - Add
options
parameter toJoken.Token.decode
- Add
options
parameter toJoken.decode
- Removed
:none
algorithm completely
- The
-
Breaking
Joken.Codec
is replaced byJoken.Config
.json_module
in config is replaced byconfig_module
.algorithm
andsecret_key
in config is replaced by implementing thealgorithm
andsecret_key
functions onJoken.Config
.Joken.Token.encode
now has a signature of(joken_config, payload)
since the algorithm and secret key are defined inside of the passed injoken_config
module.Joken.Token.decode
now has a signature of(joken_config, jwt, options \\ [])
since the algorithm and secret key are defined inside of the passed injoken_config
module.
- Enhancements
- Checking to make sure signature is on token unless
:none
is passed as the algorithm
- Checking to make sure signature is on token unless
- Enhancements
- Validating iat claim
- Verifying signature before getting the data p
- Enhancements
- Signature is now verified just from the header and payload strings.
- Added
decode_secret_key?
parameter
- Enhancements
Joken
module now looks more like old API from 0.8 with the exception that it reads configuration from a :joken config block.- For security reasons, now using the configured algorithm for checking signature instead of the one specified in the header.
- Added algorithm paramter to
Joken.Token.decode
to be used when verifying signatures
- Enhancements
- Fixed documentation typos
- Joken now uses an Agent instead of implementing GenServer
-
Enhancements
- No longer has a dependency on Timex or JSX
- Can now use any json library as long as you implement the behaviour,
Joken.Codec
- Joken module is now a GenServer
- secret_key, algorithm, and json_module are now configured when the starting Joken module
-
Breaking
Joken.encode(payload, secret, algorithm, claims)
is nowJoken.encode(pid, payload, claims)
andJoken.decode(token, secret, claims)
is nowJoken.decode(pid, token, claims)
.secret_key
andalgorithm
are now configured along withjson_module
when starting the Joken module via any of theJoken.start_link
functions. You could also use theJoken.Token
module directly instead which isn't a GenServer and allows you to put in all of the parameters needed whenever you call encode or decode.