No description
  • Go 97.4%
  • Makefile 1.5%
  • Dockerfile 0.7%
  • Go Template 0.4%
Find a file
Zamir Amir 913bc6a5ef
All checks were successful
CI / chart (push) Successful in 7s
CI / test (push) Successful in 24s
CI / specification (push) Successful in 24s
CI / image (push) Successful in 13s
CI / chart-release (push) Has been skipped
Release 0.2.1
2026-11-25 13:15:54 +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 Sign every zending for the bezorgdienst and publish the key as a JWK 2026-11-24 13:04:27 +01:00
cmd/dispatch-process Sign every zending for the bezorgdienst and publish the key as a JWK 2026-11-24 13:04:27 +01:00
helm Release 0.2.1 2026-11-25 13:15:54 +01:00
internal Sign every zending for the bezorgdienst and publish the key as a JWK 2026-11-24 13:04:27 +01:00
.dockerignore Forward shipments from allowed senders as verzenddienst 2026-11-23 11:13:02 +01:00
Dockerfile Keep only the verzenddienst's logic in the process, with the Dutch API 2026-11-23 22:07:10 +01:00
go.mod Sign every zending for the bezorgdienst and publish the key as a JWK 2026-11-24 13:04:27 +01:00
go.sum Sign every zending for the bezorgdienst and publish the key as a JWK 2026-11-24 13:04:27 +01:00
LICENSE License under EUPL-1.2 2026-11-23 20:10:32 +01:00
Makefile Release dispatch-process with a version, chart and image together 2026-11-24 19:02:13 +01:00
README.md Release dispatch-process with a version, chart and image together 2026-11-24 19:02:13 +01:00

dispatch-process

The process of the verzenddienst in Notificatie voor Burgers: it takes shipments from source organisations, checks whether the sender may dispatch and forwards the bezorgenvelop, unchanged and unread, to the chosen bezorgdienst in a zending it signs. It keeps no state: the allowed senders and the events live in dispatch-service.

Internal only: no Ingress or HTTPRoute points at it.

What it knows

The sender, whether it may dispatch and which bezorgdienst gets the shipment. Never the recipient: the adres-sticker is inside the bezorgenvelop, a JWE encrypted for the bezorgdienst (X-Wing), which the verzenddienst never reads.

API

Dutch, OpenAPI 3.1, following the NL API Design Rules. The source is api/openapi.yaml; api/openapi.json is generated from it and committed (npx -y js-yaml@4 api/openapi.yaml > api/openapi.json). Both are served as they are at /v1/openapi.json and /v1/openapi.yaml.

  • POST /v1/zendingen with header Afzender and body {bezorgdienst, bezorgenvelop} → 202 {zendingReferentie}
    • 400: the bezorgenvelop is missing, not a string or longer than 32768 characters
    • 403 "Afzender niet toegelaten": missing or unknown sender
    • 422 "Onbestelbaar": the bezorgdienst knows no mailbox for the shipment or cannot open it (the sender learns nothing it didn't know)
    • 422 "Onbekende bezorgdienst"
    • 502 "Doorgeven mislukt" or "Service niet bereikbaar"
  • POST /v1/retouren {zendingReferentie, reden: onbestelbaar}, for the bezorgdienst → 202; the retour goes to the afzender at its configured retour URL. 404 "Zending onbekend", 502 "Retour niet doorgegeven" (offer it again later)
  • GET /v1/publieke-sleutels → 200, a JWK Set (RFC 7517) with this verzenddienst's signing key, to fill trust lists

The Afzender header is temporary: once PKIo over FSC authenticates the sender, the identity comes from the connection. Errors are application/problem+json, every response carries API-Version.

The zending goes to POST <bezorgdienst>/v1/zendingen as {"ondertekend": "<JWS>"}: a compact JWS (ES256, typ zending+jwt, kid dispatch-process) of {zendingReferentie, bezorgenvelop, ontvanger, uitgegevenOp}, with the bezorgenvelop unchanged. ontvanger and uitgegevenOp keep the signature from being accepted by another bezorgdienst or again later. A bezorgdienst answering 404 (address unknown) or 422 (envelope does not open) makes the zending undeliverable. The format is in docs/encryptie.md in getting-started; the signing comes from blauwe-knop's go-connect. The reference is 32 random bytes (base64url); dispatch-service keeps which afzender it belongs to for 48 hours, after which no retour can come (the bezorgdienst returns well within the 48 hours of art. 2:10 Awb). The bezorgdienst never learns the afzender, the verzenddienst never the address.

Allowed senders

The policy lives in this process's configuration (ALLOWED_SENDERS). At start the process writes it to dispatch-service (retrying until the service answers), so the management screen can show it. Each shipment is checked against the service, with a cache of ten seconds.

Configuration

  • ALLOWED_SENDERS: comma-separated sender identities
  • DELIVERY_SERVICE_URLS: comma-separated bezorgdienst-name:url pairs, e.g. delivery-process:http://delivery-process
  • DISPATCH_SERVICE_URL: the data layer, default http://dispatch-service
  • RETURN_URLS: comma-separated afzender:url pairs where each afzender takes retours, default demo-organization:http://source-organization-process-internal
  • DISPATCH_SERVICE_API_KEY: this process's service key, from the Secret dispatch-api-keys (key DISPATCH_PROCESS_API_KEY)
  • SIGNING_KEY: the ECDSA P-256 private key as EC PRIVATE KEY PEM, from the Secret dispatch-process-sleutel (key SIGNING_KEY)
  • PARTY_NAME: the name bezorgdiensten know this verzenddienst by, the kid of every signature, default dispatch-process

Development

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

CI

.forgejo/workflows/ci.yml tests and lints every push and pull request, checks that openapi.json matches openapi.yaml and lints the spec with Redocly and the ADR checker. On main it pushes the image code.digitaledienst.overheid.nl/mijn-betaaloverzicht/dispatch-process:<commit>, which the environments repository deploys.

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.