- Go 96%
- Makefile 2.2%
- Dockerfile 1.1%
- Go Template 0.7%
| .forgejo/workflows | ||
| api | ||
| cmd/mailbox-host-service | ||
| helm | ||
| internal | ||
| .dockerignore | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
mailbox-host-service
The data layer of the hoster in Notificatie voor Burgers. It stores and returns what
mailbox-host-process and mailbox-host-management-process give and ask, and contains no
business logic: it checks no access tokens, sends no nudges and decides nothing. It follows the
blauwe-knop layering: mailbox-host-process (logic) → mailbox-host-service (data access) →
mailbox-host-db (schema and Postgres).
Internal only: never routed from outside the cluster.
API
The contract is api/openapi.yaml (OpenAPI 3.1, Dutch interface following the NL
API Design Rules), served as JSON 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. Each calling process authenticates with its own service key
as a bearer token.
What is stored: mailboxes with a hash of the access token (never the token) and the app's public signing key as JWK, citizen envelopes as the compact JWE strings they arrive in (encrypted for the citizen, returned character for character), per device an opaque push token (its kanaal sealed inside, for the push gateway alone) and version, and the newest 200 events without any reference to a mailbox. Never a sender or content.
Configuration
DATABASE_URL: Postgres connection string (theurikey of the CloudNativePG app Secret ofmailbox-host-db)MAILBOX_HOST_PROCESS_API_KEY,MAILBOX_HOST_MANAGEMENT_PROCESS_API_KEY: the service keys of the two callersLISTEN_ADDRESS: defaults to:8080
Development
go test ./... # starts a throwaway Postgres with docker, or uses TEST_DATABASE_URL
golangci-lint run ./...
The tests use internal/repositories/testdata/schema.sql, which mirrors the migrations in
mailbox-host-db; change both together.
CI
.forgejo/workflows/ci.yml runs the tests against a Postgres service container, lints the OpenAPI
document with Redocly and the ADR checker, lints the chart, and on main pushes
code.digitaledienst.overheid.nl/mijn-betaaloverzicht/mailbox-host-service:<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.