@wildo-ai/platform-config-lib 1.1.11 → 1.1.12
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.
- package/dist/esm/_unimplemented/soft-warn.d.ts +24 -49
- package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
- package/dist/esm/_unimplemented/soft-warn.js +24 -49
- package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
- package/dist/esm/blueprint/anchored-region.d.ts.map +1 -1
- package/dist/esm/blueprint/anchored-region.js.map +1 -1
- package/dist/esm/blueprint/blueprint.schemas.d.ts +0 -89
- package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -1
- package/dist/esm/blueprint/blueprint.schemas.js.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts +8 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js +15 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +10 -2
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js +10 -2
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.d.ts +21 -0
- package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.js +25 -0
- package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +80 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +81 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -0
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +41 -9
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.js +77 -28
- package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.d.ts +117 -12
- package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.js +222 -23
- package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.d.ts +31 -4
- package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.js +43 -2
- package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +40 -2
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.js +66 -3
- package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-response-integrity.js +3 -3
- package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -1
- package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
- package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -1
- package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/config-authoring.entry.js.map +1 -1
- package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
- package/dist/esm/credentials/credential-generator.service.js.map +1 -1
- package/dist/esm/index.d.ts +5 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts +119 -0
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.js +109 -0
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.js.map +1 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts +182 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.js +145 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.js.map +1 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.d.ts +156 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.d.ts.map +1 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.js +617 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.js.map +1 -0
- package/dist/esm/key-management/approval-seal-verifier.d.ts +101 -39
- package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -1
- package/dist/esm/key-management/approval-seal-verifier.js +134 -12
- package/dist/esm/key-management/approval-seal-verifier.js.map +1 -1
- package/dist/esm/key-management/approval-seal.contracts.d.ts +12 -15
- package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/approval-seal.contracts.js +20 -0
- package/dist/esm/key-management/approval-seal.contracts.js.map +1 -1
- package/dist/esm/key-management/data-key.contracts.d.ts +0 -2
- package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/data-key.contracts.js.map +1 -1
- package/dist/esm/key-management/es256-jws.d.ts.map +1 -1
- package/dist/esm/key-management/es256-jws.js.map +1 -1
- package/dist/esm/key-management/key-provider.spi.d.ts +8 -1
- package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -1
- package/dist/esm/key-management/key-provider.spi.js.map +1 -1
- package/dist/esm/key-management/keyring-rotation.contracts.d.ts +2 -12
- package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/keyring-rotation.contracts.js +3 -3
- package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -1
- package/dist/esm/key-management/keyring-status.contracts.d.ts +0 -7
- package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/keyring-status.contracts.js.map +1 -1
- package/dist/esm/key-management/pdf-incremental-update.d.ts +158 -0
- package/dist/esm/key-management/pdf-incremental-update.d.ts.map +1 -0
- package/dist/esm/key-management/pdf-incremental-update.js +730 -0
- package/dist/esm/key-management/pdf-incremental-update.js.map +1 -0
- package/dist/esm/key-management/pdf-truetype-font.d.ts +35 -0
- package/dist/esm/key-management/pdf-truetype-font.d.ts.map +1 -0
- package/dist/esm/key-management/pdf-truetype-font.js +152 -0
- package/dist/esm/key-management/pdf-truetype-font.js.map +1 -0
- package/dist/esm/key-management/qr-code.d.ts +38 -0
- package/dist/esm/key-management/qr-code.d.ts.map +1 -0
- package/dist/esm/key-management/qr-code.js +325 -0
- package/dist/esm/key-management/qr-code.js.map +1 -0
- package/dist/esm/key-management/signature-request.contracts.d.ts +0 -4
- package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/signature-request.contracts.js.map +1 -1
- package/dist/esm/key-management/signing-log-export.contracts.d.ts +0 -1
- package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -1
- package/dist/esm/key-management/vault-custody.contracts.d.ts +43 -0
- package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/vault-custody.contracts.js +66 -0
- package/dist/esm/key-management/vault-custody.contracts.js.map +1 -1
- package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
- package/dist/esm/lockfile/build-parallelism.js.map +1 -1
- package/dist/esm/lockfile/canonical-json.d.ts +1 -1
- package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
- package/dist/esm/lockfile/canonical-json.js +1 -1
- package/dist/esm/lockfile/canonical-json.js.map +1 -1
- package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
- package/dist/esm/lockfile/file-lock-hold.js +2 -1
- package/dist/esm/lockfile/file-lock-hold.js.map +1 -1
- package/dist/esm/lockfile/lockfile-io.d.ts +6 -8
- package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
- package/dist/esm/lockfile/lockfile-io.js +6 -8
- package/dist/esm/lockfile/lockfile-io.js.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.d.ts +5 -6
- package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.js +4 -5
- package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +1 -247
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
- package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +146 -0
- package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts.map +1 -0
- package/dist/esm/pnpm-settings/application-pnpm-settings.js +573 -0
- package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -0
- package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
- package/dist/esm/project-config/application-public-pricing-catalog.loader.js +15 -3
- package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
- package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -1
- package/dist/esm/project-config/application-served-public-documents.loader.js +16 -8
- package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -1
- package/dist/esm/project-config/backend-compliance-section.reader.d.ts +35 -0
- package/dist/esm/project-config/backend-compliance-section.reader.d.ts.map +1 -0
- package/dist/esm/project-config/backend-compliance-section.reader.js +123 -0
- package/dist/esm/project-config/backend-compliance-section.reader.js.map +1 -0
- package/dist/esm/project-config/backend-compliance-section.worker.d.ts +20 -0
- package/dist/esm/project-config/backend-compliance-section.worker.d.ts.map +1 -0
- package/dist/esm/project-config/backend-compliance-section.worker.js +78 -0
- package/dist/esm/project-config/backend-compliance-section.worker.js.map +1 -0
- package/dist/esm/project-config/config-module-resolution.d.ts +32 -0
- package/dist/esm/project-config/config-module-resolution.d.ts.map +1 -0
- package/dist/esm/project-config/config-module-resolution.js +33 -0
- package/dist/esm/project-config/config-module-resolution.js.map +1 -0
- package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-framework-config.js.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts +109 -55
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.js +108 -70
- package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/define-minion-config.d.ts +26 -36
- package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-minion-config.js +64 -25
- package/dist/esm/project-config/define-minion-config.js.map +1 -1
- package/dist/esm/project-config/define-saas-config.d.ts +41 -437
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js +102 -94
- package/dist/esm/project-config/define-saas-config.js.map +1 -1
- package/dist/esm/project-config/define-worker-config.d.ts +10 -20
- package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-worker-config.js +10 -12
- package/dist/esm/project-config/define-worker-config.js.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.js +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/index.d.ts +2 -0
- package/dist/esm/project-config/index.d.ts.map +1 -1
- package/dist/esm/project-config/index.js +2 -0
- package/dist/esm/project-config/index.js.map +1 -1
- package/dist/esm/project-config/loader-instances-zod.d.ts +19 -0
- package/dist/esm/project-config/loader-instances-zod.d.ts.map +1 -0
- package/dist/esm/project-config/loader-instances-zod.js +40 -0
- package/dist/esm/project-config/loader-instances-zod.js.map +1 -0
- package/dist/esm/project-config/loader.d.ts +131 -14
- package/dist/esm/project-config/loader.d.ts.map +1 -1
- package/dist/esm/project-config/loader.js +226 -12
- package/dist/esm/project-config/loader.js.map +1 -1
- package/dist/esm/project-config/minion-liveness.contracts.d.ts +131 -0
- package/dist/esm/project-config/minion-liveness.contracts.d.ts.map +1 -0
- package/dist/esm/project-config/minion-liveness.contracts.js +167 -0
- package/dist/esm/project-config/minion-liveness.contracts.js.map +1 -0
- package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
- package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
- package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
- package/dist/esm/project-config/npm-version-range.js.map +1 -1
- package/dist/esm/project-config/owning-package-tsconfig.d.ts +7 -7
- package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -1
- package/dist/esm/project-config/owning-package-tsconfig.js +7 -7
- package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.js +3 -1
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +71 -46
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js +150 -4
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +0 -2
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.d.ts +0 -17
- package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts +9 -10
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.js +13 -15
- package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/cdn.schemas.d.ts +0 -51
- package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.d.ts +34 -6
- package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.js +52 -8
- package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.d.ts +60 -13
- package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.js +77 -24
- package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.d.ts +72 -84
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.js +40 -12
- package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.d.ts +0 -8
- package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts +95 -8
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +122 -10
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +10 -4
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +20 -0
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.js +21 -2
- package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
- package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
- package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
- package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +62 -36
- package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-key-management.schemas.js +105 -3
- package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +2 -2
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.js +16 -2
- package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +21 -23
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.js +4 -5
- package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +0 -18
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
- package/dist/esm/project-config/static-asset-import-noop.d.ts +20 -3
- package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
- package/dist/esm/project-config/static-asset-import-noop.js +36 -20
- package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.d.ts +0 -5
- package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
- package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/digest.schemas.js.map +1 -1
- package/dist/esm/registry/index.d.ts +2 -3
- package/dist/esm/registry/index.d.ts.map +1 -1
- package/dist/esm/registry/index.js +2 -3
- package/dist/esm/registry/index.js.map +1 -1
- package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
- package/dist/esm/registry/local-checkout-source.js.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +1 -98
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.js +1 -2
- package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.d.ts +17 -17
- package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.d.ts +151 -219
- package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.js +145 -13
- package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
- package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-search.schemas.js.map +1 -1
- package/dist/esm/registry/registry-config.schemas.d.ts +0 -18
- package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-config.schemas.js.map +1 -1
- package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
- package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
- package/dist/esm/registry/registry-errors.d.ts +81 -3
- package/dist/esm/registry/registry-errors.d.ts.map +1 -1
- package/dist/esm/registry/registry-errors.js +185 -4
- package/dist/esm/registry/registry-errors.js.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
- package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -1
- package/dist/esm/registry/registry-url-resolution.js.map +1 -1
- package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.js.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts +0 -7
- package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.d.ts +2 -2
- package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
- package/dist/esm/workspace-scope/index.d.ts.map +1 -1
- package/dist/esm/workspace-scope/index.js.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/dist/esm/_unimplemented/index.d.ts +0 -3
- package/dist/esm/_unimplemented/index.d.ts.map +0 -1
- package/dist/esm/_unimplemented/index.js +0 -3
- package/dist/esm/_unimplemented/index.js.map +0 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +0 -137
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +0 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.js +0 -153
- package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +0 -1
- package/dist/esm/project-config/shared/cdn.example.d.ts +0 -14
- package/dist/esm/project-config/shared/cdn.example.d.ts.map +0 -1
- package/dist/esm/project-config/shared/cdn.example.js +0 -38
- package/dist/esm/project-config/shared/cdn.example.js.map +0 -1
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts +0 -15
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +0 -1
- package/dist/esm/project-config/shared/schema-version.schemas.js +0 -40
- package/dist/esm/project-config/shared/schema-version.schemas.js.map +0 -1
|
@@ -110,9 +110,7 @@ export declare const PlatformKeyVaultSelfHostedSchema: z.ZodObject<{
|
|
|
110
110
|
/** The operator's own Vault or OpenBao. Mounts and prefix default to the provider defaults (`transit`, `secret`, `wildo-`). */
|
|
111
111
|
export declare const PlatformKeyVaultManagedSchema: z.ZodObject<{
|
|
112
112
|
source: z.ZodLiteral<BackingServiceSource.MANAGED>;
|
|
113
|
-
/** The Vault API address apps-manager dials, e.g. `https://vault.internal:8200`. */
|
|
114
113
|
address: z.ZodURL;
|
|
115
|
-
/** Vault Enterprise namespace (`team/keys/`); absent on open-source Vault and OpenBao's root namespace. */
|
|
116
114
|
namespace: z.ZodOptional<z.ZodString>;
|
|
117
115
|
transitMount: z.ZodOptional<z.ZodString>;
|
|
118
116
|
kvMount: z.ZodOptional<z.ZodString>;
|
|
@@ -122,9 +120,7 @@ export declare const PlatformKeyVaultConfigSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
122
120
|
source: z.ZodLiteral<BackingServiceSource.SELF>;
|
|
123
121
|
}, z.core.$strict>, z.ZodObject<{
|
|
124
122
|
source: z.ZodLiteral<BackingServiceSource.MANAGED>;
|
|
125
|
-
/** The Vault API address apps-manager dials, e.g. `https://vault.internal:8200`. */
|
|
126
123
|
address: z.ZodURL;
|
|
127
|
-
/** Vault Enterprise namespace (`team/keys/`); absent on open-source Vault and OpenBao's root namespace. */
|
|
128
124
|
namespace: z.ZodOptional<z.ZodString>;
|
|
129
125
|
transitMount: z.ZodOptional<z.ZodString>;
|
|
130
126
|
kvMount: z.ZodOptional<z.ZodString>;
|
|
@@ -141,16 +137,12 @@ export declare enum PlatformGoogleKmsKeyProtection {
|
|
|
141
137
|
/** AWS KMS in the operator's account. */
|
|
142
138
|
export declare const PlatformKeyAwsKmsConfigSchema: z.ZodObject<{
|
|
143
139
|
region: z.ZodString;
|
|
144
|
-
/** The role apps-manager assumes to read keys and sign. */
|
|
145
140
|
signerRoleArn: z.ZodString;
|
|
146
|
-
/** The role apps-manager assumes to create, disable and schedule the deletion of keys. */
|
|
147
141
|
operatorRoleArn: z.ZodString;
|
|
148
|
-
/** A KMS endpoint other than the region's public one (a VPC interface endpoint). */
|
|
149
142
|
endpoint: z.ZodOptional<z.ZodURL>;
|
|
150
143
|
}, z.core.$strict>;
|
|
151
144
|
/** Google Cloud KMS in the operator's project. */
|
|
152
145
|
export declare const PlatformKeyGoogleCloudKmsConfigSchema: z.ZodObject<{
|
|
153
|
-
/** `projects/<project>/locations/<location>/keyRings/<ring>`; created by the operator, since a key ring cannot be deleted. */
|
|
154
146
|
keyRing: z.ZodString;
|
|
155
147
|
signerServiceAccount: z.ZodEmail;
|
|
156
148
|
operatorServiceAccount: z.ZodEmail;
|
|
@@ -158,20 +150,24 @@ export declare const PlatformKeyGoogleCloudKmsConfigSchema: z.ZodObject<{
|
|
|
158
150
|
}, z.core.$strict>;
|
|
159
151
|
/** Azure Key Vault (Premium) or Managed HSM in the operator's subscription. */
|
|
160
152
|
export declare const PlatformKeyAzureKeyVaultConfigSchema: z.ZodObject<{
|
|
161
|
-
/** `https://<vault>.vault.azure.net` or `https://<hsm>.managedhsm.azure.net`. */
|
|
162
153
|
vaultUrl: z.ZodURL;
|
|
163
|
-
/** The client id of the signer's user-assigned managed identity. */
|
|
164
154
|
signerClientId: z.ZodUUID;
|
|
165
|
-
/** The client id of the operator's user-assigned managed identity. */
|
|
166
155
|
operatorClientId: z.ZodUUID;
|
|
167
|
-
/** HSM-protected keys (`EC-HSM`, a Premium vault or Managed HSM); `false` makes software `EC` keys. */
|
|
168
156
|
hsm: z.ZodDefault<z.ZodBoolean>;
|
|
169
|
-
/**
|
|
170
|
-
* The Log Analytics workspace (its GUID) the vault's diagnostic setting sends `AuditEvent` to, in the `AzureDiagnostics`
|
|
171
|
-
* destination mode. apps-manager reads it hourly to corroborate its signatures; absent, no Azure hour is compared.
|
|
172
|
-
*/
|
|
173
157
|
logAnalyticsWorkspaceId: z.ZodOptional<z.ZodUUID>;
|
|
174
158
|
}, z.core.$strict>;
|
|
159
|
+
/** The SoftHSM2 module the platform image carries: the one PKCS#11 module a containerised apps-manager has without a mount. */
|
|
160
|
+
export declare const PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH = "/usr/lib/softhsm/libsofthsm2.so";
|
|
161
|
+
/**
|
|
162
|
+
* One file or directory of the HSM vendor's PKCS#11 client, mounted READ-ONLY into apps-manager's container (#3019): the
|
|
163
|
+
* module, its configuration, the client certificates. `hostPath` is on the docker host (compose) or on every node that
|
|
164
|
+
* may run apps-manager (Kubernetes, a `hostPath` volume); `containerPath` is where apps-manager sees it.
|
|
165
|
+
*/
|
|
166
|
+
export declare const PlatformKeyPkcs11ClientFileSchema: z.ZodObject<{
|
|
167
|
+
hostPath: z.ZodString;
|
|
168
|
+
containerPath: z.ZodString;
|
|
169
|
+
}, z.core.$strict>;
|
|
170
|
+
export type PlatformKeyPkcs11ClientFile = z.infer<typeof PlatformKeyPkcs11ClientFileSchema>;
|
|
175
171
|
/**
|
|
176
172
|
* A dedicated HSM reached over PKCS#11 (#2934): Thales Luna, Entrust nShield, AWS CloudHSM, Azure Cloud HSM, an
|
|
177
173
|
* on-premises appliance, or SoftHSM2. apps-manager loads the vendor's PKCS#11 module, logs in to one token with a user PIN
|
|
@@ -181,23 +177,49 @@ export declare const PlatformKeyAzureKeyVaultConfigSchema: z.ZodObject<{
|
|
|
181
177
|
* AND the token's model is listed in `hardwareTokenModels`, which is your statement that this model is the hardware you
|
|
182
178
|
* run. SoftHSM2 is always SOFTWARE. The binding (`pkcs11js`) is compiled by `pnpm setup:pkcs11`; an apps-manager that
|
|
183
179
|
* cannot load it says so at boot and refuses every signature on this provider.
|
|
180
|
+
*
|
|
181
|
+
* ## A real HSM in a containerised platform (#3019)
|
|
182
|
+
*
|
|
183
|
+
* The platform image carries only SoftHSM2. A real HSM's client comes from the host, and every vendor documents the same
|
|
184
|
+
* containerised shape: mount the client library and its configuration READ-ONLY, and point the client at its
|
|
185
|
+
* configuration with the vendor's own variable. So:
|
|
186
|
+
* - `clientFiles` lists what to mount, each `{ hostPath, containerPath }`. compose renders a read-only bind mount and refuses
|
|
187
|
+
* to start the service when the host path is missing; Kubernetes renders a read-only `hostPath` volume, which it mounts
|
|
188
|
+
* unchecked, so the files must exist on every node that may run apps-manager (a missing one shows as a token that cannot
|
|
189
|
+
* be opened, logged at boot). Both apps-manager services get them (INIT and serving).
|
|
190
|
+
* - `environment` carries the vendor's variables (`ChrystokiConfigurationPath` for a Thales Luna client, …). It is
|
|
191
|
+
* rendered in plain text beside the service, so it may hold paths and settings, never a credential; it may not name a
|
|
192
|
+
* variable Wildo sets itself. The token PIN stays in `secrets.json`.
|
|
193
|
+
* - In a container, `modulePath` must be the bundled SoftHSM2 or lie under a `containerPath`. Declaring `clientFiles` says
|
|
194
|
+
* apps-manager runs in a container, so that is refused here; without `clientFiles` it is refused when compose or
|
|
195
|
+
* Kubernetes renders apps-manager, because a framework developer's NATIVE apps-manager loads a host path legitimately
|
|
196
|
+
* (Homebrew's SoftHSM2, `/opt/homebrew/lib/softhsm/libsofthsm2.so`).
|
|
197
|
+
* - Both are for the CONTAINER lanes. A framework developer's native apps-manager runs on the host, where the client is
|
|
198
|
+
* installed and configured as the vendor documents, and receives neither.
|
|
199
|
+
*
|
|
200
|
+
* Example, a Thales Luna client installed under `/usr/safenet/lunaclient` on the host:
|
|
201
|
+
* `{ modulePath: '/usr/safenet/lunaclient/lib/libCryptoki2_64.so', tokenLabel: 'wildo', hardwareTokenModels: ['Luna K7'],
|
|
202
|
+
* clientFiles: [{ hostPath: '/usr/safenet/lunaclient', containerPath: '/usr/safenet/lunaclient' },
|
|
203
|
+
* { hostPath: '/etc/Chrystoki.conf', containerPath: '/etc/Chrystoki.conf' }],
|
|
204
|
+
* environment: { ChrystokiConfigurationPath: '/etc' } }`.
|
|
184
205
|
*/
|
|
185
206
|
export declare const PlatformKeyPkcs11ConfigSchema: z.ZodObject<{
|
|
186
|
-
/** The vendor's PKCS#11 module, as an absolute path in apps-manager's filesystem (e.g. `/usr/lib/softhsm/libsofthsm2.so`). */
|
|
187
207
|
modulePath: z.ZodString;
|
|
188
|
-
/** The token's label, as the module reports it. */
|
|
189
208
|
tokenLabel: z.ZodString;
|
|
190
|
-
/** Token models (`CK_TOKEN_INFO.model`) you state are hardware. Empty: every key reports SOFTWARE. */
|
|
191
209
|
hardwareTokenModels: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
210
|
+
clientFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
211
|
+
hostPath: z.ZodString;
|
|
212
|
+
containerPath: z.ZodString;
|
|
213
|
+
}, z.core.$strict>>>;
|
|
214
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
192
215
|
}, z.core.$strict>;
|
|
216
|
+
export type PlatformKeyPkcs11Config = z.infer<typeof PlatformKeyPkcs11ConfigSchema>;
|
|
193
217
|
export declare const WildoPlatformKeyManagementConfigSchema: z.ZodObject<{
|
|
194
218
|
vault: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
195
219
|
source: z.ZodLiteral<BackingServiceSource.SELF>;
|
|
196
220
|
}, z.core.$strict>, z.ZodObject<{
|
|
197
221
|
source: z.ZodLiteral<BackingServiceSource.MANAGED>;
|
|
198
|
-
/** The Vault API address apps-manager dials, e.g. `https://vault.internal:8200`. */
|
|
199
222
|
address: z.ZodURL;
|
|
200
|
-
/** Vault Enterprise namespace (`team/keys/`); absent on open-source Vault and OpenBao's root namespace. */
|
|
201
223
|
namespace: z.ZodOptional<z.ZodString>;
|
|
202
224
|
transitMount: z.ZodOptional<z.ZodString>;
|
|
203
225
|
kvMount: z.ZodOptional<z.ZodString>;
|
|
@@ -205,46 +227,50 @@ export declare const WildoPlatformKeyManagementConfigSchema: z.ZodObject<{
|
|
|
205
227
|
}, z.core.$strict>], "source">>;
|
|
206
228
|
awsKms: z.ZodOptional<z.ZodObject<{
|
|
207
229
|
region: z.ZodString;
|
|
208
|
-
/** The role apps-manager assumes to read keys and sign. */
|
|
209
230
|
signerRoleArn: z.ZodString;
|
|
210
|
-
/** The role apps-manager assumes to create, disable and schedule the deletion of keys. */
|
|
211
231
|
operatorRoleArn: z.ZodString;
|
|
212
|
-
/** A KMS endpoint other than the region's public one (a VPC interface endpoint). */
|
|
213
232
|
endpoint: z.ZodOptional<z.ZodURL>;
|
|
214
233
|
}, z.core.$strict>>;
|
|
215
234
|
googleCloudKms: z.ZodOptional<z.ZodObject<{
|
|
216
|
-
/** `projects/<project>/locations/<location>/keyRings/<ring>`; created by the operator, since a key ring cannot be deleted. */
|
|
217
235
|
keyRing: z.ZodString;
|
|
218
236
|
signerServiceAccount: z.ZodEmail;
|
|
219
237
|
operatorServiceAccount: z.ZodEmail;
|
|
220
238
|
protectionLevel: z.ZodDefault<z.ZodEnum<typeof PlatformGoogleKmsKeyProtection>>;
|
|
221
239
|
}, z.core.$strict>>;
|
|
222
240
|
azureKeyVault: z.ZodOptional<z.ZodObject<{
|
|
223
|
-
/** `https://<vault>.vault.azure.net` or `https://<hsm>.managedhsm.azure.net`. */
|
|
224
241
|
vaultUrl: z.ZodURL;
|
|
225
|
-
/** The client id of the signer's user-assigned managed identity. */
|
|
226
242
|
signerClientId: z.ZodUUID;
|
|
227
|
-
/** The client id of the operator's user-assigned managed identity. */
|
|
228
243
|
operatorClientId: z.ZodUUID;
|
|
229
|
-
/** HSM-protected keys (`EC-HSM`, a Premium vault or Managed HSM); `false` makes software `EC` keys. */
|
|
230
244
|
hsm: z.ZodDefault<z.ZodBoolean>;
|
|
231
|
-
/**
|
|
232
|
-
* The Log Analytics workspace (its GUID) the vault's diagnostic setting sends `AuditEvent` to, in the `AzureDiagnostics`
|
|
233
|
-
* destination mode. apps-manager reads it hourly to corroborate its signatures; absent, no Azure hour is compared.
|
|
234
|
-
*/
|
|
235
245
|
logAnalyticsWorkspaceId: z.ZodOptional<z.ZodUUID>;
|
|
236
246
|
}, z.core.$strict>>;
|
|
237
247
|
pkcs11: z.ZodOptional<z.ZodObject<{
|
|
238
|
-
/** The vendor's PKCS#11 module, as an absolute path in apps-manager's filesystem (e.g. `/usr/lib/softhsm/libsofthsm2.so`). */
|
|
239
248
|
modulePath: z.ZodString;
|
|
240
|
-
/** The token's label, as the module reports it. */
|
|
241
249
|
tokenLabel: z.ZodString;
|
|
242
|
-
/** Token models (`CK_TOKEN_INFO.model`) you state are hardware. Empty: every key reports SOFTWARE. */
|
|
243
250
|
hardwareTokenModels: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
251
|
+
clientFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
252
|
+
hostPath: z.ZodString;
|
|
253
|
+
containerPath: z.ZodString;
|
|
254
|
+
}, z.core.$strict>>>;
|
|
255
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
244
256
|
}, z.core.$strict>>;
|
|
245
257
|
}, z.core.$strict>;
|
|
246
258
|
export type WildoPlatformKeyManagementConfig = z.infer<typeof WildoPlatformKeyManagementConfigSchema>;
|
|
247
259
|
/** @wildo_source:part:end platform.config.platform-key-management */
|
|
260
|
+
/** What deciding a module's reachability needs: the module, and where the client files are mounted. */
|
|
261
|
+
export interface Pkcs11ModuleMountView {
|
|
262
|
+
readonly modulePath: string;
|
|
263
|
+
readonly clientFiles?: readonly {
|
|
264
|
+
readonly containerPath: string;
|
|
265
|
+
}[];
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Whether apps-manager, running in the PLATFORM IMAGE, can load `modulePath`: it is the bundled SoftHSM2, or it lies at or
|
|
269
|
+
* under one of the declared `clientFiles[].containerPath`. Nothing else exists in that container.
|
|
270
|
+
*/
|
|
271
|
+
export declare function pkcs11ModuleIsReachableInPlatformContainer(pkcs11: Pkcs11ModuleMountView): boolean;
|
|
272
|
+
/** The refusal both container lanes (compose, Kubernetes) raise for an unreachable module, naming the declaration. */
|
|
273
|
+
export declare function describeUnreachablePkcs11Module(pkcs11: Pkcs11ModuleMountView, environmentName?: string): string;
|
|
248
274
|
/** Whether the platform runs its own Vault (OpenBao) in this environment: the one predicate both lanes render from. */
|
|
249
275
|
export declare function selfHostsPlatformKeyVault(platformKeyManagement: WildoPlatformKeyManagementConfig | undefined): boolean;
|
|
250
276
|
//# sourceMappingURL=platform-key-management.schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-key-management.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-key-management.schemas.d.ts","sourceRoot":"","sources":["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M,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAMjD,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC;AAEtG,qEAAqE;AAErE,uGAAuG;AACvG,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS;QAAE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACtE;AAiBD;;;GAGG;AACH,wBAAgB,0CAA0C,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAMjG;AAED,sHAAsH;AACtH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,qBAAqB,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAO/G;AAED,uHAAuH;AACvH,wBAAgB,yBAAyB,CAAC,qBAAqB,EAAE,gCAAgC,GAAG,SAAS,GAAG,OAAO,CAEtH"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { PlatformAdminEnvKey, PlatformDocumentationSiteEnvKey, PlatformEmailEnvKey, PlatformInfrastructureEnvKey, PlatformIngressEnvKey, PlatformKubernetesEnvKey, PlatformLoggingEnvKey, PlatformObservabilityEnvKey, PlatformOwnershipDnsEnvKey, PlatformProcessEnvKey, PlatformProviderSelectionEnvKey, PlatformSecurityEnvKey, PlatformServiceUrlEnvKey, } from '../../bootstrap/platform-runtime-env.contracts.js';
|
|
2
3
|
import { BackingServiceSource } from './backing-services.schemas.js';
|
|
3
4
|
/** @wildo_source:part:start platform.config.platform-key-management facet:layer:platform facet:family:infra facet:audience:app-developer */
|
|
4
5
|
/**
|
|
@@ -161,6 +162,24 @@ export const PlatformKeyAzureKeyVaultConfigSchema = z.strictObject({
|
|
|
161
162
|
*/
|
|
162
163
|
logAnalyticsWorkspaceId: z.uuid().optional(),
|
|
163
164
|
});
|
|
165
|
+
/** The SoftHSM2 module the platform image carries: the one PKCS#11 module a containerised apps-manager has without a mount. */
|
|
166
|
+
export const PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH = '/usr/lib/softhsm/libsofthsm2.so';
|
|
167
|
+
/** An absolute path with no `.` or `..` segment, so "is this path inside that mount" is a plain prefix question. */
|
|
168
|
+
const AbsoluteNormalPathSchema = z
|
|
169
|
+
.string()
|
|
170
|
+
.regex(/^\//, 'an absolute path')
|
|
171
|
+
.refine((path) => !/(^|\/)\.{1,2}(\/|$)/.test(path), 'a path with no `.` or `..` segment');
|
|
172
|
+
/** Where the platform image keeps apps-manager itself: a mount here (or over `/`) would hide the service it serves. */
|
|
173
|
+
const PLATFORM_IMAGE_APPLICATION_ROOT = '/app';
|
|
174
|
+
/**
|
|
175
|
+
* One file or directory of the HSM vendor's PKCS#11 client, mounted READ-ONLY into apps-manager's container (#3019): the
|
|
176
|
+
* module, its configuration, the client certificates. `hostPath` is on the docker host (compose) or on every node that
|
|
177
|
+
* may run apps-manager (Kubernetes, a `hostPath` volume); `containerPath` is where apps-manager sees it.
|
|
178
|
+
*/
|
|
179
|
+
export const PlatformKeyPkcs11ClientFileSchema = z.strictObject({
|
|
180
|
+
hostPath: AbsoluteNormalPathSchema,
|
|
181
|
+
containerPath: AbsoluteNormalPathSchema.refine((path) => path !== '/' && path.replace(/\/+$/, '') !== PLATFORM_IMAGE_APPLICATION_ROOT && !path.startsWith(`${PLATFORM_IMAGE_APPLICATION_ROOT}/`), `a path outside \`/\` and \`${PLATFORM_IMAGE_APPLICATION_ROOT}\` (the platform image keeps apps-manager there)`),
|
|
182
|
+
});
|
|
164
183
|
/**
|
|
165
184
|
* A dedicated HSM reached over PKCS#11 (#2934): Thales Luna, Entrust nShield, AWS CloudHSM, Azure Cloud HSM, an
|
|
166
185
|
* on-premises appliance, or SoftHSM2. apps-manager loads the vendor's PKCS#11 module, logs in to one token with a user PIN
|
|
@@ -170,14 +189,63 @@ export const PlatformKeyAzureKeyVaultConfigSchema = z.strictObject({
|
|
|
170
189
|
* AND the token's model is listed in `hardwareTokenModels`, which is your statement that this model is the hardware you
|
|
171
190
|
* run. SoftHSM2 is always SOFTWARE. The binding (`pkcs11js`) is compiled by `pnpm setup:pkcs11`; an apps-manager that
|
|
172
191
|
* cannot load it says so at boot and refuses every signature on this provider.
|
|
192
|
+
*
|
|
193
|
+
* ## A real HSM in a containerised platform (#3019)
|
|
194
|
+
*
|
|
195
|
+
* The platform image carries only SoftHSM2. A real HSM's client comes from the host, and every vendor documents the same
|
|
196
|
+
* containerised shape: mount the client library and its configuration READ-ONLY, and point the client at its
|
|
197
|
+
* configuration with the vendor's own variable. So:
|
|
198
|
+
* - `clientFiles` lists what to mount, each `{ hostPath, containerPath }`. compose renders a read-only bind mount and refuses
|
|
199
|
+
* to start the service when the host path is missing; Kubernetes renders a read-only `hostPath` volume, which it mounts
|
|
200
|
+
* unchecked, so the files must exist on every node that may run apps-manager (a missing one shows as a token that cannot
|
|
201
|
+
* be opened, logged at boot). Both apps-manager services get them (INIT and serving).
|
|
202
|
+
* - `environment` carries the vendor's variables (`ChrystokiConfigurationPath` for a Thales Luna client, …). It is
|
|
203
|
+
* rendered in plain text beside the service, so it may hold paths and settings, never a credential; it may not name a
|
|
204
|
+
* variable Wildo sets itself. The token PIN stays in `secrets.json`.
|
|
205
|
+
* - In a container, `modulePath` must be the bundled SoftHSM2 or lie under a `containerPath`. Declaring `clientFiles` says
|
|
206
|
+
* apps-manager runs in a container, so that is refused here; without `clientFiles` it is refused when compose or
|
|
207
|
+
* Kubernetes renders apps-manager, because a framework developer's NATIVE apps-manager loads a host path legitimately
|
|
208
|
+
* (Homebrew's SoftHSM2, `/opt/homebrew/lib/softhsm/libsofthsm2.so`).
|
|
209
|
+
* - Both are for the CONTAINER lanes. A framework developer's native apps-manager runs on the host, where the client is
|
|
210
|
+
* installed and configured as the vendor documents, and receives neither.
|
|
211
|
+
*
|
|
212
|
+
* Example, a Thales Luna client installed under `/usr/safenet/lunaclient` on the host:
|
|
213
|
+
* `{ modulePath: '/usr/safenet/lunaclient/lib/libCryptoki2_64.so', tokenLabel: 'wildo', hardwareTokenModels: ['Luna K7'],
|
|
214
|
+
* clientFiles: [{ hostPath: '/usr/safenet/lunaclient', containerPath: '/usr/safenet/lunaclient' },
|
|
215
|
+
* { hostPath: '/etc/Chrystoki.conf', containerPath: '/etc/Chrystoki.conf' }],
|
|
216
|
+
* environment: { ChrystokiConfigurationPath: '/etc' } }`.
|
|
173
217
|
*/
|
|
174
|
-
export const PlatformKeyPkcs11ConfigSchema = z
|
|
175
|
-
|
|
218
|
+
export const PlatformKeyPkcs11ConfigSchema = z
|
|
219
|
+
.strictObject({
|
|
220
|
+
/**
|
|
221
|
+
* The vendor's PKCS#11 module, as an absolute path in apps-manager's filesystem: in the platform image, the bundled
|
|
222
|
+
* `/usr/lib/softhsm/libsofthsm2.so` or a path under a `clientFiles[].containerPath`.
|
|
223
|
+
*/
|
|
176
224
|
modulePath: z.string().regex(/^\//, 'an absolute path'),
|
|
177
225
|
/** The token's label, as the module reports it. */
|
|
178
226
|
tokenLabel: z.string().min(1).max(32),
|
|
179
227
|
/** Token models (`CK_TOKEN_INFO.model`) you state are hardware. Empty: every key reports SOFTWARE. */
|
|
180
228
|
hardwareTokenModels: z.array(z.string().min(1)).default([]),
|
|
229
|
+
/** The vendor client's files, mounted read-only into apps-manager's container (#3019). */
|
|
230
|
+
clientFiles: z.array(PlatformKeyPkcs11ClientFileSchema).optional(),
|
|
231
|
+
/** The vendor client's own environment variables (no credential, and no variable Wildo sets). */
|
|
232
|
+
environment: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/, 'an environment variable name'), z.string()).optional(),
|
|
233
|
+
})
|
|
234
|
+
.superRefine((pkcs11, context) => {
|
|
235
|
+
const containerPaths = (pkcs11.clientFiles ?? []).map((file) => file.containerPath.replace(/\/+$/, ''));
|
|
236
|
+
containerPaths.forEach((containerPath, index) => {
|
|
237
|
+
if (containerPaths.indexOf(containerPath) !== index) {
|
|
238
|
+
context.addIssue({ code: 'custom', path: ['clientFiles', index, 'containerPath'], message: `"${containerPath}" is mounted twice` });
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
for (const name of Object.keys(pkcs11.environment ?? {})) {
|
|
242
|
+
if (WILDO_OWNED_PLATFORM_ENV_KEYS.has(name)) {
|
|
243
|
+
context.addIssue({ code: 'custom', path: ['environment', name], message: `"${name}" is a variable Wildo sets on apps-manager itself` });
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (containerPaths.length > 0 && !pkcs11ModuleIsReachableInPlatformContainer(pkcs11)) {
|
|
247
|
+
context.addIssue({ code: 'custom', path: ['modulePath'], message: describeUnreachablePkcs11Module(pkcs11) });
|
|
248
|
+
}
|
|
181
249
|
});
|
|
182
250
|
export const WildoPlatformKeyManagementConfigSchema = z.strictObject({
|
|
183
251
|
vault: PlatformKeyVaultConfigSchema.optional(),
|
|
@@ -186,7 +254,41 @@ export const WildoPlatformKeyManagementConfigSchema = z.strictObject({
|
|
|
186
254
|
azureKeyVault: PlatformKeyAzureKeyVaultConfigSchema.optional(),
|
|
187
255
|
pkcs11: PlatformKeyPkcs11ConfigSchema.optional(),
|
|
188
256
|
});
|
|
189
|
-
/**
|
|
257
|
+
/**
|
|
258
|
+
* Every environment variable Wildo itself sets on a platform process. A vendor `environment` entry may name none of them:
|
|
259
|
+
* it would overwrite the platform's own value (a PIN, a connection string, the service's mode), and the vendor block is
|
|
260
|
+
* rendered in plain text beside the service, never into a Secret.
|
|
261
|
+
*/
|
|
262
|
+
const WILDO_OWNED_PLATFORM_ENV_KEYS = new Set([
|
|
263
|
+
...[
|
|
264
|
+
PlatformProcessEnvKey, PlatformServiceUrlEnvKey, PlatformInfrastructureEnvKey, PlatformSecurityEnvKey, PlatformAdminEnvKey,
|
|
265
|
+
PlatformKubernetesEnvKey, PlatformIngressEnvKey, PlatformLoggingEnvKey, PlatformObservabilityEnvKey, PlatformProviderSelectionEnvKey,
|
|
266
|
+
PlatformEmailEnvKey, PlatformOwnershipDnsEnvKey, PlatformDocumentationSiteEnvKey,
|
|
267
|
+
].flatMap((vocabulary) => Object.values(vocabulary)),
|
|
268
|
+
// Set literally by the deployment templates rather than through the env contract.
|
|
269
|
+
'PLATFORM_SERVICE', 'NODE_OPTIONS', 'NODE_ENV',
|
|
270
|
+
]);
|
|
271
|
+
/**
|
|
272
|
+
* Whether apps-manager, running in the PLATFORM IMAGE, can load `modulePath`: it is the bundled SoftHSM2, or it lies at or
|
|
273
|
+
* under one of the declared `clientFiles[].containerPath`. Nothing else exists in that container.
|
|
274
|
+
*/
|
|
275
|
+
export function pkcs11ModuleIsReachableInPlatformContainer(pkcs11) {
|
|
276
|
+
if (pkcs11.modulePath === PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH)
|
|
277
|
+
return true;
|
|
278
|
+
return (pkcs11.clientFiles ?? []).some(({ containerPath }) => {
|
|
279
|
+
const mountRoot = containerPath.replace(/\/+$/, '');
|
|
280
|
+
return pkcs11.modulePath === mountRoot || pkcs11.modulePath.startsWith(`${mountRoot}/`);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
/** The refusal both container lanes (compose, Kubernetes) raise for an unreachable module, naming the declaration. */
|
|
284
|
+
export function describeUnreachablePkcs11Module(pkcs11, environmentName) {
|
|
285
|
+
const mounts = (pkcs11.clientFiles ?? []).map((file) => file.containerPath);
|
|
286
|
+
return `${environmentName ? `Environment "${environmentName}": ` : ''}platformKeyManagement.pkcs11.modulePath "${pkcs11.modulePath}" `
|
|
287
|
+
+ `is not the SoftHSM2 module the platform image carries (${PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH}) and lies under no `
|
|
288
|
+
+ `platformKeyManagement.pkcs11.clientFiles[].containerPath (${mounts.length > 0 ? mounts.join(', ') : 'none declared'}). `
|
|
289
|
+
+ 'apps-manager runs in the platform image, where nothing else exists: declare the vendor\'s module (and its configuration) '
|
|
290
|
+
+ 'in clientFiles as { hostPath, containerPath } and point modulePath inside one of them.';
|
|
291
|
+
}
|
|
190
292
|
/** Whether the platform runs its own Vault (OpenBao) in this environment: the one predicate both lanes render from. */
|
|
191
293
|
export function selfHostsPlatformKeyVault(platformKeyManagement) {
|
|
192
294
|
return platformKeyManagement?.vault?.source === BackingServiceSource.SELF;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-key-management.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/platform-key-management.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,4IAA4I;AAC5I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7D,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC;CAC7C,CAAC,CAAC;AAEH,+HAA+H;AAC/H,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC1D,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC;IAC/C,oFAAoF;IACpF,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE;IAChB,2GAA2G;IAC3G,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACvC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CA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Q,EAAE;CACjD,CAAC,CAAC;AAGH,qEAAqE;AAErE,uHAAuH;AACvH,MAAM,UAAU,yBAAyB,CAAC,qBAAmE;IAC3G,OAAO,qBAAqB,EAAE,KAAK,EAAE,MAAM,KAAK,oBAAoB,CAAC,IAAI,CAAC;AAC5E,CAAC","sourcesContent":["import { z } from 'zod';\n\nimport { BackingServiceSource } from './backing-services.schemas';\n\n/** @wildo_source:part:start platform.config.platform-key-management facet:layer:platform facet:family:infra facet:audience:app-developer */\n/**\n * # Where the platform keeps the keys it holds for applications (#2933)\n *\n * apps-manager is the custodian of every platform-held key (approval seals, signature requests, and the wrapping keys\n * of an application's sealed secrets, #2894). Without this block it\n * seals them under its own key-encryption root (the LOCAL provider). With it, apps-manager also serves the\n * `vault-transit` and `vault-kv` key providers, and an application's key binding may name one of them.\n *\n * This is a PLATFORM-tier declaration, like `platformStorage`: one apps-manager holds one Vault, whatever application\n * an environment file belongs to. It is deliberately not a `backingServices` kind. A backing service is something an\n * application runtime dials, with credentials minted per application; no application runtime ever reaches this Vault,\n * and nothing is minted per application in it.\n *\n * - `{ vault: { source: 'self' } }` — the CLI renders a single-node OpenBao (the MPL-licensed Vault fork, API\n * compatible for everything used) beside apps-manager, in docker compose and in Kubernetes. It unseals itself from a\n * framework-managed key and configures itself on its first start: the Transit and KV mounts, the two least-privilege\n * policies, and the two tokens apps-manager speaks with. Good for development and for a small self-hosted platform;\n * its protection is SOFTWARE, as every Vault's is. Its self-initialization runs only on EMPTY storage, so an OpenBao\n * first started before a policy changed keeps the older policy: one started before #2894 cannot wrap data keys\n * (`transit/encrypt` and `transit/decrypt` answer 403) until the signer policy is written again (`bao policy write`\n * with `vaultSignerPolicy`) or its storage is recreated.\n * - `{ vault: { source: 'managed', address, … } }` — the operator's own Vault or OpenBao. The operator configures the\n * mounts and policies (`vaultSignerPolicy` / `vaultOperatorPolicy` in the key-management contracts) and puts the two\n * tokens in `secrets.json` under `platformKeyVaultManaged`.\n *\n * Absent, apps-manager serves no Vault provider, and a binding that names one is refused PROVIDER_UNAVAILABLE.\n *\n * ## Cloud KMS (#2896)\n *\n * `awsKms`, `googleCloudKms` and `azureKeyVault` make apps-manager serve the `aws-kms`, `google-cloud-kms` and\n * `azure-key-vault` providers: the key is generated inside the vendor's HSM, never leaves it, and the vendor signs. They\n * are always the operator's own account, so they carry no `source`. apps-manager authenticates with its WORKLOAD\n * identity (an IAM role for its service account, GKE workload identity, an Azure managed identity): nothing here is a\n * secret, and `secrets.json` holds nothing for them.\n *\n * Each provider acts as two identities, as Vault does with two tokens. The SIGNER may only read keys, sign, and wrap and\n * unwrap data keys under a wrapping key (#2894); the OPERATOR creates, disables and destroys keys and may never sign, wrap\n * or unwrap. Every wrap is authenticated encryption under a key only the vendor holds. Neither vendor's broad built-in role keeps to that, so\n * grant, per vendor:\n * - AWS: apps-manager's identity may only `sts:AssumeRole` the two roles. Every key apps-manager creates carries the tag\n * `wildo:key-ref`, and the policies are scoped by it:\n * - Signer, on `arn:aws:kms:<region>:<account>:key/*`: `kms:Sign`, `kms:Encrypt` and `kms:Decrypt` only where\n * `aws:ResourceTag/wildo:key-ref` is present (`\"Null\": { … \"false\" }`), so it cannot sign with, or decrypt under,\n * another key in the account; `kms:GetPublicKey` and `kms:DescribeKey` unconditioned (both read-only).\n * - Operator: `kms:CreateKey` and `kms:TagResource` on `\"Resource\": \"*\"` (CreateKey names no key yet), only where\n * `aws:RequestTag/wildo:key-ref` is present and `aws:TagKeys` is exactly `[\"wildo:key-ref\"]`; on `key/*`,\n * `kms:DisableKey` and `kms:ScheduleKeyDeletion` only where `aws:ResourceTag/wildo:key-ref` is present, and\n * `kms:DescribeKey`; never `kms:Sign`, `kms:Encrypt`, `kms:Decrypt` nor `kms:UntagResource`.\n * - The tag is what admits a key to the signer, so whoever may tag may admit: the operator's `kms:TagResource` lets it\n * put `wildo:key-ref` on ANY key in the account, which the signer could then sign with. AWS warns of exactly this\n * (\"Be cautious about giving principals the `kms:TagResource` … permissions\"). Keep the operator role to apps-manager\n * alone, and consider a permissions boundary or SCP denying `kms:TagResource` on keys outside the custodian's.\n * - KMS applies a tag to authorization up to five minutes after it is set, so a NEW version may be refused `kms:Sign`\n * for those minutes: the first ACTIVE version of every new keyring (made at its first signature request), and one\n * made by an emergency rotation. The signature fails as a provider fault and the caller retries it; so does the first\n * wrap under a new wrapping key, which the application's data-key ring asks for again on its own retry.\n * - Google: apps-manager's identity holds `roles/iam.serviceAccountTokenCreator` on the two service accounts only.\n * Signer: `roles/cloudkms.signer`, `roles/cloudkms.cryptoKeyEncrypterDecrypter`, `roles/cloudkms.publicKeyViewer` and\n * `roles/cloudkms.viewer` on the key ring (sign, wrap and unwrap data keys, read the public key, read a version's state). Operator: `roles/cloudkms.admin` on the key ring, which contains no\n * cryptographic operation.\n * - Azure Key Vault (a vault in the Azure RBAC permission model): two user-assigned managed identities on apps-manager,\n * each with a CUSTOM role on the vault. The built-in roles do not fit: \"Key Vault Crypto User\" can update and back up a\n * key, and \"Key Vault Crypto Officer\" holds `vaults/keys/*`, signing included.\n * - Signer: `Microsoft.KeyVault/vaults/keys/read`, `…/keys/versions/read`, `…/keys/sign/action`,\n * `…/keys/encrypt/action`, `…/keys/decrypt/action` (a data key is wrapped with A256GCM under an `oct-HSM` key, which\n * a Premium vault offers in preview; a Standard vault cannot hold one and serves signing only).\n * - Operator: `…/keys/read`, `…/keys/versions/read`, `…/keys/create/action`, `…/keys/update/action` (disable),\n * `…/keys/delete`, `…/keys/purge/action`.\n * The vault's recovery level decides whether a destroyed key is purged at once or kept until retention ends.\n * - Azure Managed HSM (`*.managedhsm.azure.net`): the same two identities, with custom roles in the HSM's LOCAL RBAC\n * (the built-in \"Managed HSM Crypto User\" can sign and back up, and cannot purge). Signer:\n * `Microsoft.KeyVault/managedHsm/keys/read/action`, `…/keys/sign/action`, `…/keys/encrypt/action`, `…/keys/decrypt/action`.\n * Operator: `…/keys/read/action`,\n * `…/keys/create`, `…/keys/write/action`, `…/keys/delete`, `…/keys/deletedKeys/read/action`,\n * `…/keys/deletedKeys/delete` (purge).\n *\n * spec-cite: AWS KMS developer guide, \"Use tags to control access to KMS keys\" (`aws:ResourceTag`, the five-minute\n * delay, limiting `kms:TagResource` with `aws:RequestTag` / `aws:TagKeys`),\n * https://docs.aws.amazon.com/kms/latest/developerguide/tag-authorization.html; AWS KMS permissions reference\n * (`CreateKey`'s resource is `*`), https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html; Azure built-in roles, Security (Key\n * Vault Crypto Officer DataActions `Microsoft.KeyVault/vaults/keys/*`) and Azure permissions, Microsoft.KeyVault (the\n * `vaults/keys/*` data actions), https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles/security;\n * Managed HSM local RBAC built-in roles (the data-action table),\n * https://learn.microsoft.com/en-us/azure/key-vault/managed-hsm/built-in-roles.\n *\n * When a provider registers at startup, apps-manager logs the vendor's quota and per-request cost. It also holds its own\n * signing under 80% of the vendor's per-second quota, per process.\n *\n * ## Corroboration\n *\n * Every ten minutes, apps-manager compares, per key version and closed hour, the signatures its signing log records with\n * the ones the vendor's own audit log records, and writes one audit row per provider and hour:\n * - UNACCOUNTED (CRITICAL) the moment the vendor shows more signatures than apps-manager can account for: a key was used\n * outside the custodian, or a signature went unrecorded;\n * - otherwise, once the hour is six hours old (vendor logs arrive late): UNCORROBORATED (the vendor recorded fewer, or its\n * log could not be read) or CORROBORATED.\n * It reads as the OPERATOR identity, which therefore also needs:\n * - AWS: `cloudtrail:LookupEvents` (KMS `Sign` is a CloudTrail management event; nothing to enable).\n * - Google: `roles/logging.privateLogViewer` on the project, and Cloud KMS Data Access audit logs ENABLED (they are off by\n * default, and until they are on, every hour is uncorroborated).\n * - Azure: Log Analytics Reader on the workspace named by `logAnalyticsWorkspaceId`, which the vault's diagnostic setting\n * sends `AuditEvent` to.\n */\nexport const PlatformKeyVaultSelfHostedSchema = z.strictObject({\n source: z.literal(BackingServiceSource.SELF),\n});\n\n/** The operator's own Vault or OpenBao. Mounts and prefix default to the provider defaults (`transit`, `secret`, `wildo-`). */\nexport const PlatformKeyVaultManagedSchema = z.strictObject({\n source: z.literal(BackingServiceSource.MANAGED),\n /** The Vault API address apps-manager dials, e.g. `https://vault.internal:8200`. */\n address: z.url(),\n /** Vault Enterprise namespace (`team/keys/`); absent on open-source Vault and OpenBao's root namespace. */\n namespace: z.string().min(1).optional(),\n transitMount: z.string().min(1).optional(),\n kvMount: z.string().min(1).optional(),\n keyNamePrefix: z.string().min(1).optional(),\n});\n\nexport const PlatformKeyVaultConfigSchema = z.discriminatedUnion('source', [PlatformKeyVaultSelfHostedSchema, PlatformKeyVaultManagedSchema]);\nexport type PlatformKeyVaultConfig = z.infer<typeof PlatformKeyVaultConfigSchema>;\n\n/** The protection level apps-manager creates Google Cloud KMS keys at. */\nexport enum PlatformGoogleKmsKeyProtection {\n /** In Cloud HSM (FIPS 140-2 Level 3): the key's attestation is HARDWARE. */\n HSM = 'HSM',\n /** In Cloud KMS software: the key's attestation is SOFTWARE, and a HARDWARE floor refuses it. */\n SOFTWARE = 'SOFTWARE',\n}\n\n/** AWS KMS in the operator's account. */\nexport const PlatformKeyAwsKmsConfigSchema = z.strictObject({\n region: z.string().regex(/^[a-z]{2}(-[a-z]+)+-\\d$/),\n /** The role apps-manager assumes to read keys and sign. */\n signerRoleArn: z.string().regex(/^arn:aws[a-z-]*:iam::\\d{12}:role\\/.+$/),\n /** The role apps-manager assumes to create, disable and schedule the deletion of keys. */\n operatorRoleArn: z.string().regex(/^arn:aws[a-z-]*:iam::\\d{12}:role\\/.+$/),\n /** A KMS endpoint other than the region's public one (a VPC interface endpoint). */\n endpoint: z.url().optional(),\n});\n\n/** Google Cloud KMS in the operator's project. */\nexport const PlatformKeyGoogleCloudKmsConfigSchema = z.strictObject({\n /** `projects/<project>/locations/<location>/keyRings/<ring>`; created by the operator, since a key ring cannot be deleted. */\n keyRing: z.string().regex(/^projects\\/[^/]+\\/locations\\/[^/]+\\/keyRings\\/[^/]+$/),\n signerServiceAccount: z.email(),\n operatorServiceAccount: z.email(),\n protectionLevel: z.enum(PlatformGoogleKmsKeyProtection).default(PlatformGoogleKmsKeyProtection.HSM),\n});\n\n/** Azure Key Vault (Premium) or Managed HSM in the operator's subscription. */\nexport const PlatformKeyAzureKeyVaultConfigSchema = z.strictObject({\n /** `https://<vault>.vault.azure.net` or `https://<hsm>.managedhsm.azure.net`. */\n vaultUrl: z.url(),\n /** The client id of the signer's user-assigned managed identity. */\n signerClientId: z.uuid(),\n /** The client id of the operator's user-assigned managed identity. */\n operatorClientId: z.uuid(),\n /** HSM-protected keys (`EC-HSM`, a Premium vault or Managed HSM); `false` makes software `EC` keys. */\n hsm: z.boolean().default(true),\n /**\n * The Log Analytics workspace (its GUID) the vault's diagnostic setting sends `AuditEvent` to, in the `AzureDiagnostics`\n * destination mode. apps-manager reads it hourly to corroborate its signatures; absent, no Azure hour is compared.\n */\n logAnalyticsWorkspaceId: z.uuid().optional(),\n});\n\n/**\n * A dedicated HSM reached over PKCS#11 (#2934): Thales Luna, Entrust nShield, AWS CloudHSM, Azure Cloud HSM, an\n * on-premises appliance, or SoftHSM2. apps-manager loads the vendor's PKCS#11 module, logs in to one token with a user PIN\n * (operator-typed in `secrets.json` under `platformKeyPkcs11: { pin }`, never here) and serves the `pkcs11` provider.\n *\n * Protection is read from the token, not declared: a key counts as HARDWARE only when the slot reports a hardware slot\n * AND the token's model is listed in `hardwareTokenModels`, which is your statement that this model is the hardware you\n * run. SoftHSM2 is always SOFTWARE. The binding (`pkcs11js`) is compiled by `pnpm setup:pkcs11`; an apps-manager that\n * cannot load it says so at boot and refuses every signature on this provider.\n */\nexport const PlatformKeyPkcs11ConfigSchema = z.strictObject({\n /** The vendor's PKCS#11 module, as an absolute path in apps-manager's filesystem (e.g. `/usr/lib/softhsm/libsofthsm2.so`). */\n modulePath: z.string().regex(/^\\//, 'an absolute path'),\n /** The token's label, as the module reports it. */\n tokenLabel: z.string().min(1).max(32),\n /** Token models (`CK_TOKEN_INFO.model`) you state are hardware. Empty: every key reports SOFTWARE. */\n hardwareTokenModels: z.array(z.string().min(1)).default([]),\n});\n\nexport const WildoPlatformKeyManagementConfigSchema = z.strictObject({\n vault: PlatformKeyVaultConfigSchema.optional(),\n awsKms: PlatformKeyAwsKmsConfigSchema.optional(),\n googleCloudKms: PlatformKeyGoogleCloudKmsConfigSchema.optional(),\n azureKeyVault: PlatformKeyAzureKeyVaultConfigSchema.optional(),\n pkcs11: PlatformKeyPkcs11ConfigSchema.optional(),\n});\nexport type WildoPlatformKeyManagementConfig = z.infer<typeof WildoPlatformKeyManagementConfigSchema>;\n\n/** @wildo_source:part:end platform.config.platform-key-management */\n\n/** Whether the platform runs its own Vault (OpenBao) in this environment: the one predicate both lanes render from. */\nexport function selfHostsPlatformKeyVault(platformKeyManagement: WildoPlatformKeyManagementConfig | undefined): boolean {\n return platformKeyManagement?.vault?.source === BackingServiceSource.SELF;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"platform-key-management.schemas.js","sourceRoot":"","sources":["../../../../src/project-config/shared/platform-key-management.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,mBAAmB,EACnB,4BAA4B,EAC5B,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,+BAA+B,EAC/B,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,4IAA4I;AAC5I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7D,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;AACL,CAAC;AAED,sHAAsH;AACtH,MAAM,UAAU,+BAA+B,CAAC,MAA6B,EAAE,eAAwB;IACrG,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC5E,OAAO,GAAG,eAAe,CAAC,CAAC,CAAC,gBAAgB,eAAe,KAAK,CAAC,CAAC,CAAC,EAAE,4CAA4C,MAAM,CAAC,UAAU,IAAI;UAClI,0DAA0D,yCAAyC,sBAAsB;UACzH,6DAA6D,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,eAAe,KAAK;UACzH,2HAA2H;UAC3H,wFAAwF,CAAC;AAC/F,CAAC;AAED,uHAAuH;AACvH,MAAM,UAAU,yBAAyB,CAAC,qBAAmE;IAC3G,OAAO,qBAAqB,EAAE,KAAK,EAAE,MAAM,KAAK,oBAAoB,CAAC,IAAI,CAAC;AAC5E,CAAC","sourcesContent":["import { z } from 'zod';\n\nimport {\n PlatformAdminEnvKey,\n PlatformDocumentationSiteEnvKey,\n PlatformEmailEnvKey,\n PlatformInfrastructureEnvKey,\n PlatformIngressEnvKey,\n PlatformKubernetesEnvKey,\n PlatformLoggingEnvKey,\n PlatformObservabilityEnvKey,\n PlatformOwnershipDnsEnvKey,\n PlatformProcessEnvKey,\n PlatformProviderSelectionEnvKey,\n PlatformSecurityEnvKey,\n PlatformServiceUrlEnvKey,\n} from '../../bootstrap/platform-runtime-env.contracts';\nimport { BackingServiceSource } from './backing-services.schemas';\n\n/** @wildo_source:part:start platform.config.platform-key-management facet:layer:platform facet:family:infra facet:audience:app-developer */\n/**\n * # Where the platform keeps the keys it holds for applications (#2933)\n *\n * apps-manager is the custodian of every platform-held key (approval seals, signature requests, and the wrapping keys\n * of an application's sealed secrets, #2894). Without this block it\n * seals them under its own key-encryption root (the LOCAL provider). With it, apps-manager also serves the\n * `vault-transit` and `vault-kv` key providers, and an application's key binding may name one of them.\n *\n * This is a PLATFORM-tier declaration, like `platformStorage`: one apps-manager holds one Vault, whatever application\n * an environment file belongs to. It is deliberately not a `backingServices` kind. A backing service is something an\n * application runtime dials, with credentials minted per application; no application runtime ever reaches this Vault,\n * and nothing is minted per application in it.\n *\n * - `{ vault: { source: 'self' } }` — the CLI renders a single-node OpenBao (the MPL-licensed Vault fork, API\n * compatible for everything used) beside apps-manager, in docker compose and in Kubernetes. It unseals itself from a\n * framework-managed key and configures itself on its first start: the Transit and KV mounts, the two least-privilege\n * policies, and the two tokens apps-manager speaks with. Good for development and for a small self-hosted platform;\n * its protection is SOFTWARE, as every Vault's is. Its self-initialization runs only on EMPTY storage, so an OpenBao\n * first started before a policy changed keeps the older policy: one started before #2894 cannot wrap data keys\n * (`transit/encrypt` and `transit/decrypt` answer 403) until the signer policy is written again (`bao policy write`\n * with `vaultSignerPolicy`) or its storage is recreated.\n * - `{ vault: { source: 'managed', address, … } }` — the operator's own Vault or OpenBao. The operator configures the\n * mounts and policies (`vaultSignerPolicy` / `vaultOperatorPolicy` in the key-management contracts) and puts the two\n * tokens in `secrets.json` under `platformKeyVaultManaged`.\n *\n * Absent, apps-manager serves no Vault provider, and a binding that names one is refused PROVIDER_UNAVAILABLE.\n *\n * ## Cloud KMS (#2896)\n *\n * `awsKms`, `googleCloudKms` and `azureKeyVault` make apps-manager serve the `aws-kms`, `google-cloud-kms` and\n * `azure-key-vault` providers: the key is generated inside the vendor's HSM, never leaves it, and the vendor signs. They\n * are always the operator's own account, so they carry no `source`. apps-manager authenticates with its WORKLOAD\n * identity (an IAM role for its service account, GKE workload identity, an Azure managed identity): nothing here is a\n * secret, and `secrets.json` holds nothing for them.\n *\n * Each provider acts as two identities, as Vault does with two tokens. The SIGNER may only read keys, sign, and wrap and\n * unwrap data keys under a wrapping key (#2894); the OPERATOR creates, disables and destroys keys and may never sign, wrap\n * or unwrap. Every wrap is authenticated encryption under a key only the vendor holds. Neither vendor's broad built-in role keeps to that, so\n * grant, per vendor:\n * - AWS: apps-manager's identity may only `sts:AssumeRole` the two roles. Every key apps-manager creates carries the tag\n * `wildo:key-ref`, and the policies are scoped by it:\n * - Signer, on `arn:aws:kms:<region>:<account>:key/*`: `kms:Sign`, `kms:Encrypt` and `kms:Decrypt` only where\n * `aws:ResourceTag/wildo:key-ref` is present (`\"Null\": { … \"false\" }`), so it cannot sign with, or decrypt under,\n * another key in the account; `kms:GetPublicKey` and `kms:DescribeKey` unconditioned (both read-only).\n * - Operator: `kms:CreateKey` and `kms:TagResource` on `\"Resource\": \"*\"` (CreateKey names no key yet), only where\n * `aws:RequestTag/wildo:key-ref` is present and `aws:TagKeys` is exactly `[\"wildo:key-ref\"]`; on `key/*`,\n * `kms:DisableKey` and `kms:ScheduleKeyDeletion` only where `aws:ResourceTag/wildo:key-ref` is present, and\n * `kms:DescribeKey`; never `kms:Sign`, `kms:Encrypt`, `kms:Decrypt` nor `kms:UntagResource`.\n * - The tag is what admits a key to the signer, so whoever may tag may admit: the operator's `kms:TagResource` lets it\n * put `wildo:key-ref` on ANY key in the account, which the signer could then sign with. AWS warns of exactly this\n * (\"Be cautious about giving principals the `kms:TagResource` … permissions\"). Keep the operator role to apps-manager\n * alone, and consider a permissions boundary or SCP denying `kms:TagResource` on keys outside the custodian's.\n * - KMS applies a tag to authorization up to five minutes after it is set, so a NEW version may be refused `kms:Sign`\n * for those minutes: the first ACTIVE version of every new keyring (made at its first signature request), and one\n * made by an emergency rotation. The signature fails as a provider fault and the caller retries it; so does the first\n * wrap under a new wrapping key, which the application's data-key ring asks for again on its own retry.\n * - Google: apps-manager's identity holds `roles/iam.serviceAccountTokenCreator` on the two service accounts only.\n * Signer: `roles/cloudkms.signer`, `roles/cloudkms.cryptoKeyEncrypterDecrypter`, `roles/cloudkms.publicKeyViewer` and\n * `roles/cloudkms.viewer` on the key ring (sign, wrap and unwrap data keys, read the public key, read a version's state). Operator: `roles/cloudkms.admin` on the key ring, which contains no\n * cryptographic operation.\n * - Azure Key Vault (a vault in the Azure RBAC permission model): two user-assigned managed identities on apps-manager,\n * each with a CUSTOM role on the vault. The built-in roles do not fit: \"Key Vault Crypto User\" can update and back up a\n * key, and \"Key Vault Crypto Officer\" holds `vaults/keys/*`, signing included.\n * - Signer: `Microsoft.KeyVault/vaults/keys/read`, `…/keys/versions/read`, `…/keys/sign/action`,\n * `…/keys/encrypt/action`, `…/keys/decrypt/action` (a data key is wrapped with A256GCM under an `oct-HSM` key, which\n * a Premium vault offers in preview; a Standard vault cannot hold one and serves signing only).\n * - Operator: `…/keys/read`, `…/keys/versions/read`, `…/keys/create/action`, `…/keys/update/action` (disable),\n * `…/keys/delete`, `…/keys/purge/action`.\n * The vault's recovery level decides whether a destroyed key is purged at once or kept until retention ends.\n * - Azure Managed HSM (`*.managedhsm.azure.net`): the same two identities, with custom roles in the HSM's LOCAL RBAC\n * (the built-in \"Managed HSM Crypto User\" can sign and back up, and cannot purge). Signer:\n * `Microsoft.KeyVault/managedHsm/keys/read/action`, `…/keys/sign/action`, `…/keys/encrypt/action`, `…/keys/decrypt/action`.\n * Operator: `…/keys/read/action`,\n * `…/keys/create`, `…/keys/write/action`, `…/keys/delete`, `…/keys/deletedKeys/read/action`,\n * `…/keys/deletedKeys/delete` (purge).\n *\n * spec-cite: AWS KMS developer guide, \"Use tags to control access to KMS keys\" (`aws:ResourceTag`, the five-minute\n * delay, limiting `kms:TagResource` with `aws:RequestTag` / `aws:TagKeys`),\n * https://docs.aws.amazon.com/kms/latest/developerguide/tag-authorization.html; AWS KMS permissions reference\n * (`CreateKey`'s resource is `*`), https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html; Azure built-in roles, Security (Key\n * Vault Crypto Officer DataActions `Microsoft.KeyVault/vaults/keys/*`) and Azure permissions, Microsoft.KeyVault (the\n * `vaults/keys/*` data actions), https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles/security;\n * Managed HSM local RBAC built-in roles (the data-action table),\n * https://learn.microsoft.com/en-us/azure/key-vault/managed-hsm/built-in-roles.\n *\n * When a provider registers at startup, apps-manager logs the vendor's quota and per-request cost. It also holds its own\n * signing under 80% of the vendor's per-second quota, per process.\n *\n * ## Corroboration\n *\n * Every ten minutes, apps-manager compares, per key version and closed hour, the signatures its signing log records with\n * the ones the vendor's own audit log records, and writes one audit row per provider and hour:\n * - UNACCOUNTED (CRITICAL) the moment the vendor shows more signatures than apps-manager can account for: a key was used\n * outside the custodian, or a signature went unrecorded;\n * - otherwise, once the hour is six hours old (vendor logs arrive late): UNCORROBORATED (the vendor recorded fewer, or its\n * log could not be read) or CORROBORATED.\n * It reads as the OPERATOR identity, which therefore also needs:\n * - AWS: `cloudtrail:LookupEvents` (KMS `Sign` is a CloudTrail management event; nothing to enable).\n * - Google: `roles/logging.privateLogViewer` on the project, and Cloud KMS Data Access audit logs ENABLED (they are off by\n * default, and until they are on, every hour is uncorroborated).\n * - Azure: Log Analytics Reader on the workspace named by `logAnalyticsWorkspaceId`, which the vault's diagnostic setting\n * sends `AuditEvent` to.\n */\nexport const PlatformKeyVaultSelfHostedSchema = z.strictObject({\n source: z.literal(BackingServiceSource.SELF),\n});\n\n/** The operator's own Vault or OpenBao. Mounts and prefix default to the provider defaults (`transit`, `secret`, `wildo-`). */\nexport const PlatformKeyVaultManagedSchema = z.strictObject({\n source: z.literal(BackingServiceSource.MANAGED),\n /** The Vault API address apps-manager dials, e.g. `https://vault.internal:8200`. */\n address: z.url(),\n /** Vault Enterprise namespace (`team/keys/`); absent on open-source Vault and OpenBao's root namespace. */\n namespace: z.string().min(1).optional(),\n transitMount: z.string().min(1).optional(),\n kvMount: z.string().min(1).optional(),\n keyNamePrefix: z.string().min(1).optional(),\n});\n\nexport const PlatformKeyVaultConfigSchema = z.discriminatedUnion('source', [PlatformKeyVaultSelfHostedSchema, PlatformKeyVaultManagedSchema]);\nexport type PlatformKeyVaultConfig = z.infer<typeof PlatformKeyVaultConfigSchema>;\n\n/** The protection level apps-manager creates Google Cloud KMS keys at. */\nexport enum PlatformGoogleKmsKeyProtection {\n /** In Cloud HSM (FIPS 140-2 Level 3): the key's attestation is HARDWARE. */\n HSM = 'HSM',\n /** In Cloud KMS software: the key's attestation is SOFTWARE, and a HARDWARE floor refuses it. */\n SOFTWARE = 'SOFTWARE',\n}\n\n/** AWS KMS in the operator's account. */\nexport const PlatformKeyAwsKmsConfigSchema = z.strictObject({\n region: z.string().regex(/^[a-z]{2}(-[a-z]+)+-\\d$/),\n /** The role apps-manager assumes to read keys and sign. */\n signerRoleArn: z.string().regex(/^arn:aws[a-z-]*:iam::\\d{12}:role\\/.+$/),\n /** The role apps-manager assumes to create, disable and schedule the deletion of keys. */\n operatorRoleArn: z.string().regex(/^arn:aws[a-z-]*:iam::\\d{12}:role\\/.+$/),\n /** A KMS endpoint other than the region's public one (a VPC interface endpoint). */\n endpoint: z.url().optional(),\n});\n\n/** Google Cloud KMS in the operator's project. */\nexport const PlatformKeyGoogleCloudKmsConfigSchema = z.strictObject({\n /** `projects/<project>/locations/<location>/keyRings/<ring>`; created by the operator, since a key ring cannot be deleted. */\n keyRing: z.string().regex(/^projects\\/[^/]+\\/locations\\/[^/]+\\/keyRings\\/[^/]+$/),\n signerServiceAccount: z.email(),\n operatorServiceAccount: z.email(),\n protectionLevel: z.enum(PlatformGoogleKmsKeyProtection).default(PlatformGoogleKmsKeyProtection.HSM),\n});\n\n/** Azure Key Vault (Premium) or Managed HSM in the operator's subscription. */\nexport const PlatformKeyAzureKeyVaultConfigSchema = z.strictObject({\n /** `https://<vault>.vault.azure.net` or `https://<hsm>.managedhsm.azure.net`. */\n vaultUrl: z.url(),\n /** The client id of the signer's user-assigned managed identity. */\n signerClientId: z.uuid(),\n /** The client id of the operator's user-assigned managed identity. */\n operatorClientId: z.uuid(),\n /** HSM-protected keys (`EC-HSM`, a Premium vault or Managed HSM); `false` makes software `EC` keys. */\n hsm: z.boolean().default(true),\n /**\n * The Log Analytics workspace (its GUID) the vault's diagnostic setting sends `AuditEvent` to, in the `AzureDiagnostics`\n * destination mode. apps-manager reads it hourly to corroborate its signatures; absent, no Azure hour is compared.\n */\n logAnalyticsWorkspaceId: z.uuid().optional(),\n});\n\n/** The SoftHSM2 module the platform image carries: the one PKCS#11 module a containerised apps-manager has without a mount. */\nexport const PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH = '/usr/lib/softhsm/libsofthsm2.so';\n\n/** An absolute path with no `.` or `..` segment, so \"is this path inside that mount\" is a plain prefix question. */\nconst AbsoluteNormalPathSchema = z\n .string()\n .regex(/^\\//, 'an absolute path')\n .refine((path) => !/(^|\\/)\\.{1,2}(\\/|$)/.test(path), 'a path with no `.` or `..` segment');\n\n/** Where the platform image keeps apps-manager itself: a mount here (or over `/`) would hide the service it serves. */\nconst PLATFORM_IMAGE_APPLICATION_ROOT = '/app';\n\n/**\n * One file or directory of the HSM vendor's PKCS#11 client, mounted READ-ONLY into apps-manager's container (#3019): the\n * module, its configuration, the client certificates. `hostPath` is on the docker host (compose) or on every node that\n * may run apps-manager (Kubernetes, a `hostPath` volume); `containerPath` is where apps-manager sees it.\n */\nexport const PlatformKeyPkcs11ClientFileSchema = z.strictObject({\n hostPath: AbsoluteNormalPathSchema,\n containerPath: AbsoluteNormalPathSchema.refine(\n (path) => path !== '/' && path.replace(/\\/+$/, '') !== PLATFORM_IMAGE_APPLICATION_ROOT && !path.startsWith(`${PLATFORM_IMAGE_APPLICATION_ROOT}/`),\n `a path outside \\`/\\` and \\`${PLATFORM_IMAGE_APPLICATION_ROOT}\\` (the platform image keeps apps-manager there)`,\n ),\n});\nexport type PlatformKeyPkcs11ClientFile = z.infer<typeof PlatformKeyPkcs11ClientFileSchema>;\n\n/**\n * A dedicated HSM reached over PKCS#11 (#2934): Thales Luna, Entrust nShield, AWS CloudHSM, Azure Cloud HSM, an\n * on-premises appliance, or SoftHSM2. apps-manager loads the vendor's PKCS#11 module, logs in to one token with a user PIN\n * (operator-typed in `secrets.json` under `platformKeyPkcs11: { pin }`, never here) and serves the `pkcs11` provider.\n *\n * Protection is read from the token, not declared: a key counts as HARDWARE only when the slot reports a hardware slot\n * AND the token's model is listed in `hardwareTokenModels`, which is your statement that this model is the hardware you\n * run. SoftHSM2 is always SOFTWARE. The binding (`pkcs11js`) is compiled by `pnpm setup:pkcs11`; an apps-manager that\n * cannot load it says so at boot and refuses every signature on this provider.\n *\n * ## A real HSM in a containerised platform (#3019)\n *\n * The platform image carries only SoftHSM2. A real HSM's client comes from the host, and every vendor documents the same\n * containerised shape: mount the client library and its configuration READ-ONLY, and point the client at its\n * configuration with the vendor's own variable. So:\n * - `clientFiles` lists what to mount, each `{ hostPath, containerPath }`. compose renders a read-only bind mount and refuses\n * to start the service when the host path is missing; Kubernetes renders a read-only `hostPath` volume, which it mounts\n * unchecked, so the files must exist on every node that may run apps-manager (a missing one shows as a token that cannot\n * be opened, logged at boot). Both apps-manager services get them (INIT and serving).\n * - `environment` carries the vendor's variables (`ChrystokiConfigurationPath` for a Thales Luna client, …). It is\n * rendered in plain text beside the service, so it may hold paths and settings, never a credential; it may not name a\n * variable Wildo sets itself. The token PIN stays in `secrets.json`.\n * - In a container, `modulePath` must be the bundled SoftHSM2 or lie under a `containerPath`. Declaring `clientFiles` says\n * apps-manager runs in a container, so that is refused here; without `clientFiles` it is refused when compose or\n * Kubernetes renders apps-manager, because a framework developer's NATIVE apps-manager loads a host path legitimately\n * (Homebrew's SoftHSM2, `/opt/homebrew/lib/softhsm/libsofthsm2.so`).\n * - Both are for the CONTAINER lanes. A framework developer's native apps-manager runs on the host, where the client is\n * installed and configured as the vendor documents, and receives neither.\n *\n * Example, a Thales Luna client installed under `/usr/safenet/lunaclient` on the host:\n * `{ modulePath: '/usr/safenet/lunaclient/lib/libCryptoki2_64.so', tokenLabel: 'wildo', hardwareTokenModels: ['Luna K7'],\n * clientFiles: [{ hostPath: '/usr/safenet/lunaclient', containerPath: '/usr/safenet/lunaclient' },\n * { hostPath: '/etc/Chrystoki.conf', containerPath: '/etc/Chrystoki.conf' }],\n * environment: { ChrystokiConfigurationPath: '/etc' } }`.\n */\nexport const PlatformKeyPkcs11ConfigSchema = z\n .strictObject({\n /**\n * The vendor's PKCS#11 module, as an absolute path in apps-manager's filesystem: in the platform image, the bundled\n * `/usr/lib/softhsm/libsofthsm2.so` or a path under a `clientFiles[].containerPath`.\n */\n modulePath: z.string().regex(/^\\//, 'an absolute path'),\n /** The token's label, as the module reports it. */\n tokenLabel: z.string().min(1).max(32),\n /** Token models (`CK_TOKEN_INFO.model`) you state are hardware. Empty: every key reports SOFTWARE. */\n hardwareTokenModels: z.array(z.string().min(1)).default([]),\n /** The vendor client's files, mounted read-only into apps-manager's container (#3019). */\n clientFiles: z.array(PlatformKeyPkcs11ClientFileSchema).optional(),\n /** The vendor client's own environment variables (no credential, and no variable Wildo sets). */\n environment: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/, 'an environment variable name'), z.string()).optional(),\n })\n .superRefine((pkcs11, context) => {\n const containerPaths = (pkcs11.clientFiles ?? []).map((file) => file.containerPath.replace(/\\/+$/, ''));\n containerPaths.forEach((containerPath, index) => {\n if (containerPaths.indexOf(containerPath) !== index) {\n context.addIssue({ code: 'custom', path: ['clientFiles', index, 'containerPath'], message: `\"${containerPath}\" is mounted twice` });\n }\n });\n for (const name of Object.keys(pkcs11.environment ?? {})) {\n if (WILDO_OWNED_PLATFORM_ENV_KEYS.has(name)) {\n context.addIssue({ code: 'custom', path: ['environment', name], message: `\"${name}\" is a variable Wildo sets on apps-manager itself` });\n }\n }\n if (containerPaths.length > 0 && !pkcs11ModuleIsReachableInPlatformContainer(pkcs11)) {\n context.addIssue({ code: 'custom', path: ['modulePath'], message: describeUnreachablePkcs11Module(pkcs11) });\n }\n });\nexport type PlatformKeyPkcs11Config = z.infer<typeof PlatformKeyPkcs11ConfigSchema>;\n\nexport const WildoPlatformKeyManagementConfigSchema = z.strictObject({\n vault: PlatformKeyVaultConfigSchema.optional(),\n awsKms: PlatformKeyAwsKmsConfigSchema.optional(),\n googleCloudKms: PlatformKeyGoogleCloudKmsConfigSchema.optional(),\n azureKeyVault: PlatformKeyAzureKeyVaultConfigSchema.optional(),\n pkcs11: PlatformKeyPkcs11ConfigSchema.optional(),\n});\nexport type WildoPlatformKeyManagementConfig = z.infer<typeof WildoPlatformKeyManagementConfigSchema>;\n\n/** @wildo_source:part:end platform.config.platform-key-management */\n\n/** What deciding a module's reachability needs: the module, and where the client files are mounted. */\nexport interface Pkcs11ModuleMountView {\n readonly modulePath: string;\n readonly clientFiles?: readonly { readonly containerPath: string }[];\n}\n\n/**\n * Every environment variable Wildo itself sets on a platform process. A vendor `environment` entry may name none of them:\n * it would overwrite the platform's own value (a PIN, a connection string, the service's mode), and the vendor block is\n * rendered in plain text beside the service, never into a Secret.\n */\nconst WILDO_OWNED_PLATFORM_ENV_KEYS: ReadonlySet<string> = new Set<string>([\n ...[\n PlatformProcessEnvKey, PlatformServiceUrlEnvKey, PlatformInfrastructureEnvKey, PlatformSecurityEnvKey, PlatformAdminEnvKey,\n PlatformKubernetesEnvKey, PlatformIngressEnvKey, PlatformLoggingEnvKey, PlatformObservabilityEnvKey, PlatformProviderSelectionEnvKey,\n PlatformEmailEnvKey, PlatformOwnershipDnsEnvKey, PlatformDocumentationSiteEnvKey,\n ].flatMap((vocabulary) => Object.values(vocabulary) as string[]),\n // Set literally by the deployment templates rather than through the env contract.\n 'PLATFORM_SERVICE', 'NODE_OPTIONS', 'NODE_ENV',\n]);\n\n/**\n * Whether apps-manager, running in the PLATFORM IMAGE, can load `modulePath`: it is the bundled SoftHSM2, or it lies at or\n * under one of the declared `clientFiles[].containerPath`. Nothing else exists in that container.\n */\nexport function pkcs11ModuleIsReachableInPlatformContainer(pkcs11: Pkcs11ModuleMountView): boolean {\n if (pkcs11.modulePath === PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH) return true;\n return (pkcs11.clientFiles ?? []).some(({ containerPath }) => {\n const mountRoot = containerPath.replace(/\\/+$/, '');\n return pkcs11.modulePath === mountRoot || pkcs11.modulePath.startsWith(`${mountRoot}/`);\n });\n}\n\n/** The refusal both container lanes (compose, Kubernetes) raise for an unreachable module, naming the declaration. */\nexport function describeUnreachablePkcs11Module(pkcs11: Pkcs11ModuleMountView, environmentName?: string): string {\n const mounts = (pkcs11.clientFiles ?? []).map((file) => file.containerPath);\n return `${environmentName ? `Environment \"${environmentName}\": ` : ''}platformKeyManagement.pkcs11.modulePath \"${pkcs11.modulePath}\" `\n + `is not the SoftHSM2 module the platform image carries (${PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH}) and lies under no `\n + `platformKeyManagement.pkcs11.clientFiles[].containerPath (${mounts.length > 0 ? mounts.join(', ') : 'none declared'}). `\n + 'apps-manager runs in the platform image, where nothing else exists: declare the vendor\\'s module (and its configuration) '\n + 'in clientFiles as { hostPath, containerPath } and point modulePath inside one of them.';\n}\n\n/** Whether the platform runs its own Vault (OpenBao) in this environment: the one predicate both lanes render from. */\nexport function selfHostsPlatformKeyVault(platformKeyManagement: WildoPlatformKeyManagementConfig | undefined): boolean {\n return platformKeyManagement?.vault?.source === BackingServiceSource.SELF;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-services.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-services.schemas.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/platform-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;;;;;GAMG;AACH,oBAAY,qBAAqB;IAC/B,aAAa,kBAAkB;IAC/B,YAAY,0BAA0B;IACtC,wBAAwB,sCAAsC;IAC9D;;;;OAIG;IACH,eAAe,6BAA6B;CAC7C;AA4BD,eAAO,MAAM,2BAA2B,kGAGyB,CAAC;AAElE,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpF;;;;;GAKG;AACH,MAAM,MAAM,kCAAkC,GAC1C,uBAAuB,CAAC,qBAAqB,GAC7C,uBAAuB,CAAC,iCAAiC,GACzD,uBAAuB,CAAC,wBAAwB,CAAC;AAErD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,kCAAkC,EAAE,qBAAqB,CAI3G,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,oBAAY,yBAAyB;IACnC,qBAAqB,0BAA0B;IAC/C,iCAAiC,sCAAsC;IACvE,wBAAwB,6BAA6B;CACtD;AAED;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;CAIgD,CAAC;AAc3F;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,yBAAyB,GAAG,SAAS,CAGvH;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,qBAAqB,GAAG,SAAS,CAGpH;AAeD,oBAAY,eAAe;IACzB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-services.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/platform-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,qBAUX;AAVD,WAAY,qBAAqB;IAC/B,wDAA+B,CAAA;IAC/B,+DAAsC,CAAA;IACtC,uFAA8D,CAAA;IAC9D;;;;OAIG;IACH,qEAA4C,CAAA;AAC9C,CAAC,EAVW,qBAAqB,KAArB,qBAAqB,QAUhC;AA4BD,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,qBAAqB,CAAC,wBA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CAAkC,GAAuC,IAAI,CAAC;AACpF,KAAK,kCAAkC,CAAC;AAExC,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["import { PlatformApplicationType } from '@wildo-ai/platform-core-shared';\n\n/**\n * Platform microservices. All use the same Docker image (wildo-platform)\n * differentiated at runtime via PLATFORM_SERVICE env var.\n *\n * For app developers: deployed as Docker containers.\n * For framework developers: run natively from source (hot-reload).\n */\nexport enum PlatformWildoServices {\n PLATFORM_INIT = 'platform-init',\n APPS_MANAGER = 'platform-apps-manager',\n CRONTABS_BATCHES_MANAGER = 'platform-crontabs-batches-manager',\n /**\n * Module-registry server (`platform-module-registry`, KD-7).\n * Hosts the central `wildo registry *` HTTP surface; pinned port\n * `PLATFORM_DEFAULT_PORTS.MODULE_REGISTRY` (5154).\n */\n MODULE_REGISTRY = 'platform-module-registry',\n}\n\n/**\n * Bootstrap platform services — long-running platform microservices that boot\n * from the same env contract via `PlatformEnvVarsBuilder.buildBootstrapEnv`.\n *\n * Excludes:\n * - `PLATFORM_INIT` — one-shot initialization job, not a long-running service.\n * - `APPS_MANAGER` — has its own dedicated full-env builder\n * (`PlatformEnvVarsBuilder.buildAppsManagerFullEnv`) with extra wiring\n * (Atlas creds, GitHub provisioning keys, etc.).\n *\n * Single source of truth for everything that iterates \"all bootstrap services\":\n * K8s Secret/ConfigMap emit (`k8s-secrets-generator.service.ts`), Compose\n * runtime catalog, and tests asserting cross-service env contracts.\n *\n * The `satisfies` clause below forces this list to cover every member of\n * `PlatformWildoServices` other than the two explicitly excluded ones —\n * adding a new enum member without listing it here is a compile error.\n * Without that coupling, the previous `Exclude<…>`-based local type alias\n * silently widened to include any future enum member, which masked the\n * \"service in enum but not yet handled by the bootstrap path\" drift class.\n */\ntype BootstrapPlatformServiceCandidate = Exclude<\n PlatformWildoServices,\n PlatformWildoServices.PLATFORM_INIT | PlatformWildoServices.APPS_MANAGER\n>;\n\nexport const BOOTSTRAP_PLATFORM_SERVICES = [\n PlatformWildoServices.CRONTABS_BATCHES_MANAGER,\n PlatformWildoServices.MODULE_REGISTRY,\n] as const satisfies readonly BootstrapPlatformServiceCandidate[];\n\nexport type BootstrapPlatformService = (typeof BOOTSTRAP_PLATFORM_SERVICES)[number];\n\n/**\n * The platform-application TYPES the platform provisions credentials for — the same three the\n * apps-manager provisioner iterates. Named here so the runtime-slug ledger below can be REQUIRED per\n * member: a fourth provisioned service that is not mapped fails to compile before it provisions a\n * grant nobody can use.\n */\nexport type ProvisionedPlatformApplicationType =\n | PlatformApplicationType.PLATFORM_APPS_MANAGER\n | PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER\n | PlatformApplicationType.PLATFORM_MODULE_REGISTRY;\n\n/**\n * ONE service, TWO spellings — and this is the join between them.\n *\n * `PlatformApplicationType` (`platform_crontabs_batches_manager`, underscores) is the platform-\n * application RECORD type: the row in `platformApplications`, the Redis ACL USERNAME, the RabbitMQ\n * user. `PlatformWildoServices` (`platform-crontabs-batches-manager`, hyphens) is the RUNTIME SLUG:\n * the Docker/K8s service name and, since 2026-09-09, the `appSlug` each service process boots with.\n *\n * Why the join matters: every Redis key a platform process writes is rooted at its runtime slug —\n * the engine's `RedisService` roots at `${appSlug}:`, the platform's `PlatformRedisService` at the\n * same slug through this ledger — and the ACL grant minted for the service must therefore be\n * `~<runtime slug>:*`. Two writers rooted at the USERNAME instead (the provisioner's grant, then the\n * platform Redis service's prefix) each produced `NOPERM` on the service's first key, one after the\n * other, once the other side was corrected. Both sides now read this one table.\n */\nexport const PLATFORM_SERVICE_RUNTIME_SLUG: Record<ProvisionedPlatformApplicationType, PlatformWildoServices> = {\n [PlatformApplicationType.PLATFORM_APPS_MANAGER]: PlatformWildoServices.APPS_MANAGER,\n [PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER]: PlatformWildoServices.CRONTABS_BATCHES_MANAGER,\n [PlatformApplicationType.PLATFORM_MODULE_REGISTRY]: PlatformWildoServices.MODULE_REGISTRY,\n};\n\n/**\n * The platform-side JWT KEY NAME of a provisioned platform service — the property name under which\n * that service's signing keypair is stored in its platform secrets (`jwt.privateKey[<name>]`,\n * `jwt.publicKey[<name>]`) and under which its public key is PUBLISHED into the platform config's\n * `jwtPublicKeys`.\n *\n * ## Two concepts that share spellings, and must not be merged\n *\n * 1. **This vocabulary — every provisioned platform service's key name.** TOTAL by nature: every\n * service apps-manager provisions gets a keypair, so every one has a name. The platform-side\n * vocabularies (`PlatformJwtPrivateKeys` / `PlatformJwtPublicKeys` in `platform-shared-lib`) are\n * DERIVED from it, and every map from a service to its key name is keyed by\n * {@link ProvisionedPlatformApplicationType} and required per member.\n * 2. **`JwtPublicKeys` in `@wildo-ai/saas-models` — the platform services whose tokens APPLICATIONS\n * verify.** A deliberate SUBSET: module-registry signs nothing to an application, so it is not\n * there, and adding it would invent an issuer/audience verification nothing performs.\n * `platform-shared-lib` asserts at the type level that that subset stays inside this vocabulary.\n *\n * ## Why this is the ONE source\n *\n * Before #514 the same population was enumerated by hand in four places — two of them\n * `Partial<Record<…>>` maps that omitted module-registry. A `Partial` map is exactly the hand-copied\n * population that broke every fresh install when module-registry was added (see\n * `.claude/rules/invariant-call-site-enumeration.md` #21): it compiles with the member missing and\n * falls back to a key the service's secrets never hold.\n *\n * The string VALUES are persisted keys (platform secrets documents, published `jwtPublicKeys`) and\n * must never change spelling.\n */\nexport enum PlatformServiceJwtKeyName {\n PLATFORM_APPS_MANAGER = 'PLATFORM_APPS_MANAGER',\n PLATFORM_CRONTABS_BATCHES_MANAGER = 'PLATFORM_CRONTABS_BATCHES_MANAGER',\n PLATFORM_MODULE_REGISTRY = 'PLATFORM_MODULE_REGISTRY',\n}\n\n/**\n * Provisioned platform service → its platform-side JWT key name. Required for every member of\n * {@link ProvisionedPlatformApplicationType}, so a fourth provisioned service fails to compile here\n * until it is given a name.\n */\nexport const PLATFORM_SERVICE_JWT_KEY_NAME = {\n [PlatformApplicationType.PLATFORM_APPS_MANAGER]: PlatformServiceJwtKeyName.PLATFORM_APPS_MANAGER,\n [PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER]: PlatformServiceJwtKeyName.PLATFORM_CRONTABS_BATCHES_MANAGER,\n [PlatformApplicationType.PLATFORM_MODULE_REGISTRY]: PlatformServiceJwtKeyName.PLATFORM_MODULE_REGISTRY,\n} as const satisfies Record<ProvisionedPlatformApplicationType, PlatformServiceJwtKeyName>;\n\n/**\n * Compile-time assertion: every {@link PlatformServiceJwtKeyName} member is the key name of SOME\n * provisioned service. A name nothing maps to would be a vocabulary member no keypair is ever stored\n * under.\n */\ntype _AssertEveryJwtKeyNameIsMapped =\n Exclude<PlatformServiceJwtKeyName, (typeof PLATFORM_SERVICE_JWT_KEY_NAME)[ProvisionedPlatformApplicationType]> extends never\n ? true\n : never;\nconst _assertEveryJwtKeyNameIsMapped: _AssertEveryJwtKeyNameIsMapped = true;\nvoid _assertEveryJwtKeyNameIsMapped;\n\n/**\n * The platform-side JWT key name for a platform-application type name, or `undefined` when the name\n * is not a provisioned platform service. Callers holding a runtime string (a service's own\n * `serviceName`, an inbound service id) go through here rather than casting into the map.\n */\nexport function resolvePlatformServiceJwtKeyName(serviceName: string | undefined): PlatformServiceJwtKeyName | undefined {\n if (serviceName === undefined) return undefined;\n return (PLATFORM_SERVICE_JWT_KEY_NAME as Record<string, PlatformServiceJwtKeyName | undefined>)[serviceName];\n}\n\n/**\n * The runtime slug for a platform-application type name, or `undefined` when the name is not a\n * provisioned platform service — a caller then reports or refuses rather than rooting a key\n * namespace, or a grant, on a guess.\n */\nexport function resolvePlatformServiceRuntimeSlug(serviceName: string | undefined): PlatformWildoServices | undefined {\n if (serviceName === undefined) return undefined;\n return (PLATFORM_SERVICE_RUNTIME_SLUG as Record<string, PlatformWildoServices | undefined>)[serviceName];\n}\n\n/**\n * Compile-time assertion: every non-excluded `PlatformWildoServices` member\n * MUST appear in `BOOTSTRAP_PLATFORM_SERVICES`. Adding a new member to the\n * enum without listing it above triggers a `Type 'X' is not assignable to\n * type 'never'` error pointing here, so the exhaustiveness check the\n * `addServiceExtras` switch used to provide for `Exclude<…>`-derived types\n * is preserved.\n */\ntype _AssertExhaustiveBootstrapCoverage =\n Exclude<BootstrapPlatformServiceCandidate, BootstrapPlatformService> extends never ? true : never;\nconst _assertExhaustiveBootstrapCoverage: _AssertExhaustiveBootstrapCoverage = true;\nvoid _assertExhaustiveBootstrapCoverage;\n\nexport enum AppsManagerMode {\n NORMAL = 'normal',\n INIT = 'init',\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"platform-services.schemas.js","sourceRoot":"","sources":["../../../../src/project-config/shared/platform-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,qBAUX;AAVD,WAAY,qBAAqB;IAC/B,wDAA+B,CAAA;IAC/B,+DAAsC,CAAA;IACtC,uFAA8D,CAAA;IAC9D;;;;OAIG;IACH,qEAA4C,CAAA;AAC9C,CAAC,EAVW,qBAAqB,KAArB,qBAAqB,QAUhC;AA4BD,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,qBAAqB,CAAC,wBAAwB;IAC9C,qBAAqB,CAAC,eAAe;CAC0B,CAAC;AAelE;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAsE;IAC9G,CAAC,uBAAuB,CAAC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,YAAY;IACnF,CAAC,uBAAuB,CAAC,iCAAiC,CAAC,EAAE,qBAAqB,CAAC,wBAAwB;IAC3G,CAAC,uBAAuB,CAAC,wBAAwB,CAAC,EAAE,qBAAqB,CAAC,eAAe;CAC1F,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAN,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACnC,4EAA+C,CAAA;IAC/C,oGAAuE,CAAA;IACvE,kFAAqD,CAAA;AACvD,CAAC,EAJW,yBAAyB,KAAzB,yBAAyB,QAIpC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,CAAC,uBAAuB,CAAC,qBAAqB,CAAC,EAAE,yBAAyB,CAAC,qBAAqB;IAChG,CAAC,uBAAuB,CAAC,iCAAiC,CAAC,EAAE,yBAAyB,CAAC,iCAAiC;IACxH,CAAC,uBAAuB,CAAC,wBAAwB,CAAC,EAAE,yBAAyB,CAAC,wBAAwB;CACd,CAAC;AAW3F,MAAM,8BAA8B,GAAmC,IAAI,CAAC;AAC5E,KAAK,8BAA8B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,gCAAgC,CAAC,WAA+B;IAC9E,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAChD,OAAQ,6BAAuF,CAAC,WAAW,CAAC,CAAC;AAC/G,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,WAA+B;IAC/E,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAChD,OAAQ,6BAAmF,CAAC,WAAW,CAAC,CAAC;AAC3G,CAAC;AAYD,MAAM,kCAAkC,GAAuC,IAAI,CAAC;AACpF,KAAK,kCAAkC,CAAC;AAExC,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["import { PlatformApplicationType } from '@wildo-ai/platform-core-shared';\n\n/**\n * Platform microservices. All use the same Docker image (wildo-platform)\n * differentiated at runtime via PLATFORM_SERVICE env var.\n *\n * For app developers: deployed as Docker containers.\n * For framework developers: run natively from source (hot-reload).\n */\nexport enum PlatformWildoServices {\n PLATFORM_INIT = 'platform-init',\n APPS_MANAGER = 'platform-apps-manager',\n CRONTABS_BATCHES_MANAGER = 'platform-crontabs-batches-manager',\n /**\n * Module-registry server (`platform-module-registry`, KD-7).\n * Hosts the central `wildo registry *` HTTP surface; pinned port\n * `PLATFORM_DEFAULT_PORTS.MODULE_REGISTRY` (5154).\n */\n MODULE_REGISTRY = 'platform-module-registry',\n}\n\n/**\n * Bootstrap platform services — long-running platform microservices that boot\n * from the same env contract via `PlatformEnvVarsBuilder.buildBootstrapEnv`.\n *\n * Excludes:\n * - `PLATFORM_INIT` — one-shot initialization job, not a long-running service.\n * - `APPS_MANAGER` — has its own dedicated full-env builder\n * (`PlatformEnvVarsBuilder.buildAppsManagerFullEnv`) with extra wiring\n * (Atlas creds, GitHub provisioning keys, etc.).\n *\n * Single source of truth for everything that iterates \"all bootstrap services\":\n * K8s Secret/ConfigMap emit (`k8s-secrets-generator.service.ts`), Compose\n * runtime catalog, and tests asserting cross-service env contracts.\n *\n * The `satisfies` clause below forces this list to cover every member of\n * `PlatformWildoServices` other than the two explicitly excluded ones —\n * adding a new enum member without listing it here is a compile error.\n * Without that coupling, the previous `Exclude<…>`-based local type alias\n * silently widened to include any future enum member, which masked the\n * \"service in enum but not yet handled by the bootstrap path\" drift class.\n */\ntype BootstrapPlatformServiceCandidate = Exclude<\n PlatformWildoServices,\n PlatformWildoServices.PLATFORM_INIT | PlatformWildoServices.APPS_MANAGER\n>;\n\nexport const BOOTSTRAP_PLATFORM_SERVICES = [\n PlatformWildoServices.CRONTABS_BATCHES_MANAGER,\n PlatformWildoServices.MODULE_REGISTRY,\n] as const satisfies readonly BootstrapPlatformServiceCandidate[];\n\nexport type BootstrapPlatformService = (typeof BOOTSTRAP_PLATFORM_SERVICES)[number];\n\n/**\n * The platform-application TYPES the platform provisions credentials for — the same three the\n * apps-manager provisioner iterates. Named here so the runtime-slug ledger below can be REQUIRED per\n * member: a fourth provisioned service that is not mapped fails to compile before it provisions a\n * grant nobody can use.\n */\nexport type ProvisionedPlatformApplicationType =\n | PlatformApplicationType.PLATFORM_APPS_MANAGER\n | PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER\n | PlatformApplicationType.PLATFORM_MODULE_REGISTRY;\n\n/**\n * ONE service, TWO spellings — and this is the join between them.\n *\n * `PlatformApplicationType` (`platform_crontabs_batches_manager`, underscores) is the platform-\n * application RECORD type: the row in `platformApplications`, the Redis ACL USERNAME, the RabbitMQ\n * user. `PlatformWildoServices` (`platform-crontabs-batches-manager`, hyphens) is the RUNTIME SLUG:\n * the Docker/K8s service name and, since 2026-09-09, the `appSlug` each service process boots with.\n *\n * Why the join matters: every Redis key a platform process writes is rooted at its runtime slug —\n * the engine's `RedisService` roots at `${appSlug}:`, the platform's `PlatformRedisService` at the\n * same slug through this ledger — and the ACL grant minted for the service must therefore be\n * `~<runtime slug>:*`. Two writers rooted at the USERNAME instead (the provisioner's grant, then the\n * platform Redis service's prefix) each produced `NOPERM` on the service's first key, one after the\n * other, once the other side was corrected. Both sides now read this one table.\n */\nexport const PLATFORM_SERVICE_RUNTIME_SLUG: Record<ProvisionedPlatformApplicationType, PlatformWildoServices> = {\n [PlatformApplicationType.PLATFORM_APPS_MANAGER]: PlatformWildoServices.APPS_MANAGER,\n [PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER]: PlatformWildoServices.CRONTABS_BATCHES_MANAGER,\n [PlatformApplicationType.PLATFORM_MODULE_REGISTRY]: PlatformWildoServices.MODULE_REGISTRY,\n};\n\n/**\n * The platform-side JWT KEY NAME of a provisioned platform service — the property name under which\n * that service's signing keypair is stored in its platform secrets (`jwt.privateKey[<name>]`,\n * `jwt.publicKey[<name>]`) and under which its public key is PUBLISHED into the platform config's\n * `jwtPublicKeys`.\n *\n * ## Two concepts that share spellings, and must not be merged\n *\n * 1. **This vocabulary — every provisioned platform service's key name.** TOTAL by nature: every\n * service apps-manager provisions gets a keypair, so every one has a name. The platform-side\n * vocabularies (`PlatformJwtPrivateKeys` / `PlatformJwtPublicKeys` in `platform-shared-lib`) are\n * DERIVED from it, and every map from a service to its key name is keyed by\n * {@link ProvisionedPlatformApplicationType} and required per member.\n * 2. **`JwtPublicKeys` in `@wildo-ai/saas-models` — the platform services whose tokens APPLICATIONS\n * verify.** A deliberate SUBSET: module-registry signs nothing to an application, so it is not\n * there, and adding it would invent an issuer/audience verification nothing performs.\n * `platform-shared-lib` asserts at the type level that that subset stays inside this vocabulary.\n *\n * ## Why this is the ONE source\n *\n * Before #514 the same population was enumerated by hand in four places — two of them\n * `Partial<Record<…>>` maps that omitted module-registry. A `Partial` map is exactly the hand-copied\n * population that broke every fresh install when module-registry was added (see\n * `.claude/rules/invariant-call-site-enumeration.md` #21): it compiles with the member missing and\n * falls back to a key the service's secrets never hold.\n *\n * The string VALUES are persisted keys (platform secrets documents, published `jwtPublicKeys`) and\n * must never change spelling.\n */\nexport enum PlatformServiceJwtKeyName {\n PLATFORM_APPS_MANAGER = 'PLATFORM_APPS_MANAGER',\n PLATFORM_CRONTABS_BATCHES_MANAGER = 'PLATFORM_CRONTABS_BATCHES_MANAGER',\n PLATFORM_MODULE_REGISTRY = 'PLATFORM_MODULE_REGISTRY',\n}\n\n/**\n * Provisioned platform service → its platform-side JWT key name. Required for every member of\n * {@link ProvisionedPlatformApplicationType}, so a fourth provisioned service fails to compile here\n * until it is given a name.\n */\nexport const PLATFORM_SERVICE_JWT_KEY_NAME = {\n [PlatformApplicationType.PLATFORM_APPS_MANAGER]: PlatformServiceJwtKeyName.PLATFORM_APPS_MANAGER,\n [PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER]: PlatformServiceJwtKeyName.PLATFORM_CRONTABS_BATCHES_MANAGER,\n [PlatformApplicationType.PLATFORM_MODULE_REGISTRY]: PlatformServiceJwtKeyName.PLATFORM_MODULE_REGISTRY,\n} as const satisfies Record<ProvisionedPlatformApplicationType, PlatformServiceJwtKeyName>;\n\n/**\n * Compile-time assertion: every {@link PlatformServiceJwtKeyName} member is the key name of SOME\n * provisioned service. A name nothing maps to would be a vocabulary member no keypair is ever stored\n * under.\n */\ntype _AssertEveryJwtKeyNameIsMapped =\n Exclude<PlatformServiceJwtKeyName, (typeof PLATFORM_SERVICE_JWT_KEY_NAME)[ProvisionedPlatformApplicationType]> extends never\n ? true\n : never;\nconst _assertEveryJwtKeyNameIsMapped: _AssertEveryJwtKeyNameIsMapped = true;\nvoid _assertEveryJwtKeyNameIsMapped;\n\n/**\n * The platform-side JWT key name for a platform-application type name, or `undefined` when the name\n * is not a provisioned platform service. Callers holding a runtime string (a service's own\n * `serviceName`, an inbound service id) go through here rather than casting into the map.\n */\nexport function resolvePlatformServiceJwtKeyName(serviceName: string | undefined): PlatformServiceJwtKeyName | undefined {\n if (serviceName === undefined) return undefined;\n return (PLATFORM_SERVICE_JWT_KEY_NAME as Record<string, PlatformServiceJwtKeyName | undefined>)[serviceName];\n}\n\n/**\n * The runtime slug for a platform-application type name, or `undefined` when the name is not a\n * provisioned platform service — a caller then reports or refuses rather than rooting a key\n * namespace, or a grant, on a guess.\n */\nexport function resolvePlatformServiceRuntimeSlug(serviceName: string | undefined): PlatformWildoServices | undefined {\n if (serviceName === undefined) return undefined;\n return (PLATFORM_SERVICE_RUNTIME_SLUG as Record<string, PlatformWildoServices | undefined>)[serviceName];\n}\n\n/**\n * Compile-time assertion: every non-excluded `PlatformWildoServices` member\n * MUST appear in `BOOTSTRAP_PLATFORM_SERVICES`. Adding a new member to the\n * enum without listing it above triggers a `Type 'X' is not assignable to\n * type 'never'` error pointing here, so the exhaustiveness check the\n * `addServiceExtras` switch used to provide for `Exclude<…>`-derived types\n * is preserved.\n */\ntype _AssertExhaustiveBootstrapCoverage =\n Exclude<BootstrapPlatformServiceCandidate, BootstrapPlatformService> extends never ? true : never;\nconst _assertExhaustiveBootstrapCoverage: _AssertExhaustiveBootstrapCoverage = true;\nvoid _assertExhaustiveBootstrapCoverage;\n\nexport enum AppsManagerMode {\n NORMAL = 'normal',\n INIT = 'init',\n}\n\n"]}
|
|
@@ -26,8 +26,8 @@ import { z } from 'zod';
|
|
|
26
26
|
* it can author one here. Absent, the constant applies there too.
|
|
27
27
|
*/
|
|
28
28
|
export declare const WildoPlatformStorageConfigSchema: z.ZodObject<{
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
30
|
+
stsRoleArn: z.ZodOptional<z.ZodString>;
|
|
31
31
|
}, z.core.$strict>;
|
|
32
32
|
export type WildoPlatformStorageConfig = z.infer<typeof WildoPlatformStorageConfigSchema>;
|
|
33
33
|
/** The platform tier's bucket: the authored remote override, else {@link STORAGE_DEFAULTS.BUCKET}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-storage.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-storage.schemas.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/platform-storage.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gCAAgC;;;kBAiB3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,sGAAsG;AACtG,wBAAgB,kCAAkC,CAAC,eAAe,EAAE,0BAA0B,GAAG,SAAS,GAAG,MAAM,CAElH"}
|
|
@@ -27,8 +27,22 @@ import { STORAGE_DEFAULTS } from './infrastructure-defaults.schemas.js';
|
|
|
27
27
|
* it can author one here. Absent, the constant applies there too.
|
|
28
28
|
*/
|
|
29
29
|
export const WildoPlatformStorageConfigSchema = z.strictObject({
|
|
30
|
-
/** The bucket apps-manager and module-registry store the platform's own objects in. */
|
|
31
|
-
bucket: z.string().min(1),
|
|
30
|
+
/** The bucket apps-manager and module-registry store the platform's own objects in. Absent: the constant. */
|
|
31
|
+
bucket: z.string().min(1).optional(),
|
|
32
|
+
/**
|
|
33
|
+
* The role apps-manager's object-storage broker assumes, as an ARN (#2172). Rendered into apps-manager's
|
|
34
|
+
* environment as `STORAGE_STS_ROLE_ARN`, never into an application's or another platform service's.
|
|
35
|
+
*
|
|
36
|
+
* Required by a store whose STS `AssumeRole` names a role (AWS STS, SeaweedFS, Ceph RGW); the broker refuses to
|
|
37
|
+
* issue a credential against AWS without it, and never falls back to the root key. Leave it out for a
|
|
38
|
+
* MinIO-compatible store, which issues a session for the calling key and names no role. The role's trust policy
|
|
39
|
+
* must admit the storage root key's identity, and its permissions bound every session: the broker's inline session
|
|
40
|
+
* policy only narrows them.
|
|
41
|
+
*
|
|
42
|
+
* spec-cite: AWS STS API Reference, AssumeRole — `RoleArn` (Required: Yes; length 20–2048)
|
|
43
|
+
* (https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html).
|
|
44
|
+
*/
|
|
45
|
+
stsRoleArn: z.string().min(20).max(2048).optional(),
|
|
32
46
|
});
|
|
33
47
|
/** The platform tier's bucket: the authored remote override, else {@link STORAGE_DEFAULTS.BUCKET}. */
|
|
34
48
|
export function resolvePlatformObjectStorageBucket(platformStorage) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-storage.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-storage.schemas.js","sourceRoot":"","sources":["../../../../src/project-config/shared/platform-storage.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7D,6GAA6G;IAC7G,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpC;;;;;;;;;;;;OAYG;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC;AAGH,sGAAsG;AACtG,MAAM,UAAU,kCAAkC,CAAC,eAAuD;IACxG,OAAO,eAAe,EAAE,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC;AAC5D,CAAC","sourcesContent":["import { z } from 'zod';\n\nimport { STORAGE_DEFAULTS } from './infrastructure-defaults.schemas';\n\n/**\n * The PLATFORM tier's own object-storage bucket, authored for a remote environment (#1112).\n *\n * ## Why the platform needs its own, separate from `backingServices.s3.bucket`\n *\n * `backingServices.s3.bucket` is an APPLICATION's bucket: its backend reads and writes there, and apps-manager\n * confines that application's storage credential to it (#1107). The platform services — apps-manager itself and\n * module-registry — store their own objects too, and both halves of that pair must address ONE bucket: the\n * platform-services STS door confines to the bucket apps-manager's env names, while module-registry addresses\n * objects in the bucket its own env names.\n *\n * Until #1112 the CLI rendered that platform bucket from the `config.json` of whichever application was being\n * registered or deployed, so it became the last-registered application's bucket, and platform objects written\n * earlier went out of reach. Measured on 2026-09-14: module-registry's uploads sat in `wonder-todos-local`, and\n * registering a second application rewrote every platform service's env to that application's bucket.\n *\n * ## Local: a constant. Remote: authored.\n *\n * A local platform is shared by every application checked out beside it, and no configuration on disk is shared\n * across them — every infra file, `config.json` and `secrets.json` belongs to one application. So a local\n * platform's bucket is the constant {@link STORAGE_DEFAULTS.BUCKET}, and authoring this block in a local\n * environment is refused at parse time (the same shape as `cdn`, which is remote-only for its own reason).\n *\n * A remote environment is deployed from one application's infra file and may need a globally unique S3 name, so\n * it can author one here. Absent, the constant applies there too.\n */\nexport const WildoPlatformStorageConfigSchema = z.strictObject({\n /** The bucket apps-manager and module-registry store the platform's own objects in. Absent: the constant. */\n bucket: z.string().min(1).optional(),\n /**\n * The role apps-manager's object-storage broker assumes, as an ARN (#2172). Rendered into apps-manager's\n * environment as `STORAGE_STS_ROLE_ARN`, never into an application's or another platform service's.\n *\n * Required by a store whose STS `AssumeRole` names a role (AWS STS, SeaweedFS, Ceph RGW); the broker refuses to\n * issue a credential against AWS without it, and never falls back to the root key. Leave it out for a\n * MinIO-compatible store, which issues a session for the calling key and names no role. The role's trust policy\n * must admit the storage root key's identity, and its permissions bound every session: the broker's inline session\n * policy only narrows them.\n *\n * spec-cite: AWS STS API Reference, AssumeRole — `RoleArn` (Required: Yes; length 20–2048)\n * (https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html).\n */\n stsRoleArn: z.string().min(20).max(2048).optional(),\n});\nexport type WildoPlatformStorageConfig = z.infer<typeof WildoPlatformStorageConfigSchema>;\n\n/** The platform tier's bucket: the authored remote override, else {@link STORAGE_DEFAULTS.BUCKET}. */\nexport function resolvePlatformObjectStorageBucket(platformStorage: WildoPlatformStorageConfig | undefined): string {\n return platformStorage?.bucket ?? STORAGE_DEFAULTS.BUCKET;\n}\n"]}
|