No description
  • Go 98.7%
  • Makefile 0.7%
  • Dockerfile 0.4%
  • Go Template 0.2%
Find a file
Zamir Amir 6c29465860
All checks were successful
CI / specification (push) Successful in 28s
CI / image (push) Successful in 14s
CI / chart-release (push) Has been skipped
CI / chart (push) Successful in 8s
CI / test (push) Successful in 25s
Release 0.3.1
2026-11-25 13:16:10 +01:00
.forgejo/workflows Scan the rendered chart with KICS on every push and pull request 2026-11-25 10:34:12 +01:00
api Let a bericht name the vordering it is about 2026-11-25 11:07:53 +01:00
cmd/source-organization-process Accept only an ontvangstbevestiging signed with the burger's brievenbus key 2026-11-24 19:12:02 +01:00
helm Release 0.3.1 2026-11-25 13:16:10 +01:00
internal Let a bericht name the vordering it is about 2026-11-25 11:07:53 +01:00
.dockerignore Offer shipments for a functional address as bronorganisatie 2026-11-23 11:13:02 +01:00
CHANGELOG.md Let a bericht name the vordering it is about 2026-11-25 11:07:53 +01:00
Dockerfile Keep only the bronorganisatie's business rules in the process, with a Dutch API 2026-11-23 22:05:04 +01:00
go.mod Sign the signal and seal it for the burger and the bezorgdienst 2026-11-24 13:08:46 +01:00
go.sum Sign the signal and seal it for the burger and the bezorgdienst 2026-11-24 13:08:46 +01:00
LICENSE License under EUPL-1.2 2026-11-23 20:10:32 +01:00
Makefile Release source-organization-process with a version, chart and image together 2026-11-24 19:02:14 +01:00
README.md Merge branch 'charts-release' 2026-11-24 19:32:37 +01:00

source-organization-process

The business logic of the bronorganisatie in Notificatie voor Burgers (blauwe-knop layering: process, service, db). It puts a message in the postvak, gives it a volgnummer and an unguessable id, offers a shipment whose signal only points to the message, records the first retrieval as the moment of aflevering and takes the ontvangstbevestiging. It keeps no state of its own: everything lives in source-organization-service.

API

Contract: api/openapi.yaml (OpenAPI 3.1, Dutch, NL API Design Rules), with the generated api/openapi.json committed next to it. Both are served at /bronorganisatie/v1/openapi.yaml and /bronorganisatie/v1/openapi.json; CI checks that the JSON matches the YAML. Regenerate after a change:

npx -y js-yaml@4 api/openapi.yaml > api/openapi.json

The public API has its own prefix, /bronorganisatie/v1, because the hostname is shared and every public API publishes its own specification.

Organisation side, the postvak (later behind PKIo):

  • POST /bronorganisatie/v1/burgers/zoeken {naam} → 200 {items: [{id, naam, bereikbaar}]}: the burgers whose name contains the term, at most 50; a POST so no name lands in a URL. GET /bronorganisatie/v1/burgers/{burgerId} gives the same three fields. The BSN and the adreskaart never appear in this API.

  • POST /bronorganisatie/v1/postvak/berichten {burgerId, berichtsoort, onderwerp, tekst, ontvangstbevestigingGevraagd} → 201 Bericht; 400 when invalid; 422 "Burger niet bereikbaar" when the burger is unknown or closed his address (nothing is kept: fall back to paper); 502 when the verzenddienst refuses (the message is removed again). When the bezorgdienst does not know the brievenbus or cannot open the envelope, the message stays as a retour: 201 with status onbestelbaar and retourOp

  • GET /bronorganisatie/v1/postvak/berichten → 200 {items}, newest first, each with its burger {id, naam, bereikbaar}, opgehaaldOp, ontvangstbevestiging and retourOp (null until then) and a derived status: opgehaald once retrieved, else onbestelbaar once returned, else verstuurd

  • GET /bronorganisatie/v1/publieke-sleutels → 200 JWK Set with this organisation's ECDSA signing key (use sig, for the trust lists of apps) and its X-Wing key (use enc, which the adresregister seals adreskaartleveringen for), both with kid its afzendernaam

Citizen side (later behind FSC voor Burgers):

  • GET /bronorganisatie/v1/berichten/{berichtId} → 200 {afzender, berichtsoort, onderwerp, tekst, aangemaaktOp, ontvangstbevestigingGevraagd, ontvangstbevestigingUrl?}; the first retrieval is recorded as the aflevering
  • POST /bronorganisatie/v1/berichten/{berichtId}/ontvangstbevestiging {ondertekend}: a JWS (ES256, typ ontvangstbevestiging+jwt) over {berichtId, bevestigdOpApparaat, ontvanger, uitgegevenOp}, signed with the signing key of the burger's brievenbus that the adresregister delivered with his adreskaart → 201 for the first, 200 for a repeat (the first stays, with its signed statement as evidence), 401 when the signature, bericht, ontvanger or moment does not hold, 409 when none was requested or the message was not retrieved yet, 400, 404

Errors are application/problem+json with Dutch title and detail; every response carries API-Version.

berichtsoort is brief, mededeling or rechtstoestandsmelding. The signal never carries content: {afzender, verwijzing, volgnummer, tijdstempel}, with verwijzing = <PUBLIC_BASE_URL>/bronorganisatie/v1/berichten/{berichtId}; the volgnummer counts per adreskaart.

The adreskaart (nvb1.<X-Wing key>.<adres-sticker>) comes from the adresregister, per BSN, and the data layer keeps it with the name the organisation looks up in the BRP. The organisation signs the signal (JWS ES256, kid its afzendernaam), encrypts it for the burger with the key from the adreskaart (the burgerenvelop), and encrypts that together with the adres-sticker for the bezorgdienst (the bezorgenvelop). It never learns the functioneel adres. All cryptography comes from blauwe-knop's go-connect; the format is docs/encryptie.md in getting-started. The ontvangstbevestiging is not yet attributable to an identified citizen: like retrieval it only requires the unguessable reference until FSC voor Burgers and an ML-DSA signature take over.

Zendingen go to the verzenddienst with POST /v1/zendingen, header Afzender (until PKIo over FSC authenticates the afzender) and {bezorgdienst, bezorgenvelop}, the bezorgenvelop a compact JWE. When the bezorgdienst does not know the brievenbus or cannot open the envelope, the verzenddienst answers 422 "Onbestelbaar"; the message then stays in the postvak with retourOp and the status onbestelbaar, as if it came back at once. Otherwise the verzenddienst answers 202 {zendingReferentie}, which is stored with the message.

Internal listener (INTERNAL_LISTEN_ADDRESS, default :8082; Service source-organization-process-internal, never routed): POST /v1/retouren {zendingReferentie, reden: onbestelbaar} → 202, from the verzenddienst when the bezorgdienst gave up. The message gets retourOp and the status onbestelbaar: fall back to paper. 404 "Zending onbekend" for an unknown reference.

The same listener takes POST /v1/adreskaartleveringen {versleuteld} from the adresregister: a JWS (adreskaartlevering+jwt) signed by an adresregister on TRUSTED_ADDRESS_REGISTERS and sealed for this organisation's X-Wing key, with {burgerservicenummer, adreskaart (null when closed), versie, ontvanger, uitgegevenOp}. The process checks the recipient and the moment (at most 5 minutes old), looks up the name in the BRP and keeps the burger → 204, also when the version is older than the one kept. 400 when it does not open, 401 "Ongeldige handtekening" without saying which check failed, 502 when the BRP gives no name (the adresregister tries again). The BSN never lands in a URL or a log line. See docs/adresregister.md in getting-started.

Configuration

Set through config in helm/values.yaml, plus the Secrets source-organization-api-keys and source-organization-process-sleutel:

  • SENDER_ID: identity of this organisation as sender
  • DISPATCH_SERVICE_URL: base URL of the verzenddienst
  • DELIVERY_SERVICE: name of the bezorgdienst to address the shipment to
  • SOURCE_ORGANIZATION_SERVICE_URL: the data layer, defaults to http://source-organization-service
  • SOURCE_ORGANIZATION_SERVICE_API_KEY: this process's key for the data layer, from the Secret key SOURCE_ORGANIZATION_PROCESS_API_KEY
  • PUBLIC_BASE_URL: origin at which citizens retrieve messages
  • ALLOWED_ORIGINS: comma-separated CORS origins, defaults to *
  • SIGNING_KEY: the ECDSA P-256 private key as PEM (EC PRIVATE KEY) that signs every signal, from the Secret source-organization-process-sleutel
  • DELIVERY_SERVICE_KEYS: JWK Set with the X-Wing key (kty OKP, crv X-ML-KEM-768, use enc) of each bezorgdienst, kid its name; the process refuses to start without a key for DELIVERY_SERVICE
  • DECRYPTION_KEY: the X-Wing private key as PEM (HPKE PRIVATE KEY) that opens adreskaartleveringen, from the same Secret source-organization-process-sleutel
  • TRUSTED_ADDRESS_REGISTERS: JWK Set with the ES256 key of each trusted adresregister, kid its name (address-register-process)
  • BRP_URL: the BRP (Haal Centraal BRP Personen), defaults to http://mock-brp-api:8008/haalcentraal/api/brp

Development

go test ./...
golangci-lint run ./...
docker build --target production -t code.digitaledienst.overheid.nl/mijn-betaaloverzicht/source-organization-process:dev .

CI

.forgejo/workflows/ci.yml tests and lints every push and pull request, checks the specification (JSON matches YAML, Redocly, ADR checker) and on main pushes the image code.digitaledienst.overheid.nl/mijn-betaaloverzicht/source-organization-process:<commit>.

Release

make release VERSION=1.2.3   # on an up-to-date main: writes helm/Chart.yaml, commits, tags v1.2.3
git push --follow-tags

The tag pipeline tags the image 1.2.3 and v1.2.3 and publishes the chart at 1.2.3 to the Forgejo Helm registry (see the charts repository). The environments repository pins that version.

License

EUPL-1.2, see LICENSE.