commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
356fac075d265392d14a423abab52d7c71154134 | Vincent Prouillet | 2021-12-03T19:42:05 | Fix validation for issuers | diff --git a/src/validation.rs b/src/validation.rs
index 20f213b..9ab40d0 100644
--- a/src/validation.rs
+++ b/src/validation.rs
@@ -28,6 +28,10 @@ use crate::errors::{new_error, ErrorKind, Result};
/// ```
#[derive(Debug, Clone, PartialEq)]
pub struct Validation {
+ /// Which claims are required to be present be... | 1 | 72 | 18 |
bebeb5f2220552b3500466da2d22a8d9b6a7dfa0 | Vincent Prouillet | 2021-11-19T19:06:45 | Fix #220 | diff --git a/src/decoding.rs b/src/decoding.rs
index 0f77931..1856877 100644
--- a/src/decoding.rs
+++ b/src/decoding.rs
@@ -29,7 +29,7 @@ macro_rules! expect_two {
}};
}
-#[derive(Debug, Clone, PartialEq)]
+#[derive(Clone)]
pub(crate) enum DecodingKeyKind {
SecretOrDer(Vec<u8>),
RsaModulusExponent {... | 2 | 3 | 3 |
7301e928b06f1368cd8293820eb082171da2d515 | Andrew Walbran | 2021-11-19T19:05:58 | Implement Clone, Eq and PartialEq for Error. (#218)
* Implement Eq and PartialEq for Error.
* Implement Clone for Error.
serde_json::Error doesn't implement Clone, so wrapped it in an Arc. | diff --git a/src/errors.rs b/src/errors.rs
index c6809ed..c695c74 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -1,6 +1,7 @@
use std::error::Error as StdError;
use std::fmt;
use std::result;
+use std::sync::Arc;
/// A crate private constructor for `Error`.
pub(crate) fn new_error(kind: ErrorKind) -> Error {
... | 1 | 9 | 5 |
369d1090bb1a332ba2f89e657456e7a777f8c0e3 | Adam Gleave | 2021-11-01T13:26:13 | (`next`) Remove chrono (#213)
* Remove chrono from all dependencies
* Fix tests
* Fix tests and comments | diff --git a/Cargo.toml b/Cargo.toml
index 2af0e53..f8e786c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,11 +18,11 @@ ring = { version = "0.16.5", features = ["std"] }
base64 = "0.13"
# For PEM decoding
pem = "1"
-simple_asn1 = "0.5"
+simple_asn1 = "0.6"
[dev-dependencies]
-# For the custom chrono example
-chr... | 6 | 52 | 44 |
2cc95b9f371915a6bf2f9503ebc3ae3ca2ff9a3c | emeryc | 2021-11-01T13:25:59 | Numeric type (#214)
* exp & nbf as float
In order to properly align with JWT NumericType wire protocol
allow for type on wire to either be u64 or f64. In either case we
convert in the most lossless way possible to a u64, so that nobody
needs to know that the spec is overly permissive.
* minimal cleanup | diff --git a/src/validation.rs b/src/validation.rs
index 14a0726..b189dc4 100644
--- a/src/validation.rs
+++ b/src/validation.rs
@@ -1,8 +1,11 @@
use std::borrow::Cow;
use std::collections::HashSet;
+use std::fmt;
+use std::marker::PhantomData;
use std::time::{SystemTime, UNIX_EPOCH};
-use serde::Deserialize;
+use... | 1 | 80 | 1 |
733d29aa871ed7ff49623ed210010917bea2f4e4 | Vincent Prouillet | 2021-10-10T18:44:53 | Add back Validation::default()
Closes #208 | diff --git a/Cargo.toml b/Cargo.toml
index 1133c6e..2af0e53 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "jsonwebtoken"
-version = "8.0.0-beta.3"
+version = "8.0.0-beta.4"
authors = ["Vincent Prouillet <hello@vincentprouillet.com>"]
license = "MIT"
readme = "README.md"
@@ -17,7 +17,7 @... | 2 | 21 | 15 |
f9771f78353e0039a99579a4b0121106f7d24677 | Ten0 | 2021-09-28T16:16:51 | Improve deserialization performance around validation and its tests (#202)
* Improve deserialization performance around validation and its tests
The claims validation was done via deserializing into a Map, which
implies allocations/deallocations. This was done even if the map was not
used afterwards.
This comm... | diff --git a/benches/jwt.rs b/benches/jwt.rs
index 640b53c..d2fee79 100644
--- a/benches/jwt.rs
+++ b/benches/jwt.rs
@@ -1,5 +1,5 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};
-use jsonwebtoken::{decode, encode, DecodingKey, EncodingKey, Header, Validation};
+use jsonwebtoken::{decode, enc... | 4 | 143 | 142 |
6a7eec9030e503a7edb09f7c1f1afbeeec3c7c32 | Ten0 | 2021-08-25T20:29:30 | Add support for x5t#S256 header (#203) | diff --git a/src/header.rs b/src/header.rs
index 38e9bed..9ea330a 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -50,11 +50,19 @@ pub struct Header {
/// Defined in [RFC7515#4.1.6](https://tools.ietf.org/html/rfc7515#section-4.1.6).
#[serde(skip_serializing_if = "Option::is_none")]
pub x5c: Option<Vec... | 2 | 21 | 5 |
94fef12259f117fc419377c0e752bf12bdd49029 | Matteo Bertucci | 2021-07-19T17:37:11 | Docs: fix copy paste error in ErrorKind::InvalidSubject (#196)
The documentation for `ErrorKind::InvalidSubject` mentioned the `aud` claim instead of `sub`. This commit fixes it. | diff --git a/src/errors.rs b/src/errors.rs
index 1f6c17f..c6809ed 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -56,7 +56,7 @@ pub enum ErrorKind {
InvalidIssuer,
/// When a token’s `aud` claim does not match one of the expected audience values
InvalidAudience,
- /// When a token’s `aud` claim doe... | 1 | 1 | 1 |
3e245e3e6bd45ff117a466ecf6f62f508ff62965 | Vincent Prouillet | 2021-04-12T20:47:49 | Allow uppercase algorithms (too much breakage otherwise) | diff --git a/src/algorithms.rs b/src/algorithms.rs
index 3948711..15687e0 100644
--- a/src/algorithms.rs
+++ b/src/algorithms.rs
@@ -11,6 +11,7 @@ pub(crate) enum AlgorithmFamily {
}
/// The algorithms supported for signing/verifying JWTs
+#[allow(clippy::upper_case_acronyms)]
#[derive(Debug, PartialEq, Hash, Copy... | 1 | 1 | 0 |
8bdc5215ea09739a0ef01be34a35eed629ea5c5e | Jarred Nicholls | 2021-03-06T21:13:59 | Add an access method to decode the Header x5c field into DER PKIX format. (#184) | diff --git a/src/header.rs b/src/header.rs
index 15e93f3..9d50129 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -1,3 +1,5 @@
+use std::result;
+
use serde::{Deserialize, Serialize};
use crate::algorithms::Algorithm;
@@ -39,7 +41,7 @@ pub struct Header {
pub x5u: Option<String>,
/// X.509 certificate c... | 1 | 14 | 2 |
45fb43c1f776d227304c72b96e44f3413da0a699 | Saber Haj Rabiee | 2021-03-05T08:10:03 | removed unnecessary conversions (#180)
* removed unnecessary conversions | diff --git a/src/crypto/ecdsa.rs b/src/crypto/ecdsa.rs
index 5425a8b..f1c3626 100644
--- a/src/crypto/ecdsa.rs
+++ b/src/crypto/ecdsa.rs
@@ -34,5 +34,5 @@ pub fn sign(
let signing_key = signature::EcdsaKeyPair::from_pkcs8(alg, key)?;
let rng = rand::SystemRandom::new();
let out = signing_key.sign(&rng, m... | 7 | 19 | 21 |
de5a1903b0064a22f363b374e5237debaea2779b | Oliver Thallmair | 2021-03-05T08:08:47 | add x5c header (#182)
* add x5c header
* fix format | diff --git a/src/header.rs b/src/header.rs
index ba4b685..b45c191 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -37,6 +37,11 @@ pub struct Header {
/// Defined in [RFC7515#4.1.5](https://tools.ietf.org/html/rfc7515#section-4.1.5).
#[serde(skip_serializing_if = "Option::is_none")]
pub x5u: Option<Stri... | 1 | 6 | 0 |
f3566ecd8239ffdc01b62dc78823f9f12955031a | Saber Haj Rabiee | 2021-03-04T16:28:05 | clone-free validate function (#179)
* clone-free validate function
It could save up to 300ns in my benches | diff --git a/src/validation.rs b/src/validation.rs
index 15f4c5d..f7a9887 100644
--- a/src/validation.rs
+++ b/src/validation.rs
@@ -2,7 +2,7 @@ use std::collections::HashSet;
use std::time::{SystemTime, UNIX_EPOCH};
use serde_json::map::Map;
-use serde_json::{from_value, Value};
+use serde_json::Value;
use crat... | 1 | 13 | 5 |
d8cc36dd0c466e04e4cce0f41fe2cc04c8003eaf | Saber Haj Rabiee | 2021-03-04T11:20:26 | clone-free serde Value deserialization (#178)
* clone-free serde Value deserialization | diff --git a/src/validation.rs b/src/validation.rs
index f4f3d0e..15f4c5d 100644
--- a/src/validation.rs
+++ b/src/validation.rs
@@ -152,14 +152,15 @@ pub fn validate(claims: &Map<String, Value>, options: &Validation) -> Result<()>
if let Some(ref correct_aud) = options.aud {
if let Some(aud) = claims.get... | 1 | 5 | 4 |
9fd9db55cdbedf3c7440de0adac6c9db0dfd0753 | Saber Haj Rabiee | 2021-03-03T21:24:24 | Update validation.rs (#176) | diff --git a/src/validation.rs b/src/validation.rs
index 0858f2e..f4f3d0e 100644
--- a/src/validation.rs
+++ b/src/validation.rs
@@ -159,7 +159,7 @@ pub fn validate(claims: &Map<String, Value>, options: &Validation) -> Result<()>
}
Value::Array(_) => {
let provided... | 1 | 1 | 1 |
874952b7a5413dd4c0f2b88bd9a24372f39372ba | Vincent Prouillet | 2021-02-20T08:57:30 | More clippy | diff --git a/examples/custom_header.rs b/examples/custom_header.rs
index 3ea556a..8d30315 100644
--- a/examples/custom_header.rs
+++ b/examples/custom_header.rs
@@ -15,9 +15,7 @@ fn main() {
Claims { sub: "b@b.com".to_owned(), company: "ACME".to_owned(), exp: 10000000000 };
let key = b"secret";
- let... | 2 | 2 | 4 |
c9442834edf8161c77421c6f76e02ff2577ad4bb | Vincent Prouillet | 2021-02-19T20:41:08 | Make DecodingKey own all the data
Closes #120
Supersedes #128 | diff --git a/src/crypto/rsa.rs b/src/crypto/rsa.rs
index d0b2f4d..687ca97 100644
--- a/src/crypto/rsa.rs
+++ b/src/crypto/rsa.rs
@@ -1,5 +1,4 @@
use ring::{rand, signature};
-use simple_asn1::BigUint;
use crate::algorithms::Algorithm;
use crate::errors::{ErrorKind, Result};
@@ -54,12 +53,10 @@ pub(crate) fn verify... | 4 | 41 | 56 |
60c92f2882c211e21311e416796eb9c713a06d71 | Vincent Prouillet | 2021-02-19T20:29:19 | Fix clippy | diff --git a/src/crypto/mod.rs b/src/crypto/mod.rs
index 1be9ee7..b30e4de 100644
--- a/src/crypto/mod.rs
+++ b/src/crypto/mod.rs
@@ -13,9 +13,9 @@ pub(crate) mod rsa;
/// The actual HS signing + encoding
/// Could be in its own file to match RSA/EC but it's 2 lines...
-pub(crate) fn sign_hmac(alg: hmac::Algorithm, ... | 2 | 6 | 8 |
f50e4901cb52adc6e6a48f12fb445c12334cfc63 | Vincent Prouillet | 2021-02-19T20:20:47 | Avoid allocation | diff --git a/src/decoding.rs b/src/decoding.rs
index b393d7c..43d2214 100644
--- a/src/decoding.rs
+++ b/src/decoding.rs
@@ -154,17 +154,17 @@ impl<'a> DecodingKey<'a> {
/// If the token or its signature is invalid, it will return an error.
///
/// ```rust///
-/// use jsonwebtoken::{verify_sig, DecodingKey, Validati... | 2 | 8 | 8 |
2aad217087cc677b1ff7d578f0afa33a734fede3 | Adrian Black | 2021-02-19T20:17:59 | add verify_sig fn (#161)
* add verify_sig fn
* fix missing comma
* fmt whitespace changes | diff --git a/src/decoding.rs b/src/decoding.rs
index a55bf6a..b393d7c 100644
--- a/src/decoding.rs
+++ b/src/decoding.rs
@@ -149,29 +149,22 @@ impl<'a> DecodingKey<'a> {
}
}
-/// Decode and validate a JWT
+/// Verify signature of a JWT, and return header object and raw payload
///
-/// If the token or its sign... | 2 | 43 | 19 |
d2c8ae3f1143b3a3dd115bb55827c028ba28c1a5 | Vincent Prouillet | 2021-02-19T20:13:20 | Impl PartialEq for ErrorKind
Closes #125 | diff --git a/src/decoding.rs b/src/decoding.rs
index 22ccf0d..a55bf6a 100644
--- a/src/decoding.rs
+++ b/src/decoding.rs
@@ -262,7 +262,6 @@ pub fn dangerous_insecure_decode_with_validation<T: DeserializeOwned>(
Ok(TokenData { header, claims: decoded_claims })
}
-
/// Decode a JWT without any signature verific... | 2 | 6 | 1 |
5c706b005afd2d7fdf0ad0fb5ebd08fedfbd01f9 | Vincent Prouillet | 2021-02-19T20:09:48 | Remove deprecated fn | diff --git a/src/decoding.rs b/src/decoding.rs
index 110fdcd..22ccf0d 100644
--- a/src/decoding.rs
+++ b/src/decoding.rs
@@ -262,13 +262,6 @@ pub fn dangerous_insecure_decode_with_validation<T: DeserializeOwned>(
Ok(TokenData { header, claims: decoded_claims })
}
-/// Decode a JWT without any signature verifica... | 2 | 0 | 9 |
2c9c57fc4bfaf7c8b55f26741844eee16e864073 | Vincent Prouillet | 2021-02-19T20:08:30 | Expose get_current_timestamp
Closes #152 | diff --git a/src/lib.rs b/src/lib.rs
index 41b10f9..c5c23b7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -24,4 +24,4 @@ pub use decoding::{
};
pub use encoding::{encode, EncodingKey};
pub use header::Header;
-pub use validation::Validation;
+pub use validation::{get_current_timestamp, Validation};
diff --git a/src/va... | 2 | 3 | 2 |
30571cafd2949f3d769a1658695ef5c9e9c4f8e4 | Vincent Prouillet | 2021-02-19T20:04:17 | Keep RSA key error message from ring
Closes #164 | diff --git a/src/crypto/rsa.rs b/src/crypto/rsa.rs
index df93960..d0b2f4d 100644
--- a/src/crypto/rsa.rs
+++ b/src/crypto/rsa.rs
@@ -39,11 +39,12 @@ pub(crate) fn sign(
key: &[u8],
message: &[u8],
) -> Result<String> {
- let key_pair = signature::RsaKeyPair::from_der(key).map_err(|_| ErrorKind::InvalidRsa... | 6 | 31 | 55 |
2662f6ad1fc452230a8936394a9c293837a385e3 | Vincent Prouillet | 2020-11-17T13:45:07 | fmt + clippy | diff --git a/tests/ecdsa/mod.rs b/tests/ecdsa/mod.rs
index 40e97df..0f26ae0 100644
--- a/tests/ecdsa/mod.rs
+++ b/tests/ecdsa/mod.rs
@@ -18,10 +18,15 @@ fn round_trip_sign_verification_pk8() {
let pubkey = include_bytes!("public_ecdsa_key.pk8");
let encrypted =
- sign("hello world".as_bytes(), &Encod... | 4 | 64 | 26 |
4aee8bc382aab9f69e0a2b538738b3634cdedf53 | Charles Lehner | 2020-11-17T13:17:40 | Add sign and verify on bytes (#150) | diff --git a/src/crypto/ecdsa.rs b/src/crypto/ecdsa.rs
index afa0f79..5425a8b 100644
--- a/src/crypto/ecdsa.rs
+++ b/src/crypto/ecdsa.rs
@@ -29,10 +29,10 @@ pub(crate) fn alg_to_ec_signing(alg: Algorithm) -> &'static signature::EcdsaSign
pub fn sign(
alg: &'static signature::EcdsaSigningAlgorithm,
key: &[u8]... | 3 | 26 | 13 |
445dfe037e5dfa1975d2305e16830a18987a8f24 | Vincent Prouillet | 2020-11-17T08:32:24 | Prepare for v8 | diff --git a/Cargo.toml b/Cargo.toml
index b7d8fe5..51e6e57 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "jsonwebtoken"
-version = "7.2.0"
+version = "8.0.0"
authors = ["Vincent Prouillet <hello@vincentprouillet.com>"]
license = "MIT"
readme = "README.md"
@@ -15,10 +15,10 @@ include = ... | 1 | 3 | 3 |
2f25cbed0a906e091a278c10eeb6cc1cf30dc24a | Arniu Tseng | 2020-12-07T15:00:44 | Add note about encoding keys (#163)
* Add note about encoding keys
* Update encoding.rs
* Format code | diff --git a/src/encoding.rs b/src/encoding.rs
index 3f7a690..49564ae 100644
--- a/src/encoding.rs
+++ b/src/encoding.rs
@@ -29,6 +29,12 @@ impl EncodingKey {
/// If you are loading a RSA key from a .pem file.
/// This errors if the key is not a valid RSA key.
+ ///
+ /// # NOTE
+ ///
+ /// Acco... | 1 | 17 | 0 |
64f276c814524ff5a66e2499d5d1141f17847a5d | Craig Colegrove | 2020-06-30T18:03:53 | Add new function and tests (#138)
Co-authored-by: Vincent Prouillet <balthek@gmail.com> | diff --git a/src/decoding.rs b/src/decoding.rs
index 3b149cb..1292646 100644
--- a/src/decoding.rs
+++ b/src/decoding.rs
@@ -206,12 +206,51 @@ pub fn dangerous_insecure_decode<T: DeserializeOwned>(token: &str) -> Result<Tok
Ok(TokenData { header, claims: decoded_claims })
}
+/// Decode and validate a JWT withou... | 3 | 71 | 1 |
6262b4700bf08ae9d22afeeddea33d5d75f58c35 | Vincent Prouillet | 2020-06-30T17:58:11 | Slight tweaks | diff --git a/src/decoding.rs b/src/decoding.rs
index 86807f9..3b149cb 100644
--- a/src/decoding.rs
+++ b/src/decoding.rs
@@ -206,26 +206,9 @@ pub fn dangerous_insecure_decode<T: DeserializeOwned>(token: &str) -> Result<Tok
Ok(TokenData { header, claims: decoded_claims })
}
-/// Decode a JWT without any signatur... | 2 | 2 | 22 |
636c0dc203f1850de4279cb9c7e903040c89070d | Craig Colegrove | 2020-06-30T17:50:45 | Rename dangerous_unsafe_decode to dangerous_insecure_decode (#139)
* Rename dangerous_unsafe_decode to dangerous_insecure_decode
* Add back old function name with deprecation flag | diff --git a/src/decoding.rs b/src/decoding.rs
index d0d3497..86807f9 100644
--- a/src/decoding.rs
+++ b/src/decoding.rs
@@ -184,7 +184,7 @@ pub fn decode<T: DeserializeOwned>(
///
/// ```rust
/// use serde::{Deserialize, Serialize};
-/// use jsonwebtoken::{dangerous_unsafe_decode, Validation, Algorithm};
+/// use j... | 3 | 41 | 13 |
693a10012883d60266dadc7bfa9b945aec2f9204 | Craig Colegrove | 2020-06-16T10:04:22 | Derive Hash for Header and Algorithm (#137) | diff --git a/src/algorithms.rs b/src/algorithms.rs
index 20edbf1..924a41e 100644
--- a/src/algorithms.rs
+++ b/src/algorithms.rs
@@ -10,7 +10,7 @@ pub(crate) enum AlgorithmFamily {
}
/// The algorithms supported for signing/verifying JWTs
-#[derive(Debug, PartialEq, Copy, Clone, Serialize, Deserialize)]
+#[derive(D... | 2 | 2 | 2 |
3cae0df3dd94734c4ad8dabec371283dfaec32db | Marc Mettke | 2020-06-09T19:50:19 | Updating base64 to 0.12 (#133) | diff --git a/Cargo.toml b/Cargo.toml
index 21e24f7..3888eb3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,7 +14,7 @@ edition = "2018"
serde_json = "1.0"
serde = {version = "1.0", features = ["derive"] }
ring = { version = "0.16.5", features = ["std"] }
-base64 = "0.11"
+base64 = "0.12"
# For PEM decoding
pem = "... | 1 | 1 | 1 |
09aad3ca2f36e88a8adbaecf8c6a5dc7af6931cf | Valentin Brandl | 2020-04-24T17:57:51 | Fix Broken chrono Example (#126)
* Add quickcheck as test dependencie
* Use timestamp nanos
* Add test property for en/decoding
* Fix existing test
* Remove quickcheck dependency
* Normalize `DateTime` values in claims | diff --git a/examples/custom_chrono.rs b/examples/custom_chrono.rs
index 561ad10..081cad4 100644
--- a/examples/custom_chrono.rs
+++ b/examples/custom_chrono.rs
@@ -13,6 +13,19 @@ struct Claims {
exp: DateTime<Utc>,
}
+impl Claims {
+ /// If a token should always be equal to its representation after serializ... | 1 | 45 | 4 |
946aef1b5762a9e61f7520ca7294da59eb786a32 | Hexilee | 2020-02-28T07:20:41 | revert breaking change of DecodingKey | diff --git a/src/decoding.rs b/src/decoding.rs
index c8ea4e4..d0d3497 100644
--- a/src/decoding.rs
+++ b/src/decoding.rs
@@ -54,6 +54,25 @@ impl<'a> DecodingKey<'a> {
}
}
+ /// If you're using HMAC with a base64 encoded, use this.
+ pub fn from_base64_secret(secret: &str) -> Result<Self> {
+ ... | 1 | 29 | 31 |
a750d5586f0b9f3ffc3867469ea5f6b145d644b2 | Hexilee | 2020-02-27T17:26:58 | fix issue 120: DecodingKey can be converted to static | diff --git a/src/decoding.rs b/src/decoding.rs
index 36837f0..c8ea4e4 100644
--- a/src/decoding.rs
+++ b/src/decoding.rs
@@ -34,7 +34,7 @@ macro_rules! expect_two {
#[derive(Debug, Clone, PartialEq)]
pub(crate) enum DecodingKeyKind<'a> {
SecretOrDer(Cow<'a, [u8]>),
- RsaModulusExponent { n: &'a str, e: &'a st... | 2 | 54 | 34 |
2f359b515ca4f986f1755b524723ccb01c6140c2 | FujiApple | 2020-01-31T05:11:40 | - Fix recursive `Display::fmt` implementation on `Error` to avoid stack overflow
- Added unit test to cover a sample case | diff --git a/src/errors.rs b/src/errors.rs
index d634581..49e6f09 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -117,7 +117,7 @@ impl fmt::Display for Error {
| ErrorKind::ImmatureSignature
| ErrorKind::InvalidAlgorithm
| ErrorKind::InvalidKeyFormat
- | ErrorKind::I... | 1 | 12 | 1 |
c2f6093309d199088e04e9e0ce9cd99888001174 | Vincent Prouillet | 2020-01-28T04:52:46 | Get rid of deprecrated std error description | diff --git a/src/errors.rs b/src/errors.rs
index 580e8b3..d634581 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -80,28 +80,6 @@ pub enum ErrorKind {
}
impl StdError for Error {
- fn description(&self) -> &str {
- match *self.0 {
- ErrorKind::InvalidToken => "invalid token",
- Err... | 1 | 1 | 23 |
689cc6d32e05b0c04be41b706dc904aab9000206 | Vincent Prouillet | 2020-01-13T18:38:33 | Validate key type with algo in encode/decode | diff --git a/src/algorithms.rs b/src/algorithms.rs
index c9ff848..20edbf1 100644
--- a/src/algorithms.rs
+++ b/src/algorithms.rs
@@ -2,6 +2,13 @@ use crate::errors::{Error, ErrorKind, Result};
use serde::{Deserialize, Serialize};
use std::str::FromStr;
+#[derive(Debug, Eq, PartialEq, Copy, Clone, Serialize, Deseria... | 7 | 114 | 22 |
4dd2f12c6de76e455e82c1a910722bc8566814e6 | Vincent Prouillet | 2020-01-02T18:40:53 | Remove EncodingKey lifetime | diff --git a/src/encoding.rs b/src/encoding.rs
index 337eb4b..175e081 100644
--- a/src/encoding.rs
+++ b/src/encoding.rs
@@ -1,5 +1,3 @@
-use std::borrow::Cow;
-
use serde::ser::Serialize;
use crate::crypto;
@@ -11,39 +9,38 @@ use crate::serialization::b64_encode_part;
/// A key to encode a JWT with. Can be a secr... | 1 | 12 | 15 |
bfcfc1d3411805b1ab64bbcc85bc3dcf91a5eabb | Vincent Prouillet | 2019-11-28T18:27:08 | Handle aud not being a sequence
Closes #110 | diff --git a/Cargo.toml b/Cargo.toml
index 37f8b32..d6f4a2a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "jsonwebtoken"
-version = "7.0.0-alpha.1"
+version = "7.0.0-alpha.2"
authors = ["Vincent Prouillet <hello@vincentprouillet.com>"]
license = "MIT"
readme = "README.md"
diff --git a/s... | 2 | 35 | 5 |
499b439cb09a03ac08a96700f5eef18b782396ef | Vincent Prouillet | 2019-11-15T19:39:19 | Wrong badge | diff --git a/Cargo.toml b/Cargo.toml
index 927b64d..37f8b32 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,4 +24,4 @@ simple_asn1 = "0.4"
chrono = "0.4"
[badges]
-maintenance = { status = "passively-developed" }
+maintenance = { status = "passively-maintained" } | 1 | 1 | 1 |
6e8d4a4be6aa16fdd23f5c5786c55d45dcc7975a | Vincent Prouillet | 2019-11-14T18:48:38 | Remove pem encoding for now | diff --git a/src/pem/encoder.rs b/src/pem/encoder.rs
deleted file mode 100644
index f2c2159..0000000
--- a/src/pem/encoder.rs
+++ /dev/null
@@ -1,194 +0,0 @@
-use crate::errors::{ErrorKind, Result};
-use pem::Pem;
-use simple_asn1::{ASN1Block, BigInt, BigUint, OID};
-
-pub(crate) fn encode_rsa_public_pkcs1_pem(modulus:... | 2 | 0 | 227 |
8e4757cb1dace5b616eff07d7b4274880a13d387 | Vincent Prouillet | 2019-11-11T19:29:57 | More refactoring in the crypto mod | diff --git a/src/crypto/ecdsa.rs b/src/crypto/ecdsa.rs
index eb7aa05..ba2f0ff 100644
--- a/src/crypto/ecdsa.rs
+++ b/src/crypto/ecdsa.rs
@@ -1,17 +1,27 @@
use ring::{rand, signature};
+use crate::algorithms::Algorithm;
use crate::errors::Result;
use crate::pem_decoder::PemEncodedKey;
use crate::serialization::b64... | 5 | 78 | 43 |
1f6d0ffb2c6afafdc765b934444ec80bb5f1bfcd | Vincent Prouillet | 2019-11-11T19:16:34 | Refactor decoding | diff --git a/Cargo.toml b/Cargo.toml
index 3ed0158..aa66e7a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,3 +22,6 @@ simple_asn1 = "0.4"
[dev-dependencies]
# For the custom chrono example
chrono = "0.4"
+
+[badges]
+maintenance = { status = "passively-developed" }
diff --git a/src/crypto/ecdsa.rs b/src/crypto/ecds... | 8 | 89 | 75 |
614f3610a72b752d9241b06bcaf7c1f27910400a | Vincent Prouillet | 2019-11-11T11:08:11 | Fix stupid bug | diff --git a/src/crypto/mod.rs b/src/crypto/mod.rs
index 6ec34fc..8f624aa 100644
--- a/src/crypto/mod.rs
+++ b/src/crypto/mod.rs
@@ -120,9 +120,10 @@ pub fn verify_rsa_modulus_exponent(
message: &str,
components: (&str, &str),
) -> Result<bool> {
+ let signature_bytes = decode(signature)?;
let n = Bi... | 1 | 2 | 1 |
b27981549f93a0f667e064cd3c7e2956a6a97277 | Vincent Prouillet | 2019-11-09T11:42:40 | Not working yet jwk decoding | diff --git a/Cargo.toml b/Cargo.toml
index 75d2314..de7847b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "jsonwebtoken"
version = "7.0.0"
-authors = ["Vincent Prouillet <prouillet.vincent@gmail.com>"]
+authors = ["Vincent Prouillet <hello@vincentprouillet.com>"]
license = "MIT"
readme ... | 9 | 222 | 240 |
e3632b3a2c874b6112516d23b4a952a2305a570f | Vincent Prouillet | 2019-11-06T22:32:13 | Remove Key approach in favour of &[u8] with pem | diff --git a/examples/custom_chrono.rs b/examples/custom_chrono.rs
index fa6d868..e0b1185 100644
--- a/examples/custom_chrono.rs
+++ b/examples/custom_chrono.rs
@@ -1,5 +1,5 @@
use chrono::prelude::*;
-use jsonwebtoken::{Header, Key, Validation};
+use jsonwebtoken::{Header, Validation};
use serde::{Deserialize, Seria... | 14 | 262 | 351 |
a6ea8c2c1a4bb6ad4778b6320f6c18a1ab4545f4 | Vincent Prouillet | 2019-11-06T18:41:51 | clippy + fmt | diff --git a/src/crypto.rs b/src/crypto.rs
index 3556fb8..804f082 100644
--- a/src/crypto.rs
+++ b/src/crypto.rs
@@ -10,7 +10,7 @@ use crate::keys::Key;
fn sign_hmac(alg: hmac::Algorithm, key: Key, signing_input: &str) -> Result<String> {
let signing_key = match key {
Key::Hmac(bytes) => hmac::Key::new(a... | 3 | 19 | 18 |
382e4478cf4694f073c29e9ce570a6932887c9dc | Vincent Prouillet | 2019-11-06T18:30:59 | Move pem encoding tests | diff --git a/src/lib.rs b/src/lib.rs
index 6785890..5a81b2f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -215,4 +215,4 @@ pub fn encode_ec_public_pem(x_coordinate: &[u8]) -> Result<String> {
/// TODO
pub fn encode_ec_public_der(x_coordinate: &[u8]) -> Result<Vec<u8>> {
pem_encoder::encode_ec_public_der(x_coordina... | 4 | 113 | 86 |
53188e1f403cd46a84ccf7251372c4f14c07f31f | Levi | 2019-11-06T13:58:49 | Add functions to create pems and ders of the public keys (#108) | diff --git a/src/lib.rs b/src/lib.rs
index 0dc6cbf..6785890 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -10,6 +10,7 @@ pub mod errors;
mod header;
mod keys;
mod pem_decoder;
+mod pem_encoder;
mod serialization;
mod validation;
@@ -185,3 +186,33 @@ pub fn decode_header(token: &str) -> Result<Header> {
pub fn dec... | 4 | 206 | 2 |
73d96357c359633699f5edd2cfed3b726fb414b4 | Vincent Prouillet | 2019-11-03T16:13:22 | Simplify header decoding | diff --git a/src/errors.rs b/src/errors.rs
index 317a5cb..0c8b148 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -45,7 +45,7 @@ pub enum ErrorKind {
/// When a key is provided with an invalid format
InvalidKeyFormat,
- // validation error
+ // Validation errors
/// When a token’s `exp` claim i... | 4 | 36 | 32 |
417e00780d333af58f3963d57999e06bcfd1030a | Vincent Prouillet | 2019-11-03T15:46:08 | Use serde with derive feature | diff --git a/Cargo.toml b/Cargo.toml
index b294bd8..75d2314 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,8 +12,7 @@ edition = "2018"
[dependencies]
serde_json = "1.0"
-serde_derive = "1.0"
-serde = "1.0"
+serde = {version = "1.0", features = ["derive"] }
ring = { version = "0.16.5", features = ["std"] }
base64... | 10 | 19 | 40 |
caef740ad419bc575f6558ca61f7e354141ed5f1 | Vincent Prouillet | 2019-11-03T13:17:04 | Refactoring + more idiomatic enum names | diff --git a/src/keys.rs b/src/keys.rs
index cbabfa4..0d2e6c4 100644
--- a/src/keys.rs
+++ b/src/keys.rs
@@ -1,5 +1,6 @@
/// The supported RSA key formats, see the documentation for ring::signature::RsaKeyPair
/// for more information
+#[derive(Debug, PartialEq)]
pub enum Key<'a> {
/// An unencrypted PKCS#8-enc... | 2 | 57 | 58 |
06bebeaae3e621601d140109b7aabcc537f56ba4 | Vincent Prouillet | 2019-11-03T12:55:36 | cargo fmt | diff --git a/src/lib.rs b/src/lib.rs
index 0243844..db07517 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -18,17 +18,17 @@ mod crypto;
pub mod errors;
mod header;
mod keys;
+mod pem_decoder;
mod serialization;
mod validation;
-mod pem_decoder;
pub use algorithms::Algorithm;
pub use crypto::{sign, verify};
pub u... | 3 | 140 | 145 |
b9a3e3086fa9b3f0399b333c9ddf136edd2e4a67 | Vincent Prouillet | 2019-11-03T12:36:52 | Fix Option handling | diff --git a/src/pem_decoder.rs b/src/pem_decoder.rs
index 32c9b7c..e525eb9 100644
--- a/src/pem_decoder.rs
+++ b/src/pem_decoder.rs
@@ -6,11 +6,32 @@ extern crate simple_asn1;
use simple_asn1::{OID, BigUint};
+/// Supported PEM files for EC and RSA Public and Private Keys
+#[derive(Debug, PartialEq)]
+enum PemTyp... | 1 | 34 | 37 |
60a030874abe31364ad217d867f071c55e45d608 | dowwie | 2019-10-31T18:12:08 | updated imports in validation.rs | diff --git a/src/validation.rs b/src/validation.rs
index f6497cc..8c7b2ca 100644
--- a/src/validation.rs
+++ b/src/validation.rs
@@ -3,8 +3,8 @@ use chrono::Utc;
use serde_json::map::Map;
use serde_json::{from_value, Value};
-use crypto::Algorithm;
-use errors::{new_error, ErrorKind, Result};
+use crate::algorithms... | 1 | 3 | 3 |
68d6c84c8cc3b517ef8aeb8c5ed34d11aa6bc96a | dowwie | 2019-10-28T15:49:02 | revised set_audience, cleaned up validation, and cleared compiler warnings | diff --git a/src/validation.rs b/src/validation.rs
index e8a60f8..f6497cc 100644
--- a/src/validation.rs
+++ b/src/validation.rs
@@ -1,11 +1,10 @@
use std::collections::HashSet;
use chrono::Utc;
-use serde::ser::Serialize;
use serde_json::map::Map;
-use serde_json::{from_value, to_value, Value};
+use serde_json::{fr... | 1 | 18 | 43 |
f7423d075ad13fa114242c0a7e51ce51467e840a | Brian Smith | 2019-08-10T21:38:14 | Use *ring* 0.16.5. | diff --git a/Cargo.toml b/Cargo.toml
index 41cf026..c7a8393 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,7 +14,6 @@ edition = "2018"
serde_json = "1.0"
serde_derive = "1.0"
serde = "1.0"
-ring = "0.14.6"
+ring = { version = "0.16.5", features = ["std"] }
base64 = "0.10"
-untrusted = "0.6"
chrono = "0.4"
diff --... | 3 | 26 | 41 |
3c62b98bd9d0e31f1f34bbf2d21103278fbfa0dc | Vincent Prouillet | 2019-06-16T16:15:14 | Update example to v7 style | diff --git a/examples/custom_chrono.rs b/examples/custom_chrono.rs
index 7fd7b3a..2d3bcca 100644
--- a/examples/custom_chrono.rs
+++ b/examples/custom_chrono.rs
@@ -5,7 +5,7 @@ extern crate serde_derive;
extern crate chrono;
use chrono::prelude::*;
-use jwt::{Header, Validation};
+use jwt::{Header, Key, Validation}... | 1 | 8 | 6 |
d51a3f632db33f3c0111b40633db30309e95e973 | Jake Shadle | 2019-05-15T14:20:32 | Fix benches | diff --git a/benches/jwt.rs b/benches/jwt.rs
index dab789c..47ba571 100644
--- a/benches/jwt.rs
+++ b/benches/jwt.rs
@@ -4,7 +4,7 @@ extern crate test;
#[macro_use]
extern crate serde_derive;
-use jwt::{decode, encode, Header, Validation};
+use jwt::{decode, encode, Header, Hmac, Validation};
#[derive(Debug, Par... | 1 | 2 | 2 |
c5db9fbe32eefc1d9b8d7cb62bb40fc5d2ea5fe7 | Jake Shadle | 2019-05-15T14:20:25 | Fix tests | diff --git a/tests/ecdsa.rs b/tests/ecdsa.rs
index 72f13df..5c1b315 100644
--- a/tests/ecdsa.rs
+++ b/tests/ecdsa.rs
@@ -4,7 +4,7 @@ extern crate serde_derive;
extern crate chrono;
use chrono::Utc;
-use jsonwebtoken::{decode, encode, sign, verify, Algorithm, Header, Validation};
+use jsonwebtoken::{decode, encode, ... | 3 | 28 | 13 |
bae7a12a4b804ac6aff3fc96675463e41dcff870 | Jake Shadle | 2019-05-15T14:20:09 | Fix examples | diff --git a/examples/custom_header.rs b/examples/custom_header.rs
index 99d346d..d43ae50 100644
--- a/examples/custom_header.rs
+++ b/examples/custom_header.rs
@@ -15,13 +15,13 @@ struct Claims {
fn main() {
let my_claims =
Claims { sub: "b@b.com".to_owned(), company: "ACME".to_owned(), exp: 10000000000... | 2 | 4 | 4 |
6cfb5c7c0e0ddfb48cf19679bfc3de0110db3f95 | Jake Shadle | 2019-05-15T14:19:38 | Add Key trait and the supported formats | diff --git a/src/crypto.rs b/src/crypto.rs
index 76dccd2..cab93e7 100644
--- a/src/crypto.rs
+++ b/src/crypto.rs
@@ -56,16 +56,32 @@ impl FromStr for Algorithm {
}
/// The actual HS signing + encoding
-fn sign_hmac(alg: &'static digest::Algorithm, key: &[u8], signing_input: &str) -> Result<String> {
- let signin... | 3 | 183 | 27 |
5d01baea948de7ff2212d73989503bdbc364d9b2 | Jake Shadle | 2019-05-15T14:16:49 | Bump ring | diff --git a/Cargo.toml b/Cargo.toml
index 581ce58..cb2d641 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@ keywords = ["jwt", "web", "api", "token", "json"]
serde_json = "1.0"
serde_derive = "1.0"
serde = "1.0"
-ring = "0.14.4"
+ring = "0.14.6"
base64 = "0.10"
untrusted = "0.6"
chrono = "0.4" | 1 | 1 | 1 |
f68210c688995ab8098331b153b89d9202d9eef2 | Max Burke | 2019-05-10T23:36:28 | Fix algorithm mapping.
RS256/384/512 algorithm strings were mapped to HMAC-SHA256/384/512
enumerators. | diff --git a/src/crypto.rs b/src/crypto.rs
index 96f2774..76dccd2 100644
--- a/src/crypto.rs
+++ b/src/crypto.rs
@@ -47,9 +47,9 @@ impl FromStr for Algorithm {
"HS512" => Ok(Algorithm::HS512),
"ES256" => Ok(Algorithm::ES256),
"ES384" => Ok(Algorithm::ES384),
- "RS256" =... | 1 | 3 | 3 |
6bac1bdbf0bb33b2b95d5c0430c99e1cb56ba417 | Kellen Frodelius-Fujimoto | 2019-04-01T10:11:28 | Add example of using `chrono::DateTime` in claims
Using `chrono`'s `serde` feature uses ISO 8601 instead of a Unix
timestamp as specified in RFC 7519 section 2, "NumericDate". This
example uses custom de/serialize functions as shown in the [serde.rs
example, "Custom Date
Format"](https://serde.rs/custom-date-form... | diff --git a/examples/custom_chrono.rs b/examples/custom_chrono.rs
new file mode 100644
index 0000000..7fd7b3a
--- /dev/null
+++ b/examples/custom_chrono.rs
@@ -0,0 +1,101 @@
+extern crate jsonwebtoken as jwt;
+extern crate serde;
+#[macro_use]
+extern crate serde_derive;
+extern crate chrono;
+
+use chrono::prelude::*... | 1 | 101 | 0 |
8a495d3a4e9feeec648b8c532238eb2015428fab | Jasper Bryant-Greene | 2019-02-01T04:12:29 | updated ring dependency | diff --git a/Cargo.toml b/Cargo.toml
index 142f489..6ec7278 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@ keywords = ["jwt", "web", "api", "token", "json"]
serde_json = "1.0"
serde_derive = "1.0"
serde = "1.0"
-ring = "0.14.1"
+ring = "0.14.4"
base64 = "0.9"
untrusted = "0.6"
chrono = "0.4" | 1 | 1 | 1 |
2793bc2be40b24d9add2adaa08cd9ce9c0b18f10 | Frank Prößdorf | 2019-01-18T07:31:56 | Fix documentation of default values in validation | diff --git a/src/validation.rs b/src/validation.rs
index 3684823..a451390 100644
--- a/src/validation.rs
+++ b/src/validation.rs
@@ -41,13 +41,13 @@ pub struct Validation {
///
/// It will return an error if the time in the `iat` field is in the future.
///
- /// Defaults to `true`.
+ /// Defaults ... | 1 | 2 | 2 |
1f6ae28566c09a8e595740182446979004255803 | Jasper Bryant-Greene | 2019-01-18T02:34:12 | ring -> 0.14.1, updated other deps | diff --git a/Cargo.toml b/Cargo.toml
index 4321e56..142f489 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@ keywords = ["jwt", "web", "api", "token", "json"]
serde_json = "1.0"
serde_derive = "1.0"
serde = "1.0"
-ring = "0.14.0-alpha4"
+ring = "0.14.1"
base64 = "0.9"
untrusted = "0.6"
chrono = "0.4" | 1 | 1 | 1 |
716fe8b64d2b89811e079dc10b7a7bb32a898e08 | Alex Gaynor | 2019-01-13T00:20:34 | Upgraded ring to 0.14 | diff --git a/Cargo.toml b/Cargo.toml
index c9c2e31..bfd72a6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@ keywords = ["jwt", "web", "api", "token", "json"]
serde_json = "1.0"
serde_derive = "1.0"
serde = "1.0"
-ring = { version = "0.13", features = ["rsa_signing", "dev_urandom_fallback"] }
+ring = { ver... | 2 | 5 | 7 |
9883fab729635c924e441217309f43412c4c87fc | Jasper Bryant-Greene | 2019-01-09T01:46:06 | implemented ECDSA signing, updated ring to 0.14 alpha | diff --git a/Cargo.toml b/Cargo.toml
index c9c2e31..4321e56 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@ keywords = ["jwt", "web", "api", "token", "json"]
serde_json = "1.0"
serde_derive = "1.0"
serde = "1.0"
-ring = { version = "0.13", features = ["rsa_signing", "dev_urandom_fallback"] }
+ring = "0.14... | 3 | 35 | 17 |
67682300773b063176cf46a79095559a54e9118e | Jasper Bryant-Greene | 2019-01-09T01:18:49 | Added ES256/ES384/ES512 Algorithm stubs | diff --git a/src/crypto.rs b/src/crypto.rs
index 207897b..edc63a9 100644
--- a/src/crypto.rs
+++ b/src/crypto.rs
@@ -18,6 +18,15 @@ pub enum Algorithm {
/// HMAC using SHA-512
HS512,
+ /// ECDSA using SHA-256
+ ES256,
+
+ /// ECDSA using SHA-384
+ ES384,
+
+ /// ECDSA using SHA-512
+ ES512... | 1 | 24 | 0 |
4bd4c8b3de83092be874944f154330af6544b42c | himanoa | 2018-08-30T18:53:55 | feat: Implement FromStr trait for Algorithm | diff --git a/src/crypto.rs b/src/crypto.rs
index 110de2e..81bbda1 100644
--- a/src/crypto.rs
+++ b/src/crypto.rs
@@ -4,8 +4,9 @@ use base64;
use ring::{rand, digest, hmac, signature};
use ring::constant_time::verify_slices_are_equal;
use untrusted;
+use std::str::FromStr;
-use errors::{Result, ErrorKind};
+use err... | 3 | 31 | 1 |
94917bfe2ccf33853a1d57094138f9e9d42c5a86 | Matt Hauck | 2018-07-13T22:50:34 | Update ring | diff --git a/Cargo.toml b/Cargo.toml
index c4fc0cc..8dc0165 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,7 +14,7 @@ error-chain = { version = "0.11", default-features = false }
serde_json = "1.0"
serde_derive = "1.0"
serde = "1.0"
-ring = { version = "0.12.0", features = ["rsa_signing", "dev_urandom_fallback"] }
... | 1 | 2 | 2 |
d30a7599a8df887754f8fa8b469e13068ab7e7ed | Mike Engel | 2018-03-03T17:50:03 | Add a method to decode a token without signature validation
- Solves #48
- `dangerous_unsafe_decode`
- No docs (aside from cargo) since people probably shouldn't use it | diff --git a/src/lib.rs b/src/lib.rs
index 2f1f4ab..c34e3a4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -122,6 +122,35 @@ pub fn decode<T: DeserializeOwned>(token: &str, key: &[u8], validation: &Validat
Ok(TokenData { header: header, claims: decoded_claims })
}
+/// Decode a token without any signature validati... | 2 | 59 | 1 |
5839cb45527132efff559b2f29fea3b201bdac0a | Vincent Prouillet | 2017-08-26T00:54:20 | Don't serialize typ if None | diff --git a/src/header.rs b/src/header.rs
index c055355..a2dc921 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -8,6 +8,7 @@ pub struct Header {
/// The type of JWS: it can only be "JWT" here
///
/// Defined in [RFC7515#4.1.9](https://tools.ietf.org/html/rfc7515#section-4.1.9).
+ #[serde(skip_seri... | 1 | 1 | 0 |
8b4228cba1083eb82412597506f43edcfffc43a5 | Jacob Chang | 2017-06-24T06:15:45 | Update dependencies (#33)
* Update ring to 0.11.0
* Update chrono to 0.4
* Bump to version 2.0.2 | diff --git a/Cargo.toml b/Cargo.toml
index 2533854..b133526 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "jsonwebtoken"
-version = "2.0.1"
+version = "2.0.2"
authors = ["Vincent Prouillet <vincent@wearewizards.io>"]
license = "MIT"
readme = "README.md"
@@ -14,7 +14,7 @@ error-chain = {... | 2 | 15 | 15 |
e5f518a8603a61f716093cf895dc8d4b3fc3cda2 | Clement RENAULT | 2017-06-13T08:51:10 | doc: Correct markdown visual errors | diff --git a/src/validation.rs b/src/validation.rs
index 0594151..405a0e4 100644
--- a/src/validation.rs
+++ b/src/validation.rs
@@ -10,13 +10,16 @@ use crypto::Algorithm;
/// Contains the various validations that are applied after decoding a token.
///
/// All time validation happen on UTC timestamps.
+///
/// ```... | 1 | 3 | 0 |
eda92188c9c59964d3a33871077f793bfe085fc3 | Clement RENAULT | 2017-06-13T08:25:21 | default: Better usage of the default Trait | diff --git a/src/crypto.rs b/src/crypto.rs
index fdd89c6..b2516b5 100644
--- a/src/crypto.rs
+++ b/src/crypto.rs
@@ -112,3 +112,9 @@ pub fn verify(signature: &str, signing_input: &str, key: &[u8], algorithm: Algor
Algorithm::RS512 => verify_rsa(&signature::RSA_PKCS1_2048_8192_SHA512, signature, signing_input, ... | 2 | 9 | 3 |
610a2cbfdb5ae1a22d85be0f9de9f1b01d5f2bb0 | Brian Smith | 2017-05-09T04:38:19 | Bump version to 2.0.1. | diff --git a/Cargo.toml b/Cargo.toml
index 327bb63..2533854 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "jsonwebtoken"
-version = "2.0.0"
+version = "2.0.1"
authors = ["Vincent Prouillet <vincent@wearewizards.io>"]
license = "MIT"
readme = "README.md" | 1 | 1 | 1 |
58899486bcdbb7239b4213769085419db75a6210 | Brian Smith | 2017-05-09T04:37:56 | Update to *ring* 0.9.4. | diff --git a/Cargo.toml b/Cargo.toml
index 27817cc..327bb63 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,7 +14,7 @@ error-chain = { version = "0.10", default-features = false }
serde_json = "1.0"
serde_derive = "1.0"
serde = "1.0"
-ring = { version = "0.7", features = ["rsa_signing", "dev_urandom_fallback"] }
+ri... | 2 | 3 | 3 |
07b6ee2a191ef4bd63214cc20eb831c141d21399 | Vincent Prouillet | 2017-04-23T04:29:07 | Remove unused import | diff --git a/benches/jwt.rs b/benches/jwt.rs
index 2def445..8d42936 100644
--- a/benches/jwt.rs
+++ b/benches/jwt.rs
@@ -4,7 +4,7 @@ extern crate jsonwebtoken as jwt;
#[macro_use]
extern crate serde_derive;
-use jwt::{encode, decode, Algorithm, Header, Validation};
+use jwt::{encode, decode, Header, Validation};
... | 1 | 1 | 1 |
cbd9b236da17cff281e3b39dd3d1dd585dca2729 | Mike Engel | 2017-04-22T05:41:25 | Remove trait from `TokenData` struct | diff --git a/src/serialization.rs b/src/serialization.rs
index 5fce526..12d5e5d 100644
--- a/src/serialization.rs
+++ b/src/serialization.rs
@@ -10,7 +10,7 @@ use header::Header;
/// The return type of a successful call to decode
#[derive(Debug)]
-pub struct TokenData<T: DeserializeOwned> {
+pub struct TokenData<T>... | 1 | 1 | 1 |
0932f14bc2a97890732ce9f1799bdf40ebd40136 | Mike Engel | 2017-04-22T05:21:04 | Migrate `Deserialize` trait to `DeserializeOwned` for Serde 1.0 | diff --git a/src/lib.rs b/src/lib.rs
index 1f517cc..e323eab 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -31,7 +31,7 @@ pub use crypto::{
pub use validation::Validation;
-use serde::de::Deserialize;
+use serde::de::DeserializeOwned;
use serde::ser::Serialize;
use errors::{Result, ErrorKind};
@@ -101,7 +101,7 @@... | 2 | 6 | 6 |
ca59ac1f02ed7b6a12640852abdbf59514bee398 | Mike Engel | 2017-04-21T21:16:52 | Update serde, serde_json, and serde_derive to 1.0 | diff --git a/Cargo.toml b/Cargo.toml
index 06fd0a3..4ce20c9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,9 +11,9 @@ keywords = ["jwt", "web", "api", "token", "json"]
[dependencies]
error-chain = { version = "0.10", default-features = false }
-serde_json = "0.9"
-serde_derive = "0.9"
-serde = "0.9"
+serde_json = ... | 1 | 3 | 3 |
d343e9c8b6f7ac1767a6d5a5319d6bd185178629 | Vincent Prouillet | 2017-04-20T03:33:33 | V2 Beta 1 | diff --git a/Cargo.toml b/Cargo.toml
index cff552d..06fd0a3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "jsonwebtoken"
-version = "2.0.0"
+version = "2.0.0-beta-1"
authors = ["Vincent Prouillet <vincent@wearewizards.io>"]
license = "MIT"
readme = "README.md" | 1 | 1 | 1 |
57c513c757233eca7001e1e818d44483cf2cbd7c | Vincent Prouillet | 2017-04-14T11:32:39 | Actually take a ref to Validation
Seems like I updated the docs but not the code... | diff --git a/benches/jwt.rs b/benches/jwt.rs
index bafe8de..f98009d 100644
--- a/benches/jwt.rs
+++ b/benches/jwt.rs
@@ -25,5 +25,5 @@ fn bench_encode(b: &mut test::Bencher) {
#[bench]
fn bench_decode(b: &mut test::Bencher) {
let token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6I... | 7 | 16 | 16 |
64ad3187ebf0a6634fc1989fe1aa0d8037ec2066 | Vincent Prouillet | 2017-04-14T11:23:28 | Cleanup crypto nesting and remove error-chain default features | diff --git a/Cargo.toml b/Cargo.toml
index 28f1517..cff552d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,8 +10,7 @@ repository = "https://github.com/Keats/rust-jwt"
keywords = ["jwt", "web", "api", "token", "json"]
[dependencies]
-rustc-serialize = "^0.3"
-error-chain = "0.10"
+error-chain = { version = "0.10", ... | 2 | 60 | 61 |
35fd9d63cc8b30bd68f65a91807f2fc5e2b56b52 | Vincent Prouillet | 2017-04-13T01:08:07 | Add some docs | diff --git a/src/crypto.rs b/src/crypto.rs
index cd141ed..b5415a8 100644
--- a/src/crypto.rs
+++ b/src/crypto.rs
@@ -17,12 +17,18 @@ use validation::{Validation, validate};
/// The algorithms supported for signing/verifying
#[derive(Debug, PartialEq, Copy, Clone, Serialize, Deserialize)]
pub enum Algorithm {
+ //... | 6 | 101 | 12 |
50d676865f5376018c5753c7548f7d6d5dd7e6b2 | Vincent Prouillet | 2017-04-12T09:03:28 | Add test for decode without validating signature | diff --git a/src/lib.rs b/src/lib.rs
index 3544903..add2702 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,7 +2,6 @@
//!
#![recursion_limit = "300"]
-
#[macro_use]
extern crate error_chain;
#[macro_use]
@@ -29,3 +28,10 @@ pub use crypto::{
decode,
};
pub use validation::Validation;
+
+// To consider:
+//p... | 2 | 15 | 1 |
410499e6b6c6559039d62229d1827798e53e2bf6 | Vincent Prouillet | 2017-04-11T05:41:44 | Add validation | diff --git a/Cargo.toml b/Cargo.toml
index 77b6376..28f1517 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,10 +11,11 @@ keywords = ["jwt", "web", "api", "token", "json"]
[dependencies]
rustc-serialize = "^0.3"
-error-chain = "0.9"
+error-chain = "0.10"
serde_json = "0.9"
serde_derive = "0.9"
serde = "0.9"
ring... | 11 | 368 | 49 |
c244e835e0703fc3270fb668c4ca5079539be3e7 | Vincent Prouillet | 2017-04-11T03:54:32 | Take ref to Header, not by value | diff --git a/examples/claims.rs b/examples/claims.rs
index 850b828..d24c056 100644
--- a/examples/claims.rs
+++ b/examples/claims.rs
@@ -29,7 +29,7 @@ fn main() {
company: "ACME".to_owned()
};
let key = "secret";
- let token = match encode(Header::default(), &my_claims, key.as_ref()) {
+ let to... | 6 | 8 | 8 |
e3a4294e85ed5e170c56993e96206e12ddf35770 | Vincent Prouillet | 2017-01-09T05:50:51 | Move to serde + base64
Remove Part trait
Move tests to tests directory
Reorganise code | diff --git a/Cargo.toml b/Cargo.toml
index bbf2eb5..aa04685 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,3 +12,8 @@ keywords = ["jwt", "web", "api", "token", "json"]
[dependencies]
rustc-serialize = "^0.3"
ring = "^0.7"
+error-chain = "0.9"
+serde_json = "0.9"
+serde_derive = "0.9"
+serde = "0.9"
+base64 = "0.4"
... | 9 | 281 | 357 |
8de24e2a63d7efd36ee3dd2fcfd7bb811606eb7f | Claus Matzinger | 2017-04-01T19:02:08 | updated ring dependency to 0.7 | diff --git a/Cargo.toml b/Cargo.toml
index 23349f6..97d113b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,5 +10,5 @@ repository = "https://github.com/Keats/rust-jwt"
keywords = ["jwt", "web", "api", "token", "json"]
[dependencies]
-rustc-serialize = "0.3"
-ring = "0.6"
+rustc-serialize = "^0.3"
+ring = "^0.7" | 1 | 2 | 2 |
634d75e8fa3d3fbe9ddc116b1ac548fbf1d4fec4 | Vincent Prouillet | 2016-12-26T04:24:18 | to_owned -> to_string | diff --git a/src/lib.rs b/src/lib.rs
index c62a605..52283aa 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -30,9 +30,9 @@ pub enum Algorithm {
impl ToJson for Algorithm {
fn to_json(&self) -> Json {
match *self {
- Algorithm::HS256 => Json::String("HS256".to_owned()),
- Algorithm::HS38... | 1 | 9 | 9 |
e715eb4930bcfd181d07fb6c1c3b0f8e452154f9 | Vincent Prouillet | 2016-12-26T04:20:18 | Fix example | diff --git a/examples/claims.rs b/examples/claims.rs
index 6b27c73..1c138ad 100644
--- a/examples/claims.rs
+++ b/examples/claims.rs
@@ -13,8 +13,8 @@ struct Claims {
// Example validation implementation
impl Claims {
- fn is_valid(self) -> bool {
- if self.company != "ACME".to_owned() {
+ fn is_valid(... | 1 | 2 | 2 |
75ce72e4ce4b5137479f8b2818e36d2e6890d984 | Vincent Prouillet | 2016-12-26T04:19:15 | Update ring | diff --git a/Cargo.toml b/Cargo.toml
index 9f7e9cf..703cf9d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,14 +11,4 @@ keywords = ["jwt", "web", "api", "token", "json"]
[dependencies]
rustc-serialize = "0.3"
-clippy = {version = "~0.0.95", optional = true}
-ring = "0.4"
-
-[features]
-default = []
-dev = ["clippy"... | 1 | 1 | 11 |
2ba03d6f061ad2b4887663bb46dd8245598748d4 | Vincent Prouillet | 2016-08-24T11:48:50 | Update ring to 0.3 | diff --git a/Cargo.toml b/Cargo.toml
index b417002..8719c71 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,7 @@ keywords = ["jwt", "web", "api", "token", "json"]
[dependencies]
rustc-serialize = "0.3"
clippy = {version = "~0.0.44", optional = true}
-ring = "0.2"
+ring = "0.3"
[features]
default = [] | 1 | 1 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.