No description
  • Go 96%
  • Makefile 2.2%
  • Dockerfile 1.1%
  • Go Template 0.7%
Find a file
Zamir Amir b679f807c0
All checks were successful
CI / chart (push) Successful in 7s
CI / test (push) Successful in 17s
CI / specification (push) Successful in 25s
CI / image (push) Successful in 15s
CI / chart-release (push) Has been skipped
Release 0.2.1
2026-11-25 13:16:08 +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 Store the app's signing key and the envelope as an encrypted string 2026-11-24 13:06:39 +01:00
cmd/mailbox-host-service Publish the OpenAPI document as committed JSON and YAML, as in blauwe knop 2026-11-23 22:19:05 +01:00
helm Release 0.2.1 2026-11-25 13:16:08 +01:00
internal Store the app's signing key and the envelope as an encrypted string 2026-11-24 13:06:39 +01:00
.dockerignore Host mailboxes and nudge connected devices 2026-11-23 11:13:03 +01:00
Dockerfile Publish the OpenAPI document as committed JSON and YAML, as in blauwe knop 2026-11-23 22:19:05 +01:00
go.mod Turn the copy of mailbox-host into the hoster's data layer 2026-11-23 20:35:28 +01:00
go.sum Turn the copy of mailbox-host into the hoster's data layer 2026-11-23 20:35:28 +01:00
LICENSE License under EUPL-1.2 2026-11-23 20:10:32 +01:00
Makefile Release mailbox-host-service with a version, chart and image together 2026-11-24 19:02:13 +01:00
README.md Release mailbox-host-service with a version, chart and image together 2026-11-24 19:02:13 +01:00

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 (the uri key of the CloudNativePG app Secret of mailbox-host-db)
  • MAILBOX_HOST_PROCESS_API_KEY, MAILBOX_HOST_MANAGEMENT_PROCESS_API_KEY: the service keys of the two callers
  • LISTEN_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.