fix: IDEAS.md quickfixes — idle-timeout app config, id_token out of Claims, FormEvent import
session.idle_timeout (minutes, default 15) joins the app-config registry and drives the onboarding Garmin session eviction, distinct from session.duration (the login cookie lifetime in hours). The raw Keycloak ID token no longer rides in auth.Claims through every request context: it's minted into the session cookie separately and read back only by the logout handler via IDTokenFromSessionCookie. OnboardingWizard uses the type-imported FormEvent<HTMLFormElement> instead of the React.FormEvent namespace alias. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -36,12 +36,27 @@ func TestConfig_GetDefaultsAndEnvSnapshot(t *testing.T) {
|
||||
if err := json.Unmarshal(rec.Body.Bytes(), &resp); err != nil {
|
||||
t.Fatalf("unmarshal: %v", err)
|
||||
}
|
||||
if len(resp.Application) != 1 {
|
||||
t.Fatalf("expected 1 app-config entry, got %d", len(resp.Application))
|
||||
if len(resp.Application) != 2 {
|
||||
t.Fatalf("expected 2 app-config entries, got %d: %+v", len(resp.Application), resp.Application)
|
||||
}
|
||||
e := resp.Application[0]
|
||||
if e.Key != "session.duration" || e.Value != "720" || e.Default != "720" || e.Overridden || e.Description == "" {
|
||||
t.Fatalf("unexpected default entry: %+v", e)
|
||||
byKey := map[string]struct {
|
||||
value, def string
|
||||
overridden bool
|
||||
}{}
|
||||
for _, e := range resp.Application {
|
||||
if e.Description == "" {
|
||||
t.Errorf("entry %q has no description", e.Key)
|
||||
}
|
||||
byKey[e.Key] = struct {
|
||||
value, def string
|
||||
overridden bool
|
||||
}{e.Value, e.Default, e.Overridden}
|
||||
}
|
||||
if e := byKey["session.duration"]; e.value != "720" || e.def != "720" || e.overridden {
|
||||
t.Fatalf("session.duration default entry = %+v", e)
|
||||
}
|
||||
if e := byKey["session.idle_timeout"]; e.value != "15" || e.def != "15" || e.overridden {
|
||||
t.Fatalf("session.idle_timeout default entry = %+v", e)
|
||||
}
|
||||
if len(resp.Environment) != 1 || resp.Environment[0].Value != "•••• (set)" {
|
||||
t.Fatalf("env snapshot not passed through: %+v", resp.Environment)
|
||||
|
||||
Reference in New Issue
Block a user