authoravatarclover caruso<git@paperclover.net>2026-10-28 22:14:54-07:00
committeravatarclover caruso<git@paperclover.net>2026-11-12 16:08:55-08:00
log6ea9559d597852c84d29e625b048170ec1826660
treee5ed274b5e397f5a609324ab7173914d5517865c
parent0701dbcf4c737821b522372cdf8419a1cf3a085d
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

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

2 files changed, 11 insertions(+), 6 deletions(-)

dashboard/src/oidc.rs+7-5
......@@ -156,11 +156,13 @@ pub fn provision(auth: &auth::Store, input: Value) -> Result<Value> {
156156 .unwrap()
157157 .strip_prefix("snowglobe.")
158158 .unwrap_or_default();
159 if uri.scheme() != "https"
160 || site.is_empty()
161 || !uri
162 .host_str()
163 .is_some_and(|h| h.ends_with(&format!(".{site}")))
159 let host = uri.host_str().unwrap_or_default();
160 let allowed = match uri.scheme() {
161 "https" => !site.is_empty() && host.ends_with(&format!(".{site}")),
162 "http" => host.ends_with(".localhost"),
163 _ => false,
164 };
165 if !allowed
164166 || !uri.username().is_empty()
165167 || uri.password().is_some()
166168 || uri.fragment().is_some()
service/shale/service.pkl+4-1
......@@ -8,7 +8,10 @@ requirements {
88 new sso.Client {
99 clientId = module.id
1010 name = module.name
11 redirectUris { "https://\(module.container.http.hostname)/-/callback" }
11 redirectUris {
12 "https://\(module.container.http.hostname)/-/callback"
13 "http://git1.localhost/-/callback"
14 }
1215 usernameAliases { ["snow"] = "clover" }
1316 allowGuests = true
1417 usernameRequired = true