Skip to content

Releases: mikkyang/rust-jwt

Remove legacy code

25 Jul 00:41
0f48648
Compare
Choose a tag to compare
  • Remove legacy code
  • Make all invalid signatures into hard errors instead of returning the boolean validation result

Merge pull request #51 from mikkyang/release/0.9.0

28 Jun 09:03
38b13aa
Compare
Choose a tag to compare
  • Fix issued_at claim serde attribute
  • Widen blanket trait implementation of FromBase64 from DeserializeOwned to Deserialize
  • More detailed errors for token verification

Update RustCrypto Dependencies

17 Jun 10:59
7a3698e
Compare
Choose a tag to compare
Dependency Old New
base64 0.10 0.12
crypto-mac 0.7 0.8
digest 0.8 0.9
hmac 0.7 0.8
sha2 0.8 0.9

Add `Store` trait

30 May 08:51
8c563d0
Compare
Choose a tag to compare

With the Store trait, you can keep collections of keys indexed by their key ids.

New Token API

23 May 09:59
afd2f15
Compare
Choose a tag to compare
  • Move all of the previous structs to the legacy module
  • Introduce more idiomatic Header, Claims, and Token types
  • Support more algorithms with optional OpenSSL support
  • Convenience methods to just sign and verify claims

For most, the following should be enough with their own defined claims types:

With the following key:

let key: Hmac<Sha256> = Hmac::new_varkey(b"some-secret").unwrap();

Signing:

let mut claims = BTreeMap::new();
claims.insert("sub", "someone");

let token_str = claims.sign_with_key(&key).unwrap();

Verification:

let token_str = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJzb21lb25lIn0.5wwE1sBrs-vftww_BGIuTVDeHtc1Jsjo-fiHhDwR8m0";

let claims: BTreeMap<String, String> = VerifyWithKey::verify_with_key(token_str, &key).unwrap();

Update (very outdated) dependencies

12 Apr 01:44
Compare
Choose a tag to compare

The only user facing changes are much needed updates to the crypto dependencies, courtesy of #10.

Types from the previous crate, rust-crypto are replaced with types from various crates from https://github.com/RustCrypto.

For example, replace the type crypto::sha2::Sha256 with sha2::Sha256.

Additionally, rustc_serialize has been migrated to serde from #9.