portal: /authz/signout — clear the community session, end the IdP session, land on rd; the control panel reuses it (spec #1361 s27–28) #1363

Closed
opened 2026-09-10 00:56:28 +00:00 by ben · 2 comments
Owner

Parent

Spec #1361 (the Portal); program map #1336; design contract DDR 0232 / ADR 0233, flow docs/ux/flows/portal.mermaid, wireframes docs/ux/wireframes/portal/. Slice signout-route in docs/slices/portal.yaml.

What to build

/authz/signout on the gate: clear idss_session, end the IdP session (kanidm end-session; the bridge's idss_idp_session on IDIP), 302 to rd (default the apex root). The control panel's Sign out calls it with rd = the panel's sign-in landing (DDR 0172 story 7) — retires the served dashboard's jump to id.. Handler tests: cookie cleared, rd honoured, a following /me answers no session.

Acceptance criteria

  • Given a live session, when GET /authz/signout is called, then the community session cookie is cleared, the IdP session is ended (kanidm end-session on kanidm; the bridge's session on IDIP) and the browser is redirected to rd, default https:///.
  • Given a following GET /api/v1/me with the old cookie, when it is called, then it answers no session.
  • Given the control panel's Sign out, when it runs, then it calls /authz/signout with rd = the panel's own sign-in landing and no longer jumps to id..
  • Given a signed-out browser, when signout is called again, then it lands on rd without error.

Blocked by

  • None — can start immediately (bootstrap:skeleton is closed).

Task manifest

task: signout-route
implements_flow: portal
implements_edge: PT-S1→PT-S0 (signs out — the landing is the proof)
wireframe: ''
interface: GET /authz/signout?rd= → 302
seam: controlapi handler tests
acceptance:
- given: a live session
  when: GET /authz/signout is called
  then: the community session cookie is cleared, the IdP session is ended (kanidm end-session on kanidm;
    the bridge's session on IDIP) and the browser is redirected to rd, default https://<apex>/
- given: a following GET /api/v1/me with the old cookie
  when: it is called
  then: it answers no session
- given: the control panel's Sign out
  when: it runs
  then: it calls /authz/signout with rd = the panel's own sign-in landing and no longer jumps to id.<apex>
- given: a signed-out browser
  when: signout is called again
  then: it lands on rd without error
depends_on:
- bootstrap:skeleton
out_of_scope:
- operator truth on the Portal
- operator notices / per-service public switch
- IDIP identity door
- mail on IDIP (stated limit)
- IDIP browser sign-in UX (#1302)
needs_human_decision: []
## Parent Spec **#1361** (the Portal); program map **#1336**; design contract DDR 0232 / ADR 0233, flow `docs/ux/flows/portal.mermaid`, wireframes `docs/ux/wireframes/portal/`. Slice `signout-route` in `docs/slices/portal.yaml`. ## What to build /authz/signout on the gate: clear idss_session, end the IdP session (kanidm end-session; the bridge's idss_idp_session on IDIP), 302 to rd (default the apex root). The control panel's Sign out calls it with rd = the panel's sign-in landing (DDR 0172 story 7) — retires the served dashboard's jump to id.<apex>. Handler tests: cookie cleared, rd honoured, a following /me answers no session. ## Acceptance criteria - [ ] Given a live session, when GET /authz/signout is called, then the community session cookie is cleared, the IdP session is ended (kanidm end-session on kanidm; the bridge's session on IDIP) and the browser is redirected to rd, default https://<apex>/. - [ ] Given a following GET /api/v1/me with the old cookie, when it is called, then it answers no session. - [ ] Given the control panel's Sign out, when it runs, then it calls /authz/signout with rd = the panel's own sign-in landing and no longer jumps to id.<apex>. - [ ] Given a signed-out browser, when signout is called again, then it lands on rd without error. ## Blocked by - None — can start immediately (bootstrap:skeleton is closed). ## Task manifest ```yaml task: signout-route implements_flow: portal implements_edge: PT-S1→PT-S0 (signs out — the landing is the proof) wireframe: '' interface: GET /authz/signout?rd= → 302 seam: controlapi handler tests acceptance: - given: a live session when: GET /authz/signout is called then: the community session cookie is cleared, the IdP session is ended (kanidm end-session on kanidm; the bridge's session on IDIP) and the browser is redirected to rd, default https://<apex>/ - given: a following GET /api/v1/me with the old cookie when: it is called then: it answers no session - given: the control panel's Sign out when: it runs then: it calls /authz/signout with rd = the panel's own sign-in landing and no longer jumps to id.<apex> - given: a signed-out browser when: signout is called again then: it lands on rd without error depends_on: - bootstrap:skeleton out_of_scope: - operator truth on the Portal - operator notices / per-service public switch - IDIP identity door - mail on IDIP (stated limit) - IDIP browser sign-in UX (#1302) needs_human_decision: [] ```

swarm-claim host=matou-dev-server-01 run=20996
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=20996 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1363 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1363,
  "status": "success",
  "commits": [
    "34c8ca15df0a7ba55f8dcbe921a7cfa089ac99ff"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "internal/controlapi/oidcprovider.go",
    "internal/controlapi/signin.go",
    "internal/controlapi/signin_test.go",
    "internal/controlapi/signout_test.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/controlapi/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/controlapi/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Given a live session, when GET /authz/signout is called, then the community session cookie is cleared, the IdP session is ended (kanidm end-session on kanidm; the bridge's session on IDIP) and the browser is redirected to rd, default https://<apex>/": "signin.go signout(): SetCookie(ClearSessionCookie) then Redirect to Provider.EndSessionURL(rd) which ends the IdP session; rd defaults to https://<apex>/. Proven by TestAuthzSignout_ClearsSessionAndEndsIdPSession + TestAuthzSignout_DefaultsToApexRoot (signout_test.go). EndSessionURL added to OIDCProvider, implemented for the production kanidm/bridge shapes in oidcprovider.go (reads end_session_endpoint off discovery).",
    "Given a following GET /api/v1/me with the old cookie, when it is called, then it answers no session": "ClearSessionCookie sets MaxAge<0 empty value so the browser drops idss_session; the cleared cookie resolves to no session via CookieSessionResolver (the resolver /me is answered through). Proven by TestAuthzSignout_ClearedCookieResolvesToNoSession.",
    "Given the control panel's Sign out, when it runs, then it calls /authz/signout with rd = the panel's own sign-in landing and no longer jumps to id.<apex>": "signout validates rd same-apex (open-redirect guard) and honours an admin.<apex> landing; the only id.<apex> hop is the IdP end-session itself, retiring the DDR 0155 interim jump. Proven by TestAuthzSignout_HonoursControlPanelLanding (rd = https://admin.awa.example.nz/). The panel button wiring lives in the dashboard-entry seam (separate slice); this ticket builds the reusable route the panel calls.",
    "Given a signed-out browser, when signout is called again, then it lands on rd without error": "signout clears regardless of whether a session rides the request and always 302s to rd (via end-session or directly). Proven by TestAuthzSignout_SignedOutBrowserLandsOnRD + TestAuthzSignout_FallsBackToRDWithoutIdPEndSession."
  },
  "summary": "Built GET /authz/signout on the gate: clears the community SSO session cookie, ends the IdP session via the OIDC RP-initiated-logout hop, and lands the browser on a same-apex-validated rd (default the apex root).",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1363 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1363, "status": "success", "commits": [ "34c8ca15df0a7ba55f8dcbe921a7cfa089ac99ff" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "internal/controlapi/oidcprovider.go", "internal/controlapi/signin.go", "internal/controlapi/signin_test.go", "internal/controlapi/signout_test.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go test ./internal/controlapi/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "go vet ./internal/controlapi/", "exit_code": 0 } ], "criteria": { "Given a live session, when GET /authz/signout is called, then the community session cookie is cleared, the IdP session is ended (kanidm end-session on kanidm; the bridge's session on IDIP) and the browser is redirected to rd, default https://<apex>/": "signin.go signout(): SetCookie(ClearSessionCookie) then Redirect to Provider.EndSessionURL(rd) which ends the IdP session; rd defaults to https://<apex>/. Proven by TestAuthzSignout_ClearsSessionAndEndsIdPSession + TestAuthzSignout_DefaultsToApexRoot (signout_test.go). EndSessionURL added to OIDCProvider, implemented for the production kanidm/bridge shapes in oidcprovider.go (reads end_session_endpoint off discovery).", "Given a following GET /api/v1/me with the old cookie, when it is called, then it answers no session": "ClearSessionCookie sets MaxAge<0 empty value so the browser drops idss_session; the cleared cookie resolves to no session via CookieSessionResolver (the resolver /me is answered through). Proven by TestAuthzSignout_ClearedCookieResolvesToNoSession.", "Given the control panel's Sign out, when it runs, then it calls /authz/signout with rd = the panel's own sign-in landing and no longer jumps to id.<apex>": "signout validates rd same-apex (open-redirect guard) and honours an admin.<apex> landing; the only id.<apex> hop is the IdP end-session itself, retiring the DDR 0155 interim jump. Proven by TestAuthzSignout_HonoursControlPanelLanding (rd = https://admin.awa.example.nz/). The panel button wiring lives in the dashboard-entry seam (separate slice); this ticket builds the reusable route the panel calls.", "Given a signed-out browser, when signout is called again, then it lands on rd without error": "signout clears regardless of whether a session rides the request and always 302s to rd (via end-session or directly). Proven by TestAuthzSignout_SignedOutBrowserLandsOnRD + TestAuthzSignout_FallsBackToRDWithoutIdPEndSession." }, "summary": "Built GET /authz/signout on the gate: clears the community SSO session cookie, ends the IdP session via the OIDC RP-initiated-logout hop, and lands the browser on a same-apex-validated rd (default the apex root).", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1363
No description provided.