No description
  • Go 97.9%
  • Makefile 1.2%
  • Dockerfile 0.6%
  • Go Template 0.3%
Find a file
Zamir Amir 7bad1dd2b2
All checks were successful
CI / image (push) Successful in 15s
CI / test (push) Successful in 40s
CI / specification (push) Successful in 1m0s
CI / chart (push) Successful in 12s
CI / chart-release (push) Successful in 4s
Release 0.2.1
2026-11-25 13:16:06 +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 Seal the address declaration for the delivery service 2026-11-24 18:53:35 +01:00
cmd/mailbox-host-process Seal the address declaration for the delivery service 2026-11-24 18:53:35 +01:00
helm Release 0.2.1 2026-11-25 13:16:06 +01:00
internal Seal the address declaration for the delivery service 2026-11-24 18:53:35 +01:00
.dockerignore Host mailboxes and nudge connected devices 2026-11-23 11:13:03 +01:00
Dockerfile Serve the hoster's public API under /hoster/v1 and publish JSON and YAML 2026-11-23 22:23:35 +01:00
go.mod Seal the address declaration for the delivery service 2026-11-24 18:53:35 +01:00
go.sum Seal the address declaration for the delivery service 2026-11-24 18:53:35 +01:00
LICENSE License under EUPL-1.2 2026-11-23 20:10:32 +01:00
Makefile Release mailbox-host-process with a version, chart and image together 2026-11-24 19:02:13 +01:00
README.md Merge branch 'charts-release' 2026-11-24 19:32:35 +01:00

mailbox-host-process

The business logic of the hoster in Notificatie voor Burgers: it checks the app's signed request to create a mailbox, declares the mailbox to the delivery service with a signed address declaration and hands back the adreskaart, checks the citizen's access token, accepts deliveries and asks the push gateway to nudge the registered devices. It holds no state: all data lives in mailbox-host-service (data access) and mailbox-host-db (Postgres), following the blauwe-knop layering, so this process can restart without losing a mailbox.

API

The contract is api/openapi.yaml (OpenAPI 3.1, Dutch interface following the NL API Design Rules), committed with a generated api/openapi.json like in blauwe knop, and served as JSON and YAML on both listeners (/hoster/v1/openapi.json and .yaml publicly, /v1/openapi.json and .yaml internally). Every response carries API-Version; errors are application/problem+json.

Public listener (:8080, routed at /hoster, prefix /hoster/v1), for the citizen:

  • POST /hoster/v1/brievenbussen {ondertekend} → 201 {functioneelAdres, toegangstoken, adreskaart}; ondertekend is the app's JWS with both its keys as JWK, 401 when the signature or its moment is not accepted
  • GET /hoster/v1/publieke-sleutels → the hoster's ECDSA key as a JWK Set, for the delivery service's trust list
  • GET /hoster/v1/brievenbussen/{functioneelAdres}/signalen with Authorization: Bearer <toegangstoken> → 200 {items: [{burgerenvelop}]}
  • PUT / DELETE /hoster/v1/brievenbussen/{functioneelAdres}/apparaten/{apparaatId} with the same header; body {pushtoken} only: the push gateway sealed the kanaal inside the token, so the hoster never learns how a device is reached; any other field is refused

Internal listener (:8082, Service <release>-internal, never routed), for delivery-process only:

  • POST /v1/brievenbussen/{functioneelAdres}/bezorgingen {burgerenvelop} → 202; the envelope is a compact JWE for the citizen, kept as an opaque string

The access token is stored only as a SHA-256 hash and compared in constant time; the functional address in the path is public by design, like a postal address, and opens nothing on its own. After each delivery the process sends every device a seintje through the pushgateway (POST /v1/seintjes {pushtoken}); a 410 removes that device version only (If-Match), so a device that re-registered meanwhile keeps its new token. A failed nudge never fails the delivery. Management lives in mailbox-host-management-process.

Configuration

  • MAILBOX_HOST_SERVICE_URL, MAILBOX_HOST_SERVICE_API_KEY: the data layer and this process's service key
  • DELIVERY_SERVICE_URL: delivery-process, where each new mailbox is declared with PUT /v1/adressen/{functioneelAdres} {versleuteld}: the signed declaration sealed for the delivery service; it answers with the adres-sticker
  • SIGNING_KEY: PEM of the hoster's ECDSA P-256 private key (chart: Secret mailbox-host-process-sleutel); the format is docs/encryptie.md in getting-started
  • DELIVERY_SERVICE_KEYS: JWK Set with the delivery service's X-Wing key (kid delivery-process) that each declaration is sealed for (chart: config.deliveryServiceKeys); the process does not start without it
  • TECHNICAL_ADDRESS_PREFIX: the base URL at which the delivery service reaches the internal listener (chart default http://mailbox-host-process-internal)
  • PUSH_GATEWAY_URL: the internal URL of the push gateway
  • LISTEN_ADDRESS (:8080), INTERNAL_LISTEN_ADDRESS (:8082), ALLOWED_ORIGINS (*)

Development

go test ./...
golangci-lint run ./...

CI

.forgejo/workflows/ci.yml tests and lints, checks the OpenAPI document with Redocly and the ADR checker, lints the chart, and on main pushes code.digitaledienst.overheid.nl/mijn-betaaloverzicht/mailbox-host-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.