@wildo-ai/platform-config-lib 1.1.10 → 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.
Files changed (396) hide show
  1. package/dist/esm/_unimplemented/soft-warn.d.ts +24 -49
  2. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
  3. package/dist/esm/_unimplemented/soft-warn.js +24 -49
  4. package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
  5. package/dist/esm/blueprint/anchored-region.d.ts +83 -0
  6. package/dist/esm/blueprint/anchored-region.d.ts.map +1 -0
  7. package/dist/esm/blueprint/anchored-region.js +263 -0
  8. package/dist/esm/blueprint/anchored-region.js.map +1 -0
  9. package/dist/esm/blueprint/blueprint.schemas.d.ts +600 -0
  10. package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -0
  11. package/dist/esm/blueprint/blueprint.schemas.js +638 -0
  12. package/dist/esm/blueprint/blueprint.schemas.js.map +1 -0
  13. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  14. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  15. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  16. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  17. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +13 -1
  18. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  19. package/dist/esm/bootstrap/bootstrap.contracts.js +6 -0
  20. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  21. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +29 -4
  22. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  23. package/dist/esm/bootstrap/bootstrap.schemas.js +29 -4
  24. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  25. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +131 -2
  26. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  27. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +139 -2
  28. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  29. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +21 -0
  30. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
  31. package/dist/esm/bootstrap/platform-store-preconnect.js +25 -0
  32. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
  33. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +80 -0
  34. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -0
  35. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +81 -0
  36. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -0
  37. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +41 -9
  38. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  39. package/dist/esm/bootstrap/runtime-backing-service-access.js +77 -28
  40. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  41. package/dist/esm/bootstrap/runtime-network-policy.d.ts +117 -12
  42. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  43. package/dist/esm/bootstrap/runtime-network-policy.js +222 -23
  44. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  45. package/dist/esm/bootstrap/runtime-network-topology.d.ts +31 -4
  46. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  47. package/dist/esm/bootstrap/runtime-network-topology.js +43 -2
  48. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  49. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  50. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +40 -2
  51. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  52. package/dist/esm/bootstrap/runtime-principal.contracts.js +66 -3
  53. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  54. package/dist/esm/bootstrap/runtime-response-integrity.d.ts +249 -0
  55. package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -0
  56. package/dist/esm/bootstrap/runtime-response-integrity.js +353 -0
  57. package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -0
  58. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts +32 -0
  59. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -0
  60. package/dist/esm/bootstrap/runtime-secret-env.contracts.js +43 -0
  61. package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -0
  62. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  63. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  64. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts +51 -0
  65. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -0
  66. package/dist/esm/canonical-json/rfc8785-canonical-json.js +231 -0
  67. package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -0
  68. package/dist/esm/config-authoring.entry.js.map +1 -1
  69. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  70. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  71. package/dist/esm/index.d.ts +20 -1
  72. package/dist/esm/index.d.ts.map +1 -1
  73. package/dist/esm/index.js +20 -1
  74. package/dist/esm/index.js.map +1 -1
  75. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts +119 -0
  76. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts.map +1 -0
  77. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js +109 -0
  78. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js.map +1 -0
  79. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts +182 -0
  80. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts.map +1 -0
  81. package/dist/esm/key-management/application-signing-key-rotation.contracts.js +145 -0
  82. package/dist/esm/key-management/application-signing-key-rotation.contracts.js.map +1 -0
  83. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts +156 -0
  84. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts.map +1 -0
  85. package/dist/esm/key-management/approval-seal-manifested-copy.js +617 -0
  86. package/dist/esm/key-management/approval-seal-manifested-copy.js.map +1 -0
  87. package/dist/esm/key-management/approval-seal-verifier.d.ts +278 -0
  88. package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -0
  89. package/dist/esm/key-management/approval-seal-verifier.js +355 -0
  90. package/dist/esm/key-management/approval-seal-verifier.js.map +1 -0
  91. package/dist/esm/key-management/approval-seal.contracts.d.ts +128 -0
  92. package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -0
  93. package/dist/esm/key-management/approval-seal.contracts.js +135 -0
  94. package/dist/esm/key-management/approval-seal.contracts.js.map +1 -0
  95. package/dist/esm/key-management/data-key.contracts.d.ts +106 -0
  96. package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -0
  97. package/dist/esm/key-management/data-key.contracts.js +54 -0
  98. package/dist/esm/key-management/data-key.contracts.js.map +1 -0
  99. package/dist/esm/key-management/es256-jws.d.ts +60 -0
  100. package/dist/esm/key-management/es256-jws.d.ts.map +1 -0
  101. package/dist/esm/key-management/es256-jws.js +135 -0
  102. package/dist/esm/key-management/es256-jws.js.map +1 -0
  103. package/dist/esm/key-management/key-provider.spi.d.ts +158 -0
  104. package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -0
  105. package/dist/esm/key-management/key-provider.spi.js +38 -0
  106. package/dist/esm/key-management/key-provider.spi.js.map +1 -0
  107. package/dist/esm/key-management/keyring-rotation.contracts.d.ts +83 -0
  108. package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -0
  109. package/dist/esm/key-management/keyring-rotation.contracts.js +101 -0
  110. package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -0
  111. package/dist/esm/key-management/keyring-status.contracts.d.ts +59 -0
  112. package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -0
  113. package/dist/esm/key-management/keyring-status.contracts.js +45 -0
  114. package/dist/esm/key-management/keyring-status.contracts.js.map +1 -0
  115. package/dist/esm/key-management/pdf-incremental-update.d.ts +158 -0
  116. package/dist/esm/key-management/pdf-incremental-update.d.ts.map +1 -0
  117. package/dist/esm/key-management/pdf-incremental-update.js +730 -0
  118. package/dist/esm/key-management/pdf-incremental-update.js.map +1 -0
  119. package/dist/esm/key-management/pdf-truetype-font.d.ts +35 -0
  120. package/dist/esm/key-management/pdf-truetype-font.d.ts.map +1 -0
  121. package/dist/esm/key-management/pdf-truetype-font.js +152 -0
  122. package/dist/esm/key-management/pdf-truetype-font.js.map +1 -0
  123. package/dist/esm/key-management/qr-code.d.ts +38 -0
  124. package/dist/esm/key-management/qr-code.d.ts.map +1 -0
  125. package/dist/esm/key-management/qr-code.js +325 -0
  126. package/dist/esm/key-management/qr-code.js.map +1 -0
  127. package/dist/esm/key-management/signature-request.contracts.d.ts +91 -0
  128. package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -0
  129. package/dist/esm/key-management/signature-request.contracts.js +96 -0
  130. package/dist/esm/key-management/signature-request.contracts.js.map +1 -0
  131. package/dist/esm/key-management/signing-log-export.contracts.d.ts +215 -0
  132. package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -0
  133. package/dist/esm/key-management/signing-log-export.contracts.js +268 -0
  134. package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -0
  135. package/dist/esm/key-management/vault-custody.contracts.d.ts +98 -0
  136. package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -0
  137. package/dist/esm/key-management/vault-custody.contracts.js +154 -0
  138. package/dist/esm/key-management/vault-custody.contracts.js.map +1 -0
  139. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  140. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  141. package/dist/esm/lockfile/canonical-json.d.ts +1 -1
  142. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  143. package/dist/esm/lockfile/canonical-json.js +1 -1
  144. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  145. package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
  146. package/dist/esm/lockfile/file-lock-hold.js +2 -1
  147. package/dist/esm/lockfile/file-lock-hold.js.map +1 -1
  148. package/dist/esm/lockfile/lockfile-io.d.ts +13 -17
  149. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  150. package/dist/esm/lockfile/lockfile-io.js +29 -30
  151. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  152. package/dist/esm/lockfile/materialize-infra-section.d.ts +22 -20
  153. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  154. package/dist/esm/lockfile/materialize-infra-section.js +13 -14
  155. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  156. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +27 -249
  157. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  158. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +28 -3
  159. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  160. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +146 -0
  161. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts.map +1 -0
  162. package/dist/esm/pnpm-settings/application-pnpm-settings.js +573 -0
  163. package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -0
  164. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
  165. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +22 -3
  166. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
  167. package/dist/esm/project-config/application-served-public-documents.loader.d.ts +26 -0
  168. package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -0
  169. package/dist/esm/project-config/application-served-public-documents.loader.js +86 -0
  170. package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -0
  171. package/dist/esm/project-config/backend-compliance-section.reader.d.ts +35 -0
  172. package/dist/esm/project-config/backend-compliance-section.reader.d.ts.map +1 -0
  173. package/dist/esm/project-config/backend-compliance-section.reader.js +123 -0
  174. package/dist/esm/project-config/backend-compliance-section.reader.js.map +1 -0
  175. package/dist/esm/project-config/backend-compliance-section.worker.d.ts +20 -0
  176. package/dist/esm/project-config/backend-compliance-section.worker.d.ts.map +1 -0
  177. package/dist/esm/project-config/backend-compliance-section.worker.js +78 -0
  178. package/dist/esm/project-config/backend-compliance-section.worker.js.map +1 -0
  179. package/dist/esm/project-config/config-module-resolution.d.ts +32 -0
  180. package/dist/esm/project-config/config-module-resolution.d.ts.map +1 -0
  181. package/dist/esm/project-config/config-module-resolution.js +33 -0
  182. package/dist/esm/project-config/config-module-resolution.js.map +1 -0
  183. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  184. package/dist/esm/project-config/define-infra-env-config.d.ts +344 -69
  185. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  186. package/dist/esm/project-config/define-infra-env-config.js +194 -143
  187. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  188. package/dist/esm/project-config/define-minion-config.d.ts +26 -36
  189. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  190. package/dist/esm/project-config/define-minion-config.js +64 -25
  191. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  192. package/dist/esm/project-config/define-saas-config.d.ts +82 -348
  193. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  194. package/dist/esm/project-config/define-saas-config.js +262 -103
  195. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  196. package/dist/esm/project-config/define-worker-config.d.ts +10 -20
  197. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  198. package/dist/esm/project-config/define-worker-config.js +10 -12
  199. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  200. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  201. package/dist/esm/project-config/hosted-infra-env-config.js +4 -1
  202. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  203. package/dist/esm/project-config/index.d.ts +5 -0
  204. package/dist/esm/project-config/index.d.ts.map +1 -1
  205. package/dist/esm/project-config/index.js +5 -0
  206. package/dist/esm/project-config/index.js.map +1 -1
  207. package/dist/esm/project-config/loader-instances-zod.d.ts +19 -0
  208. package/dist/esm/project-config/loader-instances-zod.d.ts.map +1 -0
  209. package/dist/esm/project-config/loader-instances-zod.js +40 -0
  210. package/dist/esm/project-config/loader-instances-zod.js.map +1 -0
  211. package/dist/esm/project-config/loader.d.ts +131 -14
  212. package/dist/esm/project-config/loader.d.ts.map +1 -1
  213. package/dist/esm/project-config/loader.js +226 -12
  214. package/dist/esm/project-config/loader.js.map +1 -1
  215. package/dist/esm/project-config/minion-liveness.contracts.d.ts +131 -0
  216. package/dist/esm/project-config/minion-liveness.contracts.d.ts.map +1 -0
  217. package/dist/esm/project-config/minion-liveness.contracts.js +167 -0
  218. package/dist/esm/project-config/minion-liveness.contracts.js.map +1 -0
  219. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  220. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  221. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
  222. package/dist/esm/project-config/npm-version-range.js +39 -16
  223. package/dist/esm/project-config/npm-version-range.js.map +1 -1
  224. package/dist/esm/project-config/owning-package-tsconfig.d.ts +15 -0
  225. package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -0
  226. package/dist/esm/project-config/owning-package-tsconfig.js +29 -0
  227. package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -0
  228. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  229. package/dist/esm/project-config/provider-companion-discovery.d.ts +4 -4
  230. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  231. package/dist/esm/project-config/provider-companion-discovery.js +16 -10
  232. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  233. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +103 -49
  234. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  235. package/dist/esm/project-config/provider-runtime-artifacts.js +216 -16
  236. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  237. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +0 -2
  238. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  239. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  240. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  241. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  242. package/dist/esm/project-config/shared/auth.schemas.d.ts +0 -17
  243. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  244. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  245. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
  246. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +9 -10
  247. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  248. package/dist/esm/project-config/shared/backing-services.schemas.js +13 -15
  249. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  250. package/dist/esm/project-config/shared/cdn.schemas.d.ts +0 -51
  251. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  252. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  253. package/dist/esm/project-config/shared/csp-defaults.d.ts +36 -9
  254. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  255. package/dist/esm/project-config/shared/csp-defaults.js +54 -11
  256. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  257. package/dist/esm/project-config/shared/csp-emit.d.ts +60 -13
  258. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  259. package/dist/esm/project-config/shared/csp-emit.js +77 -24
  260. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  261. package/dist/esm/project-config/shared/csp.schemas.d.ts +72 -85
  262. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  263. package/dist/esm/project-config/shared/csp.schemas.js +40 -13
  264. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  265. package/dist/esm/project-config/shared/data-services.schemas.d.ts +0 -8
  266. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  267. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  268. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  269. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  270. package/dist/esm/project-config/shared/environment.schemas.d.ts +101 -8
  271. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  272. package/dist/esm/project-config/shared/environment.schemas.js +128 -9
  273. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  274. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +10 -4
  275. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  276. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  277. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  278. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +2 -1
  279. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  280. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +4 -1
  281. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  282. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  283. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  284. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  285. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  286. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +24 -0
  287. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  288. package/dist/esm/project-config/shared/minion-resource-access.validation.js +25 -2
  289. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  290. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  291. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  292. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +276 -0
  293. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -0
  294. package/dist/esm/project-config/shared/platform-key-management.schemas.js +296 -0
  295. package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -0
  296. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  297. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +2 -2
  298. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  299. package/dist/esm/project-config/shared/platform-storage.schemas.js +16 -2
  300. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  301. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +21 -23
  302. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  303. package/dist/esm/project-config/shared/service-definitions.schemas.js +4 -5
  304. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  305. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +0 -18
  306. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  307. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  308. package/dist/esm/project-config/static-asset-import-noop.d.ts +20 -3
  309. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
  310. package/dist/esm/project-config/static-asset-import-noop.js +36 -20
  311. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
  312. package/dist/esm/registry/artifact-domain.schemas.d.ts +0 -5
  313. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  314. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  315. package/dist/esm/registry/digest.schemas.js.map +1 -1
  316. package/dist/esm/registry/index.d.ts +3 -3
  317. package/dist/esm/registry/index.d.ts.map +1 -1
  318. package/dist/esm/registry/index.js +3 -3
  319. package/dist/esm/registry/index.js.map +1 -1
  320. package/dist/esm/registry/local-checkout-source.d.ts +22 -2
  321. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
  322. package/dist/esm/registry/local-checkout-source.js +66 -3
  323. package/dist/esm/registry/local-checkout-source.js.map +1 -1
  324. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +11 -98
  325. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  326. package/dist/esm/registry/lockfile-modules-section.schemas.js +1 -2
  327. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  328. package/dist/esm/registry/module-artifact.schemas.d.ts +40 -17
  329. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  330. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  331. package/dist/esm/registry/module-manifest.schemas.d.ts +324 -74
  332. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  333. package/dist/esm/registry/module-manifest.schemas.js +377 -19
  334. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  335. package/dist/esm/registry/module-search.schemas.d.ts +2 -0
  336. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
  337. package/dist/esm/registry/module-search.schemas.js +14 -1
  338. package/dist/esm/registry/module-search.schemas.js.map +1 -1
  339. package/dist/esm/registry/registry-config.schemas.d.ts +0 -18
  340. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  341. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  342. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  343. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  344. package/dist/esm/registry/registry-errors.d.ts +103 -5
  345. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  346. package/dist/esm/registry/registry-errors.js +213 -6
  347. package/dist/esm/registry/registry-errors.js.map +1 -1
  348. package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
  349. package/dist/esm/registry/registry-section-schemas.constants.d.ts +5 -0
  350. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  351. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  352. package/dist/esm/registry/registry-url-resolution.d.ts +72 -0
  353. package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -0
  354. package/dist/esm/registry/registry-url-resolution.js +157 -0
  355. package/dist/esm/registry/registry-url-resolution.js.map +1 -0
  356. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  357. package/dist/esm/release/framework-release.constants.js.map +1 -1
  358. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  359. package/dist/esm/schemas/framework-secrets.schemas.d.ts +48 -0
  360. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  361. package/dist/esm/schemas/framework-secrets.schemas.js +53 -0
  362. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  363. package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
  364. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  365. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +1 -1
  366. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  367. package/dist/esm/schemas/platform-config.schemas.d.ts +2 -2
  368. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  369. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  370. package/dist/esm/workspace-scope/index.js.map +1 -1
  371. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  372. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  373. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  374. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  375. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  376. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  377. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  378. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  379. package/dist/tsconfig.build.tsbuildinfo +1 -1
  380. package/package.json +12 -12
  381. package/dist/esm/_unimplemented/index.d.ts +0 -3
  382. package/dist/esm/_unimplemented/index.d.ts.map +0 -1
  383. package/dist/esm/_unimplemented/index.js +0 -3
  384. package/dist/esm/_unimplemented/index.js.map +0 -1
  385. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +0 -137
  386. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +0 -1
  387. package/dist/esm/_unimplemented/unimplemented-field-warning.js +0 -153
  388. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +0 -1
  389. package/dist/esm/project-config/shared/cdn.example.d.ts +0 -14
  390. package/dist/esm/project-config/shared/cdn.example.d.ts.map +0 -1
  391. package/dist/esm/project-config/shared/cdn.example.js +0 -38
  392. package/dist/esm/project-config/shared/cdn.example.js.map +0 -1
  393. package/dist/esm/project-config/shared/schema-version.schemas.d.ts +0 -15
  394. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +0 -1
  395. package/dist/esm/project-config/shared/schema-version.schemas.js +0 -40
  396. package/dist/esm/project-config/shared/schema-version.schemas.js.map +0 -1
@@ -0,0 +1,276 @@
1
+ import { z } from 'zod';
2
+ import { BackingServiceSource } from './backing-services.schemas';
3
+ /** @wildo_source:part:start platform.config.platform-key-management facet:layer:platform facet:family:infra facet:audience:app-developer */
4
+ /**
5
+ * # Where the platform keeps the keys it holds for applications (#2933)
6
+ *
7
+ * apps-manager is the custodian of every platform-held key (approval seals, signature requests, and the wrapping keys
8
+ * of an application's sealed secrets, #2894). Without this block it
9
+ * seals them under its own key-encryption root (the LOCAL provider). With it, apps-manager also serves the
10
+ * `vault-transit` and `vault-kv` key providers, and an application's key binding may name one of them.
11
+ *
12
+ * This is a PLATFORM-tier declaration, like `platformStorage`: one apps-manager holds one Vault, whatever application
13
+ * an environment file belongs to. It is deliberately not a `backingServices` kind. A backing service is something an
14
+ * application runtime dials, with credentials minted per application; no application runtime ever reaches this Vault,
15
+ * and nothing is minted per application in it.
16
+ *
17
+ * - `{ vault: { source: 'self' } }` — the CLI renders a single-node OpenBao (the MPL-licensed Vault fork, API
18
+ * compatible for everything used) beside apps-manager, in docker compose and in Kubernetes. It unseals itself from a
19
+ * framework-managed key and configures itself on its first start: the Transit and KV mounts, the two least-privilege
20
+ * policies, and the two tokens apps-manager speaks with. Good for development and for a small self-hosted platform;
21
+ * its protection is SOFTWARE, as every Vault's is. Its self-initialization runs only on EMPTY storage, so an OpenBao
22
+ * first started before a policy changed keeps the older policy: one started before #2894 cannot wrap data keys
23
+ * (`transit/encrypt` and `transit/decrypt` answer 403) until the signer policy is written again (`bao policy write`
24
+ * with `vaultSignerPolicy`) or its storage is recreated.
25
+ * - `{ vault: { source: 'managed', address, … } }` — the operator's own Vault or OpenBao. The operator configures the
26
+ * mounts and policies (`vaultSignerPolicy` / `vaultOperatorPolicy` in the key-management contracts) and puts the two
27
+ * tokens in `secrets.json` under `platformKeyVaultManaged`.
28
+ *
29
+ * Absent, apps-manager serves no Vault provider, and a binding that names one is refused PROVIDER_UNAVAILABLE.
30
+ *
31
+ * ## Cloud KMS (#2896)
32
+ *
33
+ * `awsKms`, `googleCloudKms` and `azureKeyVault` make apps-manager serve the `aws-kms`, `google-cloud-kms` and
34
+ * `azure-key-vault` providers: the key is generated inside the vendor's HSM, never leaves it, and the vendor signs. They
35
+ * are always the operator's own account, so they carry no `source`. apps-manager authenticates with its WORKLOAD
36
+ * identity (an IAM role for its service account, GKE workload identity, an Azure managed identity): nothing here is a
37
+ * secret, and `secrets.json` holds nothing for them.
38
+ *
39
+ * Each provider acts as two identities, as Vault does with two tokens. The SIGNER may only read keys, sign, and wrap and
40
+ * unwrap data keys under a wrapping key (#2894); the OPERATOR creates, disables and destroys keys and may never sign, wrap
41
+ * or unwrap. Every wrap is authenticated encryption under a key only the vendor holds. Neither vendor's broad built-in role keeps to that, so
42
+ * grant, per vendor:
43
+ * - AWS: apps-manager's identity may only `sts:AssumeRole` the two roles. Every key apps-manager creates carries the tag
44
+ * `wildo:key-ref`, and the policies are scoped by it:
45
+ * - Signer, on `arn:aws:kms:<region>:<account>:key/*`: `kms:Sign`, `kms:Encrypt` and `kms:Decrypt` only where
46
+ * `aws:ResourceTag/wildo:key-ref` is present (`"Null": { … "false" }`), so it cannot sign with, or decrypt under,
47
+ * another key in the account; `kms:GetPublicKey` and `kms:DescribeKey` unconditioned (both read-only).
48
+ * - Operator: `kms:CreateKey` and `kms:TagResource` on `"Resource": "*"` (CreateKey names no key yet), only where
49
+ * `aws:RequestTag/wildo:key-ref` is present and `aws:TagKeys` is exactly `["wildo:key-ref"]`; on `key/*`,
50
+ * `kms:DisableKey` and `kms:ScheduleKeyDeletion` only where `aws:ResourceTag/wildo:key-ref` is present, and
51
+ * `kms:DescribeKey`; never `kms:Sign`, `kms:Encrypt`, `kms:Decrypt` nor `kms:UntagResource`.
52
+ * - The tag is what admits a key to the signer, so whoever may tag may admit: the operator's `kms:TagResource` lets it
53
+ * put `wildo:key-ref` on ANY key in the account, which the signer could then sign with. AWS warns of exactly this
54
+ * ("Be cautious about giving principals the `kms:TagResource` … permissions"). Keep the operator role to apps-manager
55
+ * alone, and consider a permissions boundary or SCP denying `kms:TagResource` on keys outside the custodian's.
56
+ * - KMS applies a tag to authorization up to five minutes after it is set, so a NEW version may be refused `kms:Sign`
57
+ * for those minutes: the first ACTIVE version of every new keyring (made at its first signature request), and one
58
+ * made by an emergency rotation. The signature fails as a provider fault and the caller retries it; so does the first
59
+ * wrap under a new wrapping key, which the application's data-key ring asks for again on its own retry.
60
+ * - Google: apps-manager's identity holds `roles/iam.serviceAccountTokenCreator` on the two service accounts only.
61
+ * Signer: `roles/cloudkms.signer`, `roles/cloudkms.cryptoKeyEncrypterDecrypter`, `roles/cloudkms.publicKeyViewer` and
62
+ * `roles/cloudkms.viewer` on the key ring (sign, wrap and unwrap data keys, read the public key, read a version's state). Operator: `roles/cloudkms.admin` on the key ring, which contains no
63
+ * cryptographic operation.
64
+ * - Azure Key Vault (a vault in the Azure RBAC permission model): two user-assigned managed identities on apps-manager,
65
+ * each with a CUSTOM role on the vault. The built-in roles do not fit: "Key Vault Crypto User" can update and back up a
66
+ * key, and "Key Vault Crypto Officer" holds `vaults/keys/*`, signing included.
67
+ * - Signer: `Microsoft.KeyVault/vaults/keys/read`, `…/keys/versions/read`, `…/keys/sign/action`,
68
+ * `…/keys/encrypt/action`, `…/keys/decrypt/action` (a data key is wrapped with A256GCM under an `oct-HSM` key, which
69
+ * a Premium vault offers in preview; a Standard vault cannot hold one and serves signing only).
70
+ * - Operator: `…/keys/read`, `…/keys/versions/read`, `…/keys/create/action`, `…/keys/update/action` (disable),
71
+ * `…/keys/delete`, `…/keys/purge/action`.
72
+ * The vault's recovery level decides whether a destroyed key is purged at once or kept until retention ends.
73
+ * - Azure Managed HSM (`*.managedhsm.azure.net`): the same two identities, with custom roles in the HSM's LOCAL RBAC
74
+ * (the built-in "Managed HSM Crypto User" can sign and back up, and cannot purge). Signer:
75
+ * `Microsoft.KeyVault/managedHsm/keys/read/action`, `…/keys/sign/action`, `…/keys/encrypt/action`, `…/keys/decrypt/action`.
76
+ * Operator: `…/keys/read/action`,
77
+ * `…/keys/create`, `…/keys/write/action`, `…/keys/delete`, `…/keys/deletedKeys/read/action`,
78
+ * `…/keys/deletedKeys/delete` (purge).
79
+ *
80
+ * spec-cite: AWS KMS developer guide, "Use tags to control access to KMS keys" (`aws:ResourceTag`, the five-minute
81
+ * delay, limiting `kms:TagResource` with `aws:RequestTag` / `aws:TagKeys`),
82
+ * https://docs.aws.amazon.com/kms/latest/developerguide/tag-authorization.html; AWS KMS permissions reference
83
+ * (`CreateKey`'s resource is `*`), https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html; Azure built-in roles, Security (Key
84
+ * Vault Crypto Officer DataActions `Microsoft.KeyVault/vaults/keys/*`) and Azure permissions, Microsoft.KeyVault (the
85
+ * `vaults/keys/*` data actions), https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles/security;
86
+ * Managed HSM local RBAC built-in roles (the data-action table),
87
+ * https://learn.microsoft.com/en-us/azure/key-vault/managed-hsm/built-in-roles.
88
+ *
89
+ * When a provider registers at startup, apps-manager logs the vendor's quota and per-request cost. It also holds its own
90
+ * signing under 80% of the vendor's per-second quota, per process.
91
+ *
92
+ * ## Corroboration
93
+ *
94
+ * Every ten minutes, apps-manager compares, per key version and closed hour, the signatures its signing log records with
95
+ * the ones the vendor's own audit log records, and writes one audit row per provider and hour:
96
+ * - UNACCOUNTED (CRITICAL) the moment the vendor shows more signatures than apps-manager can account for: a key was used
97
+ * outside the custodian, or a signature went unrecorded;
98
+ * - otherwise, once the hour is six hours old (vendor logs arrive late): UNCORROBORATED (the vendor recorded fewer, or its
99
+ * log could not be read) or CORROBORATED.
100
+ * It reads as the OPERATOR identity, which therefore also needs:
101
+ * - AWS: `cloudtrail:LookupEvents` (KMS `Sign` is a CloudTrail management event; nothing to enable).
102
+ * - Google: `roles/logging.privateLogViewer` on the project, and Cloud KMS Data Access audit logs ENABLED (they are off by
103
+ * default, and until they are on, every hour is uncorroborated).
104
+ * - Azure: Log Analytics Reader on the workspace named by `logAnalyticsWorkspaceId`, which the vault's diagnostic setting
105
+ * sends `AuditEvent` to.
106
+ */
107
+ export declare const PlatformKeyVaultSelfHostedSchema: z.ZodObject<{
108
+ source: z.ZodLiteral<BackingServiceSource.SELF>;
109
+ }, z.core.$strict>;
110
+ /** The operator's own Vault or OpenBao. Mounts and prefix default to the provider defaults (`transit`, `secret`, `wildo-`). */
111
+ export declare const PlatformKeyVaultManagedSchema: z.ZodObject<{
112
+ source: z.ZodLiteral<BackingServiceSource.MANAGED>;
113
+ address: z.ZodURL;
114
+ namespace: z.ZodOptional<z.ZodString>;
115
+ transitMount: z.ZodOptional<z.ZodString>;
116
+ kvMount: z.ZodOptional<z.ZodString>;
117
+ keyNamePrefix: z.ZodOptional<z.ZodString>;
118
+ }, z.core.$strict>;
119
+ export declare const PlatformKeyVaultConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
120
+ source: z.ZodLiteral<BackingServiceSource.SELF>;
121
+ }, z.core.$strict>, z.ZodObject<{
122
+ source: z.ZodLiteral<BackingServiceSource.MANAGED>;
123
+ address: z.ZodURL;
124
+ namespace: z.ZodOptional<z.ZodString>;
125
+ transitMount: z.ZodOptional<z.ZodString>;
126
+ kvMount: z.ZodOptional<z.ZodString>;
127
+ keyNamePrefix: z.ZodOptional<z.ZodString>;
128
+ }, z.core.$strict>], "source">;
129
+ export type PlatformKeyVaultConfig = z.infer<typeof PlatformKeyVaultConfigSchema>;
130
+ /** The protection level apps-manager creates Google Cloud KMS keys at. */
131
+ export declare enum PlatformGoogleKmsKeyProtection {
132
+ /** In Cloud HSM (FIPS 140-2 Level 3): the key's attestation is HARDWARE. */
133
+ HSM = "HSM",
134
+ /** In Cloud KMS software: the key's attestation is SOFTWARE, and a HARDWARE floor refuses it. */
135
+ SOFTWARE = "SOFTWARE"
136
+ }
137
+ /** AWS KMS in the operator's account. */
138
+ export declare const PlatformKeyAwsKmsConfigSchema: z.ZodObject<{
139
+ region: z.ZodString;
140
+ signerRoleArn: z.ZodString;
141
+ operatorRoleArn: z.ZodString;
142
+ endpoint: z.ZodOptional<z.ZodURL>;
143
+ }, z.core.$strict>;
144
+ /** Google Cloud KMS in the operator's project. */
145
+ export declare const PlatformKeyGoogleCloudKmsConfigSchema: z.ZodObject<{
146
+ keyRing: z.ZodString;
147
+ signerServiceAccount: z.ZodEmail;
148
+ operatorServiceAccount: z.ZodEmail;
149
+ protectionLevel: z.ZodDefault<z.ZodEnum<typeof PlatformGoogleKmsKeyProtection>>;
150
+ }, z.core.$strict>;
151
+ /** Azure Key Vault (Premium) or Managed HSM in the operator's subscription. */
152
+ export declare const PlatformKeyAzureKeyVaultConfigSchema: z.ZodObject<{
153
+ vaultUrl: z.ZodURL;
154
+ signerClientId: z.ZodUUID;
155
+ operatorClientId: z.ZodUUID;
156
+ hsm: z.ZodDefault<z.ZodBoolean>;
157
+ logAnalyticsWorkspaceId: z.ZodOptional<z.ZodUUID>;
158
+ }, z.core.$strict>;
159
+ /** The SoftHSM2 module the platform image carries: the one PKCS#11 module a containerised apps-manager has without a mount. */
160
+ export declare const PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH = "/usr/lib/softhsm/libsofthsm2.so";
161
+ /**
162
+ * One file or directory of the HSM vendor's PKCS#11 client, mounted READ-ONLY into apps-manager's container (#3019): the
163
+ * module, its configuration, the client certificates. `hostPath` is on the docker host (compose) or on every node that
164
+ * may run apps-manager (Kubernetes, a `hostPath` volume); `containerPath` is where apps-manager sees it.
165
+ */
166
+ export declare const PlatformKeyPkcs11ClientFileSchema: z.ZodObject<{
167
+ hostPath: z.ZodString;
168
+ containerPath: z.ZodString;
169
+ }, z.core.$strict>;
170
+ export type PlatformKeyPkcs11ClientFile = z.infer<typeof PlatformKeyPkcs11ClientFileSchema>;
171
+ /**
172
+ * A dedicated HSM reached over PKCS#11 (#2934): Thales Luna, Entrust nShield, AWS CloudHSM, Azure Cloud HSM, an
173
+ * on-premises appliance, or SoftHSM2. apps-manager loads the vendor's PKCS#11 module, logs in to one token with a user PIN
174
+ * (operator-typed in `secrets.json` under `platformKeyPkcs11: { pin }`, never here) and serves the `pkcs11` provider.
175
+ *
176
+ * Protection is read from the token, not declared: a key counts as HARDWARE only when the slot reports a hardware slot
177
+ * AND the token's model is listed in `hardwareTokenModels`, which is your statement that this model is the hardware you
178
+ * run. SoftHSM2 is always SOFTWARE. The binding (`pkcs11js`) is compiled by `pnpm setup:pkcs11`; an apps-manager that
179
+ * cannot load it says so at boot and refuses every signature on this provider.
180
+ *
181
+ * ## A real HSM in a containerised platform (#3019)
182
+ *
183
+ * The platform image carries only SoftHSM2. A real HSM's client comes from the host, and every vendor documents the same
184
+ * containerised shape: mount the client library and its configuration READ-ONLY, and point the client at its
185
+ * configuration with the vendor's own variable. So:
186
+ * - `clientFiles` lists what to mount, each `{ hostPath, containerPath }`. compose renders a read-only bind mount and refuses
187
+ * to start the service when the host path is missing; Kubernetes renders a read-only `hostPath` volume, which it mounts
188
+ * unchecked, so the files must exist on every node that may run apps-manager (a missing one shows as a token that cannot
189
+ * be opened, logged at boot). Both apps-manager services get them (INIT and serving).
190
+ * - `environment` carries the vendor's variables (`ChrystokiConfigurationPath` for a Thales Luna client, …). It is
191
+ * rendered in plain text beside the service, so it may hold paths and settings, never a credential; it may not name a
192
+ * variable Wildo sets itself. The token PIN stays in `secrets.json`.
193
+ * - In a container, `modulePath` must be the bundled SoftHSM2 or lie under a `containerPath`. Declaring `clientFiles` says
194
+ * apps-manager runs in a container, so that is refused here; without `clientFiles` it is refused when compose or
195
+ * Kubernetes renders apps-manager, because a framework developer's NATIVE apps-manager loads a host path legitimately
196
+ * (Homebrew's SoftHSM2, `/opt/homebrew/lib/softhsm/libsofthsm2.so`).
197
+ * - Both are for the CONTAINER lanes. A framework developer's native apps-manager runs on the host, where the client is
198
+ * installed and configured as the vendor documents, and receives neither.
199
+ *
200
+ * Example, a Thales Luna client installed under `/usr/safenet/lunaclient` on the host:
201
+ * `{ modulePath: '/usr/safenet/lunaclient/lib/libCryptoki2_64.so', tokenLabel: 'wildo', hardwareTokenModels: ['Luna K7'],
202
+ * clientFiles: [{ hostPath: '/usr/safenet/lunaclient', containerPath: '/usr/safenet/lunaclient' },
203
+ * { hostPath: '/etc/Chrystoki.conf', containerPath: '/etc/Chrystoki.conf' }],
204
+ * environment: { ChrystokiConfigurationPath: '/etc' } }`.
205
+ */
206
+ export declare const PlatformKeyPkcs11ConfigSchema: z.ZodObject<{
207
+ modulePath: z.ZodString;
208
+ tokenLabel: z.ZodString;
209
+ hardwareTokenModels: z.ZodDefault<z.ZodArray<z.ZodString>>;
210
+ clientFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
211
+ hostPath: z.ZodString;
212
+ containerPath: z.ZodString;
213
+ }, z.core.$strict>>>;
214
+ environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
215
+ }, z.core.$strict>;
216
+ export type PlatformKeyPkcs11Config = z.infer<typeof PlatformKeyPkcs11ConfigSchema>;
217
+ export declare const WildoPlatformKeyManagementConfigSchema: z.ZodObject<{
218
+ vault: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
219
+ source: z.ZodLiteral<BackingServiceSource.SELF>;
220
+ }, z.core.$strict>, z.ZodObject<{
221
+ source: z.ZodLiteral<BackingServiceSource.MANAGED>;
222
+ address: z.ZodURL;
223
+ namespace: z.ZodOptional<z.ZodString>;
224
+ transitMount: z.ZodOptional<z.ZodString>;
225
+ kvMount: z.ZodOptional<z.ZodString>;
226
+ keyNamePrefix: z.ZodOptional<z.ZodString>;
227
+ }, z.core.$strict>], "source">>;
228
+ awsKms: z.ZodOptional<z.ZodObject<{
229
+ region: z.ZodString;
230
+ signerRoleArn: z.ZodString;
231
+ operatorRoleArn: z.ZodString;
232
+ endpoint: z.ZodOptional<z.ZodURL>;
233
+ }, z.core.$strict>>;
234
+ googleCloudKms: z.ZodOptional<z.ZodObject<{
235
+ keyRing: z.ZodString;
236
+ signerServiceAccount: z.ZodEmail;
237
+ operatorServiceAccount: z.ZodEmail;
238
+ protectionLevel: z.ZodDefault<z.ZodEnum<typeof PlatformGoogleKmsKeyProtection>>;
239
+ }, z.core.$strict>>;
240
+ azureKeyVault: z.ZodOptional<z.ZodObject<{
241
+ vaultUrl: z.ZodURL;
242
+ signerClientId: z.ZodUUID;
243
+ operatorClientId: z.ZodUUID;
244
+ hsm: z.ZodDefault<z.ZodBoolean>;
245
+ logAnalyticsWorkspaceId: z.ZodOptional<z.ZodUUID>;
246
+ }, z.core.$strict>>;
247
+ pkcs11: z.ZodOptional<z.ZodObject<{
248
+ modulePath: z.ZodString;
249
+ tokenLabel: z.ZodString;
250
+ hardwareTokenModels: z.ZodDefault<z.ZodArray<z.ZodString>>;
251
+ clientFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
252
+ hostPath: z.ZodString;
253
+ containerPath: z.ZodString;
254
+ }, z.core.$strict>>>;
255
+ environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
256
+ }, z.core.$strict>>;
257
+ }, z.core.$strict>;
258
+ export type WildoPlatformKeyManagementConfig = z.infer<typeof WildoPlatformKeyManagementConfigSchema>;
259
+ /** @wildo_source:part:end platform.config.platform-key-management */
260
+ /** What deciding a module's reachability needs: the module, and where the client files are mounted. */
261
+ export interface Pkcs11ModuleMountView {
262
+ readonly modulePath: string;
263
+ readonly clientFiles?: readonly {
264
+ readonly containerPath: string;
265
+ }[];
266
+ }
267
+ /**
268
+ * Whether apps-manager, running in the PLATFORM IMAGE, can load `modulePath`: it is the bundled SoftHSM2, or it lies at or
269
+ * under one of the declared `clientFiles[].containerPath`. Nothing else exists in that container.
270
+ */
271
+ export declare function pkcs11ModuleIsReachableInPlatformContainer(pkcs11: Pkcs11ModuleMountView): boolean;
272
+ /** The refusal both container lanes (compose, Kubernetes) raise for an unreachable module, naming the declaration. */
273
+ export declare function describeUnreachablePkcs11Module(pkcs11: Pkcs11ModuleMountView, environmentName?: string): string;
274
+ /** Whether the platform runs its own Vault (OpenBao) in this environment: the one predicate both lanes render from. */
275
+ export declare function selfHostsPlatformKeyVault(platformKeyManagement: WildoPlatformKeyManagementConfig | undefined): boolean;
276
+ //# sourceMappingURL=platform-key-management.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-key-management.schemas.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/platform-key-management.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,4IAA4I;AAC5I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGG;AACH,eAAO,MAAM,gCAAgC;;kBAE3C,CAAC;AAEH,+HAA+H;AAC/H,eAAO,MAAM,6BAA6B;;;;;;;kBASxC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;8BAAoG,CAAC;AAC9I,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,0EAA0E;AAC1E,oBAAY,8BAA8B;IACxC,4EAA4E;IAC5E,GAAG,QAAQ;IACX,iGAAiG;IACjG,QAAQ,aAAa;CACtB;AAED,yCAAyC;AACzC,eAAO,MAAM,6BAA6B;;;;;kBAQxC,CAAC;AAEH,kDAAkD;AAClD,eAAO,MAAM,qCAAqC;;;;;kBAMhD,CAAC;AAEH,+EAA+E;AAC/E,eAAO,MAAM,oCAAoC;;;;;;kBAc/C,CAAC;AAEH,+HAA+H;AAC/H,eAAO,MAAM,yCAAyC,oCAAoC,CAAC;AAW3F;;;;GAIG;AACH,eAAO,MAAM,iCAAiC;;;kBAM5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;kBA+BtC,CAAC;AACL,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAMjD,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC;AAEtG,qEAAqE;AAErE,uGAAuG;AACvG,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS;QAAE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACtE;AAiBD;;;GAGG;AACH,wBAAgB,0CAA0C,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAMjG;AAED,sHAAsH;AACtH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,qBAAqB,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAO/G;AAED,uHAAuH;AACvH,wBAAgB,yBAAyB,CAAC,qBAAqB,EAAE,gCAAgC,GAAG,SAAS,GAAG,OAAO,CAEtH"}
@@ -0,0 +1,296 @@
1
+ import { z } from 'zod';
2
+ import { PlatformAdminEnvKey, PlatformDocumentationSiteEnvKey, PlatformEmailEnvKey, PlatformInfrastructureEnvKey, PlatformIngressEnvKey, PlatformKubernetesEnvKey, PlatformLoggingEnvKey, PlatformObservabilityEnvKey, PlatformOwnershipDnsEnvKey, PlatformProcessEnvKey, PlatformProviderSelectionEnvKey, PlatformSecurityEnvKey, PlatformServiceUrlEnvKey, } from '../../bootstrap/platform-runtime-env.contracts.js';
3
+ import { BackingServiceSource } from './backing-services.schemas.js';
4
+ /** @wildo_source:part:start platform.config.platform-key-management facet:layer:platform facet:family:infra facet:audience:app-developer */
5
+ /**
6
+ * # Where the platform keeps the keys it holds for applications (#2933)
7
+ *
8
+ * apps-manager is the custodian of every platform-held key (approval seals, signature requests, and the wrapping keys
9
+ * of an application's sealed secrets, #2894). Without this block it
10
+ * seals them under its own key-encryption root (the LOCAL provider). With it, apps-manager also serves the
11
+ * `vault-transit` and `vault-kv` key providers, and an application's key binding may name one of them.
12
+ *
13
+ * This is a PLATFORM-tier declaration, like `platformStorage`: one apps-manager holds one Vault, whatever application
14
+ * an environment file belongs to. It is deliberately not a `backingServices` kind. A backing service is something an
15
+ * application runtime dials, with credentials minted per application; no application runtime ever reaches this Vault,
16
+ * and nothing is minted per application in it.
17
+ *
18
+ * - `{ vault: { source: 'self' } }` — the CLI renders a single-node OpenBao (the MPL-licensed Vault fork, API
19
+ * compatible for everything used) beside apps-manager, in docker compose and in Kubernetes. It unseals itself from a
20
+ * framework-managed key and configures itself on its first start: the Transit and KV mounts, the two least-privilege
21
+ * policies, and the two tokens apps-manager speaks with. Good for development and for a small self-hosted platform;
22
+ * its protection is SOFTWARE, as every Vault's is. Its self-initialization runs only on EMPTY storage, so an OpenBao
23
+ * first started before a policy changed keeps the older policy: one started before #2894 cannot wrap data keys
24
+ * (`transit/encrypt` and `transit/decrypt` answer 403) until the signer policy is written again (`bao policy write`
25
+ * with `vaultSignerPolicy`) or its storage is recreated.
26
+ * - `{ vault: { source: 'managed', address, … } }` — the operator's own Vault or OpenBao. The operator configures the
27
+ * mounts and policies (`vaultSignerPolicy` / `vaultOperatorPolicy` in the key-management contracts) and puts the two
28
+ * tokens in `secrets.json` under `platformKeyVaultManaged`.
29
+ *
30
+ * Absent, apps-manager serves no Vault provider, and a binding that names one is refused PROVIDER_UNAVAILABLE.
31
+ *
32
+ * ## Cloud KMS (#2896)
33
+ *
34
+ * `awsKms`, `googleCloudKms` and `azureKeyVault` make apps-manager serve the `aws-kms`, `google-cloud-kms` and
35
+ * `azure-key-vault` providers: the key is generated inside the vendor's HSM, never leaves it, and the vendor signs. They
36
+ * are always the operator's own account, so they carry no `source`. apps-manager authenticates with its WORKLOAD
37
+ * identity (an IAM role for its service account, GKE workload identity, an Azure managed identity): nothing here is a
38
+ * secret, and `secrets.json` holds nothing for them.
39
+ *
40
+ * Each provider acts as two identities, as Vault does with two tokens. The SIGNER may only read keys, sign, and wrap and
41
+ * unwrap data keys under a wrapping key (#2894); the OPERATOR creates, disables and destroys keys and may never sign, wrap
42
+ * or unwrap. Every wrap is authenticated encryption under a key only the vendor holds. Neither vendor's broad built-in role keeps to that, so
43
+ * grant, per vendor:
44
+ * - AWS: apps-manager's identity may only `sts:AssumeRole` the two roles. Every key apps-manager creates carries the tag
45
+ * `wildo:key-ref`, and the policies are scoped by it:
46
+ * - Signer, on `arn:aws:kms:<region>:<account>:key/*`: `kms:Sign`, `kms:Encrypt` and `kms:Decrypt` only where
47
+ * `aws:ResourceTag/wildo:key-ref` is present (`"Null": { … "false" }`), so it cannot sign with, or decrypt under,
48
+ * another key in the account; `kms:GetPublicKey` and `kms:DescribeKey` unconditioned (both read-only).
49
+ * - Operator: `kms:CreateKey` and `kms:TagResource` on `"Resource": "*"` (CreateKey names no key yet), only where
50
+ * `aws:RequestTag/wildo:key-ref` is present and `aws:TagKeys` is exactly `["wildo:key-ref"]`; on `key/*`,
51
+ * `kms:DisableKey` and `kms:ScheduleKeyDeletion` only where `aws:ResourceTag/wildo:key-ref` is present, and
52
+ * `kms:DescribeKey`; never `kms:Sign`, `kms:Encrypt`, `kms:Decrypt` nor `kms:UntagResource`.
53
+ * - The tag is what admits a key to the signer, so whoever may tag may admit: the operator's `kms:TagResource` lets it
54
+ * put `wildo:key-ref` on ANY key in the account, which the signer could then sign with. AWS warns of exactly this
55
+ * ("Be cautious about giving principals the `kms:TagResource` … permissions"). Keep the operator role to apps-manager
56
+ * alone, and consider a permissions boundary or SCP denying `kms:TagResource` on keys outside the custodian's.
57
+ * - KMS applies a tag to authorization up to five minutes after it is set, so a NEW version may be refused `kms:Sign`
58
+ * for those minutes: the first ACTIVE version of every new keyring (made at its first signature request), and one
59
+ * made by an emergency rotation. The signature fails as a provider fault and the caller retries it; so does the first
60
+ * wrap under a new wrapping key, which the application's data-key ring asks for again on its own retry.
61
+ * - Google: apps-manager's identity holds `roles/iam.serviceAccountTokenCreator` on the two service accounts only.
62
+ * Signer: `roles/cloudkms.signer`, `roles/cloudkms.cryptoKeyEncrypterDecrypter`, `roles/cloudkms.publicKeyViewer` and
63
+ * `roles/cloudkms.viewer` on the key ring (sign, wrap and unwrap data keys, read the public key, read a version's state). Operator: `roles/cloudkms.admin` on the key ring, which contains no
64
+ * cryptographic operation.
65
+ * - Azure Key Vault (a vault in the Azure RBAC permission model): two user-assigned managed identities on apps-manager,
66
+ * each with a CUSTOM role on the vault. The built-in roles do not fit: "Key Vault Crypto User" can update and back up a
67
+ * key, and "Key Vault Crypto Officer" holds `vaults/keys/*`, signing included.
68
+ * - Signer: `Microsoft.KeyVault/vaults/keys/read`, `…/keys/versions/read`, `…/keys/sign/action`,
69
+ * `…/keys/encrypt/action`, `…/keys/decrypt/action` (a data key is wrapped with A256GCM under an `oct-HSM` key, which
70
+ * a Premium vault offers in preview; a Standard vault cannot hold one and serves signing only).
71
+ * - Operator: `…/keys/read`, `…/keys/versions/read`, `…/keys/create/action`, `…/keys/update/action` (disable),
72
+ * `…/keys/delete`, `…/keys/purge/action`.
73
+ * The vault's recovery level decides whether a destroyed key is purged at once or kept until retention ends.
74
+ * - Azure Managed HSM (`*.managedhsm.azure.net`): the same two identities, with custom roles in the HSM's LOCAL RBAC
75
+ * (the built-in "Managed HSM Crypto User" can sign and back up, and cannot purge). Signer:
76
+ * `Microsoft.KeyVault/managedHsm/keys/read/action`, `…/keys/sign/action`, `…/keys/encrypt/action`, `…/keys/decrypt/action`.
77
+ * Operator: `…/keys/read/action`,
78
+ * `…/keys/create`, `…/keys/write/action`, `…/keys/delete`, `…/keys/deletedKeys/read/action`,
79
+ * `…/keys/deletedKeys/delete` (purge).
80
+ *
81
+ * spec-cite: AWS KMS developer guide, "Use tags to control access to KMS keys" (`aws:ResourceTag`, the five-minute
82
+ * delay, limiting `kms:TagResource` with `aws:RequestTag` / `aws:TagKeys`),
83
+ * https://docs.aws.amazon.com/kms/latest/developerguide/tag-authorization.html; AWS KMS permissions reference
84
+ * (`CreateKey`'s resource is `*`), https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html; Azure built-in roles, Security (Key
85
+ * Vault Crypto Officer DataActions `Microsoft.KeyVault/vaults/keys/*`) and Azure permissions, Microsoft.KeyVault (the
86
+ * `vaults/keys/*` data actions), https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles/security;
87
+ * Managed HSM local RBAC built-in roles (the data-action table),
88
+ * https://learn.microsoft.com/en-us/azure/key-vault/managed-hsm/built-in-roles.
89
+ *
90
+ * When a provider registers at startup, apps-manager logs the vendor's quota and per-request cost. It also holds its own
91
+ * signing under 80% of the vendor's per-second quota, per process.
92
+ *
93
+ * ## Corroboration
94
+ *
95
+ * Every ten minutes, apps-manager compares, per key version and closed hour, the signatures its signing log records with
96
+ * the ones the vendor's own audit log records, and writes one audit row per provider and hour:
97
+ * - UNACCOUNTED (CRITICAL) the moment the vendor shows more signatures than apps-manager can account for: a key was used
98
+ * outside the custodian, or a signature went unrecorded;
99
+ * - otherwise, once the hour is six hours old (vendor logs arrive late): UNCORROBORATED (the vendor recorded fewer, or its
100
+ * log could not be read) or CORROBORATED.
101
+ * It reads as the OPERATOR identity, which therefore also needs:
102
+ * - AWS: `cloudtrail:LookupEvents` (KMS `Sign` is a CloudTrail management event; nothing to enable).
103
+ * - Google: `roles/logging.privateLogViewer` on the project, and Cloud KMS Data Access audit logs ENABLED (they are off by
104
+ * default, and until they are on, every hour is uncorroborated).
105
+ * - Azure: Log Analytics Reader on the workspace named by `logAnalyticsWorkspaceId`, which the vault's diagnostic setting
106
+ * sends `AuditEvent` to.
107
+ */
108
+ export const PlatformKeyVaultSelfHostedSchema = z.strictObject({
109
+ source: z.literal(BackingServiceSource.SELF),
110
+ });
111
+ /** The operator's own Vault or OpenBao. Mounts and prefix default to the provider defaults (`transit`, `secret`, `wildo-`). */
112
+ export const PlatformKeyVaultManagedSchema = z.strictObject({
113
+ source: z.literal(BackingServiceSource.MANAGED),
114
+ /** The Vault API address apps-manager dials, e.g. `https://vault.internal:8200`. */
115
+ address: z.url(),
116
+ /** Vault Enterprise namespace (`team/keys/`); absent on open-source Vault and OpenBao's root namespace. */
117
+ namespace: z.string().min(1).optional(),
118
+ transitMount: z.string().min(1).optional(),
119
+ kvMount: z.string().min(1).optional(),
120
+ keyNamePrefix: z.string().min(1).optional(),
121
+ });
122
+ export const PlatformKeyVaultConfigSchema = z.discriminatedUnion('source', [PlatformKeyVaultSelfHostedSchema, PlatformKeyVaultManagedSchema]);
123
+ /** The protection level apps-manager creates Google Cloud KMS keys at. */
124
+ export var PlatformGoogleKmsKeyProtection;
125
+ (function (PlatformGoogleKmsKeyProtection) {
126
+ /** In Cloud HSM (FIPS 140-2 Level 3): the key's attestation is HARDWARE. */
127
+ PlatformGoogleKmsKeyProtection["HSM"] = "HSM";
128
+ /** In Cloud KMS software: the key's attestation is SOFTWARE, and a HARDWARE floor refuses it. */
129
+ PlatformGoogleKmsKeyProtection["SOFTWARE"] = "SOFTWARE";
130
+ })(PlatformGoogleKmsKeyProtection || (PlatformGoogleKmsKeyProtection = {}));
131
+ /** AWS KMS in the operator's account. */
132
+ export const PlatformKeyAwsKmsConfigSchema = z.strictObject({
133
+ region: z.string().regex(/^[a-z]{2}(-[a-z]+)+-\d$/),
134
+ /** The role apps-manager assumes to read keys and sign. */
135
+ signerRoleArn: z.string().regex(/^arn:aws[a-z-]*:iam::\d{12}:role\/.+$/),
136
+ /** The role apps-manager assumes to create, disable and schedule the deletion of keys. */
137
+ operatorRoleArn: z.string().regex(/^arn:aws[a-z-]*:iam::\d{12}:role\/.+$/),
138
+ /** A KMS endpoint other than the region's public one (a VPC interface endpoint). */
139
+ endpoint: z.url().optional(),
140
+ });
141
+ /** Google Cloud KMS in the operator's project. */
142
+ export const PlatformKeyGoogleCloudKmsConfigSchema = z.strictObject({
143
+ /** `projects/<project>/locations/<location>/keyRings/<ring>`; created by the operator, since a key ring cannot be deleted. */
144
+ keyRing: z.string().regex(/^projects\/[^/]+\/locations\/[^/]+\/keyRings\/[^/]+$/),
145
+ signerServiceAccount: z.email(),
146
+ operatorServiceAccount: z.email(),
147
+ protectionLevel: z.enum(PlatformGoogleKmsKeyProtection).default(PlatformGoogleKmsKeyProtection.HSM),
148
+ });
149
+ /** Azure Key Vault (Premium) or Managed HSM in the operator's subscription. */
150
+ export const PlatformKeyAzureKeyVaultConfigSchema = z.strictObject({
151
+ /** `https://<vault>.vault.azure.net` or `https://<hsm>.managedhsm.azure.net`. */
152
+ vaultUrl: z.url(),
153
+ /** The client id of the signer's user-assigned managed identity. */
154
+ signerClientId: z.uuid(),
155
+ /** The client id of the operator's user-assigned managed identity. */
156
+ operatorClientId: z.uuid(),
157
+ /** HSM-protected keys (`EC-HSM`, a Premium vault or Managed HSM); `false` makes software `EC` keys. */
158
+ hsm: z.boolean().default(true),
159
+ /**
160
+ * The Log Analytics workspace (its GUID) the vault's diagnostic setting sends `AuditEvent` to, in the `AzureDiagnostics`
161
+ * destination mode. apps-manager reads it hourly to corroborate its signatures; absent, no Azure hour is compared.
162
+ */
163
+ logAnalyticsWorkspaceId: z.uuid().optional(),
164
+ });
165
+ /** The SoftHSM2 module the platform image carries: the one PKCS#11 module a containerised apps-manager has without a mount. */
166
+ export const PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH = '/usr/lib/softhsm/libsofthsm2.so';
167
+ /** An absolute path with no `.` or `..` segment, so "is this path inside that mount" is a plain prefix question. */
168
+ const AbsoluteNormalPathSchema = z
169
+ .string()
170
+ .regex(/^\//, 'an absolute path')
171
+ .refine((path) => !/(^|\/)\.{1,2}(\/|$)/.test(path), 'a path with no `.` or `..` segment');
172
+ /** Where the platform image keeps apps-manager itself: a mount here (or over `/`) would hide the service it serves. */
173
+ const PLATFORM_IMAGE_APPLICATION_ROOT = '/app';
174
+ /**
175
+ * One file or directory of the HSM vendor's PKCS#11 client, mounted READ-ONLY into apps-manager's container (#3019): the
176
+ * module, its configuration, the client certificates. `hostPath` is on the docker host (compose) or on every node that
177
+ * may run apps-manager (Kubernetes, a `hostPath` volume); `containerPath` is where apps-manager sees it.
178
+ */
179
+ export const PlatformKeyPkcs11ClientFileSchema = z.strictObject({
180
+ hostPath: AbsoluteNormalPathSchema,
181
+ containerPath: AbsoluteNormalPathSchema.refine((path) => path !== '/' && path.replace(/\/+$/, '') !== PLATFORM_IMAGE_APPLICATION_ROOT && !path.startsWith(`${PLATFORM_IMAGE_APPLICATION_ROOT}/`), `a path outside \`/\` and \`${PLATFORM_IMAGE_APPLICATION_ROOT}\` (the platform image keeps apps-manager there)`),
182
+ });
183
+ /**
184
+ * A dedicated HSM reached over PKCS#11 (#2934): Thales Luna, Entrust nShield, AWS CloudHSM, Azure Cloud HSM, an
185
+ * on-premises appliance, or SoftHSM2. apps-manager loads the vendor's PKCS#11 module, logs in to one token with a user PIN
186
+ * (operator-typed in `secrets.json` under `platformKeyPkcs11: { pin }`, never here) and serves the `pkcs11` provider.
187
+ *
188
+ * Protection is read from the token, not declared: a key counts as HARDWARE only when the slot reports a hardware slot
189
+ * AND the token's model is listed in `hardwareTokenModels`, which is your statement that this model is the hardware you
190
+ * run. SoftHSM2 is always SOFTWARE. The binding (`pkcs11js`) is compiled by `pnpm setup:pkcs11`; an apps-manager that
191
+ * cannot load it says so at boot and refuses every signature on this provider.
192
+ *
193
+ * ## A real HSM in a containerised platform (#3019)
194
+ *
195
+ * The platform image carries only SoftHSM2. A real HSM's client comes from the host, and every vendor documents the same
196
+ * containerised shape: mount the client library and its configuration READ-ONLY, and point the client at its
197
+ * configuration with the vendor's own variable. So:
198
+ * - `clientFiles` lists what to mount, each `{ hostPath, containerPath }`. compose renders a read-only bind mount and refuses
199
+ * to start the service when the host path is missing; Kubernetes renders a read-only `hostPath` volume, which it mounts
200
+ * unchecked, so the files must exist on every node that may run apps-manager (a missing one shows as a token that cannot
201
+ * be opened, logged at boot). Both apps-manager services get them (INIT and serving).
202
+ * - `environment` carries the vendor's variables (`ChrystokiConfigurationPath` for a Thales Luna client, …). It is
203
+ * rendered in plain text beside the service, so it may hold paths and settings, never a credential; it may not name a
204
+ * variable Wildo sets itself. The token PIN stays in `secrets.json`.
205
+ * - In a container, `modulePath` must be the bundled SoftHSM2 or lie under a `containerPath`. Declaring `clientFiles` says
206
+ * apps-manager runs in a container, so that is refused here; without `clientFiles` it is refused when compose or
207
+ * Kubernetes renders apps-manager, because a framework developer's NATIVE apps-manager loads a host path legitimately
208
+ * (Homebrew's SoftHSM2, `/opt/homebrew/lib/softhsm/libsofthsm2.so`).
209
+ * - Both are for the CONTAINER lanes. A framework developer's native apps-manager runs on the host, where the client is
210
+ * installed and configured as the vendor documents, and receives neither.
211
+ *
212
+ * Example, a Thales Luna client installed under `/usr/safenet/lunaclient` on the host:
213
+ * `{ modulePath: '/usr/safenet/lunaclient/lib/libCryptoki2_64.so', tokenLabel: 'wildo', hardwareTokenModels: ['Luna K7'],
214
+ * clientFiles: [{ hostPath: '/usr/safenet/lunaclient', containerPath: '/usr/safenet/lunaclient' },
215
+ * { hostPath: '/etc/Chrystoki.conf', containerPath: '/etc/Chrystoki.conf' }],
216
+ * environment: { ChrystokiConfigurationPath: '/etc' } }`.
217
+ */
218
+ export const PlatformKeyPkcs11ConfigSchema = z
219
+ .strictObject({
220
+ /**
221
+ * The vendor's PKCS#11 module, as an absolute path in apps-manager's filesystem: in the platform image, the bundled
222
+ * `/usr/lib/softhsm/libsofthsm2.so` or a path under a `clientFiles[].containerPath`.
223
+ */
224
+ modulePath: z.string().regex(/^\//, 'an absolute path'),
225
+ /** The token's label, as the module reports it. */
226
+ tokenLabel: z.string().min(1).max(32),
227
+ /** Token models (`CK_TOKEN_INFO.model`) you state are hardware. Empty: every key reports SOFTWARE. */
228
+ hardwareTokenModels: z.array(z.string().min(1)).default([]),
229
+ /** The vendor client's files, mounted read-only into apps-manager's container (#3019). */
230
+ clientFiles: z.array(PlatformKeyPkcs11ClientFileSchema).optional(),
231
+ /** The vendor client's own environment variables (no credential, and no variable Wildo sets). */
232
+ environment: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/, 'an environment variable name'), z.string()).optional(),
233
+ })
234
+ .superRefine((pkcs11, context) => {
235
+ const containerPaths = (pkcs11.clientFiles ?? []).map((file) => file.containerPath.replace(/\/+$/, ''));
236
+ containerPaths.forEach((containerPath, index) => {
237
+ if (containerPaths.indexOf(containerPath) !== index) {
238
+ context.addIssue({ code: 'custom', path: ['clientFiles', index, 'containerPath'], message: `"${containerPath}" is mounted twice` });
239
+ }
240
+ });
241
+ for (const name of Object.keys(pkcs11.environment ?? {})) {
242
+ if (WILDO_OWNED_PLATFORM_ENV_KEYS.has(name)) {
243
+ context.addIssue({ code: 'custom', path: ['environment', name], message: `"${name}" is a variable Wildo sets on apps-manager itself` });
244
+ }
245
+ }
246
+ if (containerPaths.length > 0 && !pkcs11ModuleIsReachableInPlatformContainer(pkcs11)) {
247
+ context.addIssue({ code: 'custom', path: ['modulePath'], message: describeUnreachablePkcs11Module(pkcs11) });
248
+ }
249
+ });
250
+ export const WildoPlatformKeyManagementConfigSchema = z.strictObject({
251
+ vault: PlatformKeyVaultConfigSchema.optional(),
252
+ awsKms: PlatformKeyAwsKmsConfigSchema.optional(),
253
+ googleCloudKms: PlatformKeyGoogleCloudKmsConfigSchema.optional(),
254
+ azureKeyVault: PlatformKeyAzureKeyVaultConfigSchema.optional(),
255
+ pkcs11: PlatformKeyPkcs11ConfigSchema.optional(),
256
+ });
257
+ /**
258
+ * Every environment variable Wildo itself sets on a platform process. A vendor `environment` entry may name none of them:
259
+ * it would overwrite the platform's own value (a PIN, a connection string, the service's mode), and the vendor block is
260
+ * rendered in plain text beside the service, never into a Secret.
261
+ */
262
+ const WILDO_OWNED_PLATFORM_ENV_KEYS = new Set([
263
+ ...[
264
+ PlatformProcessEnvKey, PlatformServiceUrlEnvKey, PlatformInfrastructureEnvKey, PlatformSecurityEnvKey, PlatformAdminEnvKey,
265
+ PlatformKubernetesEnvKey, PlatformIngressEnvKey, PlatformLoggingEnvKey, PlatformObservabilityEnvKey, PlatformProviderSelectionEnvKey,
266
+ PlatformEmailEnvKey, PlatformOwnershipDnsEnvKey, PlatformDocumentationSiteEnvKey,
267
+ ].flatMap((vocabulary) => Object.values(vocabulary)),
268
+ // Set literally by the deployment templates rather than through the env contract.
269
+ 'PLATFORM_SERVICE', 'NODE_OPTIONS', 'NODE_ENV',
270
+ ]);
271
+ /**
272
+ * Whether apps-manager, running in the PLATFORM IMAGE, can load `modulePath`: it is the bundled SoftHSM2, or it lies at or
273
+ * under one of the declared `clientFiles[].containerPath`. Nothing else exists in that container.
274
+ */
275
+ export function pkcs11ModuleIsReachableInPlatformContainer(pkcs11) {
276
+ if (pkcs11.modulePath === PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH)
277
+ return true;
278
+ return (pkcs11.clientFiles ?? []).some(({ containerPath }) => {
279
+ const mountRoot = containerPath.replace(/\/+$/, '');
280
+ return pkcs11.modulePath === mountRoot || pkcs11.modulePath.startsWith(`${mountRoot}/`);
281
+ });
282
+ }
283
+ /** The refusal both container lanes (compose, Kubernetes) raise for an unreachable module, naming the declaration. */
284
+ export function describeUnreachablePkcs11Module(pkcs11, environmentName) {
285
+ const mounts = (pkcs11.clientFiles ?? []).map((file) => file.containerPath);
286
+ return `${environmentName ? `Environment "${environmentName}": ` : ''}platformKeyManagement.pkcs11.modulePath "${pkcs11.modulePath}" `
287
+ + `is not the SoftHSM2 module the platform image carries (${PLATFORM_IMAGE_BUNDLED_PKCS11_MODULE_PATH}) and lies under no `
288
+ + `platformKeyManagement.pkcs11.clientFiles[].containerPath (${mounts.length > 0 ? mounts.join(', ') : 'none declared'}). `
289
+ + 'apps-manager runs in the platform image, where nothing else exists: declare the vendor\'s module (and its configuration) '
290
+ + 'in clientFiles as { hostPath, containerPath } and point modulePath inside one of them.';
291
+ }
292
+ /** Whether the platform runs its own Vault (OpenBao) in this environment: the one predicate both lanes render from. */
293
+ export function selfHostsPlatformKeyVault(platformKeyManagement) {
294
+ return platformKeyManagement?.vault?.source === BackingServiceSource.SELF;
295
+ }
296
+ //# sourceMappingURL=platform-key-management.schemas.js.map