Update ring and fix leeway docs
This commit is contained in:
parent
5839cb4552
commit
7e36d3f7bb
|
@ -6,6 +6,11 @@
|
|||
- Remove `validate_signature` from `Validation`
|
||||
- Make `typ` optional in header, some providers apparently don't use it
|
||||
|
||||
### Others
|
||||
|
||||
- Update ring
|
||||
- Fix documentation about `leeway` being in seconds and not milliseconds
|
||||
|
||||
### Other
|
||||
- Add `decode_header` to only decode the header: replaces the use case of `validate_signature`
|
||||
|
||||
|
|
|
@ -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.11.0", features = ["rsa_signing", "dev_urandom_fallback"] }
|
||||
ring = { version = "0.12.0", features = ["rsa_signing", "dev_urandom_fallback"] }
|
||||
base64 = "0.6"
|
||||
untrusted = "0.5"
|
||||
chrono = "0.4"
|
||||
|
|
|
@ -64,8 +64,8 @@ use jsonwebtoken::{Validation, Algorithm};
|
|||
|
||||
// Default valuation
|
||||
let validation = Validation::default();
|
||||
// Adding some leeway (in ms) for iat, exp and nbf checks
|
||||
let mut validation = Validation {leeway: 1000 * 60, ..Default::default()};
|
||||
// Adding some leeway (in seconds) for iat, exp and nbf checks
|
||||
let mut validation = Validation {leeway: 60, ..Default::default()};
|
||||
// Checking issuer
|
||||
let mut validation = Validation {iss: Some("issuer".to_string()), ..Default::default()};
|
||||
// Setting audience
|
||||
|
|
|
@ -18,7 +18,7 @@ use crypto::Algorithm;
|
|||
/// let validation = Validation::default();
|
||||
///
|
||||
/// // Changing one parameter
|
||||
/// let mut validation = Validation {leeway: 1000 * 60, ..Default::default()};
|
||||
/// let mut validation = Validation {leeway: 60, ..Default::default()};
|
||||
///
|
||||
/// // Setting audience
|
||||
/// let mut validation = Validation::default();
|
||||
|
@ -27,7 +27,7 @@ use crypto::Algorithm;
|
|||
/// ```
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct Validation {
|
||||
/// Add some leeway (in ms) to the `exp`, `iat` and `nbf` validation to
|
||||
/// Add some leeway (in seconds) to the `exp`, `iat` and `nbf` validation to
|
||||
/// account for clock skew.
|
||||
///
|
||||
/// Defaults to `0`.
|
||||
|
|
Loading…
Reference in New Issue