feat: een RegelHet noemt in spec.fsc4b.origins de browserapps die FSC voor Burgers mogen aanroepen #47

Merged
tim.jager merged 1 commit from feat/plugin-fsc4b-origins into main 2026-11-24 21:45:32 +00:00
Owner

Adds spec.fsc4b.origins to the RegelHet CRD. The plugin passes it to the chart value fsc4b.origins (REGELHET_FSC4B_ORIGINS, added in #39), so a browser app such as the citizen's app (#42) can call a RegelHet's FSC voor Burgers routes from its own address. Before this, the only way was a manual patch of the HelmRelease, which the plugin reverts.

apiVersion: regelhet.regelrecht.nl/v1alpha1
kind: RegelHet
metadata: { name: fsc4bproef }
spec:
  hostname: fsc4bproef
  manifest: { repoUrl: https://code.digitaledienst.overheid.nl/regelrecht/fieldlab-2026.git, path: packages/regelhet/bron.yaml }
  fsc4b:
    enabled: true
    origins:
      - https://burgerapp.cluster-a.fieldlab2026.nl

What changes

  • CRD (api/v1alpha1, regenerated crds/regelhet.regelrecht.nl_regelhets.yaml): fsc4b.origins: [string], at most 20. Each entry matches https://host[:port], or http://localhost[:port] / http://127.0.0.1[:port] for an app on a developer's machine. No path, no trailing slash, no wildcard. A CEL rule refuses origins without fsc4b.enabled. FSC voor Burgers is test mode only already, so origins are too.
  • Plugin (resources.go): validateSpec applies the same checks for objects that did not come through the API server. chartValues sets fsc4b: {enabled: true, origins: [...]} when origins are given and leaves the value out otherwise.
  • Wizard (Toegang step, under FSC voor Burgers): a field "Apps in de browser" that appears when FSC voor Burgers is checked. It takes comma-separated origins, checks them the same way, and shows them in the summary and on the detail page.
  • README: a row for fsc4b.origins in the spec table.

The plugin version stays v0.7.0, as on main.

Unrelated to this change: the committed crds/regelhet.regelrecht.nl_organisaties.yaml is out of date with the doc comments in api/v1alpha1 on main ("regelhets" vs "RegelHet instances"). I left that file out of this PR.

Tests

  • go test ./...: origins reach the chart values and the HelmRelease; they are refused without fsc4b.enabled; invalid origins are refused (http elsewhere, a path, a trailing slash, *, empty) and valid ones accepted (a port, localhost, 127.0.0.1).
  • node --test console-test/*.test.js: the wizard puts origins in the spec only with FSC voor Burgers on, splits the input on commas and whitespace, and checks it as the CRD does.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XDZRnqjJJ2izeL3kP33bnv

Adds `spec.fsc4b.origins` to the RegelHet CRD. The plugin passes it to the chart value `fsc4b.origins` (`REGELHET_FSC4B_ORIGINS`, added in #39), so a browser app such as the citizen's app (#42) can call a RegelHet's FSC voor Burgers routes from its own address. Before this, the only way was a manual patch of the HelmRelease, which the plugin reverts. ```yaml apiVersion: regelhet.regelrecht.nl/v1alpha1 kind: RegelHet metadata: { name: fsc4bproef } spec: hostname: fsc4bproef manifest: { repoUrl: https://code.digitaledienst.overheid.nl/regelrecht/fieldlab-2026.git, path: packages/regelhet/bron.yaml } fsc4b: enabled: true origins: - https://burgerapp.cluster-a.fieldlab2026.nl ``` ## What changes - **CRD** (`api/v1alpha1`, regenerated `crds/regelhet.regelrecht.nl_regelhets.yaml`): `fsc4b.origins: [string]`, at most 20. Each entry matches `https://host[:port]`, or `http://localhost[:port]` / `http://127.0.0.1[:port]` for an app on a developer's machine. No path, no trailing slash, no wildcard. A CEL rule refuses origins without `fsc4b.enabled`. FSC voor Burgers is test mode only already, so origins are too. - **Plugin** (`resources.go`): `validateSpec` applies the same checks for objects that did not come through the API server. `chartValues` sets `fsc4b: {enabled: true, origins: [...]}` when origins are given and leaves the value out otherwise. - **Wizard** (Toegang step, under FSC voor Burgers): a field "Apps in de browser" that appears when FSC voor Burgers is checked. It takes comma-separated origins, checks them the same way, and shows them in the summary and on the detail page. - **README**: a row for `fsc4b.origins` in the spec table. The plugin version stays v0.7.0, as on main. Unrelated to this change: the committed `crds/regelhet.regelrecht.nl_organisaties.yaml` is out of date with the doc comments in `api/v1alpha1` on main ("regelhets" vs "RegelHet instances"). I left that file out of this PR. ## Tests - `go test ./...`: origins reach the chart values and the HelmRelease; they are refused without `fsc4b.enabled`; invalid origins are refused (http elsewhere, a path, a trailing slash, `*`, empty) and valid ones accepted (a port, localhost, 127.0.0.1). - `node --test console-test/*.test.js`: the wizard puts origins in the spec only with FSC voor Burgers on, splits the input on commas and whitespace, and checks it as the CRD does. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XDZRnqjJJ2izeL3kP33bnv
feat: een RegelHet noemt in spec.fsc4b.origins de browserapps die FSC voor Burgers mogen aanroepen
All checks were successful
CI / Helm chart (push) Successful in 10s
CI / Fundament plugin (push) Successful in 37s
CI / Burgerapp on the real kern (push) Successful in 50s
CI / Rust format, lint and validate (push) Successful in 1m22s
CI / Frontend tests (push) Successful in 1m35s
CI / Rust tests (push) Successful in 2m4s
CI / Rust tests (database) (push) Successful in 3m19s
df50221af9
De plugin zet spec.fsc4b.origins door naar fsc4b.origins van de chart, zodat
de burgerapp een RegelHet vanaf haar eigen adres kan aanroepen zonder dat
een handmatige patch van de HelmRelease wordt teruggedraaid. Alleen met
fsc4b.enabled; elke herkomst is https://host[:poort] of http op localhost
of 127.0.0.1, zonder pad. De CRD en de plugin weigeren het andere, en de
wizard vraagt de adressen onder FSC voor Burgers in de stap Toegang.

Claude-Session: https://claude.ai/code/session_01XDZRnqjJJ2izeL3kP33bnv
tim.jager deleted branch feat/plugin-fsc4b-origins 2026-11-24 21:45:32 +00:00
Sign in to join this conversation.
No reviewers
No labels
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.

Dependencies

No dependencies set.

Reference
regelrecht/fieldlab-2026!47
No description provided.