whakapapa: one community sign-in via a kanidm OIDC client — operators land as Gramps OWNER, members as MEMBER, through OIDC_GROUP_* (the richest mapping of the six) #1539

Closed
opened 2026-09-16 18:54:58 +00:00 by ben · 2 comments
Owner

Spec

#1535 — Ben's ruling (2026-09-16): adding a member in the control panel grants them access to every member service the control panel deployed; adding a member as an operator gives them admin access to all services. One community sign-in, every door, no second login, no hidden per-app credential.

Gramps Web (API ≥ 3.4.0) supports OIDC with role mapping by group claim.

Build

  • kanidm oauth2 create whakapapa … (redirect https://whakapapa.<apex>/api/oidc/callback/kanidm — verify the exact path against the deployed image's docs), scope map idm_all_persons, claim map roles: operators → owner, idm_all_persons → member.
  • Env (internal/clan/whakapapa.go): GRAMPSWEB_OIDC_ENABLED=true, OIDC_ISSUER, OIDC_CLIENT_ID/_SECRET (clan var), OIDC_USERNAME_CLAIM=preferred_username, OIDC_ROLE_CLAIM=roles, OIDC_GROUP_OWNER=owner, OIDC_GROUP_MEMBER=member. Keep OIDC_DISABLE_LOCAL_AUTH UNSET — the owner service identity the grampsweb-admin oneshot bootstraps (whakapapa.go:239-241) drives the health check.
  • The FIRST OIDC user must already carry OWNER through the claim (Gramps grants no usable role otherwise) — the operator does by construction.

Acceptance

  • Render test pins env + oneshot; re-run idempotent.
  • Operator signs in at whakapapa.<apex> with no second login and can edit; a member can view/add per the declared MEMBER role.

Security invariant (every header-trusting port, #1167): a port that trusts X-Idss-Identity lands header_up -X-Idss-Identity on its client-protocol exempt paths in the SAME commit (the gated handle overwrites the header from the gate's answer; the exempt handle has no such vouch — internal/clan/frontdoor.go:684 is the strip, renderProxy(..., exempt=true)). A port that speaks real OIDC needs no strip but MUST keep its claim/scope maps on the pattern files.go:822-946 sets: audience idm_all_persons (every person signs in), the admin bit keyed to ONE kanidm group via a collision-proof claim.

Also

Declare the port's posture and implement its ReconcileRole from the reconciler ticket #1537; the P6-S7/P4-S5 card line reads from it.

## Spec #1535 — Ben's ruling (2026-09-16): **adding a member in the control panel grants them access to every member service the control panel deployed; adding a member as an operator gives them admin access to all services.** One community sign-in, every door, no second login, no hidden per-app credential. Gramps Web (API ≥ 3.4.0) supports OIDC with role mapping by group claim. ## Build - kanidm `oauth2 create whakapapa …` (redirect `https://whakapapa.<apex>/api/oidc/callback/kanidm` — verify the exact path against the deployed image's docs), scope map `idm_all_persons`, claim map `roles`: `operators` → `owner`, `idm_all_persons` → `member`. - Env (`internal/clan/whakapapa.go`): `GRAMPSWEB_OIDC_ENABLED=true`, `OIDC_ISSUER`, `OIDC_CLIENT_ID/_SECRET` (clan var), `OIDC_USERNAME_CLAIM=preferred_username`, `OIDC_ROLE_CLAIM=roles`, `OIDC_GROUP_OWNER=owner`, `OIDC_GROUP_MEMBER=member`. Keep `OIDC_DISABLE_LOCAL_AUTH` UNSET — the `owner` service identity the grampsweb-admin oneshot bootstraps (`whakapapa.go:239-241`) drives the health check. - The FIRST OIDC user must already carry OWNER through the claim (Gramps grants no usable role otherwise) — the operator does by construction. ## Acceptance - Render test pins env + oneshot; re-run idempotent. - Operator signs in at `whakapapa.<apex>` with no second login and can edit; a member can view/add per the declared MEMBER role. **Security invariant (every header-trusting port, #1167):** a port that trusts `X-Idss-Identity` lands `header_up -X-Idss-Identity` on its client-protocol exempt paths in the SAME commit (the gated handle overwrites the header from the gate's answer; the exempt handle has no such vouch — `internal/clan/frontdoor.go:684` is the strip, `renderProxy(..., exempt=true)`). A port that speaks real OIDC needs no strip but MUST keep its claim/scope maps on the pattern `files.go:822-946` sets: audience `idm_all_persons` (every person signs in), the admin bit keyed to ONE kanidm group via a collision-proof claim. ## Also Declare the port's posture and implement its `ReconcileRole` from the reconciler ticket #1537; the P6-S7/P4-S5 card line reads from it.

swarm-claim host=bens-mac-04 run=25431
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=25431 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1539 — status success

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

envelope
{
  "issue": 1539,
  "status": "success",
  "commits": [
    "b4d0b51ed3491b857777f145a3e06fb14ca09c12"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/offboard_catalogue_test.go",
    "internal/clan/whakapapa.go",
    "internal/clan/whakapapa_attach.go",
    "internal/clan/whakapapa_attach_test.go",
    "internal/clan/whakapapa_test.go",
    "internal/whakapapasvc/whakapapasvc.go",
    "internal/whakapapasvc/whakapapasvc_test.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/clan/ ./internal/whakapapasvc/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "go test ./...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Render test pins env + oneshot; re-run idempotent": "internal/clan/whakapapa_test.go TestRenderWhakapapa_OIDCEnvPinned pins GRAMPSWEB_OIDC_* env + the oidc env-file entry + tmpfiles; TestRenderWhakapapa_OIDCKanidmClientAndRichRoleClaim pins the whakapapa-oidc oneshot (get-or-create client, scope map idm_all_persons, roles operators->owner + idm_all_persons->member array-joined, prefer-short-username, show-basic-secret, atomic secret write); TestRenderWhakapapa_Deterministic proves an unchanged config renders identical bytes (idempotent re-run); the kanidm CLI provisioning is get-or-create/create-or-update throughout (ADR 0062 idempotent).",
    "Operator signs in at whakapapa.<apex> with no second login and can edit; a member can view/add per the declared MEMBER role": "renderWhakapapaOIDC maps the ONE operators group -> owner and idm_all_persons -> member on the collision-proof roles claim (array join), GRAMPSWEB_OIDC_GROUP_OWNER=owner/GROUP_MEMBER=member land the operator as OWNER and every person as MEMBER; scope map idm_all_persons authorizes every person (one community sign-in, no second login); OIDC_DISABLE_LOCAL_AUTH stays unset so the owner service identity keeps the health check. internal/whakapapasvc declares oidc · operator->OWNER · member->MEMBER (contract test TestPort_RoleMappingDeclaresOIDCPosture). End-to-end sign-in/edit is the deferred clan-lab drive named on the ticket; the render+posture are the shipped contract.",
    "Declare the port's posture and implement ReconcileRole (#1537); the P6-S7/P4-S5 card line reads from it": "internal/whakapapasvc/whakapapasvc.go implements memberorbit.ServicePort with RoleMapping()=front-door-only·oidc·OWNER/MEMBER and ReconcileRole a truthful no-op (the OIDC roles claim carries the role, ADR 0100); wired into productionServicePorts (main.go, now 11 ports; offboard_catalogue_test.go pins the count + whakapapasvc.Service).",
    "Security invariant #1167 — real-OIDC port keeps claim/scope maps on the files.go pattern": "renderWhakapapaOIDC keys the audience to idm_all_persons (every person signs in) and the admin bit (owner) to the ONE operators group via the collision-proof roles claim; TestRenderWhakapapa_OIDCKanidmClientAndRichRoleClaim asserts no owner value is keyed to idm_all_persons/members. A real-OIDC port needs no header strip (no X-Idss-Identity trust)."
  },
  "summary": "whakapapa (Gramps Web) speaks real OIDC against the community kanidm — operators land OWNER, every person MEMBER, via the richest roles-claim mapping — with a posture port and a no-op ReconcileRole.",
  "blockers": []
}
**close-report** for #1539 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1539, "status": "success", "commits": [ "b4d0b51ed3491b857777f145a3e06fb14ca09c12" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/offboard_catalogue_test.go", "internal/clan/whakapapa.go", "internal/clan/whakapapa_attach.go", "internal/clan/whakapapa_attach_test.go", "internal/clan/whakapapa_test.go", "internal/whakapapasvc/whakapapasvc.go", "internal/whakapapasvc/whakapapasvc_test.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/clan/ ./internal/whakapapasvc/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "go test ./...", "exit_code": 0 } ], "criteria": { "Render test pins env + oneshot; re-run idempotent": "internal/clan/whakapapa_test.go TestRenderWhakapapa_OIDCEnvPinned pins GRAMPSWEB_OIDC_* env + the oidc env-file entry + tmpfiles; TestRenderWhakapapa_OIDCKanidmClientAndRichRoleClaim pins the whakapapa-oidc oneshot (get-or-create client, scope map idm_all_persons, roles operators->owner + idm_all_persons->member array-joined, prefer-short-username, show-basic-secret, atomic secret write); TestRenderWhakapapa_Deterministic proves an unchanged config renders identical bytes (idempotent re-run); the kanidm CLI provisioning is get-or-create/create-or-update throughout (ADR 0062 idempotent).", "Operator signs in at whakapapa.<apex> with no second login and can edit; a member can view/add per the declared MEMBER role": "renderWhakapapaOIDC maps the ONE operators group -> owner and idm_all_persons -> member on the collision-proof roles claim (array join), GRAMPSWEB_OIDC_GROUP_OWNER=owner/GROUP_MEMBER=member land the operator as OWNER and every person as MEMBER; scope map idm_all_persons authorizes every person (one community sign-in, no second login); OIDC_DISABLE_LOCAL_AUTH stays unset so the owner service identity keeps the health check. internal/whakapapasvc declares oidc · operator->OWNER · member->MEMBER (contract test TestPort_RoleMappingDeclaresOIDCPosture). End-to-end sign-in/edit is the deferred clan-lab drive named on the ticket; the render+posture are the shipped contract.", "Declare the port's posture and implement ReconcileRole (#1537); the P6-S7/P4-S5 card line reads from it": "internal/whakapapasvc/whakapapasvc.go implements memberorbit.ServicePort with RoleMapping()=front-door-only·oidc·OWNER/MEMBER and ReconcileRole a truthful no-op (the OIDC roles claim carries the role, ADR 0100); wired into productionServicePorts (main.go, now 11 ports; offboard_catalogue_test.go pins the count + whakapapasvc.Service).", "Security invariant #1167 — real-OIDC port keeps claim/scope maps on the files.go pattern": "renderWhakapapaOIDC keys the audience to idm_all_persons (every person signs in) and the admin bit (owner) to the ONE operators group via the collision-proof roles claim; TestRenderWhakapapa_OIDCKanidmClientAndRichRoleClaim asserts no owner value is keyed to idm_all_persons/members. A real-OIDC port needs no header strip (no X-Idss-Identity trust)." }, "summary": "whakapapa (Gramps Web) speaks real OIDC against the community kanidm — operators land OWNER, every person MEMBER, via the richest roles-claim mapping — with a posture port and a no-op ReconcileRole.", "blockers": [] } ``` </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#1539
No description provided.