This document outlines the planned development phases for the Cloud Calibration Platform.
Core platform delivering ISO 17025 compliance management.
- Append-only event store for full calibration audit trail
- ISO 17025 compliance checks: ambient temperature (18–28 °C), relative humidity (30–75 %RH), per-point uncertainty limits (|deviation| ≤ 2u, k=2)
- Complete calibration lifecycle: draft → completed → certified → expired
- Sequential certificate generation (
CAL-YYYY-NNNNNN) - REST API: instruments, records, measurements, compliance, certificates, audit trail, stats
- Dark-themed single-page dashboard with live stats and 15 s auto-refresh
- PostgreSQL 16 persistence with
pgx/v5connection pooling - Multi-stage Docker build (distroless runtime, ~8 MB image)
- GitHub Actions CI: race-condition tests,
go vet,golangci-lint
Make certificates tamper-evident and machine-verifiable.
- RSA-2048 signing — sign a SHA-256 hash of
cert_number + record_id + issued_at + expires_atusing PKCS#1 v1.5; store base64-encoded signature incertificates.signature - Verification endpoint —
GET /api/v1/certificates/:id/verifyre-computes hash and validates signature against the stored public key - PDF generation — use
github.com/jung-kurt/gofpdfto produce a formatted ISO 17025 certificate PDF with calibration table, uncertainty budget, ambient conditions, and technician details - QR code — embed a QR code in the PDF linking to the verification endpoint (
github.com/skip2/go-qrcode) - Streaming download —
GET /api/v1/certificates/:id/pdfstreams the PDF withContent-Disposition: attachment
Enable long-term trend analysis and 10-year data retention.
- TimescaleDB hypertable — migrate
measurementstable to a hypertable partitioned bycreated_at - Continuous aggregates — daily and monthly deviation trend views per instrument type
- 10-year retention policy —
add_retention_policyaligned with ISO 17025 record-keeping requirements - Trend API —
GET /api/v1/instruments/:id/trends?from=&to=&interval=1dreturns aggregated deviation statistics - Dashboard charts — line charts for deviation over time using the trend API
Isolate labs and enforce role-based access control.
- Lab (tenant) isolation — add
lab_idcolumn to instruments, records, and certificates; enforce row-level security in PostgreSQL - OIDC/JWT authentication — validate Azure Entra ID JWTs (
github.com/lestrrat-go/jwx) on all API routes - RBAC — three roles:
technician— create instruments, records, and measurements; run compliance checksreviewer— approve and complete records; view all records within labadmin— issue certificates; manage lab users; access stats across all labs
- Federated identity — support Entra ID app registration with PKCE flow for dashboard login
- Audit events for auth — emit
auth.login,auth.token_refreshevents to the event store
Decouple PDF generation and notifications from the API hot path.
- Kafka producer — publish every
CalibrationEventto thecalibration-eventsKafka topic (Sarama client) - PDF worker — Kafka consumer group that generates and stores PDFs in Azure Blob Storage on
record.certifiedevents - KEDA scaling —
ScaledObjecttargeting thecalibration-eventsconsumer group lag; scale PDF worker pods 0–20 - Webhook notifications — configurable outbound webhooks triggered on
record.certifiedandrecord.expiredevents; delivery with exponential back-off retry - Dead-letter topic — failed PDF jobs routed to
calibration-events-dlqwith alerting via Azure Monitor action group
Harden the platform for enterprise Azure deployment.
- Helm chart — parameterised chart for
api,worker,postgres(or Azure Database for PostgreSQL Flexible Server), and KEDAScaledObject - Azure Key Vault — store RSA private key in Key Vault; retrieve via Workload Identity (no static secrets); rotate key annually
- Defender for Cloud — enable Defender for Containers; remediate all HIGH/CRITICAL findings before each release; export security score to Log Analytics
- Automated compliance reporting — weekly Azure Logic App that queries
/api/v1/stats, formats an ISO 17025 summary report, and distributes via email / Teams - DR runbook — Azure Automation runbook for point-in-time restore of PostgreSQL to secondary region (RTO < 4 h, RPO < 1 h)
- Private networking — AKS with Azure CNI Overlay; API and DB exposed only on private endpoints; Front Door + WAF (Prevention mode) as public ingress