files: Nextcloud consumes kanidm OIDC; operator lands as admin (ADR 0150, drive-arc T4) #361

Closed
opened 2026-08-09 18:18:03 +00:00 by ben · 1 comment
Owner

Slice T4 of the Nextcloud-provision drive arc — docs/superpowers/specs/2026-08-09-nextcloud-provision-e2e-design.md (commit c72bff1)

Implements ADR 0150 (ADR 0016 made real for files; ADR 0076 Tier 1).

Build

  • kanidm OAuth2 client for Nextcloud, provisioned by a files-render oneshot against the running kanidm; redirect URL https://files.<apex>/apps/user_oidc/code. Mind DDR 0147's lesson: domain-level kanidm ops need admin, not idm_admin (unauthorized objects mask as "Item not found").
  • user_oidc enabled + configured via occ in the oneshot: one provider named for the community, issuer https://id.<apex> (forwarded port on the private path, ADR 0149).
  • Group mapping: a kanidm files-admin group flows through the OIDC group claim into Nextcloud's admin group; founding adds operator to it.
  • ocadmin stays reconciler-only (no ceremony ever uses it).

Accept

  • Fresh deploy: Nextcloud's login page offers the community OIDC provider; the operator's kanidm session lands as a member of Nextcloud's admin group.
  • Oneshot idempotent (safe re-run, ADR 0062).
  • Seam tests for the rendered config + oneshot script; live proof rides T6's drive.
## Slice T4 of the Nextcloud-provision drive arc — `docs/superpowers/specs/2026-08-09-nextcloud-provision-e2e-design.md` (commit `c72bff1`) Implements **ADR 0150** (ADR 0016 made real for files; ADR 0076 Tier 1). ## Build - **kanidm OAuth2 client** for Nextcloud, provisioned by a files-render oneshot against the running kanidm; redirect URL `https://files.<apex>/apps/user_oidc/code`. Mind DDR 0147's lesson: domain-level kanidm ops need `admin`, not `idm_admin` (unauthorized objects mask as "Item not found"). - **`user_oidc`** enabled + configured via `occ` in the oneshot: one provider named for the community, issuer `https://id.<apex>` (forwarded port on the private path, ADR 0149). - **Group mapping:** a kanidm files-admin group flows through the OIDC group claim into Nextcloud's `admin` group; founding adds `operator` to it. - `ocadmin` stays reconciler-only (no ceremony ever uses it). ## Accept - Fresh deploy: Nextcloud's login page offers the community OIDC provider; the operator's kanidm session lands as a member of Nextcloud's `admin` group. - Oneshot idempotent (safe re-run, ADR 0062). - Seam tests for the rendered config + oneshot script; live proof rides T6's drive.
Author
Owner

Done in bc458a568e68b5c544d9185f9758f43cfcbefa4e (on origin/main). Files now consumes kanidm OIDC (ADR 0150 / ADR 0016; ADR 0076 Tier 1).

  • kanidm half (files.go new nextcloud-oidc oneshot, emitted only when the co-hosted live set carries an IDPHost): confidential OAuth2 client nextcloud, redirect https://files.<apex>/apps/user_oidc/code, authenticated as the DOMAIN admin (DDR 0147, the kanidm-brand-push pattern); scope-map + claim-map so nextcloud_admins members carry a groups claim whose value is Nextcloud's built-in admin group; basic secret read back, never pre-shared.
  • Nextcloud half: user_oidc enabled via occ; one provider named for the community (apex slug), discovery id.<apex>/oauth2/openid/nextcloud/.well-known/openid-configuration, --group-provisioning=1 --mapping-groups=groups.
  • Founding half (vmguest.go): kanidm provisioning declares the nextcloud_admins group (clan.NextcloudAdminGroup) and the operator joins it — a passkey sign-in lands an admin session. ocadmin stays reconciler-only.
  • Wiring: FilesConfig/FilesLiveSet gain IDPHost; the deploy sets it on the co-hosted private path only (deploy.go).
  • Idempotent (ADR 0062): get-or-create client, install-or-enable app, create-or-update provider/maps.

Evidence: seam tests in internal/clan/files_test.go (OIDC client/user_oidc/group-map/idempotency) + vmguest_test.go (files-admin group + operator membership) green; rendered files.nix nix-instantiate --parse clean. Live proof rides T6's drive — occ app:install user_oidc needs the guest's deploy-time appstore reach, the first likely T4 red.

Done in `bc458a568e68b5c544d9185f9758f43cfcbefa4e` (on origin/main). Files now consumes kanidm OIDC (ADR 0150 / ADR 0016; ADR 0076 Tier 1). - **kanidm half** (`files.go` new `nextcloud-oidc` oneshot, emitted only when the co-hosted live set carries an `IDPHost`): confidential OAuth2 client `nextcloud`, redirect `https://files.<apex>/apps/user_oidc/code`, authenticated as the DOMAIN `admin` (DDR 0147, the kanidm-brand-push pattern); scope-map + claim-map so `nextcloud_admins` members carry a `groups` claim whose value is Nextcloud's built-in `admin` group; basic secret read back, never pre-shared. - **Nextcloud half**: `user_oidc` enabled via `occ`; one provider named for the community (apex slug), discovery `id.<apex>/oauth2/openid/nextcloud/.well-known/openid-configuration`, `--group-provisioning=1 --mapping-groups=groups`. - **Founding half** (`vmguest.go`): kanidm provisioning declares the `nextcloud_admins` group (`clan.NextcloudAdminGroup`) and the operator joins it — a passkey sign-in lands an admin session. `ocadmin` stays reconciler-only. - **Wiring**: FilesConfig/FilesLiveSet gain `IDPHost`; the deploy sets it on the co-hosted private path only (`deploy.go`). - Idempotent (ADR 0062): get-or-create client, install-or-enable app, create-or-update provider/maps. **Evidence**: seam tests in `internal/clan/files_test.go` (OIDC client/user_oidc/group-map/idempotency) + `vmguest_test.go` (files-admin group + operator membership) green; rendered `files.nix` `nix-instantiate --parse` clean. Live proof rides T6's drive — `occ app:install user_oidc` needs the guest's deploy-time appstore reach, the first likely T4 red.
ben closed this issue 2026-08-09 20:18:41 +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#361
No description provided.