From f8b75c8d1493500774f167491a25288d69856d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Seitz?= Date: Wed, 8 Jan 2025 13:39:40 +0100 Subject: [PATCH] update keycloak to v26 --- Cargo.lock | 24 +++++++++++++++++------- Cargo.toml | 10 +++++----- crates/keycloak/src/client.rs | 4 ++-- crates/keycloak/src/session.rs | 1 + crates/keycloak/src/token/jwt.rs | 1 + 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c0b54c6..fd46ecf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -264,9 +264,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.84" +version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1244b10dcd56c92219da4e14caa97e312079e185f04ba3eea25061561dc0a0" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", @@ -1804,6 +1804,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.14" @@ -1849,11 +1858,12 @@ dependencies = [ [[package]] name = "keycloak" -version = "25.0.400" +version = "26.0.700" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df537a70e0833ece7c63458d5e4f88477ac0c046c5af96b462b1eb92645c6c64" +checksum = "c1d908ba7f82228fc5b67d9c8879bb76940d114373164047b470be91a794e463" dependencies = [ "async-trait", + "percent-encoding", "reqwest", "serde", "serde_json", @@ -2617,7 +2627,7 @@ dependencies = [ "deadpool-redis", "envy", "futures", - "itertools 0.13.0", + "itertools 0.14.0", "lazy_static", "prometheus-client", "qm-entity", @@ -3335,9 +3345,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.134" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" dependencies = [ "indexmap 2.7.0", "itoa", diff --git a/Cargo.toml b/Cargo.toml index ff32a9c..dda819a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ repository = "https://github.com/hd-gmbh-dev/quick-microservice-rs" [workspace.dependencies] anyhow = "1.0.93" -async-trait = "0.1.83" +async-trait = "0.1.85" axum = "0.7.9" tynm = "0.1.10" base64 = "0.22.1" @@ -25,14 +25,14 @@ chrono = { version="0.4.38", features = ["serde"] } futures = "0.3.31" tokio = { version = "1.41.1", features = ["full"] } tower-http = { version = "0.6.2", features = ["cors"] } -thiserror = "2.0.3" -itertools = "0.13.0" +thiserror = "2.0.9" +itertools = "0.14.0" envy = "0.4.2" reqwest = { version = "0.12.9", default-features = false, features = ["json"] } jsonwebtoken = "9.3.0" serde = { version = "1.0.215", features = ["derive", "rc"] } -serde_json = "1.0.133" -keycloak = "25.0.200" +serde_json = "1.0.135" +keycloak = "26.0.700" mongodb = "3.1.0" lazy_static = "1.5.0" tracing = "0.1.40" diff --git a/crates/keycloak/src/client.rs b/crates/keycloak/src/client.rs index 05c0b1a..784eb4a 100644 --- a/crates/keycloak/src/client.rs +++ b/crates/keycloak/src/client.rs @@ -405,7 +405,7 @@ impl Keycloak { ) -> Result, KeycloakError> { self.inner .admin - .realm_roles_with_role_name_users_get(realm, role_name, None, None) + .realm_roles_with_role_name_users_get(realm, role_name, None, None, None) .await .map_err(|e| { tracing::error!("{e:#?}"); @@ -471,7 +471,7 @@ impl Keycloak { Ok(self .inner .admin - .realm_roles_with_role_name_users_get(realm, role_name, None, None) + .realm_roles_with_role_name_users_get(realm, role_name, None, None, None) .await .map_err(|e| { tracing::error!("{e:#?}"); diff --git a/crates/keycloak/src/session.rs b/crates/keycloak/src/session.rs index 671a039..13618c2 100644 --- a/crates/keycloak/src/session.rs +++ b/crates/keycloak/src/session.rs @@ -76,6 +76,7 @@ pub struct ParsedAccessToken { //:"openid profile email", sid: Option, //:"cdfaa367-5c30-4142-b31a-f770073e2051", + #[serde(default)] email_verified: bool, //:false, preferred_username: Option, //:"admin" diff --git a/crates/keycloak/src/token/jwt.rs b/crates/keycloak/src/token/jwt.rs index bdcefbd..b6e3022 100644 --- a/crates/keycloak/src/token/jwt.rs +++ b/crates/keycloak/src/token/jwt.rs @@ -38,6 +38,7 @@ pub struct Claims { pub scope: String, #[serde(default)] pub sid: String, + #[serde(default)] pub email_verified: bool, #[serde(default)] pub name: String,