From 98d81280896a9a9621efd3ce81d4d1edffc2f035 Mon Sep 17 00:00:00 2001 From: cduvray Date: Thu, 27 Oct 2022 08:00:32 +0200 Subject: [PATCH 1/2] fix ci: bump pinned rust version (fixes #268) - dependency time 0.3.15 supporting 1.59+ --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77053e64..88d19474 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: include: - build: pinned os: ubuntu-20.04 - rust: 1.56.0 + rust: 1.59.0 - build: stable os: ubuntu-20.04 rust: stable From eb325f1e6f4f6ff04bd0d5c5f2a76f43e0d9c7c0 Mon Sep 17 00:00:00 2001 From: cduvray Date: Mon, 24 Oct 2022 20:43:48 +0200 Subject: [PATCH 2/2] fix. clippy:derive_partial_eq_without_eq (stable 1.64) (If a type T derives PartialEq and all of its members implement Eq, then T can always implement Eq. Implementing Eq allows T to be used in APIs that require Eq types. It also allows structs containing T to derive Eq themselves.) --- src/header.rs | 2 +- src/jwk.rs | 2 +- src/validation.rs | 2 +- tests/ecdsa/mod.rs | 2 +- tests/eddsa/mod.rs | 2 +- tests/hmac.rs | 2 +- tests/rsa/mod.rs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/header.rs b/src/header.rs index aef5af29..b19c23df 100644 --- a/src/header.rs +++ b/src/header.rs @@ -9,7 +9,7 @@ use crate::serialization::b64_decode; /// A basic JWT header, the alg defaults to HS256 and typ is automatically /// set to `JWT`. All the other fields are optional. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Hash)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash)] pub struct Header { /// The type of JWS: it can only be "JWT" here /// diff --git a/src/jwk.rs b/src/jwk.rs index 13a10df0..59d32711 100644 --- a/src/jwk.rs +++ b/src/jwk.rs @@ -350,7 +350,7 @@ pub struct Jwk { } /// A JWK set -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct JwkSet { pub keys: Vec, } diff --git a/src/validation.rs b/src/validation.rs index ec76b077..b4920b27 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -26,7 +26,7 @@ use crate::errors::{new_error, ErrorKind, Result}; /// validation.set_issuer(&["Me"]); // a single string /// validation.set_issuer(&["Me", "You"]); // array of strings /// ``` -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Validation { /// Which claims are required to be present before starting the validation. /// This does not interact with the various `validate_*`. If you remove `exp` from that list, you still need diff --git a/tests/ecdsa/mod.rs b/tests/ecdsa/mod.rs index d12ae48c..82bdd064 100644 --- a/tests/ecdsa/mod.rs +++ b/tests/ecdsa/mod.rs @@ -5,7 +5,7 @@ use jsonwebtoken::{ use serde::{Deserialize, Serialize}; use time::OffsetDateTime; -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] pub struct Claims { sub: String, company: String, diff --git a/tests/eddsa/mod.rs b/tests/eddsa/mod.rs index 9136863b..cdbfd5d0 100644 --- a/tests/eddsa/mod.rs +++ b/tests/eddsa/mod.rs @@ -5,7 +5,7 @@ use jsonwebtoken::{ use serde::{Deserialize, Serialize}; use time::OffsetDateTime; -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] pub struct Claims { sub: String, company: String, diff --git a/tests/hmac.rs b/tests/hmac.rs index ace5d109..f0e01246 100644 --- a/tests/hmac.rs +++ b/tests/hmac.rs @@ -6,7 +6,7 @@ use jsonwebtoken::{ use serde::{Deserialize, Serialize}; use time::OffsetDateTime; -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] pub struct Claims { sub: String, company: String, diff --git a/tests/rsa/mod.rs b/tests/rsa/mod.rs index dc0fa934..19635034 100644 --- a/tests/rsa/mod.rs +++ b/tests/rsa/mod.rs @@ -14,7 +14,7 @@ const RSA_ALGORITHMS: &[Algorithm] = &[ Algorithm::PS512, ]; -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] pub struct Claims { sub: String, company: String,