## What & why S-18b, second of the S-18 (#19) split (after S-18a #139/#142). Stands up the upstream Maykin **Objecten API** in the compose stack and wires it to the Objecttypen API — the authoritative object store the ACL will write register records to (S-19). Closes #140 ### What - **Compose** (main + local): `objecten-db` (**PostGIS** — objects carry geometry), `objecten-redis`, `objecten-init` (RUN_SETUP_CONFIG → migrate + provision token + register the Objecttypen service), `objecten` web (health on `/admin/`, host `:8021`). Verbatim upstream image `maykinmedia/objects-api` pinned to `3.4.0` (nearest release to objecttypes-api `3.4.2`; the two speak over the stable Objecttypes API v2). - **Seed**: `infra/seed-config.sh objecten` streams `infra/objecten/setup_configuration/data.yaml` into the external `rr-objecten-config` volume — same pattern as S-18a. The data.yaml (1) registers **Objecttypen** as a trusted `zgw_consumers` service (`api_type: orc`, api-key auth with the S-18a dev token) so an object can reference its objecttype, and (2) provisions a dev **static API token** so peers (the ACL, S-19) can write objects. - **Wiring**: added to `WAIT_SVCS`, `CFG_VOLS`, the `SEED` invocations, `seed-config.sh`, and the CI log-dump. `objecten-init` waits on `objecttypen` being healthy so the service registration is meaningful end to end. - **Smoke**: `verify-objecten` (`infra/run-objecten-check.sh` + `objecten-check.py`) asserts unauth → 401, token → 200 on `/api/v2/objects`; added as a verify-stack step + a row in the #136 check-summary table. ## Verified locally (end to end, real compose) Seeded + brought up the real `infra/docker-compose.yml` objecten chain (pulls in objecttypen via `depends_on`): `objecten-init` ran setup_configuration — `token_configuration_success` **and** "Successfully executed step: Configuration to connect with external services" — the web reached healthy, and `make verify-objecten` → **"OK — no-auth 401, token 200"**. Confirmed the registered service via the Objecten django shell: ``` objecttypen | orc | http://objecttypen:8000/api/v2/ | api_key ``` YAML (both compose files + ci.yaml) + shell + python all validated; `docker compose config` clean on both files. ## Definition of Done - [x] Failing smoke committed first (`test(infra): …`, "no running objecten container"); implementation makes it pass. - [x] Conventional Commits referencing #140. - [ ] CI green (verify-stack objecten step). - [x] `docker compose up` reaches health (objecten healthy on first poll locally). - [x] Demo note in `docs/demo-script.md`. - [x] Closed by the merging PR (`closes #140`). No new ADR: follows the established verbatim-image + seed-config CG-module pattern (S-18a/ADR-0023-era). 🤖 Generated with [Claude Code](https://claude.com/claude-code)Reviewed-on: #143
32 lines
1.3 KiB
YAML
32 lines
1.3 KiB
YAML
# Objecten API setup_configuration (S-18b). Streamed into the external rr-objecten-config volume by
|
|
# infra/seed-config.sh and applied by objecten-init (RUN_SETUP_CONFIG). Declarative + idempotent.
|
|
#
|
|
# Two things: (1) register the Objecttypen API (S-18a) as a trusted service so an object can
|
|
# reference its objecttype — authenticating with the dev static token Objecttypen provisioned; and
|
|
# (2) a dev static token so peers (the ACL, S-19) can write objects here. Dev-only, not for prod.
|
|
|
|
# (1) Trust the Objecttypen API. `orc` = overige RESTful component (how zgw_consumers classifies the
|
|
# Objecttypen API). The RegisterRecord objecttype (S-18c) will reference an objecttype under this
|
|
# service by uuid.
|
|
zgw_consumers_config_enable: true
|
|
zgw_consumers:
|
|
services:
|
|
- identifier: objecttypen
|
|
label: Objecttypen API
|
|
api_type: orc
|
|
api_root: http://objecttypen:8000/api/v2/
|
|
auth_type: api_key
|
|
header_key: Authorization
|
|
header_value: Token 0123456789abcdef0123456789abcdef01234567
|
|
|
|
# (2) Static API token peers use to write/read objects.
|
|
tokenauth_config_enable: true
|
|
tokenauth:
|
|
items:
|
|
- identifier: register-referentie
|
|
token: 1234567890abcdef1234567890abcdef12345678
|
|
contact_person: Register Referentie
|
|
email: admin@localhost
|
|
organization: Respellion
|
|
is_superuser: true
|