archive: build the Omeka S header-auth module (IdssHeaderAuth) — JIT member sign-in from X-Idss-Identity, operator → global_admin via the reconciler, installed declaratively, strip on exempt paths (ruled by Ben on #1545) #1548

Closed
opened 2026-09-16 19:02:05 +00:00 by ben · 5 comments
Owner

Spec

#1535 — Ben's ruling (2026-09-16): one community sign-in at every door; operator = admin everywhere. Ruled on #1545 by Ben, 2026-09-16: option 1 now (own accounts + the #1532 reveal, the card says "front door only" until this lands) and build the header-auth module — Omeka S has no OIDC module and its only SSO module is SAML-only, which kanidm does not speak.

Build — an Omeka S module IdssHeaderAuth (PHP, upstream-shaped, contributed back)

The Grist/LimeSurvey shape, in Omeka's own module system (Laminas MVC; the erseco image the archive port runs, internal/clan/archive.go):

  1. Header login. On every request to the public/admin UI with no Omeka session, read the front door's verified identity header (X-Idss-Identity → HTTP_X_IDSS_IDENTITY; module setting names the header). Look the user up by a stable external id (store the person id in a module-owned table or as the user's email-shaped key <id>@idss.local — pick one and say why); JIT-create on first sight with role researcher (member default — the port declares it), then establish Omeka's session for them. No header ⇒ Omeka's own login page as today (the exempt/health paths, ADR 0074). Never read the header when the module setting is off.
  2. Role from the reconciler, not the header. Operators become global_admin; the mapping is #1537's ReconcileRole calling Omeka's REST API with the minted admin key the reconcile oneshot already writes (archive.go:119, key_identity/key_credential) — PATCH /api/users/{id} o:role. The module only ever JIT-creates at the member role; promotion is the control plane's act. (A second header for role is REJECTED: one more thing to strip, no audit.)
  3. Install declaratively. The module dir bind-mounted into the container (the Local Contexts module precedent in the omeka-reconcile oneshot) and enabled + configured by that oneshot (omeka-s-cli module:enable, settings via CLI/API), idempotent on re-run. The archive port's declaration flips to signin: header.
  4. The #1167 strip, same commit: ArchiveExemptPaths (archive.go:245) gets header_up -X-Idss-Identity in the front-door render and a frontdoor_test.go case; a forged header on an exempt path must be dropped.
  5. Upstream: the module lives in its own repo under the Matou org (MIT/GPL-compatible with Omeka S), README in Omeka's module conventions; idss pins it by commit in the render. Filing the upstream listing is a follow-up, not this ticket.

Acceptance

  • Module unit tests (PHPUnit, Omeka's module test harness) cover: no header ⇒ untouched login; header + unknown ⇒ JIT researcher + session; header + known ⇒ session, role untouched; setting off ⇒ inert.
  • Render tests pin the bind-mount, enable step, header setting, the strip, and idempotency.
  • Reconcile test: operator ⇒ global_admin via the API fake; revoke ⇒ researcher.
  • Live proof rides #1547 (operator = global admin at archive.<apex>, member = researcher, no second login).

Files

New repo Matou/omeka-s-module-idss-header-auth; internal/clan/archive.go (+ the oneshot), internal/clan/frontdoor.go + tests, the port declaration (#1537), docs/GOTCHAS.md if a hazard surfaces.

## Spec #1535 — Ben's ruling (2026-09-16): one community sign-in at every door; operator = admin everywhere. **Ruled on #1545 by Ben, 2026-09-16:** option 1 now (own accounts + the #1532 reveal, the card says "front door only" until this lands) **and build the header-auth module** — Omeka S has no OIDC module and its only SSO module is SAML-only, which kanidm does not speak. ## Build — an Omeka S module `IdssHeaderAuth` (PHP, upstream-shaped, contributed back) The Grist/LimeSurvey shape, in Omeka's own module system (Laminas MVC; the erseco image the archive port runs, `internal/clan/archive.go`): 1. **Header login.** On every request to the public/admin UI with no Omeka session, read the front door's verified identity header (`X-Idss-Identity` → `HTTP_X_IDSS_IDENTITY`; module setting names the header). Look the user up by a stable external id (store the person id in a module-owned table or as the user's email-shaped key `<id>@idss.local` — pick one and say why); **JIT-create** on first sight with role `researcher` (member default — the port declares it), then establish Omeka's session for them. No header ⇒ Omeka's own login page as today (the exempt/health paths, ADR 0074). Never read the header when the module setting is off. 2. **Role from the reconciler, not the header.** Operators become `global_admin`; the mapping is #1537's `ReconcileRole` calling Omeka's REST API with the minted admin key the reconcile oneshot already writes (`archive.go:119`, `key_identity`/`key_credential`) — `PATCH /api/users/{id}` `o:role`. The module only ever JIT-creates at the member role; promotion is the control plane's act. (A second header for role is REJECTED: one more thing to strip, no audit.) 3. **Install declaratively.** The module dir bind-mounted into the container (the Local Contexts module precedent in the `omeka-reconcile` oneshot) and enabled + configured by that oneshot (`omeka-s-cli module:enable`, settings via CLI/API), idempotent on re-run. The archive port's declaration flips to `signin: header`. 4. **The #1167 strip, same commit:** `ArchiveExemptPaths` (`archive.go:245`) gets `header_up -X-Idss-Identity` in the front-door render and a `frontdoor_test.go` case; a forged header on an exempt path must be dropped. 5. **Upstream:** the module lives in its own repo under the Matou org (MIT/GPL-compatible with Omeka S), README in Omeka's module conventions; idss pins it by commit in the render. Filing the upstream listing is a follow-up, not this ticket. ## Acceptance - Module unit tests (PHPUnit, Omeka's module test harness) cover: no header ⇒ untouched login; header + unknown ⇒ JIT `researcher` + session; header + known ⇒ session, role untouched; setting off ⇒ inert. - Render tests pin the bind-mount, enable step, header setting, the strip, and idempotency. - Reconcile test: operator ⇒ `global_admin` via the API fake; revoke ⇒ `researcher`. - Live proof rides #1547 (operator = global admin at `archive.<apex>`, member = researcher, no second login). ## Files New repo `Matou/omeka-s-module-idss-header-auth`; `internal/clan/archive.go` (+ the oneshot), `internal/clan/frontdoor.go` + tests, the port declaration (#1537), `docs/GOTCHAS.md` if a hazard surfaces.

Blocked — agent-blocked (cannot-proceed: required PHP/Omeka build+test toolchain is unavailable, and the module's own repo does not yet exist)

A Sandcastle Go-sandbox iteration claimed this ticket. Its central deliverable is a PHP Omeka S module (IdssHeaderAuth, Laminas MVC) living in a new external repo Matou/omeka-s-module-idss-header-auth, and the primary acceptance clause is PHPUnit module tests against Omeka's module test harness. None of that can be built or verified in this environment, so the slice is not implementable here:

  • No PHP toolchain in the sandbox. php, php8.x, composer, phpunit are all absent from PATH, and PHP is not in the nix develop devshell / flake. The Sandcastle image is Go/Nix-only. So the module source cannot be built, lint-checked, or its PHPUnit acceptance run — and this is a security-sensitive auth path (JIT member account creation from a trusted header, operator → global_admin) where shipping un-run, un-syntax-checked PHP and claiming verification would be dishonest. Ben's #1545 ruling already blessed the design; the block is purely the toolchain, not the decision.
  • The module's repo does not exist yet. GET /api/v1/repos/Matou/omeka-s-module-idss-header-auth → 404. The idss render is meant to bind-mount the module dir and pin it by commit (internal/clan/archive.go + the omeka-reconcile oneshot). There is no commit to pin, and repo creation + first push under the Matou org is not a Go-sandbox act.
  • The archive port ships no member-orbit reconciler today, by design. whole_composition.go:275 records "Archive ships no member-orbit reconciler (a community archive carries no per-member lifecycle state)". The reconcile leg (operator ⇒ global_admin via a new archive ReconcileRole calling Omeka REST PATCH /api/users/{id} o:role, plus its contract test and wiring into servicePorts + the #1537 roles reconciler) is a new control-plane subsystem, not a small edit — and it depends on the module existing.

What is already in place (so the human can scope the split)

  • The #1167 front-door strip already covers /api/* generically. frontdoor.go renderRoute strips X-Idss-Identity on every service's exempt handle (renderProxy(..., stripIdentity=true), frontdoor.go:531), and ArchiveExemptPaths = ["/api/*"] already exists (archive.go:245). So item 4's strip is present; only a dedicated frontdoor_test.go archive case would be additive.

What a human must do to re-arm

  1. Create/scaffold Matou/omeka-s-module-idss-header-auth (the PHP module + PHPUnit), OR provide a Sandcastle lane with a PHP/composer/phpunit + Omeka module-test environment so an agent can build and run its acceptance.
  2. Then split this ticket: keep the PHP module (+ PHPUnit + upstream) in its own repo/CI, and carve the idss-repo integration legs — archive render bind-mount/enable/header-setting, the signin: header port flip, the archive ReconcileRole port + its contract test + composition wiring, and a frontdoor_test.go archive-strip case — into a dependent idss ticket (depends_on the module repo's first pinned commit), which a Go-sandbox agent can complete and prove.
  3. Re-add ready-for-agent to whichever piece is implementable in this lane.

No code was changed this run.

## Blocked — `agent-blocked` (cannot-proceed: required PHP/Omeka build+test toolchain is unavailable, and the module's own repo does not yet exist) A Sandcastle Go-sandbox iteration claimed this ticket. Its **central deliverable is a PHP Omeka S module** (`IdssHeaderAuth`, Laminas MVC) living in a **new external repo `Matou/omeka-s-module-idss-header-auth`**, and the **primary acceptance clause is PHPUnit module tests** against Omeka's module test harness. None of that can be built or verified in this environment, so the slice is not implementable here: - **No PHP toolchain in the sandbox.** `php`, `php8.x`, `composer`, `phpunit` are all absent from `PATH`, and PHP is not in the `nix develop` devshell / flake. The Sandcastle image is Go/Nix-only. So the module source cannot be built, lint-checked, or its PHPUnit acceptance run — and this is a security-sensitive auth path (JIT member account creation from a trusted header, operator → `global_admin`) where shipping un-run, un-syntax-checked PHP and *claiming* verification would be dishonest. Ben's #1545 ruling already blessed the *design*; the block is purely the toolchain, not the decision. - **The module's repo does not exist yet.** `GET /api/v1/repos/Matou/omeka-s-module-idss-header-auth` → **404**. The idss render is meant to bind-mount the module dir and pin it **by commit** (`internal/clan/archive.go` + the `omeka-reconcile` oneshot). There is no commit to pin, and repo creation + first push under the Matou org is not a Go-sandbox act. - **The archive port ships no member-orbit reconciler today, by design.** `whole_composition.go:275` records "Archive ships no member-orbit reconciler (a community archive carries no per-member lifecycle state)". The reconcile leg (operator ⇒ `global_admin` via a new archive `ReconcileRole` calling Omeka REST `PATCH /api/users/{id}` `o:role`, plus its contract test and wiring into `servicePorts` + the #1537 roles reconciler) is a new control-plane subsystem, not a small edit — and it depends on the module existing. ### What is already in place (so the human can scope the split) - **The #1167 front-door strip already covers `/api/*` generically.** `frontdoor.go` `renderRoute` strips `X-Idss-Identity` on every service's exempt handle (`renderProxy(..., stripIdentity=true)`, frontdoor.go:531), and `ArchiveExemptPaths = ["/api/*"]` already exists (archive.go:245). So item 4's strip is present; only a dedicated `frontdoor_test.go` archive case would be additive. ### What a human must do to re-arm 1. Create/scaffold **`Matou/omeka-s-module-idss-header-auth`** (the PHP module + PHPUnit), OR provide a Sandcastle lane with a PHP/composer/phpunit + Omeka module-test environment so an agent can build and run its acceptance. 2. Then **split this ticket**: keep the PHP module (+ PHPUnit + upstream) in its own repo/CI, and carve the idss-repo integration legs — archive render bind-mount/enable/header-setting, the `signin: header` port flip, the archive `ReconcileRole` port + its contract test + composition wiring, and a `frontdoor_test.go` archive-strip case — into a **dependent idss ticket** (`depends_on` the module repo's first pinned commit), which a Go-sandbox agent *can* complete and prove. 3. Re-add `ready-for-agent` to whichever piece is implementable in this lane. No code was changed this run.
Author
Owner

Acknowledged — this is a human-input item now (Ben): the sandbox has no PHP/composer/PHPUnit lane and Matou/omeka-s-module-idss-header-auth does not exist. Two ways to re-arm, Ben's call: (a) create the module repo + a PHP lane so a worker can build and prove it, or (b) hand the module to a session on a machine with nix shell nixpkgs#php83 nixpkgs#php83Packages.composer. Per the #1545 ruling ("option 1 now"), the full proof drive #1547 no longer blocks on this ticket — it asserts Omeka's own posture (the front-door-only card line) until the module lands, and a later fire proves the module. Dependency removed 2026-09-16.

Acknowledged — this is a **human-input** item now (Ben): the sandbox has no PHP/composer/PHPUnit lane and `Matou/omeka-s-module-idss-header-auth` does not exist. Two ways to re-arm, Ben's call: (a) create the module repo + a PHP lane so a worker can build and prove it, or (b) hand the module to a session on a machine with `nix shell nixpkgs#php83 nixpkgs#php83Packages.composer`. Per the #1545 ruling ("option 1 **now**"), the full proof drive **#1547 no longer blocks on this ticket** — it asserts Omeka's `own` posture (the front-door-only card line) until the module lands, and a later fire proves the module. Dependency removed 2026-09-16.
Author
Owner

Built in session (Ben's go, 2026-09-27) — main 4e7c9a4e, ADR 0285, live on whakatohea-demo

  • Where the module lives: internal/clan/omeka/IdssHeaderAuth in this repo, embedded in the render, baked into the Nix store and mounted read-only. There is no separate repo (ADR 0285 §1); offering it upstream is a follow-up.
  • Account key: m-<sha256(identity)[:24]>@<archive host> (the ADR 0283 form). New accounts are researcher. Stewards are global_admin, applied at deploy: a new archivesvc port is AppliesAtDeploy, like surveys, and a former steward steps down to researcher.
  • Scope: the module is on only on the public path. Private-path routes are ungated, so a header there vouches for nothing.
  • Tests: plain-PHP tests of the module's logic run in the clan Go tests when php is on PATH (nix shell nixpkgs#php83); render, attach and port tests always run.
  • Live proof against the pinned image, direct to the container:
    • steward → global admin, reaches Settings and user edit;
    • member → researcher, refused Settings;
    • a second person in the same browser gets their own account;
    • no header → Omeka's own login.

Still owed: the browser proof through the real front door. Ben opens archive.<apex> → admin with no second login. This stays open for that.

## Built in session (Ben's go, 2026-09-27) — main 4e7c9a4e, ADR 0285, live on whakatohea-demo - **Where the module lives:** `internal/clan/omeka/IdssHeaderAuth` in this repo, embedded in the render, baked into the Nix store and mounted read-only. There is no separate repo (ADR 0285 §1); offering it upstream is a follow-up. - **Account key:** `m-<sha256(identity)[:24]>@<archive host>` (the ADR 0283 form). New accounts are **researcher**. Stewards are **global_admin**, applied at deploy: a new `archivesvc` port is AppliesAtDeploy, like surveys, and a former steward steps down to researcher. - **Scope:** the module is on only on the public path. Private-path routes are ungated, so a header there vouches for nothing. - **Tests:** plain-PHP tests of the module's logic run in the clan Go tests when `php` is on PATH (`nix shell nixpkgs#php83`); render, attach and port tests always run. - **Live proof against the pinned image, direct to the container:** - steward → global admin, reaches Settings and user edit; - member → researcher, refused Settings; - a second person in the same browser gets their own account; - no header → Omeka's own login. **Still owed:** the browser proof through the real front door. Ben opens `archive.<apex>` → admin with no second login. This stays open for that.

This was generated by AI during triage.

Triage: enhancement + ready-for-human

The build is done and verified in code; only a human-eyes acceptance item is left, so this is ready-for-human, not ready-for-agent.

Established (grounded against the repo):

  • The IdssHeaderAuth module landed on main at 4e7c9a4e (ADR 0285), living in-repo at internal/clan/omeka/IdssHeaderAuth, embedded in the render and mounted read-only — no separate Matou/omeka-s-module-idss-header-auth repo (ADR 0285 §1 supersedes the original ticket's external-repo plan; upstreaming is a follow-up).
  • Account key is the ADR 0283 form m-<sha256(identity)[:24]>@<archive host>; JIT accounts are researcher, stewards are global_admin applied at deploy via a new archivesvc AppliesAtDeploy port; the module is public-path only (private path is ungated so a header there vouches for nothing).
  • Automated acceptance is in place: plain-PHP module-logic tests run in the clan Go tests when php is on PATH; render/attach/port tests always run; live proof was taken direct to the container on whakatohea-demo (steward → global_admin reaches Settings/user-edit; member → researcher refused Settings; a second person in the same browser gets their own account; no header → Omeka's own login).

What still blocks close (Ben's own note, 2026-09-27): the browser proof through the real front door — Ben opens archive.<apex> and lands in admin with no second login.

Why human

Ben's eyes on a live trust surface. The only outstanding acceptance clause is a manual, first-person browser observation of an authentication/SSO trust surface (identity-header → JIT member sign-in, steward → global_admin) through the live front door on whakatohea-demo. It is not covered by any existing test, drive, or probe — Ben explicitly reserved it as a hands-and-eyes check — so ADR 0174's two-way-door path does not apply (nothing existing proves it). Ben himself claimed it in the 2026-09-16 and 2026-09-27 comments. Residue: one live front-door browser sign-in that a person must watch succeed.

> *This was generated by AI during triage.* ## Triage: `enhancement` + `ready-for-human` The build is done and verified in code; only a human-eyes acceptance item is left, so this is `ready-for-human`, not `ready-for-agent`. **Established (grounded against the repo):** - The `IdssHeaderAuth` module landed on `main` at `4e7c9a4e` (ADR 0285), living in-repo at `internal/clan/omeka/IdssHeaderAuth`, embedded in the render and mounted read-only — no separate `Matou/omeka-s-module-idss-header-auth` repo (ADR 0285 §1 supersedes the original ticket's external-repo plan; upstreaming is a follow-up). - Account key is the ADR 0283 form `m-<sha256(identity)[:24]>@<archive host>`; JIT accounts are `researcher`, stewards are `global_admin` applied at deploy via a new `archivesvc` AppliesAtDeploy port; the module is public-path only (private path is ungated so a header there vouches for nothing). - Automated acceptance is in place: plain-PHP module-logic tests run in the clan Go tests when `php` is on PATH; render/attach/port tests always run; live proof was taken **direct to the container** on whakatohea-demo (steward → global_admin reaches Settings/user-edit; member → researcher refused Settings; a second person in the same browser gets their own account; no header → Omeka's own login). **What still blocks close (Ben's own note, 2026-09-27):** the browser proof **through the real front door** — Ben opens `archive.<apex>` and lands in admin with **no second login**. ## Why human **Ben's eyes on a live trust surface.** The only outstanding acceptance clause is a manual, first-person browser observation of an authentication/SSO trust surface (identity-header → JIT member sign-in, steward → `global_admin`) through the live front door on whakatohea-demo. It is not covered by any existing test, drive, or probe — Ben explicitly reserved it as a hands-and-eyes check — so ADR 0174's two-way-door path does not apply (nothing existing proves it). Ben himself claimed it in the 2026-09-16 and 2026-09-27 comments. Residue: one live front-door browser sign-in that a person must watch succeed.
Author
Owner

Live proof — done (Ben, 2026-09-27)

Ben opened the Community archive on whakatohea-demo, went to the admin dashboard, and landed signed in with no second login, through the real front door on an IDIP community. The account is keyed on his AID, with the global_admin role. Closing.

Follow-ups:

  • the header-forgery hazard, #1941 (ready-for-human);
  • display names instead of the raw AID as the account name (spec #1915 family).
## Live proof — done (Ben, 2026-09-27) Ben opened the Community archive on whakatohea-demo, went to the admin dashboard, and landed signed in with no second login, through the real front door on an IDIP community. The account is keyed on his AID, with the global_admin role. Closing. Follow-ups: - the header-forgery hazard, #1941 (ready-for-human); - display names instead of the raw AID as the account name (spec #1915 family).
ben closed this issue 2026-09-27 23:39:51 +00:00
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#1548
No description provided.