- Go 97.4%
- Makefile 1.5%
- Dockerfile 0.7%
- Go Template 0.4%
| .forgejo/workflows | ||
| api | ||
| cmd/dispatch-process | ||
| helm | ||
| internal | ||
| .dockerignore | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
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/zendingenwith headerAfzenderand body{bezorgdienst, bezorgenvelop}→202 {zendingReferentie}400: the bezorgenvelop is missing, not a string or longer than 32768 characters403"Afzender niet toegelaten": missing or unknown sender422"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 identitiesDELIVERY_SERVICE_URLS: comma-separatedbezorgdienst-name:urlpairs, e.g.delivery-process:http://delivery-processDISPATCH_SERVICE_URL: the data layer, defaulthttp://dispatch-serviceRETURN_URLS: comma-separatedafzender:urlpairs where each afzender takes retours, defaultdemo-organization:http://source-organization-process-internalDISPATCH_SERVICE_API_KEY: this process's service key, from the Secretdispatch-api-keys(keyDISPATCH_PROCESS_API_KEY)SIGNING_KEY: the ECDSA P-256 private key asEC PRIVATE KEYPEM, from the Secretdispatch-process-sleutel(keySIGNING_KEY)PARTY_NAME: the name bezorgdiensten know this verzenddienst by, thekidof every signature, defaultdispatch-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.