newsletters: one community sign-in via OIDC seeded at deploy through PUT /api/settings (Listmonk configures OIDC in the DB, not env) — operators Super Admin, members a declared role #1541

Closed
opened 2026-09-16 18:55:06 +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.

Listmonk has OIDC since 4.1.0 and OIDC auto-signup since 5.1.0 (our 6.1.0 carries both), but the config lives in Settings → Security (DB), with no env override.

Build

  • kanidm oauth2 create newsletters … (redirect https://newsletters.<apex>/auth/oidc), scope map idm_all_persons.
  • The newsletters reconciler step (the same admin-API session the health check drives, internal/clan/newsletters.go:25-62, API user idss-api) does PUT /api/settings with security.oidc.{enabled, provider_url, client_id, client_secret, auto_create_users, default_user_role} then the restart Listmonk asks for; idempotent (compare before write).
  • Roles: create a Members user role (lists: view/subscribe; campaigns: none) as default_user_role; the reconciler promotes operators to Super Admin via PUT /api/users/{id}.
  • Keep the idss-api token user; it is the health check's identity, never a human login.

Acceptance

  • Render/reconcile test pins the settings payload; second run writes nothing.
  • Operator opens newsletters.<apex> and is Super Admin with no second login; a member sees lists only.

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. Listmonk has OIDC since 4.1.0 and OIDC auto-signup since 5.1.0 (our 6.1.0 carries both), but the config lives in Settings → Security (DB), with no env override. ## Build - kanidm `oauth2 create newsletters …` (redirect `https://newsletters.<apex>/auth/oidc`), scope map `idm_all_persons`. - The `newsletters` reconciler step (the same admin-API session the health check drives, `internal/clan/newsletters.go:25-62`, API user `idss-api`) does `PUT /api/settings` with `security.oidc.{enabled, provider_url, client_id, client_secret, auto_create_users, default_user_role}` then the restart Listmonk asks for; idempotent (compare before write). - Roles: create a `Members` user role (lists: view/subscribe; campaigns: none) as `default_user_role`; the reconciler promotes operators to `Super Admin` via `PUT /api/users/{id}`. - Keep the `idss-api` token user; it is the health check's identity, never a human login. ## Acceptance - Render/reconcile test pins the settings payload; second run writes nothing. - Operator opens `newsletters.<apex>` and is Super Admin with no second login; a member sees lists only. **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=25422
(automated multi-host claim — lowest live claim id works this ticket)

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

close-report for #1541 — status success

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

envelope
{
  "issue": 1541,
  "status": "success",
  "commits": [
    "2995cd3e65525b850906ef134a4cd9e2c7bf591a"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/offboard_catalogue_test.go",
    "internal/clan/newsletters.go",
    "internal/clan/newsletters_attach.go",
    "internal/clan/newsletters_test.go",
    "internal/member/removal.go",
    "internal/newslettersvc/newslettersvc.go",
    "internal/newslettersvc/newslettersvc_test.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/newslettersvc/ ./internal/clan/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "gofmt -l (touched files)",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/clan/ ./internal/newslettersvc/ ./internal/member/... ./internal/memberorbit/... ./control-plane/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Render/reconcile test pins the settings payload; second run writes nothing": "internal/clan/newsletters.go renderNewslettersOIDC emits the newsletters-oidc oneshot: PUT /api/settings with security.oidc.{enabled, provider_url, client_id, client_secret, auto_create_users, default_user_role} and compare-before-write (reads live security.oidc, returns before the PUT when it matches). Pinned by TestRenderNewsletters_OIDCSettingsPayloadPinned and TestRenderNewsletters_OIDCComparesBeforeWrite in newsletters_test.go (green).",
    "Operator opens newsletters.<apex> and is Super Admin with no second login; a member sees lists only": "Sign-in with no second login: kanidm `newsletters` OAuth2 client (redirect https://newsletters.<apex>/auth/oidc, scope map idm_all_persons) + security.oidc.{enabled, auto_create_users} written to Listmonk (renderNewslettersOIDC) — SignInOIDC (removal.go). Member sees lists only: auto_create_users lands the Members role (lists view/subscribe, no campaigns) as default_user_role. Operator is Super Admin: internal/newslettersvc Port.ReconcileRole promotes an operator to Super Admin over PUT /api/users/{id} (member -> Members), proven by TestNewslettersPort_ReconcileRolePromotesOperatorToSuperAdmin / _DemotesToMembers (green). The reconciler is fanned out by #1537 over the port wired into productionServicePorts.",
    "Declare the port's posture and implement its ReconcileRole (#1537); the P6-S7/P4-S5 card line reads from it": "internal/newslettersvc Port.RoleMapping() declares reconciler-mapped · user role · oidc · operator->Super Admin · member->Members (SignInOIDC), and Port.ReconcileRole is implemented; wired into productionServicePorts (9 ports) so the catalogue's RoleMapping(newsletters) feeds the P4-S5/P6-S4/P6-S7 card line. Pinned by TestNewslettersPort_RoleMappingIsReconcilerOIDC and TestProductionServicePorts_FromDerivedURLs (green).",
    "Security invariant #1167": "A port that speaks real OIDC needs no X-Idss-Identity strip; the admin bit is keyed to the ONE operators group via the ledger role (the reconciler), not a claim — Listmonk's OIDC carries no role map. scope map is idm_all_persons (every person signs in)."
  },
  "summary": "The newsletters port speaks one community sign-in via Listmonk's DB-held OIDC — operators promoted to Super Admin by the member-orbit reconciler, members auto-provisioned into a lists-only Members role.",
  "reason": "",
  "blockers": []
}
**close-report** for #1541 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1541, "status": "success", "commits": [ "2995cd3e65525b850906ef134a4cd9e2c7bf591a" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/offboard_catalogue_test.go", "internal/clan/newsletters.go", "internal/clan/newsletters_attach.go", "internal/clan/newsletters_test.go", "internal/member/removal.go", "internal/newslettersvc/newslettersvc.go", "internal/newslettersvc/newslettersvc_test.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/newslettersvc/ ./internal/clan/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "gofmt -l (touched files)", "exit_code": 0 }, { "command": "go test ./internal/clan/ ./internal/newslettersvc/ ./internal/member/... ./internal/memberorbit/... ./control-plane/...", "exit_code": 0 } ], "criteria": { "Render/reconcile test pins the settings payload; second run writes nothing": "internal/clan/newsletters.go renderNewslettersOIDC emits the newsletters-oidc oneshot: PUT /api/settings with security.oidc.{enabled, provider_url, client_id, client_secret, auto_create_users, default_user_role} and compare-before-write (reads live security.oidc, returns before the PUT when it matches). Pinned by TestRenderNewsletters_OIDCSettingsPayloadPinned and TestRenderNewsletters_OIDCComparesBeforeWrite in newsletters_test.go (green).", "Operator opens newsletters.<apex> and is Super Admin with no second login; a member sees lists only": "Sign-in with no second login: kanidm `newsletters` OAuth2 client (redirect https://newsletters.<apex>/auth/oidc, scope map idm_all_persons) + security.oidc.{enabled, auto_create_users} written to Listmonk (renderNewslettersOIDC) — SignInOIDC (removal.go). Member sees lists only: auto_create_users lands the Members role (lists view/subscribe, no campaigns) as default_user_role. Operator is Super Admin: internal/newslettersvc Port.ReconcileRole promotes an operator to Super Admin over PUT /api/users/{id} (member -> Members), proven by TestNewslettersPort_ReconcileRolePromotesOperatorToSuperAdmin / _DemotesToMembers (green). The reconciler is fanned out by #1537 over the port wired into productionServicePorts.", "Declare the port's posture and implement its ReconcileRole (#1537); the P6-S7/P4-S5 card line reads from it": "internal/newslettersvc Port.RoleMapping() declares reconciler-mapped · user role · oidc · operator->Super Admin · member->Members (SignInOIDC), and Port.ReconcileRole is implemented; wired into productionServicePorts (9 ports) so the catalogue's RoleMapping(newsletters) feeds the P4-S5/P6-S4/P6-S7 card line. Pinned by TestNewslettersPort_RoleMappingIsReconcilerOIDC and TestProductionServicePorts_FromDerivedURLs (green).", "Security invariant #1167": "A port that speaks real OIDC needs no X-Idss-Identity strip; the admin bit is keyed to the ONE operators group via the ledger role (the reconciler), not a claim — Listmonk's OIDC carries no role map. scope map is idm_all_persons (every person signs in)." }, "summary": "The newsletters port speaks one community sign-in via Listmonk's DB-held OIDC — operators promoted to Super Admin by the member-orbit reconciler, members auto-provisioned into a lists-only Members role.", "reason": "", "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#1541
No description provided.