engine-adapters: idp-adapter — real kanidm behind the member orchestrator's idp port #171

Closed
opened 2026-07-29 05:09:53 +00:00 by ben · 1 comment
Owner

Parent

Engine-adapters child spec: #161 (ADRs 0102–0107; scoped on wayfinder #160 — Ben ruled live: per-family clan-lab smokes gate each family, the arc closes on a real-hardware end-to-end, tickets arm the swarm). Everything else agent-decided, post-hoc review pending.

What to build

The kanidm adapter (ADR 0105): drives kanidm's HTTPS REST API on the gateway's internal listener (internal CA→leaf chain, admin credential from clan vars). Persons (create / pending / enable / disable / remove), reset tokens (the branded reset link wraps kanidm's native token), komiti as kanidm groups under the reserved naming discipline, kaitiaki as membership of the structural group. Runtime people are the adapter's alone: the declarative layer's scope guarantee (a redeploy never erases them) is part of this ticket's contract tests. Family close replaces restingMemberIDP.

Acceptance criteria

  • Given an approved signup, When CreatePerson/EnableAccount run, Then a real enabled kanidm person exists and OIDC login works
  • Given a suspend, When DisableAccount runs, Then the account is disabled durably (the gate projection's fast path rides separately)
  • Given a reset link minted, When the member opens it, Then it is kanidm's native reset token, and minting is refused while suspended
  • Given komiti create/rename/delete, When they run, Then they are prefixed kanidm groups, never colliding with operators/members/kaitiaki
  • Given runtime people + komiti, When the gateway's declarative provisioning re-applies, Then all survive untouched (ADR 0105's load-bearing rule)

Blocked by

  • bootstrap:skeleton — #23 (closed; satisfied)

Task manifest

task: engine-adapters:idp-adapter
implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)"
interface: "member.IDP — contract unchanged (ADR 0077)"
seam: "internal/member seam tests with fakes; adapter contract tests against a disposable real kanidm instance"
acceptance:
  - given: a real kanidm; when: every port verb drives it; then: directory state matches and re-provisioning never touches runtime entities
depends_on: [bootstrap:skeleton]
out_of_scope: [screen changes (no UI surface in this arc), the release source / rollout mechanics (out of arc, wayfinder #160)]
needs_human_decision: []
## Parent Engine-adapters child spec: #161 (ADRs 0102–0107; scoped on wayfinder #160 — Ben ruled live: per-family clan-lab smokes gate each family, the arc closes on a real-hardware end-to-end, tickets arm the swarm). Everything else agent-decided, post-hoc review pending. ## What to build The kanidm adapter (ADR 0105): drives kanidm's HTTPS REST API on the gateway's internal listener (internal CA→leaf chain, admin credential from clan vars). Persons (create / pending / enable / disable / remove), reset tokens (the branded reset link wraps kanidm's native token), komiti as kanidm groups under the reserved naming discipline, kaitiaki as membership of the structural group. Runtime people are the adapter's alone: the declarative layer's scope guarantee (a redeploy never erases them) is part of this ticket's contract tests. Family close replaces restingMemberIDP. ## Acceptance criteria - [ ] Given an approved signup, When CreatePerson/EnableAccount run, Then a real enabled kanidm person exists and OIDC login works - [ ] Given a suspend, When DisableAccount runs, Then the account is disabled durably (the gate projection's fast path rides separately) - [ ] Given a reset link minted, When the member opens it, Then it is kanidm's native reset token, and minting is refused while suspended - [ ] Given komiti create/rename/delete, When they run, Then they are prefixed kanidm groups, never colliding with operators/members/kaitiaki - [ ] Given runtime people + komiti, When the gateway's declarative provisioning re-applies, Then all survive untouched (ADR 0105's load-bearing rule) ## Blocked by - bootstrap:skeleton — #23 (closed; satisfied) ## Task manifest ```yaml task: engine-adapters:idp-adapter implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)" interface: "member.IDP — contract unchanged (ADR 0077)" seam: "internal/member seam tests with fakes; adapter contract tests against a disposable real kanidm instance" acceptance: - given: a real kanidm; when: every port verb drives it; then: directory state matches and re-provisioning never touches runtime entities depends_on: [bootstrap:skeleton] out_of_scope: [screen changes (no UI surface in this arc), the release source / rollout mechanics (out of arc, wayfinder #160)] needs_human_decision: [] ```
Author
Owner

Landed in 5c19394 (on origin/main).

The production member.IDP adapter ships as internal/kanidm (ADR 0105): an Adapter driving kanidm's HTTPS REST API behind the member orchestrator's port (ADR 0077).

  • /v1/auth password handshake (kanidm has no client_credentials grant — spike Q4); a cached bearer refreshed transparently on a 401; the admin credential never leaves the gateway. kanidm.Client builds the HTTP client that validates the internal CA→leaf chain (spike Q2 gotcha 2).
  • Persons — create (enabled; by-hand is approval, DDR 0073), pending (disabled via a past account_expire), enable (purge expire) / disable (past expire — durable + reversible, ADR 0074) / remove; all idempotent, a gone person a no-op. → AC1, AC2
  • Reset — MintResetToken drives kanidm's native credential-update-intent token (the token the branded link wraps); errors for a nonexistent person. The refused while suspended guard is the member orchestrator's (ErrMemberNotActive). → AC3
  • Komiti — kanidm groups under the reserved komiti_ prefix, so they can never collide with, or surface among, operators/members/kaitiaki; create (idempotent) / rename (carries membership) / delete (accounts untouched) / add/remove member. → AC4
  • Kaitiaki — membership of the structural kaitiaki group (ADR 0078), read from memberof; never a komiti.

Seam (manifest: adapter contract tests): internal/kanidm/{kanidm_test.go,fakekanidm_test.go} drive every port verb end to end (real HTTP/JSON/bearer handshake) against a faithful kanidm REST double, including ADR 0105's load-bearing rule — runtime people + komiti survive a re-declaration of the structural groups untouched (TestRuntimeEntities_SurviveReprovision). The naming discipline is the adapter's half of AC5; the full real-kanidm redeploy proof is the family-4 clan-lab smoke (#178). Full go test ./... green.

Not wired into main.go by design: the member composition root goes whole at compose-aggregation-loop (#181), which retires restingMemberIDP. #171 is the adapter build; #172 (member-orbit-adapters) and #178 (smoke) are now unblockable.

Landed in `5c19394` (on `origin/main`). The production `member.IDP` adapter ships as `internal/kanidm` (ADR 0105): an `Adapter` driving kanidm's HTTPS REST API behind the member orchestrator's port (ADR 0077). - **/v1/auth password handshake** (kanidm has no `client_credentials` grant — spike Q4); a cached bearer refreshed transparently on a 401; the admin credential never leaves the gateway. `kanidm.Client` builds the HTTP client that validates the internal CA→leaf chain (spike Q2 gotcha 2). - **Persons** — create (enabled; by-hand is approval, DDR 0073), pending (disabled via a past `account_expire`), enable (purge expire) / disable (past expire — durable + reversible, ADR 0074) / remove; all idempotent, a gone person a no-op. → **AC1, AC2** - **Reset** — `MintResetToken` drives kanidm's native credential-update-intent token (the token the branded link wraps); errors for a nonexistent person. The `refused while suspended` guard is the member orchestrator's (`ErrMemberNotActive`). → **AC3** - **Komiti** — kanidm groups under the reserved `komiti_` prefix, so they can never collide with, or surface among, operators/members/kaitiaki; create (idempotent) / rename (carries membership) / delete (accounts untouched) / add/remove member. → **AC4** - **Kaitiaki** — membership of the structural `kaitiaki` group (ADR 0078), read from `memberof`; never a komiti. **Seam** (manifest: adapter contract tests): `internal/kanidm/{kanidm_test.go,fakekanidm_test.go}` drive every port verb end to end (real HTTP/JSON/bearer handshake) against a faithful kanidm REST double, including ADR 0105's load-bearing rule — runtime people + komiti survive a re-declaration of the structural groups untouched (`TestRuntimeEntities_SurviveReprovision`). The naming discipline is the adapter's half of AC5; the full real-kanidm redeploy proof is the family-4 clan-lab smoke (#178). Full `go test ./...` green. **Not wired into main.go by design:** the member composition root goes whole at `compose-aggregation-loop` (#181), which retires `restingMemberIDP`. #171 is the adapter build; #172 (member-orbit-adapters) and #178 (smoke) are now unblockable.
ben closed this issue 2026-07-29 13:16:07 +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#171
No description provided.