Compare commits

...

29 Commits

Author SHA1 Message Date
7a5af8d60c Merge pull request 'Update Rust crate serde to v1.0.225' () from renovate/serde-1.x-lockfile into master 2025-09-17 00:35:12 +00:00
2a0f757fee Update Rust crate serde to v1.0.225 2025-09-17 00:35:06 +00:00
e0ff7b1b21 Merge pull request 'Update Rust crate serde to v1.0.224' () from renovate/serde-1.x-lockfile into master 2025-09-16 00:35:12 +00:00
8aaee8da13 Update Rust crate serde to v1.0.224 2025-09-16 00:35:06 +00:00
6403d238a5 Merge pull request 'Update Rust crate serde_json to v1.0.145' () from renovate/serde_json-1.x-lockfile into master 2025-09-15 00:35:41 +00:00
31cd9d5a21 Merge pull request 'Update Rust crate serde to v1.0.223' () from renovate/serde-1.x-lockfile into master 2025-09-15 00:35:38 +00:00
20646f0627 Update Rust crate serde_json to v1.0.145 2025-09-15 00:35:37 +00:00
85a8bb01e8 Update Rust crate serde to v1.0.223 2025-09-15 00:35:32 +00:00
d3d4e3d236 Merge pull request 'Update Rust crate serde_json to v1.0.144' () from renovate/serde_json-1.x-lockfile into master 2025-09-14 00:36:01 +00:00
8f757bcdef Merge pull request 'Update Rust crate serde to v1.0.221' () from renovate/serde-1.x-lockfile into master 2025-09-14 00:35:56 +00:00
eabff0a4aa Update Rust crate serde_json to v1.0.144 2025-09-14 00:35:56 +00:00
86859119ae Update Rust crate serde to v1.0.221 2025-09-14 00:35:51 +00:00
3fe2238be0 Merge pull request 'Update Rust crate log to v0.4.28' () from renovate/log-0.x-lockfile into master 2025-09-04 00:28:21 +00:00
b94ffeb570 Update Rust crate log to v0.4.28 2025-09-04 00:28:16 +00:00
e91701159a Merge pull request 'Update Rust crate serde_json to v1.0.143' () from renovate/serde_json-1.x-lockfile into master 2025-08-20 00:27:16 +00:00
491d845e30 Update Rust crate serde_json to v1.0.143 2025-08-20 00:27:12 +00:00
7c37d2e129 Merge pull request 'Update Rust crate reqwest to v0.12.23' () from renovate/reqwest-0.x-lockfile into master 2025-08-13 00:27:19 +00:00
dd5c4f35cf Update Rust crate reqwest to v0.12.23 2025-08-13 00:27:15 +00:00
d7aebe76cc Merge pull request 'Update Rust crate serde_json to v1.0.142' () from renovate/serde_json-1.x-lockfile into master 2025-08-01 00:18:17 +00:00
72f99fbd7c Update Rust crate serde_json to v1.0.142 2025-08-01 00:18:12 +00:00
932239bfa0 Merge pull request 'Update Rust crate rand to v0.9.2' () from renovate/rand-0.x-lockfile into master 2025-07-21 00:15:44 +00:00
396467ca05 Update Rust crate rand to v0.9.2 2025-07-21 00:15:42 +00:00
73d3576c1a Merge pull request 'Update Rust crate serde_json to v1.0.141' () from renovate/serde_json-1.x-lockfile into master 2025-07-19 00:15:59 +00:00
41aff54fd8 Update Rust crate serde_json to v1.0.141 2025-07-19 00:15:57 +00:00
faadf35cc5 Update Rust crate reqwest to v0.12.22 2025-07-04 00:08:51 +00:00
a1f3152474 Fix cargo clippy issues 2025-07-03 08:22:55 +02:00
c394d29fee Update Rust crate reqwest to v0.12.20 2025-06-11 00:21:56 +00:00
9711754ff3 Update Rust crate reqwest to v0.12.19 2025-06-04 00:21:27 +00:00
240dfcc091 Fix cargo clippy issue 2025-06-03 20:37:37 +02:00
4 changed files with 70 additions and 41 deletions

95
Cargo.lock generated

@@ -473,21 +473,28 @@ dependencies = [
[[package]]
name = "hyper-util"
version = "0.1.10"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4"
checksum = "b1c293b6b3d21eca78250dc7dbebd6b9210ec5530e038cbfe0661b5c47ab06e8"
dependencies = [
"base64",
"bytes",
"futures-channel",
"futures-core",
"futures-util",
"http",
"http-body",
"hyper",
"ipnet",
"libc",
"percent-encoding",
"pin-project-lite",
"socket2",
"system-configuration",
"tokio",
"tower-service",
"tracing",
"windows-registry",
]
[[package]]
@@ -654,6 +661,16 @@ version = "2.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
[[package]]
name = "iri-string"
version = "0.7.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2"
dependencies = [
"memchr",
"serde",
]
[[package]]
name = "itoa"
version = "1.0.15"
@@ -705,9 +722,9 @@ checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856"
[[package]]
name = "log"
version = "0.4.27"
version = "0.4.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
[[package]]
name = "memchr"
@@ -888,9 +905,9 @@ dependencies = [
[[package]]
name = "rand"
version = "0.9.1"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
dependencies = [
"rand_chacha",
"rand_core 0.9.3",
@@ -926,15 +943,14 @@ dependencies = [
[[package]]
name = "reqwest"
version = "0.12.15"
version = "0.12.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb"
checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb"
dependencies = [
"base64",
"bytes",
"encoding_rs",
"futures-core",
"futures-util",
"h2",
"http",
"http-body",
@@ -943,29 +959,26 @@ dependencies = [
"hyper-rustls",
"hyper-tls",
"hyper-util",
"ipnet",
"js-sys",
"log",
"mime",
"native-tls",
"once_cell",
"percent-encoding",
"pin-project-lite",
"rustls-pemfile",
"rustls-pki-types",
"serde",
"serde_json",
"serde_urlencoded",
"sync_wrapper",
"system-configuration",
"tokio",
"tokio-native-tls",
"tower",
"tower-http",
"tower-service",
"url",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"windows-registry",
]
[[package]]
@@ -1014,15 +1027,6 @@ dependencies = [
"zeroize",
]
[[package]]
name = "rustls-pemfile"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50"
dependencies = [
"rustls-pki-types",
]
[[package]]
name = "rustls-pki-types"
version = "1.11.0"
@@ -1086,18 +1090,28 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.219"
version = "1.0.225"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
checksum = "fd6c24dee235d0da097043389623fb913daddf92c76e9f5a1db88607a0bcbd1d"
dependencies = [
"serde_core",
"serde_derive",
]
[[package]]
name = "serde_core"
version = "1.0.225"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "659356f9a0cb1e529b24c01e43ad2bdf520ec4ceaf83047b83ddcc2251f96383"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.219"
version = "1.0.225"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
checksum = "0ea936adf78b1f766949a4977b91d2f5595825bd6ec079aa9543ad2685fc4516"
dependencies = [
"proc-macro2",
"quote",
@@ -1106,14 +1120,15 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.140"
version = "1.0.145"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
dependencies = [
"itoa",
"memchr",
"ryu",
"serde",
"serde_core",
]
[[package]]
@@ -1151,9 +1166,9 @@ checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd"
[[package]]
name = "socket2"
version = "0.5.8"
version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8"
checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678"
dependencies = [
"libc",
"windows-sys 0.52.0",
@@ -1310,6 +1325,24 @@ dependencies = [
"tower-service",
]
[[package]]
name = "tower-http"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2"
dependencies = [
"bitflags",
"bytes",
"futures-util",
"http",
"http-body",
"iri-string",
"pin-project-lite",
"tower",
"tower-layer",
"tower-service",
]
[[package]]
name = "tower-layer"
version = "0.3.3"

@@ -39,7 +39,7 @@ impl Error for StateError {}
impl fmt::Display for StateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "StateManager error {:?}", self)
write!(f, "StateManager error {self:?}")
}
}

@@ -38,7 +38,7 @@ impl OpenIDConfig {
code: &str,
redirect_uri: &str,
) -> Result<(OpenIDTokenResponse, String), Box<dyn Error>> {
let authorization = BASE64_STANDARD.encode(format!("{}:{}", client_id, client_secret));
let authorization = BASE64_STANDARD.encode(format!("{client_id}:{client_secret}"));
let mut params = HashMap::new();
params.insert("grant_type", "authorization_code");

@@ -1,12 +1,10 @@
use std::error::Error;
use std::io::ErrorKind;
use aes_gcm::aead::{Aead, OsRng};
use aes_gcm::{Aes256Gcm, Key, KeyInit, Nonce};
use base64::engine::general_purpose::STANDARD as BASE64_STANDARD;
use base64::Engine as _;
use bincode::{Decode, Encode};
use rand::Rng;
use std::error::Error;
/// The lenght of the nonce used to initialize encryption
const NONCE_LEN: usize = 12;
@@ -45,8 +43,7 @@ impl CryptoWrapper {
let bytes = BASE64_STANDARD.decode(input)?;
if bytes.len() < NONCE_LEN {
return Err(Box::new(std::io::Error::new(
ErrorKind::Other,
return Err(Box::new(std::io::Error::other(
"Input string is smaller than nonce!",
)));
}
@@ -59,9 +56,8 @@ impl CryptoWrapper {
let dec = match aes_key.decrypt(Nonce::from_slice(nonce), enc) {
Ok(d) => d,
Err(e) => {
log::error!("Failed to decrypt wrapped data! {:#?}", e);
return Err(Box::new(std::io::Error::new(
ErrorKind::Other,
log::error!("Failed to decrypt wrapped data! {e:#?}");
return Err(Box::new(std::io::Error::other(
"Failed to decrypt wrapped data!",
)));
}