@wildo-ai/platform-config-lib 1.1.11 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (389) 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.map +1 -1
  6. package/dist/esm/blueprint/anchored-region.js.map +1 -1
  7. package/dist/esm/blueprint/blueprint.schemas.d.ts +0 -89
  8. package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -1
  9. package/dist/esm/blueprint/blueprint.schemas.js.map +1 -1
  10. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  11. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  12. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  13. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  14. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  15. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  16. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  17. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  18. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +8 -1
  19. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  20. package/dist/esm/bootstrap/bootstrap.schemas.js +15 -1
  21. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  22. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +10 -2
  23. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  24. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +10 -2
  25. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  26. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +21 -0
  27. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
  28. package/dist/esm/bootstrap/platform-store-preconnect.js +25 -0
  29. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
  30. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +80 -0
  31. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -0
  32. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +81 -0
  33. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -0
  34. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +41 -9
  35. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  36. package/dist/esm/bootstrap/runtime-backing-service-access.js +77 -28
  37. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  38. package/dist/esm/bootstrap/runtime-network-policy.d.ts +117 -12
  39. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  40. package/dist/esm/bootstrap/runtime-network-policy.js +222 -23
  41. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  42. package/dist/esm/bootstrap/runtime-network-topology.d.ts +31 -4
  43. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  44. package/dist/esm/bootstrap/runtime-network-topology.js +43 -2
  45. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  46. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
  47. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  48. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +40 -2
  49. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  50. package/dist/esm/bootstrap/runtime-principal.contracts.js +66 -3
  51. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  52. package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -1
  53. package/dist/esm/bootstrap/runtime-response-integrity.js +3 -3
  54. package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -1
  55. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -1
  56. package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -1
  57. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  58. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  59. package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
  60. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  61. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -1
  62. package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -1
  63. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  64. package/dist/esm/config-authoring.entry.js.map +1 -1
  65. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  66. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  67. package/dist/esm/index.d.ts +5 -1
  68. package/dist/esm/index.d.ts.map +1 -1
  69. package/dist/esm/index.js +5 -1
  70. package/dist/esm/index.js.map +1 -1
  71. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts +119 -0
  72. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts.map +1 -0
  73. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js +109 -0
  74. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js.map +1 -0
  75. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts +182 -0
  76. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts.map +1 -0
  77. package/dist/esm/key-management/application-signing-key-rotation.contracts.js +145 -0
  78. package/dist/esm/key-management/application-signing-key-rotation.contracts.js.map +1 -0
  79. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts +156 -0
  80. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts.map +1 -0
  81. package/dist/esm/key-management/approval-seal-manifested-copy.js +617 -0
  82. package/dist/esm/key-management/approval-seal-manifested-copy.js.map +1 -0
  83. package/dist/esm/key-management/approval-seal-verifier.d.ts +114 -40
  84. package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -1
  85. package/dist/esm/key-management/approval-seal-verifier.js +143 -12
  86. package/dist/esm/key-management/approval-seal-verifier.js.map +1 -1
  87. package/dist/esm/key-management/approval-seal.contracts.d.ts +12 -15
  88. package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -1
  89. package/dist/esm/key-management/approval-seal.contracts.js +20 -0
  90. package/dist/esm/key-management/approval-seal.contracts.js.map +1 -1
  91. package/dist/esm/key-management/data-key.contracts.d.ts +0 -2
  92. package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -1
  93. package/dist/esm/key-management/data-key.contracts.js.map +1 -1
  94. package/dist/esm/key-management/es256-jws.d.ts.map +1 -1
  95. package/dist/esm/key-management/es256-jws.js.map +1 -1
  96. package/dist/esm/key-management/key-provider.spi.d.ts +8 -1
  97. package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -1
  98. package/dist/esm/key-management/key-provider.spi.js.map +1 -1
  99. package/dist/esm/key-management/keyring-rotation.contracts.d.ts +2 -12
  100. package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -1
  101. package/dist/esm/key-management/keyring-rotation.contracts.js +3 -3
  102. package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -1
  103. package/dist/esm/key-management/keyring-status.contracts.d.ts +0 -7
  104. package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -1
  105. package/dist/esm/key-management/keyring-status.contracts.js.map +1 -1
  106. package/dist/esm/key-management/pdf-incremental-update.d.ts +158 -0
  107. package/dist/esm/key-management/pdf-incremental-update.d.ts.map +1 -0
  108. package/dist/esm/key-management/pdf-incremental-update.js +730 -0
  109. package/dist/esm/key-management/pdf-incremental-update.js.map +1 -0
  110. package/dist/esm/key-management/pdf-truetype-font.d.ts +35 -0
  111. package/dist/esm/key-management/pdf-truetype-font.d.ts.map +1 -0
  112. package/dist/esm/key-management/pdf-truetype-font.js +152 -0
  113. package/dist/esm/key-management/pdf-truetype-font.js.map +1 -0
  114. package/dist/esm/key-management/qr-code.d.ts +38 -0
  115. package/dist/esm/key-management/qr-code.d.ts.map +1 -0
  116. package/dist/esm/key-management/qr-code.js +325 -0
  117. package/dist/esm/key-management/qr-code.js.map +1 -0
  118. package/dist/esm/key-management/signature-request.contracts.d.ts +0 -4
  119. package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -1
  120. package/dist/esm/key-management/signature-request.contracts.js.map +1 -1
  121. package/dist/esm/key-management/signing-log-export.contracts.d.ts +0 -1
  122. package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -1
  123. package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -1
  124. package/dist/esm/key-management/vault-custody.contracts.d.ts +43 -0
  125. package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -1
  126. package/dist/esm/key-management/vault-custody.contracts.js +66 -0
  127. package/dist/esm/key-management/vault-custody.contracts.js.map +1 -1
  128. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  129. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  130. package/dist/esm/lockfile/canonical-json.d.ts +1 -1
  131. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  132. package/dist/esm/lockfile/canonical-json.js +1 -1
  133. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  134. package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
  135. package/dist/esm/lockfile/file-lock-hold.js +2 -1
  136. package/dist/esm/lockfile/file-lock-hold.js.map +1 -1
  137. package/dist/esm/lockfile/lockfile-io.d.ts +6 -8
  138. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  139. package/dist/esm/lockfile/lockfile-io.js +6 -8
  140. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  141. package/dist/esm/lockfile/materialize-infra-section.d.ts +5 -6
  142. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  143. package/dist/esm/lockfile/materialize-infra-section.js +4 -5
  144. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  145. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +1 -247
  146. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  147. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +1 -1
  148. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  149. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +146 -0
  150. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts.map +1 -0
  151. package/dist/esm/pnpm-settings/application-pnpm-settings.js +573 -0
  152. package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -0
  153. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
  154. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +15 -3
  155. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
  156. package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -1
  157. package/dist/esm/project-config/application-served-public-documents.loader.js +16 -8
  158. package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -1
  159. package/dist/esm/project-config/backend-compliance-section.reader.d.ts +35 -0
  160. package/dist/esm/project-config/backend-compliance-section.reader.d.ts.map +1 -0
  161. package/dist/esm/project-config/backend-compliance-section.reader.js +123 -0
  162. package/dist/esm/project-config/backend-compliance-section.reader.js.map +1 -0
  163. package/dist/esm/project-config/backend-compliance-section.worker.d.ts +20 -0
  164. package/dist/esm/project-config/backend-compliance-section.worker.d.ts.map +1 -0
  165. package/dist/esm/project-config/backend-compliance-section.worker.js +78 -0
  166. package/dist/esm/project-config/backend-compliance-section.worker.js.map +1 -0
  167. package/dist/esm/project-config/config-module-resolution.d.ts +32 -0
  168. package/dist/esm/project-config/config-module-resolution.d.ts.map +1 -0
  169. package/dist/esm/project-config/config-module-resolution.js +33 -0
  170. package/dist/esm/project-config/config-module-resolution.js.map +1 -0
  171. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  172. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  173. package/dist/esm/project-config/define-infra-env-config.d.ts +146 -55
  174. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  175. package/dist/esm/project-config/define-infra-env-config.js +124 -71
  176. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  177. package/dist/esm/project-config/define-minion-config.d.ts +26 -36
  178. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  179. package/dist/esm/project-config/define-minion-config.js +64 -25
  180. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  181. package/dist/esm/project-config/define-saas-config.d.ts +41 -437
  182. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  183. package/dist/esm/project-config/define-saas-config.js +102 -94
  184. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  185. package/dist/esm/project-config/define-worker-config.d.ts +10 -20
  186. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  187. package/dist/esm/project-config/define-worker-config.js +10 -12
  188. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  189. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  190. package/dist/esm/project-config/hosted-infra-env-config.js +2 -1
  191. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  192. package/dist/esm/project-config/index.d.ts +2 -0
  193. package/dist/esm/project-config/index.d.ts.map +1 -1
  194. package/dist/esm/project-config/index.js +2 -0
  195. package/dist/esm/project-config/index.js.map +1 -1
  196. package/dist/esm/project-config/loader-instances-zod.d.ts +19 -0
  197. package/dist/esm/project-config/loader-instances-zod.d.ts.map +1 -0
  198. package/dist/esm/project-config/loader-instances-zod.js +40 -0
  199. package/dist/esm/project-config/loader-instances-zod.js.map +1 -0
  200. package/dist/esm/project-config/loader.d.ts +131 -14
  201. package/dist/esm/project-config/loader.d.ts.map +1 -1
  202. package/dist/esm/project-config/loader.js +226 -12
  203. package/dist/esm/project-config/loader.js.map +1 -1
  204. package/dist/esm/project-config/minion-liveness.contracts.d.ts +131 -0
  205. package/dist/esm/project-config/minion-liveness.contracts.d.ts.map +1 -0
  206. package/dist/esm/project-config/minion-liveness.contracts.js +167 -0
  207. package/dist/esm/project-config/minion-liveness.contracts.js.map +1 -0
  208. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  209. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  210. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
  211. package/dist/esm/project-config/npm-version-range.js.map +1 -1
  212. package/dist/esm/project-config/owning-package-tsconfig.d.ts +7 -7
  213. package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -1
  214. package/dist/esm/project-config/owning-package-tsconfig.js +7 -7
  215. package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -1
  216. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
  217. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  218. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  219. package/dist/esm/project-config/provider-companion-discovery.js +3 -1
  220. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  221. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +71 -46
  222. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  223. package/dist/esm/project-config/provider-runtime-artifacts.js +150 -4
  224. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  225. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +0 -2
  226. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  227. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  228. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  229. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  230. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  231. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  232. package/dist/esm/project-config/shared/auth.schemas.d.ts +0 -17
  233. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  234. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  235. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
  236. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
  237. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +9 -10
  238. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  239. package/dist/esm/project-config/shared/backing-services.schemas.js +13 -15
  240. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  241. package/dist/esm/project-config/shared/cdn.schemas.d.ts +0 -51
  242. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  243. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  244. package/dist/esm/project-config/shared/csp-defaults.d.ts +34 -6
  245. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  246. package/dist/esm/project-config/shared/csp-defaults.js +52 -8
  247. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  248. package/dist/esm/project-config/shared/csp-emit.d.ts +60 -13
  249. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  250. package/dist/esm/project-config/shared/csp-emit.js +77 -24
  251. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  252. package/dist/esm/project-config/shared/csp.schemas.d.ts +72 -84
  253. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  254. package/dist/esm/project-config/shared/csp.schemas.js +40 -12
  255. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  256. package/dist/esm/project-config/shared/data-services.schemas.d.ts +0 -8
  257. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  258. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  259. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  260. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  261. package/dist/esm/project-config/shared/environment.schemas.d.ts +95 -8
  262. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  263. package/dist/esm/project-config/shared/environment.schemas.js +122 -10
  264. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  265. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +10 -4
  266. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  267. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  268. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
  269. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  270. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +1 -1
  271. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  272. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +1 -1
  273. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  274. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  275. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  276. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  277. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  278. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +20 -0
  279. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  280. package/dist/esm/project-config/shared/minion-resource-access.validation.js +21 -2
  281. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  282. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  283. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  284. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +67 -38
  285. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -1
  286. package/dist/esm/project-config/shared/platform-key-management.schemas.js +113 -5
  287. package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -1
  288. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  289. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  290. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +2 -2
  291. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  292. package/dist/esm/project-config/shared/platform-storage.schemas.js +16 -2
  293. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  294. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +21 -23
  295. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  296. package/dist/esm/project-config/shared/service-definitions.schemas.js +4 -5
  297. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  298. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +0 -18
  299. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  300. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  301. package/dist/esm/project-config/static-asset-import-noop.d.ts +20 -3
  302. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
  303. package/dist/esm/project-config/static-asset-import-noop.js +36 -20
  304. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
  305. package/dist/esm/registry/artifact-domain.schemas.d.ts +0 -5
  306. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  307. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  308. package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
  309. package/dist/esm/registry/digest.schemas.js.map +1 -1
  310. package/dist/esm/registry/index.d.ts +2 -3
  311. package/dist/esm/registry/index.d.ts.map +1 -1
  312. package/dist/esm/registry/index.js +2 -3
  313. package/dist/esm/registry/index.js.map +1 -1
  314. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
  315. package/dist/esm/registry/local-checkout-source.js.map +1 -1
  316. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +1 -98
  317. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  318. package/dist/esm/registry/lockfile-modules-section.schemas.js +1 -2
  319. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  320. package/dist/esm/registry/module-artifact.schemas.d.ts +17 -17
  321. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  322. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  323. package/dist/esm/registry/module-manifest.schemas.d.ts +151 -219
  324. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  325. package/dist/esm/registry/module-manifest.schemas.js +145 -13
  326. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  327. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
  328. package/dist/esm/registry/module-search.schemas.js.map +1 -1
  329. package/dist/esm/registry/registry-config.schemas.d.ts +0 -18
  330. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  331. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  332. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  333. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  334. package/dist/esm/registry/registry-errors.d.ts +81 -3
  335. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  336. package/dist/esm/registry/registry-errors.js +185 -4
  337. package/dist/esm/registry/registry-errors.js.map +1 -1
  338. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
  339. package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
  340. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  341. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  342. package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -1
  343. package/dist/esm/registry/registry-url-resolution.js.map +1 -1
  344. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  345. package/dist/esm/release/framework-release.constants.js.map +1 -1
  346. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  347. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  348. package/dist/esm/schemas/framework-secrets.schemas.d.ts +0 -7
  349. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  350. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  351. package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
  352. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  353. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  354. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +1 -1
  355. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  356. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  357. package/dist/esm/schemas/platform-config.schemas.d.ts +2 -2
  358. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  359. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  360. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
  361. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  362. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  363. package/dist/esm/workspace-scope/index.js.map +1 -1
  364. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  365. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  366. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  367. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  368. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  369. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  370. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  371. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  372. package/dist/tsconfig.build.tsbuildinfo +1 -1
  373. package/package.json +12 -12
  374. package/dist/esm/_unimplemented/index.d.ts +0 -3
  375. package/dist/esm/_unimplemented/index.d.ts.map +0 -1
  376. package/dist/esm/_unimplemented/index.js +0 -3
  377. package/dist/esm/_unimplemented/index.js.map +0 -1
  378. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +0 -137
  379. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +0 -1
  380. package/dist/esm/_unimplemented/unimplemented-field-warning.js +0 -153
  381. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +0 -1
  382. package/dist/esm/project-config/shared/cdn.example.d.ts +0 -14
  383. package/dist/esm/project-config/shared/cdn.example.d.ts.map +0 -1
  384. package/dist/esm/project-config/shared/cdn.example.js +0 -38
  385. package/dist/esm/project-config/shared/cdn.example.js.map +0 -1
  386. package/dist/esm/project-config/shared/schema-version.schemas.d.ts +0 -15
  387. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +0 -1
  388. package/dist/esm/project-config/shared/schema-version.schemas.js +0 -40
  389. package/dist/esm/project-config/shared/schema-version.schemas.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"key-provider.spi.js","sourceRoot":"","sources":["../../../../src/key-management/key-provider.spi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AA+IxG,4CAA4C;AAC5C,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAsB,EAAE,OAAmB,EAAE,cAA0B;IACxG,IAAI,OAAO,CAAC,MAAM,KAAK,cAAc;QAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,cAAc,eAAe,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IACxH,MAAM,EAAE,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,cAAc,C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,WAAW,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACrJ,CAAC","sourcesContent":["import { createCipheriv, createDecipheriv, createHash, randomBytes, type KeyObject } from 'node:crypto';\nimport type {\n CryptoKey_MaterialAccess,\n CryptoKey_MaterialProvenance,\n CryptoKey_OperationMode,\n CryptoKey_Primitive,\n CryptoKey_ProtectionLevel,\n CryptoKeyFloor,\n} from '@wildo-ai/saas-models';\nimport type { EcdsaSignatureEncoding, P256PublicJwk } from './es256-jws';\n\n/**\n * # The key provider SPI (#2891)\n *\n * What a key provider implements: the engine's LOCAL provider today, Vault, cloud KMS and HSM providers in slice 2\n * (#2933, #2896, #2934), a customer's own provider later (#2919). The custodian (apps-manager for platform custody)\n * drives a provider through this interface and nothing else; a consumer never reaches one, it asks the key-management\n * API by purpose.\n *\n * A provider declares, per key, how operations happen:\n * - **REMOTE**: the key never leaves. Every operation is a call: `signDigest` names the exact version (no call may\n * resolve \"latest\"), and the digest is SHA-256 over the ASCII JWS signing input (RFC 7515 §5.1).\n * - **RETRIEVED**: the provider hands the material to the custodian, which operates locally. The LOCAL provider is\n * RETRIEVED to its custodian only; the purpose's `heldBy` decides whether any runtime may retrieve too.\n *\n * Data-key wrapping (#2894): a wrapping version (`AES_256_GCM_DATA_KEY`) wraps the application's data keys. A REMOTE\n * provider wraps and unwraps itself (`wrapDataKey` / `unwrapDataKey`), with the associated data bound into the wrap; a\n * RETRIEVED provider hands the custodian the AES key and the custodian wraps locally ({@link wrapDataKeyLocally}). MAC is\n * not on this interface: no purpose's MAC key is provider-held (#2893's keys are the application's own).\n *\n * Verification is never a provider call: the custodian verifies every returned signature locally against the public\n * JWK of the version it named (verify-after-sign), and every verifier works from published public keys.\n */\n\n/** Names one version of one key at one provider, exactly. */\nexport interface KeyVersionRef {\n readonly providerRef: string;\n /** The provider's name for the key (a KMS key id, a Vault key name, a LOCAL key id). */\n readonly keyRef: string;\n /** The provider's name for the version. Never \"latest\". */\n readonly versionRef: string;\n}\n\n/** What a provider attests about one key version, re-read at every keyring refresh. */\nexport interface KeyVersionAttestation {\n readonly protectionLevel: CryptoKey_ProtectionLevel;\n readonly materialAccess: CryptoKey_MaterialAccess;\n readonly provenance: CryptoKey_MaterialProvenance;\n /** False once the provider has disabled or destroyed the version's private material. */\n readonly privateMaterialUsable: boolean;\n}\n\n/** A newly created key version. */\nexport interface CreatedKeyVersion {\n readonly ref: KeyVersionRef;\n readonly primitive: CryptoKey_Primitive;\n /** The public half, for an asymmetric primitive. */\n readonly publicJwk?: P256PublicJwk;\n readonly attestation: KeyVersionAttestation;\n}\n\n/**\n * What a vendor charges and allows for a provider's operations (#2896): stated, as prose a person reads, when a purpose is\n * bound to the provider, so the cost of binding a busy purpose to a paid KMS is never a surprise. Each value is the\n * vendor's published default at the time it was written; an account's own quota may differ, and the provider's source\n * file cites where each figure comes from.\n */\nexport interface KeyProviderVendorTerms {\n /** How many signing requests the vendor serves before throttling. */\n readonly signRequestQuota: string;\n /** What one signing request costs. */\n readonly signCost: string;\n /** What holding one key version costs. */\n readonly keyCost: string;\n /** How a throttle shows itself, and how the keyring treats it. */\n readonly throttling: string;\n /**\n * What wrapping a data key costs (#2894), for a provider that wraps: one wrap per data key, and one unwrap per data key\n * each time an application runtime starts, so far fewer calls than signatures.\n */\n readonly wrapCost?: string;\n /** Where the vendor records each signature, for corroboration against the signing log. */\n readonly auditLog: string;\n}\n\n/** A key provider, as the custodian drives it. */\nexport interface KeyProvider {\n readonly providerRef: string;\n /** How this provider performs operations. A provider may support both; the custodian prefers REMOTE. */\n readonly operationModes: readonly CryptoKey_OperationMode[];\n /** The encoding of the signatures `signDigest` returns; the custodian normalizes to raw R ‖ S. */\n readonly signatureEncoding: EcdsaSignatureEncoding;\n /** The primitives this provider can create keys for. */\n readonly primitives: readonly CryptoKey_Primitive[];\n /**\n * A paid vendor's terms, stated in apps-manager's log when the provider registers at boot (the moment the operator who\n * declared the account reads it); absent for a provider that costs nothing per call.\n */\n readonly vendorTerms?: KeyProviderVendorTerms;\n /**\n * The vendor's quota on signatures, as a rate, and what it is shared across. apps-manager keeps its own signing under\n * a share of it (a throttle answers a retryable PROVIDER_FAULT), so the relay retries instead of the vendor refusing.\n * Absent: the provider states no quota (a dedicated HSM's throughput is the operator's own).\n */\n readonly signRequestQuota?: { readonly perSecond: number; readonly sharedAcross: string };\n /**\n * The most this provider's DEPLOYMENT can offer, as configured: a Google key ring creating SOFTWARE keys, an Azure\n * vault making `EC` keys, a PKCS#11 token whose model is not allow-listed. The keyring refuses a purpose whose floor it\n * cannot meet BEFORE creating a version, rather than creating a vendor key and destroying it on every attempt. Absent:\n * only the version's own attestation is checked.\n */\n deploymentCeiling?(): Promise<CryptoKeyFloor>;\n\n /** Create a new version of `keyRef` (the key itself is created with its first version). */\n createKeyVersion(input: { readonly keyRef: string; readonly primitive: CryptoKey_Primitive }): Promise<CreatedKeyVersion>;\n /** What the provider attests about the version now. */\n describeKeyVersion(ref: KeyVersionRef): Promise<KeyVersionAttestation>;\n /** The public half of an asymmetric version. */\n getPublicKey(ref: KeyVersionRef): Promise<P256PublicJwk>;\n /** REMOTE: sign a SHA-256 digest with exactly this version. */\n signDigest?(ref: KeyVersionRef, digest: Uint8Array): Promise<Uint8Array>;\n /** RETRIEVED: the private (or secret, for a wrapping key) material of exactly this version, to the custodian. */\n retrieveKeyMaterial?(ref: KeyVersionRef): Promise<KeyObject>;\n /**\n * REMOTE: wrap a data key under exactly this wrapping version, binding `associatedData` into the wrap, so a wrapped key\n * moved to another data key's row does not unwrap. The wrap must be AUTHENTICATED encryption made with a secret only the\n * provider holds (AES-GCM and its vendor forms): a public-key wrap (RSA `wrapKey`) can be made by anyone holding the\n * public half, so a substituted data key would unwrap (#2894 stage D review). Returns the provider's opaque wrapped form.\n */\n wrapDataKey?(ref: KeyVersionRef, dataKey: Uint8Array, associatedData: Uint8Array): Promise<Uint8Array>;\n /** REMOTE: unwrap what {@link wrapDataKey} returned, refusing it under any other associated data. */\n unwrapDataKey?(ref: KeyVersionRef, wrapped: Uint8Array, associatedData: Uint8Array): Promise<Uint8Array>;\n /** Stop the version from signing; its material is kept until destroyed. */\n disableKeyVersion(ref: KeyVersionRef): Promise<void>;\n /** Destroy the version's private material. Irreversible; the public half is the custodian's to keep. */\n destroyKeyVersion(ref: KeyVersionRef): Promise<void>;\n /**\n * Whether the version's private material can still be used: false when what protects it is gone (the LOCAL provider's\n * key-encryption root was lost). Only a provider that can LOSE its own access implements it; absent means always.\n */\n materialIsReadable?(ref: KeyVersionRef): Promise<boolean>;\n}\n\n/** A data key is an AES-256 key (#2894). */\nexport const DATA_KEY_BYTES = 32;\n\nconst LOCAL_WRAP_IV_BYTES = 12;\nconst LOCAL_WRAP_TAG_BYTES = 16;\n\n/**\n * Wrap a data key with a wrapping key the custodian holds (a RETRIEVED provider's version): AES-256-GCM with a random IV,\n * the associated data authenticated, as `iv ‖ tag ‖ ciphertext`. One IV per wrap, and a wrapping key wraps few keys (one\n * per data key, each used for many values), far below the 2^32 random-IV bound (NIST SP 800-38D §8.3).\n */\nexport function wrapDataKeyLocally(wrappingKey: KeyObject, dataKey: Uint8Array, associatedData: Uint8Array): Uint8Array {\n if (dataKey.length !== DATA_KEY_BYTES) throw new Error(`A data key is ${DATA_KEY_BYTES} bytes, not ${dataKey.length}.`);\n const iv = randomBytes(LOCAL_WRAP_IV_BYTES);\n const cipher = createCipheriv('aes-256-gcm', wrappingKey, iv);\n cipher.setAAD(associatedData);\n const ciphertext = Buffer.concat([cipher.update(dataKey), cipher.final()]);\n return Buffer.concat([iv, cipher.getAuthTag(), ciphertext]);\n}\n\n/** Unwrap what {@link wrapDataKeyLocally} returned; throws when the wrap, the key or the associated data differ. */\nexport function unwrapDataKeyLocally(wrappingKey: KeyObject, wrapped: Uint8Array, associatedData: Uint8Array): Uint8Array {\n const bytes = Buffer.from(wrapped);\n if (bytes.length !== LOCAL_WRAP_IV_BYTES + LOCAL_WRAP_TAG_BYTES + DATA_KEY_BYTES) throw new Error('Not a locally wrapped data key.');\n const decipher = createDecipheriv('aes-256-gcm', wrappingKey, bytes.subarray(0, LOCAL_WRAP_IV_BYTES));\n decipher.setAAD(associatedData);\n decipher.setAuthTag(bytes.subarray(LOCAL_WRAP_IV_BYTES, LOCAL_WRAP_IV_BYTES + LOCAL_WRAP_TAG_BYTES));\n return Buffer.concat([decipher.update(bytes.subarray(LOCAL_WRAP_IV_BYTES + LOCAL_WRAP_TAG_BYTES)), decipher.final()]);\n}\n\n/**\n * The `kid` of a wrapping version (#2894). A signing version's `kid` is its public key's thumbprint; a wrapping key has no\n * public half, so its `kid` is derived from the version's provider references, never from its material, and names it in\n * every envelope sealed under a data key it wraps.\n */\nexport function wrappingKeyKidOf(ref: KeyVersionRef): string {\n return createHash('sha256').update(`wildo-wrapping-key-id:v1|${ref.providerRef}|${ref.keyRef}|${ref.versionRef}`).digest('base64url').slice(0, 22);\n}\n"]}
1
+ {"version":3,"file":"key-provider.spi.js","sourceRoot":"","sources":["../../../src/key-management/key-provider.spi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAuJxG,4CAA4C;AAC5C,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAsB,EAAE,OAAmB,EAAE,cAA0B;IACxG,IAAI,OAAO,CAAC,MAAM,KAAK,cAAc;QAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,cAAc,eAAe,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IACxH,MAAM,EAAE,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAC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AM,CAAC,4BAA4B,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACrJ,CAAC","sourcesContent":["import { createCipheriv, createDecipheriv, createHash, randomBytes, type KeyObject } from 'node:crypto';\nimport type {\n CryptoKey_MaterialAccess,\n CryptoKey_MaterialProvenance,\n CryptoKey_OperationMode,\n CryptoKey_Primitive,\n CryptoKey_ProtectionEvidence,\n CryptoKey_ProtectionLevel,\n CryptoKeyFloor,\n} from '@wildo-ai/saas-models';\nimport type { EcdsaSignatureEncoding, P256PublicJwk } from './es256-jws';\n\n/**\n * # The key provider SPI (#2891)\n *\n * What a key provider implements: the engine's LOCAL provider today, Vault, cloud KMS and HSM providers in slice 2\n * (#2933, #2896, #2934), a customer's own provider later (#2919). The custodian (apps-manager for platform custody)\n * drives a provider through this interface and nothing else; a consumer never reaches one, it asks the key-management\n * API by purpose.\n *\n * A provider declares, per key, how operations happen:\n * - **REMOTE**: the key never leaves. Every operation is a call: `signDigest` names the exact version (no call may\n * resolve \"latest\"), and the digest is SHA-256 over the ASCII JWS signing input (RFC 7515 §5.1).\n * - **RETRIEVED**: the provider hands the material to the custodian, which operates locally. The LOCAL provider is\n * RETRIEVED to its custodian only; the purpose's `heldBy` decides whether any runtime may retrieve too.\n *\n * Data-key wrapping (#2894): a wrapping version (`AES_256_GCM_DATA_KEY`) wraps the application's data keys. A REMOTE\n * provider wraps and unwraps itself (`wrapDataKey` / `unwrapDataKey`), with the associated data bound into the wrap; a\n * RETRIEVED provider hands the custodian the AES key and the custodian wraps locally ({@link wrapDataKeyLocally}). MAC is\n * not on this interface: no purpose's MAC key is provider-held (#2893's keys are the application's own).\n *\n * Verification is never a provider call: the custodian verifies every returned signature locally against the public\n * JWK of the version it named (verify-after-sign), and every verifier works from published public keys.\n */\n\n/** Names one version of one key at one provider, exactly. */\nexport interface KeyVersionRef {\n readonly providerRef: string;\n /** The provider's name for the key (a KMS key id, a Vault key name, a LOCAL key id). */\n readonly keyRef: string;\n /** The provider's name for the version. Never \"latest\". */\n readonly versionRef: string;\n}\n\n/** What a provider attests about one key version, re-read at every keyring refresh. */\nexport interface KeyVersionAttestation {\n readonly protectionLevel: CryptoKey_ProtectionLevel;\n readonly materialAccess: CryptoKey_MaterialAccess;\n readonly provenance: CryptoKey_MaterialProvenance;\n /**\n * Whose word `protectionLevel` rests on (#3016). A provider states exactly what it did: one that reads its vendor's key\n * metadata answers `PROVIDER_CLAIM`, never `VERIFIED_HARDWARE_ATTESTATION`, which only a provider that verified the\n * HSM's own signed statement against pinned roots and bound it to this version may answer. The keyring checks it\n * against the purpose's floor like every other axis.\n */\n readonly protectionEvidence: CryptoKey_ProtectionEvidence;\n /** False once the provider has disabled or destroyed the version's private material. */\n readonly privateMaterialUsable: boolean;\n}\n\n/** A newly created key version. */\nexport interface CreatedKeyVersion {\n readonly ref: KeyVersionRef;\n readonly primitive: CryptoKey_Primitive;\n /** The public half, for an asymmetric primitive. */\n readonly publicJwk?: P256PublicJwk;\n readonly attestation: KeyVersionAttestation;\n}\n\n/**\n * What a vendor charges and allows for a provider's operations (#2896): stated, as prose a person reads, when a purpose is\n * bound to the provider, so the cost of binding a busy purpose to a paid KMS is never a surprise. Each value is the\n * vendor's published default at the time it was written; an account's own quota may differ, and the provider's source\n * file cites where each figure comes from.\n */\nexport interface KeyProviderVendorTerms {\n /** How many signing requests the vendor serves before throttling. */\n readonly signRequestQuota: string;\n /** What one signing request costs. */\n readonly signCost: string;\n /** What holding one key version costs. */\n readonly keyCost: string;\n /** How a throttle shows itself, and how the keyring treats it. */\n readonly throttling: string;\n /**\n * What wrapping a data key costs (#2894), for a provider that wraps: one wrap per data key, and one unwrap per data key\n * each time an application runtime starts, so far fewer calls than signatures.\n */\n readonly wrapCost?: string;\n /** Where the vendor records each signature, for corroboration against the signing log. */\n readonly auditLog: string;\n}\n\n/** A key provider, as the custodian drives it. */\nexport interface KeyProvider {\n readonly providerRef: string;\n /** How this provider performs operations. A provider may support both; the custodian prefers REMOTE. */\n readonly operationModes: readonly CryptoKey_OperationMode[];\n /** The encoding of the signatures `signDigest` returns; the custodian normalizes to raw R ‖ S. */\n readonly signatureEncoding: EcdsaSignatureEncoding;\n /** The primitives this provider can create keys for. */\n readonly primitives: readonly CryptoKey_Primitive[];\n /**\n * A paid vendor's terms, stated in apps-manager's log when the provider registers at boot (the moment the operator who\n * declared the account reads it); absent for a provider that costs nothing per call.\n */\n readonly vendorTerms?: KeyProviderVendorTerms;\n /**\n * The vendor's quota on signatures, as a rate, and what it is shared across. apps-manager keeps its own signing under\n * a share of it (a throttle answers a retryable PROVIDER_FAULT), so the relay retries instead of the vendor refusing.\n * Absent: the provider states no quota (a dedicated HSM's throughput is the operator's own).\n */\n readonly signRequestQuota?: { readonly perSecond: number; readonly sharedAcross: string };\n /**\n * The most this provider's DEPLOYMENT can offer, as configured: a Google key ring creating SOFTWARE keys, an Azure\n * vault making `EC` keys, a PKCS#11 token whose model is not allow-listed. The keyring refuses a purpose whose floor it\n * cannot meet BEFORE creating a version, rather than creating a vendor key and destroying it on every attempt. Absent:\n * only the version's own attestation is checked.\n */\n deploymentCeiling?(): Promise<CryptoKeyFloor>;\n\n /** Create a new version of `keyRef` (the key itself is created with its first version). */\n createKeyVersion(input: { readonly keyRef: string; readonly primitive: CryptoKey_Primitive }): Promise<CreatedKeyVersion>;\n /** What the provider attests about the version now. */\n describeKeyVersion(ref: KeyVersionRef): Promise<KeyVersionAttestation>;\n /** The public half of an asymmetric version. */\n getPublicKey(ref: KeyVersionRef): Promise<P256PublicJwk>;\n /** REMOTE: sign a SHA-256 digest with exactly this version. */\n signDigest?(ref: KeyVersionRef, digest: Uint8Array): Promise<Uint8Array>;\n /** RETRIEVED: the private (or secret, for a wrapping key) material of exactly this version, to the custodian. */\n retrieveKeyMaterial?(ref: KeyVersionRef): Promise<KeyObject>;\n /**\n * REMOTE: wrap a data key under exactly this wrapping version, binding `associatedData` into the wrap, so a wrapped key\n * moved to another data key's row does not unwrap. The wrap must be AUTHENTICATED encryption made with a secret only the\n * provider holds (AES-GCM and its vendor forms): a public-key wrap (RSA `wrapKey`) can be made by anyone holding the\n * public half, so a substituted data key would unwrap (#2894 stage D review). Returns the provider's opaque wrapped form.\n */\n wrapDataKey?(ref: KeyVersionRef, dataKey: Uint8Array, associatedData: Uint8Array): Promise<Uint8Array>;\n /** REMOTE: unwrap what {@link wrapDataKey} returned, refusing it under any other associated data. */\n unwrapDataKey?(ref: KeyVersionRef, wrapped: Uint8Array, associatedData: Uint8Array): Promise<Uint8Array>;\n /** Stop the version from signing; its material is kept until destroyed. */\n disableKeyVersion(ref: KeyVersionRef): Promise<void>;\n /** Destroy the version's private material. Irreversible; the public half is the custodian's to keep. */\n destroyKeyVersion(ref: KeyVersionRef): Promise<void>;\n /**\n * Whether the version's private material can still be used: false when what protects it is gone (the LOCAL provider's\n * key-encryption root was lost). Only a provider that can LOSE its own access implements it; absent means always.\n */\n materialIsReadable?(ref: KeyVersionRef): Promise<boolean>;\n}\n\n/** A data key is an AES-256 key (#2894). */\nexport const DATA_KEY_BYTES = 32;\n\nconst LOCAL_WRAP_IV_BYTES = 12;\nconst LOCAL_WRAP_TAG_BYTES = 16;\n\n/**\n * Wrap a data key with a wrapping key the custodian holds (a RETRIEVED provider's version): AES-256-GCM with a random IV,\n * the associated data authenticated, as `iv ‖ tag ‖ ciphertext`. One IV per wrap, and a wrapping key wraps few keys (one\n * per data key, each used for many values), far below the 2^32 random-IV bound (NIST SP 800-38D §8.3).\n */\nexport function wrapDataKeyLocally(wrappingKey: KeyObject, dataKey: Uint8Array, associatedData: Uint8Array): Uint8Array {\n if (dataKey.length !== DATA_KEY_BYTES) throw new Error(`A data key is ${DATA_KEY_BYTES} bytes, not ${dataKey.length}.`);\n const iv = randomBytes(LOCAL_WRAP_IV_BYTES);\n const cipher = createCipheriv('aes-256-gcm', wrappingKey, iv);\n cipher.setAAD(associatedData);\n const ciphertext = Buffer.concat([cipher.update(dataKey), cipher.final()]);\n return Buffer.concat([iv, cipher.getAuthTag(), ciphertext]);\n}\n\n/** Unwrap what {@link wrapDataKeyLocally} returned; throws when the wrap, the key or the associated data differ. */\nexport function unwrapDataKeyLocally(wrappingKey: KeyObject, wrapped: Uint8Array, associatedData: Uint8Array): Uint8Array {\n const bytes = Buffer.from(wrapped);\n if (bytes.length !== LOCAL_WRAP_IV_BYTES + LOCAL_WRAP_TAG_BYTES + DATA_KEY_BYTES) throw new Error('Not a locally wrapped data key.');\n const decipher = createDecipheriv('aes-256-gcm', wrappingKey, bytes.subarray(0, LOCAL_WRAP_IV_BYTES));\n decipher.setAAD(associatedData);\n decipher.setAuthTag(bytes.subarray(LOCAL_WRAP_IV_BYTES, LOCAL_WRAP_IV_BYTES + LOCAL_WRAP_TAG_BYTES));\n return Buffer.concat([decipher.update(bytes.subarray(LOCAL_WRAP_IV_BYTES + LOCAL_WRAP_TAG_BYTES)), decipher.final()]);\n}\n\n/**\n * The `kid` of a wrapping version (#2894). A signing version's `kid` is its public key's thumbprint; a wrapping key has no\n * public half, so its `kid` is derived from the version's provider references, never from its material, and names it in\n * every envelope sealed under a data key it wraps.\n */\nexport function wrappingKeyKidOf(ref: KeyVersionRef): string {\n return createHash('sha256').update(`wildo-wrapping-key-id:v1|${ref.providerRef}|${ref.keyRef}|${ref.versionRef}`).digest('base64url').slice(0, 22);\n}\n"]}
@@ -39,25 +39,15 @@ export declare function buildAdminKeyringRotationPath(appSlug: string): string;
39
39
  export declare function cryptoKeyPurposeIsKeyringHeld(purpose: CryptoKey_Purpose): boolean;
40
40
  /**
41
41
  * Why a purpose the keyring does not hold cannot be rotated here, and what to do instead, by where its key IS held. Each
42
- * holding has its own procedure (#2892 review F9): an application's own keys have none yet, so pointing at the
43
- * response-key procedure would send an operator to a step that changes nothing.
42
+ * holding has its own procedure (#2892 review F9): pointing an application's own keys at the response-key procedure would
43
+ * send an operator to a step that changes nothing.
44
44
  */
45
45
  export declare function keyringRotationRefusalOf(purpose: CryptoKey_Purpose): string | undefined;
46
46
  export declare const KeyringRotationRequestSchema: z.ZodObject<{
47
47
  purpose: z.ZodDefault<z.ZodEnum<typeof CryptoKey_Purpose>>;
48
- /** For an organization-scoped binding: the organization whose key rotates. Absent for an application-scoped one. */
49
48
  organizationId: z.ZodOptional<z.ZodString>;
50
49
  mode: z.ZodDefault<z.ZodEnum<typeof KeyringRotationMode>>;
51
- /**
52
- * Emergency only, and required there: the earliest instant the key may have been exposed (ISO 8601). Never defaulted
53
- * to now, which would vouch for every seal made between the leak and its discovery, and never in the future, which
54
- * would vouch for seals not yet made.
55
- */
56
50
  compromiseInstant: z.ZodOptional<z.ZodISODateTime>;
57
- /**
58
- * Emergency and root-lost only, and required there: why, in the operator's words. Recorded on the audit row, where the
59
- * shared admin secret names nobody. A planned rotation records no reason, so it accepts none.
60
- */
61
51
  justification: z.ZodOptional<z.ZodString>;
62
52
  }, z.core.$strict>;
63
53
  export type KeyringRotationRequest = z.input<typeof KeyringRotationRequestSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"keyring-rotation.contracts.d.ts","sourceRoot":"","sources":["../../../../src/key-management/keyring-rotation.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAqD,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI7G;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,iDAAiD;AACjD,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,SAAS,cAAc;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,QAAU,CAAC;AAEzD,2DAA2D;AAC3D,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,mGAAmG;AACnG,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAEjF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAcvF;AAED,eAAO,MAAM,4BAA4B;;IAGrC,oHAAoH;;;IAGpH;;;;OAIG;;IAEH;;;OAGG;;kBAkBH,CAAC;AACL,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,uEAAuE;AACvE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAsB,CAAC"}
1
+ {"version":3,"file":"keyring-rotation.contracts.d.ts","sourceRoot":"","sources":["../../../src/key-management/keyring-rotation.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAqD,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI7G;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,iDAAiD;AACjD,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,SAAS,cAAc;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,QAAU,CAAC;AAEzD,2DAA2D;AAC3D,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,mGAAmG;AACnG,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAEjF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAcvF;AAED,eAAO,MAAM,4BAA4B;;;;;;kBAiCrC,CAAC;AACL,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,uEAAuE;AACvE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAsB,CAAC"}
@@ -46,8 +46,8 @@ export function cryptoKeyPurposeIsKeyringHeld(purpose) {
46
46
  }
47
47
  /**
48
48
  * Why a purpose the keyring does not hold cannot be rotated here, and what to do instead, by where its key IS held. Each
49
- * holding has its own procedure (#2892 review F9): an application's own keys have none yet, so pointing at the
50
- * response-key procedure would send an operator to a step that changes nothing.
49
+ * holding has its own procedure (#2892 review F9): pointing an application's own keys at the response-key procedure would
50
+ * send an operator to a step that changes nothing.
51
51
  */
52
52
  export function keyringRotationRefusalOf(purpose) {
53
53
  switch (CRYPTO_KEY_PURPOSE_DESCRIPTORS[purpose].holding) {
@@ -56,7 +56,7 @@ export function keyringRotationRefusalOf(purpose) {
56
56
  case CryptoKey_Holding.CUSTODIAN_ENVIRONMENT:
57
57
  return `The ${purpose} key is held in apps-manager's environment, not the keyring: rotate it by promoting the next response key in the environment's secrets and running \`wildo config sync\`.`;
58
58
  case CryptoKey_Holding.APPLICATION_SECRETS:
59
- return `The ${purpose} key is held in the application's secrets, not the keyring, and its rotation is not built yet (#2895). A key that is missing is minted at the next registration (\`wildo local init\`).`;
59
+ return `The ${purpose} key is held in the application's secrets, not the keyring: rotate the application's signing keys with \`wildo keys rotate-signing-keys --reason "…"\` (#2895). A key that is missing is minted at the next registration (\`wildo local init\`).`;
60
60
  default: {
61
61
  // A holding added later must name its procedure here: an unhandled one would otherwise read as keyring-held.
62
62
  const unhandled = CRYPTO_KEY_PURPOSE_DESCRIPTORS[purpose].holding;
@@ -1 +1 @@
1
- {"version":3,"file":"keyring-rotation.contracts.js","sourceRoot":"","sources":["../../../../src/key-management/keyring-rotation.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC7G,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,sCAAsC,EAAE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C,GAAG,EAAE,GAAG,sCAAsC,GAAG,IAAI,EACnK,EAAE,OAAO,EAAE,2GAA2G,EAAE,IAAI,EAAE,CAAC,mBAAmB,CAAC,EAAE,CACtJ;KACA,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,KAAK,SAAS,CAAC,EAAE;IAC7G,OAAO,EAAE,gHAAgH;IACzH,IAAI,EAAE,CAAC,eAAe,CAAC;CACxB,CAAC,CAAC;AAGL,uEAAuE;AACvE,MAAM,CAAC,MAAM,6BAA6B,GAAG,mBAAmB,CAAC","sourcesContent":["import { z } from 'zod';\nimport { CRYPTO_KEY_PURPOSE_DESCRIPTORS, CryptoKey_Holding, CryptoKey_Purpose } from '@wildo-ai/saas-models';\nimport { KeyringStatusSchema } from './keyring-status.contracts';\nimport { SIGNATURE_CLOCK_SKEW_TOLERANCE_SECONDS } from './signature-request.contracts';\n\n/**\n * # Rotating a keyring by hand (#2891)\n *\n * The operator's door onto an application's keyring, behind apps-manager's admin secret (`wildo keys rotate`). Three\n * modes, because three different things happened:\n *\n * - {@link KeyringRotationMode.PLANNED}: the published NEXT version is promoted and the ACTIVE one retires, still\n * verifying everything it signed. Refused while NEXT is younger than {@link NEXT_KEY_PUBLICATION_LEAD_SECONDS}: a\n * verifier may not hold it yet.\n * - {@link KeyringRotationMode.EMERGENCY}: the key may have LEAKED. ACTIVE is marked COMPROMISED from the operator's\n * earliest estimate of exposure, its private material is destroyed at once, and NEXT is promoted. Seals made before\n * that instant can still be corroborated; seals after it cannot.\n * - {@link KeyringRotationMode.ROOT_LOST}: the key-encryption root that sealed the LOCAL keys is gone (and not leaked).\n * No sealed key can be opened again, so every version whose material cannot be read is DESTROYED (its public half\n * stays, and still verifies what it signed) and a fresh ACTIVE and NEXT are made under the current root.\n *\n * Only a purpose whose key is held in the platform keyring can be rotated here. The runtime-response key is held in\n * apps-manager's environment ({@link CryptoKey_Holding.CUSTODIAN_ENVIRONMENT}): rotate it by promoting\n * `platform.appsManagerResponseSigning.next*` to the current pair in the environment's secrets, minting a new next, and\n * running `wildo config sync`. A rotation request for it is refused rather than reported as done.\n */\n\n/** Which rotation the operator is asking for. */\nexport enum KeyringRotationMode {\n PLANNED = 'planned',\n EMERGENCY = 'emergency',\n ROOT_LOST = 'root_lost',\n}\n\n/**\n * How long a NEXT version must have been published before a planned rotation may promote it: the application's refresh\n * interval (5 minutes) plus the seal JWKS cache lifetime (5 minutes), with margin. A verifier that fetched the key set\n * just before the NEXT version existed holds it by then.\n */\nexport const NEXT_KEY_PUBLICATION_LEAD_SECONDS = 15 * 60;\n\n/** The admin path of an application's keyring rotation. */\nexport function buildAdminKeyringRotationPath(appSlug: string): string {\n return `/admin/apps/${encodeURIComponent(appSlug)}/keys/rotate`;\n}\n\n/** Whether a purpose's key is held in the platform keyring, so the rotation door may act on it. */\nexport function cryptoKeyPurposeIsKeyringHeld(purpose: CryptoKey_Purpose): boolean {\n return CRYPTO_KEY_PURPOSE_DESCRIPTORS[purpose].holding === CryptoKey_Holding.PLATFORM_KEYRING;\n}\n\n/**\n * Why a purpose the keyring does not hold cannot be rotated here, and what to do instead, by where its key IS held. Each\n * holding has its own procedure (#2892 review F9): an application's own keys have none yet, so pointing at the\n * response-key procedure would send an operator to a step that changes nothing.\n */\nexport function keyringRotationRefusalOf(purpose: CryptoKey_Purpose): string | undefined {\n switch (CRYPTO_KEY_PURPOSE_DESCRIPTORS[purpose].holding) {\n case CryptoKey_Holding.PLATFORM_KEYRING:\n return undefined;\n case CryptoKey_Holding.CUSTODIAN_ENVIRONMENT:\n return `The ${purpose} key is held in apps-manager's environment, not the keyring: rotate it by promoting the next response key in the environment's secrets and running \\`wildo config sync\\`.`;\n case CryptoKey_Holding.APPLICATION_SECRETS:\n return `The ${purpose} key is held in the application's secrets, not the keyring, and its rotation is not built yet (#2895). A key that is missing is minted at the next registration (\\`wildo local init\\`).`;\n default: {\n // A holding added later must name its procedure here: an unhandled one would otherwise read as keyring-held.\n const unhandled: never = CRYPTO_KEY_PURPOSE_DESCRIPTORS[purpose].holding;\n return `The ${purpose} key's holding (${String(unhandled)}) has no rotation procedure here.`;\n }\n }\n}\n\nexport const KeyringRotationRequestSchema = z\n .strictObject({\n purpose: z.enum(CryptoKey_Purpose).default(CryptoKey_Purpose.APPROVAL_SEAL),\n /** For an organization-scoped binding: the organization whose key rotates. Absent for an application-scoped one. */\n organizationId: z.string().min(1).optional(),\n mode: z.enum(KeyringRotationMode).default(KeyringRotationMode.PLANNED),\n /**\n * Emergency only, and required there: the earliest instant the key may have been exposed (ISO 8601). Never defaulted\n * to now, which would vouch for every seal made between the leak and its discovery, and never in the future, which\n * would vouch for seals not yet made.\n */\n compromiseInstant: z.iso.datetime({ offset: true }).optional(),\n /**\n * Emergency and root-lost only, and required there: why, in the operator's words. Recorded on the audit row, where the\n * shared admin secret names nobody. A planned rotation records no reason, so it accepts none.\n */\n justification: z.string().trim().min(10).optional(),\n })\n .superRefine((request, ctx) => {\n const refusal = keyringRotationRefusalOf(request.purpose);\n if (refusal) ctx.addIssue({ code: 'custom', message: refusal, path: ['purpose'] });\n })\n .refine((request) => (request.mode === KeyringRotationMode.EMERGENCY) === (request.compromiseInstant !== undefined), {\n message: 'An emergency rotation states the earliest instant the key may have been exposed (compromiseInstant); no other rotation takes one.',\n path: ['compromiseInstant'],\n })\n .refine(\n (request) => request.compromiseInstant === undefined || new Date(request.compromiseInstant).getTime() <= Date.now() + SIGNATURE_CLOCK_SKEW_TOLERANCE_SECONDS * 1000,\n { message: 'The compromise instant is in the future: name the earliest instant the key may already have been exposed.', path: ['compromiseInstant'] },\n )\n .refine((request) => (request.mode !== KeyringRotationMode.PLANNED) === (request.justification !== undefined), {\n message: 'An emergency or root-lost rotation states why (justification); a planned one records no reason and takes none.',\n path: ['justification'],\n });\nexport type KeyringRotationRequest = z.input<typeof KeyringRotationRequestSchema>;\n\n/** The answer: the application's keyring status after the rotation. */\nexport const KeyringRotationResponseSchema = KeyringStatusSchema;\n"]}
1
+ {"version":3,"file":"keyring-rotation.contracts.js","sourceRoot":"","sources":["../../../src/key-management/keyring-rotation.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC7G,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,sCAAsC,EAAE,MAAM,+BAA+B,CAAC;AAEvF;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,iDAAiD;AACjD,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,8CAAuB,CAAA;IACvB,8CAAuB,CAAA;AACzB,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,GAAG,EAAE,CAAC;AAEzD,2DAA2D;AAC3D,MAAM,UAAU,6BAA6B,CAAC,OAAe;IAC3D,OAAO,eAAe,kBAAkB,CAAC,OAAO,CAAC,cAAc,CAAC;AAClE,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,6BAA6B,CAAC,OAA0B;IACtE,OAAO,8BAA8B,CAAC,OAAO,CAAC,CAAC,OAAO,KAAK,iBAAiB,CAAC,gBAAgB,CAAC;AAChG,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAA0B;IACjE,QAAQ,8BAA8B,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;QACxD,KAAK,iBAAiB,CAAC,gBAAgB;YACrC,OAAO,SAAS,CAAC;QACnB,KAAK,iBAAiB,CAAC,qBAAqB;YAC1C,OAAO,OAAO,OAAO,2KAA2K,CAAC;QACnM,KAAK,iBAAiB,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O,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,mBAAmB,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,KAAK,SAAS,CAAC,EAAE;IACnH,OAAO,EAAE,mIAAmI;IAC5I,IAAI,EAAE,CAAC,mBAAmB,CAAC;CAC5B,CAAC;KACD,MAAM,CACL,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,iBAAiB,KAAK,SAAS,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,sCAAsC,GAAG,IAAI,EACnK,EAAE,OAAO,EAAE,2GAA2G,EAAE,IAAI,EAAE,CAAC,mBAAmB,CAAC,EAAE,CACtJ;KACA,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,KAAK,SAAS,CAAC,EAAE;IAC7G,OAAO,EAAE,gHAAgH;IACzH,IAAI,EAAE,CAAC,eAAe,CAAC;CACxB,CAAC,CAAC;AAGL,uEAAuE;AACvE,MAAM,CAAC,MAAM,6BAA6B,GAAG,mBAAmB,CAAC","sourcesContent":["import { z } from 'zod';\nimport { CRYPTO_KEY_PURPOSE_DESCRIPTORS, CryptoKey_Holding, CryptoKey_Purpose } from '@wildo-ai/saas-models';\nimport { KeyringStatusSchema } from './keyring-status.contracts';\nimport { SIGNATURE_CLOCK_SKEW_TOLERANCE_SECONDS } from './signature-request.contracts';\n\n/**\n * # Rotating a keyring by hand (#2891)\n *\n * The operator's door onto an application's keyring, behind apps-manager's admin secret (`wildo keys rotate`). Three\n * modes, because three different things happened:\n *\n * - {@link KeyringRotationMode.PLANNED}: the published NEXT version is promoted and the ACTIVE one retires, still\n * verifying everything it signed. Refused while NEXT is younger than {@link NEXT_KEY_PUBLICATION_LEAD_SECONDS}: a\n * verifier may not hold it yet.\n * - {@link KeyringRotationMode.EMERGENCY}: the key may have LEAKED. ACTIVE is marked COMPROMISED from the operator's\n * earliest estimate of exposure, its private material is destroyed at once, and NEXT is promoted. Seals made before\n * that instant can still be corroborated; seals after it cannot.\n * - {@link KeyringRotationMode.ROOT_LOST}: the key-encryption root that sealed the LOCAL keys is gone (and not leaked).\n * No sealed key can be opened again, so every version whose material cannot be read is DESTROYED (its public half\n * stays, and still verifies what it signed) and a fresh ACTIVE and NEXT are made under the current root.\n *\n * Only a purpose whose key is held in the platform keyring can be rotated here. The runtime-response key is held in\n * apps-manager's environment ({@link CryptoKey_Holding.CUSTODIAN_ENVIRONMENT}): rotate it by promoting\n * `platform.appsManagerResponseSigning.next*` to the current pair in the environment's secrets, minting a new next, and\n * running `wildo config sync`. A rotation request for it is refused rather than reported as done.\n */\n\n/** Which rotation the operator is asking for. */\nexport enum KeyringRotationMode {\n PLANNED = 'planned',\n EMERGENCY = 'emergency',\n ROOT_LOST = 'root_lost',\n}\n\n/**\n * How long a NEXT version must have been published before a planned rotation may promote it: the application's refresh\n * interval (5 minutes) plus the seal JWKS cache lifetime (5 minutes), with margin. A verifier that fetched the key set\n * just before the NEXT version existed holds it by then.\n */\nexport const NEXT_KEY_PUBLICATION_LEAD_SECONDS = 15 * 60;\n\n/** The admin path of an application's keyring rotation. */\nexport function buildAdminKeyringRotationPath(appSlug: string): string {\n return `/admin/apps/${encodeURIComponent(appSlug)}/keys/rotate`;\n}\n\n/** Whether a purpose's key is held in the platform keyring, so the rotation door may act on it. */\nexport function cryptoKeyPurposeIsKeyringHeld(purpose: CryptoKey_Purpose): boolean {\n return CRYPTO_KEY_PURPOSE_DESCRIPTORS[purpose].holding === CryptoKey_Holding.PLATFORM_KEYRING;\n}\n\n/**\n * Why a purpose the keyring does not hold cannot be rotated here, and what to do instead, by where its key IS held. Each\n * holding has its own procedure (#2892 review F9): pointing an application's own keys at the response-key procedure would\n * send an operator to a step that changes nothing.\n */\nexport function keyringRotationRefusalOf(purpose: CryptoKey_Purpose): string | undefined {\n switch (CRYPTO_KEY_PURPOSE_DESCRIPTORS[purpose].holding) {\n case CryptoKey_Holding.PLATFORM_KEYRING:\n return undefined;\n case CryptoKey_Holding.CUSTODIAN_ENVIRONMENT:\n return `The ${purpose} key is held in apps-manager's environment, not the keyring: rotate it by promoting the next response key in the environment's secrets and running \\`wildo config sync\\`.`;\n case CryptoKey_Holding.APPLICATION_SECRETS:\n return `The ${purpose} key is held in the application's secrets, not the keyring: rotate the application's signing keys with \\`wildo keys rotate-signing-keys --reason \"…\"\\` (#2895). A key that is missing is minted at the next registration (\\`wildo local init\\`).`;\n default: {\n // A holding added later must name its procedure here: an unhandled one would otherwise read as keyring-held.\n const unhandled: never = CRYPTO_KEY_PURPOSE_DESCRIPTORS[purpose].holding;\n return `The ${purpose} key's holding (${String(unhandled)}) has no rotation procedure here.`;\n }\n }\n}\n\nexport const KeyringRotationRequestSchema = z\n .strictObject({\n purpose: z.enum(CryptoKey_Purpose).default(CryptoKey_Purpose.APPROVAL_SEAL),\n /** For an organization-scoped binding: the organization whose key rotates. Absent for an application-scoped one. */\n organizationId: z.string().min(1).optional(),\n mode: z.enum(KeyringRotationMode).default(KeyringRotationMode.PLANNED),\n /**\n * Emergency only, and required there: the earliest instant the key may have been exposed (ISO 8601). Never defaulted\n * to now, which would vouch for every seal made between the leak and its discovery, and never in the future, which\n * would vouch for seals not yet made.\n */\n compromiseInstant: z.iso.datetime({ offset: true }).optional(),\n /**\n * Emergency and root-lost only, and required there: why, in the operator's words. Recorded on the audit row, where the\n * shared admin secret names nobody. A planned rotation records no reason, so it accepts none.\n */\n justification: z.string().trim().min(10).optional(),\n })\n .superRefine((request, ctx) => {\n const refusal = keyringRotationRefusalOf(request.purpose);\n if (refusal) ctx.addIssue({ code: 'custom', message: refusal, path: ['purpose'] });\n })\n .refine((request) => (request.mode === KeyringRotationMode.EMERGENCY) === (request.compromiseInstant !== undefined), {\n message: 'An emergency rotation states the earliest instant the key may have been exposed (compromiseInstant); no other rotation takes one.',\n path: ['compromiseInstant'],\n })\n .refine(\n (request) => request.compromiseInstant === undefined || new Date(request.compromiseInstant).getTime() <= Date.now() + SIGNATURE_CLOCK_SKEW_TOLERANCE_SECONDS * 1000,\n { message: 'The compromise instant is in the future: name the earliest instant the key may already have been exposed.', path: ['compromiseInstant'] },\n )\n .refine((request) => (request.mode !== KeyringRotationMode.PLANNED) === (request.justification !== undefined), {\n message: 'An emergency or root-lost rotation states why (justification); a planned one records no reason and takes none.',\n path: ['justification'],\n });\nexport type KeyringRotationRequest = z.input<typeof KeyringRotationRequestSchema>;\n\n/** The answer: the application's keyring status after the rotation. */\nexport const KeyringRotationResponseSchema = KeyringStatusSchema;\n"]}
@@ -3,11 +3,9 @@ import { CryptoKey_MaterialAccess, CryptoKey_MaterialProvenance, CryptoKey_Prote
3
3
  /** One key version, as the application stores it. Instants are ISO 8601. */
4
4
  export declare const KeyringStatusVersionSchema: z.ZodObject<{
5
5
  kid: z.ZodString;
6
- /** The JWS algorithm the key verifies; pinned per key, never taken from a seal's header. */
7
6
  alg: z.ZodLiteral<"ES256">;
8
7
  purpose: z.ZodEnum<typeof CryptoKey_Purpose>;
9
8
  scope: z.ZodEnum<typeof CryptoKey_Scope>;
10
- /** The application's id for an application-scoped key, the organization's for an organization-scoped one. */
11
9
  scopeId: z.ZodString;
12
10
  generation: z.ZodNumber;
13
11
  state: z.ZodEnum<typeof CryptoKey_VersionState>;
@@ -25,21 +23,17 @@ export declare const KeyringStatusVersionSchema: z.ZodObject<{
25
23
  activatedAt: z.ZodOptional<z.ZodString>;
26
24
  retiredAt: z.ZodOptional<z.ZodString>;
27
25
  compromisedAt: z.ZodOptional<z.ZodString>;
28
- /** The earliest instant the material may have been exposed: a seal before it can still be corroborated. */
29
26
  compromiseInstant: z.ZodOptional<z.ZodString>;
30
27
  privateMaterialDestroyedAt: z.ZodOptional<z.ZodString>;
31
28
  }, z.core.$strict>;
32
29
  export type KeyringStatusVersion = z.infer<typeof KeyringStatusVersionSchema>;
33
30
  export declare const KeyringStatusSchema: z.ZodObject<{
34
- /** The issuer the custodian sets on this application's seals. */
35
31
  iss: z.ZodString;
36
32
  versions: z.ZodArray<z.ZodObject<{
37
33
  kid: z.ZodString;
38
- /** The JWS algorithm the key verifies; pinned per key, never taken from a seal's header. */
39
34
  alg: z.ZodLiteral<"ES256">;
40
35
  purpose: z.ZodEnum<typeof CryptoKey_Purpose>;
41
36
  scope: z.ZodEnum<typeof CryptoKey_Scope>;
42
- /** The application's id for an application-scoped key, the organization's for an organization-scoped one. */
43
37
  scopeId: z.ZodString;
44
38
  generation: z.ZodNumber;
45
39
  state: z.ZodEnum<typeof CryptoKey_VersionState>;
@@ -57,7 +51,6 @@ export declare const KeyringStatusSchema: z.ZodObject<{
57
51
  activatedAt: z.ZodOptional<z.ZodString>;
58
52
  retiredAt: z.ZodOptional<z.ZodString>;
59
53
  compromisedAt: z.ZodOptional<z.ZodString>;
60
- /** The earliest instant the material may have been exposed: a seal before it can still be corroborated. */
61
54
  compromiseInstant: z.ZodOptional<z.ZodString>;
62
55
  privateMaterialDestroyedAt: z.ZodOptional<z.ZodString>;
63
56
  }, z.core.$strict>>;
@@ -1 +1 @@
1
- {"version":3,"file":"keyring-status.contracts.d.ts","sourceRoot":"","sources":["../../../../src/key-management/keyring-status.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAiB/B,4EAA4E;AAC5E,eAAO,MAAM,0BAA0B;;IAErC,4FAA4F;;;;IAI5F,6GAA6G;;;;;;;;;;;;;;;;;;IAa7G,2GAA2G;;;kBAG3G,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,mBAAmB;IAC9B,iEAAiE;;;;QAxBjE,4FAA4F;;;;QAI5F,6GAA6G;;;;;;;;;;;;;;;;;;QAa7G,2GAA2G;;;;kBAU3G,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"keyring-status.contracts.d.ts","sourceRoot":"","sources":["../../../src/key-management/keyring-status.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAiB/B,4EAA4E;AAC5E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;kBAsBrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAI9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"keyring-status.contracts.js","sourceRoot":"","sources":["../../../../src/key-management/keyring-status.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;GAUG;AAEH,MAAM,mBAAmB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,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M,EAAE,CAAC,QAAQ,EAAE;IAChC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,2GAA2G;IAC3G,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,0BAA0B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,YAAY,CAAC;IAChD,iEAAiE;IACjE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC;CAC9C,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n CryptoKey_MaterialAccess,\n CryptoKey_MaterialProvenance,\n CryptoKey_ProtectionLevel,\n CryptoKey_Purpose,\n CryptoKey_Scope,\n CryptoKey_VersionState,\n} from '@wildo-ai/saas-models';\nimport { ES256_JWS_ALGORITHM } from './es256-jws';\n\n/**\n * # Keyring status (#2891)\n *\n * What the platform custodian tells an application about the keys it signs with for it: every version of every\n * published-verification keyring, public halves only, in a SIGNED answer (#2921). The application stores each version in\n * its own `publishedVerificationKeys` resource, so a seal it holds verifies from its own store, and keeps verifying after\n * a rotation, after the keyring is rebuilt, and after the application moves to another platform.\n *\n * A COMPROMISED version is listed with its compromise instant, so the application can move it out of its live JWKS and\n * into its compromised-keys document. A DESTROYED version is listed too: only its private half is gone.\n */\n\nconst P256PublicJwkSchema = z.strictObject({ kty: z.literal('EC'), crv: z.literal('P-256'), x: z.string().min(1), y: z.string().min(1) });\n\n/** One key version, as the application stores it. Instants are ISO 8601. */\nexport const KeyringStatusVersionSchema = z.strictObject({\n kid: z.string().min(1),\n /** The JWS algorithm the key verifies; pinned per key, never taken from a seal's header. */\n alg: z.literal(ES256_JWS_ALGORITHM),\n purpose: z.enum(CryptoKey_Purpose),\n scope: z.enum(CryptoKey_Scope),\n /** The application's id for an application-scoped key, the organization's for an organization-scoped one. */\n scopeId: z.string().min(1),\n generation: z.number().int().min(1),\n state: z.enum(CryptoKey_VersionState),\n providerRef: z.string().min(1),\n protectionLevel: z.enum(CryptoKey_ProtectionLevel),\n materialAccess: z.enum(CryptoKey_MaterialAccess),\n provenance: z.enum(CryptoKey_MaterialProvenance),\n publicJwk: P256PublicJwkSchema,\n createdAt: z.string(),\n activatedAt: z.string().optional(),\n retiredAt: z.string().optional(),\n compromisedAt: z.string().optional(),\n /** The earliest instant the material may have been exposed: a seal before it can still be corroborated. */\n compromiseInstant: z.string().optional(),\n privateMaterialDestroyedAt: z.string().optional(),\n});\nexport type KeyringStatusVersion = z.infer<typeof KeyringStatusVersionSchema>;\n\nexport const KeyringStatusSchema = z.strictObject({\n /** The issuer the custodian sets on this application's seals. */\n iss: z.string().min(1),\n versions: z.array(KeyringStatusVersionSchema),\n});\nexport type KeyringStatus = z.infer<typeof KeyringStatusSchema>;\n"]}
1
+ {"version":3,"file":"keyring-status.contracts.js","sourceRoot":"","sources":["../../../src/key-management/keyring-status.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;GAUG;AAEH,MAAM,mBAAmB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAA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AAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,YAAY,CAAC;IAChD,iEAAiE;IACjE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC;CAC9C,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n CryptoKey_MaterialAccess,\n CryptoKey_MaterialProvenance,\n CryptoKey_ProtectionLevel,\n CryptoKey_Purpose,\n CryptoKey_Scope,\n CryptoKey_VersionState,\n} from '@wildo-ai/saas-models';\nimport { ES256_JWS_ALGORITHM } from './es256-jws';\n\n/**\n * # Keyring status (#2891)\n *\n * What the platform custodian tells an application about the keys it signs with for it: every version of every\n * published-verification keyring, public halves only, in a SIGNED answer (#2921). The application stores each version in\n * its own `publishedVerificationKeys` resource, so a seal it holds verifies from its own store, and keeps verifying after\n * a rotation, after the keyring is rebuilt, and after the application moves to another platform.\n *\n * A COMPROMISED version is listed with its compromise instant, so the application can move it out of its live JWKS and\n * into its compromised-keys document. A DESTROYED version is listed too: only its private half is gone.\n */\n\nconst P256PublicJwkSchema = z.strictObject({ kty: z.literal('EC'), crv: z.literal('P-256'), x: z.string().min(1), y: z.string().min(1) });\n\n/** One key version, as the application stores it. Instants are ISO 8601. */\nexport const KeyringStatusVersionSchema = z.strictObject({\n kid: z.string().min(1),\n /** The JWS algorithm the key verifies; pinned per key, never taken from a seal's header. */\n alg: z.literal(ES256_JWS_ALGORITHM),\n purpose: z.enum(CryptoKey_Purpose),\n scope: z.enum(CryptoKey_Scope),\n /** The application's id for an application-scoped key, the organization's for an organization-scoped one. */\n scopeId: z.string().min(1),\n generation: z.number().int().min(1),\n state: z.enum(CryptoKey_VersionState),\n providerRef: z.string().min(1),\n protectionLevel: z.enum(CryptoKey_ProtectionLevel),\n materialAccess: z.enum(CryptoKey_MaterialAccess),\n provenance: z.enum(CryptoKey_MaterialProvenance),\n publicJwk: P256PublicJwkSchema,\n createdAt: z.string(),\n activatedAt: z.string().optional(),\n retiredAt: z.string().optional(),\n compromisedAt: z.string().optional(),\n /** The earliest instant the material may have been exposed: a seal before it can still be corroborated. */\n compromiseInstant: z.string().optional(),\n privateMaterialDestroyedAt: z.string().optional(),\n});\nexport type KeyringStatusVersion = z.infer<typeof KeyringStatusVersionSchema>;\n\nexport const KeyringStatusSchema = z.strictObject({\n /** The issuer the custodian sets on this application's seals. */\n iss: z.string().min(1),\n versions: z.array(KeyringStatusVersionSchema),\n});\nexport type KeyringStatus = z.infer<typeof KeyringStatusSchema>;\n"]}
@@ -0,0 +1,158 @@
1
+ /**
2
+ * # Appending to a PDF without touching its bytes (#2907)
3
+ *
4
+ * The smallest PDF capability the manifested copy of an approved deliverable needs, written here because the PDF stack
5
+ * the engine has (`@react-pdf/renderer`) renders whole documents and cannot open an existing one. It does exactly two
6
+ * things: READ enough of a PDF to locate its page tree (the cross-reference chain, the trailer, a handful of objects), and
7
+ * APPEND an incremental-update section that adds objects and redefines one existing object. The original bytes are never
8
+ * rewritten: the result is the original, byte for byte, followed by the new section, which every conforming reader
9
+ * applies on top. That property is the point: a verifier holding the copy holds the original as its prefix.
10
+ *
11
+ * Supported: classic cross-reference tables, cross-reference streams (FlateDecode, with or without a PNG predictor), hybrid
12
+ * files (`/XRefStm`), objects held in object streams, a `/Prev` chain of earlier updates. Refused with a typed reason:
13
+ * an encrypted file (`/Encrypt`: the appended objects would have to be encrypted too), a file that does not begin with
14
+ * `%PDF-`, and any structure this reader cannot follow (a filter other than FlateDecode on a stream it must decode, a
15
+ * page-tree root whose `/Kids` is not a direct array). A refusal is a statement that no copy can be made, never a guess.
16
+ *
17
+ * Deliberately NOT a general PDF library: it parses objects only to re-serialize the one it redefines, and serializes
18
+ * every string as hexadecimal and every number by its original token, so a value it did not change is written with the
19
+ * same meaning. Everything it writes is a pure function of its inputs, so the same inputs give the same bytes, which is
20
+ * what lets the verifier rebuild a copy and compare.
21
+ *
22
+ * Rejected: adopting pdf-lib (#2907 named it as the candidate). It saves by rewriting the whole file (no incremental
23
+ * save), so the copy would no longer carry the original as its prefix, and the verifier would need the original from
24
+ * elsewhere to tie the two; adding it also meant a dependency and lockfile change in every application.
25
+ *
26
+ * spec-cite: ISO 32000-1:2008 §7.3 (objects), §7.5.4 (cross-reference table), §7.5.5 (file trailer), §7.5.6 (incremental
27
+ * updates), §7.5.7 (object streams), §7.5.8 (cross-reference streams, hybrid files), §7.4.4.4 (PNG predictors, by reference
28
+ * to the FlateDecode parameters). Cited by section; the subset implemented is this file's decision.
29
+ */
30
+ /** Why a PDF cannot be appended to. */
31
+ export declare enum PdfIncrementalUpdateRefusal {
32
+ /** The bytes do not begin with a PDF header. */
33
+ NOT_A_PDF = "not_a_pdf",
34
+ /** The file is encrypted: appended objects would have to be encrypted with a key nobody here holds. */
35
+ ENCRYPTED = "encrypted",
36
+ /** A structure this reader does not follow (named in the message). */
37
+ UNSUPPORTED_STRUCTURE = "unsupported_structure"
38
+ }
39
+ /** A PDF that cannot be appended to, and why. */
40
+ export declare class PdfIncrementalUpdateRefusedError extends Error {
41
+ readonly refusal: PdfIncrementalUpdateRefusal;
42
+ constructor(refusal: PdfIncrementalUpdateRefusal, message: string);
43
+ }
44
+ /** A PDF object as this reader models it (ISO 32000-1 §7.3). */
45
+ export type PdfObject = {
46
+ readonly kind: 'null';
47
+ } | {
48
+ readonly kind: 'bool';
49
+ readonly value: boolean;
50
+ }
51
+ /** The number's token as written, so a value this module does not change is re-serialized unchanged. */
52
+ | {
53
+ readonly kind: 'number';
54
+ readonly text: string;
55
+ }
56
+ /** The name's bytes, decoded from `#xx` escapes, as a latin1 string. */
57
+ | {
58
+ readonly kind: 'name';
59
+ readonly value: string;
60
+ } | {
61
+ readonly kind: 'string';
62
+ readonly bytes: Buffer;
63
+ } | {
64
+ readonly kind: 'array';
65
+ readonly items: readonly PdfObject[];
66
+ }
67
+ /** Entries in the order they were read. */
68
+ | {
69
+ readonly kind: 'dict';
70
+ readonly entries: ReadonlyMap<string, PdfObject>;
71
+ } | {
72
+ readonly kind: 'ref';
73
+ readonly num: number;
74
+ readonly gen: number;
75
+ };
76
+ export type PdfDict = Extract<PdfObject, {
77
+ kind: 'dict';
78
+ }>;
79
+ export type PdfRef = Extract<PdfObject, {
80
+ kind: 'ref';
81
+ }>;
82
+ /** Constructors, for the objects a caller appends. */
83
+ export declare const pdf: {
84
+ null: () => PdfObject;
85
+ bool: (value: boolean) => PdfObject;
86
+ int: (value: number) => PdfObject;
87
+ /** A real written with at most 2 decimals, without exponent: deterministic. */
88
+ real: (value: number) => PdfObject;
89
+ name: (value: string) => PdfObject;
90
+ string: (value: string | Buffer) => PdfObject;
91
+ array: (items: readonly PdfObject[]) => PdfObject;
92
+ dict: (entries: Record<string, PdfObject | undefined>) => PdfDict;
93
+ ref: (num: number, gen?: number) => PdfRef;
94
+ };
95
+ /** A real number as a PDF token: no exponent, at most two decimals, trailing zeros dropped. */
96
+ export declare function formatPdfReal(value: number): string;
97
+ /** One object as PDF syntax, latin1. Strings are hexadecimal; numbers keep their token. */
98
+ export declare function serializePdfObject(object: PdfObject): string;
99
+ /** A literal string's syntax (§7.3.4.2) for latin1 text: `(`, `)` and `\` escaped. For content streams. */
100
+ export declare function pdfLiteralString(latin1: string): string;
101
+ /** The layout of the most recent cross-reference section, which an update continues. */
102
+ export declare enum PdfCrossReferenceForm {
103
+ TABLE = "table",
104
+ STREAM = "stream"
105
+ }
106
+ /** A PDF read for appending: its cross-reference chain, its latest trailer, and an object resolver. */
107
+ export declare class PdfDocumentReader {
108
+ readonly bytes: Buffer;
109
+ private readonly entries;
110
+ /** The latest trailer (the xref stream's dictionary when the latest section is a stream). */
111
+ readonly trailer: PdfDict;
112
+ /** The offset of the latest cross-reference section: what an update's `/Prev` names. */
113
+ readonly lastXrefOffset: number;
114
+ readonly lastXrefForm: PdfCrossReferenceForm;
115
+ private readonly objectStreams;
116
+ constructor(bytes: Buffer);
117
+ /** The number one past the highest object number in use: where appended objects start. */
118
+ get size(): number;
119
+ /** Record an entry unless a later section already defined that object. */
120
+ private setEntry;
121
+ private readSection;
122
+ /** A cross-reference stream at `offset`: its entries recorded, its dictionary returned (§7.5.8). */
123
+ private readXrefStream;
124
+ /** The `num gen obj` at `offset`: its header checked, its value read, its stream data when it has one. */
125
+ private readIndirectAt;
126
+ private readStreamAt;
127
+ /** The value of an object, a reference followed (a chain of at most 16), a missing or free object as `null`. */
128
+ resolve(object: PdfObject | undefined, hops?: number): PdfObject;
129
+ /** Object `num`'s current definition. */
130
+ readObject(num: number, gen?: number): PdfObject;
131
+ /**
132
+ * The raw (still encoded) data of stream object `num`, when it is stored at an offset; undefined otherwise. What a
133
+ * reader of an update uses to take back the streams it wrote, which are written unencoded.
134
+ */
135
+ streamDataOf(num: number): Buffer | undefined;
136
+ /** The generation an object is currently defined with: what a redefinition of it must reuse. */
137
+ generationOf(num: number): number;
138
+ private objectStream;
139
+ /** A dictionary, a reference followed; refused when the value is not one. */
140
+ dictOf(object: PdfObject | undefined, what: string): PdfDict;
141
+ /** A box (`/MediaBox`) as four numbers, a reference followed; undefined when it is not one. */
142
+ boxOf(object: PdfObject | undefined): readonly [number, number, number, number] | undefined;
143
+ }
144
+ /** One object an update writes: a new one, or a redefinition of an existing number (same generation). */
145
+ export interface PdfUpdateObject {
146
+ readonly num: number;
147
+ readonly gen: number;
148
+ readonly value: PdfObject;
149
+ /** Raw stream data, written unencoded; `/Length` is set from it. */
150
+ readonly stream?: Buffer;
151
+ }
152
+ /**
153
+ * The update section, appended after `prelude` (bytes the caller places first, a comment line). The trailer carries the
154
+ * previous one's `/Root`, `/Info` and `/ID` unchanged, a `/Size` past the highest object written, and `/Prev`; it is
155
+ * written in the form the latest section used, so a file read through cross-reference streams stays that way.
156
+ */
157
+ export declare function appendPdfIncrementalUpdate(reader: PdfDocumentReader, prelude: string, objects: readonly PdfUpdateObject[]): Buffer;
158
+ //# sourceMappingURL=pdf-incremental-update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdf-incremental-update.d.ts","sourceRoot":"","sources":["../../../src/key-management/pdf-incremental-update.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,uCAAuC;AACvC,oBAAY,2BAA2B;IACrC,gDAAgD;IAChD,SAAS,cAAc;IACvB,uGAAuG;IACvG,SAAS,cAAc;IACvB,sEAAsE;IACtE,qBAAqB,0BAA0B;CAChD;AAED,iDAAiD;AACjD,qBAAa,gCAAiC,SAAQ,KAAK;IAC7C,QAAQ,CAAC,OAAO,EAAE,2BAA2B;gBAApC,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,MAAM;CAI3E;AAED,gEAAgE;AAChE,MAAM,MAAM,SAAS,GACjB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE;AACpD,wGAAwG;GACtG;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AACpD,wEAAwE;GACtE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAA;CAAE;AAClE,2CAA2C;GACzC;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,M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