Research: the session substrate and the per-member door answer the Portal can consume today, on both paths and both tiers #1337

Closed
opened 2026-09-09 03:59:13 +00:00 by ben · 2 comments
Owner

Parent

The Portal map (#1336)

Question

What can the Portal actually stand on today? Inventory from source (control-plane composition root control-plane/cmd/control-plane/main.go, internal/controlapi — authgate.go, the /authz/signin + /authz/callback substrate, mail.go, member_join*.go; internal/clan/frontdoor.go; internal/member, internal/memberorbit, the IDIP roster decider ADR 0222 #1155; dashboard/src/entry/*.ts, lib/api/*):

  1. The session leg per path. Where the control plane's own OIDC-client session (/authz/signin, the rd carriage, the cookie on the apex) is wired: public path, private path (ADR 0149/0150 — no forward_auth; is the gate OIDC secret / session substrate present in the VM guest?), rented vs own-VPS. What "resting" means for a member arriving at the apex on each. Does the same cookie serve the apex AND admin.<apex> (DDR 0172's sign-out = gate clear + kanidm end)?
  2. The door per tier. kanidm tier: the branded sign-in (DDR 0145/0147/0148) and how the gate answers forward_auth from the member orchestrator. IDIP tier: what session a browser member holds today (the twelve-words door, keriauth), what the roster-backed gate decider answers, and what #1293's doorkeeper sign-in (#1302) will hand the Portal — read that map's research findings (research/doorkeeper-hosting-and-vouching branch, ADR 0226/DDR 0228) so the Portal's assumption "a session exists after the door" is stated in the tier's real terms.
  3. The per-member "doors open to me" answer. Which API can answer, for the signed-in identity, the set of live services their komiti/credentials open: the portal ledger (internal/provision/portal.go, PublishedLink), the access matrix (ADR 0078, internal/member), regression bug #1229 (empty access matrix) state, the IDIP tier's credential-keyed access (ADR 0222), and the private path's un-enforced matrix (DDR 0173 stated limit). State exactly what is fact (the gate would admit) vs intent (the matrix says) on each path/tier.
  4. What /mail consumes today (HttpMemberMailClient, /api/mail) and whether its session posture is the same leg as (1).

Deliver: a table (path × tier → session leg, door, per-member access answer, gaps) plus the list of gaps a Portal spec must close or state as limits. Write to a research/portal-session-substrate branch under docs/research/2026-09-08-portal-session-substrate.md; link from this ticket.

## Parent [The Portal map (#1336)](https://git.matou.nz/Matou/idss/issues/1336) ## Question What can the Portal actually stand on today? Inventory from source (control-plane composition root `control-plane/cmd/control-plane/main.go`, `internal/controlapi` — `authgate.go`, the `/authz/signin` + `/authz/callback` substrate, `mail.go`, `member_join*.go`; `internal/clan/frontdoor.go`; `internal/member`, `internal/memberorbit`, the IDIP roster decider ADR 0222 #1155; `dashboard/src/entry/*.ts`, `lib/api/*`): 1. **The session leg per path.** Where the control plane's own OIDC-client session (`/authz/signin`, the `rd` carriage, the cookie on the apex) is wired: public path, private path (ADR 0149/0150 — no `forward_auth`; is the gate OIDC secret / session substrate present in the VM guest?), rented vs own-VPS. What "resting" means for a member arriving at the apex on each. Does the same cookie serve the apex AND `admin.<apex>` (DDR 0172's sign-out = gate clear + kanidm end)? 2. **The door per tier.** kanidm tier: the branded sign-in (DDR 0145/0147/0148) and how the gate answers `forward_auth` from the member orchestrator. IDIP tier: what session a browser member holds today (the twelve-words door, keriauth), what the roster-backed gate decider answers, and what #1293's doorkeeper sign-in (#1302) will hand the Portal — read that map's research findings (`research/doorkeeper-hosting-and-vouching` branch, ADR 0226/DDR 0228) so the Portal's assumption "a session exists after the door" is stated in the tier's real terms. 3. **The per-member "doors open to me" answer.** Which API can answer, for the signed-in identity, the set of live services their komiti/credentials open: the portal ledger (`internal/provision/portal.go`, `PublishedLink`), the access matrix (ADR 0078, `internal/member`), regression bug #1229 (empty access matrix) state, the IDIP tier's credential-keyed access (ADR 0222), and the private path's un-enforced matrix (DDR 0173 stated limit). State exactly what is *fact* (the gate would admit) vs *intent* (the matrix says) on each path/tier. 4. **What `/mail` consumes today** (`HttpMemberMailClient`, `/api/mail`) and whether its session posture is the same leg as (1). Deliver: a table (path × tier → session leg, door, per-member access answer, gaps) plus the list of gaps a Portal spec must close or state as limits. Write to a `research/portal-session-substrate` branch under `docs/research/2026-09-08-portal-session-substrate.md`; link from this ticket.
Author
Owner

Research landed — branch research/portal-session-substrate, commit 8e61f324 (unpushed, in the agent worktree; branched from origin/main c0da2f36). Doc: docs/research/2026-09-08-portal-session-substrate.md (table path × tier, gaps, /mail, every claim cited path:line).

Table gist (path × tier):

  • Session leg — real on all four cells. GET /authz/signin → IdP → /authz/callback mints idss_session (stateless HMAC {sub, exp}, 12 h, Domain=<apex>; session.go:142-153), wired whenever IDSS_COMMUNITY_APEX + IDSS_GATE_OIDC_SECRET are exported (main.go:1363) — the private path exports both (<slug>.idss.internal, vmguest.go:1876-1882) and trusts the guest kanidm CA (#1240). One cookie serves the apex AND admin.<apex>. sub = kanidm preferred_username / the AID on IDIP (oidcprovider.go:107-115).
  • Door: kanidm's branded page (DDR 0145/47/48) / the bridge's twelve-words GET /login (internal/idp/signin.go). The #1302 doorkeeper door still ends in the bridge's OIDC callback (doorkeeper research §2.5) → same cookie; the Portal's "a session exists after the door" holds in the tier's real terms. On the private path the door is reachable only inside the CA-pinned app window (DDR 0165). IDIP-on-private is rendered, never driven.
  • Gate fact: Orchestrator.GateDecision (komiti.go:567-626) / IdipGateDecider (idip_gate.go:107-179, live roster Standing + held credential slugs) on the public path; nothing on private service routes (ADR 0150).
  • Per-member "doors open to me": no member-facing API on either tier. kanidm: GET /api/v1/members/{id}/detail access[] is intent-only, ungated on the apex, omits un-rowed (open) services and the operator exception (detail.go:288-312). IDIP: every /api/v1/idip read is steward-gated; Standing(aid) has no HTTP projection. #1229 is CLOSED (31545803) but only fixed the per-credential steward view. The portal ledger (portal.go) is write-only — Links() has no route.
  • Resting at the apex: the route is ungated and strips X-Idss-Identity (frontdoor.go:557-573); the whole operator API answers anyone there (#512 posture the harness relies on).

Gaps a Portal spec must close or state as limits:

  1. No "who am I / am I live" route — and it must go through GateDecision, not the bare cookie resolver (a suspended member's cookie stays valid up to 12 h).
  2. No per-member doors-open-to-me route on either tier (fact = live services × the tier's GateDecision; computable, unexposed).
  3. Sign-out unbuilt (DDR 0172): no /authz/signout, ClearSessionCookie uncalled, dashboard Sign out = jump to id.<apex>, refusal page's Sign out = /.
  4. /mail is unreachable for a member today: WithMemberMail(c.mailPortal, nil) (main.go:1486-1488) → HeaderSessionResolver; the apex strips the header → 401 always; admin.<apex> admits operators only. Fix shape = pass gateResolver.
  5. Portal ledger write-only and never shrinks on service removal.
  6. Cookie carries no display name; kanidm lookup is the ungated operator route, IDIP lookup steward-gated.
  7. IDIP: a plain member has no route under /api/v1/idip at all ("my credentials" has no source but the wallet).
  8. First sign-in (FirstLogin) is observed only inside gateVerify (authgate.go:243) — never on the ungated apex.
  9. The apex API is ungated (inherited limit or a scope decision).
  10. No session-expiry frame on the apex (DDR 0172's "session ended" unbuilt).
  11. /mail on IDIP is wrong even after (4): address = <AID>@<apex>, Claim gates through the kanidm orchestrator (resting on IDIP).
  12. Private path: apex resolves only in the app window; callback URL is portless (signin.go:107-109).
**Research landed** — branch `research/portal-session-substrate`, commit `8e61f324` (unpushed, in the agent worktree; branched from `origin/main` `c0da2f36`). Doc: `docs/research/2026-09-08-portal-session-substrate.md` (table path × tier, gaps, `/mail`, every claim cited `path:line`). **Table gist (path × tier):** - **Session leg — real on all four cells.** `GET /authz/signin` → IdP → `/authz/callback` mints `idss_session` (stateless HMAC `{sub, exp}`, 12 h, `Domain=<apex>`; `session.go:142-153`), wired whenever `IDSS_COMMUNITY_APEX` + `IDSS_GATE_OIDC_SECRET` are exported (`main.go:1363`) — the private path exports both (`<slug>.idss.internal`, `vmguest.go:1876-1882`) and trusts the guest kanidm CA (#1240). One cookie serves the apex AND `admin.<apex>`. `sub` = kanidm `preferred_username` / the AID on IDIP (`oidcprovider.go:107-115`). - **Door:** kanidm's branded page (DDR 0145/47/48) / the bridge's twelve-words `GET /login` (`internal/idp/signin.go`). The #1302 doorkeeper door still ends in the bridge's OIDC callback (doorkeeper research §2.5) → same cookie; the Portal's "a session exists after the door" holds in the tier's real terms. On the private path the door is reachable only inside the CA-pinned app window (DDR 0165). IDIP-on-private is rendered, never driven. - **Gate fact:** `Orchestrator.GateDecision` (`komiti.go:567-626`) / `IdipGateDecider` (`idip_gate.go:107-179`, live roster Standing + held credential slugs) on the public path; **nothing** on private service routes (ADR 0150). - **Per-member "doors open to me": no member-facing API on either tier.** kanidm: `GET /api/v1/members/{id}/detail` `access[]` is intent-only, ungated on the apex, omits un-rowed (open) services and the operator exception (`detail.go:288-312`). IDIP: every `/api/v1/idip` read is steward-gated; `Standing(aid)` has no HTTP projection. #1229 is CLOSED (`31545803`) but only fixed the per-credential steward view. The portal ledger (`portal.go`) is write-only — `Links()` has no route. - **Resting at the apex:** the route is ungated and strips `X-Idss-Identity` (`frontdoor.go:557-573`); the whole operator API answers anyone there (#512 posture the harness relies on). **Gaps a Portal spec must close or state as limits:** 1. No "who am I / am I live" route — and it must go through `GateDecision`, not the bare cookie resolver (a suspended member's cookie stays valid up to 12 h). 2. No per-member doors-open-to-me route on either tier (fact = live services × the tier's `GateDecision`; computable, unexposed). 3. Sign-out unbuilt (DDR 0172): no `/authz/signout`, `ClearSessionCookie` uncalled, dashboard Sign out = jump to `id.<apex>`, refusal page's Sign out = `/`. 4. **`/mail` is unreachable for a member today**: `WithMemberMail(c.mailPortal, nil)` (`main.go:1486-1488`) → `HeaderSessionResolver`; the apex strips the header → 401 always; `admin.<apex>` admits operators only. Fix shape = pass `gateResolver`. 5. Portal ledger write-only and never shrinks on service removal. 6. Cookie carries no display name; kanidm lookup is the ungated operator route, IDIP lookup steward-gated. 7. IDIP: a plain member has no route under `/api/v1/idip` at all ("my credentials" has no source but the wallet). 8. First sign-in (`FirstLogin`) is observed only inside `gateVerify` (`authgate.go:243`) — never on the ungated apex. 9. The apex API is ungated (inherited limit or a scope decision). 10. No session-expiry frame on the apex (DDR 0172's "session ended" unbuilt). 11. `/mail` on IDIP is wrong even after (4): address = `<AID>@<apex>`, `Claim` gates through the kanidm orchestrator (resting on IDIP). 12. Private path: apex resolves only in the app window; callback URL is portless (`signin.go:107-109`).
Author
Owner

Resolution

Findings on research/portal-session-substrate @ 8e61f324 → docs/research/2026-09-08-portal-session-substrate.md (land on main when reviewed, like #725's). Gist:

  • The session leg is real on all four path × tier cells: /authz/signin → IdP → /authz/callback mints the idss_session cookie (stateless HMAC {sub,exp}, 12 h, Domain=<apex>), wired whenever IDSS_COMMUNITY_APEX + IDSS_GATE_OIDC_SECRET exist — the private path exports both. One cookie spans the apex and admin.<apex>. sub = kanidm preferred_username / the AID on IDIP.
  • Door: kanidm's branded page / the bridge's twelve-words GET /login; #1302's doorkeeper door still ends at the bridge's OIDC callback → the same cookie, so "a session exists after the door" holds in the tier's real terms. Private path: the door is reachable only inside the CA-pinned app window (DDR 0165); IDIP-on-private is rendered, never driven.
  • Gate fact exists on the public path only (GateDecision / IdipGateDecider); nothing gates private service routes (ADR 0150).
  • No member-facing "doors open to me" API on either tier: the kanidm members/{id}/detail.access[] is intent-only, ungated, and omits un-rowed (open) services + the operator exception; every IDIP read is steward-gated; #1229 is CLOSED but fixed only the steward view; the portal ledger's Links() has no route (write-only).
  • The apex route is ungated and strips X-Idss-Identity — the operator API answers anyone there.

12 gaps the Portal spec must close or state as limits (doc §4), the load-bearing ones: no who-am-I/am-I-live route (the bare cookie stays valid ≤12 h after a suspend); no per-member doors route; sign-out unbuilt (no /authz/signout); /mail is unreachable for any member today (header resolver on a route that strips the header → always 401; fix = pass the gate resolver) — filed as a defect; ledger never shrinks; no display name in the cookie; an IDIP plain member has no route at all; no session-expiry frame.

Unblocks the two faces grill and the my-services grill.

## Resolution Findings on `research/portal-session-substrate` @ `8e61f324` → `docs/research/2026-09-08-portal-session-substrate.md` (land on main when reviewed, like #725's). Gist: - **The session leg is real on all four path × tier cells**: `/authz/signin` → IdP → `/authz/callback` mints the `idss_session` cookie (stateless HMAC `{sub,exp}`, 12 h, `Domain=<apex>`), wired whenever `IDSS_COMMUNITY_APEX` + `IDSS_GATE_OIDC_SECRET` exist — the private path exports both. **One cookie spans the apex and `admin.<apex>`.** `sub` = kanidm `preferred_username` / the AID on IDIP. - **Door**: kanidm's branded page / the bridge's twelve-words `GET /login`; #1302's doorkeeper door still ends at the bridge's OIDC callback → the same cookie, so "a session exists after the door" holds in the tier's real terms. Private path: the door is reachable only inside the CA-pinned app window (DDR 0165); IDIP-on-private is rendered, never driven. - **Gate fact** exists on the public path only (`GateDecision` / `IdipGateDecider`); nothing gates private service routes (ADR 0150). - **No member-facing "doors open to me" API on either tier**: the kanidm `members/{id}/detail.access[]` is intent-only, ungated, and omits un-rowed (open) services + the operator exception; every IDIP read is steward-gated; #1229 is CLOSED but fixed only the steward view; the portal ledger's `Links()` has no route (write-only). - **The apex route is ungated and strips `X-Idss-Identity`** — the operator API answers anyone there. **12 gaps** the Portal spec must close or state as limits (doc §4), the load-bearing ones: no who-am-I/am-I-live route (the bare cookie stays valid ≤12 h after a suspend); no per-member doors route; sign-out unbuilt (no `/authz/signout`); **`/mail` is unreachable for any member today** (header resolver on a route that strips the header → always 401; fix = pass the gate resolver) — filed as a defect; ledger never shrinks; no display name in the cookie; an IDIP plain member has no route at all; no session-expiry frame. Unblocks the two faces grill and the my-services grill.
ben closed this issue 2026-09-09 04:17:21 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#1337
No description provided.