v0.332.0: one sign-in for the file manager — a dashboard pass, a host-only files cookie, a per-box secret header (R-1100, operator D16)
gates / gates (push) Successful in 47s
gates / gates (push) Successful in 47s
This commit is contained in:
@@ -58,7 +58,21 @@ func fileBrowserLink(domain, sourceName, relPath string) string {
|
||||
return b.String()
|
||||
}
|
||||
|
||||
// importFolderLink is the deep link to a drop-zone app's folder inside the canonical import source.
|
||||
// importFolderLink is the deep link to a drop-zone app's folder inside the canonical import source (through the
|
||||
// dashboard's pass, R-1100).
|
||||
func importFolderLink(domain, appDir string) string {
|
||||
return fileBrowserLink(domain, infra.FileBrowserImportLabel, appDir)
|
||||
return fileBrowserOpenLink(domain, infra.FileBrowserImportLabel, appDir)
|
||||
}
|
||||
|
||||
// fileBrowserOpenLink is what a dashboard page links to for a FileBrowser folder since R-1100: the dashboard's
|
||||
// GET /__files/open, which hands the household's signed-in browser a one-time pass to the file manager, so FileBrowser
|
||||
// opens at the folder without its own login (files_sso.go). The folder is fileBrowserLink's path, carried in `to`
|
||||
// (query-escaped as a whole; the path keeps its own PathEscape inside). Pinned by TestFileBrowserOpenLink_R1100_*.
|
||||
func fileBrowserOpenLink(domain, sourceName, relPath string) string {
|
||||
return filesOpenURL(domain, fileBrowserLink(domain, sourceName, relPath))
|
||||
}
|
||||
|
||||
// filesOpenURL turns a files.<domain> link into the dashboard's pass link for the same FileBrowser path.
|
||||
func filesOpenURL(domain, link string) string {
|
||||
return "https://felhom." + domain + filesOpenPath + "?" + url.Values{"to": {filesPathOf(link, "files."+domain)}}.Encode()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user