members: komiti-matrix-roles — komiti CRUD, the access matrix, kaitiaki + operator role #76

Closed
opened 2026-07-25 04:58:19 +00:00 by ben · 1 comment
Owner

Parent

Feature spec: #19 (members).

What to build

This slice gives komiti teeth and completes the role/designation surface. From the Members tab the operator creates, renames, and deletes komiti (P6-S1 → S7); deleting one closes its doors and mappings and touches no member account, and the operator role and kaitiaki designation never appear among komiti. On komiti detail the operator sets the service × komiti matrix (ADR 0076): each service is open to all members by default or restricted to named komiti. Restriction bites at the gateway's auth gate — a member outside a restricted komiti has their browser request to that service denied and never reaches the app at all — and a matrix change enforces on each affected member's next request, not on a deploy.

Per-app role mapping follows what each catalogue port declares: where a port declares claim-native groups, komiti ride the OIDC token as app groups; where it declares a reconciler-mapped construct (team, org, group folder), the reconciler applies the mapping and komiti detail shows it; where it declares neither, komiti detail says "front door only" for that service, honestly. The matrix and role mappings live in the config repo (the clan Config hatch, carried by the Tier-1 replica), so they are policy the community owns.

On member detail (S7 → S1, and P6-S4) the operator designates a kaitiaki — a designation, not a role, granting no access, stored as the hidden kanidm kaitiaki group, shown as a badge in the list and read by rescue from the IdP — and grants or revokes the operator role. Granting operator is a deliberate act: audit-logged, never flowing from any invite; revoking it leaves the member an active member.

Notes: the operator-role grant invokes rescue's key mint (ADR 0089) — an operator gets a standing operator key — which is why this slice depends on rescue's operator-key-ledger (Ben-confirmed 2026-07-25).

Acceptance criteria

  • (story 25) Given I manage komiti, when I delete one, then its doors and mappings close and no member account is touched; the operator role and kaitiaki never appear among komiti.
  • (story 26) Given a service restricted to a komiti, when a member outside it sends any browser request to that service, then the gateway's auth gate denies it — the member never reaches the app at all; and given the default, then every service is open to all members.
  • (story 27) Given a port declares claim-native groups, then komiti appear as app groups from the OIDC claim; given a port declares a reconciler-mapped construct, then the mapping is applied by the reconciler and shown on komiti detail; given a port declares neither, then komiti detail says "front door only" for that service, honestly.
  • (story 28) Given I restrict or open a service, then the auth gate enforces the new matrix on each affected member's next request.
  • (story 29) Given I designate a member kaitiaki, then it grants no access (a designation, not a role — stored as the hidden kanidm kaitiaki group), shows as a badge in the list, and rescue reads the designation from the IdP.
  • (story 30) Given an active member, when I grant operator, then it is audit-logged and never flows from any invite; when I revoke it, then the member remains an active member.

Blocked by

  • #71 — kaitiaki/operator actions live on member detail
  • #25 — matrix + role mappings live in the config repo (clan Config hatch)
  • #32 — the operator grant invokes rescue's key mint (ADR 0089)

Task manifest

task: members:komiti-matrix-roles
implements_flow: p6-members
implements_edge: S1→S7, S7→S1
wireframe:
  - docs/ux/wireframes/p6-members/p6-s7-komiti-detail.html
  - docs/ux/wireframes/p6-members/p6-s4-member-detail.html
interface: the `member` orchestrator (ADR 0077) — komiti CRUD (kanidm groups via `idp`), service × komiti matrix in the config repo + auth-gate decision function (ADR 0076), port-declared role mappings (claim-native / reconciler-mapped / front-door-only), kaitiaki designation (hidden group, ADR 0078), operator grant/revoke invoking rescue's key mint (ADR 0089)
seam: "`member` orchestrator seam tests (control plane, Go) \u2014 fake `idp`, fake catalogue-port role-mapping verbs, gate-state; assert the auth-gate decision (session identity + matrix + deny-list \u2192 allow/deny) bites on next request, komiti delete closes doors and touches no account, operator grant is audit-logged and never from an invite"
acceptance:
  - given: I manage komiti
    when: I delete one
    then: its doors and mappings close, no member account is touched; operator role and kaitiaki never appear among komiti
  - given: a service restricted to a komiti
    when: a member outside it sends a browser request to it
    then: the auth gate denies it and the member never reaches the app; the default is open to all members
  - given: a port declares claim-native groups / a reconciler-mapped construct / neither
    when: the mapping resolves
    then: komiti appear as OIDC app groups / the reconciler applies and komiti detail shows it / komiti detail says "front door only" honestly
  - given: I restrict or open a service
    when: the change is saved
    then: the auth gate enforces the new matrix on each affected member's next request
  - given: I designate a member kaitiaki
    when: the designation is set
    then: it grants no access (hidden kanidm kaitiaki group), shows a badge in the list, and rescue reads it from the IdP
  - given: an active member
    when: I grant operator (then revoke)
    then: granting is audit-logged and never flows from an invite; revoking leaves them an active member
depends_on: [member-detail-reset, bootstrap:clan-seam, rescue:operator-key-ledger]
out_of_scope: [suspend/removal (suspend's, removal-fates'), a third access role or delegation, komiti nesting, cross-community identity, per-app role mapping beyond what a port declares (ADR 0076), rescue's own share ceremony]
needs_human_decision: []
## Parent Feature spec: #19 (members). ## What to build This slice gives komiti teeth and completes the role/designation surface. From the Members tab the operator creates, renames, and deletes komiti (P6-S1 → S7); deleting one closes its doors and mappings and touches no member account, and the operator role and kaitiaki designation never appear among komiti. On komiti detail the operator sets the service × komiti matrix (ADR 0076): each service is open to all members by default or restricted to named komiti. Restriction bites at the gateway's auth gate — a member outside a restricted komiti has their browser request to that service denied and never reaches the app at all — and a matrix change enforces on each affected member's next request, not on a deploy. Per-app role mapping follows what each catalogue port declares: where a port declares claim-native groups, komiti ride the OIDC token as app groups; where it declares a reconciler-mapped construct (team, org, group folder), the reconciler applies the mapping and komiti detail shows it; where it declares neither, komiti detail says "front door only" for that service, honestly. The matrix and role mappings live in the config repo (the clan Config hatch, carried by the Tier-1 replica), so they are policy the community owns. On member detail (S7 → S1, and P6-S4) the operator designates a kaitiaki — a designation, not a role, granting no access, stored as the hidden kanidm kaitiaki group, shown as a badge in the list and read by rescue from the IdP — and grants or revokes the operator role. Granting operator is a deliberate act: audit-logged, never flowing from any invite; revoking it leaves the member an active member. Notes: the operator-role grant invokes rescue's key mint (ADR 0089) — an operator gets a standing operator key — which is why this slice depends on rescue's operator-key-ledger (Ben-confirmed 2026-07-25). ## Acceptance criteria - [ ] (story 25) Given I manage komiti, when I delete one, then its doors and mappings close and no member account is touched; the operator role and kaitiaki never appear among komiti. - [ ] (story 26) Given a service restricted to a komiti, when a member outside it sends any browser request to that service, then the gateway's auth gate denies it — the member never reaches the app at all; and given the default, then every service is open to all members. - [ ] (story 27) Given a port declares claim-native groups, then komiti appear as app groups from the OIDC claim; given a port declares a reconciler-mapped construct, then the mapping is applied by the reconciler and shown on komiti detail; given a port declares neither, then komiti detail says "front door only" for that service, honestly. - [ ] (story 28) Given I restrict or open a service, then the auth gate enforces the new matrix on each affected member's next request. - [ ] (story 29) Given I designate a member kaitiaki, then it grants no access (a designation, not a role — stored as the hidden kanidm kaitiaki group), shows as a badge in the list, and rescue reads the designation from the IdP. - [ ] (story 30) Given an active member, when I grant operator, then it is audit-logged and never flows from any invite; when I revoke it, then the member remains an active member. ## Blocked by - #71 — kaitiaki/operator actions live on member detail - #25 — matrix + role mappings live in the config repo (clan Config hatch) - #32 — the operator grant invokes rescue's key mint (ADR 0089) ## Task manifest ```yaml task: members:komiti-matrix-roles implements_flow: p6-members implements_edge: S1→S7, S7→S1 wireframe: - docs/ux/wireframes/p6-members/p6-s7-komiti-detail.html - docs/ux/wireframes/p6-members/p6-s4-member-detail.html interface: the `member` orchestrator (ADR 0077) — komiti CRUD (kanidm groups via `idp`), service × komiti matrix in the config repo + auth-gate decision function (ADR 0076), port-declared role mappings (claim-native / reconciler-mapped / front-door-only), kaitiaki designation (hidden group, ADR 0078), operator grant/revoke invoking rescue's key mint (ADR 0089) seam: "`member` orchestrator seam tests (control plane, Go) \u2014 fake `idp`, fake catalogue-port role-mapping verbs, gate-state; assert the auth-gate decision (session identity + matrix + deny-list \u2192 allow/deny) bites on next request, komiti delete closes doors and touches no account, operator grant is audit-logged and never from an invite" acceptance: - given: I manage komiti when: I delete one then: its doors and mappings close, no member account is touched; operator role and kaitiaki never appear among komiti - given: a service restricted to a komiti when: a member outside it sends a browser request to it then: the auth gate denies it and the member never reaches the app; the default is open to all members - given: a port declares claim-native groups / a reconciler-mapped construct / neither when: the mapping resolves then: komiti appear as OIDC app groups / the reconciler applies and komiti detail shows it / komiti detail says "front door only" honestly - given: I restrict or open a service when: the change is saved then: the auth gate enforces the new matrix on each affected member's next request - given: I designate a member kaitiaki when: the designation is set then: it grants no access (hidden kanidm kaitiaki group), shows a badge in the list, and rescue reads it from the IdP - given: an active member when: I grant operator (then revoke) then: granting is audit-logged and never flows from an invite; revoking leaves them an active member depends_on: [member-detail-reset, bootstrap:clan-seam, rescue:operator-key-ledger] out_of_scope: [suspend/removal (suspend's, removal-fates'), a third access role or delegation, komiti nesting, cross-community identity, per-app role mapping beyond what a port declares (ADR 0076), rescue's own share ceremony] needs_human_decision: [] ```
Author
Owner

Done in commit af56999 (branch sandcastle/worker/20260725-113503-6f3f7b).

Built the member orchestrator's komiti / access-matrix / role-designation surface (ADRs 0076/0077/0078/0089) at the single member seam — internal/member/komiti.go + roles.go, with 8 new seam tests in komiti_test.go (go build / go test ./internal/member/ / go vet / gofmt clean).

Acceptance coverage:

  • story 25 — CreateKomiti/RenameKomiti/DeleteKomiti (kanidm groups via the idp port), all audit-logged; delete closes doors (drops the komiti from every restricted policy) and touches no member account (strips group membership only); the operator role + kaitiaki are reserved names, refused and never among komiti. Tests TestDeleteKomiti_ClosesDoorsTouchesNoAccount, TestKomiti_OperatorAndKaitiakiNeverAmongKomiti.
  • story 26 & 28 — the auth-gate decision function GateDecision(sessionIdentity, service) reads deny-projection + matrix + live komiti; a restricted service denies an outsider (never reaches the app), the default is open to all, a suspended member is denied everywhere, an operator is never locked out, and a matrix change bites on the next request (read live, not on a deploy). Matrix writes via RestrictService/OpenService (new AccessMatrix.SetPolicy, config repo). Tests TestGateDecision_RestrictedDeniesOutsiderDefaultOpen, TestGateDecision_DenyListAndOperatorBypass, TestGateDecision_MatrixChangeBitesOnNextRequest.
  • story 27 — port-declared role mappings (new Catalogue.RoleMapping/ApplyRoleMapping): claim-native ride the OIDC claim, reconciler-mapped applied by the reconciler and shown on KomitiDetail, neither reads "front door only" honestly. Test TestKomitiDetail_PortDeclaredRoleMappings.
  • story 29 — Designate writes the hidden kanidm kaitiaki group (new idp.SetKaitiaki/IsKaitiaki — rescue reads it from the IdP), grants no access, mirrors the list badge. Test TestDesignate_KaitiakiIsHiddenGroupGrantsNoAccessBadgeInList.
  • story 30 — GrantOperator/RevokeOperator: a deliberate audit-logged act, never from an invite (active members only), invoking rescue's key mint (new Rescue.GrantOperatorKey/RevokeOperatorKey, ADR 0089); revoke leaves the member active. Test TestGrantOperator_AuditedMintsKeyNeverFromInvite.

No production adapters implement these ports yet (the durable config-repo matrix writer, the real catalogue role-mapping verbs, and rescue's wiring are later slices); only the seam fakes. STATUS.md updated in the same commit.

Done in commit af56999 (branch sandcastle/worker/20260725-113503-6f3f7b). Built the `member` orchestrator's komiti / access-matrix / role-designation surface (ADRs 0076/0077/0078/0089) at the single member seam — `internal/member/komiti.go` + `roles.go`, with 8 new seam tests in `komiti_test.go` (`go build` / `go test ./internal/member/` / `go vet` / `gofmt` clean). **Acceptance coverage:** - **story 25** — `CreateKomiti`/`RenameKomiti`/`DeleteKomiti` (kanidm groups via the `idp` port), all audit-logged; delete closes doors (drops the komiti from every restricted policy) and touches no member account (strips group membership only); the operator role + kaitiaki are reserved names, refused and never among komiti. Tests `TestDeleteKomiti_ClosesDoorsTouchesNoAccount`, `TestKomiti_OperatorAndKaitiakiNeverAmongKomiti`. - **story 26 & 28** — the auth-gate decision function `GateDecision(sessionIdentity, service)` reads deny-projection + matrix + live komiti; a restricted service denies an outsider (never reaches the app), the default is open to all, a suspended member is denied everywhere, an operator is never locked out, and a matrix change bites on the next request (read live, not on a deploy). Matrix writes via `RestrictService`/`OpenService` (new `AccessMatrix.SetPolicy`, config repo). Tests `TestGateDecision_RestrictedDeniesOutsiderDefaultOpen`, `TestGateDecision_DenyListAndOperatorBypass`, `TestGateDecision_MatrixChangeBitesOnNextRequest`. - **story 27** — port-declared role mappings (new `Catalogue.RoleMapping`/`ApplyRoleMapping`): claim-native ride the OIDC claim, reconciler-mapped applied by the reconciler and shown on `KomitiDetail`, neither reads "front door only" honestly. Test `TestKomitiDetail_PortDeclaredRoleMappings`. - **story 29** — `Designate` writes the hidden kanidm `kaitiaki` group (new `idp.SetKaitiaki`/`IsKaitiaki` — rescue reads it from the IdP), grants no access, mirrors the list badge. Test `TestDesignate_KaitiakiIsHiddenGroupGrantsNoAccessBadgeInList`. - **story 30** — `GrantOperator`/`RevokeOperator`: a deliberate audit-logged act, never from an invite (active members only), invoking rescue's key mint (new `Rescue.GrantOperatorKey`/`RevokeOperatorKey`, ADR 0089); revoke leaves the member active. Test `TestGrantOperator_AuditedMintsKeyNeverFromInvite`. No production adapters implement these ports yet (the durable config-repo matrix writer, the real catalogue role-mapping verbs, and rescue's wiring are later slices); only the seam fakes. STATUS.md updated in the same commit.
ben closed this issue 2026-07-25 11:49:18 +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#76
No description provided.