From 6ea9559d597852c84d29e625b048170ec1826660 Mon Sep 17 00:00:00 2001 From: clover caruso Date: Wed, 28 Oct 2026 22:14:54 -0700 Subject: [PATCH] Allow a localhost redirect for Shale SSO Add http://git1.localhost/-/callback to the Shale OIDC client and let first-party client provisioning accept http redirects on *.localhost. Assisted-by: claude-sonnet-5.5 --- dashboard/src/oidc.rs | 12 +++++++----- service/shale/service.pkl | 5 ++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dashboard/src/oidc.rs b/dashboard/src/oidc.rs index 90439f5a8192dc6f96da9d64deda923100dc2d90..2866ba36b316995a939abb09c7c1fe6c1f0b1834 100644 --- a/dashboard/src/oidc.rs +++ b/dashboard/src/oidc.rs @@ -156,11 +156,13 @@ pub fn provision(auth: &auth::Store, input: Value) -> Result { .unwrap() .strip_prefix("snowglobe.") .unwrap_or_default(); - if uri.scheme() != "https" - || site.is_empty() - || !uri - .host_str() - .is_some_and(|h| h.ends_with(&format!(".{site}"))) + let host = uri.host_str().unwrap_or_default(); + let allowed = match uri.scheme() { + "https" => !site.is_empty() && host.ends_with(&format!(".{site}")), + "http" => host.ends_with(".localhost"), + _ => false, + }; + if !allowed || !uri.username().is_empty() || uri.password().is_some() || uri.fragment().is_some() diff --git a/service/shale/service.pkl b/service/shale/service.pkl index 0fdfe0fb269db7badba13f01f645b683b91d68f4..dbdb537322551e9b1bb15efa2e5b011b3815b3ac 100644 --- a/service/shale/service.pkl +++ b/service/shale/service.pkl @@ -8,7 +8,10 @@ requirements { new sso.Client { clientId = module.id name = module.name - redirectUris { "https://\(module.container.http.hostname)/-/callback" } + redirectUris { + "https://\(module.container.http.hostname)/-/callback" + "http://git1.localhost/-/callback" + } usernameAliases { ["snow"] = "clover" } allowGuests = true usernameRequired = true -- 2.54.1