From a2d60c352b14d3e2c5f00b06006c95db3c23d495 Mon Sep 17 00:00:00 2001 From: nathanmoreton <52756156+nathanmoreton@users.noreply.github.com> Date: Fri, 1 May 2026 14:36:13 -0500 Subject: [PATCH] Fix fmt and clippy on Rust 1.95 The rebase onto upstream main bumped rust-toolchain to 1.95, which flagged two things the 1.94 compiler didn't catch: - rustfmt collapses build_redirect_uri's signature onto one line - clippy's collapsible_if catches the nested if in validate_config Style only, no behavior change. --- src/api/core/sso_cookie_vendor.rs | 5 +---- src/config.rs | 11 +++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/api/core/sso_cookie_vendor.rs b/src/api/core/sso_cookie_vendor.rs index e4c5b3dd..f5ff150b 100644 --- a/src/api/core/sso_cookie_vendor.rs +++ b/src/api/core/sso_cookie_vendor.rs @@ -69,10 +69,7 @@ fn sso_cookie_vendor(cookies: &CookieJar<'_>) -> Result, -) -> Result)> { +fn build_redirect_uri(cookie_name: &str, cookies: &HashMap) -> Result)> { // Check for the single (non-sharded) cookie — takes precedence over shards if let Some(value) = cookies.get(cookie_name) { let encoded_value = url_encode(value); diff --git a/src/config.rs b/src/config.rs index a78ccee2..13875cdc 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1091,13 +1091,12 @@ fn validate_config(cfg: &ConfigItems, on_update: bool) -> Result<(), Error> { validate_sso_master_password_policy(cfg.sso_master_password_policy.as_ref())?; } - if cfg.sso_cookie_vendor_enabled { - if cfg.sso_cookie_vendor_idp_login_url.is_empty() + if cfg.sso_cookie_vendor_enabled + && (cfg.sso_cookie_vendor_idp_login_url.is_empty() || cfg.sso_cookie_vendor_cookie_name.is_empty() - || cfg.sso_cookie_vendor_cookie_domain.is_empty() - { - err!("`SSO_COOKIE_VENDOR_IDP_LOGIN_URL`, `SSO_COOKIE_VENDOR_COOKIE_NAME` and `SSO_COOKIE_VENDOR_COOKIE_DOMAIN` must be set when SSO cookie vendor is enabled") - } + || cfg.sso_cookie_vendor_cookie_domain.is_empty()) + { + err!("`SSO_COOKIE_VENDOR_IDP_LOGIN_URL`, `SSO_COOKIE_VENDOR_COOKIE_NAME` and `SSO_COOKIE_VENDOR_COOKIE_DOMAIN` must be set when SSO cookie vendor is enabled") } if cfg._enable_yubico {