fix(caddy): end the forgejo session on keycloak front-channel logout #760
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra!760
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "fix/756-logout"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Signing out on the portal now also signs the browser out of Forgejo, through Keycloak front-channel logout. Refs #756.
What
opentofu/keycloak/clients.tofu): theforgejoclient getsfrontchannel_logout_url = <forgejo_url>/user/frontchannel-logout. The other clients keep their current setting (null).git.*: aGET /user/frontchannel-logoutwithSec-Fetch-Dest: iframe,Sec-Fetch-Site: same-siteand the realm'sissis rewritten to Forgejo's ownPOST /user/logout. Forgejo then deletes the server-side session and expires thesessionandpersistentcookies. That response dropsX-Frame-Optionsand sendsframe-ancestors https://<keycloak_domain>. Any other request to the path reaches Forgejo unchanged and gets a 404.ansible/roles/caddy/files/test_frontchannel_logout.shruns the real template blocks in Caddy against a stub upstream. It covers the #646 control, the Keycloak frame, a cross-site frame, a top-level navigation, a wrongissand missing fetch metadata. It is wired into CI.Limits
Before merge
keycloak_openid_client.sign_in["forgejo"]only; Caddy--check --diffshows only the new block.The bitborg-web FAQ change (
accounts-signout) follows in its own PR after the test.Prod apply, 2026-10-17, from
main(be2f5d3):opentofu/keycloak, workspaceprod: 0 added, 1 changed, 0 destroyed. Onlykeycloak_openid_client.sign_in["forgejo"]:frontchannel_logout_enabledtrue,frontchannel_logout_urlhttps://git.bitborg.se/user/frontchannel-logout.--tags caddyonbitborg-prod:--check --diffshowed only the@forgejo_frontchannel_logoutblock; applychanged=2,failed=0.Curl checks on
git.bitborg.se: bare URL404withX-Frame-Options: DENY; iframe-shapedGETwith the realm'siss200,frame-ancestors https://id.bitborg.se,persistentandredirect_toexpired.X-Frame-Options: DENYalso on the200, as on staging (#761).