feat(tenants): provision the product tenant with the registry UUID on create (#21)
This commit was merged in pull request #21.
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"gitea.meghsakha.com/platform/tenant-registry/internal/authn"
|
||||
"gitea.meghsakha.com/platform/tenant-registry/internal/config"
|
||||
"gitea.meghsakha.com/platform/tenant-registry/internal/keycloak"
|
||||
"gitea.meghsakha.com/platform/tenant-registry/internal/product"
|
||||
"gitea.meghsakha.com/platform/tenant-registry/internal/store"
|
||||
)
|
||||
|
||||
@@ -20,8 +21,19 @@ type Server struct {
|
||||
Cfg *config.Config
|
||||
Log *slog.Logger
|
||||
Store store.Store
|
||||
Keycloak keycloak.Adapter // never nil — main wires Mock when KC env is unset
|
||||
Auth *authn.Verifier // nil ⇒ AUTH_ENABLED=false, API is open (dev only)
|
||||
Keycloak keycloak.Adapter // never nil — main wires Mock when KC env is unset
|
||||
Auth *authn.Verifier // nil ⇒ AUTH_ENABLED=false, API is open (dev only)
|
||||
Product product.Provisioner // never nil — main wires Noop when PRODUCT_API_URL is unset
|
||||
}
|
||||
|
||||
// productProvisioner guarantees the "never nil" invariant the struct documents.
|
||||
// Tests construct Server directly and would otherwise panic; an unset provisioner
|
||||
// simply means no downstream provisioning, never a crash mid-tenant-creation.
|
||||
func (s *Server) productProvisioner() product.Provisioner {
|
||||
if s.Product == nil {
|
||||
return product.NoopProvisioner{}
|
||||
}
|
||||
return s.Product
|
||||
}
|
||||
|
||||
// NewRouter builds the http.Handler with logging middleware applied.
|
||||
|
||||
Reference in New Issue
Block a user