@wildo-ai/platform-config-lib 1.1.11 → 1.1.13
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 +114 -40
- package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -1
- package/dist/esm/key-management/approval-seal-verifier.js +143 -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 +146 -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 +124 -71
- 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 +2 -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 +67 -38
- 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 +113 -5
- 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
|
@@ -64,11 +64,14 @@ import { BackingServiceSource } from './backing-services.schemas';
|
|
|
64
64
|
* - Azure Key Vault (a vault in the Azure RBAC permission model): two user-assigned managed identities on apps-manager,
|
|
65
65
|
* 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
|
|
66
66
|
* key, and "Key Vault Crypto Officer" holds `vaults/keys/*`, signing included.
|
|
67
|
-
* - Signer: `Microsoft.KeyVault/vaults/keys/read`, `…/keys/
|
|
67
|
+
* - Signer: `Microsoft.KeyVault/vaults/keys/read`, `…/keys/sign/action`,
|
|
68
68
|
* `…/keys/encrypt/action`, `…/keys/decrypt/action` (a data key is wrapped with A256GCM under an `oct-HSM` key, which
|
|
69
69
|
* a Premium vault offers in preview; a Standard vault cannot hold one and serves signing only).
|
|
70
|
-
* - Operator: `…/keys/read`, `…/keys/
|
|
70
|
+
* - Operator: `…/keys/read`, `…/keys/create/action`, `…/keys/update/action` (disable),
|
|
71
71
|
* `…/keys/delete`, `…/keys/purge/action`.
|
|
72
|
+
* Azure has no `keys/versions/read` data action: `keys/read` reads every version. Measured 2026-11-12 (#3697) with two
|
|
73
|
+
* user-assigned managed identities holding exactly these roles: each verb succeeded as its own identity and answered
|
|
74
|
+
* 403 as the other one.
|
|
72
75
|
* The vault's recovery level decides whether a destroyed key is purged at once or kept until retention ends.
|
|
73
76
|
* - Azure Managed HSM (`*.managedhsm.azure.net`): the same two identities, with custom roles in the HSM's LOCAL RBAC
|
|
74
77
|
* (the built-in "Managed HSM Crypto User" can sign and back up, and cannot purge). Signer:
|
|
@@ -110,9 +113,7 @@ export declare const PlatformKeyVaultSelfHostedSchema: z.ZodObject<{
|
|
|
110
113
|
/** The operator's own Vault or OpenBao. Mounts and prefix default to the provider defaults (`transit`, `secret`, `wildo-`). */
|
|
111
114
|
export declare const PlatformKeyVaultManagedSchema: z.ZodObject<{
|
|
112
115
|
source: z.ZodLiteral<BackingServiceSource.MANAGED>;
|
|
113
|
-
/** The Vault API address apps-manager dials, e.g. `https://vault.internal:8200`. */
|
|
114
116
|
address: z.ZodURL;
|
|
115
|
-
/** Vault Enterprise namespace (`team/keys/`); absent on open-source Vault and OpenBao's root namespace. */
|
|
116
117
|
namespace: z.ZodOptional<z.ZodString>;
|
|
117
118
|
transitMount: z.ZodOptional<z.ZodString>;
|
|
118
119
|
kvMount: z.ZodOptional<z.ZodString>;
|
|
@@ -122,9 +123,7 @@ export declare const PlatformKeyVaultConfigSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
122
123
|
source: z.ZodLiteral<BackingServiceSource.SELF>;
|
|
123
124
|
}, z.core.$strict>, z.ZodObject<{
|
|
124
125
|
source: z.ZodLiteral<BackingServiceSource.MANAGED>;
|
|
125
|
-
/** The Vault API address apps-manager dials, e.g. `https://vault.internal:8200`. */
|
|
126
126
|
address: z.ZodURL;
|
|
127
|
-
/** Vault Enterprise namespace (`team/keys/`); absent on open-source Vault and OpenBao's root namespace. */
|
|
128
127
|
namespace: z.ZodOptional<z.ZodString>;
|
|
129
128
|
transitMount: z.ZodOptional<z.ZodString>;
|
|
130
129
|
kvMount: z.ZodOptional<z.ZodString>;
|
|
@@ -141,16 +140,12 @@ export declare enum PlatformGoogleKmsKeyProtection {
|
|
|
141
140
|
/** AWS KMS in the operator's account. */
|
|
142
141
|
export declare const PlatformKeyAwsKmsConfigSchema: z.ZodObject<{
|
|
143
142
|
region: z.ZodString;
|
|
144
|
-
/** The role apps-manager assumes to read keys and sign. */
|
|
145
143
|
signerRoleArn: z.ZodString;
|
|
146
|
-
/** The role apps-manager assumes to create, disable and schedule the deletion of keys. */
|
|
147
144
|
operatorRoleArn: z.ZodString;
|
|
148
|
-
/** A KMS endpoint other than the region's public one (a VPC interface endpoint). */
|
|
149
145
|
endpoint: z.ZodOptional<z.ZodURL>;
|
|
150
146
|
}, z.core.$strict>;
|
|
151
147
|
/** Google Cloud KMS in the operator's project. */
|
|
152
148
|
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
149
|
keyRing: z.ZodString;
|
|
155
150
|
signerServiceAccount: z.ZodEmail;
|
|
156
151
|
operatorServiceAccount: z.ZodEmail;
|
|
@@ -158,20 +153,24 @@ export declare const PlatformKeyGoogleCloudKmsConfigSchema: z.ZodObject<{
|
|
|
158
153
|
}, z.core.$strict>;
|
|
159
154
|
/** Azure Key Vault (Premium) or Managed HSM in the operator's subscription. */
|
|
160
155
|
export declare const PlatformKeyAzureKeyVaultConfigSchema: z.ZodObject<{
|
|
161
|
-
/** `https://<vault>.vault.azure.net` or `https://<hsm>.managedhsm.azure.net`. */
|
|
162
156
|
vaultUrl: z.ZodURL;
|
|
163
|
-
/** The client id of the signer's user-assigned managed identity. */
|
|
164
157
|
signerClientId: z.ZodUUID;
|
|
165
|
-
/** The client id of the operator's user-assigned managed identity. */
|
|
166
158
|
operatorClientId: z.ZodUUID;
|
|
167
|
-
/** HSM-protected keys (`EC-HSM`, a Premium vault or Managed HSM); `false` makes software `EC` keys. */
|
|
168
159
|
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
160
|
logAnalyticsWorkspaceId: z.ZodOptional<z.ZodUUID>;
|
|
174
161
|
}, z.core.$strict>;
|
|
162
|
+
/** The SoftHSM2 module the platform image carries: the one PKCS#11 module a containerised apps-manager has without a mount. */
|
|
163
|
+
export declare const PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH = "/usr/lib/softhsm/libsofthsm2.so";
|
|
164
|
+
/**
|
|
165
|
+
* One file or directory of the HSM vendor's PKCS#11 client, mounted READ-ONLY into apps-manager's container (#3019): the
|
|
166
|
+
* module, its configuration, the client certificates. `hostPath` is on the docker host (compose) or on every node that
|
|
167
|
+
* may run apps-manager (Kubernetes, a `hostPath` volume); `containerPath` is where apps-manager sees it.
|
|
168
|
+
*/
|
|
169
|
+
export declare const PlatformKeyPkcs11ClientFileSchema: z.ZodObject<{
|
|
170
|
+
hostPath: z.ZodString;
|
|
171
|
+
containerPath: z.ZodString;
|
|
172
|
+
}, z.core.$strict>;
|
|
173
|
+
export type PlatformKeyPkcs11ClientFile = z.infer<typeof PlatformKeyPkcs11ClientFileSchema>;
|
|
175
174
|
/**
|
|
176
175
|
* A dedicated HSM reached over PKCS#11 (#2934): Thales Luna, Entrust nShield, AWS CloudHSM, Azure Cloud HSM, an
|
|
177
176
|
* 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 +180,49 @@ export declare const PlatformKeyAzureKeyVaultConfigSchema: z.ZodObject<{
|
|
|
181
180
|
* AND the token's model is listed in `hardwareTokenModels`, which is your statement that this model is the hardware you
|
|
182
181
|
* run. SoftHSM2 is always SOFTWARE. The binding (`pkcs11js`) is compiled by `pnpm setup:pkcs11`; an apps-manager that
|
|
183
182
|
* cannot load it says so at boot and refuses every signature on this provider.
|
|
183
|
+
*
|
|
184
|
+
* ## A real HSM in a containerised platform (#3019)
|
|
185
|
+
*
|
|
186
|
+
* The platform image carries only SoftHSM2. A real HSM's client comes from the host, and every vendor documents the same
|
|
187
|
+
* containerised shape: mount the client library and its configuration READ-ONLY, and point the client at its
|
|
188
|
+
* configuration with the vendor's own variable. So:
|
|
189
|
+
* - `clientFiles` lists what to mount, each `{ hostPath, containerPath }`. compose renders a read-only bind mount and refuses
|
|
190
|
+
* to start the service when the host path is missing; Kubernetes renders a read-only `hostPath` volume, which it mounts
|
|
191
|
+
* unchecked, so the files must exist on every node that may run apps-manager (a missing one shows as a token that cannot
|
|
192
|
+
* be opened, logged at boot). Both apps-manager services get them (INIT and serving).
|
|
193
|
+
* - `environment` carries the vendor's variables (`ChrystokiConfigurationPath` for a Thales Luna client, …). It is
|
|
194
|
+
* rendered in plain text beside the service, so it may hold paths and settings, never a credential; it may not name a
|
|
195
|
+
* variable Wildo sets itself. The token PIN stays in `secrets.json`.
|
|
196
|
+
* - In a container, `modulePath` must be the bundled SoftHSM2 or lie under a `containerPath`. Declaring `clientFiles` says
|
|
197
|
+
* apps-manager runs in a container, so that is refused here; without `clientFiles` it is refused when compose or
|
|
198
|
+
* Kubernetes renders apps-manager, because a framework developer's NATIVE apps-manager loads a host path legitimately
|
|
199
|
+
* (Homebrew's SoftHSM2, `/opt/homebrew/lib/softhsm/libsofthsm2.so`).
|
|
200
|
+
* - Both are for the CONTAINER lanes. A framework developer's native apps-manager runs on the host, where the client is
|
|
201
|
+
* installed and configured as the vendor documents, and receives neither.
|
|
202
|
+
*
|
|
203
|
+
* Example, a Thales Luna client installed under `/usr/safenet/lunaclient` on the host:
|
|
204
|
+
* `{ modulePath: '/usr/safenet/lunaclient/lib/libCryptoki2_64.so', tokenLabel: 'wildo', hardwareTokenModels: ['Luna K7'],
|
|
205
|
+
* clientFiles: [{ hostPath: '/usr/safenet/lunaclient', containerPath: '/usr/safenet/lunaclient' },
|
|
206
|
+
* { hostPath: '/etc/Chrystoki.conf', containerPath: '/etc/Chrystoki.conf' }],
|
|
207
|
+
* environment: { ChrystokiConfigurationPath: '/etc' } }`.
|
|
184
208
|
*/
|
|
185
209
|
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
210
|
modulePath: z.ZodString;
|
|
188
|
-
/** The token's label, as the module reports it. */
|
|
189
211
|
tokenLabel: z.ZodString;
|
|
190
|
-
/** Token models (`CK_TOKEN_INFO.model`) you state are hardware. Empty: every key reports SOFTWARE. */
|
|
191
212
|
hardwareTokenModels: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
213
|
+
clientFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
214
|
+
hostPath: z.ZodString;
|
|
215
|
+
containerPath: z.ZodString;
|
|
216
|
+
}, z.core.$strict>>>;
|
|
217
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
192
218
|
}, z.core.$strict>;
|
|
219
|
+
export type PlatformKeyPkcs11Config = z.infer<typeof PlatformKeyPkcs11ConfigSchema>;
|
|
193
220
|
export declare const WildoPlatformKeyManagementConfigSchema: z.ZodObject<{
|
|
194
221
|
vault: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
195
222
|
source: z.ZodLiteral<BackingServiceSource.SELF>;
|
|
196
223
|
}, z.core.$strict>, z.ZodObject<{
|
|
197
224
|
source: z.ZodLiteral<BackingServiceSource.MANAGED>;
|
|
198
|
-
/** The Vault API address apps-manager dials, e.g. `https://vault.internal:8200`. */
|
|
199
225
|
address: z.ZodURL;
|
|
200
|
-
/** Vault Enterprise namespace (`team/keys/`); absent on open-source Vault and OpenBao's root namespace. */
|
|
201
226
|
namespace: z.ZodOptional<z.ZodString>;
|
|
202
227
|
transitMount: z.ZodOptional<z.ZodString>;
|
|
203
228
|
kvMount: z.ZodOptional<z.ZodString>;
|
|
@@ -205,46 +230,50 @@ export declare const WildoPlatformKeyManagementConfigSchema: z.ZodObject<{
|
|
|
205
230
|
}, z.core.$strict>], "source">>;
|
|
206
231
|
awsKms: z.ZodOptional<z.ZodObject<{
|
|
207
232
|
region: z.ZodString;
|
|
208
|
-
/** The role apps-manager assumes to read keys and sign. */
|
|
209
233
|
signerRoleArn: z.ZodString;
|
|
210
|
-
/** The role apps-manager assumes to create, disable and schedule the deletion of keys. */
|
|
211
234
|
operatorRoleArn: z.ZodString;
|
|
212
|
-
/** A KMS endpoint other than the region's public one (a VPC interface endpoint). */
|
|
213
235
|
endpoint: z.ZodOptional<z.ZodURL>;
|
|
214
236
|
}, z.core.$strict>>;
|
|
215
237
|
googleCloudKms: z.ZodOptional<z.ZodObject<{
|
|
216
|
-
/** `projects/<project>/locations/<location>/keyRings/<ring>`; created by the operator, since a key ring cannot be deleted. */
|
|
217
238
|
keyRing: z.ZodString;
|
|
218
239
|
signerServiceAccount: z.ZodEmail;
|
|
219
240
|
operatorServiceAccount: z.ZodEmail;
|
|
220
241
|
protectionLevel: z.ZodDefault<z.ZodEnum<typeof PlatformGoogleKmsKeyProtection>>;
|
|
221
242
|
}, z.core.$strict>>;
|
|
222
243
|
azureKeyVault: z.ZodOptional<z.ZodObject<{
|
|
223
|
-
/** `https://<vault>.vault.azure.net` or `https://<hsm>.managedhsm.azure.net`. */
|
|
224
244
|
vaultUrl: z.ZodURL;
|
|
225
|
-
/** The client id of the signer's user-assigned managed identity. */
|
|
226
245
|
signerClientId: z.ZodUUID;
|
|
227
|
-
/** The client id of the operator's user-assigned managed identity. */
|
|
228
246
|
operatorClientId: z.ZodUUID;
|
|
229
|
-
/** HSM-protected keys (`EC-HSM`, a Premium vault or Managed HSM); `false` makes software `EC` keys. */
|
|
230
247
|
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
248
|
logAnalyticsWorkspaceId: z.ZodOptional<z.ZodUUID>;
|
|
236
249
|
}, z.core.$strict>>;
|
|
237
250
|
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
251
|
modulePath: z.ZodString;
|
|
240
|
-
/** The token's label, as the module reports it. */
|
|
241
252
|
tokenLabel: z.ZodString;
|
|
242
|
-
/** Token models (`CK_TOKEN_INFO.model`) you state are hardware. Empty: every key reports SOFTWARE. */
|
|
243
253
|
hardwareTokenModels: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
254
|
+
clientFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
255
|
+
hostPath: z.ZodString;
|
|
256
|
+
containerPath: z.ZodString;
|
|
257
|
+
}, z.core.$strict>>>;
|
|
258
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
244
259
|
}, z.core.$strict>>;
|
|
245
260
|
}, z.core.$strict>;
|
|
246
261
|
export type WildoPlatformKeyManagementConfig = z.infer<typeof WildoPlatformKeyManagementConfigSchema>;
|
|
247
262
|
/** @wildo_source:part:end platform.config.platform-key-management */
|
|
263
|
+
/** What deciding a module's reachability needs: the module, and where the client files are mounted. */
|
|
264
|
+
export interface Pkcs11ModuleMountView {
|
|
265
|
+
readonly modulePath: string;
|
|
266
|
+
readonly clientFiles?: readonly {
|
|
267
|
+
readonly containerPath: string;
|
|
268
|
+
}[];
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Whether apps-manager, running in the PLATFORM IMAGE, can load `modulePath`: it is the bundled SoftHSM2, or it lies at or
|
|
272
|
+
* under one of the declared `clientFiles[].containerPath`. Nothing else exists in that container.
|
|
273
|
+
*/
|
|
274
|
+
export declare function pkcs11ModuleIsReachableInPlatformContainer(pkcs11: Pkcs11ModuleMountView): boolean;
|
|
275
|
+
/** The refusal both container lanes (compose, Kubernetes) raise for an unreachable module, naming the declaration. */
|
|
276
|
+
export declare function describeUnreachablePkcs11Module(pkcs11: Pkcs11ModuleMountView, environmentName?: string): string;
|
|
248
277
|
/** Whether the platform runs its own Vault (OpenBao) in this environment: the one predicate both lanes render from. */
|
|
249
278
|
export declare function selfHostsPlatformKeyVault(platformKeyManagement: WildoPlatformKeyManagementConfig | undefined): boolean;
|
|
250
279
|
//# 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":["../../../../src/project-config/shared/platform-key-management.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,4IAA4I;AAC5I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS;QAAE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACtE;AAmBD;;;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,6 @@
|
|
|
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';
|
|
3
|
+
import { AGENT_CONTENT_GUARDRAILS_ENV_VAR } from '@wildo-ai/saas-models';
|
|
2
4
|
import { BackingServiceSource } from './backing-services.schemas.js';
|
|
3
5
|
/** @wildo_source:part:start platform.config.platform-key-management facet:layer:platform facet:family:infra facet:audience:app-developer */
|
|
4
6
|
/**
|
|
@@ -64,11 +66,14 @@ import { BackingServiceSource } from './backing-services.schemas.js';
|
|
|
64
66
|
* - Azure Key Vault (a vault in the Azure RBAC permission model): two user-assigned managed identities on apps-manager,
|
|
65
67
|
* 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
|
|
66
68
|
* key, and "Key Vault Crypto Officer" holds `vaults/keys/*`, signing included.
|
|
67
|
-
* - Signer: `Microsoft.KeyVault/vaults/keys/read`, `…/keys/
|
|
69
|
+
* - Signer: `Microsoft.KeyVault/vaults/keys/read`, `…/keys/sign/action`,
|
|
68
70
|
* `…/keys/encrypt/action`, `…/keys/decrypt/action` (a data key is wrapped with A256GCM under an `oct-HSM` key, which
|
|
69
71
|
* a Premium vault offers in preview; a Standard vault cannot hold one and serves signing only).
|
|
70
|
-
* - Operator: `…/keys/read`, `…/keys/
|
|
72
|
+
* - Operator: `…/keys/read`, `…/keys/create/action`, `…/keys/update/action` (disable),
|
|
71
73
|
* `…/keys/delete`, `…/keys/purge/action`.
|
|
74
|
+
* Azure has no `keys/versions/read` data action: `keys/read` reads every version. Measured 2026-11-12 (#3697) with two
|
|
75
|
+
* user-assigned managed identities holding exactly these roles: each verb succeeded as its own identity and answered
|
|
76
|
+
* 403 as the other one.
|
|
72
77
|
* The vault's recovery level decides whether a destroyed key is purged at once or kept until retention ends.
|
|
73
78
|
* - Azure Managed HSM (`*.managedhsm.azure.net`): the same two identities, with custom roles in the HSM's LOCAL RBAC
|
|
74
79
|
* (the built-in "Managed HSM Crypto User" can sign and back up, and cannot purge). Signer:
|
|
@@ -161,6 +166,24 @@ export const PlatformKeyAzureKeyVaultConfigSchema = z.strictObject({
|
|
|
161
166
|
*/
|
|
162
167
|
logAnalyticsWorkspaceId: z.uuid().optional(),
|
|
163
168
|
});
|
|
169
|
+
/** The SoftHSM2 module the platform image carries: the one PKCS#11 module a containerised apps-manager has without a mount. */
|
|
170
|
+
export const PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH = '/usr/lib/softhsm/libsofthsm2.so';
|
|
171
|
+
/** An absolute path with no `.` or `..` segment, so "is this path inside that mount" is a plain prefix question. */
|
|
172
|
+
const AbsoluteNormalPathSchema = z
|
|
173
|
+
.string()
|
|
174
|
+
.regex(/^\//, 'an absolute path')
|
|
175
|
+
.refine((path) => !/(^|\/)\.{1,2}(\/|$)/.test(path), 'a path with no `.` or `..` segment');
|
|
176
|
+
/** Where the platform image keeps apps-manager itself: a mount here (or over `/`) would hide the service it serves. */
|
|
177
|
+
const PLATFORM_IMAGE_APPLICATION_ROOT = '/app';
|
|
178
|
+
/**
|
|
179
|
+
* One file or directory of the HSM vendor's PKCS#11 client, mounted READ-ONLY into apps-manager's container (#3019): the
|
|
180
|
+
* module, its configuration, the client certificates. `hostPath` is on the docker host (compose) or on every node that
|
|
181
|
+
* may run apps-manager (Kubernetes, a `hostPath` volume); `containerPath` is where apps-manager sees it.
|
|
182
|
+
*/
|
|
183
|
+
export const PlatformKeyPkcs11ClientFileSchema = z.strictObject({
|
|
184
|
+
hostPath: AbsoluteNormalPathSchema,
|
|
185
|
+
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)`),
|
|
186
|
+
});
|
|
164
187
|
/**
|
|
165
188
|
* A dedicated HSM reached over PKCS#11 (#2934): Thales Luna, Entrust nShield, AWS CloudHSM, Azure Cloud HSM, an
|
|
166
189
|
* 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 +193,63 @@ export const PlatformKeyAzureKeyVaultConfigSchema = z.strictObject({
|
|
|
170
193
|
* AND the token's model is listed in `hardwareTokenModels`, which is your statement that this model is the hardware you
|
|
171
194
|
* run. SoftHSM2 is always SOFTWARE. The binding (`pkcs11js`) is compiled by `pnpm setup:pkcs11`; an apps-manager that
|
|
172
195
|
* cannot load it says so at boot and refuses every signature on this provider.
|
|
196
|
+
*
|
|
197
|
+
* ## A real HSM in a containerised platform (#3019)
|
|
198
|
+
*
|
|
199
|
+
* The platform image carries only SoftHSM2. A real HSM's client comes from the host, and every vendor documents the same
|
|
200
|
+
* containerised shape: mount the client library and its configuration READ-ONLY, and point the client at its
|
|
201
|
+
* configuration with the vendor's own variable. So:
|
|
202
|
+
* - `clientFiles` lists what to mount, each `{ hostPath, containerPath }`. compose renders a read-only bind mount and refuses
|
|
203
|
+
* to start the service when the host path is missing; Kubernetes renders a read-only `hostPath` volume, which it mounts
|
|
204
|
+
* unchecked, so the files must exist on every node that may run apps-manager (a missing one shows as a token that cannot
|
|
205
|
+
* be opened, logged at boot). Both apps-manager services get them (INIT and serving).
|
|
206
|
+
* - `environment` carries the vendor's variables (`ChrystokiConfigurationPath` for a Thales Luna client, …). It is
|
|
207
|
+
* rendered in plain text beside the service, so it may hold paths and settings, never a credential; it may not name a
|
|
208
|
+
* variable Wildo sets itself. The token PIN stays in `secrets.json`.
|
|
209
|
+
* - In a container, `modulePath` must be the bundled SoftHSM2 or lie under a `containerPath`. Declaring `clientFiles` says
|
|
210
|
+
* apps-manager runs in a container, so that is refused here; without `clientFiles` it is refused when compose or
|
|
211
|
+
* Kubernetes renders apps-manager, because a framework developer's NATIVE apps-manager loads a host path legitimately
|
|
212
|
+
* (Homebrew's SoftHSM2, `/opt/homebrew/lib/softhsm/libsofthsm2.so`).
|
|
213
|
+
* - Both are for the CONTAINER lanes. A framework developer's native apps-manager runs on the host, where the client is
|
|
214
|
+
* installed and configured as the vendor documents, and receives neither.
|
|
215
|
+
*
|
|
216
|
+
* Example, a Thales Luna client installed under `/usr/safenet/lunaclient` on the host:
|
|
217
|
+
* `{ modulePath: '/usr/safenet/lunaclient/lib/libCryptoki2_64.so', tokenLabel: 'wildo', hardwareTokenModels: ['Luna K7'],
|
|
218
|
+
* clientFiles: [{ hostPath: '/usr/safenet/lunaclient', containerPath: '/usr/safenet/lunaclient' },
|
|
219
|
+
* { hostPath: '/etc/Chrystoki.conf', containerPath: '/etc/Chrystoki.conf' }],
|
|
220
|
+
* environment: { ChrystokiConfigurationPath: '/etc' } }`.
|
|
173
221
|
*/
|
|
174
|
-
export const PlatformKeyPkcs11ConfigSchema = z
|
|
175
|
-
|
|
222
|
+
export const PlatformKeyPkcs11ConfigSchema = z
|
|
223
|
+
.strictObject({
|
|
224
|
+
/**
|
|
225
|
+
* The vendor's PKCS#11 module, as an absolute path in apps-manager's filesystem: in the platform image, the bundled
|
|
226
|
+
* `/usr/lib/softhsm/libsofthsm2.so` or a path under a `clientFiles[].containerPath`.
|
|
227
|
+
*/
|
|
176
228
|
modulePath: z.string().regex(/^\//, 'an absolute path'),
|
|
177
229
|
/** The token's label, as the module reports it. */
|
|
178
230
|
tokenLabel: z.string().min(1).max(32),
|
|
179
231
|
/** Token models (`CK_TOKEN_INFO.model`) you state are hardware. Empty: every key reports SOFTWARE. */
|
|
180
232
|
hardwareTokenModels: z.array(z.string().min(1)).default([]),
|
|
233
|
+
/** The vendor client's files, mounted read-only into apps-manager's container (#3019). */
|
|
234
|
+
clientFiles: z.array(PlatformKeyPkcs11ClientFileSchema).optional(),
|
|
235
|
+
/** The vendor client's own environment variables (no credential, and no variable Wildo sets). */
|
|
236
|
+
environment: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/, 'an environment variable name'), z.string()).optional(),
|
|
237
|
+
})
|
|
238
|
+
.superRefine((pkcs11, context) => {
|
|
239
|
+
const containerPaths = (pkcs11.clientFiles ?? []).map((file) => file.containerPath.replace(/\/+$/, ''));
|
|
240
|
+
containerPaths.forEach((containerPath, index) => {
|
|
241
|
+
if (containerPaths.indexOf(containerPath) !== index) {
|
|
242
|
+
context.addIssue({ code: 'custom', path: ['clientFiles', index, 'containerPath'], message: `"${containerPath}" is mounted twice` });
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
for (const name of Object.keys(pkcs11.environment ?? {})) {
|
|
246
|
+
if (WILDO_OWNED_PLATFORM_ENV_KEYS.has(name)) {
|
|
247
|
+
context.addIssue({ code: 'custom', path: ['environment', name], message: `"${name}" is a variable Wildo sets on apps-manager itself` });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if (containerPaths.length > 0 && !pkcs11ModuleIsReachableInPlatformContainer(pkcs11)) {
|
|
251
|
+
context.addIssue({ code: 'custom', path: ['modulePath'], message: describeUnreachablePkcs11Module(pkcs11) });
|
|
252
|
+
}
|
|
181
253
|
});
|
|
182
254
|
export const WildoPlatformKeyManagementConfigSchema = z.strictObject({
|
|
183
255
|
vault: PlatformKeyVaultConfigSchema.optional(),
|
|
@@ -186,7 +258,43 @@ export const WildoPlatformKeyManagementConfigSchema = z.strictObject({
|
|
|
186
258
|
azureKeyVault: PlatformKeyAzureKeyVaultConfigSchema.optional(),
|
|
187
259
|
pkcs11: PlatformKeyPkcs11ConfigSchema.optional(),
|
|
188
260
|
});
|
|
189
|
-
/**
|
|
261
|
+
/**
|
|
262
|
+
* Every environment variable Wildo itself sets on a platform process. A vendor `environment` entry may name none of them:
|
|
263
|
+
* it would overwrite the platform's own value (a PIN, a connection string, the service's mode), and the vendor block is
|
|
264
|
+
* rendered in plain text beside the service, never into a Secret.
|
|
265
|
+
*/
|
|
266
|
+
const WILDO_OWNED_PLATFORM_ENV_KEYS = new Set([
|
|
267
|
+
...[
|
|
268
|
+
PlatformProcessEnvKey, PlatformServiceUrlEnvKey, PlatformInfrastructureEnvKey, PlatformSecurityEnvKey, PlatformAdminEnvKey,
|
|
269
|
+
PlatformKubernetesEnvKey, PlatformIngressEnvKey, PlatformLoggingEnvKey, PlatformObservabilityEnvKey, PlatformProviderSelectionEnvKey,
|
|
270
|
+
PlatformEmailEnvKey, PlatformOwnershipDnsEnvKey, PlatformDocumentationSiteEnvKey,
|
|
271
|
+
].flatMap((vocabulary) => Object.values(vocabulary)),
|
|
272
|
+
// An application runtime's guardrail posture (`WildoInfraEnvConfig.agentContentGuardrails`), named by saas-models.
|
|
273
|
+
AGENT_CONTENT_GUARDRAILS_ENV_VAR,
|
|
274
|
+
// Set literally by the deployment templates rather than through the env contract.
|
|
275
|
+
'PLATFORM_SERVICE', 'NODE_OPTIONS', 'NODE_ENV',
|
|
276
|
+
]);
|
|
277
|
+
/**
|
|
278
|
+
* Whether apps-manager, running in the PLATFORM IMAGE, can load `modulePath`: it is the bundled SoftHSM2, or it lies at or
|
|
279
|
+
* under one of the declared `clientFiles[].containerPath`. Nothing else exists in that container.
|
|
280
|
+
*/
|
|
281
|
+
export function pkcs11ModuleIsReachableInPlatformContainer(pkcs11) {
|
|
282
|
+
if (pkcs11.modulePath === PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH)
|
|
283
|
+
return true;
|
|
284
|
+
return (pkcs11.clientFiles ?? []).some(({ containerPath }) => {
|
|
285
|
+
const mountRoot = containerPath.replace(/\/+$/, '');
|
|
286
|
+
return pkcs11.modulePath === mountRoot || pkcs11.modulePath.startsWith(`${mountRoot}/`);
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
/** The refusal both container lanes (compose, Kubernetes) raise for an unreachable module, naming the declaration. */
|
|
290
|
+
export function describeUnreachablePkcs11Module(pkcs11, environmentName) {
|
|
291
|
+
const mounts = (pkcs11.clientFiles ?? []).map((file) => file.containerPath);
|
|
292
|
+
return `${environmentName ? `Environment "${environmentName}": ` : ''}platformKeyManagement.pkcs11.modulePath "${pkcs11.modulePath}" `
|
|
293
|
+
+ `is not the SoftHSM2 module the platform image carries (${PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH}) and lies under no `
|
|
294
|
+
+ `platformKeyManagement.pkcs11.clientFiles[].containerPath (${mounts.length > 0 ? mounts.join(', ') : 'none declared'}). `
|
|
295
|
+
+ 'apps-manager runs in the platform image, where nothing else exists: declare the vendor\'s module (and its configuration) '
|
|
296
|
+
+ 'in clientFiles as { hostPath, containerPath } and point modulePath inside one of them.';
|
|
297
|
+
}
|
|
190
298
|
/** Whether the platform runs its own Vault (OpenBao) in this environment: the one predicate both lanes render from. */
|
|
191
299
|
export function selfHostsPlatformKeyVault(platformKeyManagement) {
|
|
192
300
|
return platformKeyManagement?.vault?.source === BackingServiceSource.SELF;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-key-management.schemas.js","sourceRoot":"","sources":["../../../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C,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC9B;;;OAGG;IACH,uBAAuB,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC1D,8HAA8H;IAC9H,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACvD,mDAAmD;IACnD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACrC,sGAAsG;IACtG,mBAAmB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAC5D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,YAAY,CAAC;IACnE,KAAK,EAAE,4BAA4B,CAAC,QAAQ,EAAE;IAC9C,MAAM,EAAE,6BAA6B,CAAC,QAAQ,EAAE;IAChD,cAAc,EAAE,qCAAqC,CAAC,QAAQ,EAAE;IAChE,aAAa,EAAE,oCAAoC,CAAC,QAAQ,EAAE;IAC9D,MAAM,EAAE,6BAA6B,CAAC,QAAQ,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,gCAAgC,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,4IAA4I;AAC5I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGG;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,GAA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AC,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 { AGENT_CONTENT_GUARDRAILS_ENV_VAR } from '@wildo-ai/saas-models';\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/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/create/action`, `…/keys/update/action` (disable),\n * `…/keys/delete`, `…/keys/purge/action`.\n * Azure has no `keys/versions/read` data action: `keys/read` reads every version. Measured 2026-11-12 (#3697) with two\n * user-assigned managed identities holding exactly these roles: each verb succeeded as its own identity and answered\n * 403 as the other one.\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 // An application runtime's guardrail posture (`WildoInfraEnvConfig.agentContentGuardrails`), named by saas-models.\n AGENT_CONTENT_GUARDRAILS_ENV_VAR,\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,wBAAwB;IAC9C,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C,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"}
|