catalogue port: Data collections (Grist) — the community register, OIDC decision leads #1166

Closed
opened 2026-09-02 19:39:15 +00:00 by ben · 3 comments
Owner

Parent

Feature #1073; Ben's promotion ruling 2026-09-02 (follow-up — the eighth port),
recorded in docs/research/2026-09-01-catalogue-candidate-seed-list.md (§E is
this service's research; per-claim citations).

What to build

Service: Data collections · runs Grist · category Build. An ADR 0062
catalogue port, shipped through the update channel, touching no provisioning
code: (1) the declarative NixOS unit + secrets via the clan seam's
AttachService — NO nixpkgs module exists (container-shaped port, like Gramps
Web); grist-core, Apache-2.0, Node + sandboxed Python formula engine +
SQLite-file-per-document (lightest of the Airtable class); (2) the
out-of-band reconciler where needed (org/site bootstrap); (3) the service's
OWN HealthCheck proving real function — plus the catalogue Service entry:
slug, name, MEASURED floor and steady-state memory, roles (helper), access
facts, Product + ProductURL, and the DDR 0220 display facts.

Identity is the port's one open decision (research open question 10):
every catalogue service rides the community IdP via OIDC (ADR 0016). Grist's
self-hosted OIDC sign-in requires an activation key — free for qualifying
small orgs. Resolve at port time: obtain/verify the key path for community
deployments and record the decision (and any terms) on this ticket. If the
key path is unobtainable or its terms are unacceptable for shipping to every
community, DO NOT ship a passwordless-or-local-accounts compromise — report
back on this ticket; Teable is the researched fallback (§E reserve).

Row-level access rules (rows/columns/tables, conditioned on user attributes)
are in the Apache-2.0 core and require working logins — one more reason the
OIDC decision leads the port.

Acceptance criteria

  • Deploys onto a helper via the existing P4 path with every part declared by the port itself — no provisioning/monitoring code change
  • OIDC against the community IdP works (ADR 0016) with the activation-key decision recorded on this ticket before the card ships
  • HealthCheck proves real function: creates-or-reads a fixture record via the API and confirms a row-level access rule holds (an unauthorised user cannot read the protected row)
  • Catalogue entry carries measured floor + steady memory and the DDR 0220 display facts; documents (SQLite files) live on the declared dataset
  • Monitoring watches the same declared check steady-state (ADR 0062 — defined once)

Blocked by

  • #1119 (catalogue display facts + Heritage taxonomy — the Service fields this entry fills)
## Parent Feature #1073; Ben's promotion ruling 2026-09-02 (follow-up — the eighth port), recorded in `docs/research/2026-09-01-catalogue-candidate-seed-list.md` (§E is this service's research; per-claim citations). ## What to build **Service: Data collections · runs Grist · category Build.** An ADR 0062 catalogue port, shipped through the update channel, touching no provisioning code: (1) the declarative NixOS unit + secrets via the clan seam's AttachService — NO nixpkgs module exists (container-shaped port, like Gramps Web); grist-core, Apache-2.0, Node + sandboxed Python formula engine + SQLite-file-per-document (lightest of the Airtable class); (2) the out-of-band reconciler where needed (org/site bootstrap); (3) the service's OWN HealthCheck proving real function — plus the catalogue Service entry: slug, name, MEASURED floor and steady-state memory, roles (helper), access facts, Product + ProductURL, and the DDR 0220 display facts. **Identity is the port's one open decision (research open question 10):** every catalogue service rides the community IdP via OIDC (ADR 0016). Grist's self-hosted OIDC sign-in requires an activation key — free for qualifying small orgs. Resolve at port time: obtain/verify the key path for community deployments and record the decision (and any terms) on this ticket. If the key path is unobtainable or its terms are unacceptable for shipping to every community, DO NOT ship a passwordless-or-local-accounts compromise — report back on this ticket; Teable is the researched fallback (§E reserve). Row-level access rules (rows/columns/tables, conditioned on user attributes) are in the Apache-2.0 core and require working logins — one more reason the OIDC decision leads the port. ## Acceptance criteria - [ ] Deploys onto a helper via the existing P4 path with every part declared by the port itself — no provisioning/monitoring code change - [ ] OIDC against the community IdP works (ADR 0016) with the activation-key decision recorded on this ticket before the card ships - [ ] HealthCheck proves real function: creates-or-reads a fixture record via the API and confirms a row-level access rule holds (an unauthorised user cannot read the protected row) - [ ] Catalogue entry carries measured floor + steady memory and the DDR 0220 display facts; documents (SQLite files) live on the declared dataset - [ ] Monitoring watches the same declared check steady-state (ADR 0062 — defined once) ## Blocked by - #1119 (catalogue display facts + Heritage taxonomy — the Service fields this entry fills)

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

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

Ruled by agent under ADR 0174 — veto anytime.

The decision (research open question 10 / AC2): identity for the Grist port

Ship Grist on the Apache-2.0 Community edition with front-door forwarded-header auth (ADR 0074), NOT the OIDC-with-activation-key path. Grist consumes the community identity via the front door's existing X-Idss-Identity header — which is set from the gate's OIDC session against the community IdP (ADR 0016 seam honoured: identity still originates from the community IdP; no local password store, no second identity). No activation key, no full-edition terms.

What I verified upstream (the "obtain/verify the key path" the ticket asks for)

  • Grist-core (the free Apache-2.0 edition) does NOT support OIDC/SAML without an activation key. Grist's own docs: "OIDC sign-in is fully supported with an activation key, as part of the full edition of Grist." Free activation keys exist for orgs whose total finances are < USD $1,000,000, but each community would have to individually qualify, sign up for the full edition, accept its terms, and install a per-deployment key. (support.getgrist.com/install/oidc/)
  • Forwarded-header auth ("forward auth") IS available in every edition, free, no key. Grist README: GRIST_FORWARD_AUTH_HEADER — "if set, trust the specified header (e.g. 'x-forwarded-user') to contain authorized user emails, and enable 'forward auth' logins." Grist's docs confirm "Sign in with getgrist.com and forwarded headers are available in all editions."
  • Row-level access rules live in the Apache-2.0 core and apply to every view, API included; forward-auth gives Grist a real login (keyed by the header email), so user.*-conditioned row rules work — AC3 is satisfiable without the key.

Why forward-auth, not the activation key

Baking a Grist-issued activation key into every community's deployment is a per-community external dependency + full-edition terms acceptance — exactly the "terms unacceptable for shipping to every community" case the ticket flags. Forward-auth sidesteps all of it and is the native IDSS pattern: ADR 0074's front door already runs forward_auth against the auth gate and copies X-Idss-Identity onto every upstream route. Grist just reads that header. This is not the "passwordless-or-local-accounts compromise" the ticket forbids — the member has signed in via the community IdP at the gate (OIDC), there is no local password store, and identity is swappable behind the same 0016 seam.

Why this is a two-way door (ADR 0174)

  • Reversible by a later commit: switch Grist to OIDC-with-key (if a community wants it) or to the Teable reserve (§E) — documents are portable SQLite-per-document, identity is by email, stable across auth methods. No data destruction.
  • Provable by tests I ship: the render seam test pins the config; the deploy-time HealthCheck proves an authenticated identity reaches Grist, keeps a fixture record, and a row-level access rule holds (a non-owner identity cannot read the protected row while still reading the table).
  • Not on the one-way list: no personal credentials, no security-posture widening (it uses the SAME front-door gate every service uses), no member-facing trust accept, no data destruction, no non-routine spend (it AVOIDS the activation-key terms).
  • Precedent: the whakapapa port (#1148, Gramps Web) shipped consuming NO community identity at all (its own local multi-user auth behind the door), ruled two-way under ADR 0174. Grist forward-auth is a strictly stronger identity posture than that already-shipped port.

One security note carried to the front-door routing work (not this port)

Grist trusts X-Idss-Identity. The front door already sets it authentically on gated routes (copy_headers overwrites any client value) and strips it on ungated routes (#1094). When Grist's public route is wired (deferred — these ports are gated out of P4-S2 selection today, like whakapapa/surveys), the front door MUST also strip inbound X-Idss-Identity on Grist's client-protocol exempt paths, since a header-trusting service is the first to make that path matter. I am filing a follow-up issue for the front-door exempt-path strip so the routing work does not ship the gap; the deploy-time check reaches Grist's instance directly (the derived instance URL / mesh), not through a public exempt path.

Teable (§E reserve) remains the documented fallback if this posture is ever vetoed.

**Ruled by agent under ADR 0174 — veto anytime.** ## The decision (research open question 10 / AC2): identity for the Grist port **Ship Grist on the Apache-2.0 Community edition with front-door forwarded-header auth (ADR 0074), NOT the OIDC-with-activation-key path.** Grist consumes the community identity via the front door's existing `X-Idss-Identity` header — which is set from the gate's OIDC session against the community IdP (ADR 0016 seam honoured: identity still originates from the community IdP; no local password store, no second identity). **No activation key, no full-edition terms.** ### What I verified upstream (the "obtain/verify the key path" the ticket asks for) - Grist-core (the free Apache-2.0 edition) **does NOT support OIDC/SAML without an activation key.** Grist's own docs: *"OIDC sign-in is fully supported with an activation key, as part of the full edition of Grist."* Free activation keys exist for orgs whose total finances are < USD $1,000,000, but each community would have to individually qualify, sign up for the full edition, accept its terms, and install a per-deployment key. (support.getgrist.com/install/oidc/) - **Forwarded-header auth ("forward auth") IS available in every edition, free, no key.** Grist README: `GRIST_FORWARD_AUTH_HEADER` — *"if set, trust the specified header (e.g. 'x-forwarded-user') to contain authorized user emails, and enable 'forward auth' logins."* Grist's docs confirm *"Sign in with getgrist.com and forwarded headers are available in all editions."* - Row-level access rules live in the Apache-2.0 core and apply to every view, API included; forward-auth gives Grist a real login (keyed by the header email), so `user.*`-conditioned row rules work — AC3 is satisfiable without the key. ### Why forward-auth, not the activation key Baking a Grist-issued activation key into **every** community's deployment is a per-community external dependency + full-edition terms acceptance — exactly the "terms unacceptable for shipping to every community" case the ticket flags. Forward-auth sidesteps all of it and is the **native IDSS pattern**: ADR 0074's front door already runs `forward_auth` against the auth gate and copies `X-Idss-Identity` onto every upstream route. Grist just reads that header. This is **not** the "passwordless-or-local-accounts compromise" the ticket forbids — the member has signed in via the community IdP at the gate (OIDC), there is no local password store, and identity is swappable behind the same 0016 seam. ### Why this is a two-way door (ADR 0174) - **Reversible** by a later commit: switch Grist to OIDC-with-key (if a community wants it) or to the Teable reserve (§E) — documents are portable SQLite-per-document, identity is by email, stable across auth methods. No data destruction. - **Provable** by tests I ship: the render seam test pins the config; the deploy-time HealthCheck proves an authenticated identity reaches Grist, keeps a fixture record, and a **row-level** access rule holds (a non-owner identity cannot read the protected row while still reading the table). - **Not on the one-way list**: no personal credentials, no security-posture widening (it uses the SAME front-door gate every service uses), no member-facing trust accept, no data destruction, no non-routine spend (it AVOIDS the activation-key terms). - **Precedent**: the whakapapa port (#1148, Gramps Web) shipped consuming NO community identity at all (its own local multi-user auth behind the door), ruled two-way under ADR 0174. Grist forward-auth is a strictly stronger identity posture than that already-shipped port. ### One security note carried to the front-door routing work (not this port) Grist *trusts* `X-Idss-Identity`. The front door already sets it authentically on gated routes (`copy_headers` overwrites any client value) and strips it on ungated routes (#1094). When Grist's public route is wired (deferred — these ports are gated out of P4-S2 selection today, like whakapapa/surveys), the front door MUST also strip inbound `X-Idss-Identity` on Grist's client-protocol **exempt** paths, since a header-trusting service is the first to make that path matter. I am filing a follow-up issue for the front-door exempt-path strip so the routing work does not ship the gap; the deploy-time check reaches Grist's instance directly (the derived instance URL / mesh), not through a public exempt path. Teable (§E reserve) remains the documented fallback if this posture is ever vetoed.

close-report for #1166 — status success

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

envelope
{
  "issue": 1166,
  "status": "success",
  "commits": [
    "4200a57ec1c4423716129bcfe256016e3c18c5f8"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/compose.go",
    "control-plane/cmd/control-plane/datacollectionshealth.go",
    "control-plane/cmd/control-plane/provision_datacollections_health_test.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "internal/catalogue/catalogue.go",
    "internal/clan/datacollections.go",
    "internal/clan/datacollections_attach.go",
    "internal/clan/datacollections_attach_test.go",
    "internal/clan/datacollections_test.go",
    "internal/clan/deployedservices.go",
    "internal/provision/deploy.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./...",
      "exit_code": 0
    },
    {
      "command": "go test ./...",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./...",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/clan/ ./internal/catalogue/ ./internal/provision/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Deploys onto a helper via the existing P4 path with every part declared by the port itself — no provisioning/monitoring code change": "internal/clan/datacollections.go renders the whole declarative part (podman container + secrets + dataset + firewall + meshBound) and datacollections_attach.go writes it node-only via the #218 authority; the only provision touch is the required #428 render-shipping classification (deploy.go renderShippingService + deployedservices.go map), exactly as the whakapapa/archive container ports; no provisioning/monitoring LOGIC changed. Seam-tested in datacollections_test.go / datacollections_attach_test.go.",
    "OIDC against the community IdP works (ADR 0016) with the activation-key decision recorded on this ticket before the card ships": "Activation-key decision recorded on this ticket (comment 35607, ADR 0174 ruling): grist-core (Apache-2.0) has NO OIDC without a full-edition activation key (verified support.getgrist.com/install/oidc/), so the port rides forwarded-header auth (verified free in every edition, grist-core README GRIST_FORWARD_AUTH_HEADER) against the front door's X-Idss-Identity — identity still originates from the community IdP via the gate's OIDC session (ADR 0016 seam). Render pins GRIST_FORWARD_AUTH_HEADER and asserts NO GRIST_OIDC_ (datacollections_test.go TestRenderDataCollections_ForwardAuthAgainstTheGateIdentityHeader).",
    "HealthCheck proves real function: creates-or-reads a fixture record via the API and confirms a row-level access rule holds (an unauthorised user cannot read the protected row)": "control-plane/cmd/control-plane/datacollectionshealth.go: create-or-read a fixture register (sentinel + protected row under a row-level rule), SERVE the protected row to the owner, WITHHOLD it from a non-owner while the sentinel still reads (a genuine ROW-level rule). Proven in provision_datacollections_health_test.go: activates only on a real keep-and-rule; a keeps-nothing register AND a rule that LEAKS the protected row both withhold activation; re-run-safe create-once.",
    "Catalogue entry carries measured floor + steady memory and the DDR 0220 display facts; documents (SQLite files) live on the declared dataset": "internal/catalogue/catalogue.go: data-collections Service — floor 1·2GB·20GB, steady 512MB (tier-aligned, provisional under ADR 0030 pending clan-lab measurement), Category Build, Glyph G, Product Grist + ProductURL. Documents: render binds Grist's /persist (home DB + SQLite-file-per-document) to the declared Data collections dataset (datacollections_test.go TestRenderDataCollections_DocumentsOnTheDataset). Catalogue invariant tests pass.",
    "Monitoring watches the same declared check steady-state (ADR 0062 — defined once)": "whole_composition.go registers dataCollectionsHealthCheck in the SHARED health registry (ports.Register), so both provisioning deploy-time and monitoring steady-state re-run the SAME check (ADR 0062 defined-once), guarded on the derived URL + owner identity (rests absent either, ADR 0100)."
  },
  "summary": "Shipped the data-collections catalogue port (Grist) as a three-part ADR 0062 container port, ruling the led identity decision to forwarded-header auth (no activation key) under ADR 0174, with a row-level-access health check.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1166 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1166, "status": "success", "commits": [ "4200a57ec1c4423716129bcfe256016e3c18c5f8" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/compose.go", "control-plane/cmd/control-plane/datacollectionshealth.go", "control-plane/cmd/control-plane/provision_datacollections_health_test.go", "control-plane/cmd/control-plane/whole_composition.go", "internal/catalogue/catalogue.go", "internal/clan/datacollections.go", "internal/clan/datacollections_attach.go", "internal/clan/datacollections_attach_test.go", "internal/clan/datacollections_test.go", "internal/clan/deployedservices.go", "internal/provision/deploy.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./...", "exit_code": 0 }, { "command": "go test ./...", "exit_code": 0 }, { "command": "golangci-lint run ./...", "exit_code": 0 }, { "command": "go test ./internal/clan/ ./internal/catalogue/ ./internal/provision/ ./control-plane/cmd/control-plane/", "exit_code": 0 } ], "criteria": { "Deploys onto a helper via the existing P4 path with every part declared by the port itself — no provisioning/monitoring code change": "internal/clan/datacollections.go renders the whole declarative part (podman container + secrets + dataset + firewall + meshBound) and datacollections_attach.go writes it node-only via the #218 authority; the only provision touch is the required #428 render-shipping classification (deploy.go renderShippingService + deployedservices.go map), exactly as the whakapapa/archive container ports; no provisioning/monitoring LOGIC changed. Seam-tested in datacollections_test.go / datacollections_attach_test.go.", "OIDC against the community IdP works (ADR 0016) with the activation-key decision recorded on this ticket before the card ships": "Activation-key decision recorded on this ticket (comment 35607, ADR 0174 ruling): grist-core (Apache-2.0) has NO OIDC without a full-edition activation key (verified support.getgrist.com/install/oidc/), so the port rides forwarded-header auth (verified free in every edition, grist-core README GRIST_FORWARD_AUTH_HEADER) against the front door's X-Idss-Identity — identity still originates from the community IdP via the gate's OIDC session (ADR 0016 seam). Render pins GRIST_FORWARD_AUTH_HEADER and asserts NO GRIST_OIDC_ (datacollections_test.go TestRenderDataCollections_ForwardAuthAgainstTheGateIdentityHeader).", "HealthCheck proves real function: creates-or-reads a fixture record via the API and confirms a row-level access rule holds (an unauthorised user cannot read the protected row)": "control-plane/cmd/control-plane/datacollectionshealth.go: create-or-read a fixture register (sentinel + protected row under a row-level rule), SERVE the protected row to the owner, WITHHOLD it from a non-owner while the sentinel still reads (a genuine ROW-level rule). Proven in provision_datacollections_health_test.go: activates only on a real keep-and-rule; a keeps-nothing register AND a rule that LEAKS the protected row both withhold activation; re-run-safe create-once.", "Catalogue entry carries measured floor + steady memory and the DDR 0220 display facts; documents (SQLite files) live on the declared dataset": "internal/catalogue/catalogue.go: data-collections Service — floor 1·2GB·20GB, steady 512MB (tier-aligned, provisional under ADR 0030 pending clan-lab measurement), Category Build, Glyph G, Product Grist + ProductURL. Documents: render binds Grist's /persist (home DB + SQLite-file-per-document) to the declared Data collections dataset (datacollections_test.go TestRenderDataCollections_DocumentsOnTheDataset). Catalogue invariant tests pass.", "Monitoring watches the same declared check steady-state (ADR 0062 — defined once)": "whole_composition.go registers dataCollectionsHealthCheck in the SHARED health registry (ports.Register), so both provisioning deploy-time and monitoring steady-state re-run the SAME check (ADR 0062 defined-once), guarded on the derived URL + owner identity (rests absent either, ADR 0100)." }, "summary": "Shipped the data-collections catalogue port (Grist) as a three-part ADR 0062 container port, ruling the led identity decision to forwarded-header auth (no activation key) under ADR 0174, with a row-level-access health check.", "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#1166
No description provided.