@wildo-ai/platform-config-lib 1.1.11 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/_unimplemented/soft-warn.d.ts +24 -49
- package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
- package/dist/esm/_unimplemented/soft-warn.js +24 -49
- package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
- package/dist/esm/blueprint/anchored-region.d.ts.map +1 -1
- package/dist/esm/blueprint/anchored-region.js.map +1 -1
- package/dist/esm/blueprint/blueprint.schemas.d.ts +0 -89
- package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -1
- package/dist/esm/blueprint/blueprint.schemas.js.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts +8 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js +15 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +10 -2
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js +10 -2
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.d.ts +21 -0
- package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.js +25 -0
- package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +80 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +81 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -0
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +41 -9
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.js +77 -28
- package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.d.ts +117 -12
- package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.js +222 -23
- package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.d.ts +31 -4
- package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.js +43 -2
- package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +40 -2
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.js +66 -3
- package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-response-integrity.js +3 -3
- package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -1
- package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
- package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -1
- package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/config-authoring.entry.js.map +1 -1
- package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
- package/dist/esm/credentials/credential-generator.service.js.map +1 -1
- package/dist/esm/index.d.ts +5 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts +119 -0
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.js +109 -0
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.js.map +1 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts +182 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.js +145 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.js.map +1 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.d.ts +156 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.d.ts.map +1 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.js +617 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.js.map +1 -0
- package/dist/esm/key-management/approval-seal-verifier.d.ts +101 -39
- package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -1
- package/dist/esm/key-management/approval-seal-verifier.js +134 -12
- package/dist/esm/key-management/approval-seal-verifier.js.map +1 -1
- package/dist/esm/key-management/approval-seal.contracts.d.ts +12 -15
- package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/approval-seal.contracts.js +20 -0
- package/dist/esm/key-management/approval-seal.contracts.js.map +1 -1
- package/dist/esm/key-management/data-key.contracts.d.ts +0 -2
- package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/data-key.contracts.js.map +1 -1
- package/dist/esm/key-management/es256-jws.d.ts.map +1 -1
- package/dist/esm/key-management/es256-jws.js.map +1 -1
- package/dist/esm/key-management/key-provider.spi.d.ts +8 -1
- package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -1
- package/dist/esm/key-management/key-provider.spi.js.map +1 -1
- package/dist/esm/key-management/keyring-rotation.contracts.d.ts +2 -12
- package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/keyring-rotation.contracts.js +3 -3
- package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -1
- package/dist/esm/key-management/keyring-status.contracts.d.ts +0 -7
- package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/keyring-status.contracts.js.map +1 -1
- package/dist/esm/key-management/pdf-incremental-update.d.ts +158 -0
- package/dist/esm/key-management/pdf-incremental-update.d.ts.map +1 -0
- package/dist/esm/key-management/pdf-incremental-update.js +730 -0
- package/dist/esm/key-management/pdf-incremental-update.js.map +1 -0
- package/dist/esm/key-management/pdf-truetype-font.d.ts +35 -0
- package/dist/esm/key-management/pdf-truetype-font.d.ts.map +1 -0
- package/dist/esm/key-management/pdf-truetype-font.js +152 -0
- package/dist/esm/key-management/pdf-truetype-font.js.map +1 -0
- package/dist/esm/key-management/qr-code.d.ts +38 -0
- package/dist/esm/key-management/qr-code.d.ts.map +1 -0
- package/dist/esm/key-management/qr-code.js +325 -0
- package/dist/esm/key-management/qr-code.js.map +1 -0
- package/dist/esm/key-management/signature-request.contracts.d.ts +0 -4
- package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/signature-request.contracts.js.map +1 -1
- package/dist/esm/key-management/signing-log-export.contracts.d.ts +0 -1
- package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -1
- package/dist/esm/key-management/vault-custody.contracts.d.ts +43 -0
- package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/vault-custody.contracts.js +66 -0
- package/dist/esm/key-management/vault-custody.contracts.js.map +1 -1
- package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
- package/dist/esm/lockfile/build-parallelism.js.map +1 -1
- package/dist/esm/lockfile/canonical-json.d.ts +1 -1
- package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
- package/dist/esm/lockfile/canonical-json.js +1 -1
- package/dist/esm/lockfile/canonical-json.js.map +1 -1
- package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
- package/dist/esm/lockfile/file-lock-hold.js +2 -1
- package/dist/esm/lockfile/file-lock-hold.js.map +1 -1
- package/dist/esm/lockfile/lockfile-io.d.ts +6 -8
- package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
- package/dist/esm/lockfile/lockfile-io.js +6 -8
- package/dist/esm/lockfile/lockfile-io.js.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.d.ts +5 -6
- package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.js +4 -5
- package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +1 -247
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
- package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +146 -0
- package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts.map +1 -0
- package/dist/esm/pnpm-settings/application-pnpm-settings.js +573 -0
- package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -0
- package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
- package/dist/esm/project-config/application-public-pricing-catalog.loader.js +15 -3
- package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
- package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -1
- package/dist/esm/project-config/application-served-public-documents.loader.js +16 -8
- package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -1
- package/dist/esm/project-config/backend-compliance-section.reader.d.ts +35 -0
- package/dist/esm/project-config/backend-compliance-section.reader.d.ts.map +1 -0
- package/dist/esm/project-config/backend-compliance-section.reader.js +123 -0
- package/dist/esm/project-config/backend-compliance-section.reader.js.map +1 -0
- package/dist/esm/project-config/backend-compliance-section.worker.d.ts +20 -0
- package/dist/esm/project-config/backend-compliance-section.worker.d.ts.map +1 -0
- package/dist/esm/project-config/backend-compliance-section.worker.js +78 -0
- package/dist/esm/project-config/backend-compliance-section.worker.js.map +1 -0
- package/dist/esm/project-config/config-module-resolution.d.ts +32 -0
- package/dist/esm/project-config/config-module-resolution.d.ts.map +1 -0
- package/dist/esm/project-config/config-module-resolution.js +33 -0
- package/dist/esm/project-config/config-module-resolution.js.map +1 -0
- package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-framework-config.js.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts +109 -55
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.js +108 -70
- package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/define-minion-config.d.ts +26 -36
- package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-minion-config.js +64 -25
- package/dist/esm/project-config/define-minion-config.js.map +1 -1
- package/dist/esm/project-config/define-saas-config.d.ts +41 -437
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js +102 -94
- package/dist/esm/project-config/define-saas-config.js.map +1 -1
- package/dist/esm/project-config/define-worker-config.d.ts +10 -20
- package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-worker-config.js +10 -12
- package/dist/esm/project-config/define-worker-config.js.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.js +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/index.d.ts +2 -0
- package/dist/esm/project-config/index.d.ts.map +1 -1
- package/dist/esm/project-config/index.js +2 -0
- package/dist/esm/project-config/index.js.map +1 -1
- package/dist/esm/project-config/loader-instances-zod.d.ts +19 -0
- package/dist/esm/project-config/loader-instances-zod.d.ts.map +1 -0
- package/dist/esm/project-config/loader-instances-zod.js +40 -0
- package/dist/esm/project-config/loader-instances-zod.js.map +1 -0
- package/dist/esm/project-config/loader.d.ts +131 -14
- package/dist/esm/project-config/loader.d.ts.map +1 -1
- package/dist/esm/project-config/loader.js +226 -12
- package/dist/esm/project-config/loader.js.map +1 -1
- package/dist/esm/project-config/minion-liveness.contracts.d.ts +131 -0
- package/dist/esm/project-config/minion-liveness.contracts.d.ts.map +1 -0
- package/dist/esm/project-config/minion-liveness.contracts.js +167 -0
- package/dist/esm/project-config/minion-liveness.contracts.js.map +1 -0
- package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
- package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
- package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
- package/dist/esm/project-config/npm-version-range.js.map +1 -1
- package/dist/esm/project-config/owning-package-tsconfig.d.ts +7 -7
- package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -1
- package/dist/esm/project-config/owning-package-tsconfig.js +7 -7
- package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.js +3 -1
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +71 -46
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js +150 -4
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +0 -2
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.d.ts +0 -17
- package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts +9 -10
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.js +13 -15
- package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/cdn.schemas.d.ts +0 -51
- package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.d.ts +34 -6
- package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.js +52 -8
- package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.d.ts +60 -13
- package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.js +77 -24
- package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.d.ts +72 -84
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.js +40 -12
- package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.d.ts +0 -8
- package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts +95 -8
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +122 -10
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +10 -4
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +20 -0
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.js +21 -2
- package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
- package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
- package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
- package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +62 -36
- package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-key-management.schemas.js +105 -3
- package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +2 -2
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.js +16 -2
- package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +21 -23
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.js +4 -5
- package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +0 -18
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
- package/dist/esm/project-config/static-asset-import-noop.d.ts +20 -3
- package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
- package/dist/esm/project-config/static-asset-import-noop.js +36 -20
- package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.d.ts +0 -5
- package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
- package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/digest.schemas.js.map +1 -1
- package/dist/esm/registry/index.d.ts +2 -3
- package/dist/esm/registry/index.d.ts.map +1 -1
- package/dist/esm/registry/index.js +2 -3
- package/dist/esm/registry/index.js.map +1 -1
- package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
- package/dist/esm/registry/local-checkout-source.js.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +1 -98
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.js +1 -2
- package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.d.ts +17 -17
- package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.d.ts +151 -219
- package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.js +145 -13
- package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
- package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-search.schemas.js.map +1 -1
- package/dist/esm/registry/registry-config.schemas.d.ts +0 -18
- package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-config.schemas.js.map +1 -1
- package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
- package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
- package/dist/esm/registry/registry-errors.d.ts +81 -3
- package/dist/esm/registry/registry-errors.d.ts.map +1 -1
- package/dist/esm/registry/registry-errors.js +185 -4
- package/dist/esm/registry/registry-errors.js.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
- package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -1
- package/dist/esm/registry/registry-url-resolution.js.map +1 -1
- package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.js.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts +0 -7
- package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.d.ts +2 -2
- package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
- package/dist/esm/workspace-scope/index.d.ts.map +1 -1
- package/dist/esm/workspace-scope/index.js.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/dist/esm/_unimplemented/index.d.ts +0 -3
- package/dist/esm/_unimplemented/index.d.ts.map +0 -1
- package/dist/esm/_unimplemented/index.js +0 -3
- package/dist/esm/_unimplemented/index.js.map +0 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +0 -137
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +0 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.js +0 -153
- package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +0 -1
- package/dist/esm/project-config/shared/cdn.example.d.ts +0 -14
- package/dist/esm/project-config/shared/cdn.example.d.ts.map +0 -1
- package/dist/esm/project-config/shared/cdn.example.js +0 -38
- package/dist/esm/project-config/shared/cdn.example.js.map +0 -1
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts +0 -15
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +0 -1
- package/dist/esm/project-config/shared/schema-version.schemas.js +0 -40
- package/dist/esm/project-config/shared/schema-version.schemas.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signing-log-export.contracts.js","sourceRoot":"","sources":["../../../../src/key-management/signing-log-export.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,sBAAsB,EAAE,eAAe,EAAwB,MAAM,uBAAuB,CAAC;AAC1I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K,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,CAAC,iBAAiB,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;QACxG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IACD,MAAM,SAAS,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3E,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC;QACjD,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClI,IAAI,KAAK;YAAE,aAAa,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,4BAA4B,CAAC,eAAe,EAAE,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChK,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;AACnE,CAAC","sourcesContent":["/**\n * # The signing log and its export (#2891, #2932)\n *\n * The custodian records every signature it makes in the application's SIGNING LOG, a hash chain: each entry carries the\n * previous entry's hash, and the first chains to the application's genesis anchor, so a removed or edited entry breaks\n * every hash after it. The log lives on the host. An EXPORT is what lets the operator hold it independently: a range of\n * entries and the chain's head at that moment, signed under its own purpose ({@link CryptoKey_Purpose.SIGNING_LOG_EXPORT},\n * `typ: signing-log+jws`), which the operator pulls into storage the host does not control.\n *\n * What a kept export proves, and only that:\n * - **an entry inserted into the log's past** (or an entry edited or removed) breaks the chain against it: a later\n * export disagrees with the kept one at some sequence, which {@link compareSigningLogExports} reports;\n * - **a seal it lists existed when it was signed**, so a seal under a key compromised after that instant is\n * corroborated (the approval-seal verifier reads the exports for this). Backdating after a compromise is therefore\n * bounded by the time since the operator's last export.\n *\n * What it does not prove: anything about entries appended after it, until the next export; and nothing at all for a\n * self-hosted operator, who is its own host and so signs its own exports.\n *\n * Everything here is pure and offline: an auditor checks exports with the operator's pin set and nothing else.\n */\nimport { createHash } from 'node:crypto';\nimport { z } from 'zod';\nimport { CryptoKey_Purpose, CryptoKey_Scope, CryptoKey_VersionState, singleJwsTypeOf, type CryptoKeyPinSet } from '@wildo-ai/saas-models';\nimport { canonicalizeJson } from '../canonical-json/rfc8785-canonical-json';\nimport { ES256_JWS_ALGORITHM, base64url, isP256PublicJwk, p256JwkThumbprint, verifyEs256 } from './es256-jws';\nimport type { ApprovalSealVerificationKey } from './approval-seal-verifier';\n\n/** The export's JWS `typ`. */\nexport const SIGNING_LOG_EXPORT_TYP = singleJwsTypeOf(CryptoKey_Purpose.SIGNING_LOG_EXPORT);\n\n/** The most entries one export carries; an operator pulls a longer log in several exports. */\nexport const SIGNING_LOG_EXPORT_MAXIMUM_ENTRIES = 1000;\n\n/** The anchor the first entry of an application's signing log chains to. */\nexport function signingLogGenesisHash(wildoApplicationId: string): string {\n return base64url(createHash('sha256').update(canonicalizeJson({ chain: 'wildo-signing-log-genesis', wildoApplicationId }), 'utf8').digest());\n}\n\n/** The fields of an entry its hash covers: everything but the hash itself. */\nexport interface SigningLogChainedFields {\n readonly wildoApplicationId: string;\n /** 1 for the application's first signature, +1 for each next one. */\n readonly sequence: number;\n readonly purpose: CryptoKey_Purpose;\n readonly iss: string;\n readonly jti: string;\n /** SHA-256 (base64url) over the RFC 8785 serialization of the signed claims. */\n readonly claimsDigest: string;\n readonly decisionPayloadDigest: string;\n readonly kid: string;\n readonly iat: number;\n readonly principal: string;\n readonly previousEntryHash: string;\n}\n\n/** An entry's hash: SHA-256 over the RFC 8785 serialization of its chained fields. */\nexport function signingLogEntryHashOf(fields: SigningLogChainedFields): string {\n const covered: SigningLogChainedFields = {\n wildoApplicationId: fields.wildoApplicationId,\n sequence: fields.sequence,\n purpose: fields.purpose,\n iss: fields.iss,\n jti: fields.jti,\n claimsDigest: fields.claimsDigest,\n decisionPayloadDigest: fields.decisionPayloadDigest,\n kid: fields.kid,\n iat: fields.iat,\n principal: fields.principal,\n previousEntryHash: fields.previousEntryHash,\n };\n return base64url(createHash('sha256').update(canonicalizeJson(covered), 'utf8').digest());\n}\n\n/** One entry, as an export carries it: its chained fields (the application id is the export's) and its hash. */\nexport const SigningLogExportEntrySchema = z.strictObject({\n sequence: z.number().int().min(1),\n purpose: z.enum(CryptoKey_Purpose),\n iss: z.string().min(1),\n jti: z.string().min(1),\n claimsDigest: z.string().min(1),\n decisionPayloadDigest: z.string().min(1),\n kid: z.string().min(1),\n iat: z.number().int(),\n principal: z.string().min(1),\n previousEntryHash: z.string().min(1),\n entryHash: z.string().min(1),\n});\nexport type SigningLogExportEntry = z.infer<typeof SigningLogExportEntrySchema>;\n\n/** The chain's head when the export was made: sequence 0 and the genesis anchor for an empty log. */\nexport const SigningLogHeadSchema = z.strictObject({ sequence: z.number().int().min(0), entryHash: z.string().min(1) });\nexport type SigningLogHead = z.infer<typeof SigningLogHeadSchema>;\n\n/**\n * The signed claims of an export. `iss` and `iat` are the custodian's, as on a seal; `jti` names the export, and is the\n * id of the log entry the export's own signature is recorded under, so the next export lists this one.\n */\nexport const SigningLogExportClaimsSchema = z.strictObject({\n iss: z.string().min(1),\n iat: z.number().int(),\n jti: z.string().min(1),\n wildoApplicationId: z.string().min(1),\n /** The entries are the ones after this sequence (0: from the first). */\n afterSequence: z.number().int().min(0),\n entries: z.array(SigningLogExportEntrySchema).max(SIGNING_LOG_EXPORT_MAXIMUM_ENTRIES),\n head: SigningLogHeadSchema,\n});\nexport type SigningLogExportClaims = z.infer<typeof SigningLogExportClaimsSchema>;\n\n/**\n * What the application backend asks the custodian for, on the operator's behalf: the entries after the operator's last\n * export (0 for the first), at most `limit` of them. The custodian builds and signs the export from its own log; nothing\n * in the request reaches the signed claims but the range.\n */\nexport const SigningLogExportRequestSchema = z.strictObject({\n afterSequence: z.number().int().min(0),\n limit: z.number().int().min(1).max(SIGNING_LOG_EXPORT_MAXIMUM_ENTRIES).optional(),\n});\nexport type SigningLogExportRequest = z.infer<typeof SigningLogExportRequestSchema>;\n\n/** The custodian's answer: the export, the key it was signed with, and where the operator's next pull starts. */\nexport interface SigningLogExportResponse {\n readonly jws: string;\n readonly kid: string;\n readonly iss: string;\n readonly iat: number;\n /** The chain's head when the export was made. */\n readonly headSequence: number;\n /** The last sequence the export carries: the `afterSequence` of the next pull. */\n readonly throughSequence: number;\n /** The sequence the export's own signature was recorded under, so the next export lists it. */\n readonly recordedAtSequence: number;\n}\n\n/**\n * A published verification key's stored record, as a bundle or an export file states it (dates as ISO strings): its public\n * half, the algorithm it pins, its scope and issuer, its state. A verifier given the operator's pin set takes only the\n * public half and the issuer from it.\n */\nexport const VerificationKeyRecordSchema = z.object({\n kid: z.string().min(1),\n publicJwk: z.object({ kty: z.literal('EC'), crv: z.literal('P-256'), x: z.string().min(1), y: z.string().min(1) }),\n alg: z.literal(ES256_JWS_ALGORITHM),\n scope: z.enum(CryptoKey_Scope),\n scopeId: z.string().min(1),\n iss: z.string().min(1),\n state: z.enum(CryptoKey_VersionState),\n compromiseInstant: z.string().optional(),\n});\n\n/** What the operator's door answers, and what the operator keeps: the export, and the stored record of its key. */\nexport const SigningLogExportFileSchema = z.strictObject({\n jws: z.string().min(1),\n key: VerificationKeyRecordSchema,\n});\nexport type SigningLogExportFile = z.infer<typeof SigningLogExportFileSchema>;\n\n/** Why an export does not verify. */\nexport enum SigningLogExportVerificationFailure {\n /** Not a compact JWS with a JSON header and payload. */\n MALFORMED = 'malformed',\n /** The header's `alg` is not ES256, or names a critical extension, or its `typ` is not the export's. */\n HEADER_INVALID = 'header_invalid',\n /** No given key has the header's `kid`. */\n UNKNOWN_KEY = 'unknown_key',\n /** A pin set was given and does not pin the key, or the key handed over is not the one its pinned `kid` names. */\n UNPINNED = 'unpinned',\n SIGNATURE_INVALID = 'signature_invalid',\n /** The payload is not the export's claims shape. */\n CLAIMS_INVALID = 'claims_invalid',\n /** The issuer is not the key's, or not the expected one; or the key is not the application's own export key. */\n ISSUER_MISMATCH = 'issuer_mismatch',\n /** An entry's hash is not the hash of its fields, a link does not chain, a sequence is skipped, or the head disagrees. */\n CHAIN_BROKEN = 'chain_broken',\n}\n\nexport interface SigningLogExportVerification {\n /** Signed by a (pinned) export key of the application, and the entries chain. */\n readonly valid: boolean;\n /**\n * The export is evidence: valid, and its key was not compromised before it signed. An export signed after its own key's\n * compromise instant proves nothing, whatever it says.\n */\n readonly provable: boolean;\n readonly failures: readonly SigningLogExportVerificationFailure[];\n readonly kid?: string;\n readonly keyState?: CryptoKey_VersionState;\n readonly claims?: SigningLogExportClaims;\n}\n\nexport interface SigningLogExportVerificationInput {\n readonly jws: string;\n /** The records of the keys that may have signed it (from an export file, from the application). */\n readonly keys: readonly ApprovalSealVerificationKey[];\n /** The operator's pin set for SIGNING_LOG_EXPORT, from a channel the host does not control. */\n readonly pins?: CryptoKeyPinSet;\n readonly expectedIssuer?: string;\n}\n\nfunction decodeJson(part: string | undefined): Record<string, unknown> | null {\n if (!part) return null;\n try {\n const value: unknown = JSON.parse(Buffer.from(part, 'base64url').toString('utf8'));\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? (value as Record<string, unknown>) : null;\n } catch {\n return null;\n }\n}\n\n/**\n * The key a verifier may use for a record, with the pin's word on what became of it (#2932): undefined (the caller's\n * `UNPINNED`) when a pin set is given and does not pin the key, or the record's public half is not the one the pinned\n * thumbprint names. Without a pin set the record is trusted as given.\n */\nexport function pinnedVerificationKeyOf(\n record: ApprovalSealVerificationKey,\n pins: CryptoKeyPinSet | undefined,\n): ApprovalSealVerificationKey | undefined {\n if (!pins) return record;\n const pin = pins.keys.find((candidate) => candidate.kid === record.kid);\n if (!pin || p256JwkThumbprint(record.publicJwk) !== pin.kid) return undefined;\n return {\n ...record,\n state: pin.state,\n scope: pin.scope,\n scopeId: pin.scopeId,\n ...(pin.compromiseInstant ? { compromiseInstant: pin.compromiseInstant } : { compromiseInstant: undefined }),\n };\n}\n\n/** Whether a key COMPROMISED at its compromise instant was so at `epochSeconds` (a compromised key with no instant: always). */\nexport function compromisedAt(key: ApprovalSealVerificationKey, epochSeconds: number): boolean {\n if (key.state !== CryptoKey_VersionState.COMPROMISED) return false;\n return key.compromiseInstant === undefined || epochSeconds * 1000 >= Date.parse(key.compromiseInstant);\n}\n\n/** The chain breaks inside an export, if any: each entry's hash, each link, each sequence, and the head. */\nfunction chainIsIntact(claims: SigningLogExportClaims): boolean {\n let previous: string | undefined = claims.afterSequence === 0 ? signingLogGenesisHash(claims.wildoApplicationId) : undefined;\n for (const [index, entry] of claims.entries.entries()) {\n if (entry.sequence !== claims.afterSequence + index + 1) return false;\n if (previous !== undefined && entry.previousEntryHash !== previous) return false;\n const { entryHash, ...fields } = entry;\n if (signingLogEntryHashOf({ ...fields, wildoApplicationId: claims.wildoApplicationId }) !== entryHash) return false;\n previous = entryHash;\n }\n const last = claims.entries.at(-1);\n const reached = last?.sequence ?? claims.afterSequence;\n if (claims.head.sequence < reached) return false;\n if (last && claims.head.sequence === last.sequence && claims.head.entryHash !== last.entryHash) return false;\n if (claims.head.sequence === 0 && claims.head.entryHash !== signingLogGenesisHash(claims.wildoApplicationId)) return false;\n return true;\n}\n\n/** Verify one export: the header, the (pinned) key, the signature, the claims, and that its entries chain. Pure, offline. */\nexport function verifySigningLogExport(input: SigningLogExportVerificationInput): SigningLogExportVerification {\n const fail = (failure: SigningLogExportVerificationFailure, extra: Partial<SigningLogExportVerification> = {}): SigningLogExportVerification =>\n ({ valid: false, provable: false, failures: [failure], ...extra });\n const parts = input.jws.split('.');\n const header = parts.length === 3 ? decodeJson(parts[0]) : null;\n const payload = parts.length === 3 ? decodeJson(parts[1]) : null;\n if (!header || !payload || !parts[2]) return fail(SigningLogExportVerificationFailure.MALFORMED);\n const kid = typeof header.kid === 'string' ? header.kid : undefined;\n const record = kid ? input.keys.find((candidate) => candidate.kid === kid) : undefined;\n if (!record || !isP256PublicJwk(record.publicJwk)) return fail(SigningLogExportVerificationFailure.UNKNOWN_KEY, kid ? { kid } : {});\n const key = pinnedVerificationKeyOf(record, input.pins);\n if (!key) return fail(SigningLogExportVerificationFailure.UNPINNED, { kid });\n // ES256 from the key record, never from the header; no extension is understood; the export's own type only.\n if (header.alg !== key.alg || key.alg !== ES256_JWS_ALGORITHM || header.crit !== undefined || header.typ !== SIGNING_LOG_EXPORT_TYP) {\n return fail(SigningLogExportVerificationFailure.HEADER_INVALID, { kid, keyState: key.state });\n }\n if (!verifyEs256(`${parts[0]}.${parts[1]}`, Buffer.from(parts[2], 'base64url'), key.publicJwk)) {\n return fail(SigningLogExportVerificationFailure.SIGNATURE_INVALID, { kid, keyState: key.state });\n }\n const parsed = SigningLogExportClaimsSchema.safeParse(payload);\n if (!parsed.success) return fail(SigningLogExportVerificationFailure.CLAIMS_INVALID, { kid, keyState: key.state });\n const claims = parsed.data;\n const ownKey = key.scope === CryptoKey_Scope.APPLICATION && key.scopeId === claims.wildoApplicationId;\n if (claims.iss !== key.iss || !ownKey || (input.expectedIssuer !== undefined && claims.iss !== input.expectedIssuer)) {\n return fail(SigningLogExportVerificationFailure.ISSUER_MISMATCH, { kid, keyState: key.state, claims });\n }\n if (!chainIsIntact(claims)) return fail(SigningLogExportVerificationFailure.CHAIN_BROKEN, { kid, keyState: key.state, claims });\n return { valid: true, provable: !compromisedAt(key, claims.iat), failures: [], kid, keyState: key.state, claims };\n}\n\n/** How exports of one log disagree. */\nexport enum SigningLogExportDisagreement {\n /** Two exports give one sequence different hashes: an entry at or before it was inserted, edited or removed. */\n CHAIN_DIVERGES = 'chain_diverges',\n /** A later export's head is behind an earlier one's: entries the operator already holds are gone from the log. */\n CHAIN_TRUNCATED = 'chain_truncated',\n /** The exports are not of one application's log. */\n DIFFERENT_LOGS = 'different_logs',\n}\n\nexport interface SigningLogExportComparison {\n /** Every export agrees with every other on every sequence they both know. */\n readonly consistent: boolean;\n readonly disagreements: ReadonlyArray<{ readonly disagreement: SigningLogExportDisagreement; readonly sequence?: number; readonly exports: readonly string[] }>;\n}\n\n/**\n * Compare verified exports of one log, kept ones and a new one alike. Each export states a hash for every sequence it\n * carries, for its head, and (through its first entry's link) for the sequence before its range; two exports that state\n * different hashes for one sequence disagree, and so does a later export whose head is behind an earlier one's. Exports\n * that do not verify, or prove nothing, are the caller's to leave out ({@link verifySigningLogExport}).\n */\nexport function compareSigningLogExports(exports: readonly SigningLogExportClaims[]): SigningLogExportComparison {\n const disagreements: Array<SigningLogExportComparison['disagreements'][number]> = [];\n if (new Set(exports.map((claims) => claims.wildoApplicationId)).size > 1) {\n return { consistent: false, disagreements: [{ disagreement: SigningLogExportDisagreement.DIFFERENT_LOGS, exports: exports.map((claims) => claims.jti) }] };\n }\n const stated = new Map<number, { readonly entryHash: string; readonly jti: string }>();\n const state = (sequence: number, entryHash: string, jti: string) => {\n const earlier = stated.get(sequence);\n if (!earlier) stated.set(sequence, { entryHash, jti });\n else if (earlier.entryHash !== entryHash) disagreements.push({ disagreement: SigningLogExportDisagreement.CHAIN_DIVERGES, sequence, exports: [earlier.jti, jti] });\n };\n for (const claims of exports) {\n for (const entry of claims.entries) state(entry.sequence, entry.entryHash, claims.jti);\n const first = claims.entries[0];\n if (first && claims.afterSequence > 0) state(claims.afterSequence, first.previousEntryHash, claims.jti);\n state(claims.head.sequence, claims.head.entryHash, claims.jti);\n }\n const byInstant = [...exports].sort((left, right) => left.iat - right.iat);\n for (const [index, later] of byInstant.entries()) {\n const ahead = byInstant.slice(0, index).find((earlier) => earlier.iat < later.iat && earlier.head.sequence > later.head.sequence);\n if (ahead) disagreements.push({ disagreement: SigningLogExportDisagreement.CHAIN_TRUNCATED, sequence: later.head.sequence, exports: [ahead.jti, later.jti] });\n }\n return { consistent: disagreements.length === 0, disagreements };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"signing-log-export.contracts.js","sourceRoot":"","sources":["../../../src/key-management/signing-log-export.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,sBAAsB,EAAE,eAAe,EAAwB,MAAM,uBAAuB,CAAC;AAC1I,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG9G,8BAA8B;AAC9B,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAE5F,8FAA8F;AAC9F,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,CAAC;AAEvD,4EAA4E;AAC5E,MAAM,UAAU,qBAAqB,CAAC,kBAA0B;IAC9D,OAAO,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAC/I,CAAC;AAmBD,sFAAsF;AACtF,MAAM,UAAU,qBAAqB,CAAC,MAA+B;IACnE,MAAM,OAAO,GAA4B;QACvC,kBAAk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QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClI,IAAI,KAAK;YAAE,aAAa,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,4BAA4B,CAAC,eAAe,EAAE,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChK,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;AACnE,CAAC","sourcesContent":["/**\n * # The signing log and its export (#2891, #2932)\n *\n * The custodian records every signature it makes in the application's SIGNING LOG, a hash chain: each entry carries the\n * previous entry's hash, and the first chains to the application's genesis anchor, so a removed or edited entry breaks\n * every hash after it. The log lives on the host. An EXPORT is what lets the operator hold it independently: a range of\n * entries and the chain's head at that moment, signed under its own purpose ({@link CryptoKey_Purpose.SIGNING_LOG_EXPORT},\n * `typ: signing-log+jws`), which the operator pulls into storage the host does not control.\n *\n * What a kept export proves, and only that:\n * - **an entry inserted into the log's past** (or an entry edited or removed) breaks the chain against it: a later\n * export disagrees with the kept one at some sequence, which {@link compareSigningLogExports} reports;\n * - **a seal it lists existed when it was signed**, so a seal under a key compromised after that instant is\n * corroborated (the approval-seal verifier reads the exports for this). Backdating after a compromise is therefore\n * bounded by the time since the operator's last export.\n *\n * What it does not prove: anything about entries appended after it, until the next export; and nothing at all for a\n * self-hosted operator, who is its own host and so signs its own exports.\n *\n * Everything here is pure and offline: an auditor checks exports with the operator's pin set and nothing else.\n */\nimport { createHash } from 'node:crypto';\nimport { z } from 'zod';\nimport { CryptoKey_Purpose, CryptoKey_Scope, CryptoKey_VersionState, singleJwsTypeOf, type CryptoKeyPinSet } from '@wildo-ai/saas-models';\nimport { canonicalizeJson } from '../canonical-json/rfc8785-canonical-json';\nimport { ES256_JWS_ALGORITHM, base64url, isP256PublicJwk, p256JwkThumbprint, verifyEs256 } from './es256-jws';\nimport type { ApprovalSealVerificationKey } from './approval-seal-verifier';\n\n/** The export's JWS `typ`. */\nexport const SIGNING_LOG_EXPORT_TYP = singleJwsTypeOf(CryptoKey_Purpose.SIGNING_LOG_EXPORT);\n\n/** The most entries one export carries; an operator pulls a longer log in several exports. */\nexport const SIGNING_LOG_EXPORT_MAXIMUM_ENTRIES = 1000;\n\n/** The anchor the first entry of an application's signing log chains to. */\nexport function signingLogGenesisHash(wildoApplicationId: string): string {\n return base64url(createHash('sha256').update(canonicalizeJson({ chain: 'wildo-signing-log-genesis', wildoApplicationId }), 'utf8').digest());\n}\n\n/** The fields of an entry its hash covers: everything but the hash itself. */\nexport interface SigningLogChainedFields {\n readonly wildoApplicationId: string;\n /** 1 for the application's first signature, +1 for each next one. */\n readonly sequence: number;\n readonly purpose: CryptoKey_Purpose;\n readonly iss: string;\n readonly jti: string;\n /** SHA-256 (base64url) over the RFC 8785 serialization of the signed claims. */\n readonly claimsDigest: string;\n readonly decisionPayloadDigest: string;\n readonly kid: string;\n readonly iat: number;\n readonly principal: string;\n readonly previousEntryHash: string;\n}\n\n/** An entry's hash: SHA-256 over the RFC 8785 serialization of its chained fields. */\nexport function signingLogEntryHashOf(fields: SigningLogChainedFields): string {\n const covered: SigningLogChainedFields = {\n wildoApplicationId: fields.wildoApplicationId,\n sequence: fields.sequence,\n purpose: fields.purpose,\n iss: fields.iss,\n jti: fields.jti,\n claimsDigest: fields.claimsDigest,\n decisionPayloadDigest: fields.decisionPayloadDigest,\n kid: fields.kid,\n iat: fields.iat,\n principal: fields.principal,\n previousEntryHash: fields.previousEntryHash,\n };\n return base64url(createHash('sha256').update(canonicalizeJson(covered), 'utf8').digest());\n}\n\n/** One entry, as an export carries it: its chained fields (the application id is the export's) and its hash. */\nexport const SigningLogExportEntrySchema = z.strictObject({\n sequence: z.number().int().min(1),\n purpose: z.enum(CryptoKey_Purpose),\n iss: z.string().min(1),\n jti: z.string().min(1),\n claimsDigest: z.string().min(1),\n decisionPayloadDigest: z.string().min(1),\n kid: z.string().min(1),\n iat: z.number().int(),\n principal: z.string().min(1),\n previousEntryHash: z.string().min(1),\n entryHash: z.string().min(1),\n});\nexport type SigningLogExportEntry = z.infer<typeof SigningLogExportEntrySchema>;\n\n/** The chain's head when the export was made: sequence 0 and the genesis anchor for an empty log. */\nexport const SigningLogHeadSchema = z.strictObject({ sequence: z.number().int().min(0), entryHash: z.string().min(1) });\nexport type SigningLogHead = z.infer<typeof SigningLogHeadSchema>;\n\n/**\n * The signed claims of an export. `iss` and `iat` are the custodian's, as on a seal; `jti` names the export, and is the\n * id of the log entry the export's own signature is recorded under, so the next export lists this one.\n */\nexport const SigningLogExportClaimsSchema = z.strictObject({\n iss: z.string().min(1),\n iat: z.number().int(),\n jti: z.string().min(1),\n wildoApplicationId: z.string().min(1),\n /** The entries are the ones after this sequence (0: from the first). */\n afterSequence: z.number().int().min(0),\n entries: z.array(SigningLogExportEntrySchema).max(SIGNING_LOG_EXPORT_MAXIMUM_ENTRIES),\n head: SigningLogHeadSchema,\n});\nexport type SigningLogExportClaims = z.infer<typeof SigningLogExportClaimsSchema>;\n\n/**\n * What the application backend asks the custodian for, on the operator's behalf: the entries after the operator's last\n * export (0 for the first), at most `limit` of them. The custodian builds and signs the export from its own log; nothing\n * in the request reaches the signed claims but the range.\n */\nexport const SigningLogExportRequestSchema = z.strictObject({\n afterSequence: z.number().int().min(0),\n limit: z.number().int().min(1).max(SIGNING_LOG_EXPORT_MAXIMUM_ENTRIES).optional(),\n});\nexport type SigningLogExportRequest = z.infer<typeof SigningLogExportRequestSchema>;\n\n/** The custodian's answer: the export, the key it was signed with, and where the operator's next pull starts. */\nexport interface SigningLogExportResponse {\n readonly jws: string;\n readonly kid: string;\n readonly iss: string;\n readonly iat: number;\n /** The chain's head when the export was made. */\n readonly headSequence: number;\n /** The last sequence the export carries: the `afterSequence` of the next pull. */\n readonly throughSequence: number;\n /** The sequence the export's own signature was recorded under, so the next export lists it. */\n readonly recordedAtSequence: number;\n}\n\n/**\n * A published verification key's stored record, as a bundle or an export file states it (dates as ISO strings): its public\n * half, the algorithm it pins, its scope and issuer, its state. A verifier given the operator's pin set takes only the\n * public half and the issuer from it.\n */\nexport const VerificationKeyRecordSchema = z.object({\n kid: z.string().min(1),\n publicJwk: z.object({ kty: z.literal('EC'), crv: z.literal('P-256'), x: z.string().min(1), y: z.string().min(1) }),\n alg: z.literal(ES256_JWS_ALGORITHM),\n scope: z.enum(CryptoKey_Scope),\n scopeId: z.string().min(1),\n iss: z.string().min(1),\n state: z.enum(CryptoKey_VersionState),\n compromiseInstant: z.string().optional(),\n});\n\n/** What the operator's door answers, and what the operator keeps: the export, and the stored record of its key. */\nexport const SigningLogExportFileSchema = z.strictObject({\n jws: z.string().min(1),\n key: VerificationKeyRecordSchema,\n});\nexport type SigningLogExportFile = z.infer<typeof SigningLogExportFileSchema>;\n\n/** Why an export does not verify. */\nexport enum SigningLogExportVerificationFailure {\n /** Not a compact JWS with a JSON header and payload. */\n MALFORMED = 'malformed',\n /** The header's `alg` is not ES256, or names a critical extension, or its `typ` is not the export's. */\n HEADER_INVALID = 'header_invalid',\n /** No given key has the header's `kid`. */\n UNKNOWN_KEY = 'unknown_key',\n /** A pin set was given and does not pin the key, or the key handed over is not the one its pinned `kid` names. */\n UNPINNED = 'unpinned',\n SIGNATURE_INVALID = 'signature_invalid',\n /** The payload is not the export's claims shape. */\n CLAIMS_INVALID = 'claims_invalid',\n /** The issuer is not the key's, or not the expected one; or the key is not the application's own export key. */\n ISSUER_MISMATCH = 'issuer_mismatch',\n /** An entry's hash is not the hash of its fields, a link does not chain, a sequence is skipped, or the head disagrees. */\n CHAIN_BROKEN = 'chain_broken',\n}\n\nexport interface SigningLogExportVerification {\n /** Signed by a (pinned) export key of the application, and the entries chain. */\n readonly valid: boolean;\n /**\n * The export is evidence: valid, and its key was not compromised before it signed. An export signed after its own key's\n * compromise instant proves nothing, whatever it says.\n */\n readonly provable: boolean;\n readonly failures: readonly SigningLogExportVerificationFailure[];\n readonly kid?: string;\n readonly keyState?: CryptoKey_VersionState;\n readonly claims?: SigningLogExportClaims;\n}\n\nexport interface SigningLogExportVerificationInput {\n readonly jws: string;\n /** The records of the keys that may have signed it (from an export file, from the application). */\n readonly keys: readonly ApprovalSealVerificationKey[];\n /** The operator's pin set for SIGNING_LOG_EXPORT, from a channel the host does not control. */\n readonly pins?: CryptoKeyPinSet;\n readonly expectedIssuer?: string;\n}\n\nfunction decodeJson(part: string | undefined): Record<string, unknown> | null {\n if (!part) return null;\n try {\n const value: unknown = JSON.parse(Buffer.from(part, 'base64url').toString('utf8'));\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? (value as Record<string, unknown>) : null;\n } catch {\n return null;\n }\n}\n\n/**\n * The key a verifier may use for a record, with the pin's word on what became of it (#2932): undefined (the caller's\n * `UNPINNED`) when a pin set is given and does not pin the key, or the record's public half is not the one the pinned\n * thumbprint names. Without a pin set the record is trusted as given.\n */\nexport function pinnedVerificationKeyOf(\n record: ApprovalSealVerificationKey,\n pins: CryptoKeyPinSet | undefined,\n): ApprovalSealVerificationKey | undefined {\n if (!pins) return record;\n const pin = pins.keys.find((candidate) => candidate.kid === record.kid);\n if (!pin || p256JwkThumbprint(record.publicJwk) !== pin.kid) return undefined;\n return {\n ...record,\n state: pin.state,\n scope: pin.scope,\n scopeId: pin.scopeId,\n ...(pin.compromiseInstant ? { compromiseInstant: pin.compromiseInstant } : { compromiseInstant: undefined }),\n };\n}\n\n/** Whether a key COMPROMISED at its compromise instant was so at `epochSeconds` (a compromised key with no instant: always). */\nexport function compromisedAt(key: ApprovalSealVerificationKey, epochSeconds: number): boolean {\n if (key.state !== CryptoKey_VersionState.COMPROMISED) return false;\n return key.compromiseInstant === undefined || epochSeconds * 1000 >= Date.parse(key.compromiseInstant);\n}\n\n/** The chain breaks inside an export, if any: each entry's hash, each link, each sequence, and the head. */\nfunction chainIsIntact(claims: SigningLogExportClaims): boolean {\n let previous: string | undefined = claims.afterSequence === 0 ? signingLogGenesisHash(claims.wildoApplicationId) : undefined;\n for (const [index, entry] of claims.entries.entries()) {\n if (entry.sequence !== claims.afterSequence + index + 1) return false;\n if (previous !== undefined && entry.previousEntryHash !== previous) return false;\n const { entryHash, ...fields } = entry;\n if (signingLogEntryHashOf({ ...fields, wildoApplicationId: claims.wildoApplicationId }) !== entryHash) return false;\n previous = entryHash;\n }\n const last = claims.entries.at(-1);\n const reached = last?.sequence ?? claims.afterSequence;\n if (claims.head.sequence < reached) return false;\n if (last && claims.head.sequence === last.sequence && claims.head.entryHash !== last.entryHash) return false;\n if (claims.head.sequence === 0 && claims.head.entryHash !== signingLogGenesisHash(claims.wildoApplicationId)) return false;\n return true;\n}\n\n/** Verify one export: the header, the (pinned) key, the signature, the claims, and that its entries chain. Pure, offline. */\nexport function verifySigningLogExport(input: SigningLogExportVerificationInput): SigningLogExportVerification {\n const fail = (failure: SigningLogExportVerificationFailure, extra: Partial<SigningLogExportVerification> = {}): SigningLogExportVerification =>\n ({ valid: false, provable: false, failures: [failure], ...extra });\n const parts = input.jws.split('.');\n const header = parts.length === 3 ? decodeJson(parts[0]) : null;\n const payload = parts.length === 3 ? decodeJson(parts[1]) : null;\n if (!header || !payload || !parts[2]) return fail(SigningLogExportVerificationFailure.MALFORMED);\n const kid = typeof header.kid === 'string' ? header.kid : undefined;\n const record = kid ? input.keys.find((candidate) => candidate.kid === kid) : undefined;\n if (!record || !isP256PublicJwk(record.publicJwk)) return fail(SigningLogExportVerificationFailure.UNKNOWN_KEY, kid ? { kid } : {});\n const key = pinnedVerificationKeyOf(record, input.pins);\n if (!key) return fail(SigningLogExportVerificationFailure.UNPINNED, { kid });\n // ES256 from the key record, never from the header; no extension is understood; the export's own type only.\n if (header.alg !== key.alg || key.alg !== ES256_JWS_ALGORITHM || header.crit !== undefined || header.typ !== SIGNING_LOG_EXPORT_TYP) {\n return fail(SigningLogExportVerificationFailure.HEADER_INVALID, { kid, keyState: key.state });\n }\n if (!verifyEs256(`${parts[0]}.${parts[1]}`, Buffer.from(parts[2], 'base64url'), key.publicJwk)) {\n return fail(SigningLogExportVerificationFailure.SIGNATURE_INVALID, { kid, keyState: key.state });\n }\n const parsed = SigningLogExportClaimsSchema.safeParse(payload);\n if (!parsed.success) return fail(SigningLogExportVerificationFailure.CLAIMS_INVALID, { kid, keyState: key.state });\n const claims = parsed.data;\n const ownKey = key.scope === CryptoKey_Scope.APPLICATION && key.scopeId === claims.wildoApplicationId;\n if (claims.iss !== key.iss || !ownKey || (input.expectedIssuer !== undefined && claims.iss !== input.expectedIssuer)) {\n return fail(SigningLogExportVerificationFailure.ISSUER_MISMATCH, { kid, keyState: key.state, claims });\n }\n if (!chainIsIntact(claims)) return fail(SigningLogExportVerificationFailure.CHAIN_BROKEN, { kid, keyState: key.state, claims });\n return { valid: true, provable: !compromisedAt(key, claims.iat), failures: [], kid, keyState: key.state, claims };\n}\n\n/** How exports of one log disagree. */\nexport enum SigningLogExportDisagreement {\n /** Two exports give one sequence different hashes: an entry at or before it was inserted, edited or removed. */\n CHAIN_DIVERGES = 'chain_diverges',\n /** A later export's head is behind an earlier one's: entries the operator already holds are gone from the log. */\n CHAIN_TRUNCATED = 'chain_truncated',\n /** The exports are not of one application's log. */\n DIFFERENT_LOGS = 'different_logs',\n}\n\nexport interface SigningLogExportComparison {\n /** Every export agrees with every other on every sequence they both know. */\n readonly consistent: boolean;\n readonly disagreements: ReadonlyArray<{ readonly disagreement: SigningLogExportDisagreement; readonly sequence?: number; readonly exports: readonly string[] }>;\n}\n\n/**\n * Compare verified exports of one log, kept ones and a new one alike. Each export states a hash for every sequence it\n * carries, for its head, and (through its first entry's link) for the sequence before its range; two exports that state\n * different hashes for one sequence disagree, and so does a later export whose head is behind an earlier one's. Exports\n * that do not verify, or prove nothing, are the caller's to leave out ({@link verifySigningLogExport}).\n */\nexport function compareSigningLogExports(exports: readonly SigningLogExportClaims[]): SigningLogExportComparison {\n const disagreements: Array<SigningLogExportComparison['disagreements'][number]> = [];\n if (new Set(exports.map((claims) => claims.wildoApplicationId)).size > 1) {\n return { consistent: false, disagreements: [{ disagreement: SigningLogExportDisagreement.DIFFERENT_LOGS, exports: exports.map((claims) => claims.jti) }] };\n }\n const stated = new Map<number, { readonly entryHash: string; readonly jti: string }>();\n const state = (sequence: number, entryHash: string, jti: string) => {\n const earlier = stated.get(sequence);\n if (!earlier) stated.set(sequence, { entryHash, jti });\n else if (earlier.entryHash !== entryHash) disagreements.push({ disagreement: SigningLogExportDisagreement.CHAIN_DIVERGES, sequence, exports: [earlier.jti, jti] });\n };\n for (const claims of exports) {\n for (const entry of claims.entries) state(entry.sequence, entry.entryHash, claims.jti);\n const first = claims.entries[0];\n if (first && claims.afterSequence > 0) state(claims.afterSequence, first.previousEntryHash, claims.jti);\n state(claims.head.sequence, claims.head.entryHash, claims.jti);\n }\n const byInstant = [...exports].sort((left, right) => left.iat - right.iat);\n for (const [index, later] of byInstant.entries()) {\n const ahead = byInstant.slice(0, index).find((earlier) => earlier.iat < later.iat && earlier.head.sequence > later.head.sequence);\n if (ahead) disagreements.push({ disagreement: SigningLogExportDisagreement.CHAIN_TRUNCATED, sequence: later.head.sequence, exports: [ahead.jti, later.jti] });\n }\n return { consistent: disagreements.length === 0, disagreements };\n}\n"]}
|
|
@@ -52,4 +52,47 @@ export declare function vaultOperatorPolicy(layout?: VaultCustodyLayout): string
|
|
|
52
52
|
* platform runs.
|
|
53
53
|
*/
|
|
54
54
|
export declare const VAULT_TOKEN_PERIOD = "768h";
|
|
55
|
+
/**
|
|
56
|
+
* # The break-glass RECOVERY token of the self-hosted OpenBao (#3006)
|
|
57
|
+
*
|
|
58
|
+
* A self-initialized OpenBao revokes its root token when initialization ends, and a static-seal server has no recovery
|
|
59
|
+
* keys, so without a third credential nothing could ever replace a leaked signer or operator token, or move the server
|
|
60
|
+
* onto a new unseal key, short of wiping its storage and every key in it. The recovery token is that credential, and its
|
|
61
|
+
* policy is the whole of what it may do:
|
|
62
|
+
*
|
|
63
|
+
* - `auth/token/lookup-self`: the CLI proves the token is live before it acts, and a server initialized before #3006
|
|
64
|
+
* (which holds no such token) answers "bad token" here rather than half-way through a rotation;
|
|
65
|
+
* - `auth/token/lookup` and `auth/token/revoke-accessor`: read the accessor of the token being replaced, then revoke it
|
|
66
|
+
* by that accessor. Lookup returns metadata, never a secret;
|
|
67
|
+
* - `auth/token/create-orphan` with `sudo` (a custom `id` needs it): only under exactly ONE of the three platform
|
|
68
|
+
* policies, only with no default policy, and only with the period or TTL the platform's own tokens carry. Every other
|
|
69
|
+
* parameter is refused (`allowed_parameters`), and `required_parameters` refuses a request that omits the id, the
|
|
70
|
+
* policy or `no_default_policy` (an omitted parameter is not checked by `allowed_parameters`; measured on OpenBao 2.7.1,
|
|
71
|
+
* a create without `no_default_policy` was admitted and attached `default`);
|
|
72
|
+
* - `sys/rotate/root` with `sudo`: re-wraps the server's root key under the seal's CURRENT key, which is the step that
|
|
73
|
+
* moves a static-seal server onto a new unseal key (measured on 2.7.1: started with the new key current and the old
|
|
74
|
+
* one previous, a rotation, and the new key alone unseals while the old one is refused).
|
|
75
|
+
*
|
|
76
|
+
* It can neither sign, wrap, read key material, change a mount nor write a policy, so a leaked recovery token can mint a
|
|
77
|
+
* signer and sign, which is the power any signer token has, but cannot make a key leave the server. It is held in
|
|
78
|
+
* `secrets.json` (and the CI secret store a pipeline renders the server from); no runtime's environment carries it,
|
|
79
|
+
* apps-manager's included (the env builder forbids it), and only the server's own container receives it, read at its
|
|
80
|
+
* first start alone.
|
|
81
|
+
*
|
|
82
|
+
* spec-cite: OpenBao/Vault "Policies" (`allowed_parameters`, `required_parameters`, `sudo`)
|
|
83
|
+
* https://openbao.org/docs/concepts/policies/; token API (`create-orphan`, `lookup`, `revoke-accessor`)
|
|
84
|
+
* https://openbao.org/api-docs/auth/token/; `sys/rotate/root` https://openbao.org/api-docs/system/rotate-root/.
|
|
85
|
+
*/
|
|
86
|
+
export declare const VAULT_RECOVERY_POLICY_NAME = "wildo-key-recovery";
|
|
87
|
+
/**
|
|
88
|
+
* How long the recovery token lives: one hundred years, i.e. it does not expire. It is offline (nobody renews it), so a
|
|
89
|
+
* periodic token would be dead after one period. The token mount's maximum lease TTL is raised to the same value at the
|
|
90
|
+
* first start: created by the root token with no TTL, it got the mount default, 768h (measured on OpenBao 2.7.1), and would
|
|
91
|
+
* have expired after 32 days.
|
|
92
|
+
*/
|
|
93
|
+
export declare const VAULT_RECOVERY_TOKEN_TTL = "876000h";
|
|
94
|
+
/** The platform policies a recovery token may mint a token under, one per token. */
|
|
95
|
+
export declare const VAULT_RECOVERY_MINTABLE_POLICY_NAMES: readonly ["wildo-key-signer", "wildo-key-operator", "wildo-key-recovery"];
|
|
96
|
+
/** The RECOVERY token's policy, as Vault HCL. Depends on no layout: it touches no mount but `auth/token` and `sys`. */
|
|
97
|
+
export declare function vaultRecoveryPolicy(): string;
|
|
55
98
|
//# sourceMappingURL=vault-custody.contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vault-custody.contracts.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"vault-custody.contracts.d.ts","sourceRoot":"","sources":["../../../src/key-management/vault-custody.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6IAA6I;AAC7I,mEAAmE;AACnE,eAAO,MAAM,2BAA2B,YAAY,CAAC;AACrD,sGAAsG;AACtG,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAC/C,gGAAgG;AAChG,eAAO,MAAM,6BAA6B,WAAW,CAAC;AAEtD,oDAAoD;AACpD,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAC3D,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D,mDAAmD;AACnD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,6CAA6C;AAC7C,wBAAgB,oBAAoB,CAAC,MAAM,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAAG,kBAAkB,CAMjG;AAID,+CAA+C;AAC/C,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,kBAA2C,GAAG,MAAM,CAc7F;AAED,iDAAiD;AACjD,wBAAgB,mBAAmB,CAAC,MAAM,GAAE,kBAA2C,GAAG,MAAM,CAkB/F;AAED,mEAAmE;AAEnE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,SAAS,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAElD,oFAAoF;AACpF,eAAO,MAAM,oCAAoC,2EAA8F,CAAC;AAEhJ,uHAAuH;AACvH,wBAAgB,mBAAmB,IAAI,MAAM,CAuB5C"}
|
|
@@ -85,4 +85,70 @@ export function vaultOperatorPolicy(layout = vaultCustodyLayoutOf()) {
|
|
|
85
85
|
* platform runs.
|
|
86
86
|
*/
|
|
87
87
|
export const VAULT_TOKEN_PERIOD = '768h';
|
|
88
|
+
/**
|
|
89
|
+
* # The break-glass RECOVERY token of the self-hosted OpenBao (#3006)
|
|
90
|
+
*
|
|
91
|
+
* A self-initialized OpenBao revokes its root token when initialization ends, and a static-seal server has no recovery
|
|
92
|
+
* keys, so without a third credential nothing could ever replace a leaked signer or operator token, or move the server
|
|
93
|
+
* onto a new unseal key, short of wiping its storage and every key in it. The recovery token is that credential, and its
|
|
94
|
+
* policy is the whole of what it may do:
|
|
95
|
+
*
|
|
96
|
+
* - `auth/token/lookup-self`: the CLI proves the token is live before it acts, and a server initialized before #3006
|
|
97
|
+
* (which holds no such token) answers "bad token" here rather than half-way through a rotation;
|
|
98
|
+
* - `auth/token/lookup` and `auth/token/revoke-accessor`: read the accessor of the token being replaced, then revoke it
|
|
99
|
+
* by that accessor. Lookup returns metadata, never a secret;
|
|
100
|
+
* - `auth/token/create-orphan` with `sudo` (a custom `id` needs it): only under exactly ONE of the three platform
|
|
101
|
+
* policies, only with no default policy, and only with the period or TTL the platform's own tokens carry. Every other
|
|
102
|
+
* parameter is refused (`allowed_parameters`), and `required_parameters` refuses a request that omits the id, the
|
|
103
|
+
* policy or `no_default_policy` (an omitted parameter is not checked by `allowed_parameters`; measured on OpenBao 2.7.1,
|
|
104
|
+
* a create without `no_default_policy` was admitted and attached `default`);
|
|
105
|
+
* - `sys/rotate/root` with `sudo`: re-wraps the server's root key under the seal's CURRENT key, which is the step that
|
|
106
|
+
* moves a static-seal server onto a new unseal key (measured on 2.7.1: started with the new key current and the old
|
|
107
|
+
* one previous, a rotation, and the new key alone unseals while the old one is refused).
|
|
108
|
+
*
|
|
109
|
+
* It can neither sign, wrap, read key material, change a mount nor write a policy, so a leaked recovery token can mint a
|
|
110
|
+
* signer and sign, which is the power any signer token has, but cannot make a key leave the server. It is held in
|
|
111
|
+
* `secrets.json` (and the CI secret store a pipeline renders the server from); no runtime's environment carries it,
|
|
112
|
+
* apps-manager's included (the env builder forbids it), and only the server's own container receives it, read at its
|
|
113
|
+
* first start alone.
|
|
114
|
+
*
|
|
115
|
+
* spec-cite: OpenBao/Vault "Policies" (`allowed_parameters`, `required_parameters`, `sudo`)
|
|
116
|
+
* https://openbao.org/docs/concepts/policies/; token API (`create-orphan`, `lookup`, `revoke-accessor`)
|
|
117
|
+
* https://openbao.org/api-docs/auth/token/; `sys/rotate/root` https://openbao.org/api-docs/system/rotate-root/.
|
|
118
|
+
*/
|
|
119
|
+
export const VAULT_RECOVERY_POLICY_NAME = 'wildo-key-recovery';
|
|
120
|
+
/**
|
|
121
|
+
* How long the recovery token lives: one hundred years, i.e. it does not expire. It is offline (nobody renews it), so a
|
|
122
|
+
* periodic token would be dead after one period. The token mount's maximum lease TTL is raised to the same value at the
|
|
123
|
+
* first start: created by the root token with no TTL, it got the mount default, 768h (measured on OpenBao 2.7.1), and would
|
|
124
|
+
* have expired after 32 days.
|
|
125
|
+
*/
|
|
126
|
+
export const VAULT_RECOVERY_TOKEN_TTL = '876000h';
|
|
127
|
+
/** The platform policies a recovery token may mint a token under, one per token. */
|
|
128
|
+
export const VAULT_RECOVERY_MINTABLE_POLICY_NAMES = [VAULT_SIGNER_POLICY_NAME, VAULT_OPERATOR_POLICY_NAME, VAULT_RECOVERY_POLICY_NAME];
|
|
129
|
+
/** The RECOVERY token's policy, as Vault HCL. Depends on no layout: it touches no mount but `auth/token` and `sys`. */
|
|
130
|
+
export function vaultRecoveryPolicy() {
|
|
131
|
+
const policies = VAULT_RECOVERY_MINTABLE_POLICY_NAMES.map((name) => `["${name}"]`).join(', ');
|
|
132
|
+
return [
|
|
133
|
+
'path "auth/token/lookup-self" { capabilities = ["read"] }',
|
|
134
|
+
'path "auth/token/lookup" { capabilities = ["update"] }',
|
|
135
|
+
'path "auth/token/revoke-accessor" { capabilities = ["update"] }',
|
|
136
|
+
[
|
|
137
|
+
'path "auth/token/create-orphan" {',
|
|
138
|
+
' capabilities = ["update", "sudo"]',
|
|
139
|
+
' required_parameters = ["id", "policies", "no_default_policy"]',
|
|
140
|
+
' allowed_parameters = {',
|
|
141
|
+
' "id" = []',
|
|
142
|
+
` "policies" = [${policies}]`,
|
|
143
|
+
' "no_default_policy" = [true]',
|
|
144
|
+
` "period" = ["${VAULT_TOKEN_PERIOD}"]`,
|
|
145
|
+
` "ttl" = ["${VAULT_RECOVERY_TOKEN_TTL}"]`,
|
|
146
|
+
' "display_name" = []',
|
|
147
|
+
' "meta" = []',
|
|
148
|
+
' }',
|
|
149
|
+
'}',
|
|
150
|
+
].join('\n'),
|
|
151
|
+
'path "sys/rotate/root" { capabilities = ["update", "sudo"] }',
|
|
152
|
+
].join('\n');
|
|
153
|
+
}
|
|
88
154
|
//# sourceMappingURL=vault-custody.contracts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vault-custody.contracts.js","sourceRoot":"","sources":["../../../../src/key-management/vault-custody.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6IAA6I;AAC7I,mEAAmE;AACnE,MAAM,CAAC,MAAM,2BAA2B,GAAG,SAAS,CAAC;AACrD,sGAAsG;AACtG,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC;AAC/C,gGAAgG;AAChG,MAAM,CAAC,MAAM,6BAA6B,GAAG,QAAQ,CAAC;AAEtD,oDAAoD;AACpD,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAC3D,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAC;AAS/D,6CAA6C;AAC7C,MAAM,UAAU,oBAAoB,CAAC,SAAsC,EAAE;IAC3E,OAAO;QACL,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,2BAA2B;QAChE,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,sBAAsB;QACjD,aAAa,EAAE,MAAM,CAAC,aAAa,IAAI,6BAA6B;KACrE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,GAAG,4DAA4D,CAAC;AAEhF,+CAA+C;AAC/C,MAAM,UAAU,iBAAiB,CAAC,SAA6B,oBAAoB,EAAE;IACnF,MAAM,EAAE,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC;IAClE,OAAO;QACL,SAAS,CAAC,SAAS,CAAC,kCAAkC;QACtD,SAAS,CAAC,YAAY,CAAC,kCAAkC;QACzD,SAAS,CAAC,YAAY,CAAC,kCAAkC;QACzD,SAAS,CAAC,SAAS,CAAC,gCAAgC;QACpD,SAAS,EAAE,SAAS,CAAC,gCAAgC;QACrD,SAAS,EAAE,aAAa,CAAC,gCAAgC;QACzD,SAAS,CAAC,6CAA6C;QACvD,SAAS,CAAC,wCAAwC;QAClD,SAAS,CAAC,wCAAwC;QAClD,UAAU;KACX,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,mBAAmB,CAAC,SAA6B,oBAAoB,EAAE;IACrF,MAAM,EAAE,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC;IAClE,OAAO;QACL,6GAA6G;QAC7G,8GAA8G;QAC9G,iCAAiC;QACjC,SAAS,CAAC,SAAS,CAAC,sIAAsI;QAC1J,SAAS,EAAE,SAAS,CAAC,4CAA4C;QACjE,SAAS,EAAE,WAAW,CAAC,kCAAkC;QACzD,SAAS,EAAE,YAAY,CAAC,kCAAkC;QAC1D,SAAS,EAAE,aAAa,CAAC,kCAAkC;QAC3D,SAAS,CAAC,sCAAsC;QAChD,SAAS,CAAC,yCAAyC;QACnD,SAAS,CAAC,yCAAyC;QACnD,SAAS,CAAC,wCAAwC;QAClD,SAAS,CAAC,wCAAwC;QAClD,UAAU;KACX,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,mEAAmE;AAEnE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC","sourcesContent":["/**\n * # The platform's Vault custody contract (#2933)\n *\n * apps-manager signs through HashiCorp Vault (or OpenBao) with TWO tokens, and least privilege is a property of the\n * policy each token holds. Those policies are stated here once, because three places need the same text: the\n * self-hosted OpenBao the CLI renders (it writes them at its first start), the real-container test suite, and the\n * runbook an operator follows to configure their own Vault. A copy in each would drift, and a drift here is either a\n * provider that cannot do its job or a token that can do more than its job.\n *\n * - The SIGNER token signs, wraps and reads: `transit/sign/<k>`, `transit/encrypt/<k>` and `transit/decrypt/<k>` (data\n * keys wrapped and unwrapped under a wrapping key, #2894), read on `transit/keys/<k>` (the public key and the\n * attributes the attestation is computed from), and read on a KV key. It can never change a key's configuration, so it can never\n * make a key exportable; Vault's deny-by-default already refuses that, and the explicit `deny` lines keep it refused\n * if a broader grant is ever added beside these.\n * - The OPERATOR token performs lifecycle acts (create, rotate, configure, delete; KV write, delete, destroy) and can\n * neither sign, wrap, unwrap nor read key material, nor send `exportable` / `allow_plaintext_backup` (`denied_parameters`), so it\n * cannot make a Transit key leave Vault either.\n * - Both may renew THEMSELVES (`auth/token/renew-self`), because a periodic token that is not renewed expires; nothing\n * else under `auth/` is granted.\n *\n * spec-cite: Vault \"Policies\" (path globs, `deny` precedence) https://developer.hashicorp.com/vault/docs/concepts/policies;\n * Transit API https://developer.hashicorp.com/vault/api-docs/secret/transit; KV v2 API\n * https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2; token renew-self\n * https://developer.hashicorp.com/vault/api-docs/auth/token#renew-a-token-self.\n */\n\n/** @wildo_source:part:start platform.key-management.vault-custody facet:layer:platform facet:family:security facet:audience:app-developer */\n/** The Transit mount the providers use when none is configured. */\nexport const VAULT_DEFAULT_TRANSIT_MOUNT = 'transit';\n/** The KV v2 mount the providers use when none is configured (where a Vault dev server mounts it). */\nexport const VAULT_DEFAULT_KV_MOUNT = 'secret';\n/** The prefix of every key name the providers create; the policies grant nothing outside it. */\nexport const VAULT_DEFAULT_KEY_NAME_PREFIX = 'wildo-';\n\n/** The names the two policies are written under. */\nexport const VAULT_SIGNER_POLICY_NAME = 'wildo-key-signer';\nexport const VAULT_OPERATOR_POLICY_NAME = 'wildo-key-operator';\n\n/** Where the providers' keys live in one Vault. */\nexport interface VaultCustodyLayout {\n readonly transitMount: string;\n readonly kvMount: string;\n readonly keyNamePrefix: string;\n}\n\n/** The layout with every default applied. */\nexport function vaultCustodyLayoutOf(layout: Partial<VaultCustodyLayout> = {}): VaultCustodyLayout {\n return {\n transitMount: layout.transitMount || VAULT_DEFAULT_TRANSIT_MOUNT,\n kvMount: layout.kvMount || VAULT_DEFAULT_KV_MOUNT,\n keyNamePrefix: layout.keyNamePrefix || VAULT_DEFAULT_KEY_NAME_PREFIX,\n };\n}\n\nconst RENEW_SELF = 'path \"auth/token/renew-self\" { capabilities = [\"update\"] }';\n\n/** The SIGNER token's policy, as Vault HCL. */\nexport function vaultSignerPolicy(layout: VaultCustodyLayout = vaultCustodyLayoutOf()): string {\n const { transitMount: t, kvMount: kv, keyNamePrefix: p } = layout;\n return [\n `path \"${t}/sign/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${t}/encrypt/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${t}/decrypt/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${t}/keys/${p}*\" { capabilities = [\"read\"] }`,\n `path \"${kv}/data/${p}*\" { capabilities = [\"read\"] }`,\n `path \"${kv}/metadata/${p}*\" { capabilities = [\"read\"] }`,\n `path \"${t}/keys/+/config\" { capabilities = [\"deny\"] }`,\n `path \"${t}/export/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/backup/*\" { capabilities = [\"deny\"] }`,\n RENEW_SELF,\n ].join('\\n');\n}\n\n/** The OPERATOR token's policy, as Vault HCL. */\nexport function vaultOperatorPolicy(layout: VaultCustodyLayout = vaultCustodyLayoutOf()): string {\n const { transitMount: t, kvMount: kv, keyNamePrefix: p } = layout;\n return [\n // `exportable` and `allow_plaintext_backup` are one-way and turn a key into one that can leave Vault, so the\n // operator may not send them at all, at creation or on `/config`: Vault refuses any request carrying a denied\n // parameter, whatever its value.\n `path \"${t}/keys/${p}*\" { capabilities = [\"create\", \"update\", \"read\", \"delete\"] denied_parameters = { \"exportable\" = [] \"allow_plaintext_backup\" = [] } }`,\n `path \"${kv}/data/${p}*\" { capabilities = [\"create\", \"update\"] }`,\n `path \"${kv}/delete/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${kv}/destroy/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${kv}/metadata/${p}*\" { capabilities = [\"delete\"] }`,\n `path \"${t}/sign/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/encrypt/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/decrypt/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/export/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/backup/*\" { capabilities = [\"deny\"] }`,\n RENEW_SELF,\n ].join('\\n');\n}\n\n/** @wildo_source:part:end platform.key-management.vault-custody */\n\n/**\n * How long a token issued for the platform lives between renewals. apps-manager renews each token at half its lease\n * (`VaultTokenRenewal`), so the period bounds how long a token that stops being renewed stays usable, not how long the\n * platform runs.\n */\nexport const VAULT_TOKEN_PERIOD = '768h';\n"]}
|
|
1
|
+
{"version":3,"file":"vault-custody.contracts.js","sourceRoot":"","sources":["../../../src/key-management/vault-custody.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6IAA6I;AAC7I,mEAAmE;AACnE,MAAM,CAAC,MAAM,2BAA2B,GAAG,SAAS,CAAC;AACrD,sGAAsG;AACtG,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC;AAC/C,gGAAgG;AAChG,MAAM,CAAC,MAAM,6BAA6B,GAAG,QAAQ,CAAC;AAEtD,oDAAoD;AACpD,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAC3D,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAC;AAS/D,6CAA6C;AAC7C,MAAM,UAAU,oBAAoB,CAAC,SAAsC,EAAE;IAC3E,OAAO;QACL,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,2BAA2B;QAChE,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,sBAAsB;QACjD,aAAa,EAAE,MAAM,CAAC,aAAa,IAAI,6BAA6B;KACrE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,GAAG,4DAA4D,CAAC;AAEhF,+CAA+C;AAC/C,MAAM,UAAU,iBAAiB,CAAC,SAA6B,oBAAoB,EAAE;IACnF,MAAM,EAAE,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE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;AAE/D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAElD,oFAAoF;AACpF,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,wBAAwB,EAAE,0BAA0B,EAAE,0BAA0B,CAAU,CAAC;AAEhJ,uHAAuH;AACvH,MAAM,UAAU,mBAAmB;IACjC,MAAM,QAAQ,GAAG,oCAAoC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9F,OAAO;QACL,2DAA2D;QAC3D,wDAAwD;QACxD,iEAAiE;QACjE;YACE,mCAAmC;YACnC,qCAAqC;YACrC,iEAAiE;YACjE,0BAA0B;YAC1B,eAAe;YACf,qBAAqB,QAAQ,GAAG;YAChC,kCAAkC;YAClC,oBAAoB,kBAAkB,IAAI;YAC1C,iBAAiB,wBAAwB,IAAI;YAC7C,yBAAyB;YACzB,iBAAiB;YACjB,KAAK;YACL,GAAG;SACJ,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,8DAA8D;KAC/D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC","sourcesContent":["/**\n * # The platform's Vault custody contract (#2933)\n *\n * apps-manager signs through HashiCorp Vault (or OpenBao) with TWO tokens, and least privilege is a property of the\n * policy each token holds. Those policies are stated here once, because three places need the same text: the\n * self-hosted OpenBao the CLI renders (it writes them at its first start), the real-container test suite, and the\n * runbook an operator follows to configure their own Vault. A copy in each would drift, and a drift here is either a\n * provider that cannot do its job or a token that can do more than its job.\n *\n * - The SIGNER token signs, wraps and reads: `transit/sign/<k>`, `transit/encrypt/<k>` and `transit/decrypt/<k>` (data\n * keys wrapped and unwrapped under a wrapping key, #2894), read on `transit/keys/<k>` (the public key and the\n * attributes the attestation is computed from), and read on a KV key. It can never change a key's configuration, so it can never\n * make a key exportable; Vault's deny-by-default already refuses that, and the explicit `deny` lines keep it refused\n * if a broader grant is ever added beside these.\n * - The OPERATOR token performs lifecycle acts (create, rotate, configure, delete; KV write, delete, destroy) and can\n * neither sign, wrap, unwrap nor read key material, nor send `exportable` / `allow_plaintext_backup` (`denied_parameters`), so it\n * cannot make a Transit key leave Vault either.\n * - Both may renew THEMSELVES (`auth/token/renew-self`), because a periodic token that is not renewed expires; nothing\n * else under `auth/` is granted.\n *\n * spec-cite: Vault \"Policies\" (path globs, `deny` precedence) https://developer.hashicorp.com/vault/docs/concepts/policies;\n * Transit API https://developer.hashicorp.com/vault/api-docs/secret/transit; KV v2 API\n * https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2; token renew-self\n * https://developer.hashicorp.com/vault/api-docs/auth/token#renew-a-token-self.\n */\n\n/** @wildo_source:part:start platform.key-management.vault-custody facet:layer:platform facet:family:security facet:audience:app-developer */\n/** The Transit mount the providers use when none is configured. */\nexport const VAULT_DEFAULT_TRANSIT_MOUNT = 'transit';\n/** The KV v2 mount the providers use when none is configured (where a Vault dev server mounts it). */\nexport const VAULT_DEFAULT_KV_MOUNT = 'secret';\n/** The prefix of every key name the providers create; the policies grant nothing outside it. */\nexport const VAULT_DEFAULT_KEY_NAME_PREFIX = 'wildo-';\n\n/** The names the two policies are written under. */\nexport const VAULT_SIGNER_POLICY_NAME = 'wildo-key-signer';\nexport const VAULT_OPERATOR_POLICY_NAME = 'wildo-key-operator';\n\n/** Where the providers' keys live in one Vault. */\nexport interface VaultCustodyLayout {\n readonly transitMount: string;\n readonly kvMount: string;\n readonly keyNamePrefix: string;\n}\n\n/** The layout with every default applied. */\nexport function vaultCustodyLayoutOf(layout: Partial<VaultCustodyLayout> = {}): VaultCustodyLayout {\n return {\n transitMount: layout.transitMount || VAULT_DEFAULT_TRANSIT_MOUNT,\n kvMount: layout.kvMount || VAULT_DEFAULT_KV_MOUNT,\n keyNamePrefix: layout.keyNamePrefix || VAULT_DEFAULT_KEY_NAME_PREFIX,\n };\n}\n\nconst RENEW_SELF = 'path \"auth/token/renew-self\" { capabilities = [\"update\"] }';\n\n/** The SIGNER token's policy, as Vault HCL. */\nexport function vaultSignerPolicy(layout: VaultCustodyLayout = vaultCustodyLayoutOf()): string {\n const { transitMount: t, kvMount: kv, keyNamePrefix: p } = layout;\n return [\n `path \"${t}/sign/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${t}/encrypt/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${t}/decrypt/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${t}/keys/${p}*\" { capabilities = [\"read\"] }`,\n `path \"${kv}/data/${p}*\" { capabilities = [\"read\"] }`,\n `path \"${kv}/metadata/${p}*\" { capabilities = [\"read\"] }`,\n `path \"${t}/keys/+/config\" { capabilities = [\"deny\"] }`,\n `path \"${t}/export/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/backup/*\" { capabilities = [\"deny\"] }`,\n RENEW_SELF,\n ].join('\\n');\n}\n\n/** The OPERATOR token's policy, as Vault HCL. */\nexport function vaultOperatorPolicy(layout: VaultCustodyLayout = vaultCustodyLayoutOf()): string {\n const { transitMount: t, kvMount: kv, keyNamePrefix: p } = layout;\n return [\n // `exportable` and `allow_plaintext_backup` are one-way and turn a key into one that can leave Vault, so the\n // operator may not send them at all, at creation or on `/config`: Vault refuses any request carrying a denied\n // parameter, whatever its value.\n `path \"${t}/keys/${p}*\" { capabilities = [\"create\", \"update\", \"read\", \"delete\"] denied_parameters = { \"exportable\" = [] \"allow_plaintext_backup\" = [] } }`,\n `path \"${kv}/data/${p}*\" { capabilities = [\"create\", \"update\"] }`,\n `path \"${kv}/delete/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${kv}/destroy/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${kv}/metadata/${p}*\" { capabilities = [\"delete\"] }`,\n `path \"${t}/sign/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/encrypt/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/decrypt/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/export/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/backup/*\" { capabilities = [\"deny\"] }`,\n RENEW_SELF,\n ].join('\\n');\n}\n\n/** @wildo_source:part:end platform.key-management.vault-custody */\n\n/**\n * How long a token issued for the platform lives between renewals. apps-manager renews each token at half its lease\n * (`VaultTokenRenewal`), so the period bounds how long a token that stops being renewed stays usable, not how long the\n * platform runs.\n */\nexport const VAULT_TOKEN_PERIOD = '768h';\n\n/**\n * # The break-glass RECOVERY token of the self-hosted OpenBao (#3006)\n *\n * A self-initialized OpenBao revokes its root token when initialization ends, and a static-seal server has no recovery\n * keys, so without a third credential nothing could ever replace a leaked signer or operator token, or move the server\n * onto a new unseal key, short of wiping its storage and every key in it. The recovery token is that credential, and its\n * policy is the whole of what it may do:\n *\n * - `auth/token/lookup-self`: the CLI proves the token is live before it acts, and a server initialized before #3006\n * (which holds no such token) answers \"bad token\" here rather than half-way through a rotation;\n * - `auth/token/lookup` and `auth/token/revoke-accessor`: read the accessor of the token being replaced, then revoke it\n * by that accessor. Lookup returns metadata, never a secret;\n * - `auth/token/create-orphan` with `sudo` (a custom `id` needs it): only under exactly ONE of the three platform\n * policies, only with no default policy, and only with the period or TTL the platform's own tokens carry. Every other\n * parameter is refused (`allowed_parameters`), and `required_parameters` refuses a request that omits the id, the\n * policy or `no_default_policy` (an omitted parameter is not checked by `allowed_parameters`; measured on OpenBao 2.7.1,\n * a create without `no_default_policy` was admitted and attached `default`);\n * - `sys/rotate/root` with `sudo`: re-wraps the server's root key under the seal's CURRENT key, which is the step that\n * moves a static-seal server onto a new unseal key (measured on 2.7.1: started with the new key current and the old\n * one previous, a rotation, and the new key alone unseals while the old one is refused).\n *\n * It can neither sign, wrap, read key material, change a mount nor write a policy, so a leaked recovery token can mint a\n * signer and sign, which is the power any signer token has, but cannot make a key leave the server. It is held in\n * `secrets.json` (and the CI secret store a pipeline renders the server from); no runtime's environment carries it,\n * apps-manager's included (the env builder forbids it), and only the server's own container receives it, read at its\n * first start alone.\n *\n * spec-cite: OpenBao/Vault \"Policies\" (`allowed_parameters`, `required_parameters`, `sudo`)\n * https://openbao.org/docs/concepts/policies/; token API (`create-orphan`, `lookup`, `revoke-accessor`)\n * https://openbao.org/api-docs/auth/token/; `sys/rotate/root` https://openbao.org/api-docs/system/rotate-root/.\n */\nexport const VAULT_RECOVERY_POLICY_NAME = 'wildo-key-recovery';\n\n/**\n * How long the recovery token lives: one hundred years, i.e. it does not expire. It is offline (nobody renews it), so a\n * periodic token would be dead after one period. The token mount's maximum lease TTL is raised to the same value at the\n * first start: created by the root token with no TTL, it got the mount default, 768h (measured on OpenBao 2.7.1), and would\n * have expired after 32 days.\n */\nexport const VAULT_RECOVERY_TOKEN_TTL = '876000h';\n\n/** The platform policies a recovery token may mint a token under, one per token. */\nexport const VAULT_RECOVERY_MINTABLE_POLICY_NAMES = [VAULT_SIGNER_POLICY_NAME, VAULT_OPERATOR_POLICY_NAME, VAULT_RECOVERY_POLICY_NAME] as const;\n\n/** The RECOVERY token's policy, as Vault HCL. Depends on no layout: it touches no mount but `auth/token` and `sys`. */\nexport function vaultRecoveryPolicy(): string {\n const policies = VAULT_RECOVERY_MINTABLE_POLICY_NAMES.map((name) => `[\"${name}\"]`).join(', ');\n return [\n 'path \"auth/token/lookup-self\" { capabilities = [\"read\"] }',\n 'path \"auth/token/lookup\" { capabilities = [\"update\"] }',\n 'path \"auth/token/revoke-accessor\" { capabilities = [\"update\"] }',\n [\n 'path \"auth/token/create-orphan\" {',\n ' capabilities = [\"update\", \"sudo\"]',\n ' required_parameters = [\"id\", \"policies\", \"no_default_policy\"]',\n ' allowed_parameters = {',\n ' \"id\" = []',\n ` \"policies\" = [${policies}]`,\n ' \"no_default_policy\" = [true]',\n ` \"period\" = [\"${VAULT_TOKEN_PERIOD}\"]`,\n ` \"ttl\" = [\"${VAULT_RECOVERY_TOKEN_TTL}\"]`,\n ' \"display_name\" = []',\n ' \"meta\" = []',\n ' }',\n '}',\n ].join('\\n'),\n 'path \"sys/rotate/root\" { capabilities = [\"update\", \"sudo\"] }',\n ].join('\\n');\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-parallelism.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"build-parallelism.d.ts","sourceRoot":"","sources":["../../../src/lockfile/build-parallelism.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,+BAA+B,EAAE,MAAmD,CAAC;AAElG;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,mEAAmE;AACnE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,0GAA0G;AAC1G,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGhE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQ7D;AAED,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAM9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-parallelism.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"build-parallelism.js","sourceRoot":"","sources":["../../../src/lockfile/build-parallelism.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAW,0CAA0C,CAAC;AAElG;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM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AE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5H,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport path from 'node:path';\n\n/**\n * How many build-plan coding tasks the creation lane may run AT ONCE in one application (#1528).\n *\n * An OPERATIONAL setting, not product truth: it decides how fast the build spends, never what it\n * builds, so it lives in the application's machine-local state beside the workspace-mutation lock and\n * is safe to delete. The companion reads it at every wave, so it changes without a restart; the CLI\n * writes it (`wildo workbench parallelism <n>`).\n *\n * Absent means {@link DEFAULT_BUILD_PARALLELISM}. `1` is the lane's single-flight behaviour, and remains\n * one command away. Parallel runs share ONE worktree by decision (Paul, 2026-09-24): concurrent agents\n * editing the same tree reconcile fine in practice, so the lane detects and repairs interference instead\n * of preventing it.\n */\nexport const BUILD_PARALLELISM_RELATIVE_PATH: string = '.wildo-saas/state/build-parallelism.json';\n\n/**\n * Five runs at once, by decision (Paul, 2026-09-24): parallel is the lane's normal mode, not an opt-in.\n *\n * Five rather than more because each slot is a live agent spending on its own, and the wave is already\n * measured to cut wall-clock by more than three at four runs (a live wave of four real agents: 28 s\n * against 86 s of combined run time). It sits under the ACP provider's own limit of ten concurrent\n * sessions, so the setting — not the provider — is what decides the width.\n */\nexport const DEFAULT_BUILD_PARALLELISM = 5;\n\n/**\n * A breaker, not a budget. Each slot is a live coding agent spending on its own, so the ceiling stops\n * a typo (`100`) from becoming a hundred concurrent agents; any value up to it is the operator's call.\n */\nexport const MAXIMUM_BUILD_PARALLELISM = 16;\n\n/** Absolute path of an application's build-parallelism setting. */\nexport function getBuildParallelismPath(saasRoot: string): string {\n return path.join(saasRoot, BUILD_PARALLELISM_RELATIVE_PATH);\n}\n\n/** Clamp a requested degree into `[1, MAXIMUM_BUILD_PARALLELISM]`; anything unreadable is the default. */\nexport function normalizeBuildParallelism(value: unknown): number {\n if (typeof value !== 'number' || !Number.isFinite(value)) return DEFAULT_BUILD_PARALLELISM;\n return Math.min(MAXIMUM_BUILD_PARALLELISM, Math.max(1, Math.floor(value)));\n}\n\n/**\n * The application's build parallelism. Never throws: an absent, unreadable or malformed file reads as\n * the default, because a throughput knob that cannot be read must not stop the build.\n */\nexport function readBuildParallelism(saasRoot: string): number {\n const filePath = getBuildParallelismPath(saasRoot);\n if (!existsSync(filePath)) return DEFAULT_BUILD_PARALLELISM;\n try {\n return normalizeBuildParallelism((JSON.parse(readFileSync(filePath, 'utf8')) as { degree?: unknown }).degree);\n } catch {\n return DEFAULT_BUILD_PARALLELISM;\n }\n}\n\n/** Record the application's build parallelism, clamped. Returns the degree actually recorded. */\nexport function writeBuildParallelism(saasRoot: string, degree: number): number {\n const recorded = normalizeBuildParallelism(degree);\n const filePath = getBuildParallelismPath(saasRoot);\n mkdirSync(path.dirname(filePath), { recursive: true });\n writeFileSync(filePath, `${JSON.stringify({ degree: recorded, recordedAt: new Date().toISOString() }, null, 2)}\\n`, 'utf8');\n return recorded;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Canonical JSON serialization helpers shared by lockfile writers and
|
|
3
|
-
* lockfile readers
|
|
3
|
+
* lockfile readers.
|
|
4
4
|
*
|
|
5
5
|
* `JSON.stringify`'s built-in second argument can either filter+order
|
|
6
6
|
* top-level keys (when given an array) or transform values (when given
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-json.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"canonical-json.d.ts","sourceRoot":"","sources":["../../../src/lockfile/canonical-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAW1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGzD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Canonical JSON serialization helpers shared by lockfile writers and
|
|
3
|
-
* lockfile readers
|
|
3
|
+
* lockfile readers.
|
|
4
4
|
*
|
|
5
5
|
* `JSON.stringify`'s built-in second argument can either filter+order
|
|
6
6
|
* top-level keys (when given an array) or transform values (when given
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-json.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"canonical-json.js","sourceRoot":"","sources":["../../../src/lockfile/canonical-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACvC,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YACpD,MAAM,MAAM,GAA4B,EAAE,CAAC;YAC3C,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBACtC,MAAM,CAAC,CAAC,CAAC,GAAI,CAA6B,CAAC,CAAC,CAAC,CAAC;YAChD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,MAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC7C,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAC1E,CAAC","sourcesContent":["/**\n * Canonical JSON serialization helpers shared by lockfile writers and\n * lockfile readers.\n *\n * `JSON.stringify`'s built-in second argument can either filter+order\n * top-level keys (when given an array) or transform values (when given\n * a function). To get a *recursive* canonical serialization — the\n * SAME byte output for two semantically equal inputs regardless of\n * property-insertion order at any nesting level — we need a transform\n * that returns a new object with sorted keys at every layer.\n *\n * The legacy in-line implementation in `materialize-infra-section.ts`\n * sorted only top-level keys. That meant nested objects (e.g.\n * `MongoBackingService.options: {retryWrites, w, authSource}`) drifted\n * across editor saves that re-ordered the nested keys, falsely\n * triggering lockfile-drift CI failures.\n *\n * This helper is the canonical fix.\n */\n\nimport { createHash } from 'node:crypto';\n\n/**\n * `JSON.stringify` with sorted keys at every nesting level. Stable\n * across platforms, editor save formats, and Node versions.\n *\n * Special-cases:\n * - Arrays preserve order (semantic — array order is meaningful).\n * - Objects sort their own keys (lexicographic).\n * - Primitives pass through.\n * - `undefined` values are dropped (matches `JSON.stringify` default).\n */\nexport function stableJsonStringify(value: unknown): string {\n return JSON.stringify(value, (_key, v) => {\n if (v && typeof v === 'object' && !Array.isArray(v)) {\n const sorted: Record<string, unknown> = {};\n for (const k of Object.keys(v).sort()) {\n sorted[k] = (v as Record<string, unknown>)[k];\n }\n return sorted;\n }\n return v;\n });\n}\n\n/**\n * Stable sha256 digest of any JSON-serializable value. Output format:\n * `sha256:<hex>` (matches the digest convention used elsewhere in the\n * lockfile envelope, e.g. provider-runtime artifacts).\n *\n * Two inputs with the same canonical serialization (per\n * `stableJsonStringify`) produce the same digest regardless of\n * property-insertion order at any nesting level.\n */\nexport function stableSha256Digest(value: unknown): string {\n const canonical = stableJsonStringify(value);\n return `sha256:${createHash('sha256').update(canonical).digest('hex')}`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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 -32,6 +32,7 @@ import * as os from 'node:os';
|
|
|
32
32
|
import * as path from 'node:path';
|
|
33
33
|
import lockfile from 'proper-lockfile';
|
|
34
34
|
import { z } from 'zod';
|
|
35
|
+
import { describeCaughtError } from '@wildo-ai/saas-models';
|
|
35
36
|
/**
|
|
36
37
|
* How long a LIVE holder may go without refreshing its lock before a waiter may reclaim it anyway.
|
|
37
38
|
*
|
|
@@ -51,7 +52,7 @@ export class FileLockCompromisedError extends Error {
|
|
|
51
52
|
/** What the critical section itself failed with, when it failed too; `cause` is the lock's loss. */
|
|
52
53
|
sectionError;
|
|
53
54
|
constructor(lockTargetPath, cause) {
|
|
54
|
-
super(`The lock on ${lockTargetPath} was lost while it was held (${
|
|
55
|
+
super(`The lock on ${lockTargetPath} was lost while it was held (${describeCaughtError(cause)}). `
|
|
55
56
|
+ 'The critical section it guarded did not keep exclusive access and was refused.', { cause });
|
|
56
57
|
this.name = 'FileLockCompromisedError';
|
|
57
58
|
this.lockTargetPath = lockTargetPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-lock-hold.js","sourceRoot":"","sources":["../../../../src/lockfile/file-lock-hold.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,GAAG,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I,YAAY,KAAK,IAAI,CAAC,UAAU;YAAE,IAAI,CAAC,UAAU,CAAC,YAAY,GAAG,YAAY,CAAC;QACnG,MAAM,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IACD,IAAI,CAAC;QACH,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,0FAA0F;QAC1F,MAAM,kBAAkB,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,UAAU;YAAE,MAAM,IAAI,CAAC,UAAU,CAAC;QAC3C,MAAM,KAAK,CAAC;IACd,CAAC;IACD,MAAM,kBAAkB,EAAE,CAAC;IAC3B,IAAI,aAAa;QAAE,MAAM,YAAY,CAAC;IACtC,OAAO,KAAU,CAAC;AACpB,CAAC","sourcesContent":["/**\n * The one way this package acquires a `proper-lockfile` lock, so every holder gets the same two\n * guarantees (#2225):\n *\n * 1. **A waiter never reclaims the lock of a holder that is still alive.** proper-lockfile decides a\n * lock is stale from its directory's mtime alone (`stale`, 5 s by default here). A holder whose\n * refresh is merely LATE — an event-loop stall, a saturated libuv threadpool, a laptop waking up —\n * recovers on its own as long as nobody touched the lock directory (proper-lockfile 4.1.2,\n * `lockfile.js` `updateLock`: a successful `utimes` carries no threshold check). What turns a late\n * refresh into a lost lock is a WAITER judging the mtime stale and removing the directory. So the\n * reclaim itself is guarded: the removal is refused while the recorded holder is alive on this host.\n * 2. **Losing the lock is an error in that critical section, never a process exit.** proper-lockfile's\n * default `onCompromised` throws inside an `fs` callback, which is an uncaught exception. On\n * 2026-10-01 that killed the dev companion mid build wave, with every in-flight coding run in it.\n *\n * Why a liveness check and not simply a larger `stale`: the reclaim that matters most is by the SAME\n * process — proper-lockfile keeps no in-process guard, so a second `lock()` in the companion (a\n * concurrent run's commit retrying for minutes) takes the same mtime path as a stranger would. Any\n * fixed window is one stall away from being too short, and a long window makes a CRASHED holder's lock\n * block everyone for that long. Asking \"is the holder alive\" keeps dead-holder recovery at 5 s and makes\n * the live-holder case independent of timing. Rejected: writing the holder record INSIDE the lock\n * directory (it changes the directory's mtime, which proper-lockfile reads as another owner, and makes a\n * plain `rmdir` from an older library fail `ENOTEMPTY`) and BESIDE it (the shared\n * `.wildo-saas/wildo-saas.lock.json.lock` sits in a committed, un-ignored directory, so a record there is\n * an untracked file in the very `git status` the companion attributes writes from).\n */\n\nimport nodeFs from 'node:fs';\nimport { promises as fs } from 'node:fs';\nimport { AsyncLocalStorage } from 'node:async_hooks';\nimport { createHash, randomUUID } from 'node:crypto';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport lockfile from 'proper-lockfile';\nimport { z } from 'zod';\n\n/**\n * How long a LIVE holder may go without refreshing its lock before a waiter may reclaim it anyway.\n *\n * Ten minutes without a single mtime refresh (normally every 2.5 s) means the holder is wedged, or its\n * pid was reused by an unrelated process. Past this the reclaim proceeds, and the wedged holder learns it\n * lost the lock through {@link FileLockCompromisedError} rather than by dying.\n */\nexport const LIVE_HOLDER_RECLAIM_CEILING_MS = 10 * 60_000;\n\n/** Options every acquisition in this package resolves to. */\nexport interface FileLockAcquireOptions {\n readonly retries: number | { retries?: number; minTimeout?: number; maxTimeout?: number; factor?: number };\n readonly stale: number;\n readonly realpath: boolean;\n /**\n * Told once when the lock is lost while held. The critical section still fails with\n * {@link FileLockCompromisedError}; this is for the caller's own log. Omitted, one line goes to stderr.\n */\n readonly onCompromised?: (error: FileLockCompromisedError) => void;\n}\n\n/**\n * The lock was taken from this holder while it still held it — another acquirer removed it, or the lock\n * directory was deleted. The holder no longer has exclusivity, so whatever it was about to do as the\n * exclusive writer must not happen. `code` is `ECOMPROMISED`, the code proper-lockfile itself uses.\n */\nexport class FileLockCompromisedError extends Error {\n readonly code = 'ECOMPROMISED';\n readonly lockTargetPath: string;\n /** What the critical section itself failed with, when it failed too; `cause` is the lock's loss. */\n sectionError?: unknown;\n\n constructor(lockTargetPath: string, cause: unknown) {\n super(\n `The lock on ${lockTargetPath} was lost while it was held (${cause instanceof Error ? cause.message : String(cause)}). `\n + 'The critical section it guarded did not keep exclusive access and was refused.',\n { cause },\n );\n this.name = 'FileLockCompromisedError';\n this.lockTargetPath = lockTargetPath;\n }\n}\n\ninterface FileLockHold {\n readonly lockTargetPath: string;\n compromise: FileLockCompromisedError | null;\n}\n\n/** The holds the current async call chain is running inside, outermost first. */\nconst heldFileLocks = new AsyncLocalStorage<readonly FileLockHold[]>();\n\n/**\n * Throw if a lock the current call chain is running inside has been lost.\n *\n * Call it immediately before an act that is only safe as the lock's exclusive holder — a git commit, a\n * file write the lock serializes. Outside any lock, or with every enclosing lock intact, it does nothing.\n */\nexport function assertHeldFileLocksIntact(): void {\n for (const hold of heldFileLocks.getStore() ?? []) {\n if (hold.compromise) throw hold.compromise;\n }\n}\n\nconst FileLockHolderRecordSchema = z.object({\n pid: z.number().int().positive(),\n hostname: z.string(),\n token: z.string(),\n acquiredAt: z.string(),\n});\ntype FileLockHolderRecord = z.infer<typeof FileLockHolderRecordSchema>;\n\n/** lock directory → token of the hold THIS process currently has on it. */\nconst heldInThisProcess = new Map<string, string>();\n\n/**\n * Where a lock's holder is recorded: a per-USER temp directory (created `0700`), keyed by the lock\n * directory's path. Outside every worktree (see the module comment), and shared by every process of one\n * user on one host — which is exactly the population whose liveness `process.kill(pid, 0)` can answer.\n * Per user, not merely per `$TMPDIR`: where `os.tmpdir()` is a shared `/tmp`, another account could\n * otherwise plant a record naming a live pid and hold a crashed lock for the whole ceiling.\n */\nexport function fileLockHolderRecordPath(lockDirPath: string): string {\n const key = createHash('sha256').update(lockDirPath).digest('hex').slice(0, 32);\n return path.join(fileLockHolderRecordDirectory(), `${key}.json`);\n}\n\nfunction fileLockHolderRecordDirectory(): string {\n const user = typeof process.getuid === 'function' ? String(process.getuid()) : os.userInfo().username;\n return path.join(os.tmpdir(), `wildo-file-lock-holders-${user}`);\n}\n\n/**\n * Whether the record directory belongs to this user. `mkdir`'s `0700` holds only for a directory this\n * process CREATED; on a shared `/tmp` another account could have created it first. A directory owned by\n * someone else is never written to and never believed: the lock then keeps plain mtime staleness.\n */\nasync function holderRecordDirectoryIsOurs(): Promise<boolean> {\n if (typeof process.getuid !== 'function') return true;\n try {\n return (await fs.lstat(fileLockHolderRecordDirectory())).uid === process.getuid();\n } catch {\n return false;\n }\n}\n\nasync function readHolderRecord(lockDirPath: string): Promise<FileLockHolderRecord | null> {\n if (!(await holderRecordDirectoryIsOurs())) return null;\n try {\n const parsed = FileLockHolderRecordSchema.safeParse(JSON.parse(await fs.readFile(fileLockHolderRecordPath(lockDirPath), 'utf8')));\n return parsed.success ? parsed.data : null;\n } catch {\n return null;\n }\n}\n\nfunction isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n // EPERM: the process exists but belongs to someone else — alive.\n return (error as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n\n/**\n * The holder a reclaim of `lockDirPath` would take the lock from, when that holder is alive and\n * refreshed within {@link LIVE_HOLDER_RECLAIM_CEILING_MS}; otherwise `null`, and the reclaim may proceed.\n *\n * No record, a record from another host, or a record naming a dead process all mean proper-lockfile's own\n * mtime judgement stands — the dead-holder recovery this lock has always had.\n */\nasync function liveHolderBlockingReclaim(lockDirPath: string): Promise<FileLockHolderRecord | null> {\n const record = await readHolderRecord(lockDirPath);\n if (!record || record.hostname !== os.hostname()) return null;\n const alive = record.pid === process.pid\n // In this process the map is the truth: a record naming this pid with another token is left over\n // from a hold that has already ended here.\n ? heldInThisProcess.get(lockDirPath) === record.token\n : isProcessAlive(record.pid);\n if (!alive) return null;\n try {\n const { mtimeMs } = await fs.stat(lockDirPath);\n if (Date.now() - mtimeMs > LIVE_HOLDER_RECLAIM_CEILING_MS) return null;\n } catch {\n return null;\n }\n return record;\n}\n\n/**\n * The `fs` proper-lockfile is given. Identical to `node:fs` except `rmdir`, which proper-lockfile calls\n * for exactly two reasons: to REMOVE A STALE LOCK before taking it (while acquiring) and to RELEASE its\n * own lock (once held, including its exit-time cleanup). Only the first is guarded, and a refusal is\n * returned as `ELOCKED` so the caller's retry policy and conflict mapping apply unchanged.\n */\nfunction createReclaimGuardedFs(phase: { acquiring: boolean }): typeof nodeFs {\n const rmdir = (lockDirPath: string, callback: (error: NodeJS.ErrnoException | null) => void): void => {\n if (!phase.acquiring) {\n nodeFs.rmdir(lockDirPath, callback);\n return;\n }\n liveHolderBlockingReclaim(lockDirPath).then(\n (holder) => {\n if (!holder) {\n nodeFs.rmdir(lockDirPath, callback);\n return;\n }\n callback(Object.assign(\n new Error(`Lock file is already being held by live process ${holder.pid} (its refresh is late, so it is not reclaimed)`),\n { code: 'ELOCKED', file: lockDirPath },\n ));\n },\n () => nodeFs.rmdir(lockDirPath, callback),\n );\n };\n return { ...nodeFs, rmdir } as typeof nodeFs;\n}\n\nfunction reportCompromiseToStderr(error: FileLockCompromisedError): void {\n process.stderr.write(`[wildo] ${error.message}\\n`);\n}\n\n/**\n * Acquire `lockTargetPath` (which must exist), run `fn` holding it, release it.\n *\n * - A lost lock never throws asynchronously. It marks the hold, `assertHeldFileLocksIntact()` refuses from\n * then on inside `fn`'s call chain, and the call rejects with {@link FileLockCompromisedError} once `fn`\n * settles — with `fn`'s own error as the cause when it failed too.\n * - Contention is still proper-lockfile's `ELOCKED`, including a refused reclaim of a live holder.\n */\nexport async function holdFileLock<T>(lockTargetPath: string, fn: () => Promise<T>, options: FileLockAcquireOptions): Promise<T> {\n const canonicalTarget = options.realpath ? await fs.realpath(lockTargetPath) : path.resolve(lockTargetPath);\n const lockDirPath = `${canonicalTarget}.lock`;\n const hold: FileLockHold = { lockTargetPath, compromise: null };\n const token = randomUUID();\n const phase = { acquiring: true };\n\n const release = await lockfile.lock(lockTargetPath, {\n retries: options.retries,\n stale: options.stale,\n realpath: options.realpath,\n fs: createReclaimGuardedFs(phase),\n onCompromised: (cause: Error) => {\n hold.compromise = new FileLockCompromisedError(lockTargetPath, cause);\n if (heldInThisProcess.get(lockDirPath) === token) heldInThisProcess.delete(lockDirPath);\n try {\n (options.onCompromised ?? reportCompromiseToStderr)(hold.compromise);\n } catch {\n // A logging callback must not reintroduce the uncaught exception this handler exists to remove.\n }\n },\n });\n phase.acquiring = false;\n heldInThisProcess.set(lockDirPath, token);\n const recordPath = fileLockHolderRecordPath(lockDirPath);\n try {\n await fs.mkdir(path.dirname(recordPath), { recursive: true, mode: 0o700 });\n if (!(await holderRecordDirectoryIsOurs())) throw new Error('holder record directory belongs to another user');\n const record: FileLockHolderRecord = { pid: process.pid, hostname: os.hostname(), token, acquiredAt: new Date().toISOString() };\n await fs.writeFile(recordPath, JSON.stringify(record), 'utf8');\n } catch {\n // Without a record the lock keeps proper-lockfile's plain mtime judgement — what it had before #2225.\n }\n\n const enclosing = heldFileLocks.getStore() ?? [];\n let value: T | undefined;\n let sectionFailed = false;\n let sectionError: unknown;\n try {\n value = await heldFileLocks.run([...enclosing, hold], fn);\n } catch (error) {\n sectionFailed = true;\n sectionError = error;\n }\n\n if (heldInThisProcess.get(lockDirPath) === token) heldInThisProcess.delete(lockDirPath);\n /*\n * The record goes AFTER the release, never before: the release is what the next acquirer is waiting\n * for, and a caller that saw this section settle may acquire again at once with no retries. A record\n * outliving its lock is harmless — the token check means it is only ever removed by its own hold, and\n * a stale record defends nothing once the directory it names is gone.\n */\n // Residual, accepted: the read and the remove are two steps, so an acquirer whose record lands between\n // them loses it and falls back to plain mtime staleness for that one hold — what every hold had before\n // #2225. The window is the gap between two filesystem calls, after this hold has already released.\n const forgetHolderRecord = async (): Promise<void> => {\n if ((await readHolderRecord(lockDirPath))?.token === token) await fs.rm(recordPath, { force: true }).catch(() => undefined);\n };\n\n if (hold.compromise) {\n // proper-lockfile has already dropped a compromised lock, so there is nothing of ours to release —\n // and the directory now belongs to whoever took it.\n await forgetHolderRecord();\n if (sectionFailed && sectionError !== hold.compromise) hold.compromise.sectionError = sectionError;\n throw hold.compromise;\n }\n try {\n await release();\n } catch (error) {\n // Lost between the check above and the release: same answer as a loss during the section.\n await forgetHolderRecord();\n if (hold.compromise) throw hold.compromise;\n throw error;\n }\n await forgetHolderRecord();\n if (sectionFailed) throw sectionError;\n return value as T;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"file-lock-hold.js","sourceRoot":"","sources":["../../../src/lockfile/file-lock-hold.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,GAAG,MAAM,CAAC;AAc1D;;;;GAIG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACxC,IAAI,GAAG,cAAc,CAAC;IACtB,cAAc,CAAS;IAChC,oGAAoG;IACpG,YAAY,CAAW;IAEvB,YAAY,cAAsB,EAAE,KAAc;QAChD,KAAK,CACH,eAAe,cAAc,gCAAgC,mBAAmB,CAAC,KAAK,CAAC,KAAK;cAC1F,gFAAgF,EAClF,EAAE,KAAK,EAAE,CACV,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;QACvC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;CACF;AAOD,iFAAiF;AACjF,MAAM,aAAa,GAAG,IAAI,iBAAiB,EAA2B,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB;IAC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,aAAa,GAAG,IAAI,CAAC;QACrB,YAAY,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,IAAI,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,KAAK;QAAE,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACxF;;;;;OAKG;IACH,uGAAuG;IACvG,uGAAuG;IACvG,mGAAmG;IACnG,MAAM,kBAAkB,GAAG,KAAK,IAAmB,EAAE;QACnD,IAAI,CAAC,MAAM,gBAAgB,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK;YAAE,MAAM,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC9H,CAAC,CAAC;IAEF,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,mGAAmG;QACnG,oDAAoD;QACpD,MAAM,kBAAkB,EAAE,CAAC;QAC3B,IAAI,aAAa,IAAI,YAAY,KAAK,IAAI,CAAC,UAAU;YAAE,IAAI,CAAC,UAAU,CAAC,YAAY,GAAG,YAAY,CAAC;QACnG,MAAM,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IACD,IAAI,CAAC;QACH,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,0FAA0F;QAC1F,MAAM,kBAAkB,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,UAAU;YAAE,MAAM,IAAI,CAAC,UAAU,CAAC;QAC3C,MAAM,KAAK,CAAC;IACd,CAAC;IACD,MAAM,kBAAkB,EAAE,CAAC;IAC3B,IAAI,aAAa;QAAE,MAAM,YAAY,CAAC;IACtC,OAAO,KAAU,CAAC;AACpB,CAAC","sourcesContent":["/**\n * The one way this package acquires a `proper-lockfile` lock, so every holder gets the same two\n * guarantees (#2225):\n *\n * 1. **A waiter never reclaims the lock of a holder that is still alive.** proper-lockfile decides a\n * lock is stale from its directory's mtime alone (`stale`, 5 s by default here). A holder whose\n * refresh is merely LATE — an event-loop stall, a saturated libuv threadpool, a laptop waking up —\n * recovers on its own as long as nobody touched the lock directory (proper-lockfile 4.1.2,\n * `lockfile.js` `updateLock`: a successful `utimes` carries no threshold check). What turns a late\n * refresh into a lost lock is a WAITER judging the mtime stale and removing the directory. So the\n * reclaim itself is guarded: the removal is refused while the recorded holder is alive on this host.\n * 2. **Losing the lock is an error in that critical section, never a process exit.** proper-lockfile's\n * default `onCompromised` throws inside an `fs` callback, which is an uncaught exception. On\n * 2026-10-01 that killed the dev companion mid build wave, with every in-flight coding run in it.\n *\n * Why a liveness check and not simply a larger `stale`: the reclaim that matters most is by the SAME\n * process — proper-lockfile keeps no in-process guard, so a second `lock()` in the companion (a\n * concurrent run's commit retrying for minutes) takes the same mtime path as a stranger would. Any\n * fixed window is one stall away from being too short, and a long window makes a CRASHED holder's lock\n * block everyone for that long. Asking \"is the holder alive\" keeps dead-holder recovery at 5 s and makes\n * the live-holder case independent of timing. Rejected: writing the holder record INSIDE the lock\n * directory (it changes the directory's mtime, which proper-lockfile reads as another owner, and makes a\n * plain `rmdir` from an older library fail `ENOTEMPTY`) and BESIDE it (the shared\n * `.wildo-saas/wildo-saas.lock.json.lock` sits in a committed, un-ignored directory, so a record there is\n * an untracked file in the very `git status` the companion attributes writes from).\n */\n\nimport nodeFs from 'node:fs';\nimport { promises as fs } from 'node:fs';\nimport { AsyncLocalStorage } from 'node:async_hooks';\nimport { createHash, randomUUID } from 'node:crypto';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport lockfile from 'proper-lockfile';\nimport { z } from 'zod';\nimport { describeCaughtError } from '@wildo-ai/saas-models';\n\n/**\n * How long a LIVE holder may go without refreshing its lock before a waiter may reclaim it anyway.\n *\n * Ten minutes without a single mtime refresh (normally every 2.5 s) means the holder is wedged, or its\n * pid was reused by an unrelated process. Past this the reclaim proceeds, and the wedged holder learns it\n * lost the lock through {@link FileLockCompromisedError} rather than by dying.\n */\nexport const LIVE_HOLDER_RECLAIM_CEILING_MS = 10 * 60_000;\n\n/** Options every acquisition in this package resolves to. */\nexport interface FileLockAcquireOptions {\n readonly retries: number | { retries?: number; minTimeout?: number; maxTimeout?: number; factor?: number };\n readonly stale: number;\n readonly realpath: boolean;\n /**\n * Told once when the lock is lost while held. The critical section still fails with\n * {@link FileLockCompromisedError}; this is for the caller's own log. Omitted, one line goes to stderr.\n */\n readonly onCompromised?: (error: FileLockCompromisedError) => void;\n}\n\n/**\n * The lock was taken from this holder while it still held it — another acquirer removed it, or the lock\n * directory was deleted. The holder no longer has exclusivity, so whatever it was about to do as the\n * exclusive writer must not happen. `code` is `ECOMPROMISED`, the code proper-lockfile itself uses.\n */\nexport class FileLockCompromisedError extends Error {\n readonly code = 'ECOMPROMISED';\n readonly lockTargetPath: string;\n /** What the critical section itself failed with, when it failed too; `cause` is the lock's loss. */\n sectionError?: unknown;\n\n constructor(lockTargetPath: string, cause: unknown) {\n super(\n `The lock on ${lockTargetPath} was lost while it was held (${describeCaughtError(cause)}). `\n + 'The critical section it guarded did not keep exclusive access and was refused.',\n { cause },\n );\n this.name = 'FileLockCompromisedError';\n this.lockTargetPath = lockTargetPath;\n }\n}\n\ninterface FileLockHold {\n readonly lockTargetPath: string;\n compromise: FileLockCompromisedError | null;\n}\n\n/** The holds the current async call chain is running inside, outermost first. */\nconst heldFileLocks = new AsyncLocalStorage<readonly FileLockHold[]>();\n\n/**\n * Throw if a lock the current call chain is running inside has been lost.\n *\n * Call it immediately before an act that is only safe as the lock's exclusive holder — a git commit, a\n * file write the lock serializes. Outside any lock, or with every enclosing lock intact, it does nothing.\n */\nexport function assertHeldFileLocksIntact(): void {\n for (const hold of heldFileLocks.getStore() ?? []) {\n if (hold.compromise) throw hold.compromise;\n }\n}\n\nconst FileLockHolderRecordSchema = z.object({\n pid: z.number().int().positive(),\n hostname: z.string(),\n token: z.string(),\n acquiredAt: z.string(),\n});\ntype FileLockHolderRecord = z.infer<typeof FileLockHolderRecordSchema>;\n\n/** lock directory → token of the hold THIS process currently has on it. */\nconst heldInThisProcess = new Map<string, string>();\n\n/**\n * Where a lock's holder is recorded: a per-USER temp directory (created `0700`), keyed by the lock\n * directory's path. Outside every worktree (see the module comment), and shared by every process of one\n * user on one host — which is exactly the population whose liveness `process.kill(pid, 0)` can answer.\n * Per user, not merely per `$TMPDIR`: where `os.tmpdir()` is a shared `/tmp`, another account could\n * otherwise plant a record naming a live pid and hold a crashed lock for the whole ceiling.\n */\nexport function fileLockHolderRecordPath(lockDirPath: string): string {\n const key = createHash('sha256').update(lockDirPath).digest('hex').slice(0, 32);\n return path.join(fileLockHolderRecordDirectory(), `${key}.json`);\n}\n\nfunction fileLockHolderRecordDirectory(): string {\n const user = typeof process.getuid === 'function' ? String(process.getuid()) : os.userInfo().username;\n return path.join(os.tmpdir(), `wildo-file-lock-holders-${user}`);\n}\n\n/**\n * Whether the record directory belongs to this user. `mkdir`'s `0700` holds only for a directory this\n * process CREATED; on a shared `/tmp` another account could have created it first. A directory owned by\n * someone else is never written to and never believed: the lock then keeps plain mtime staleness.\n */\nasync function holderRecordDirectoryIsOurs(): Promise<boolean> {\n if (typeof process.getuid !== 'function') return true;\n try {\n return (await fs.lstat(fileLockHolderRecordDirectory())).uid === process.getuid();\n } catch {\n return false;\n }\n}\n\nasync function readHolderRecord(lockDirPath: string): Promise<FileLockHolderRecord | null> {\n if (!(await holderRecordDirectoryIsOurs())) return null;\n try {\n const parsed = FileLockHolderRecordSchema.safeParse(JSON.parse(await fs.readFile(fileLockHolderRecordPath(lockDirPath), 'utf8')));\n return parsed.success ? parsed.data : null;\n } catch {\n return null;\n }\n}\n\nfunction isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n // EPERM: the process exists but belongs to someone else — alive.\n return (error as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n\n/**\n * The holder a reclaim of `lockDirPath` would take the lock from, when that holder is alive and\n * refreshed within {@link LIVE_HOLDER_RECLAIM_CEILING_MS}; otherwise `null`, and the reclaim may proceed.\n *\n * No record, a record from another host, or a record naming a dead process all mean proper-lockfile's own\n * mtime judgement stands — the dead-holder recovery this lock has always had.\n */\nasync function liveHolderBlockingReclaim(lockDirPath: string): Promise<FileLockHolderRecord | null> {\n const record = await readHolderRecord(lockDirPath);\n if (!record || record.hostname !== os.hostname()) return null;\n const alive = record.pid === process.pid\n // In this process the map is the truth: a record naming this pid with another token is left over\n // from a hold that has already ended here.\n ? heldInThisProcess.get(lockDirPath) === record.token\n : isProcessAlive(record.pid);\n if (!alive) return null;\n try {\n const { mtimeMs } = await fs.stat(lockDirPath);\n if (Date.now() - mtimeMs > LIVE_HOLDER_RECLAIM_CEILING_MS) return null;\n } catch {\n return null;\n }\n return record;\n}\n\n/**\n * The `fs` proper-lockfile is given. Identical to `node:fs` except `rmdir`, which proper-lockfile calls\n * for exactly two reasons: to REMOVE A STALE LOCK before taking it (while acquiring) and to RELEASE its\n * own lock (once held, including its exit-time cleanup). Only the first is guarded, and a refusal is\n * returned as `ELOCKED` so the caller's retry policy and conflict mapping apply unchanged.\n */\nfunction createReclaimGuardedFs(phase: { acquiring: boolean }): typeof nodeFs {\n const rmdir = (lockDirPath: string, callback: (error: NodeJS.ErrnoException | null) => void): void => {\n if (!phase.acquiring) {\n nodeFs.rmdir(lockDirPath, callback);\n return;\n }\n liveHolderBlockingReclaim(lockDirPath).then(\n (holder) => {\n if (!holder) {\n nodeFs.rmdir(lockDirPath, callback);\n return;\n }\n callback(Object.assign(\n new Error(`Lock file is already being held by live process ${holder.pid} (its refresh is late, so it is not reclaimed)`),\n { code: 'ELOCKED', file: lockDirPath },\n ));\n },\n () => nodeFs.rmdir(lockDirPath, callback),\n );\n };\n return { ...nodeFs, rmdir } as typeof nodeFs;\n}\n\nfunction reportCompromiseToStderr(error: FileLockCompromisedError): void {\n process.stderr.write(`[wildo] ${error.message}\\n`);\n}\n\n/**\n * Acquire `lockTargetPath` (which must exist), run `fn` holding it, release it.\n *\n * - A lost lock never throws asynchronously. It marks the hold, `assertHeldFileLocksIntact()` refuses from\n * then on inside `fn`'s call chain, and the call rejects with {@link FileLockCompromisedError} once `fn`\n * settles — with `fn`'s own error as the cause when it failed too.\n * - Contention is still proper-lockfile's `ELOCKED`, including a refused reclaim of a live holder.\n */\nexport async function holdFileLock<T>(lockTargetPath: string, fn: () => Promise<T>, options: FileLockAcquireOptions): Promise<T> {\n const canonicalTarget = options.realpath ? await fs.realpath(lockTargetPath) : path.resolve(lockTargetPath);\n const lockDirPath = `${canonicalTarget}.lock`;\n const hold: FileLockHold = { lockTargetPath, compromise: null };\n const token = randomUUID();\n const phase = { acquiring: true };\n\n const release = await lockfile.lock(lockTargetPath, {\n retries: options.retries,\n stale: options.stale,\n realpath: options.realpath,\n fs: createReclaimGuardedFs(phase),\n onCompromised: (cause: Error) => {\n hold.compromise = new FileLockCompromisedError(lockTargetPath, cause);\n if (heldInThisProcess.get(lockDirPath) === token) heldInThisProcess.delete(lockDirPath);\n try {\n (options.onCompromised ?? reportCompromiseToStderr)(hold.compromise);\n } catch {\n // A logging callback must not reintroduce the uncaught exception this handler exists to remove.\n }\n },\n });\n phase.acquiring = false;\n heldInThisProcess.set(lockDirPath, token);\n const recordPath = fileLockHolderRecordPath(lockDirPath);\n try {\n await fs.mkdir(path.dirname(recordPath), { recursive: true, mode: 0o700 });\n if (!(await holderRecordDirectoryIsOurs())) throw new Error('holder record directory belongs to another user');\n const record: FileLockHolderRecord = { pid: process.pid, hostname: os.hostname(), token, acquiredAt: new Date().toISOString() };\n await fs.writeFile(recordPath, JSON.stringify(record), 'utf8');\n } catch {\n // Without a record the lock keeps proper-lockfile's plain mtime judgement — what it had before #2225.\n }\n\n const enclosing = heldFileLocks.getStore() ?? [];\n let value: T | undefined;\n let sectionFailed = false;\n let sectionError: unknown;\n try {\n value = await heldFileLocks.run([...enclosing, hold], fn);\n } catch (error) {\n sectionFailed = true;\n sectionError = error;\n }\n\n if (heldInThisProcess.get(lockDirPath) === token) heldInThisProcess.delete(lockDirPath);\n /*\n * The record goes AFTER the release, never before: the release is what the next acquirer is waiting\n * for, and a caller that saw this section settle may acquire again at once with no retries. A record\n * outliving its lock is harmless — the token check means it is only ever removed by its own hold, and\n * a stale record defends nothing once the directory it names is gone.\n */\n // Residual, accepted: the read and the remove are two steps, so an acquirer whose record lands between\n // them loses it and falls back to plain mtime staleness for that one hold — what every hold had before\n // #2225. The window is the gap between two filesystem calls, after this hold has already released.\n const forgetHolderRecord = async (): Promise<void> => {\n if ((await readHolderRecord(lockDirPath))?.token === token) await fs.rm(recordPath, { force: true }).catch(() => undefined);\n };\n\n if (hold.compromise) {\n // proper-lockfile has already dropped a compromised lock, so there is nothing of ours to release —\n // and the directory now belongs to whoever took it.\n await forgetHolderRecord();\n if (sectionFailed && sectionError !== hold.compromise) hold.compromise.sectionError = sectionError;\n throw hold.compromise;\n }\n try {\n await release();\n } catch (error) {\n // Lost between the check above and the release: same answer as a loss during the section.\n await forgetHolderRecord();\n if (hold.compromise) throw hold.compromise;\n throw error;\n }\n await forgetHolderRecord();\n if (sectionFailed) throw sectionError;\n return value as T;\n}\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared `wildo-saas.lock.json` IO primitives.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* into `platform-config-lib`. Both the dev companion's
|
|
4
|
+
* Holds the locking + atomic-write surface, validated by a lock-contention
|
|
5
|
+
* spike, in `platform-config-lib`. Both the dev companion's
|
|
7
6
|
* `WildoSaasLockCompanionService` and the CLI-side
|
|
8
7
|
* `RegistryLockfileService` consume this module so concurrent
|
|
9
8
|
* writers — across processes (CLI + companion + minions) — never
|
|
@@ -46,11 +45,10 @@ export declare const WILDO_SAAS_LOCK_RELATIVE_PATH = ".wildo-saas/wildo-saas.loc
|
|
|
46
45
|
*/
|
|
47
46
|
export declare function getWildoSaasLockPath(saasRoot: string): string;
|
|
48
47
|
/**
|
|
49
|
-
* Default `proper-lockfile` options. The 5s `stale` window
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* 4a-4d all passed under these settings.
|
|
48
|
+
* Default `proper-lockfile` options. The 5s `stale` window comes from
|
|
49
|
+
* a lock-contention spike: typical lock-hold time is < 50ms; 5s is generous enough
|
|
50
|
+
* to absorb a CI pause without compromising legitimate locks. The spike's
|
|
51
|
+
* contention tests all passed under these settings.
|
|
54
52
|
*
|
|
55
53
|
* `realpath: false` is required when the saas root is symlinked
|
|
56
54
|
* (common with pnpm `dependenciesMeta.injected: true` workspaces).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lockfile-io.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"lockfile-io.d.ts","sourceRoot":"","sources":["../../../src/lockfile/lockfile-io.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAMH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,oBAAoB,EAE1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAA2C,KAAK,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE1G;;GAEG;AACH,eAAO,MAAM,6BAA6B,qCAAqC,CAAC;AAEhF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;CAIuB,CAAC;AAEzD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,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