- Go 97.9%
- Makefile 1.2%
- Dockerfile 0.5%
- Go Template 0.4%
| .forgejo/workflows | ||
| api | ||
| cmd/delivery-process | ||
| helm | ||
| internal | ||
| .dockerignore | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
delivery-process
The process of the bezorgdienst in Notificatie voor Burgers. It takes address declarations from
hosters and brings shipments from the dispatch service to the right mailbox, passing the citizen
envelope on unopened. It knows the functional and technical address of every mailbox, never the
sender: it does not accept, store or log a Sender header.
Address declarations and zendingen are signed (ES256 JWS) by a hoster or verzenddienst on its trust
lists. With its X-Wing key it opens the bezorgenvelop and the adres-sticker inside; the citizen envelope
stays sealed for the citizen. The format is docs/encryptie.md in getting-started; all cryptography is
blauwe-knop's go-connect.
The process keeps no state. Following the blauwe-knop layers, addresses and events live in
delivery-service (data access) and delivery-db (Postgres); the management screen reads them through
delivery-management-process. Internal only: hosters and the dispatch service reach this Service; no
route exposes it outside the cluster.
API
Dutch, as in api/openapi.yaml (OpenAPI 3.1, NL API Design Rules), served at /v1/openapi.json and /v1/openapi.yaml (both committed in api/, as in blauwe knop).
Every response carries API-Version; errors are application/problem+json.
PUT /v1/adressen/{functioneelAdres}{versleuteld}→200 {adresSticker}: the address declaration of a hoster, signed and then sealed for this bezorgdienst, answered with a fresh adres-sticker (the functional address sealed for this bezorgdienst);422when it does not open with this bezorgdienst's key; a repeated declaration replaces the old onePOST /v1/zendingen{ondertekend}: the signed zending of the verzenddienst. Untrusted, wrong recipient or older than 5 minutes → 401; a bezorgenvelop or sticker that does not open → 422; unknown functioneel adres → 404 at once; otherwise 202{zendingReferentie}and a background worker delivers it, retrying with exponential back-off while the mailbox is unreachable. AfterDELIVERY_MAXIMUM_DURATION(default 1h; the 48 hours of art. 2:10 Awb cap all delays together) it goes back to the verzenddienst asPOST /v1/retouren {zendingReferentie, reden: onbestelbaar}— only the reference, never an address.GET /v1/publieke-sleutels: the X-Wing public key as a JWK Set
The mailbox receives POST <technischAdres> with {"burgerenvelop": "<compacte JWE>"}.
Configuration
DELIVERY_SERVICE_URL: internal base URL ofdelivery-serviceDELIVERY_SERVICE_API_KEY: this process's service key fordelivery-serviceLISTEN_ADDRESS: defaults to:8080DECRYPTION_KEY: this bezorgdienst's X-Wing private key as PEM, from the Secretdelivery-process-sleutelTRUSTED_HOSTERS,TRUSTED_DISPATCHERS: JWK Sets of the parties whose signatures are accepted, kid = name; empty trusts no one
Retry configuration: DISPATCH_URL (default http://dispatch-process), RETRY_INITIAL_DELAY (5s), RETRY_FACTOR (2), RETRY_MAXIMUM_DELAY (5m), DELIVERY_MAXIMUM_DURATION (1h), WORKER_INTERVAL (1s), CLAIM_DURATION (30s).
Development
go test ./... # collaborators are in-memory fakes; no database needed here
golangci-lint run ./...
CI
.forgejo/workflows/ci.yml tests, validates the spec with Redocly and the ADR checker, lints the
chart, and on main pushes code.digitaledienst.overheid.nl/mijn-betaaloverzicht/delivery-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.