No description
  • Go 97%
  • Makefile 1.7%
  • Dockerfile 0.8%
  • Go Template 0.5%
Find a file
Zamir Amir d213926761
All checks were successful
CI / test (push) Successful in 29s
CI / specification (push) Successful in 28s
CI / image (push) Successful in 14s
CI / chart-release (push) Has been skipped
CI / chart (push) Successful in 7s
Release 0.4.1
2026-11-25 13:15:40 +01:00
.forgejo/workflows Scan the rendered chart with KICS on every push and pull request 2026-11-25 10:34:11 +01:00
api Bring a recipient that joins the kring up to date 2026-11-24 21:12:03 +01:00
cmd/address-register-service Let the beheerproces read an overview and the events, and nothing else 2026-11-24 20:24:18 +01:00
helm Release 0.4.1 2026-11-25 13:15:40 +01:00
internal Bring a recipient that joins the kring up to date 2026-11-24 21:12:03 +01:00
.dockerignore Store registrations and deliveries behind the service contract 2026-11-24 17:20:07 +01:00
Dockerfile Store registrations and deliveries behind the service contract 2026-11-24 17:20:07 +01:00
go.mod Store registrations and deliveries behind the service contract 2026-11-24 17:20:07 +01:00
go.sum Store registrations and deliveries behind the service contract 2026-11-24 17:20:07 +01:00
LICENSE Start the adresregister data layer with its Dutch contract 2026-11-24 17:09:35 +01:00
Makefile Release address-register-service with a version, chart and image together 2026-11-24 19:02:12 +01:00
README.md Bring a recipient that joins the kring up to date 2026-11-24 21:12:03 +01:00

address-register-service

The data layer of the adresregister in Notificatie voor Burgers: the latest registration per BSN and the adreskaartleveringen to the wettelijke kring, with no business logic. address-register-process decides who is in the kring, checks the BSN and retries; this service only stores and returns. The design is in docs/adresregister.md in getting-started.

Three operations are atomic because they cannot be safe otherwise:

  • a registration or closure gets the next version of its BSN and puts one delivery of that version per recipient in the same transaction; a recipient's earlier delivery is replaced under a new id, so a worker still delivering the old version cannot mark the new one delivered;
  • claiming due deliveries skips the ones another worker holds (FOR UPDATE SKIP LOCKED);
  • an undelivered delivery to a recipient that left the kring is dropped with the next registration.

A recipient that joins the kring later gets the registrations that are already there through POST /v1/leveringen/aanvullingen: every member is brought to the current version of every registration, in one transaction. A member that never had a delivery for a BSN only gets one when the registration has an adreskaart, so it never receives a closure of a burger it did not know. A member that already holds the current version gets nothing, so the process calls it on every start.

The BSN only travels in request bodies, never in a URL, and the service never logs it. Every registration, closure, delivery and retry is also logged in gebeurtenissen, for the beheerscherm.

API

Internal only, at /v1 (Kubernetes Service address-register-service); the contract is api/openapi.yaml (Dutch OAS 3.1, NL API Design Rules), also served at /v1/openapi.json and /v1/openapi.yaml. Every call except the specification needs a service key in Authorization: Bearer …: the key of address-register-process for registrations and deliveries, the key of address-register-management-process for the read-only /v1/overzicht and /v1/gebeurtenissen. Neither key opens the other's paths.

Regenerate the JSON after editing the YAML: npx -y js-yaml@4 api/openapi.yaml > api/openapi.json.

Configuration

Variable Meaning
DATABASE_URL Postgres of address-register-db (the chart takes it from the CNPG Secret address-register-db-app)
ADDRESS_REGISTER_PROCESS_API_KEY service key of address-register-process (Secret address-register-api-keys)
ADDRESS_REGISTER_MANAGEMENT_PROCESS_API_KEY service key of address-register-management-process (same Secret)
LISTEN_ADDRESS default :8080

Development

go test ./...          # starts a throwaway Postgres with docker, or uses TEST_DATABASE_URL
golangci-lint run ./...
helm lint helm

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.