Refactor architecture into eight components and consolidate reliability work
Build and publish container images / images (push) Successful in 9m34s
Release container images / release (push) Successful in 36s

Extract Grammaratur, Dregarnuhr, Geduldh, Mestionora, Ordoschnellic, Schutzaria, Kunstzeal and Seheweit behind compatible application contracts.

Include accumulated editor resilience, navigation and theme UX, remote CLI, storage/schema and DR groundwork, tests and design/operations documentation.

Verified: uncached full Go suite; go vet ./...; race tests for all eight components; 11 targeted Chromium tests; Node suites; 19 Python CLI tests; reproducible editor build. No push, release tag or deployment in this checkpoint.
This commit is contained in:
Anya Tokugawa committed 2026-11-01 15:23:31 +09:00
1 parent 9dd425f765
commit d5d21b7841
302 files changed
+20037 -3492

No files matched your search

@@ -0,0 +1,50 @@
package server
import (
"net/http"
"net/http/httptest"
"net/url"
"strings"
"testing"
)
func TestSessionPolicyAdminUIAndCookie(t *testing.T) {
s, token, domain := configFixture(t)
form := url.Values{"action": {"save_session_policy"}, "session_minutes": {"60"}}
w := configRequest(s, token, "POST", "/-/sys/config/auth", form)
if w.Code != http.StatusSeeOther || w.Header().Get("Location") != "/-/sys/config?panel=auth-sessions&saved=1" {
t.Fatalf("policy save %d %s", w.Code, w.Body.String())
}
if s.store.AuthSessionLifetimeMinutes(domain) != 60 {
t.Fatal("policy not saved")
}
w = configRequest(s, token, "GET", "/-/sys/config?panel=auth-sessions", nil)
if w.Code != 200 || !strings.Contains(w.Body.String(), `name="session_minutes" value="60"`) {
t.Fatal("policy control missing")
}
for _, bad := range []string{"", "abc", "0", "99999999999999999999999"} {
form.Set("session_minutes", bad)
if w = configRequest(s, token, "POST", "/-/sys/config/auth", form); w.Code != 400 {
t.Fatalf("bad lifetime %q accepted", bad)
}
}
user, err := s.store.CreatePasswordAccount(domain, "reader", "a long test password", "Reader", "")
if err != nil {
t.Fatal(err)
}
reader, err := s.store.CreateAuthSession(domain, user.UUID)
if err != nil {
t.Fatal(err)
}
form.Set("session_minutes", "120")
if w = configRequest(s, reader, "POST", "/-/sys/config/auth", form); w.Code != 403 {
t.Fatalf("non-admin policy change: %d", w.Code)
}
w = httptest.NewRecorder()
r := httptest.NewRequest("GET", "https://localhost/", nil)
s.setAuthCookie(w, r, "fixture-token")
cookies := w.Result().Cookies()
if len(cookies) != 1 || cookies[0].MaxAge != 3600 || !cookies[0].HttpOnly || !cookies[0].Secure {
t.Fatalf("cookie policy %#v", cookies)
}
}