document-archive: one community sign-in via a kanidm OIDC client (the files.go template) — operators are superusers, members auto-provision on first sign-in #1538

Closed
opened 2026-09-16 18:54:54 +00:00 by ben · 4 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.

Paperless-ngx 2.20.15 (our build, django-allauth 65.16.1 present) supports OIDC since 2.5.0.

Build

  • kanidm: oauth2 create paperless …, redirect https://document-archive.<apex>/accounts/oidc/kanidm/login/callback/, scope map audience idm_all_persons openid email profile groups, claim map pgroups (collision-proof, as ocgroups) with operators → admins — mirror internal/clan/files.go:822-946; the client secret is a clan var (sops-age).
  • Paperless env (internal/clan/paperless.go): PAPERLESS_APPS=allauth.socialaccount.providers.openid_connect, PAPERLESS_SOCIALACCOUNT_PROVIDERS JSON (issuer https://id.<apex>/oauth2/openid/paperless), PAPERLESS_SOCIAL_AUTO_SIGNUP=true, PAPERLESS_SOCIAL_ACCOUNT_SYNC_GROUPS=true, PAPERLESS_DISABLE_REGULAR_LOGIN=true ONLY once the admin service identity (PaperlessAdminUser, the health check's) still works over API token — keep the local admin.
  • Operator → superuser: group sync gives Django groups, not is_superuser; the reconciler sets it via PATCH /api/users/{id}/ (is_superuser, is_staff) over the admin session the health check already drives (paperless.go).
  • Members: auto-signup, default group members with the permissions the port declares (view + add documents).

Acceptance

  • Render test pins the env + the kanidm oneshot; the OIDC oneshot is idempotent on re-run (the files.go get || create shape).
  • Phase-9 drive leg (the drive-leg ticket) signs the operator into document-archive.<apex> with no second login and reaches /admin/ as superuser.
  • #1503's monitoring lesson: the health check keeps using the API-token path, never the browser path.

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. Paperless-ngx 2.20.15 (our build, `django-allauth 65.16.1` present) supports OIDC since 2.5.0. ## Build - kanidm: `oauth2 create paperless …`, redirect `https://document-archive.<apex>/accounts/oidc/kanidm/login/callback/`, scope map audience `idm_all_persons` `openid email profile groups`, claim map `pgroups` (collision-proof, as `ocgroups`) with `operators` → `admins` — mirror `internal/clan/files.go:822-946`; the client secret is a clan var (sops-age). - Paperless env (`internal/clan/paperless.go`): `PAPERLESS_APPS=allauth.socialaccount.providers.openid_connect`, `PAPERLESS_SOCIALACCOUNT_PROVIDERS` JSON (issuer `https://id.<apex>/oauth2/openid/paperless`), `PAPERLESS_SOCIAL_AUTO_SIGNUP=true`, `PAPERLESS_SOCIAL_ACCOUNT_SYNC_GROUPS=true`, `PAPERLESS_DISABLE_REGULAR_LOGIN=true` ONLY once the admin service identity (`PaperlessAdminUser`, the health check's) still works over API token — keep the local admin. - Operator → **superuser**: group sync gives Django groups, not `is_superuser`; the reconciler sets it via `PATCH /api/users/{id}/` (`is_superuser`, `is_staff`) over the admin session the health check already drives (`paperless.go`). - Members: auto-signup, default group `members` with the permissions the port declares (view + add documents). ## Acceptance - Render test pins the env + the kanidm oneshot; the OIDC oneshot is idempotent on re-run (the `files.go` `get || create` shape). - Phase-9 drive leg (the drive-leg ticket) signs the operator into `document-archive.<apex>` with no second login and reaches `/admin/` as superuser. - #1503's monitoring lesson: the health check keeps using the API-token path, never the browser path. **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=elitebook-distributed-server-03 run=25440
(automated multi-host claim — lowest live claim id works this ticket)

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

Ruled by agent under ADR 0174 — veto anytime. Two render ambiguities in the Build section, both two-way doors (revertible by a later commit, render/seam-proved offline, exact wire proven on the deferred Phase-9 clan-lab drive — the whakapapa #1539 precedent):

  1. OIDC client secret — the Build says both "mirror files.go:822-946" (which reads kanidm's minted basic secret back with show-basic-secret) and "the client secret is a clan var (sops-age)". These conflict: the kanidm CLI mints the basic secret and exposes no set-to-a-chosen-value verb, so a pre-generated clan-var secret cannot be pushed to the client. I followed the dominant instruction (mirror files.go): the document-archive-oidc oneshot provisions the paperless kanidm client, reads the minted secret back, and writes the full PAPERLESS_SOCIALACCOUNT_PROVIDERS JSON (client_id + secret + issuer) atomically into <store>/oidc.env, which paperless-web reads via a second EnvironmentFile and orders after the oneshot — the exact whakapapa #1539 oidc.env shape. The secret never lands in a clan var or the world-readable Nix store.

  2. PAPERLESS_DISABLE_REGULAR_LOGIN — the Build gates it "ONLY once the admin service identity still works over API token", which cannot be verified offline. I left it unset (regular login stays enabled), mirroring whakapapa #1539's "OIDC_DISABLE_LOCAL_AUTH UNSET so the owner service identity still drives the health check" — the health check keeps the /api/token/ path, the local admin is kept. The drive can flip it once it proves the token path survives.

Proof: the render test pins the env + the kanidm oneshot + idempotency; the documentarchivesvc contract test pins operator→superuser over PATCH /api/users/{id}/; the health check is untouched (still API-token). A later commit/drive reverts either call freely.

**Ruled by agent under ADR 0174 — veto anytime.** Two render ambiguities in the Build section, both two-way doors (revertible by a later commit, render/seam-proved offline, exact wire proven on the deferred Phase-9 clan-lab drive — the whakapapa #1539 precedent): 1. **OIDC client secret** — the Build says both "mirror `files.go:822-946`" (which reads kanidm's *minted* basic secret back with `show-basic-secret`) **and** "the client secret is a clan var (sops-age)". These conflict: the kanidm CLI mints the basic secret and exposes no set-to-a-chosen-value verb, so a pre-generated clan-var secret cannot be pushed to the client. I followed the dominant instruction (mirror files.go): the `document-archive-oidc` oneshot provisions the `paperless` kanidm client, reads the minted secret back, and writes the full `PAPERLESS_SOCIALACCOUNT_PROVIDERS` JSON (client_id + secret + issuer) atomically into `<store>/oidc.env`, which `paperless-web` reads via a second `EnvironmentFile` and orders `after` the oneshot — the exact whakapapa #1539 `oidc.env` shape. The secret never lands in a clan var or the world-readable Nix store. 2. **`PAPERLESS_DISABLE_REGULAR_LOGIN`** — the Build gates it "ONLY once the admin service identity still works over API token", which cannot be verified offline. I left it **unset** (regular login stays enabled), mirroring whakapapa #1539's "OIDC_DISABLE_LOCAL_AUTH UNSET so the owner service identity still drives the health check" — the health check keeps the `/api/token/` path, the local admin is kept. The drive can flip it once it proves the token path survives. Proof: the render test pins the env + the kanidm oneshot + idempotency; the `documentarchivesvc` contract test pins operator→superuser over `PATCH /api/users/{id}/`; the health check is untouched (still API-token). A later commit/drive reverts either call freely.

close-report for #1538 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • commit 9f5524ef9e is not reachable from origin/main (not landed)
  • changed_files: 'STATUS.md' is not in the diff of the claimed commits
  • changed_files: 'control-plane/cmd/control-plane/main.go' is not in the diff of the claimed commits
  • changed_files: 'control-plane/cmd/control-plane/offboard_catalogue_test.go' is not in the diff of the claimed commits
  • changed_files: 'internal/clan/paperless.go' is not in the diff of the claimed commits
  • changed_files: 'internal/clan/paperless_attach.go' is not in the diff of the claimed commits
  • changed_files: 'internal/clan/paperless_attach_test.go' is not in the diff of the claimed commits
  • changed_files: 'internal/clan/paperless_test.go' is not in the diff of the claimed commits
  • changed_files: 'internal/documentarchivesvc/documentarchivesvc.go' is not in the diff of the claimed commits
  • changed_files: 'internal/documentarchivesvc/documentarchivesvc_test.go' is not in the diff of the claimed commits
  • changed_files: 'internal/member/removal.go' is not in the diff of the claimed commits
envelope
{
  "issue": 1538,
  "status": "success",
  "commits": [
    "9f5524ef9e84e334ae8bacab14157a41c93e88c4"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/offboard_catalogue_test.go",
    "internal/clan/paperless.go",
    "internal/clan/paperless_attach.go",
    "internal/clan/paperless_attach_test.go",
    "internal/clan/paperless_test.go",
    "internal/documentarchivesvc/documentarchivesvc.go",
    "internal/documentarchivesvc/documentarchivesvc_test.go",
    "internal/member/removal.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "gofmt -l (changed .go files)",
      "exit_code": 0
    },
    {
      "command": "go vet ./...",
      "exit_code": 0
    },
    {
      "command": "go test ./... (pre-push gate: nix develop .#go-ci)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Render test pins the env + the kanidm oneshot; the OIDC oneshot is idempotent on re-run (the files.go get||create shape)": "internal/clan/paperless_test.go TestRenderPaperless_OIDCStaticEnv (PAPERLESS_APPS/SOCIAL_AUTO_SIGNUP/SOCIAL_ACCOUNT_SYNC_GROUPS pinned), TestRenderPaperless_OIDCKanidmClient (document-archive-oidc oneshot: kanidm login, get||create paperless, redirect .../accounts/oidc/kanidm/login/callback/, scope-map idm_all_persons openid email profile groups, pgroups operators->admins + idm_all_persons->members, join array, show-basic-secret, atomic env write, paperless-web second EnvironmentFile + after-ordering + tmpfiles), TestRenderPaperless_OIDCOmittedWithoutIDP, TestRenderPaperless_Deterministic (OIDC variant re-renders identical bytes — the get||create shape is idempotent). internal/clan/paperless.go:renderPaperlessOIDC uses the files.go get||create guard.",
    "Operator -> superuser via the reconciler (PATCH /api/users/{id}/ is_superuser,is_staff over the admin session the health check drives)": "internal/documentarchivesvc/documentarchivesvc.go Port.ReconcileRole (mint token via POST /api/token/ as clan.PaperlessAdminUser, GET /api/users/?username=, PATCH /api/users/{id}/ {is_superuser,is_staff} only on divergence); test TestDocumentArchivePort_ReconcileRolePromotesOperatorToSuperuser (idempotent) + TestDocumentArchivePort_ReconcileRoleDemotesMember. Wired into productionServicePorts (main.go, 13 ports) — TestProductionServicePorts_FromDerivedURLs.",
    "Members: auto-signup, default group members": "internal/clan/paperless.go renders PAPERLESS_SOCIAL_AUTO_SIGNUP=true + PAPERLESS_SOCIAL_ACCOUNT_SYNC_GROUPS=true and the kanidm pgroups claim maps idm_all_persons->members (TestRenderPaperless_OIDCKanidmClient); a never-signed-in member is a truthful reconcile no-op (TestDocumentArchivePort_ReconcileRoleBeforeFirstSignInIsNoOp).",
    "The health check keeps using the API-token path, never the browser path (#1503)": "paperlesshealth.go untouched (still POST /api/token/ then Token auth); PAPERLESS_DISABLE_REGULAR_LOGIN left UNSET so the local admin + API-token path keep working (TestRenderPaperless_OIDCStaticEnv asserts it is absent).",
    "Security invariant #1167: a real-OIDC port needs no header strip but keeps its claim/scope maps on the files.go:822-946 pattern (audience idm_all_persons, admin bit keyed to ONE group via a collision-proof claim)": "Paperless speaks real OIDC (django-allauth) so no frontdoor strip added; the kanidm oneshot keys the audience to idm_all_persons and the admin bit to the ONE operators group via the collision-proof pgroups claim (pgroups operators->admins), mirroring files.go ocgroups — TestRenderPaperless_OIDCKanidmClient.",
    "Declare the port's posture and implement its ReconcileRole (#1537); the P6-S7/P4-S5 card line reads from it": "internal/documentarchivesvc RoleMapping() = reconciler-mapped/oidc/operator->superuser/member->member (TestDocumentArchivePort_RoleMappingIsReconcilerOIDC); ReconcileRole is a real PATCH reconcile; member.SignInOwn doc updated (Paperless now SignInOIDC)."
  },
  "summary": "document-archive (Paperless-ngx) now speaks kanidm OIDC — one community sign-in, members auto-provision, and the documentarchivesvc reconciler promotes an operator to Paperless superuser over PATCH /api/users/{id}/.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1538 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit 9f5524ef9e84e334ae8bacab14157a41c93e88c4 is not reachable from origin/main (not landed) - changed_files: 'STATUS.md' is not in the diff of the claimed commits - changed_files: 'control-plane/cmd/control-plane/main.go' is not in the diff of the claimed commits - changed_files: 'control-plane/cmd/control-plane/offboard_catalogue_test.go' is not in the diff of the claimed commits - changed_files: 'internal/clan/paperless.go' is not in the diff of the claimed commits - changed_files: 'internal/clan/paperless_attach.go' is not in the diff of the claimed commits - changed_files: 'internal/clan/paperless_attach_test.go' is not in the diff of the claimed commits - changed_files: 'internal/clan/paperless_test.go' is not in the diff of the claimed commits - changed_files: 'internal/documentarchivesvc/documentarchivesvc.go' is not in the diff of the claimed commits - changed_files: 'internal/documentarchivesvc/documentarchivesvc_test.go' is not in the diff of the claimed commits - changed_files: 'internal/member/removal.go' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 1538, "status": "success", "commits": [ "9f5524ef9e84e334ae8bacab14157a41c93e88c4" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/offboard_catalogue_test.go", "internal/clan/paperless.go", "internal/clan/paperless_attach.go", "internal/clan/paperless_attach_test.go", "internal/clan/paperless_test.go", "internal/documentarchivesvc/documentarchivesvc.go", "internal/documentarchivesvc/documentarchivesvc_test.go", "internal/member/removal.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "gofmt -l (changed .go files)", "exit_code": 0 }, { "command": "go vet ./...", "exit_code": 0 }, { "command": "go test ./... (pre-push gate: nix develop .#go-ci)", "exit_code": 0 } ], "criteria": { "Render test pins the env + the kanidm oneshot; the OIDC oneshot is idempotent on re-run (the files.go get||create shape)": "internal/clan/paperless_test.go TestRenderPaperless_OIDCStaticEnv (PAPERLESS_APPS/SOCIAL_AUTO_SIGNUP/SOCIAL_ACCOUNT_SYNC_GROUPS pinned), TestRenderPaperless_OIDCKanidmClient (document-archive-oidc oneshot: kanidm login, get||create paperless, redirect .../accounts/oidc/kanidm/login/callback/, scope-map idm_all_persons openid email profile groups, pgroups operators->admins + idm_all_persons->members, join array, show-basic-secret, atomic env write, paperless-web second EnvironmentFile + after-ordering + tmpfiles), TestRenderPaperless_OIDCOmittedWithoutIDP, TestRenderPaperless_Deterministic (OIDC variant re-renders identical bytes — the get||create shape is idempotent). internal/clan/paperless.go:renderPaperlessOIDC uses the files.go get||create guard.", "Operator -> superuser via the reconciler (PATCH /api/users/{id}/ is_superuser,is_staff over the admin session the health check drives)": "internal/documentarchivesvc/documentarchivesvc.go Port.ReconcileRole (mint token via POST /api/token/ as clan.PaperlessAdminUser, GET /api/users/?username=, PATCH /api/users/{id}/ {is_superuser,is_staff} only on divergence); test TestDocumentArchivePort_ReconcileRolePromotesOperatorToSuperuser (idempotent) + TestDocumentArchivePort_ReconcileRoleDemotesMember. Wired into productionServicePorts (main.go, 13 ports) — TestProductionServicePorts_FromDerivedURLs.", "Members: auto-signup, default group members": "internal/clan/paperless.go renders PAPERLESS_SOCIAL_AUTO_SIGNUP=true + PAPERLESS_SOCIAL_ACCOUNT_SYNC_GROUPS=true and the kanidm pgroups claim maps idm_all_persons->members (TestRenderPaperless_OIDCKanidmClient); a never-signed-in member is a truthful reconcile no-op (TestDocumentArchivePort_ReconcileRoleBeforeFirstSignInIsNoOp).", "The health check keeps using the API-token path, never the browser path (#1503)": "paperlesshealth.go untouched (still POST /api/token/ then Token auth); PAPERLESS_DISABLE_REGULAR_LOGIN left UNSET so the local admin + API-token path keep working (TestRenderPaperless_OIDCStaticEnv asserts it is absent).", "Security invariant #1167: a real-OIDC port needs no header strip but keeps its claim/scope maps on the files.go:822-946 pattern (audience idm_all_persons, admin bit keyed to ONE group via a collision-proof claim)": "Paperless speaks real OIDC (django-allauth) so no frontdoor strip added; the kanidm oneshot keys the audience to idm_all_persons and the admin bit to the ONE operators group via the collision-proof pgroups claim (pgroups operators->admins), mirroring files.go ocgroups — TestRenderPaperless_OIDCKanidmClient.", "Declare the port's posture and implement its ReconcileRole (#1537); the P6-S7/P4-S5 card line reads from it": "internal/documentarchivesvc RoleMapping() = reconciler-mapped/oidc/operator->superuser/member->member (TestDocumentArchivePort_RoleMappingIsReconcilerOIDC); ReconcileRole is a real PATCH reconcile; member.SignInOwn doc updated (Paperless now SignInOIDC)." }, "summary": "document-archive (Paperless-ngx) now speaks kanidm OIDC — one community sign-in, members auto-provision, and the documentarchivesvc reconciler promotes an operator to Paperless superuser over PATCH /api/users/{id}/.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>

close-report for #1538 — status success

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

envelope
{
  "issue": 1538,
  "status": "success",
  "commits": [
    "9f5524ef9e84e334ae8bacab14157a41c93e88c4"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/offboard_catalogue_test.go",
    "internal/clan/paperless.go",
    "internal/clan/paperless_attach.go",
    "internal/clan/paperless_attach_test.go",
    "internal/clan/paperless_test.go",
    "internal/documentarchivesvc/documentarchivesvc.go",
    "internal/documentarchivesvc/documentarchivesvc_test.go",
    "internal/member/removal.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "gofmt -l (changed .go files)",
      "exit_code": 0
    },
    {
      "command": "go vet ./...",
      "exit_code": 0
    },
    {
      "command": "go test ./... (pre-push gate: nix develop .#go-ci)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Render test pins the env + the kanidm oneshot; the OIDC oneshot is idempotent on re-run (the files.go get||create shape)": "internal/clan/paperless_test.go TestRenderPaperless_OIDCStaticEnv (PAPERLESS_APPS/SOCIAL_AUTO_SIGNUP/SOCIAL_ACCOUNT_SYNC_GROUPS pinned), TestRenderPaperless_OIDCKanidmClient (document-archive-oidc oneshot: kanidm login, get||create paperless, redirect .../accounts/oidc/kanidm/login/callback/, scope-map idm_all_persons openid email profile groups, pgroups operators->admins + idm_all_persons->members, join array, show-basic-secret, atomic env write, paperless-web second EnvironmentFile + after-ordering + tmpfiles), TestRenderPaperless_OIDCOmittedWithoutIDP, TestRenderPaperless_Deterministic (OIDC variant re-renders identical bytes — the get||create shape is idempotent). internal/clan/paperless.go:renderPaperlessOIDC uses the files.go get||create guard.",
    "Operator -> superuser via the reconciler (PATCH /api/users/{id}/ is_superuser,is_staff over the admin session the health check drives)": "internal/documentarchivesvc/documentarchivesvc.go Port.ReconcileRole (mint token via POST /api/token/ as clan.PaperlessAdminUser, GET /api/users/?username=, PATCH /api/users/{id}/ {is_superuser,is_staff} only on divergence); test TestDocumentArchivePort_ReconcileRolePromotesOperatorToSuperuser (idempotent) + TestDocumentArchivePort_ReconcileRoleDemotesMember. Wired into productionServicePorts (main.go, 13 ports) — TestProductionServicePorts_FromDerivedURLs.",
    "Members: auto-signup, default group members": "internal/clan/paperless.go renders PAPERLESS_SOCIAL_AUTO_SIGNUP=true + PAPERLESS_SOCIAL_ACCOUNT_SYNC_GROUPS=true and the kanidm pgroups claim maps idm_all_persons->members (TestRenderPaperless_OIDCKanidmClient); a never-signed-in member is a truthful reconcile no-op (TestDocumentArchivePort_ReconcileRoleBeforeFirstSignInIsNoOp).",
    "The health check keeps using the API-token path, never the browser path (#1503)": "paperlesshealth.go untouched (still POST /api/token/ then Token auth); PAPERLESS_DISABLE_REGULAR_LOGIN left UNSET so the local admin + API-token path keep working (TestRenderPaperless_OIDCStaticEnv asserts it is absent).",
    "Security invariant #1167: a real-OIDC port needs no header strip but keeps its claim/scope maps on the files.go:822-946 pattern (audience idm_all_persons, admin bit keyed to ONE group via a collision-proof claim)": "Paperless speaks real OIDC (django-allauth) so no frontdoor strip added; the kanidm oneshot keys the audience to idm_all_persons and the admin bit to the ONE operators group via the collision-proof pgroups claim (pgroups operators->admins), mirroring files.go ocgroups — TestRenderPaperless_OIDCKanidmClient.",
    "Declare the port's posture and implement its ReconcileRole (#1537); the P6-S7/P4-S5 card line reads from it": "internal/documentarchivesvc RoleMapping() = reconciler-mapped/oidc/operator->superuser/member->member (TestDocumentArchivePort_RoleMappingIsReconcilerOIDC); ReconcileRole is a real PATCH reconcile; member.SignInOwn doc updated (Paperless now SignInOIDC)."
  },
  "summary": "document-archive (Paperless-ngx) now speaks kanidm OIDC — one community sign-in, members auto-provision, and the documentarchivesvc reconciler promotes an operator to Paperless superuser over PATCH /api/users/{id}/.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1538 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1538, "status": "success", "commits": [ "9f5524ef9e84e334ae8bacab14157a41c93e88c4" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/offboard_catalogue_test.go", "internal/clan/paperless.go", "internal/clan/paperless_attach.go", "internal/clan/paperless_attach_test.go", "internal/clan/paperless_test.go", "internal/documentarchivesvc/documentarchivesvc.go", "internal/documentarchivesvc/documentarchivesvc_test.go", "internal/member/removal.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "gofmt -l (changed .go files)", "exit_code": 0 }, { "command": "go vet ./...", "exit_code": 0 }, { "command": "go test ./... (pre-push gate: nix develop .#go-ci)", "exit_code": 0 } ], "criteria": { "Render test pins the env + the kanidm oneshot; the OIDC oneshot is idempotent on re-run (the files.go get||create shape)": "internal/clan/paperless_test.go TestRenderPaperless_OIDCStaticEnv (PAPERLESS_APPS/SOCIAL_AUTO_SIGNUP/SOCIAL_ACCOUNT_SYNC_GROUPS pinned), TestRenderPaperless_OIDCKanidmClient (document-archive-oidc oneshot: kanidm login, get||create paperless, redirect .../accounts/oidc/kanidm/login/callback/, scope-map idm_all_persons openid email profile groups, pgroups operators->admins + idm_all_persons->members, join array, show-basic-secret, atomic env write, paperless-web second EnvironmentFile + after-ordering + tmpfiles), TestRenderPaperless_OIDCOmittedWithoutIDP, TestRenderPaperless_Deterministic (OIDC variant re-renders identical bytes — the get||create shape is idempotent). internal/clan/paperless.go:renderPaperlessOIDC uses the files.go get||create guard.", "Operator -> superuser via the reconciler (PATCH /api/users/{id}/ is_superuser,is_staff over the admin session the health check drives)": "internal/documentarchivesvc/documentarchivesvc.go Port.ReconcileRole (mint token via POST /api/token/ as clan.PaperlessAdminUser, GET /api/users/?username=, PATCH /api/users/{id}/ {is_superuser,is_staff} only on divergence); test TestDocumentArchivePort_ReconcileRolePromotesOperatorToSuperuser (idempotent) + TestDocumentArchivePort_ReconcileRoleDemotesMember. Wired into productionServicePorts (main.go, 13 ports) — TestProductionServicePorts_FromDerivedURLs.", "Members: auto-signup, default group members": "internal/clan/paperless.go renders PAPERLESS_SOCIAL_AUTO_SIGNUP=true + PAPERLESS_SOCIAL_ACCOUNT_SYNC_GROUPS=true and the kanidm pgroups claim maps idm_all_persons->members (TestRenderPaperless_OIDCKanidmClient); a never-signed-in member is a truthful reconcile no-op (TestDocumentArchivePort_ReconcileRoleBeforeFirstSignInIsNoOp).", "The health check keeps using the API-token path, never the browser path (#1503)": "paperlesshealth.go untouched (still POST /api/token/ then Token auth); PAPERLESS_DISABLE_REGULAR_LOGIN left UNSET so the local admin + API-token path keep working (TestRenderPaperless_OIDCStaticEnv asserts it is absent).", "Security invariant #1167: a real-OIDC port needs no header strip but keeps its claim/scope maps on the files.go:822-946 pattern (audience idm_all_persons, admin bit keyed to ONE group via a collision-proof claim)": "Paperless speaks real OIDC (django-allauth) so no frontdoor strip added; the kanidm oneshot keys the audience to idm_all_persons and the admin bit to the ONE operators group via the collision-proof pgroups claim (pgroups operators->admins), mirroring files.go ocgroups — TestRenderPaperless_OIDCKanidmClient.", "Declare the port's posture and implement its ReconcileRole (#1537); the P6-S7/P4-S5 card line reads from it": "internal/documentarchivesvc RoleMapping() = reconciler-mapped/oidc/operator->superuser/member->member (TestDocumentArchivePort_RoleMappingIsReconcilerOIDC); ReconcileRole is a real PATCH reconcile; member.SignInOwn doc updated (Paperless now SignInOIDC)." }, "summary": "document-archive (Paperless-ngx) now speaks kanidm OIDC — one community sign-in, members auto-provision, and the documentarchivesvc reconciler promotes an operator to Paperless superuser over PATCH /api/users/{id}/.", "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.

Reference
Matou/idss#1538
No description provided.