diff --git a/Cargo.lock b/Cargo.lock index 9282c4a..17d9888 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,15 +25,15 @@ checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa" [[package]] name = "base64" -version = "0.13.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "base64-url" -version = "1.4.13" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a99c239d0c7e77c85dddfa9cebce48704b3c49550fcd3b84dd637e4484899f" +checksum = "9c5b0a88aa36e9f095ee2e2b13fb8c5e4313e022783aedacc123328c0084916d" dependencies = [ "base64", ] @@ -179,9 +179,9 @@ dependencies = [ [[package]] name = "der" -version = "0.6.1" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946" dependencies = [ "const-oid", "pem-rfc7468", @@ -280,7 +280,7 @@ dependencies = [ [[package]] name = "jumpdrive-auth" -version = "1.1.2" +version = "1.1.3" dependencies = [ "base32", "base64-url", @@ -390,30 +390,29 @@ checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "pem-rfc7468" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" dependencies = [ "base64ct", ] [[package]] name = "pkcs1" -version = "0.4.1" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff33bdbdfc54cc98a2eca766ebdec3e1b8fb7387523d5c9c9a2891da856f719" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ "der", "pkcs8", "spki", - "zeroize", ] [[package]] name = "pkcs8" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", "spki", @@ -475,11 +474,12 @@ dependencies = [ [[package]] name = "rsa" -version = "0.8.2" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55a77d189da1fee555ad95b7e50e7457d91c0e089ec68ca69ad2989413bbdab4" +checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" dependencies = [ "byteorder", + "const-oid", "digest", "num-bigint-dig", "num-integer", @@ -489,6 +489,7 @@ dependencies = [ "pkcs8", "rand_core", "signature", + "spki", "subtle", "zeroize", ] @@ -577,9 +578,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spki" -version = "0.6.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", "der", diff --git a/Cargo.toml b/Cargo.toml index dcb2ec1..0b176c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,8 +16,8 @@ test-utils = [] serde = { version = "1.0.152", features = ["derive"] } serde_json = "1.0.91" chrono = "0.4.23" -base64-url = "1.4.13" -rsa = "0.8.0" +base64-url = "2.0.0" +rsa = "0.9.2" hmac = "0.12.1" sha2 = { version = "0.10.6", features = ["oid"] } rand = { version = "0.8.5", features = ["std_rng"] } diff --git a/src/services/jwt_service.rs b/src/services/jwt_service.rs index 8b4e712..ac47224 100644 --- a/src/services/jwt_service.rs +++ b/src/services/jwt_service.rs @@ -16,7 +16,7 @@ use crate::models::jwt::jwt_headers::JwtHeader; use crate::models::jwt::jwt_token_type::JwtTokenType; /// Service with functions to generate and verify JWT tokens -pub(crate) struct JwtService { +pub struct JwtService { signing_key: SigningKey, access_token_seconds: u32, issuer: String, @@ -33,7 +33,7 @@ impl JwtService { audience: impl Into, ) -> Self { Self { - signing_key: SigningKey::new_with_prefix(private_key), + signing_key: SigningKey::new(private_key), access_token_seconds, issuer: issuer.into(), audience: audience.into(),