members: every port declares its sign-in + role posture, and ONE roles reconciler fans operator/member out to kanidm groups and every deployed app on member add, operator grant/revoke, and service deploy (fixes GrantOperator never touching kanidm) #1537

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

The gap

GrantOperator / RevokeOperator (internal/member/roles.go:80-135) change the ledger role and the rescue key and nothing else: the promoted person is not added to kanidm's operators or files-admin groups, so they are an operator to the gate (komiti.go:640 isOperator reads the ledger) and a plain member to every app — Nextcloud included. Only the founding render (clan/vmguest.go:1610, persons.operator.groups = ["operators" "files-admin"]) ever puts anyone in those groups.

Build

  1. Port posture declaration. Each port's declaration (the catalogue entry / port descriptor the P6-S7 and P4-S5 service cards read) carries SignIn: oidc|header|own and a role mapping: what an operator becomes and what a member becomes (nextcloud: operator→files-admin group, member→default; grist: operator→org owner, member→editor; forgejo: operator→admin, member→default; mattermost: operator→system_admin; meetings/mail/docs-editing/static-sites: front door only). The service card renders the honest line from it (ADR 0076: "says so honestly per service").
  2. ReconcileRoles(ctx, personID) on the members orchestrator: reads the ledger role, then (a) kanidm: ensure membership in operators (+ files-admin, clan.NextcloudAdminGroup) for operators and absence for members — via the existing kanidm adapter's group verbs (internal/kanidm/kanidm.go:484-502 is the claim-map precedent); (b) for every DEPLOYED port with a per-app mapping, call the port's ReconcileRole(person, role) over its admin API — the same session its health check drives (ADR 0062 part 2). Per-app implementations land in the per-port tickets; this ticket ships the fan-out, the kanidm half, and the Nextcloud mapping (which is the kanidm half by construction, ADR 0150).
  3. Three call sites: GrantOperator/RevokeOperator; member add/approve (CreatePerson / EnableAccount paths); P4 deploy after a port's health check passes (provision/deploy.go) — for EVERY current operator, so a new service already knows them. Audit line names the apps touched. Failures on one app never roll back the ledger (best-effort, reported on the member detail as "not yet applied on ", retried by the next reconcile).

Acceptance

  • roles_test.go: grant → kanidm operators + files-admin membership asserted through the fake IDP; revoke → removed; idempotent.
  • Deploying a port with a mapping reconciles every existing operator (provision test with a fake port).
  • P6-S4 member detail shows the per-app role state honestly.
  • Wireframes p6-s4 / p4-s5 amended for the posture line under ADR 0174 (design-tier accept, two-way).

Files

internal/member/roles.go, internal/member/idp.go, internal/kanidm/kanidm.go, internal/catalogue/catalogue.go (or the port descriptor), internal/provision/deploy.go, dashboard/ service cards + member detail, tests.

## 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. ## The gap `GrantOperator` / `RevokeOperator` (`internal/member/roles.go:80-135`) change the ledger role and the rescue key and **nothing else**: the promoted person is not added to kanidm's `operators` or `files-admin` groups, so they are an operator to the gate (`komiti.go:640 isOperator` reads the ledger) and a plain member to every app — Nextcloud included. Only the founding render (`clan/vmguest.go:1610`, `persons.operator.groups = ["operators" "files-admin"]`) ever puts anyone in those groups. ## Build 1. **Port posture declaration.** Each port's declaration (the catalogue entry / port descriptor the P6-S7 and P4-S5 service cards read) carries `SignIn: oidc|header|own` and a role mapping: what an operator becomes and what a member becomes (`nextcloud: operator→files-admin group, member→default`; `grist: operator→org owner, member→editor`; `forgejo: operator→admin, member→default`; `mattermost: operator→system_admin`; `meetings/mail/docs-editing/static-sites: front door only`). The service card renders the honest line from it (ADR 0076: "says so honestly per service"). 2. **`ReconcileRoles(ctx, personID)`** on the members orchestrator: reads the ledger role, then (a) kanidm: ensure membership in `operators` (+ `files-admin`, `clan.NextcloudAdminGroup`) for operators and absence for members — via the existing `kanidm` adapter's group verbs (`internal/kanidm/kanidm.go:484-502` is the claim-map precedent); (b) for every DEPLOYED port with a per-app mapping, call the port's `ReconcileRole(person, role)` over its admin API — the same session its health check drives (ADR 0062 part 2). Per-app implementations land in the per-port tickets; this ticket ships the fan-out, the kanidm half, and the Nextcloud mapping (which is the kanidm half by construction, ADR 0150). 3. **Three call sites:** `GrantOperator`/`RevokeOperator`; member add/approve (`CreatePerson` / `EnableAccount` paths); P4 deploy after a port's health check passes (`provision/deploy.go`) — for EVERY current operator, so a new service already knows them. Audit line names the apps touched. Failures on one app never roll back the ledger (best-effort, reported on the member detail as "not yet applied on <app>", retried by the next reconcile). ## Acceptance - `roles_test.go`: grant → kanidm `operators` + `files-admin` membership asserted through the fake IDP; revoke → removed; idempotent. - Deploying a port with a mapping reconciles every existing operator (provision test with a fake port). - P6-S4 member detail shows the per-app role state honestly. - Wireframes p6-s4 / p4-s5 amended for the posture line under ADR 0174 (design-tier accept, two-way). ## Files `internal/member/roles.go`, `internal/member/idp.go`, `internal/kanidm/kanidm.go`, `internal/catalogue/catalogue.go` (or the port descriptor), `internal/provision/deploy.go`, `dashboard/` service cards + member detail, tests.

swarm-claim host=elitebook-distributed-server-03 run=25415
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=25415 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1537 — status success

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

envelope
{
  "issue": 1537,
  "status": "success",
  "commits": [
    "1b34e27859a11a597432dfd5c578eac092a3b51c"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/resting_composition.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "dashboard/src/components/members/MemberDetailScreen.vue",
    "dashboard/src/lib/memberDetail.ts",
    "dashboard/tests/unit/memberDetail.test.ts",
    "docs/ux/wireframes/p4-provisioning/p4-s5-active.html",
    "docs/ux/wireframes/p6-members/p6-s4-member-detail.html",
    "internal/chatsvc/chatsvc.go",
    "internal/codesvc/codesvc.go",
    "internal/controlapi/members.go",
    "internal/docseditingsvc/docseditingsvc.go",
    "internal/kanidm/fakekanidm_test.go",
    "internal/kanidm/kanidm.go",
    "internal/kanidm/kanidm_test.go",
    "internal/mailsvc/mailsvc.go",
    "internal/meetingssvc/meetingssvc.go",
    "internal/member/approval.go",
    "internal/member/byhand.go",
    "internal/member/detail.go",
    "internal/member/idp.go",
    "internal/member/komiti_test.go",
    "internal/member/ledger.go",
    "internal/member/member.go",
    "internal/member/removal.go",
    "internal/member/roles.go",
    "internal/member/roles_test.go",
    "internal/member/self_test.go",
    "internal/memberorbit/memberorbit.go",
    "internal/memberorbit/memberorbit_test.go",
    "internal/nextcloud/nextcloud.go",
    "internal/provision/health.go",
    "internal/provision/health_test.go",
    "internal/provision/provision.go",
    "internal/staticsitessvc/staticsitessvc.go"
  ],
  "tests": [
    {
      "command": "go test ./... (via nix .#go-ci pre-push gate)",
      "exit_code": 0
    },
    {
      "command": "go vet ./... (nix .#go-ci)",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./... (nix .#go-ci)",
      "exit_code": 0
    },
    {
      "command": "eslint . (TS lint gate)",
      "exit_code": 0
    },
    {
      "command": "dashboard vue-tsc + vitest run (1685 tests)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "roles_test.go: grant -> kanidm operators + files-admin membership asserted through the fake IDP; revoke -> removed; idempotent": "internal/member/roles_test.go TestGrantOperator_ReconcilesKanidmOperatorAndFilesAdminGroups (asserts InOperatorsGroup + InFilesAdminGroup on grant, removed on revoke, idempotent both ways) via new member.RolePort.SetOperator (idp.go) wired into GrantOperator/RevokeOperator (roles.go); kanidm adapter half proven by internal/kanidm/kanidm_test.go TestSetOperator_WritesAndClearsBothRoleGroups",
    "Deploying a port with a mapping reconciles every existing operator (provision test with a fake port)": "internal/member/roles_test.go TestReconcileService_ReconcilesEveryOperatorForANewPort (member fan-out to every operator via FakeCatalogue) + internal/provision/health_test.go TestDeploy_HealthyServiceReconcilesRolesFailedServiceDoesNot (the P4 hook in health.go calls provision.RoleReconciler.ReconcileService only for healthy services; wired member->provision via SetRoleReconciler in whole_composition.go)",
    "P6-S4 member detail shows the per-app role state honestly": "internal/member/detail.go ServiceAccess.RoleInApp + NotApplied from the port's declared posture + Member.RoleReconcile tail (roles_test.go TestMemberDetail_ShowsPerAppRolePostureAndNotAppliedHonestly); dashboard MemberDetailScreen.vue renders data-field=role-in-app-<service> + role-not-applied-<service> (memberDetail.test.ts new case)",
    "Wireframes p6-s4 / p4-s5 amended for the posture line under ADR 0174 (design-tier accept, two-way)": "docs/ux/wireframes/p6-members/p6-s4-member-detail.html (ACCESS block posture line + role-not-applied) and docs/ux/wireframes/p4-provisioning/p4-s5-active.html (role-posture-<service> honest line), both with dated ADR-0174 design-tier amendment notes"
  },
  "summary": "Every port declares its sign-in + role posture, and one roles reconciler fans operator/member out to the kanidm operators/files-admin groups and every deployed reconciler-mapped app on grant/revoke, member add/approve, and service deploy.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1537 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1537, "status": "success", "commits": [ "1b34e27859a11a597432dfd5c578eac092a3b51c" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/resting_composition.go", "control-plane/cmd/control-plane/whole_composition.go", "dashboard/src/components/members/MemberDetailScreen.vue", "dashboard/src/lib/memberDetail.ts", "dashboard/tests/unit/memberDetail.test.ts", "docs/ux/wireframes/p4-provisioning/p4-s5-active.html", "docs/ux/wireframes/p6-members/p6-s4-member-detail.html", "internal/chatsvc/chatsvc.go", "internal/codesvc/codesvc.go", "internal/controlapi/members.go", "internal/docseditingsvc/docseditingsvc.go", "internal/kanidm/fakekanidm_test.go", "internal/kanidm/kanidm.go", "internal/kanidm/kanidm_test.go", "internal/mailsvc/mailsvc.go", "internal/meetingssvc/meetingssvc.go", "internal/member/approval.go", "internal/member/byhand.go", "internal/member/detail.go", "internal/member/idp.go", "internal/member/komiti_test.go", "internal/member/ledger.go", "internal/member/member.go", "internal/member/removal.go", "internal/member/roles.go", "internal/member/roles_test.go", "internal/member/self_test.go", "internal/memberorbit/memberorbit.go", "internal/memberorbit/memberorbit_test.go", "internal/nextcloud/nextcloud.go", "internal/provision/health.go", "internal/provision/health_test.go", "internal/provision/provision.go", "internal/staticsitessvc/staticsitessvc.go" ], "tests": [ { "command": "go test ./... (via nix .#go-ci pre-push gate)", "exit_code": 0 }, { "command": "go vet ./... (nix .#go-ci)", "exit_code": 0 }, { "command": "golangci-lint run ./... (nix .#go-ci)", "exit_code": 0 }, { "command": "eslint . (TS lint gate)", "exit_code": 0 }, { "command": "dashboard vue-tsc + vitest run (1685 tests)", "exit_code": 0 } ], "criteria": { "roles_test.go: grant -> kanidm operators + files-admin membership asserted through the fake IDP; revoke -> removed; idempotent": "internal/member/roles_test.go TestGrantOperator_ReconcilesKanidmOperatorAndFilesAdminGroups (asserts InOperatorsGroup + InFilesAdminGroup on grant, removed on revoke, idempotent both ways) via new member.RolePort.SetOperator (idp.go) wired into GrantOperator/RevokeOperator (roles.go); kanidm adapter half proven by internal/kanidm/kanidm_test.go TestSetOperator_WritesAndClearsBothRoleGroups", "Deploying a port with a mapping reconciles every existing operator (provision test with a fake port)": "internal/member/roles_test.go TestReconcileService_ReconcilesEveryOperatorForANewPort (member fan-out to every operator via FakeCatalogue) + internal/provision/health_test.go TestDeploy_HealthyServiceReconcilesRolesFailedServiceDoesNot (the P4 hook in health.go calls provision.RoleReconciler.ReconcileService only for healthy services; wired member->provision via SetRoleReconciler in whole_composition.go)", "P6-S4 member detail shows the per-app role state honestly": "internal/member/detail.go ServiceAccess.RoleInApp + NotApplied from the port's declared posture + Member.RoleReconcile tail (roles_test.go TestMemberDetail_ShowsPerAppRolePostureAndNotAppliedHonestly); dashboard MemberDetailScreen.vue renders data-field=role-in-app-<service> + role-not-applied-<service> (memberDetail.test.ts new case)", "Wireframes p6-s4 / p4-s5 amended for the posture line under ADR 0174 (design-tier accept, two-way)": "docs/ux/wireframes/p6-members/p6-s4-member-detail.html (ACCESS block posture line + role-not-applied) and docs/ux/wireframes/p4-provisioning/p4-s5-active.html (role-posture-<service> honest line), both with dated ADR-0174 design-tier amendment notes" }, "summary": "Every port declares its sign-in + role posture, and one roles reconciler fans operator/member out to the kanidm operators/files-admin groups and every deployed reconciler-mapped app on grant/revoke, member add/approve, and service deploy.", "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.

Blocks
Reference
Matou/idss#1537
No description provided.