From b0b008f7ede51ab0f2c2d9101fdc2a258c0ff10a Mon Sep 17 00:00:00 2001 From: Bjorn Date: Wed, 19 Jul 2023 21:42:24 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20`JwtHeaders::with=5Fcty`=20fu?= =?UTF-8?q?nction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 2 +- README.md | 2 +- src/models/jwt/jwt_headers.rs | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4c942cb..6b3eefc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jumpdrive-auth" -version = "2.0.0" +version = "2.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/README.md b/README.md index d440963..365728d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ I currently have no intentions to publish this to crates.io, so for now if you w dependency using: ```toml -jumpdrive-auth = { git = "https://github.com/Jumpdrive-dev/Auth-Services", tag = "2.0.0" } +jumpdrive-auth = { git = "https://github.com/Jumpdrive-dev/Auth-Services", tag = "2.1.0" } ``` ## Features diff --git a/src/models/jwt/jwt_headers.rs b/src/models/jwt/jwt_headers.rs index 858d6ac..2c50adf 100644 --- a/src/models/jwt/jwt_headers.rs +++ b/src/models/jwt/jwt_headers.rs @@ -20,6 +20,15 @@ pub struct JwtHeader { pub cty: Option, } +impl JwtHeader { + pub fn with_cty(value: T) -> JwtHeader { + JwtHeader { + cty: Some(value), + ..JwtHeader::default() + } + } +} + impl Default for JwtHeader { fn default() -> JwtHeader { Self {