@aifabrix/builder 2.61.2 → 2.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/lib/api/applications.api.js +22 -2
  2. package/lib/api/bootstrap-snapshot.api.js +115 -0
  3. package/lib/api/onboarding-status.api.js +117 -0
  4. package/lib/app/deploy.js +14 -5
  5. package/lib/app/register.js +24 -2
  6. package/lib/app/run-env-compose.js +44 -8
  7. package/lib/app/run-env-recovery.js +1 -0
  8. package/lib/app/run-helpers.js +1 -1
  9. package/lib/app/run.js +6 -4
  10. package/lib/build/standard-docker-build.js +4 -0
  11. package/lib/channels/channel-artifact-generator.js +13 -3
  12. package/lib/cli/infra-guided-footers.js +10 -8
  13. package/lib/cli/infra-guided.js +60 -12
  14. package/lib/cli/setup-infra-up-platform-action.js +14 -1
  15. package/lib/cli/setup-platform.js +20 -3
  16. package/lib/commands/auth-config.js +2 -0
  17. package/lib/commands/login.js +4 -0
  18. package/lib/commands/repair-datasource-apply.js +3 -1
  19. package/lib/commands/repair-datasource-legacy.js +94 -0
  20. package/lib/commands/setup-image-refresh.js +26 -0
  21. package/lib/commands/setup-modes.js +9 -2
  22. package/lib/commands/setup-onboarding-readiness.js +83 -0
  23. package/lib/commands/setup-prompts-platform-mode.js +34 -0
  24. package/lib/commands/setup.js +35 -10
  25. package/lib/commands/up-builder-api.js +24 -8
  26. package/lib/commands/up-common.js +16 -1
  27. package/lib/commands/up-dataplane-bootstrap.js +149 -16
  28. package/lib/commands/up-dataplane-credentials.js +21 -0
  29. package/lib/commands/up-dataplane.js +26 -34
  30. package/lib/commands/up-integration-server.js +112 -0
  31. package/lib/commands/wizard-config-normalizer.js +5 -1
  32. package/lib/core/admin-secrets-env-overlay.js +8 -3
  33. package/lib/core/environment-access-policy.js +121 -0
  34. package/lib/core/environment-mode-policy.js +177 -0
  35. package/lib/core/local-env-overrides.js +149 -0
  36. package/lib/core/secrets-ensure.js +4 -2
  37. package/lib/core/secrets-env-content.js +12 -9
  38. package/lib/core/secrets-env-write.js +1 -1
  39. package/lib/datasource/capability/capability-manifest.js +1 -0
  40. package/lib/deployment/installation/index.js +14 -1
  41. package/lib/deployment/installation/infra-catalog.js +3 -0
  42. package/lib/deployment/installation/local-environment-stage.js +285 -0
  43. package/lib/deployment/installation/local-installation.js +76 -0
  44. package/lib/deployment/installation/stage-input.js +5 -1
  45. package/lib/generator/builders.js +3 -1
  46. package/lib/generator/index.js +32 -9
  47. package/lib/generator/split-variables.js +2 -2
  48. package/lib/parameters/database-adoption.js +125 -0
  49. package/lib/parameters/physical-database-naming.js +136 -0
  50. package/lib/parameters/physical-secret-name.js +194 -0
  51. package/lib/parameters/rsa-secret-values.js +165 -0
  52. package/lib/programmatic/run-channel-install-artifacts.js +28 -2
  53. package/lib/programmatic/run-channel-package.js +3 -1
  54. package/lib/programmatic/workspace-context.js +37 -2
  55. package/lib/schema/infra.parameter.yaml +61 -27
  56. package/lib/schema/infrastructure-schema.json +213 -120
  57. package/lib/utils/compose-generate-docker-compose.js +2 -2
  58. package/lib/utils/compose-generator.js +4 -7
  59. package/lib/utils/compose-miso-env.js +2 -2
  60. package/lib/utils/compose-traefik-ingress-base.js +3 -4
  61. package/lib/utils/dataplane-dimension-abac-setting.js +120 -0
  62. package/lib/utils/declarative-url-ports.js +3 -0
  63. package/lib/utils/env-environment-file-paths.js +105 -0
  64. package/lib/utils/environment-scoped-resources.js +48 -14
  65. package/lib/utils/log-redaction.js +4 -1
  66. package/lib/utils/paths-system-builder-keys.js +7 -1
  67. package/lib/utils/paths.js +7 -2
  68. package/lib/utils/postgres-platform-bootstrap.js +35 -1
  69. package/lib/utils/redis-env-scope.js +21 -1
  70. package/lib/utils/registry-auth-sources.js +154 -0
  71. package/lib/utils/registry-credentials.js +131 -14
  72. package/lib/utils/secrets-generator.js +30 -21
  73. package/lib/utils/secrets-helpers.js +5 -7
  74. package/lib/utils/secrets-kv-scope.js +127 -28
  75. package/lib/utils/secrets-materialize-local.js +9 -0
  76. package/lib/utils/secrets-missing-error.js +35 -1
  77. package/lib/utils/token-manager.js +14 -8
  78. package/lib/utils/url-public-path-prefix.js +6 -10
  79. package/package.json +4 -2
  80. package/templates/README.md +6 -0
  81. package/templates/applications/builder-api/application.yaml +1 -1
  82. package/templates/applications/dataplane/application.yaml +2 -2
  83. package/templates/applications/dataplane/env.template +1 -1
  84. package/templates/applications/integration-server/application.yaml +91 -0
  85. package/templates/applications/integration-server/env.template +215 -0
  86. package/templates/applications/mirrored-templates.json +52 -0
  87. package/templates/applications/miso-controller/application.yaml +43 -1
  88. package/templates/applications/miso-controller/env.template +45 -39
  89. package/templates/marketplace/createUiDefinition.json +52 -4
  90. package/templates/marketplace/main.json +85 -7
@@ -593,31 +593,31 @@ parameters:
593
593
  azure:
594
594
  notes: Not a typical Key Vault name; local optional pypi token.
595
595
 
596
- # Default client id for controller app in local multi-service layout; override after register if needed.
596
+ # Miso Controller ↔ controller OAuth. The Controller issues both values at registration;
597
+ # local infrastructure must leave them empty until application resolution retrieves them.
597
598
  - key: miso-controller-client-idKeyVault
598
599
  ownerAppKey: miso-controller
599
600
  scope: app
600
601
  sensitive: false
601
602
  generator:
602
- type: literal
603
- value: 'miso-controller-miso-miso-controller'
604
- ensureOn: [upInfra, resolveApp]
603
+ type: emptyString
604
+ ensureOn: [resolveApp]
605
605
  azure:
606
606
  legacyVaultSecretNames:
607
607
  - '{serviceName}-miso-clientIdKeyVault'
608
608
  notes: >-
609
- Per-app OAuth client id from controller registration; literal default matches local Keycloak client naming.
609
+ Per-app OAuth client id issued when miso-controller is registered with Miso.
610
610
 
611
611
  - key: miso-controller-client-secretKeyVault
612
612
  ownerAppKey: miso-controller
613
613
  scope: app
614
614
  generator:
615
- type: randomBytes32
616
- ensureOn: [upInfra, resolveApp]
615
+ type: emptyString
616
+ ensureOn: [resolveApp]
617
617
  azure:
618
618
  notes: >-
619
- Per-app OAuth client secret used by miso-controller for service-to-service auth (MISO_CLIENTSECRET).
620
- Generated on first ensure for local bootstrap.
619
+ Per-app OAuth client secret issued when miso-controller is registered with Miso and used
620
+ for service-to-service auth (MISO_CLIENTSECRET). Never generated by local infrastructure.
621
621
 
622
622
  # Builder API ↔ controller OAuth. These are explicit declarations rather than catch-all
623
623
  # matches so the backup catalog records the owner and canonical names unambiguously.
@@ -644,28 +644,41 @@ parameters:
644
644
  notes: Per-app OAuth client secret issued when builder-api is registered with Miso.
645
645
 
646
646
  # Dataplane ↔ controller OAuth (builder/dataplane env.template MISO_CLIENTID / MISO_CLIENTSECRET).
647
+ # Plan 265.0: issued by the Controller at registration, so the catalog must not produce a
648
+ # value for it. The previous `literal` on the `upInfra` hook meant Builder generated an id
649
+ # the Controller owns — and the literal was `miso-controller-dev-dataplane`, with `dev`
650
+ # baked into an entry that is not dev-specific. `emptyString` on `resolveApp` is the shape
651
+ # `builder-api-client-idKeyVault` already uses for the same relationship.
647
652
  - key: dataplane-client-idKeyVault
648
653
  ownerAppKey: dataplane
649
654
  scope: app
650
655
  sensitive: false
651
656
  generator:
652
- type: literal
653
- value: 'miso-controller-dev-dataplane'
654
- ensureOn: [upInfra, resolveApp]
657
+ type: emptyString
658
+ ensureOn: [resolveApp]
655
659
  azure:
656
660
  notes: >-
657
- Per-app OAuth client id from controller registration; literal default matches local Keycloak client naming
658
- (override for environments such as miso-controller-dev-dataplane).
659
-
661
+ Per-app OAuth client id issued when dataplane is registered with Miso. Not generated
662
+ locally: the Controller owns it, and a locally invented id is one the Controller has
663
+ never seen.
664
+
665
+ # Plan 265.0: the Controller issues this secret, so a `randomBytes32` generator on the
666
+ # `upInfra` hook had Builder inventing an OAuth secret the Controller owns. That invented
667
+ # value is what defeated the "credentials missing locally" guard and surfaced as a
668
+ # misleading auth error rather than a clear one. Matches
669
+ # `builder-api-client-secretKeyVault`.
660
670
  - key: dataplane-client-secretKeyVault
661
671
  ownerAppKey: dataplane
662
672
  scope: app
663
673
  generator:
664
- type: randomBytes32
665
- ensureOn: [upInfra, resolveApp]
674
+ type: emptyString
675
+ ensureOn: [resolveApp]
666
676
  azure:
667
677
  vaultSecretName: dataplane-client-secretKeyVault
668
- notes: Per-app OAuth client secret for dataplane; generated on first ensure.
678
+ notes: >-
679
+ Per-app OAuth client secret issued when dataplane is registered with Miso. Never
680
+ generated locally; it is fetched from the Controller, which is the only party that
681
+ can issue one it will accept.
669
682
 
670
683
  # Mori / telemetry is optional for an unlicensed Community installation.
671
684
  - key: mori-controller-api-keyKeyVault
@@ -706,10 +719,17 @@ parameters:
706
719
  #
707
720
  # Rotating an installation that already holds a value here means clearing BOTH halves
708
721
  # together — the generator is get-or-create, so replacing one alone leaves a mismatched pair.
722
+ # Supplied, never generated. Mori owns this pair and keeps the private half; an installation
723
+ # that minted it would hold the private half of the key it verifies against and could sign a
724
+ # licence it would then accept. Builder refuses these pairs (aifabrix-builder 211.0 /
725
+ # 5bfeb06d); `rsaKeyPair` here made Miso mint them anyway, because catalog-resolver runs the
726
+ # generator unconditionally and never consults valueSource. `emptyAllowed` is what stops it:
727
+ # the materializer skips isEmptyByDesign rows, so Miso no longer writes this secret at all.
728
+ # It arrives instead as a deploy parameter -- packages.json -> main.bicep ->
729
+ # 08_keyvault-secrets.bicep -> the installation vault -- which is also the only writer that
730
+ # can hold Mori's real key rather than a locally invented one.
709
731
  generator:
710
- type: rsaKeyPair
711
- pairId: mori-license-signing
712
- part: public
732
+ type: emptyAllowed
713
733
  ensureOn: [upInfra, resolveApp]
714
734
  azure:
715
735
  vaultSecretName: mori-license-public-keyKeyVault
@@ -817,10 +837,17 @@ parameters:
817
837
  ownerAppKey: mori-controller
818
838
  scope: app
819
839
  sensitive: true
840
+ # Supplied, never generated. Mori owns this pair and keeps the private half; an installation
841
+ # that minted it would hold the private half of the key it verifies against and could sign a
842
+ # licence it would then accept. Builder refuses these pairs (aifabrix-builder 211.0 /
843
+ # 5bfeb06d); `rsaKeyPair` here made Miso mint them anyway, because catalog-resolver runs the
844
+ # generator unconditionally and never consults valueSource. `emptyAllowed` is what stops it:
845
+ # the materializer skips isEmptyByDesign rows, so Miso no longer writes this secret at all.
846
+ # It arrives instead as a deploy parameter -- packages.json -> main.bicep ->
847
+ # 08_keyvault-secrets.bicep -> the installation vault -- which is also the only writer that
848
+ # can hold Mori's real key rather than a locally invented one.
820
849
  generator:
821
- type: rsaKeyPair
822
- pairId: mori-policy-signing
823
- part: private
850
+ type: emptyAllowed
824
851
  ensureOn: [resolveApp]
825
852
  azure:
826
853
  vaultSecretName: secrets-policyPrivateKeyVault
@@ -857,10 +884,17 @@ parameters:
857
884
  # Mori and the dataplane must not share a signing identity. Sharing one means the dataplane
858
885
  # holds a key that mints licences, and the two services have completely different blast
859
886
  # radii. Mori is the licence server; the dataplane runs customer workloads.
887
+ # Supplied, never generated. Mori owns this pair and keeps the private half; an installation
888
+ # that minted it would hold the private half of the key it verifies against and could sign a
889
+ # licence it would then accept. Builder refuses these pairs (aifabrix-builder 211.0 /
890
+ # 5bfeb06d); `rsaKeyPair` here made Miso mint them anyway, because catalog-resolver runs the
891
+ # generator unconditionally and never consults valueSource. `emptyAllowed` is what stops it:
892
+ # the materializer skips isEmptyByDesign rows, so Miso no longer writes this secret at all.
893
+ # It arrives instead as a deploy parameter -- packages.json -> main.bicep ->
894
+ # 08_keyvault-secrets.bicep -> the installation vault -- which is also the only writer that
895
+ # can hold Mori's real key rather than a locally invented one.
860
896
  generator:
861
- type: rsaKeyPair
862
- pairId: mori-license-signing
863
- part: private
897
+ type: emptyAllowed
864
898
  ensureOn: [resolveApp]
865
899
  azure:
866
900
  vaultSecretName: secrets-licensePrivateKeyVault