feat: make http session cookie path & duration configurable (fixes #10522) (#10632)

Signed-off-by: Vikram Vaswani <2571660+vvaswani@users.noreply.github.com>
Signed-off-by: Jakob Borg <jakob@kastelo.net>
Co-authored-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
vvaswani
2026-04-26 07:59:24 +00:00
committed by GitHub
co-authored by Jakob Borg
parent 1f57187461
commit 987e631176
5 changed files with 124 additions and 17 deletions
+26
View File
@@ -786,6 +786,32 @@ func TestGUIConfigURL(t *testing.T) {
}
}
func TestGUISessionCookiePathPrepare(t *testing.T) {
t.Parallel()
cases := []struct {
name string
in string
out string
}{
{name: "empty stays empty", in: "", out: ""},
{name: "already rooted", in: " /gui ", out: "/gui"},
{name: "needs slash", in: "gui", out: "/gui"},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
c := GUIConfiguration{SessionCookiePath: tc.in}
c.prepare()
if c.SessionCookiePath != tc.out {
t.Fatalf("unexpected path %q != %q", c.SessionCookiePath, tc.out)
}
})
}
}
func TestGUIPasswordHash(t *testing.T) {
var c GUIConfiguration