From 693a10012883d60266dadc7bfa9b945aec2f9204 Mon Sep 17 00:00:00 2001 From: Craig Colegrove <34786857+giarc3@users.noreply.github.com> Date: Tue, 16 Jun 2020 04:04:22 -0600 Subject: [PATCH] Derive Hash for Header and Algorithm (#137) --- src/algorithms.rs | 2 +- src/header.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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(Debug, PartialEq, Hash, Copy, Clone, Serialize, Deserialize)] pub enum Algorithm { /// HMAC using SHA-256 HS256, diff --git a/src/header.rs b/src/header.rs index c6ac473..ba4b685 100644 --- a/src/header.rs +++ b/src/header.rs @@ -6,7 +6,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)] +#[derive(Debug, Clone, PartialEq, Hash, Serialize, Deserialize)] pub struct Header { /// The type of JWS: it can only be "JWT" here ///