fix(docs): Wiki.js session sweep judged brokered sessions dead via wikijs client check #192
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/docs-editor-exit-403"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WikiJsSessionReconciler::subjectIsLive kept a wiki session only while a
live Keycloak SSO session carried the 'wikijs' client — a direct-OIDC
concept the session broker retired: managed logins mint wiki sessions
from the central session's snapshot and never run an OIDC exchange for
that client, so every brokered session read as dead and the ~30s sweep
deleted it. The next /_api call — e.g. the pageLoad the route watcher
fires on editor exit (GET /sites/{id}/pages/{hash}?withContent=false)
— evaluated as anonymous, hit the guests DENY rule, and the SPA landed
on /_error/unauthorized (with the 'Page has been reverted' toast
masking the navigation that triggered it).
Liveness now mirrors the record the session gate actually introspects:
the subject's active central browser_session (not revoked, within
expiry, seen inside the idle window). Keycloak identity disabled or
deleted still purges; sidless central sessions keep their keep-until-
expiry rule from ReconcileBrowserSessions so the sweep never
out-purges the gate's own verdict. The dead wikijs.oidc_client_id
config goes with the clients-map check.
WikiJsSessionReconcileTest rewritten for the broker-native verdict:
central-session presence decides keep/purge, plus revoked/expired/
idle-timeout, sidless keep, disabled/deleted dominance, lookup-failure
skip, and the local-only exemption.
WikiJsSessionReconciler::subjectIsLive kept a wiki session only while a live Keycloak SSO session carried the 'wikijs' client — a direct-OIDC concept the session broker retired: managed logins mint wiki sessions from the central session's snapshot and never run an OIDC exchange for that client, so every brokered session read as dead and the ~30s sweep deleted it. The next /_api call — e.g. the pageLoad the route watcher fires on editor exit (GET /sites/{id}/pages/{hash}?withContent=false) — evaluated as anonymous, hit the guests DENY rule, and the SPA landed on /_error/unauthorized (with the 'Page has been reverted' toast masking the navigation that triggered it). Liveness now mirrors the record the session gate actually introspects: the subject's active central browser_session (not revoked, within expiry, seen inside the idle window). Keycloak identity disabled or deleted still purges; sidless central sessions keep their keep-until- expiry rule from ReconcileBrowserSessions so the sweep never out-purges the gate's own verdict. The dead wikijs.oidc_client_id config goes with the clients-map check. WikiJsSessionReconcileTest rewritten for the broker-native verdict: central-session presence decides keep/purge, plus revoked/expired/ idle-timeout, sidless keep, disabled/deleted dominance, lookup-failure skip, and the local-only exemption.