feat(admin): cloud injection and the 15-minute reconciler

Injection is a single UpdateOne of three licence fields, so it is
idempotent and safe to re-run. The control plane caches licence state for
60 seconds, so an injected licence takes effect within a minute with no
restart.

Deliver never fails its caller. The reconciler, not the issuance path, is
what actually guarantees a cloud instance ends up holding the licence admin
says it holds -- injection at issue time is best-effort and this is the
backstop.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
mrhid6
2026-07-25 19:02:45 +01:00
co-authored by Claude Opus 5
parent 427191b14c
commit a636a48e07
2 changed files with 155 additions and 0 deletions
+5
View File
@@ -13,6 +13,7 @@ import (
"github.com/joho/godotenv"
"github.com/mrhid6/vantage/admin/internal/config"
"github.com/mrhid6/vantage/admin/internal/db"
"github.com/mrhid6/vantage/admin/internal/inject"
"github.com/mrhid6/vantage/admin/internal/licensing"
"github.com/mrhid6/vantage/admin/internal/models"
)
@@ -46,6 +47,10 @@ func main() {
}
idxCancel()
reconcileCtx, stopReconcile := context.WithCancel(context.Background())
defer stopReconcile()
inject.StartReconciler(reconcileCtx)
srv := &http.Server{
Addr: cfg.Addr,
Handler: http.NotFoundHandler(), // replaced in Task 8