All notable changes to this project will be documented in this file. The project adheres to Semantic Versioning.
- Update the
secp256k1
dependency.
- Bump minimum supported Rust version to 1.70.
- Update the
secp256k1
dependency.
- Fix missing JWK helpers when compiling the crate with the
p256
feature.
(All changes are relative compared to the 0.8.0-beta.1 release)
- Support floating-point timestamps in claims.
- Update
ed25519-dalek
dependency, fixing a potential vulnerability as described in RUSTSEC-2022-0093. - Replace unmaintained
serde_cbor
dependency withciborium
.
- Support padding in base64url encoding of certificate thumbprints in the JWT header.
- Update
secp256k1
andrsa
dependencies. - Make JWT
Header
generic similar toClaims
, so that it contain custom fields as per Section 4.2 of RFC 7515. SinceDefault
is now implemented for allHeader<T: Default>
, one should use a newHeader::empty()
method to create an empty header, andHeader::new()
to create a header with custom fields. - Take
Header<_>
by reference inAlgorithmExt
methods creating tokens (previously, it was taken by value). - Support custom-encoded certificate thumbprints in JWT
Header
by replacing types of the corresponding fields with a newThumbprint
enum. As an example, this allows hex-encoded thumbprints (which are then additionally base64url-encoded) produced by some software.
- Deprecate
validate_integrity
andvalidate_for_signed_token
methods inAlgorithmExt
. An extended version of this functionality, which can validate tokens with custom headers, is now encapsulated in the newValidator
type, which is returned by the newAlgorithmExt::validator()
method.
- Update dependencies and bump minimum supported Rust version to 1.65.
- Rename the
with_rsa
feature torsa
.
- Add ES256 implementation using pure-Rust
p256
crate.
- Update dependencies, bump minimum supported Rust version to 1.60 and switch to 2021 Rust edition.
(All changes are relative compared to the 0.5.0-beta.1 release)
- Add
UntrustedToken::into_owned()
method to extend the token lifetime to static. This is useful if anUntrustedToken
needs to be stashed / passed across threads. - Add
UntrustedToken::deserialize_claims_unchecked()
to extract claims from a token without verification. As the name length implies, the method should only be used in exceptional cases. - Implement
FromStr
and some standard traits (Clone
,Copy
,PartialEq
) forRsa
. - Introduce
AlgorithmSignature::LENGTH
constant for specifying the expected signature length. The newValidationError::InvalidSignatureLen
variant provides more specific errors if the signature length is not as specified. - Allow opting out from CBOR claims encoding by making
serde_cbor
dependency optional and using it as a crate feature. The relevant functionality (AlgorithmExt::compact_token
, some error variants, etc.) is now gated behind this feature. This change is motivated by the fact that supporting verification of CBOR-encoded tokens has non-zero cost for library users (e.g., in terms of code size or security analysis).
- Update dependencies.
- Fix datetime overflow when validating the expiration claim.
- Fix
no_std
support for RSA-based JWS algorithms. As a part of the fix, to enable RSA, you should now use thersa
feature instead ofrsa
.
- Use constant-time base64 encoding / decoding from the
base64ct
crate.
- Add
new()
constructor forHS*
keys that accepts any type implementingAsRef<[u8]>
. This simplifies key loading. - Add
new()
constructor forUntrustedToken
that accepts any type implementingAsRef<str>
. This simplifies token processing. - Add basic JSON Web Key (JWK) support. This allows (de)serializing keys from / into a uniform format and computing key thumbprints.
- Add ES256K implementation using pure-Rust
k256
crate.
- Update dependencies.
- Rename
Header.signature_type
field totoken_type
to be more in line with JWT spec. - Rename
Claims.expiration_date
toexpiration
to be more precise. - Encapsulate
hmac
andsha2
dependencies by introducing signature types forHS*
algorithms. Thedigest
dependency is still public. exonum-crypto
feature is no longer enabled by default.- Change return type of
SigningKey::as_bytes()
to securely zeroize owned values on drop.
- Fix ES256K signature verification by accepting high-S signatures, which are still produced by some third-party implementations (e.g., OpenSSL).
No substantial changes compared to the 0.3.0-beta.2 release.
(All changes are relative compared to the 0.3.0-beta.1 release)
- Make
CreationError
non-exhaustive. - Rename
StrongKey::inner()
method tointo_inner
.
- Fix
docs.rs
configuration.
- Add signature getters for untrusted and trusted tokens.
- Add the
ed25519-compact
backend for Ed25519-based tokens. - Add
SigningKey
andVerifyingKey
traits for generic access to cryptographic keys. - Support RSA algorithms using pure-Rust
rsa
crate. - Add
no_std
mode and checkno_std
/ WASM compatibility via dedicated aux crates. Introduce two relevant crate features,clock
andstd
. - Add wrapper types for strong keys / JWT algorithms.
- Add details to some
ValidationError
variants.
- Update dependencies.
- Update minimum supported Rust version due to dependencies.
es256k
feature should now be used for access to libsecp256k1 backend instead ofsecp256k1
.- Rework time-related token creation / validation logic. It is now possible to use a custom clock, which could be useful for testing or if there is no access to the system clock.
- Make
Header
,Claims
,TimeOptions
, and error types non-exhaustive.
- Update dependencies; replace
failure
error handling withanyhow
.
The initial release of jwt-compact
.