| author | |
| committer | |
| log | 6ea9559d597852c84d29e625b048170ec1826660 |
| tree | e5ed274b5e397f5a609324ab7173914d5517865c |
| parent | 0701dbcf4c737821b522372cdf8419a1cf3a085d |
| signature | Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU |
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.52 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> { | ... | @@ -156,11 +156,13 @@ pub fn provision(auth: &auth::Store, input: Value) -> Result<Value> { |
| 156 | .unwrap() | 156 | .unwrap() |
| 157 | .strip_prefix("snowglobe.") | 157 | .strip_prefix("snowglobe.") |
| 158 | .unwrap_or_default(); | 158 | .unwrap_or_default(); |
| 159 | if uri.scheme() != "https" | 159 | let host = uri.host_str().unwrap_or_default(); |
| 160 | || site.is_empty() | 160 | let allowed = match uri.scheme() { |
| 161 | || !uri | 161 | "https" => !site.is_empty() && host.ends_with(&format!(".{site}")), |
| 162 | .host_str() | 162 | "http" => host.ends_with(".localhost"), |
| 163 | .is_some_and(|h| h.ends_with(&format!(".{site}"))) | 163 | _ => false, |
| 164 | }; | ||
| 165 | if !allowed | ||
| 164 | || !uri.username().is_empty() | 166 | || !uri.username().is_empty() |
| 165 | || uri.password().is_some() | 167 | || uri.password().is_some() |
| 166 | || uri.fragment().is_some() | 168 | || uri.fragment().is_some() |
service/shale/service.pkl+4-1| ... | @@ -8,7 +8,10 @@ requirements { | ... | @@ -8,7 +8,10 @@ requirements { |
| 8 | new sso.Client { | 8 | new sso.Client { |
| 9 | clientId = module.id | 9 | clientId = module.id |
| 10 | name = module.name | 10 | 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 | } | ||
| 12 | usernameAliases { ["snow"] = "clover" } | 15 | usernameAliases { ["snow"] = "clover" } |
| 13 | allowGuests = true | 16 | allowGuests = true |
| 14 | usernameRequired = true | 17 | usernameRequired = true |