@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":"approval-seal-verifier.js","sourceRoot":"","sources":["../../../../src/key-management/approval-seal-verifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,sBAAsB,EAAwB,MAAM,uBAAuB,CAAC;AAC1I,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxJ,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,GAG/B,MAAM,2BAA2B,CAAC;AAEnC,qC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C,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAErI;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3D,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACvD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5C,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;CACjK,CAAC,CAAC","sourcesContent":["/**\n * # Verifying an approval seal, offline (#2903)\n *\n * Everything a verifier needs travels with the seal: the compact JWS, the stored records of the keys that may have signed\n * it (their public half, scope and issuer, as an export carries them), and, when the person's content is to be shown,\n * the disclosures. Nothing here calls the application or the platform, so a seal verifies after the application is gone.\n *\n * ## What is checked, and on whose authority\n *\n * - The header: ES256 is pinned per key from the key RECORD, never read from the header (RFC 8725 §3.1); `jku`, `x5u`,\n * `jwk` and `x5c` are never followed (RFC 8725 §3.10, RFC 7515 §10.7); a `crit` naming anything is refused, since no\n * extension is understood (RFC 7515 §4.1.11); `typ` must be the approval seal's.\n * - The signature, under the key the `kid` names among those given.\n * - The issuer: the payload's `iss` must be the key record's, and the expected issuer when one is given.\n * - The claims: the version-1 shape, strict.\n * - The key's scope, from its stored record and never from a JWKS member: an organization-scoped key verifies only a seal\n * whose tenant is that organization.\n * - The disclosures: each must digest to the commitment its claim names; a commitment with no disclosure is reported as\n * erased (the person's content was removed, the seal stands).\n * - A COMPROMISED key: the signature may still verify, but the seal is not PROVABLE unless corroborated by evidence the\n * key's holder could not have forged: the decision's payload digest recorded outside the application before the\n * compromise instant (an exported audit event, an immutable sink).\n * - The OPERATOR'S PIN SET, when one is given (#2932): the key must be pinned, by the RFC 7638 thumbprint of the public\n * half the verifier was handed (so a key record that names a pinned `kid` over another key is refused), and the pin's\n * state, scope and compromise instant are used instead of the record's. The record (from a bundle, from the host)\n * only supplies the public half and the issuer; the operator's pin decides whether that half is theirs and what became\n * of it. Without a pin set the records are trusted as given, as before.\n * - The OPERATOR'S KEPT SIGNING-LOG EXPORTS, when given (#2932): a seal under a key compromised after an export that lists\n * it is corroborated by that export, which the host could not have signed after the compromise without the operator's\n * copy disagreeing. Each export is verified here, with the operator's pin set for the export key.\n *\n * spec-cite: RFC 8725 §3.1 (algorithm verification), §3.10 (do not trust received URLs); RFC 7515 §4.1.11 (`crit`),\n * §10.7 (key selection from header parameters). Cited by section; the behaviour is this file's decision.\n */\nimport { z } from 'zod';\nimport { singleJwsTypeOf, CryptoKey_Purpose, CryptoKey_Scope, CryptoKey_VersionState, type CryptoKeyPinSet } from '@wildo-ai/saas-models';\nimport { ES256_JWS_ALGORITHM, isP256PublicJwk, verifyEs256, type P256PublicJwk } from './es256-jws';\nimport { decisionPayloadDigestOf, sealClaimsDigestOf } from './signature-request.contracts';\nimport { VerificationKeyRecordSchema, compareSigningLogExports, pinnedVerificationKeyOf, verifySigningLogExport } from './signing-log-export.contracts';\nimport {\n ApprovalSealClaimsV1Schema,\n ApprovalSealDisclosureClaim,\n approvalSealDisclosureDigestOf,\n type ApprovalSealClaimsV1,\n type ApprovalSealDisclosureValue,\n} from './approval-seal.contracts';\n\n/** The approval seal's JWS `typ`. */\nconst APPROVAL_SEAL_TYP = singleJwsTypeOf(CryptoKey_Purpose.APPROVAL_SEAL);\n\n/** The payload members the custodian sets; the rest is the decision's committed payload. */\nconst CUSTODIAN_SET_CLAIMS = ['iss', 'iat', 'lateSeal'] as const;\n\n/** One key that may have signed a seal: its STORED record (scope, issuer, state), as an export carries it. */\nexport interface ApprovalSealVerificationKey {\n readonly kid: string;\n readonly publicJwk: P256PublicJwk;\n /** The algorithm the key record pins. ES256 for every approval-seal key today. */\n readonly alg: typeof ES256_JWS_ALGORITHM;\n readonly scope: CryptoKey_Scope;\n /** The application's id for an APPLICATION key, the organization's for an ORGANIZATION key. */\n readonly scopeId: string;\n readonly iss: string;\n readonly state: CryptoKey_VersionState;\n /** ISO 8601, for a COMPROMISED key: the earliest instant its private half may have been exposed. */\n readonly compromiseInstant?: string;\n}\n\n/** Evidence recorded OUTSIDE the application that the decision's payload existed before a key's compromise. */\nexport interface ApprovalSealCorroboration {\n readonly decisionPayloadDigest: string;\n /** ISO 8601: when the evidence was recorded where the key's holder could not rewrite it. */\n readonly recordedAt: string;\n}\n\nexport interface ApprovalSealVerificationInput {\n readonly jws: string;\n readonly keys: readonly ApprovalSealVerificationKey[];\n /** The issuer the seal must carry, when the verifier knows which application it expects. */\n readonly expectedIssuer?: string;\n readonly disclosures?: readonly ApprovalSealDisclosureValue[];\n readonly corroboration?: ApprovalSealCorroboration;\n /** The operator's pin set for approval seals (#2932), from a channel the host does not control. */\n readonly pins?: CryptoKeyPinSet;\n /**\n * The signing-log exports the operator kept (#2932), with the records of the keys that signed them and the operator's\n * pin set for SIGNING_LOG_EXPORT. An export that does not verify, or was signed after its own key's compromise, is\n * ignored: it corroborates nothing.\n */\n readonly signingLogExports?: {\n readonly exports: readonly string[];\n readonly keys: readonly ApprovalSealVerificationKey[];\n readonly pins?: CryptoKeyPinSet;\n };\n}\n\n/** What corroborated a seal under a compromised key. */\nexport enum ApprovalSealCorroborationSource {\n /** The decision's payload digest, recorded outside the application before the compromise. */\n RECORDED_EVIDENCE = 'recorded_evidence',\n /** A signing-log export the operator kept, signed before the compromise, lists the seal. */\n SIGNING_LOG_EXPORT = 'signing_log_export',\n}\n\n/** Why a seal does not verify. */\nexport enum ApprovalSealVerificationFailure {\n /** Not a compact JWS with a JSON header and payload. */\n MALFORMED = 'malformed',\n /** The header's `alg` is not the one the key record pins. */\n ALGORITHM_NOT_PINNED = 'algorithm_not_pinned',\n /** The header names a critical extension, and none is understood. */\n CRITICAL_EXTENSION = 'critical_extension',\n /** The header's `typ` is not the approval seal's. */\n TYPE_MISMATCH = 'type_mismatch',\n /** No given key has the header's `kid`. */\n UNKNOWN_KEY = 'unknown_key',\n SIGNATURE_INVALID = 'signature_invalid',\n /** The payload's issuer is not the key record's, or not the expected one. */\n ISSUER_MISMATCH = 'issuer_mismatch',\n /** The payload is not the version-1 claims shape. */\n CLAIMS_INVALID = 'claims_invalid',\n /** The key's stored scope does not cover the seal's tenant (or is not a scope a seal is signed under). */\n TENANT_OUTSIDE_KEY_SCOPE = 'tenant_outside_key_scope',\n /** A disclosure does not digest to the commitment its claim names. */\n DISCLOSURE_MISMATCH = 'disclosure_mismatch',\n /** A pin set was given and does not pin the key, or the key handed over is not the one its pinned `kid` names. */\n UNPINNED = 'unpinned',\n}\n\n/** What the seal says about one person's disclosure. */\nexport enum ApprovalSealDisclosureStanding {\n /** Given, and it digests to the commitment. */\n DISCLOSED = 'disclosed',\n /** Committed to, and not given: the content was erased (or withheld). The seal stands. */\n ERASED = 'erased',\n}\n\nexport interface ApprovalSealVerification {\n /** The signature verifies, under a key whose record covers the seal, over well-formed claims and matching disclosures. */\n readonly valid: boolean;\n readonly failures: readonly ApprovalSealVerificationFailure[];\n /**\n * The seal proves what it says: valid, and its key not compromised, or corroborated before the compromise. A valid seal\n * under a compromised key, uncorroborated, is reported valid and NOT provable.\n */\n readonly provable: boolean;\n /** For a seal under a compromised key, what corroborated it; absent when nothing did (or nothing needed to). */\n readonly corroboratedBy?: ApprovalSealCorroborationSource;\n readonly kid?: string;\n readonly keyState?: CryptoKey_VersionState;\n readonly claims?: ApprovalSealClaimsV1;\n readonly iss?: string;\n /** The signing instant, epoch seconds. */\n readonly iat?: number;\n readonly lateSeal?: boolean;\n /** Seconds between the decision and its signature: what the database held at signing is what is sealed. */\n readonly signingWindowSeconds?: number;\n /** The digest of the decision's committed payload, to compare with the RESOLVED row of an exported trail. */\n readonly decisionPayloadDigest?: string;\n readonly approver?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n readonly requester?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n /** What the person was shown (#2903 S6), when the seal binds it: DISCLOSED with the presentation, else not given. */\n readonly presentation?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n /** What the person answered, when the seal binds it. */\n readonly statement?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n}\n\nfunction decodeJson(part: string | undefined): Record<string, unknown> | null {\n if (!part) return null;\n try {\n const value: unknown = JSON.parse(Buffer.from(part, 'base64url').toString('utf8'));\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? (value as Record<string, unknown>) : null;\n } catch {\n return null;\n }\n}\n\nfunction disclosureStanding(\n claimName: ApprovalSealDisclosureClaim,\n commitment: string | undefined,\n disclosures: readonly ApprovalSealDisclosureValue[],\n failures: ApprovalSealVerificationFailure[],\n): ApprovalSealVerification['approver'] {\n if (!commitment) return undefined;\n const given = disclosures.filter((disclosure) => disclosure.claimName === claimName);\n if (given.length === 0) return { standing: ApprovalSealDisclosureStanding.ERASED };\n const matching = given.find((disclosure) => approvalSealDisclosureDigestOf(disclosure) === commitment);\n if (!matching) {\n failures.push(ApprovalSealVerificationFailure.DISCLOSURE_MISMATCH);\n return { standing: ApprovalSealDisclosureStanding.ERASED };\n }\n return { standing: ApprovalSealDisclosureStanding.DISCLOSED, value: matching.value };\n}\n\n/**\n * What corroborates a seal under a compromised key, if anything: evidence of its payload recorded before the compromise,\n * or a kept export signed before the compromise that lists this exact seal (its issuer, its key, its signed claims).\n */\nfunction corroborationOf(\n input: ApprovalSealVerificationInput,\n key: ApprovalSealVerificationKey,\n payload: Readonly<Record<string, unknown>>,\n decisionPayloadDigest: string,\n): ApprovalSealCorroborationSource | undefined {\n if (key.compromiseInstant === undefined) return undefined;\n const compromisedFrom = Date.parse(key.compromiseInstant);\n if (input.corroboration && input.corroboration.decisionPayloadDigest === decisionPayloadDigest && Date.parse(input.corroboration.recordedAt) < compromisedFrom) {\n return ApprovalSealCorroborationSource.RECORDED_EVIDENCE;\n }\n const logged = input.signingLogExports;\n if (!logged) return undefined;\n const claimsDigest = sealClaimsDigestOf(payload);\n const evidence = logged.exports.flatMap((jws) => {\n const exported = verifySigningLogExport({ jws, keys: logged.keys, ...(logged.pins ? { pins: logged.pins } : {}), expectedIssuer: key.iss });\n return exported.provable && exported.claims ? [exported.claims] : [];\n });\n // The exports must agree with each other first (#2932 review M3): an export is dated by the instant it states for\n // itself, so a host holding the export key could sign one dated before the compromise; it disagrees with the operator's\n // kept exports (a different hash at some sequence, or a head behind an earlier one), and then none of them corroborates.\n if (!compareSigningLogExports(evidence).consistent) return undefined;\n for (const claims of evidence) {\n if (claims.iat * 1000 >= compromisedFrom) continue;\n const lists = claims.entries.some((entry) =>\n entry.purpose === CryptoKey_Purpose.APPROVAL_SEAL && entry.kid === key.kid && entry.iss === key.iss && entry.claimsDigest === claimsDigest);\n if (lists) return ApprovalSealCorroborationSource.SIGNING_LOG_EXPORT;\n }\n return undefined;\n}\n\n/** See the file's header. Pure and offline. */\nexport function verifyApprovalSeal(input: ApprovalSealVerificationInput): ApprovalSealVerification {\n const failures: ApprovalSealVerificationFailure[] = [];\n const fail = (failure: ApprovalSealVerificationFailure, extra: Partial<ApprovalSealVerification> = {}): ApprovalSealVerification =>\n ({ valid: false, provable: false, failures: [...failures, failure], ...extra });\n\n const parts = input.jws.split('.');\n const header = parts.length === 3 ? decodeJson(parts[0]) : null;\n const payload = parts.length === 3 ? decodeJson(parts[1]) : null;\n if (!header || !payload || !parts[2]) return fail(ApprovalSealVerificationFailure.MALFORMED);\n\n const kid = typeof header.kid === 'string' ? header.kid : undefined;\n // The key is chosen by `kid` among the keys the verifier was GIVEN; `jku`/`x5u`/`jwk`/`x5c` are never read.\n const record = kid ? input.keys.find((candidate) => candidate.kid === kid) : undefined;\n if (!record || !isP256PublicJwk(record.publicJwk)) return fail(ApprovalSealVerificationFailure.UNKNOWN_KEY, kid ? { kid } : {});\n // The operator's pin, when given: the key handed over must be the one the pinned thumbprint names, and the pin (not\n // the record) says what became of it.\n const key = pinnedVerificationKeyOf(record, input.pins);\n if (!key) return fail(ApprovalSealVerificationFailure.UNPINNED, { kid });\n if (header.alg !== key.alg || key.alg !== ES256_JWS_ALGORITHM) return fail(ApprovalSealVerificationFailure.ALGORITHM_NOT_PINNED, { kid });\n if (header.crit !== undefined) return fail(ApprovalSealVerificationFailure.CRITICAL_EXTENSION, { kid });\n if (header.typ !== APPROVAL_SEAL_TYP) return fail(ApprovalSealVerificationFailure.TYPE_MISMATCH, { kid });\n if (!verifyEs256(`${parts[0]}.${parts[1]}`, Buffer.from(parts[2], 'base64url'), key.publicJwk)) {\n return fail(ApprovalSealVerificationFailure.SIGNATURE_INVALID, { kid, keyState: key.state });\n }\n\n const iss = typeof payload.iss === 'string' ? payload.iss : undefined;\n const iat = typeof payload.iat === 'number' ? payload.iat : undefined;\n const lateSeal = payload.lateSeal === true;\n if (!iss || iss !== key.iss || (input.expectedIssuer !== undefined && iss !== input.expectedIssuer)) failures.push(ApprovalSealVerificationFailure.ISSUER_MISMATCH);\n\n const committed = Object.fromEntries(Object.entries(payload).filter(([name]) => !(CUSTODIAN_SET_CLAIMS as readonly string[]).includes(name)));\n const parsed = ApprovalSealClaimsV1Schema.safeParse(committed);\n if (!parsed.success) return fail(ApprovalSealVerificationFailure.CLAIMS_INVALID, { kid, keyState: key.state, ...(iss ? { iss } : {}) });\n const claims = parsed.data;\n\n // The key's scope from its RECORD: an organization key covers only that organization's decisions.\n const scopeCovers = key.scope === CryptoKey_Scope.APPLICATION || (key.scope === CryptoKey_Scope.ORGANIZATION && claims.tenant === key.scopeId);\n if (!scopeCovers) failures.push(ApprovalSealVerificationFailure.TENANT_OUTSIDE_KEY_SCOPE);\n\n const disclosures = input.disclosures ?? [];\n const approver = disclosureStanding(ApprovalSealDisclosureClaim.APPROVER, claims.approver, disclosures, failures);\n const requester = disclosureStanding(ApprovalSealDisclosureClaim.REQUESTER, claims.requester?.disclosure, disclosures, failures);\n const presentation = disclosureStanding(ApprovalSealDisclosureClaim.PRESENTATION, claims.presentation?.digest, disclosures, failures);\n const statement = disclosureStanding(ApprovalSealDisclosureClaim.STATEMENT, claims.statementDigest, disclosures, failures);\n\n const decisionPayloadDigest = decisionPayloadDigestOf(committed);\n const valid = failures.length === 0;\n const compromised = key.state === CryptoKey_VersionState.COMPROMISED;\n const corroboratedBy = compromised ? corroborationOf(input, key, payload, decisionPayloadDigest) : undefined;\n const corroborated = !compromised || corroboratedBy !== undefined;\n return {\n valid,\n failures,\n provable: valid && corroborated,\n ...(corroboratedBy ? { corroboratedBy } : {}),\n kid,\n keyState: key.state,\n claims,\n iss,\n ...(iat !== undefined ? { iat, signingWindowSeconds: Math.max(0, iat - claims.decidedAt) } : {}),\n lateSeal,\n decisionPayloadDigest,\n ...(approver ? { approver } : {}),\n ...(requester ? { requester } : {}),\n ...(presentation ? { presentation } : {}),\n ...(statement ? { statement } : {}),\n };\n}\n\n/** A verification key as an export or a CLI file states it (dates as ISO strings): the one shape of a key record. */\nexport const ApprovalSealVerificationKeySchema = VerificationKeyRecordSchema;\n\n/**\n * Evidence recorded outside the application that a decision's payload existed before a key's compromise, as the file an\n * operator keeps it in (`wildo seal verify --corroboration <file>`).\n */\nexport const ApprovalSealCorroborationSchema = z.object({ decisionPayloadDigest: z.string().min(1), recordedAt: z.string().min(1) });\n\n/**\n * What `wildo seal verify` reads: one seal and everything it needs to verify, offline. A bundle is what the HOST exports,\n * so it carries no pin set, no signing-log exports and no corroboration: each is evidence against the host, and reaches\n * the verifier only from the operator's own files (`ApprovalSealVerificationInput.pins` / `signingLogExports` /\n * `corroboration`). The schema is not strict, so a bundle naming any of them has it stripped on parse rather than\n * believed (#2932 review H1, R1).\n */\nexport const ApprovalSealVerificationBundleSchema = z.object({\n jws: z.string().min(1),\n keys: z.array(ApprovalSealVerificationKeySchema).min(1),\n expectedIssuer: z.string().min(1).optional(),\n disclosures: z.array(z.object({ claimName: z.enum(ApprovalSealDisclosureClaim), salt: z.string().min(1), value: z.record(z.string(), z.unknown()) })).optional(),\n});\nexport type ApprovalSealVerificationBundle = z.infer<typeof ApprovalSealVerificationBundleSchema>;\n"]}
1
+ {"version":3,"file":"approval-seal-verifier.js","sourceRoot":"","sources":["../../../src/key-management/approval-seal-verifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,eAAe,EAA8C,iBAAiB,EAAE,eAAe,EAAE,sBAAsB,EAAwB,MAAM,uBAAuB,CAAC;AACtP,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxJ,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,EAC9B,4BAA4B,GAG7B,MAAM,2BAA2B,CAAC;AAEnC,qCAAqC;AACrC,MAAM,iBAA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AC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5F;;;OAGG;IACH,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;SACxK,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,KAAK,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,qFAAqF,EAAE,CAAC;SACxL,QAAQ,EAAE;CACd,CAAC,CAAC","sourcesContent":["/**\n * # Verifying an approval seal, offline (#2903)\n *\n * Everything a verifier needs travels with the seal: the compact JWS, the stored records of the keys that may have signed\n * it (their public half, scope and issuer, as an export carries them), and, when the person's content is to be shown,\n * the disclosures. Nothing here calls the application or the platform, so a seal verifies after the application is gone.\n *\n * ## What is checked, and on whose authority\n *\n * - The header: ES256 is pinned per key from the key RECORD, never read from the header (RFC 8725 §3.1); `jku`, `x5u`,\n * `jwk` and `x5c` are never followed (RFC 8725 §3.10, RFC 7515 §10.7); a `crit` naming anything is refused, since no\n * extension is understood (RFC 7515 §4.1.11); `typ` must be the approval seal's.\n * - The signature, under the key the `kid` names among those given.\n * - The issuer: the payload's `iss` must be the key record's, and the expected issuer when one is given.\n * - The claims: the version-1 shape, strict.\n * - The key's scope, from its stored record and never from a JWKS member: an organization-scoped key verifies only a seal\n * whose tenant is that organization.\n * - The disclosures: each must digest to the commitment its claim names; a commitment with no disclosure is reported as\n * erased (the person's content was removed, the seal stands).\n * - A FILE deliverable (#2904), when the seal attests one: the file's bytes, hashed and salted with the salt its row\n * kept, must give the commitment the disclosed presentation binds it by. One changed byte fails the seal; bytes not\n * given are reported as such (a missing file), never as a match.\n * - A MANIFESTED COPY (#2907), when the seal's deliverable has one: the copy is rebuilt from its own prefix, the JWS, the\n * inputs it carries (its words, its pinned font, its verification address) and the disclosed approver's printed name,\n * and must equal the bytes given, and the host's record of its hash when the bundle states one; its prefix must then open the seal's commitment\n * to the approved file, which ties the copy to the original without the original being supplied. One changed byte in\n * the approval page fails the seal. A copy the approver's erasure deleted is reported CONTENT_ERASED, never missing.\n * - The CURRENCY of the approval over its record (#2914), when the record as it is now is given: the values of the fields\n * the approval covers, as the disclosed presentation carries them, compared with the record. A record changed since is\n * NOT a failure: the seal still proves what was approved; it is reported NO_LONGER_CURRENT. Without the presentation\n * disclosed there is nothing to compare, and it is reported as having no sealed field set, never as current.\n * - A COMPROMISED key: the signature may still verify, but the seal is not PROVABLE unless corroborated by evidence the\n * key's holder could not have forged: the decision's payload digest recorded outside the application before the\n * compromise instant (an exported audit event, an immutable sink).\n * - The OPERATOR'S PIN SET, when one is given (#2932): the key must be pinned, by the RFC 7638 thumbprint of the public\n * half the verifier was handed (so a key record that names a pinned `kid` over another key is refused), and the pin's\n * state, scope and compromise instant are used instead of the record's. The record (from a bundle, from the host)\n * only supplies the public half and the issuer; the operator's pin decides whether that half is theirs and what became\n * of it. Without a pin set the records are trusted as given, as before.\n * - The OPERATOR'S KEPT SIGNING-LOG EXPORTS, when given (#2932): a seal under a key compromised after an export that lists\n * it is corroborated by that export, which the host could not have signed after the compromise without the operator's\n * copy disagreeing. Each export is verified here, with the operator's pin set for the export key.\n *\n * spec-cite: RFC 8725 §3.1 (algorithm verification), §3.10 (do not trust received URLs); RFC 7515 §4.1.11 (`crit`),\n * §10.7 (key selection from header parameters). Cited by section; the behaviour is this file's decision.\n */\nimport { createHash } from 'node:crypto';\nimport { z } from 'zod';\nimport { approvalSealSubjectCurrencyOf, humanDecisionBoundDeliverableOf, singleJwsTypeOf, type ApprovalSealSubjectCurrencyAssessment, CryptoKey_Purpose, CryptoKey_Scope, CryptoKey_VersionState, type CryptoKeyPinSet } from '@wildo-ai/saas-models';\nimport { ES256_JWS_ALGORITHM, isP256PublicJwk, verifyEs256, type P256PublicJwk } from './es256-jws';\nimport { decisionPayloadDigestOf, sealClaimsDigestOf } from './signature-request.contracts';\nimport { VerificationKeyRecordSchema, compareSigningLogExports, pinnedVerificationKeyOf, verifySigningLogExport } from './signing-log-export.contracts';\nimport { checkApprovalSealManifestedCopy } from './approval-seal-manifested-copy';\nimport {\n ApprovalSealClaimsV1Schema,\n ApprovalSealDisclosureClaim,\n approvalSealDisclosureDigestOf,\n approvalSealFileCommitmentOf,\n type ApprovalSealClaimsV1,\n type ApprovalSealDisclosureValue,\n} from './approval-seal.contracts';\n\n/** The approval seal's JWS `typ`. */\nconst APPROVAL_SEAL_TYP = singleJwsTypeOf(CryptoKey_Purpose.APPROVAL_SEAL);\n\n/** The payload members the custodian sets; the rest is the decision's committed payload. */\nconst CUSTODIAN_SET_CLAIMS = ['iss', 'iat', 'lateSeal'] as const;\n\n/** One key that may have signed a seal: its STORED record (scope, issuer, state), as an export carries it. */\nexport interface ApprovalSealVerificationKey {\n readonly kid: string;\n readonly publicJwk: P256PublicJwk;\n /** The algorithm the key record pins. ES256 for every approval-seal key today. */\n readonly alg: typeof ES256_JWS_ALGORITHM;\n readonly scope: CryptoKey_Scope;\n /** The application's id for an APPLICATION key, the organization's for an ORGANIZATION key. */\n readonly scopeId: string;\n readonly iss: string;\n readonly state: CryptoKey_VersionState;\n /** ISO 8601, for a COMPROMISED key: the earliest instant its private half may have been exposed. */\n readonly compromiseInstant?: string;\n}\n\n/** Evidence recorded OUTSIDE the application that the decision's payload existed before a key's compromise. */\nexport interface ApprovalSealCorroboration {\n readonly decisionPayloadDigest: string;\n /** ISO 8601: when the evidence was recorded where the key's holder could not rewrite it. */\n readonly recordedAt: string;\n}\n\nexport interface ApprovalSealVerificationInput {\n readonly jws: string;\n readonly keys: readonly ApprovalSealVerificationKey[];\n /** The issuer the seal must carry, when the verifier knows which application it expects. */\n readonly expectedIssuer?: string;\n readonly disclosures?: readonly ApprovalSealDisclosureValue[];\n /**\n * The committed claims whose content the host no longer holds because an ERASURE removed it (#2924): the approver's\n * own erasure, or a later erasure of the requester or of a person the presentation named (#3001). The host's\n * statement, read as a reason and never as proof: a claim it names and does not give reads ERASED, one it neither\n * names nor gives reads WITHHELD, and either way the seal stands.\n */\n readonly erasedClaims?: readonly ApprovalSealDisclosureClaim[];\n readonly corroboration?: ApprovalSealCorroboration;\n /**\n * The file deliverable the seal attests (#2904): its id and the salt the seal's row kept (a bundle carries both), and\n * the file's BYTES, which the verifier is given by whoever holds the file (`wildo seal verify --deliverable`). Without\n * the bytes the file is reported NOT_GIVEN.\n */\n readonly deliverableFile?: { readonly fileId: string; readonly salt: string; readonly bytes?: Uint8Array };\n /**\n * The manifested copy of that deliverable (#2907): its id as the host names it, or the host's statement that the\n * approver's erasure deleted it (`contentErased`, read as a reason, never as proof), and the copy's BYTES from whoever\n * holds the file (`wildo seal verify --manifested-copy`). Checking it needs the approver disclosed (the copy prints\n * their name) and, to tie it to the approved file, the presentation and `deliverableFile`'s salt. `contentSha256` is\n * the host's record of the copy's hash: it binds what the rebuild takes from the copy itself (its words, its\n * verification address), so a copy reworded since does not verify.\n */\n readonly manifestedCopy?: { readonly fileId?: string; readonly contentSha256?: string; readonly contentErased?: boolean; readonly bytes?: Uint8Array };\n /**\n * The record the approval is about, as it is NOW (#2914): its fields as an export of the record states them, or null\n * for a record that is gone. Compared with the sealed field set the disclosed presentation carries\n * (`wildo seal verify --subject-record`).\n */\n readonly subjectRecord?: Readonly<Record<string, unknown>> | null;\n /** The operator's pin set for approval seals (#2932), from a channel the host does not control. */\n readonly pins?: CryptoKeyPinSet;\n /**\n * The signing-log exports the operator kept (#2932), with the records of the keys that signed them and the operator's\n * pin set for SIGNING_LOG_EXPORT. An export that does not verify, or was signed after its own key's compromise, is\n * ignored: it corroborates nothing.\n */\n readonly signingLogExports?: {\n readonly exports: readonly string[];\n readonly keys: readonly ApprovalSealVerificationKey[];\n readonly pins?: CryptoKeyPinSet;\n };\n}\n\n/** What corroborated a seal under a compromised key. */\nexport enum ApprovalSealCorroborationSource {\n /** The decision's payload digest, recorded outside the application before the compromise. */\n RECORDED_EVIDENCE = 'recorded_evidence',\n /** A signing-log export the operator kept, signed before the compromise, lists the seal. */\n SIGNING_LOG_EXPORT = 'signing_log_export',\n}\n\n/** Why a seal does not verify. */\nexport enum ApprovalSealVerificationFailure {\n /** Not a compact JWS with a JSON header and payload. */\n MALFORMED = 'malformed',\n /** The header's `alg` is not the one the key record pins. */\n ALGORITHM_NOT_PINNED = 'algorithm_not_pinned',\n /** The header names a critical extension, and none is understood. */\n CRITICAL_EXTENSION = 'critical_extension',\n /** The header's `typ` is not the approval seal's. */\n TYPE_MISMATCH = 'type_mismatch',\n /** No given key has the header's `kid`. */\n UNKNOWN_KEY = 'unknown_key',\n SIGNATURE_INVALID = 'signature_invalid',\n /** The payload's issuer is not the key record's, or not the expected one. */\n ISSUER_MISMATCH = 'issuer_mismatch',\n /** The payload is not the version-1 claims shape. */\n CLAIMS_INVALID = 'claims_invalid',\n /** The key's stored scope does not cover the seal's tenant (or is not a scope a seal is signed under). */\n TENANT_OUTSIDE_KEY_SCOPE = 'tenant_outside_key_scope',\n /** A disclosure does not digest to the commitment its claim names. */\n DISCLOSURE_MISMATCH = 'disclosure_mismatch',\n /** A pin set was given and does not pin the key, or the key handed over is not the one its pinned `kid` names. */\n UNPINNED = 'unpinned',\n /** A file deliverable's bytes were given and are not the ones the seal binds (#2904). */\n DELIVERABLE_FILE_MISMATCH = 'deliverable_file_mismatch',\n /**\n * A manifested copy was given and is not this seal's (#2907): its approval page, its attached JWS or its page tree is\n * not what the seal rebuilds, or what precedes them is not the file the seal binds.\n */\n MANIFESTED_COPY_MISMATCH = 'manifested_copy_mismatch',\n}\n\n/** What the seal says about the file deliverable it attests (#2904). */\nexport enum ApprovalSealDeliverableFileStanding {\n /** The bytes given hash, with the row's salt, to the commitment the presentation binds: the file approved. */\n MATCHES = 'matches',\n /** The bytes given are not the file approved: one changed byte is enough. The seal does not verify. */\n CHANGED = 'changed',\n /** The seal binds the file and its bytes were not given: the file is missing, or was not supplied. */\n NOT_GIVEN = 'not_given',\n /**\n * Nothing to compare with: the presentation that holds the commitment is not disclosed (erased with a person it\n * named, or withheld), or it binds no such file.\n */\n NOT_COMMITTED = 'not_committed',\n /**\n * A manifested copy (#2907) only: the host states the approver's erasure deleted it. The copy printed the approver's\n * name in clear and a file cannot be scrubbed, so it went; the seal and the original still prove the approval, and the\n * copy can be rebuilt from both should the name ever lawfully be needed again.\n */\n CONTENT_ERASED = 'content_erased',\n}\n\n/**\n * What the seal says about one committed disclosure: a person's (approver, requester), what they were shown, what they\n * answered. In none of the three is the seal failed: the signature covers the commitments, never the content (#2924).\n */\nexport enum ApprovalSealDisclosureStanding {\n /** Given, and it digests to the commitment. */\n DISCLOSED = 'disclosed',\n /**\n * Committed to, not given, and the bundle states an erasure removed it (`erasedClaims`): UNDISCLOSED (erased). For the\n * presentation this is PRESENTATION_ERASED: an erasure rewrote the stored presentation, and the seal still proves that\n * a presentation with this digest was shown.\n */\n ERASED = 'erased',\n /** Committed to, and not given, with no erasure stated: withheld, or a bundle that does not carry it. */\n WITHHELD = 'withheld',\n}\n\nexport interface ApprovalSealVerification {\n /** The signature verifies, under a key whose record covers the seal, over well-formed claims and matching disclosures. */\n readonly valid: boolean;\n readonly failures: readonly ApprovalSealVerificationFailure[];\n /**\n * The seal proves what it says: valid, and its key not compromised, or corroborated before the compromise. A valid seal\n * under a compromised key, uncorroborated, is reported valid and NOT provable.\n */\n readonly provable: boolean;\n /** For a seal under a compromised key, what corroborated it; absent when nothing did (or nothing needed to). */\n readonly corroboratedBy?: ApprovalSealCorroborationSource;\n readonly kid?: string;\n readonly keyState?: CryptoKey_VersionState;\n readonly claims?: ApprovalSealClaimsV1;\n readonly iss?: string;\n /** The signing instant, epoch seconds. */\n readonly iat?: number;\n readonly lateSeal?: boolean;\n /** Seconds between the decision and its signature: what the database held at signing is what is sealed. */\n readonly signingWindowSeconds?: number;\n /** The digest of the decision's committed payload, to compare with the RESOLVED row of an exported trail. */\n readonly decisionPayloadDigest?: string;\n readonly approver?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n readonly requester?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n /** What the person was shown (#2903 S6), when the seal binds it: DISCLOSED, ERASED (PRESENTATION_ERASED) or WITHHELD. */\n readonly presentation?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n /** What the person answered, when the seal binds it. */\n readonly statement?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n /** The file deliverable the seal attests, checked against its bytes (#2904), when one was named. */\n readonly deliverableFile?: { readonly fileId: string; readonly argument?: string; readonly standing: ApprovalSealDeliverableFileStanding };\n /**\n * The manifested copy (#2907), when one was named: MATCHES (the original the seal binds, followed by exactly this seal's\n * approval page naming the disclosed approver), CHANGED, NOT_GIVEN, NOT_COMMITTED (the approver or the commitment is\n * not disclosed, so there is nothing to rebuild or tie it to) or CONTENT_ERASED. `approverName` is the name it prints.\n */\n readonly manifestedCopy?: {\n readonly fileId?: string;\n readonly standing: ApprovalSealDeliverableFileStanding;\n readonly approverName?: string;\n /** What the copy states it was made with, when it rebuilt: its words' language, its verification address. */\n readonly locale?: string;\n readonly verificationUrl?: string;\n };\n /**\n * Whether the approval is still current over its record (#2914), when the record was given: CURRENT,\n * NO_LONGER_CURRENT (never a failure), SUBJECT_GONE, or NO_SEALED_FIELD_SET when the presentation is not disclosed or\n * covers no record field.\n */\n readonly subjectRecordCurrency?: ApprovalSealSubjectCurrencyAssessment;\n}\n\nfunction decodeJson(part: string | undefined): Record<string, unknown> | null {\n if (!part) return null;\n try {\n const value: unknown = JSON.parse(Buffer.from(part, 'base64url').toString('utf8'));\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? (value as Record<string, unknown>) : null;\n } catch {\n return null;\n }\n}\n\nfunction disclosureStanding(\n claimName: ApprovalSealDisclosureClaim,\n commitment: string | undefined,\n disclosures: readonly ApprovalSealDisclosureValue[],\n erasedClaims: readonly ApprovalSealDisclosureClaim[],\n failures: ApprovalSealVerificationFailure[],\n): ApprovalSealVerification['approver'] {\n if (!commitment) return undefined;\n const given = disclosures.filter((disclosure) => disclosure.claimName === claimName);\n if (given.length === 0) {\n return { standing: erasedClaims.includes(claimName) ? ApprovalSealDisclosureStanding.ERASED : ApprovalSealDisclosureStanding.WITHHELD };\n }\n const matching = given.find((disclosure) => approvalSealDisclosureDigestOf(disclosure) === commitment);\n if (!matching) {\n // A disclosure that does not open its commitment is not the content: the seal fails, and nothing was disclosed.\n failures.push(ApprovalSealVerificationFailure.DISCLOSURE_MISMATCH);\n return { standing: ApprovalSealDisclosureStanding.WITHHELD };\n }\n return { standing: ApprovalSealDisclosureStanding.DISCLOSED, value: matching.value };\n}\n\n/**\n * The file deliverable against the commitment the disclosed presentation binds it by (#2904). A mismatch is a failure:\n * the seal does not attest those bytes.\n */\nfunction deliverableFileStandingOf(\n given: ApprovalSealVerificationInput['deliverableFile'],\n presentation: ApprovalSealVerification['presentation'],\n failures: ApprovalSealVerificationFailure[],\n): ApprovalSealVerification['deliverableFile'] {\n if (!given) return undefined;\n const bound = presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED ? humanDecisionBoundDeliverableOf(presentation.value, given.fileId) : undefined;\n if (!bound) return { fileId: given.fileId, standing: ApprovalSealDeliverableFileStanding.NOT_COMMITTED };\n if (!given.bytes) return { fileId: given.fileId, argument: bound.argument, standing: ApprovalSealDeliverableFileStanding.NOT_GIVEN };\n const contentSha256 = createHash('sha256').update(given.bytes).digest('hex');\n if (approvalSealFileCommitmentOf(given.salt, contentSha256) === bound.commitment) {\n return { fileId: given.fileId, argument: bound.argument, standing: ApprovalSealDeliverableFileStanding.MATCHES };\n }\n failures.push(ApprovalSealVerificationFailure.DELIVERABLE_FILE_MISMATCH);\n return { fileId: given.fileId, argument: bound.argument, standing: ApprovalSealDeliverableFileStanding.CHANGED };\n}\n\n/**\n * The manifested copy against the seal (#2907): rebuilt and compared, then its prefix opened against the commitment the\n * disclosed presentation binds the deliverable by. A mismatch at either step is a failure.\n */\nfunction manifestedCopyStandingOf(\n input: ApprovalSealVerificationInput,\n approver: ApprovalSealVerification['approver'],\n presentation: ApprovalSealVerification['presentation'],\n failures: ApprovalSealVerificationFailure[],\n): ApprovalSealVerification['manifestedCopy'] {\n const given = input.manifestedCopy;\n if (!given) return undefined;\n const named = given.fileId ? { fileId: given.fileId } : {};\n if (!given.bytes) {\n return { ...named, standing: given.contentErased ? ApprovalSealDeliverableFileStanding.CONTENT_ERASED : ApprovalSealDeliverableFileStanding.NOT_GIVEN };\n }\n if (approver?.standing !== ApprovalSealDisclosureStanding.DISCLOSED || !approver.value) return { ...named, standing: ApprovalSealDeliverableFileStanding.NOT_COMMITTED };\n const approverName = typeof approver.value.name === 'string' ? approver.value.name : undefined;\n const printed = approverName !== undefined ? { approverName } : {};\n const statedHash = given.contentSha256 === undefined || createHash('sha256').update(given.bytes).digest('hex') === given.contentSha256;\n const check = checkApprovalSealManifestedCopy(given.bytes, { jws: input.jws, ...printed });\n if (!check.matches || !statedHash) {\n failures.push(ApprovalSealVerificationFailure.MANIFESTED_COPY_MISMATCH);\n return { ...named, standing: ApprovalSealDeliverableFileStanding.CHANGED };\n }\n const deliverable = input.deliverableFile;\n const bound = deliverable && presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED\n ? humanDecisionBoundDeliverableOf(presentation.value, deliverable.fileId)\n : undefined;\n const stated = { locale: check.statement.locale, ...(check.statement.verificationUrl ? { verificationUrl: check.statement.verificationUrl } : {}) };\n if (!deliverable || !bound) return { ...named, standing: ApprovalSealDeliverableFileStanding.NOT_COMMITTED, ...printed, ...stated };\n if (approvalSealFileCommitmentOf(deliverable.salt, createHash('sha256').update(check.original).digest('hex')) !== bound.commitment) {\n failures.push(ApprovalSealVerificationFailure.MANIFESTED_COPY_MISMATCH);\n return { ...named, standing: ApprovalSealDeliverableFileStanding.CHANGED };\n }\n return { ...named, standing: ApprovalSealDeliverableFileStanding.MATCHES, ...printed, ...stated };\n}\n\n/**\n * What corroborates a seal under a compromised key, if anything: evidence of its payload recorded before the compromise,\n * or a kept export signed before the compromise that lists this exact seal (its issuer, its key, its signed claims).\n */\nfunction corroborationOf(\n input: ApprovalSealVerificationInput,\n key: ApprovalSealVerificationKey,\n payload: Readonly<Record<string, unknown>>,\n decisionPayloadDigest: string,\n): ApprovalSealCorroborationSource | undefined {\n if (key.compromiseInstant === undefined) return undefined;\n const compromisedFrom = Date.parse(key.compromiseInstant);\n if (input.corroboration && input.corroboration.decisionPayloadDigest === decisionPayloadDigest && Date.parse(input.corroboration.recordedAt) < compromisedFrom) {\n return ApprovalSealCorroborationSource.RECORDED_EVIDENCE;\n }\n const logged = input.signingLogExports;\n if (!logged) return undefined;\n const claimsDigest = sealClaimsDigestOf(payload);\n const evidence = logged.exports.flatMap((jws) => {\n const exported = verifySigningLogExport({ jws, keys: logged.keys, ...(logged.pins ? { pins: logged.pins } : {}), expectedIssuer: key.iss });\n return exported.provable && exported.claims ? [exported.claims] : [];\n });\n // The exports must agree with each other first (#2932 review M3): an export is dated by the instant it states for\n // itself, so a host holding the export key could sign one dated before the compromise; it disagrees with the operator's\n // kept exports (a different hash at some sequence, or a head behind an earlier one), and then none of them corroborates.\n if (!compareSigningLogExports(evidence).consistent) return undefined;\n for (const claims of evidence) {\n if (claims.iat * 1000 >= compromisedFrom) continue;\n const lists = claims.entries.some((entry) =>\n entry.purpose === CryptoKey_Purpose.APPROVAL_SEAL && entry.kid === key.kid && entry.iss === key.iss && entry.claimsDigest === claimsDigest);\n if (lists) return ApprovalSealCorroborationSource.SIGNING_LOG_EXPORT;\n }\n return undefined;\n}\n\n/** See the file's header. Pure and offline. */\nexport function verifyApprovalSeal(input: ApprovalSealVerificationInput): ApprovalSealVerification {\n const failures: ApprovalSealVerificationFailure[] = [];\n const fail = (failure: ApprovalSealVerificationFailure, extra: Partial<ApprovalSealVerification> = {}): ApprovalSealVerification =>\n ({ valid: false, provable: false, failures: [...failures, failure], ...extra });\n\n const parts = input.jws.split('.');\n const header = parts.length === 3 ? decodeJson(parts[0]) : null;\n const payload = parts.length === 3 ? decodeJson(parts[1]) : null;\n if (!header || !payload || !parts[2]) return fail(ApprovalSealVerificationFailure.MALFORMED);\n\n const kid = typeof header.kid === 'string' ? header.kid : undefined;\n // The key is chosen by `kid` among the keys the verifier was GIVEN; `jku`/`x5u`/`jwk`/`x5c` are never read.\n const record = kid ? input.keys.find((candidate) => candidate.kid === kid) : undefined;\n if (!record || !isP256PublicJwk(record.publicJwk)) return fail(ApprovalSealVerificationFailure.UNKNOWN_KEY, kid ? { kid } : {});\n // The operator's pin, when given: the key handed over must be the one the pinned thumbprint names, and the pin (not\n // the record) says what became of it.\n const key = pinnedVerificationKeyOf(record, input.pins);\n if (!key) return fail(ApprovalSealVerificationFailure.UNPINNED, { kid });\n if (header.alg !== key.alg || key.alg !== ES256_JWS_ALGORITHM) return fail(ApprovalSealVerificationFailure.ALGORITHM_NOT_PINNED, { kid });\n if (header.crit !== undefined) return fail(ApprovalSealVerificationFailure.CRITICAL_EXTENSION, { kid });\n if (header.typ !== APPROVAL_SEAL_TYP) return fail(ApprovalSealVerificationFailure.TYPE_MISMATCH, { kid });\n if (!verifyEs256(`${parts[0]}.${parts[1]}`, Buffer.from(parts[2], 'base64url'), key.publicJwk)) {\n return fail(ApprovalSealVerificationFailure.SIGNATURE_INVALID, { kid, keyState: key.state });\n }\n\n const iss = typeof payload.iss === 'string' ? payload.iss : undefined;\n const iat = typeof payload.iat === 'number' ? payload.iat : undefined;\n const lateSeal = payload.lateSeal === true;\n if (!iss || iss !== key.iss || (input.expectedIssuer !== undefined && iss !== input.expectedIssuer)) failures.push(ApprovalSealVerificationFailure.ISSUER_MISMATCH);\n\n const committed = Object.fromEntries(Object.entries(payload).filter(([name]) => !(CUSTODIAN_SET_CLAIMS as readonly string[]).includes(name)));\n const parsed = ApprovalSealClaimsV1Schema.safeParse(committed);\n if (!parsed.success) return fail(ApprovalSealVerificationFailure.CLAIMS_INVALID, { kid, keyState: key.state, ...(iss ? { iss } : {}) });\n const claims = parsed.data;\n\n // The key's scope from its RECORD: an organization key covers only that organization's decisions.\n const scopeCovers = key.scope === CryptoKey_Scope.APPLICATION || (key.scope === CryptoKey_Scope.ORGANIZATION && claims.tenant === key.scopeId);\n if (!scopeCovers) failures.push(ApprovalSealVerificationFailure.TENANT_OUTSIDE_KEY_SCOPE);\n\n const disclosures = input.disclosures ?? [];\n const erased = input.erasedClaims ?? [];\n const approver = disclosureStanding(ApprovalSealDisclosureClaim.APPROVER, claims.approver, disclosures, erased, failures);\n const requester = disclosureStanding(ApprovalSealDisclosureClaim.REQUESTER, claims.requester?.disclosure, disclosures, erased, failures);\n const presentation = disclosureStanding(ApprovalSealDisclosureClaim.PRESENTATION, claims.presentation?.digest, disclosures, erased, failures);\n const statement = disclosureStanding(ApprovalSealDisclosureClaim.STATEMENT, claims.statementDigest, disclosures, erased, failures);\n const deliverableFile = deliverableFileStandingOf(input.deliverableFile, presentation, failures);\n const manifestedCopy = manifestedCopyStandingOf(input, approver, presentation, failures);\n // #2914: never a failure; the presentation counts only when it opened its commitment.\n const subjectRecordCurrency = input.subjectRecord !== undefined\n ? approvalSealSubjectCurrencyOf(presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED ? presentation.value : undefined, input.subjectRecord)\n : undefined;\n\n const decisionPayloadDigest = decisionPayloadDigestOf(committed);\n const valid = failures.length === 0;\n const compromised = key.state === CryptoKey_VersionState.COMPROMISED;\n const corroboratedBy = compromised ? corroborationOf(input, key, payload, decisionPayloadDigest) : undefined;\n const corroborated = !compromised || corroboratedBy !== undefined;\n return {\n valid,\n failures,\n provable: valid && corroborated,\n ...(corroboratedBy ? { corroboratedBy } : {}),\n kid,\n keyState: key.state,\n claims,\n iss,\n ...(iat !== undefined ? { iat, signingWindowSeconds: Math.max(0, iat - claims.decidedAt) } : {}),\n lateSeal,\n decisionPayloadDigest,\n ...(approver ? { approver } : {}),\n ...(requester ? { requester } : {}),\n ...(presentation ? { presentation } : {}),\n ...(statement ? { statement } : {}),\n ...(deliverableFile ? { deliverableFile } : {}),\n ...(manifestedCopy ? { manifestedCopy } : {}),\n ...(subjectRecordCurrency ? { subjectRecordCurrency } : {}),\n };\n}\n\n/** A verification key as an export or a CLI file states it (dates as ISO strings): the one shape of a key record. */\nexport const ApprovalSealVerificationKeySchema = VerificationKeyRecordSchema;\n\n/**\n * Evidence recorded outside the application that a decision's payload existed before a key's compromise, as the file an\n * operator keeps it in (`wildo seal verify --corroboration <file>`).\n */\nexport const ApprovalSealCorroborationSchema = z.object({ decisionPayloadDigest: z.string().min(1), recordedAt: z.string().min(1) });\n\n/**\n * What `wildo seal verify` reads: one seal and everything it needs to verify, offline. A bundle is what the HOST exports,\n * so it carries no pin set, no signing-log exports and no corroboration: each is evidence against the host, and reaches\n * the verifier only from the operator's own files (`ApprovalSealVerificationInput.pins` / `signingLogExports` /\n * `corroboration`). The schema is not strict, so a bundle naming any of them has it stripped on parse rather than\n * believed (#2932 review H1, R1).\n */\nexport const ApprovalSealVerificationBundleSchema = z.object({\n jws: z.string().min(1),\n keys: z.array(ApprovalSealVerificationKeySchema).min(1),\n expectedIssuer: z.string().min(1).optional(),\n disclosures: z.array(z.object({ claimName: z.enum(ApprovalSealDisclosureClaim), salt: z.string().min(1), value: z.record(z.string(), z.unknown()) })).optional(),\n /** The committed claims an erasure removed from the host's row (#2924): see `ApprovalSealVerificationInput.erasedClaims`. */\n erasedClaims: z.array(z.enum(ApprovalSealDisclosureClaim)).optional(),\n /**\n * The file deliverable the seal attests (#2904): its id and the salt its row kept. Never the bytes, which the verifier\n * is given from the file itself (`--deliverable`), and never the clear hash.\n */\n deliverableFile: z.object({ fileId: z.string().min(1), salt: z.string().min(1) }).optional(),\n /**\n * The deliverable's manifested copy (#2907): its file id, or `contentErased` when the approver's erasure deleted it.\n * Never its bytes, which the verifier is given from the file itself (`--manifested-copy`).\n */\n manifestedCopy: z.object({ fileId: z.string().min(1).optional(), contentSha256: z.string().regex(/^[0-9a-f]{64}$/).optional(), contentErased: z.literal(true).optional() })\n .refine((copy) => (copy.fileId === undefined) !== (copy.contentErased === undefined), { message: 'A manifested copy is named by its file id, or stated erased: exactly one of the two' })\n .optional(),\n});\nexport type ApprovalSealVerificationBundle = z.infer<typeof ApprovalSealVerificationBundleSchema>;\n"]}
@@ -38,79 +38,68 @@ export declare enum ApprovalSealDisclosureClaim {
38
38
  export declare const ApprovalSealDeciderClaimsSchema: z.ZodObject<{
39
39
  kind: z.ZodEnum<typeof HumanDecision_DeciderKind>;
40
40
  channel: z.ZodEnum<typeof HumanDecision_AnswerChannel>;
41
- /** The client that acted for the person, in the style of RFC 8693 §4.1 `act`. */
42
41
  act: z.ZodOptional<z.ZodObject<{
43
42
  clientId: z.ZodString;
44
43
  }, z.core.$strict>>;
45
44
  authTime: z.ZodOptional<z.ZodNumber>;
46
45
  amr: z.ZodOptional<z.ZodArray<z.ZodString>>;
47
46
  stepUpMethod: z.ZodOptional<z.ZodEnum<typeof AuthMethod>>;
48
- /** For a chat answer: the inbound source it arrived through (`slack:interactions`). Names a channel, not a person. */
47
+ stepUpAt: z.ZodOptional<z.ZodNumber>;
48
+ stepUpUserVerified: z.ZodOptional<z.ZodBoolean>;
49
49
  inboundSourceKey: z.ZodOptional<z.ZodString>;
50
50
  }, z.core.$strict>;
51
51
  /** Who asked. A machine is named by kind only; a person by their disclosure. */
52
52
  export declare const ApprovalSealRequesterClaimsSchema: z.ZodObject<{
53
53
  kind: z.ZodEnum<typeof HumanDecision_RequesterKind>;
54
54
  clientId: z.ZodOptional<z.ZodString>;
55
- /** The digest of the requester's disclosure, when the requester is a person. */
56
55
  disclosure: z.ZodOptional<z.ZodString>;
57
56
  }, z.core.$strict>;
58
57
  /** The approval seal's claims, version 1: everything but what the custodian sets (`iss`, `iat`, `kid`, `typ`, `lateSeal`). */
59
58
  export declare const ApprovalSealClaimsV1Schema: z.ZodObject<{
60
59
  v: z.ZodLiteral<1>;
61
- /** Minted at commit: at least 128 bits, base64url. With `iss` the seal's id. */
62
60
  jti: z.ZodString;
63
61
  source: z.ZodEnum<typeof ApprovalSource>;
64
62
  decisionRef: z.ZodString;
65
63
  step: z.ZodNumber;
66
64
  sequence: z.ZodNumber;
67
- /** The jti of the seal this one supersedes. */
68
65
  supersedes: z.ZodOptional<z.ZodString>;
69
- /** The organization the decision belongs to, or the application's id when it belongs to none. */
70
66
  tenant: z.ZodString;
71
67
  subject: z.ZodObject<{
72
68
  resourceType: z.ZodString;
73
69
  resourceId: z.ZodString;
74
70
  presentationSchemaVersion: z.ZodOptional<z.ZodNumber>;
75
71
  }, z.core.$strict>;
76
- /** What was presented, when the engine built it (#2903 S6): its id, how its rendering is known, its salted digest. */
77
72
  presentation: z.ZodOptional<z.ZodObject<{
78
- /** The id the act echoed, or the one the engine derived for what it sent. Absent when the application held no key. */
79
73
  id: z.ZodOptional<z.ZodString>;
80
74
  provenance: z.ZodEnum<typeof ApprovalPresentationProvenance>;
81
75
  digest: z.ZodString;
82
76
  }, z.core.$strict>>;
83
- /** The digest of the approver's statement (the `statement` disclosure): what they answered. */
84
77
  statementDigest: z.ZodOptional<z.ZodString>;
85
78
  meaning: z.ZodEnum<typeof ApprovalSealMeaning>;
86
- /** Only an outcome a person decided (`APPROVAL_SEAL_OUTCOMES`). */
87
79
  outcome: z.ZodEnum<{
88
80
  accepted: import("@wildo-ai/saas-models").HumanDecision_Outcome.ACCEPTED;
89
81
  accepted_with_modifications: import("@wildo-ai/saas-models").HumanDecision_Outcome.ACCEPTED_WITH_MODIFICATIONS;
90
82
  rejected: import("@wildo-ai/saas-models").HumanDecision_Outcome.REJECTED;
91
83
  }>;
92
- /** When the person decided, epoch seconds: distinct from `iat`, when the custodian signed. */
93
84
  decidedAt: z.ZodNumber;
94
85
  decider: z.ZodObject<{
95
86
  kind: z.ZodEnum<typeof HumanDecision_DeciderKind>;
96
87
  channel: z.ZodEnum<typeof HumanDecision_AnswerChannel>;
97
- /** The client that acted for the person, in the style of RFC 8693 §4.1 `act`. */
98
88
  act: z.ZodOptional<z.ZodObject<{
99
89
  clientId: z.ZodString;
100
90
  }, z.core.$strict>>;
101
91
  authTime: z.ZodOptional<z.ZodNumber>;
102
92
  amr: z.ZodOptional<z.ZodArray<z.ZodString>>;
103
93
  stepUpMethod: z.ZodOptional<z.ZodEnum<typeof AuthMethod>>;
104
- /** For a chat answer: the inbound source it arrived through (`slack:interactions`). Names a channel, not a person. */
94
+ stepUpAt: z.ZodOptional<z.ZodNumber>;
95
+ stepUpUserVerified: z.ZodOptional<z.ZodBoolean>;
105
96
  inboundSourceKey: z.ZodOptional<z.ZodString>;
106
97
  }, z.core.$strict>;
107
98
  requester: z.ZodOptional<z.ZodObject<{
108
99
  kind: z.ZodEnum<typeof HumanDecision_RequesterKind>;
109
100
  clientId: z.ZodOptional<z.ZodString>;
110
- /** The digest of the requester's disclosure, when the requester is a person. */
111
101
  disclosure: z.ZodOptional<z.ZodString>;
112
102
  }, z.core.$strict>>;
113
- /** The digest of the approver's disclosure. */
114
103
  approver: z.ZodString;
115
104
  }, z.core.$strict>;
116
105
  export type ApprovalSealClaimsV1 = z.infer<typeof ApprovalSealClaimsV1Schema>;
@@ -128,4 +117,12 @@ export declare function encodeApprovalSealDisclosure(disclosure: ApprovalSealDis
128
117
  export declare function approvalSealDisclosureDigestOf(disclosure: ApprovalSealDisclosureValue): string;
129
118
  /** A new seal id: 128 bits, base64url. */
130
119
  export declare function newApprovalSealJti(): string;
120
+ /**
121
+ * The commitment a seal binds a FILE deliverable by (#2904, the form #2903's design names): base64url SHA-256 of the ASCII
122
+ * string `salt + contentSha256`, the salt base64url and the hash the file's lowercase hex SHA-256. The presentation carries
123
+ * the commitment and the seal's row the salt, so the clear hash stays in the file's metadata: a JWS, or a presentation,
124
+ * shared without the salt cannot be used to confirm a guessed document. Given the file's bytes and the salt, anyone can
125
+ * recompute it, and one changed byte changes it.
126
+ */
127
+ export declare function approvalSealFileCommitmentOf(salt: string, contentSha256: string): string;
131
128
  //# sourceMappingURL=approval-seal.contracts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"approval-seal.contracts.d.ts","sourceRoot":"","sources":["../../../../src/key-management/approval-seal.contracts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,8BAA8B,EAC9B,mBAAmB,EAEnB,cAAc,EACd,UAAU,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,2BAA2B,EAC5B,MAAM,uBAAuB,CAAC;AAI/B;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,kDAAkD;AAClD,oBAAY,2BAA2B;IACrC,8GAA8G;IAC9G,QAAQ,aAAa;IACrB,iDAAiD;IACjD,SAAS,cAAc;IACvB;;;;OAIG;IACH,YAAY,iBAAiB;IAC7B,iHAAiH;IACjH,SAAS,cAAc;CACxB;AAKD,0HAA0H;AAC1H,eAAO,MAAM,+BAA+B;;;IAG1C,iFAAiF;;;;;;;IAKjF,sHAAsH;;kBAEtH,CAAC;AAEH,gFAAgF;AAChF,eAAO,MAAM,iCAAiC;;;IAG5C,gFAAgF;;kBAEhF,CAAC;AAEH,8HAA8H;AAC9H,eAAO,MAAM,0BAA0B;;IAErC,gFAAgF;;;;;;IAMhF,+CAA+C;;IAE/C,iGAAiG;;;;;;;IAOjG,sHAAsH;;QAEpH,sHAAsH;;;;;IAKxH,+FAA+F;;;IAG/F,mEAAmE;;;;;;IAEnE,8FAA8F;;;;;QA/C9F,iFAAiF;;;;;;;QAKjF,sHAAsH;;;;;;QAQtH,gFAAgF;;;IAsChF,+CAA+C;;kBAE/C,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,mDAAmD;AACnD,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,SAAS,EAAE,2BAA2B,CAAC;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACnD;AAED,kFAAkF;AAClF,wBAAgB,6BAA6B,IAAI,MAAM,CAEtD;AAED,gHAAgH;AAChH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,2BAA2B,GAAG,MAAM,CAE5F;AAED,gGAAgG;AAChG,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,2BAA2B,GAAG,MAAM,CAE9F;AAED,0CAA0C;AAC1C,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C"}
1
+ {"version":3,"file":"approval-seal.contracts.d.ts","sourceRoot":"","sources":["../../../src/key-management/approval-seal.contracts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,8BAA8B,EAC9B,mBAAmB,EAEnB,cAAc,EACd,UAAU,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,2BAA2B,EAC5B,MAAM,uBAAuB,CAAC;AAI/B;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,kDAAkD;AAClD,oBAAY,2BAA2B;IACrC,8GAA8G;IAC9G,QAAQ,aAAa;IACrB,iDAAiD;IACjD,SAAS,cAAc;IACvB;;;;OAIG;IACH,YAAY,iBAAiB;IAC7B,iHAAiH;IACjH,SAAS,cAAc;CACxB;AAKD,0HAA0H;AAC1H,eAAO,MAAM,+BAA+B;;;;;;;;;;;;kBAoB1C,CAAC;AAEH,gFAAgF;AAChF,eAAO,MAAM,iCAAiC;;;;kBAK5C,CAAC;AAEH,8HAA8H;AAC9H,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmCrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,mDAAmD;AACnD,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,SAAS,EAAE,2BAA2B,CAAC;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACnD;AAED,kFAAkF;AAClF,wBAAgB,6BAA6B,IAAI,MAAM,CAEtD;AAED,gHAAgH;AAChH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,2BAA2B,GAAG,MAAM,CAE5F;AAED,gGAAgG;AAChG,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,2BAA2B,GAAG,MAAM,CAE9F;AAED,0CAA0C;AAC1C,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAExF"}
@@ -49,6 +49,16 @@ export const ApprovalSealDeciderClaimsSchema = z.strictObject({
49
49
  authTime: z.number().int().nonnegative().optional(),
50
50
  amr: z.array(z.string().min(1)).min(1).optional(),
51
51
  stepUpMethod: z.enum(AuthMethod).optional(),
52
+ /**
53
+ * When the step-up factor was proven, epoch seconds (#2923): beside `stepUpMethod`, it shows which factor answered and
54
+ * how long before `decidedAt`, which is what a decision requiring a fresh factor (`stepUp.maximumAgeSeconds`) asked.
55
+ */
56
+ stepUpAt: z.number().int().nonnegative().optional(),
57
+ /**
58
+ * For a passkey step-up, whether the authenticator verified the person (the assertion's UV flag, #2923). The assertion
59
+ * itself, which names the credential, is in the salted approver disclosure, never here.
60
+ */
61
+ stepUpUserVerified: z.boolean().optional(),
52
62
  /** For a chat answer: the inbound source it arrived through (`slack:interactions`). Names a channel, not a person. */
53
63
  inboundSourceKey: z.string().min(1).optional(),
54
64
  });
@@ -112,4 +122,14 @@ export function approvalSealDisclosureDigestOf(disclosure) {
112
122
  export function newApprovalSealJti() {
113
123
  return randomBytes(16).toString('base64url');
114
124
  }
125
+ /**
126
+ * The commitment a seal binds a FILE deliverable by (#2904, the form #2903's design names): base64url SHA-256 of the ASCII
127
+ * string `salt + contentSha256`, the salt base64url and the hash the file's lowercase hex SHA-256. The presentation carries
128
+ * the commitment and the seal's row the salt, so the clear hash stays in the file's metadata: a JWS, or a presentation,
129
+ * shared without the salt cannot be used to confirm a guessed document. Given the file's bytes and the salt, anyone can
130
+ * recompute it, and one changed byte changes it.
131
+ */
132
+ export function approvalSealFileCommitmentOf(salt, contentSha256) {
133
+ return base64url(createHash('sha256').update(`${salt}${contentSha256}`, 'ascii').digest());
134
+ }
115
135
  //# sourceMappingURL=approval-seal.contracts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"approval-seal.contracts.js","sourceRoot":"","sources":["../../../../src/key-management/approval-seal.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,8BAA8B,EAC9B,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,UAAU,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,aA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C,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,4BAA4B,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAC5G,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,kBAAkB;IAChC,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import { createHash, randomBytes } from 'node:crypto';\nimport { z } from 'zod';\nimport {\n ApprovalPresentationProvenance,\n ApprovalSealMeaning,\n APPROVAL_SEAL_OUTCOMES,\n ApprovalSource,\n AuthMethod,\n HumanDecision_AnswerChannel,\n HumanDecision_DeciderKind,\n HumanDecision_RequesterKind,\n} from '@wildo-ai/saas-models';\nimport { canonicalizeJson } from '../canonical-json/rfc8785-canonical-json';\nimport { base64url } from './es256-jws';\n\n/**\n * # The approval seal's claims, version 1 (#2903)\n *\n * The shape is fixed once seals exist: a seal made today must verify, and read the same, for as long as its record is\n * kept. A change is a new version (`v`), never an edit of this one. The application builds and checks these claims at\n * commit; the custodian (#2891) checks only what it decides on (`jti`, `decidedAt`, `tenant`) and signs the rest as\n * committed, under the decision-payload digest; the offline verifier checks all of it.\n *\n * ## No person in clear\n *\n * No personal value and no deterministic pseudonym is in the payload. Each person (the approver, and a requester who is\n * a person) appears ONLY as the digest of one salted disclosure, in the SD-JWT disclosure form: SHA-256 over the base64url\n * of the JSON array `[salt, claimName, value]`. The claim name is inside the digest, so a disclosure cannot be replayed\n * into another slot. The disclosure, salt and value included, is kept on the seal's row.\n *\n * spec-cite: N/A — the disclosure form is SD-JWT's (RFC 9901 §4.2.1, salted array), reproduced from its structure rather\n * than quoted; the digest here is over the RFC 8785 canonical form of the array so it can be rebuilt from stored fields.\n */\nexport const APPROVAL_SEAL_CLAIMS_VERSION = 1;\n\n/** The claim names a disclosure may stand for. */\nexport enum ApprovalSealDisclosureClaim {\n /** The person who decided: printed name, reference, authentication time, session reference, any assertion. */\n APPROVER = 'approver',\n /** The person who asked, when a person asked. */\n REQUESTER = 'requester',\n /**\n * What the person was shown (#2903 S6): the decision's presentation, its wording and the values decided on. Salted like a\n * person's disclosure, so a seal shared alone cannot confirm a guessed presentation. Kept with the seal when a person\n * is erased: it is the record of what was decided on, not a fact about the person who decided.\n */\n PRESENTATION = 'presentation',\n /** What the person answered (#2903 S6): the option, the values, the arguments they authored, the reason code. */\n STATEMENT = 'statement',\n}\n\n/** A disclosure commitment: base64url SHA-256, 43 characters. */\nconst DigestSchema = z.string().regex(/^[A-Za-z0-9_-]{43}$/);\n\n/** The decider's context, as #2905 records it, minus anything that would identify the person (their link id, session). */\nexport const ApprovalSealDeciderClaimsSchema = z.strictObject({\n kind: z.enum(HumanDecision_DeciderKind),\n channel: z.enum(HumanDecision_AnswerChannel),\n /** The client that acted for the person, in the style of RFC 8693 §4.1 `act`. */\n act: z.strictObject({ clientId: z.string().min(1) }).optional(),\n authTime: z.number().int().nonnegative().optional(),\n amr: z.array(z.string().min(1)).min(1).optional(),\n stepUpMethod: z.enum(AuthMethod).optional(),\n /** For a chat answer: the inbound source it arrived through (`slack:interactions`). Names a channel, not a person. */\n inboundSourceKey: z.string().min(1).optional(),\n});\n\n/** Who asked. A machine is named by kind only; a person by their disclosure. */\nexport const ApprovalSealRequesterClaimsSchema = z.strictObject({\n kind: z.enum(HumanDecision_RequesterKind),\n clientId: z.string().min(1).optional(),\n /** The digest of the requester's disclosure, when the requester is a person. */\n disclosure: DigestSchema.optional(),\n});\n\n/** The approval seal's claims, version 1: everything but what the custodian sets (`iss`, `iat`, `kid`, `typ`, `lateSeal`). */\nexport const ApprovalSealClaimsV1Schema = z.strictObject({\n v: z.literal(APPROVAL_SEAL_CLAIMS_VERSION),\n /** Minted at commit: at least 128 bits, base64url. With `iss` the seal's id. */\n jti: z.string().regex(/^[A-Za-z0-9_-]{22,}$/),\n source: z.enum(ApprovalSource),\n decisionRef: z.string().min(1),\n step: z.number().int().min(0),\n sequence: z.number().int().min(1),\n /** The jti of the seal this one supersedes. */\n supersedes: z.string().min(1).optional(),\n /** The organization the decision belongs to, or the application's id when it belongs to none. */\n tenant: z.string().min(1),\n subject: z.strictObject({\n resourceType: z.string().min(1),\n resourceId: z.string().min(1),\n presentationSchemaVersion: z.number().int().min(1).optional(),\n }),\n /** What was presented, when the engine built it (#2903 S6): its id, how its rendering is known, its salted digest. */\n presentation: z.strictObject({\n /** The id the act echoed, or the one the engine derived for what it sent. Absent when the application held no key. */\n id: z.string().min(1).optional(),\n provenance: z.enum(ApprovalPresentationProvenance),\n digest: DigestSchema,\n }).optional(),\n /** The digest of the approver's statement (the `statement` disclosure): what they answered. */\n statementDigest: DigestSchema.optional(),\n meaning: z.enum(ApprovalSealMeaning),\n /** Only an outcome a person decided (`APPROVAL_SEAL_OUTCOMES`). */\n outcome: z.enum(APPROVAL_SEAL_OUTCOMES),\n /** When the person decided, epoch seconds: distinct from `iat`, when the custodian signed. */\n decidedAt: z.number().int().positive(),\n decider: ApprovalSealDeciderClaimsSchema,\n requester: ApprovalSealRequesterClaimsSchema.optional(),\n /** The digest of the approver's disclosure. */\n approver: DigestSchema,\n});\nexport type ApprovalSealClaimsV1 = z.infer<typeof ApprovalSealClaimsV1Schema>;\n\n/** One disclosure, as stored on the seal's row. */\nexport interface ApprovalSealDisclosureValue {\n readonly claimName: ApprovalSealDisclosureClaim;\n readonly salt: string;\n readonly value: Readonly<Record<string, unknown>>;\n}\n\n/** A fresh disclosure salt: 128 bits from the CSPRNG, base64url. Never reused. */\nexport function newApprovalSealDisclosureSalt(): string {\n return randomBytes(16).toString('base64url');\n}\n\n/** The disclosure's encoded form: base64url of the RFC 8785 canonical JSON array `[salt, claimName, value]`. */\nexport function encodeApprovalSealDisclosure(disclosure: ApprovalSealDisclosureValue): string {\n return base64url(canonicalizeJson([disclosure.salt, disclosure.claimName, disclosure.value]));\n}\n\n/** The commitment a payload carries for a disclosure: base64url SHA-256 of its encoded form. */\nexport function approvalSealDisclosureDigestOf(disclosure: ApprovalSealDisclosureValue): string {\n return base64url(createHash('sha256').update(encodeApprovalSealDisclosure(disclosure), 'ascii').digest());\n}\n\n/** A new seal id: 128 bits, base64url. */\nexport function newApprovalSealJti(): string {\n return randomBytes(16).toString('base64url');\n}\n"]}
1
+ {"version":3,"file":"approval-seal.contracts.js","sourceRoot":"","sources":["../../../src/key-management/approval-seal.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,8BAA8B,EAC9B,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,UAAU,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAE9C,kDAAkD;AAClD,MAAM,CAAN,IAAY,2BAaX;AAbD,WAAY,2BAA2B;IACrC,8GAA8G;IAC9G,oDAAqB,CAAA;IACrB,iDAAiD;IACjD,sDAAuB,CAAA;IACvB;;;;OAIG;IACH,4DAA6B,CAAA;IAC7B,iHAAiH;IACjH,sDAAuB,CAAA;AACzB,CAAC,EAbW,2BAA2B,KAA3B,2BAA2B,QAatC;AAED,iEAAiE;AACjE,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;AAE7D,0HAA0H;AAC1H,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC5D,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC;IACvC,OAAO,EAAE,CAAC,CAAC,IA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AAE,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAC7F,CAAC","sourcesContent":["import { createHash, randomBytes } from 'node:crypto';\nimport { z } from 'zod';\nimport {\n ApprovalPresentationProvenance,\n ApprovalSealMeaning,\n APPROVAL_SEAL_OUTCOMES,\n ApprovalSource,\n AuthMethod,\n HumanDecision_AnswerChannel,\n HumanDecision_DeciderKind,\n HumanDecision_RequesterKind,\n} from '@wildo-ai/saas-models';\nimport { canonicalizeJson } from '../canonical-json/rfc8785-canonical-json';\nimport { base64url } from './es256-jws';\n\n/**\n * # The approval seal's claims, version 1 (#2903)\n *\n * The shape is fixed once seals exist: a seal made today must verify, and read the same, for as long as its record is\n * kept. A change is a new version (`v`), never an edit of this one. The application builds and checks these claims at\n * commit; the custodian (#2891) checks only what it decides on (`jti`, `decidedAt`, `tenant`) and signs the rest as\n * committed, under the decision-payload digest; the offline verifier checks all of it.\n *\n * ## No person in clear\n *\n * No personal value and no deterministic pseudonym is in the payload. Each person (the approver, and a requester who is\n * a person) appears ONLY as the digest of one salted disclosure, in the SD-JWT disclosure form: SHA-256 over the base64url\n * of the JSON array `[salt, claimName, value]`. The claim name is inside the digest, so a disclosure cannot be replayed\n * into another slot. The disclosure, salt and value included, is kept on the seal's row.\n *\n * spec-cite: N/A — the disclosure form is SD-JWT's (RFC 9901 §4.2.1, salted array), reproduced from its structure rather\n * than quoted; the digest here is over the RFC 8785 canonical form of the array so it can be rebuilt from stored fields.\n */\nexport const APPROVAL_SEAL_CLAIMS_VERSION = 1;\n\n/** The claim names a disclosure may stand for. */\nexport enum ApprovalSealDisclosureClaim {\n /** The person who decided: printed name, reference, authentication time, session reference, any assertion. */\n APPROVER = 'approver',\n /** The person who asked, when a person asked. */\n REQUESTER = 'requester',\n /**\n * What the person was shown (#2903 S6): the decision's presentation, its wording and the values decided on. Salted like a\n * person's disclosure, so a seal shared alone cannot confirm a guessed presentation. Kept with the seal when a person\n * is erased: it is the record of what was decided on, not a fact about the person who decided.\n */\n PRESENTATION = 'presentation',\n /** What the person answered (#2903 S6): the option, the values, the arguments they authored, the reason code. */\n STATEMENT = 'statement',\n}\n\n/** A disclosure commitment: base64url SHA-256, 43 characters. */\nconst DigestSchema = z.string().regex(/^[A-Za-z0-9_-]{43}$/);\n\n/** The decider's context, as #2905 records it, minus anything that would identify the person (their link id, session). */\nexport const ApprovalSealDeciderClaimsSchema = z.strictObject({\n kind: z.enum(HumanDecision_DeciderKind),\n channel: z.enum(HumanDecision_AnswerChannel),\n /** The client that acted for the person, in the style of RFC 8693 §4.1 `act`. */\n act: z.strictObject({ clientId: z.string().min(1) }).optional(),\n authTime: z.number().int().nonnegative().optional(),\n amr: z.array(z.string().min(1)).min(1).optional(),\n stepUpMethod: z.enum(AuthMethod).optional(),\n /**\n * When the step-up factor was proven, epoch seconds (#2923): beside `stepUpMethod`, it shows which factor answered and\n * how long before `decidedAt`, which is what a decision requiring a fresh factor (`stepUp.maximumAgeSeconds`) asked.\n */\n stepUpAt: z.number().int().nonnegative().optional(),\n /**\n * For a passkey step-up, whether the authenticator verified the person (the assertion's UV flag, #2923). The assertion\n * itself, which names the credential, is in the salted approver disclosure, never here.\n */\n stepUpUserVerified: z.boolean().optional(),\n /** For a chat answer: the inbound source it arrived through (`slack:interactions`). Names a channel, not a person. */\n inboundSourceKey: z.string().min(1).optional(),\n});\n\n/** Who asked. A machine is named by kind only; a person by their disclosure. */\nexport const ApprovalSealRequesterClaimsSchema = z.strictObject({\n kind: z.enum(HumanDecision_RequesterKind),\n clientId: z.string().min(1).optional(),\n /** The digest of the requester's disclosure, when the requester is a person. */\n disclosure: DigestSchema.optional(),\n});\n\n/** The approval seal's claims, version 1: everything but what the custodian sets (`iss`, `iat`, `kid`, `typ`, `lateSeal`). */\nexport const ApprovalSealClaimsV1Schema = z.strictObject({\n v: z.literal(APPROVAL_SEAL_CLAIMS_VERSION),\n /** Minted at commit: at least 128 bits, base64url. With `iss` the seal's id. */\n jti: z.string().regex(/^[A-Za-z0-9_-]{22,}$/),\n source: z.enum(ApprovalSource),\n decisionRef: z.string().min(1),\n step: z.number().int().min(0),\n sequence: z.number().int().min(1),\n /** The jti of the seal this one supersedes. */\n supersedes: z.string().min(1).optional(),\n /** The organization the decision belongs to, or the application's id when it belongs to none. */\n tenant: z.string().min(1),\n subject: z.strictObject({\n resourceType: z.string().min(1),\n resourceId: z.string().min(1),\n presentationSchemaVersion: z.number().int().min(1).optional(),\n }),\n /** What was presented, when the engine built it (#2903 S6): its id, how its rendering is known, its salted digest. */\n presentation: z.strictObject({\n /** The id the act echoed, or the one the engine derived for what it sent. Absent when the application held no key. */\n id: z.string().min(1).optional(),\n provenance: z.enum(ApprovalPresentationProvenance),\n digest: DigestSchema,\n }).optional(),\n /** The digest of the approver's statement (the `statement` disclosure): what they answered. */\n statementDigest: DigestSchema.optional(),\n meaning: z.enum(ApprovalSealMeaning),\n /** Only an outcome a person decided (`APPROVAL_SEAL_OUTCOMES`). */\n outcome: z.enum(APPROVAL_SEAL_OUTCOMES),\n /** When the person decided, epoch seconds: distinct from `iat`, when the custodian signed. */\n decidedAt: z.number().int().positive(),\n decider: ApprovalSealDeciderClaimsSchema,\n requester: ApprovalSealRequesterClaimsSchema.optional(),\n /** The digest of the approver's disclosure. */\n approver: DigestSchema,\n});\nexport type ApprovalSealClaimsV1 = z.infer<typeof ApprovalSealClaimsV1Schema>;\n\n/** One disclosure, as stored on the seal's row. */\nexport interface ApprovalSealDisclosureValue {\n readonly claimName: ApprovalSealDisclosureClaim;\n readonly salt: string;\n readonly value: Readonly<Record<string, unknown>>;\n}\n\n/** A fresh disclosure salt: 128 bits from the CSPRNG, base64url. Never reused. */\nexport function newApprovalSealDisclosureSalt(): string {\n return randomBytes(16).toString('base64url');\n}\n\n/** The disclosure's encoded form: base64url of the RFC 8785 canonical JSON array `[salt, claimName, value]`. */\nexport function encodeApprovalSealDisclosure(disclosure: ApprovalSealDisclosureValue): string {\n return base64url(canonicalizeJson([disclosure.salt, disclosure.claimName, disclosure.value]));\n}\n\n/** The commitment a payload carries for a disclosure: base64url SHA-256 of its encoded form. */\nexport function approvalSealDisclosureDigestOf(disclosure: ApprovalSealDisclosureValue): string {\n return base64url(createHash('sha256').update(encodeApprovalSealDisclosure(disclosure), 'ascii').digest());\n}\n\n/** A new seal id: 128 bits, base64url. */\nexport function newApprovalSealJti(): string {\n return randomBytes(16).toString('base64url');\n}\n\n/**\n * The commitment a seal binds a FILE deliverable by (#2904, the form #2903's design names): base64url SHA-256 of the ASCII\n * string `salt + contentSha256`, the salt base64url and the hash the file's lowercase hex SHA-256. The presentation carries\n * the commitment and the seal's row the salt, so the clear hash stays in the file's metadata: a JWS, or a presentation,\n * shared without the salt cannot be used to confirm a guessed document. Given the file's bytes and the salt, anyone can\n * recompute it, and one changed byte changes it.\n */\nexport function approvalSealFileCommitmentOf(salt: string, contentSha256: string): string {\n return base64url(createHash('sha256').update(`${salt}${contentSha256}`, 'ascii').digest());\n}\n"]}
@@ -27,7 +27,6 @@ export declare function dataKeyAssociatedDataOf(input: {
27
27
  }): Buffer;
28
28
  export declare const DataKeyIssueRequestSchema: z.ZodObject<{
29
29
  purpose: z.ZodEnum<typeof CryptoKey_Purpose>;
30
- /** The organization whose key serves the request, when the binding is organization-scoped; ignored otherwise. */
31
30
  organizationId: z.ZodOptional<z.ZodString>;
32
31
  }, z.core.$strict>;
33
32
  export type DataKeyIssueRequest = z.infer<typeof DataKeyIssueRequestSchema>;
@@ -68,7 +67,6 @@ export declare const DataKeyReleaseRequestSchema: z.ZodObject<{
68
67
  export type DataKeyReleaseRequest = z.infer<typeof DataKeyReleaseRequestSchema>;
69
68
  export declare const DataKeyWrappingVersionsRequestSchema: z.ZodObject<{
70
69
  purpose: z.ZodEnum<typeof CryptoKey_Purpose>;
71
- /** The organization whose key serves the request, when the binding is organization-scoped; ignored otherwise. */
72
70
  organizationId: z.ZodOptional<z.ZodString>;
73
71
  }, z.core.$strict>;
74
72
  export type DataKeyWrappingVersionsRequest = z.infer<typeof DataKeyWrappingVersionsRequestSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"data-key.contracts.d.ts","sourceRoot":"","sources":["../../../../src/key-management/data-key.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAExG;;;;;;;;;;;;;;;;;GAiBG;AAEH,uDAAuD;AACvD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAErL;AAWD,eAAO,MAAM,yBAAyB;;IAJpC,iHAAiH;;kBAIjD,CAAC;AACnE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,0BAA0B;;;;;;kBAIrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,0BAA0B;;;;;;kBAA6B,CAAC;AACrE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iCAAiC,uCAAuC,CAAC;AACtF,eAAO,MAAM,0BAA0B,aAAa,CAAC;AAErD,eAAO,MAAM,2BAA2B;;;;kBAA+D,CAAC;AACxG,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,oCAAoC;;IAlC/C,iHAAiH;;kBAkCtC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I,KAAK,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC;AACtH,CAAC;AAED,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AAE7D,0GAA0G;AAC1G,MAAM,yBAAyB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC/C,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC;IAClC,iHAAiH;IACjH,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,yBAAyB,CAAC;AAGnE,MAAM,CAAC,MAAM,0BAA0B,GAAG,yBAAyB,CAAC,MAAM,CAAC;IACzE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,OAAO,EAAE,eAAe;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,0BAA0B,GAAG,0BAA0B,CAAC;AAGrE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,oCAAoC,CAAC;AACtF,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC;AAErD,MAAM,CAAC,MAAM,2BAA2B,GAAG,yBAAyB,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAGxG,MAAM,CAAC,MAAM,oCAAoC,GAAG,yBAAyB,CAAC","sourcesContent":["import { z } from 'zod';\nimport { CryptoKey_Purpose, CryptoKey_Scope, type CryptoKey_VersionState } from '@wildo-ai/saas-models';\n\n/**\n * # Data keys: what the application and the custodian exchange (#2894)\n *\n * The application seals its stored secrets under DATA keys, and a data key is only ever stored WRAPPED by its purpose's\n * wrapping key, which never leaves the custodian (apps-manager). Five requests, all on the signed apps-to-manager channel:\n *\n * - **issue** a new data key: the custodian mints it, wraps it under the ACTIVE wrapping version, and answers with both\n * halves (the application stores the wrapped one and holds the plaintext in memory only);\n * - **unwrap** a stored data key, at boot or when a process first needs it;\n * - **rewrap** a data key under the ACTIVE version after a rotation, without its plaintext leaving the custodian;\n * - **release** a retired wrapping version once no stored data key is wrapped under it, so it can be destroyed;\n * - **read the wrapping versions** and their states, from which the application derives, at every refresh, what it\n * re-wraps, which data key stops sealing (one a COMPROMISED version wrapped), and which version it releases.\n *\n * The custodian builds the associated data of every wrap itself ({@link dataKeyAssociatedDataOf}): the purpose, the\n * scope, the scope's id and the data key's id, so a wrapped key copied to another data key, organization or application\n * does not unwrap. Both sides import this module.\n */\n\n/** The associated data a data key is wrapped under. */\nexport function dataKeyAssociatedDataOf(input: { readonly purpose: CryptoKey_Purpose; readonly scope: CryptoKey_Scope; readonly scopeId: string; readonly dataKeyId: string }): Buffer {\n return Buffer.from(`wildo-data-key:v1|${input.purpose}|${input.scope}|${input.scopeId}|${input.dataKeyId}`, 'utf8');\n}\n\nconst base64urlString = z.string().regex(/^[A-Za-z0-9_-]+$/);\n\n/** Which keyring: the purpose, and the organization when the purpose's binding is organization-scoped. */\nconst DataKeyScopeRequestSchema = z.strictObject({\n purpose: z.enum(CryptoKey_Purpose),\n /** The organization whose key serves the request, when the binding is organization-scoped; ignored otherwise. */\n organizationId: z.string().min(1).optional(),\n});\n\nexport const DataKeyIssueRequestSchema = DataKeyScopeRequestSchema;\nexport type DataKeyIssueRequest = z.infer<typeof DataKeyIssueRequestSchema>;\n\nexport const DataKeyUnwrapRequestSchema = DataKeyScopeRequestSchema.extend({\n kid: z.string().min(1),\n dataKeyId: z.string().min(1),\n wrapped: base64urlString,\n});\nexport type DataKeyUnwrapRequest = z.infer<typeof DataKeyUnwrapRequestSchema>;\n\nexport const DataKeyRewrapRequestSchema = DataKeyUnwrapRequestSchema;\nexport type DataKeyRewrapRequest = z.infer<typeof DataKeyRewrapRequestSchema>;\n\n/**\n * The header by which a rewrap declares that the application recorded the data key's exposure before asking (#3029),\n * with the value {@link DATA_KEY_EXPOSURE_RECORDED}. The custodian refuses a rewrap off a COMPROMISED version without it\n * (`exposure_unrecorded`): once the row is re-wrapped it no longer names the compromised version, and only the mark tells\n * the application that the values sealed under that data key must be sealed again. A runtime from before #3029 records\n * no mark and sends no header, so it is refused and the row waits for a current runtime to mark and move it.\n *\n * A header rather than a body field, decided: the request body is a strict object, so a custodian from before #3029\n * would refuse an unknown field as `request_invalid`, which an application reads as \"this runtime is refused\" and stops\n * sealing on. A custodian from before #3029 ignores the header, and the application marks its rows either way.\n */\nexport const DATA_KEY_EXPOSURE_RECORDED_HEADER = 'x-wildo-data-key-exposure-recorded';\nexport const DATA_KEY_EXPOSURE_RECORDED = 'recorded';\n\nexport const DataKeyReleaseRequestSchema = DataKeyScopeRequestSchema.extend({ kid: z.string().min(1) });\nexport type DataKeyReleaseRequest = z.infer<typeof DataKeyReleaseRequestSchema>;\n\nexport const DataKeyWrappingVersionsRequestSchema = DataKeyScopeRequestSchema;\nexport type DataKeyWrappingVersionsRequest = z.infer<typeof DataKeyWrappingVersionsRequestSchema>;\n\n/** Where a data key belongs: the keyring scope the custodian resolved for the request. */\nexport interface DataKeyScope {\n readonly scope: CryptoKey_Scope;\n readonly scopeId: string;\n}\n\n/** A new data key: its id, its wrapping version, both halves (base64url), and the scope it was wrapped for. */\nexport interface DataKeyIssueResponse extends DataKeyScope {\n readonly dataKeyId: string;\n readonly kid: string;\n readonly dataKey: string;\n readonly wrapped: string;\n}\n\nexport interface DataKeyUnwrapResponse {\n readonly dataKey: string;\n}\n\n/** One wrapping version of the keyring, as the application needs it: its `kid`, its state, and whether it was released. */\nexport interface DataKeyWrappingVersion {\n readonly kid: string;\n readonly state: CryptoKey_VersionState;\n readonly released: boolean;\n}\n\n/** Every wrapping version of the keyring that serves the request (none before its first data key). */\nexport interface DataKeyWrappingVersionsResponse {\n readonly versions: readonly DataKeyWrappingVersion[];\n}\n\nexport interface DataKeyRewrapResponse {\n readonly kid: string;\n readonly wrapped: string;\n}\n\nexport interface DataKeyReleaseResponse {\n readonly kid: string;\n readonly releasedAt: string;\n}\n"]}
1
+ {"version":3,"file":"data-key.contracts.js","sourceRoot":"","sources":["../../../src/key-management/data-key.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAgD,MAAM,uBAAuB,CAAC;AAExG;;;;;;;;;;;;;;;;;GAiBG;AAEH,uDAAuD;AACvD,MAAM,UAAU,uBAAuB,CAAC,KAAqI;IAC3K,OAAO,MAAM,CAAC,IAAI,CAAC,qBAAqB,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC;AACtH,CAAC;AAED,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AAE7D,0GAA0G;AAC1G,MAAM,yBAAyB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC/C,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC;IAClC,iHAAiH;IACjH,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,yBAAyB,CAAC;AAGnE,MAAM,CAAC,MAAM,0BAA0B,GAAG,yBAAyB,CAAC,MAAM,CAAC;IACzE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,OAAO,EAAE,eAAe;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,0BAA0B,GAAG,0BAA0B,CAAC;AAGrE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,oCAAoC,CAAC;AACtF,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC;AAErD,MAAM,CAAC,MAAM,2BAA2B,GAAG,yBAAyB,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAGxG,MAAM,CAAC,MAAM,oCAAoC,GAAG,yBAAyB,CAAC","sourcesContent":["import { z } from 'zod';\nimport { CryptoKey_Purpose, CryptoKey_Scope, type CryptoKey_VersionState } from '@wildo-ai/saas-models';\n\n/**\n * # Data keys: what the application and the custodian exchange (#2894)\n *\n * The application seals its stored secrets under DATA keys, and a data key is only ever stored WRAPPED by its purpose's\n * wrapping key, which never leaves the custodian (apps-manager). Five requests, all on the signed apps-to-manager channel:\n *\n * - **issue** a new data key: the custodian mints it, wraps it under the ACTIVE wrapping version, and answers with both\n * halves (the application stores the wrapped one and holds the plaintext in memory only);\n * - **unwrap** a stored data key, at boot or when a process first needs it;\n * - **rewrap** a data key under the ACTIVE version after a rotation, without its plaintext leaving the custodian;\n * - **release** a retired wrapping version once no stored data key is wrapped under it, so it can be destroyed;\n * - **read the wrapping versions** and their states, from which the application derives, at every refresh, what it\n * re-wraps, which data key stops sealing (one a COMPROMISED version wrapped), and which version it releases.\n *\n * The custodian builds the associated data of every wrap itself ({@link dataKeyAssociatedDataOf}): the purpose, the\n * scope, the scope's id and the data key's id, so a wrapped key copied to another data key, organization or application\n * does not unwrap. Both sides import this module.\n */\n\n/** The associated data a data key is wrapped under. */\nexport function dataKeyAssociatedDataOf(input: { readonly purpose: CryptoKey_Purpose; readonly scope: CryptoKey_Scope; readonly scopeId: string; readonly dataKeyId: string }): Buffer {\n return Buffer.from(`wildo-data-key:v1|${input.purpose}|${input.scope}|${input.scopeId}|${input.dataKeyId}`, 'utf8');\n}\n\nconst base64urlString = z.string().regex(/^[A-Za-z0-9_-]+$/);\n\n/** Which keyring: the purpose, and the organization when the purpose's binding is organization-scoped. */\nconst DataKeyScopeRequestSchema = z.strictObject({\n purpose: z.enum(CryptoKey_Purpose),\n /** The organization whose key serves the request, when the binding is organization-scoped; ignored otherwise. */\n organizationId: z.string().min(1).optional(),\n});\n\nexport const DataKeyIssueRequestSchema = DataKeyScopeRequestSchema;\nexport type DataKeyIssueRequest = z.infer<typeof DataKeyIssueRequestSchema>;\n\nexport const DataKeyUnwrapRequestSchema = DataKeyScopeRequestSchema.extend({\n kid: z.string().min(1),\n dataKeyId: z.string().min(1),\n wrapped: base64urlString,\n});\nexport type DataKeyUnwrapRequest = z.infer<typeof DataKeyUnwrapRequestSchema>;\n\nexport const DataKeyRewrapRequestSchema = DataKeyUnwrapRequestSchema;\nexport type DataKeyRewrapRequest = z.infer<typeof DataKeyRewrapRequestSchema>;\n\n/**\n * The header by which a rewrap declares that the application recorded the data key's exposure before asking (#3029),\n * with the value {@link DATA_KEY_EXPOSURE_RECORDED}. The custodian refuses a rewrap off a COMPROMISED version without it\n * (`exposure_unrecorded`): once the row is re-wrapped it no longer names the compromised version, and only the mark tells\n * the application that the values sealed under that data key must be sealed again. A runtime from before #3029 records\n * no mark and sends no header, so it is refused and the row waits for a current runtime to mark and move it.\n *\n * A header rather than a body field, decided: the request body is a strict object, so a custodian from before #3029\n * would refuse an unknown field as `request_invalid`, which an application reads as \"this runtime is refused\" and stops\n * sealing on. A custodian from before #3029 ignores the header, and the application marks its rows either way.\n */\nexport const DATA_KEY_EXPOSURE_RECORDED_HEADER = 'x-wildo-data-key-exposure-recorded';\nexport const DATA_KEY_EXPOSURE_RECORDED = 'recorded';\n\nexport const DataKeyReleaseRequestSchema = DataKeyScopeRequestSchema.extend({ kid: z.string().min(1) });\nexport type DataKeyReleaseRequest = z.infer<typeof DataKeyReleaseRequestSchema>;\n\nexport const DataKeyWrappingVersionsRequestSchema = DataKeyScopeRequestSchema;\nexport type DataKeyWrappingVersionsRequest = z.infer<typeof DataKeyWrappingVersionsRequestSchema>;\n\n/** Where a data key belongs: the keyring scope the custodian resolved for the request. */\nexport interface DataKeyScope {\n readonly scope: CryptoKey_Scope;\n readonly scopeId: string;\n}\n\n/** A new data key: its id, its wrapping version, both halves (base64url), and the scope it was wrapped for. */\nexport interface DataKeyIssueResponse extends DataKeyScope {\n readonly dataKeyId: string;\n readonly kid: string;\n readonly dataKey: string;\n readonly wrapped: string;\n}\n\nexport interface DataKeyUnwrapResponse {\n readonly dataKey: string;\n}\n\n/** One wrapping version of the keyring, as the application needs it: its `kid`, its state, and whether it was released. */\nexport interface DataKeyWrappingVersion {\n readonly kid: string;\n readonly state: CryptoKey_VersionState;\n readonly released: boolean;\n}\n\n/** Every wrapping version of the keyring that serves the request (none before its first data key). */\nexport interface DataKeyWrappingVersionsResponse {\n readonly versions: readonly DataKeyWrappingVersion[];\n}\n\nexport interface DataKeyRewrapResponse {\n readonly kid: string;\n readonly wrapped: string;\n}\n\nexport interface DataKeyReleaseResponse {\n readonly kid: string;\n readonly releasedAt: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"es256-jws.d.ts","sourceRoot":"","sources":["../../../../src/key-management/es256-jws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAEpH;;;;;;;;GAQG;AAEH,2FAA2F;AAC3F,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;IACnB,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,6GAA6G;AAC7G,eAAO,MAAM,mBAAmB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AQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACjF,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,oBAAoB,CAAC,SAAqB;IACxD,IAAI,SAAS,CAAC,MAAM,KAAK,yBAAyB;QAAE,OAAO,KAAK,CAAC;IACjE,OAAO,MAAM,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,UAAU,IAAI,EAAE,CAAC;AAChG,CAAC;AAED,oHAAoH;AACpH,MAAM,UAAU,WAAW,CAAC,YAAoB,EAAE,SAAqB,EAAE,SAAwB;IAC/F,IAAI,SAAS,CAAC,MAAM,KAAK,yBAAyB;QAAE,OAAO,KAAK,CAAC;IACjE,OAAO,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,eAAe,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,SAAS,CAAC,CAAC;AAChJ,CAAC","sourcesContent":["import { createHash, createPublicKey, verify as verifyWithKey, type JsonWebKey, type KeyObject } from 'node:crypto';\n\n/**\n * The ES256 / JWS primitives every signer and verifier in the platform shares (#2891): the platform's answers to its\n * runtimes (#2921), the keyring's signatures and the approval seal's verifier (#2903). One implementation, in a\n * package with no JOSE dependency, so the offline verifier and every runtime read signatures the same way.\n *\n * spec-cite: RFC 7515 §5.1 (the JWS signing input), RFC 7518 §3.4 (ES256: ECDSA P-256 SHA-256, signature as the\n * 64-byte concatenation R ‖ S, each left-padded to 32 bytes), RFC 7638 §3 (the JWK thumbprint over the required\n * members in lexicographic order).\n */\n\n/** The public half of an ES256 key, as a JWK carrying only the members RFC 7638 hashes. */\nexport interface P256PublicJwk {\n readonly kty: 'EC';\n readonly crv: 'P-256';\n readonly x: string;\n readonly y: string;\n}\n\n/** The only JWS algorithm the platform signs with, pinned rather than read from a header (RFC 8725 §3.1). */\nexport const ES256_JWS_ALGORITHM = 'ES256';\n\n/** The length of a raw ES256 signature: R and S, 32 bytes each. */\nexport const ES256_RAW_SIGNATURE_BYTES = 64;\n\n/** base64url without padding (RFC 7515 §2). */\nexport function base64url(input: Buffer | Uint8Array | string): string {\n return Buffer.from(input).toString('base64url');\n}\n\n/** Whether a value is a P-256 public JWK with the members RFC 7638 hashes. */\nexport function isP256PublicJwk(value: unknown): value is P256PublicJwk {\n if (!value || typeof value !== 'object') return false;\n const jwk = value as Record<string, unknown>;\n return jwk.kty === 'EC' && jwk.crv === 'P-256' && typeof jwk.x === 'string' && typeof jwk.y === 'string';\n}\n\n/** The RFC 7638 thumbprint of a P-256 public key: SHA-256 over `{\"crv\",\"kty\",\"x\",\"y\"}` in that order, base64url. */\nexport function p256JwkThumbprint(jwk: P256PublicJwk): string {\n const canonical = `{\"crv\":\"${jwk.crv}\",\"kty\":\"${jwk.kty}\",\"x\":\"${jwk.x}\",\"y\":\"${jwk.y}\"}`;\n return base64url(createHash('sha256').update(canonical).digest());\n}\n\n/** The P-256 public JWK of a key object (public or private); refuses any other key type. */\nexport function p256PublicJwkOf(key: KeyObject): P256PublicJwk {\n const exported = (key.type === 'private' ? createPublicKey(key) : key).export({ format: 'jwk' }) as JsonWebKey;\n if (!isP256PublicJwk(exported)) {\n throw new Error('An ES256 key must be an EC P-256 key.');\n }\n return { kty: 'EC', crv: 'P-256', x: exported.x, y: exported.y };\n}\n\n/** The verification key object of a P-256 public JWK. */\nexport function p256KeyObjectOf(jwk: P256PublicJwk): KeyObject {\n return createPublicKey({ key: { kty: 'EC', crv: 'P-256', x: jwk.x, y: jwk.y }, format: 'jwk' });\n}\n\n/** The JWS signing input, `base64url(header).base64url(payload)` (RFC 7515 §5.1), for JSON header and claims. */\nexport function jwsSigningInput(header: Readonly<Record<string, unknown>>, claims: unknown): string {\n return `${base64url(JSON.stringify(header))}.${base64url(JSON.stringify(claims))}`;\n}\n\n/** The SHA-256 digest of a JWS signing input over its ASCII bytes: what a remote key provider is asked to sign. */\nexport function jwsSigningInputDigest(signingInput: string): Buffer {\n return createHash('sha256').update(Buffer.from(signingInput, 'ascii')).digest();\n}\n\n/** How a key provider encodes the ECDSA signatures it returns. Declared by the provider, never guessed from the bytes. */\nexport enum EcdsaSignatureEncoding {\n /** R ‖ S, 32 bytes each: what JWS requires and what a JOSE-native provider returns. */\n RAW = 'raw',\n /** The DER `SEQUENCE { INTEGER r, INTEGER s }` a cloud KMS or an HSM returns. */\n DER = 'der',\n}\n\n/**\n * Normalize an ECDSA P-256 signature to the raw form ES256 requires: R ‖ S, each exactly 32 bytes, left-padded with\n * zeros, never stripped (RFC 7518 §3.4). The encoding is the provider's declaration: guessing it from the bytes would be\n * wrong for a valid raw signature whose first bytes happen to read as a DER header. Refuses a malformed signature, so\n * one is never stored or returned.\n */\nexport function normalizeEs256Signature(signature: Uint8Array, encoding: EcdsaSignatureEncoding): Buffer {\n const bytes = Buffer.from(signature);\n const fail = (why: string): never => {\n throw new Error(`Not an ES256 signature: ${why}.`);\n };\n if (encoding === EcdsaSignatureEncoding.RAW) {\n if (bytes.length !== ES256_RAW_SIGNATURE_BYTES) fail(`a raw signature is ${ES256_RAW_SIGNATURE_BYTES} bytes, got ${bytes.length}`);\n return bytes;\n }\n if (bytes[0] !== 0x30) fail('not a DER sequence');\n let offset = 1;\n const [sequenceLength, sequenceLengthBytes] = readDerLength(bytes, offset) ?? fail('bad sequence length');\n offset += sequenceLengthBytes;\n if (offset + sequenceLength !== bytes.length) fail('the sequence length does not match the signature length');\n const integers: Buffer[] = [];\n for (let index = 0; index < 2; index += 1) {\n if (bytes[offset] !== 0x02) fail('expected an INTEGER');\n offset += 1;\n const [integerLength, integerLengthBytes] = readDerLength(bytes, offset) ?? fail('bad integer length');\n offset += integerLengthBytes;\n let integer = bytes.subarray(offset, offset + integerLength);\n offset += integerLength;\n while (integer.length > 1 && integer[0] === 0x00) integer = integer.subarray(1);\n if (integer.length > 32) fail('an integer is wider than 32 bytes');\n integers.push(Buffer.concat([Buffer.alloc(32 - integer.length), integer]));\n }\n if (offset !== bytes.length) fail('trailing bytes after the two integers');\n return Buffer.concat(integers);\n}\n\nfunction readDerLength(bytes: Buffer, offset: number): [number, number] | undefined {\n const first = bytes[offset];\n if (first === undefined) return undefined;\n if (first < 0x80) return [first, 1];\n const count = first & 0x7f;\n if (count === 0 || count > 2 || offset + 1 + count > bytes.length) return undefined;\n let length = 0;\n for (let index = 0; index < count; index += 1) length = (length << 8) | (bytes[offset + 1 + index] as number);\n return [length, 1 + count];\n}\n\n/** The order of the P-256 group (SEC 2 §2.4.2), for the low-S form. */\nconst P256_ORDER = 0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551n;\n\n/**\n * The low-S form of a raw ES256 signature: S replaced by n − S when S > n/2. Both forms verify; signing only the low\n * one removes the trivial malleability (a second valid signature over the same input), which is why a seal's identity\n * never rests on its signature bytes and the signing proxy still emits low-S only (#2903).\n */\nexport function toLowSEs256Signature(signature: Uint8Array): Buffer {\n const bytes = Buffer.from(signature);\n if (bytes.length !== ES256_RAW_SIGNATURE_BYTES) throw new Error(`Not a raw ES256 signature: ${bytes.length} bytes.`);\n const s = BigInt(`0x${bytes.subarray(32).toString('hex')}`);\n if (s <= P256_ORDER >> 1n) return bytes;\n const lowS = Buffer.from((P256_ORDER - s).toString(16).padStart(64, '0'), 'hex');\n return Buffer.concat([bytes.subarray(0, 32), lowS]);\n}\n\n/** Whether a raw ES256 signature is in the low-S form. */\nexport function isLowSEs256Signature(signature: Uint8Array): boolean {\n if (signature.length !== ES256_RAW_SIGNATURE_BYTES) return false;\n return BigInt(`0x${Buffer.from(signature).subarray(32).toString('hex')}`) <= P256_ORDER >> 1n;\n}\n\n/** Whether a raw ES256 signature verifies over a signing input under a public JWK. Verification is always local. */\nexport function verifyEs256(signingInput: string, signature: Uint8Array, publicJwk: P256PublicJwk): boolean {\n if (signature.length !== ES256_RAW_SIGNATURE_BYTES) return false;\n return verifyWithKey('sha256', Buffer.from(signingInput, 'ascii'), { key: p256KeyObjectOf(publicJwk), dsaEncoding: 'ieee-p1363' }, signature);\n}\n"]}
1
+ {"version":3,"file":"es256-jws.js","sourceRoot":"","sources":["../../../src/key-management/es256-jws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,IAAI,aAAa,EAAmC,MAAM,aAAa,CAAC;AAoBpH,6GAA6G;AAC7G,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAE3C,mEAAmE;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C,+CAA+C;AAC/C,MAAM,UAAU,SAAS,CAAC,KAAmC;IAC3D,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAClD,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,GAAG,GAAG,KAAgC,CAAC;IAC7C,OAAO,GAAG,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,GAAG,KAAK,OAAO,IAAI,OAAO,GAAG,CAAC,CAAC,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,CAAC,KAAK,QAAQ,CAAC;AAC3G,CAAC;AAED,oHAAoH;AACpH,MAAM,UAAU,iBAAiB,CAAC,GAAkB;IAClD,MAAM,SAAS,GAAG,WAAW,GAAG,CAAC,GAAG,YAAY,GAAG,CAAC,GAAG,UAAU,G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AAK,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,oBAAoB,CAAC,SAAqB;IACxD,IAAI,SAAS,CAAC,MAAM,KAAK,yBAAyB;QAAE,OAAO,KAAK,CAAC;IACjE,OAAO,MAAM,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,UAAU,IAAI,EAAE,CAAC;AAChG,CAAC;AAED,oHAAoH;AACpH,MAAM,UAAU,WAAW,CAAC,YAAoB,EAAE,SAAqB,EAAE,SAAwB;IAC/F,IAAI,SAAS,CAAC,MAAM,KAAK,yBAAyB;QAAE,OAAO,KAAK,CAAC;IACjE,OAAO,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,eAAe,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,SAAS,CAAC,CAAC;AAChJ,CAAC","sourcesContent":["import { createHash, createPublicKey, verify as verifyWithKey, type JsonWebKey, type KeyObject } from 'node:crypto';\n\n/**\n * The ES256 / JWS primitives every signer and verifier in the platform shares (#2891): the platform's answers to its\n * runtimes (#2921), the keyring's signatures and the approval seal's verifier (#2903). One implementation, in a\n * package with no JOSE dependency, so the offline verifier and every runtime read signatures the same way.\n *\n * spec-cite: RFC 7515 §5.1 (the JWS signing input), RFC 7518 §3.4 (ES256: ECDSA P-256 SHA-256, signature as the\n * 64-byte concatenation R ‖ S, each left-padded to 32 bytes), RFC 7638 §3 (the JWK thumbprint over the required\n * members in lexicographic order).\n */\n\n/** The public half of an ES256 key, as a JWK carrying only the members RFC 7638 hashes. */\nexport interface P256PublicJwk {\n readonly kty: 'EC';\n readonly crv: 'P-256';\n readonly x: string;\n readonly y: string;\n}\n\n/** The only JWS algorithm the platform signs with, pinned rather than read from a header (RFC 8725 §3.1). */\nexport const ES256_JWS_ALGORITHM = 'ES256';\n\n/** The length of a raw ES256 signature: R and S, 32 bytes each. */\nexport const ES256_RAW_SIGNATURE_BYTES = 64;\n\n/** base64url without padding (RFC 7515 §2). */\nexport function base64url(input: Buffer | Uint8Array | string): string {\n return Buffer.from(input).toString('base64url');\n}\n\n/** Whether a value is a P-256 public JWK with the members RFC 7638 hashes. */\nexport function isP256PublicJwk(value: unknown): value is P256PublicJwk {\n if (!value || typeof value !== 'object') return false;\n const jwk = value as Record<string, unknown>;\n return jwk.kty === 'EC' && jwk.crv === 'P-256' && typeof jwk.x === 'string' && typeof jwk.y === 'string';\n}\n\n/** The RFC 7638 thumbprint of a P-256 public key: SHA-256 over `{\"crv\",\"kty\",\"x\",\"y\"}` in that order, base64url. */\nexport function p256JwkThumbprint(jwk: P256PublicJwk): string {\n const canonical = `{\"crv\":\"${jwk.crv}\",\"kty\":\"${jwk.kty}\",\"x\":\"${jwk.x}\",\"y\":\"${jwk.y}\"}`;\n return base64url(createHash('sha256').update(canonical).digest());\n}\n\n/** The P-256 public JWK of a key object (public or private); refuses any other key type. */\nexport function p256PublicJwkOf(key: KeyObject): P256PublicJwk {\n const exported = (key.type === 'private' ? createPublicKey(key) : key).export({ format: 'jwk' }) as JsonWebKey;\n if (!isP256PublicJwk(exported)) {\n throw new Error('An ES256 key must be an EC P-256 key.');\n }\n return { kty: 'EC', crv: 'P-256', x: exported.x, y: exported.y };\n}\n\n/** The verification key object of a P-256 public JWK. */\nexport function p256KeyObjectOf(jwk: P256PublicJwk): KeyObject {\n return createPublicKey({ key: { kty: 'EC', crv: 'P-256', x: jwk.x, y: jwk.y }, format: 'jwk' });\n}\n\n/** The JWS signing input, `base64url(header).base64url(payload)` (RFC 7515 §5.1), for JSON header and claims. */\nexport function jwsSigningInput(header: Readonly<Record<string, unknown>>, claims: unknown): string {\n return `${base64url(JSON.stringify(header))}.${base64url(JSON.stringify(claims))}`;\n}\n\n/** The SHA-256 digest of a JWS signing input over its ASCII bytes: what a remote key provider is asked to sign. */\nexport function jwsSigningInputDigest(signingInput: string): Buffer {\n return createHash('sha256').update(Buffer.from(signingInput, 'ascii')).digest();\n}\n\n/** How a key provider encodes the ECDSA signatures it returns. Declared by the provider, never guessed from the bytes. */\nexport enum EcdsaSignatureEncoding {\n /** R ‖ S, 32 bytes each: what JWS requires and what a JOSE-native provider returns. */\n RAW = 'raw',\n /** The DER `SEQUENCE { INTEGER r, INTEGER s }` a cloud KMS or an HSM returns. */\n DER = 'der',\n}\n\n/**\n * Normalize an ECDSA P-256 signature to the raw form ES256 requires: R ‖ S, each exactly 32 bytes, left-padded with\n * zeros, never stripped (RFC 7518 §3.4). The encoding is the provider's declaration: guessing it from the bytes would be\n * wrong for a valid raw signature whose first bytes happen to read as a DER header. Refuses a malformed signature, so\n * one is never stored or returned.\n */\nexport function normalizeEs256Signature(signature: Uint8Array, encoding: EcdsaSignatureEncoding): Buffer {\n const bytes = Buffer.from(signature);\n const fail = (why: string): never => {\n throw new Error(`Not an ES256 signature: ${why}.`);\n };\n if (encoding === EcdsaSignatureEncoding.RAW) {\n if (bytes.length !== ES256_RAW_SIGNATURE_BYTES) fail(`a raw signature is ${ES256_RAW_SIGNATURE_BYTES} bytes, got ${bytes.length}`);\n return bytes;\n }\n if (bytes[0] !== 0x30) fail('not a DER sequence');\n let offset = 1;\n const [sequenceLength, sequenceLengthBytes] = readDerLength(bytes, offset) ?? fail('bad sequence length');\n offset += sequenceLengthBytes;\n if (offset + sequenceLength !== bytes.length) fail('the sequence length does not match the signature length');\n const integers: Buffer[] = [];\n for (let index = 0; index < 2; index += 1) {\n if (bytes[offset] !== 0x02) fail('expected an INTEGER');\n offset += 1;\n const [integerLength, integerLengthBytes] = readDerLength(bytes, offset) ?? fail('bad integer length');\n offset += integerLengthBytes;\n let integer = bytes.subarray(offset, offset + integerLength);\n offset += integerLength;\n while (integer.length > 1 && integer[0] === 0x00) integer = integer.subarray(1);\n if (integer.length > 32) fail('an integer is wider than 32 bytes');\n integers.push(Buffer.concat([Buffer.alloc(32 - integer.length), integer]));\n }\n if (offset !== bytes.length) fail('trailing bytes after the two integers');\n return Buffer.concat(integers);\n}\n\nfunction readDerLength(bytes: Buffer, offset: number): [number, number] | undefined {\n const first = bytes[offset];\n if (first === undefined) return undefined;\n if (first < 0x80) return [first, 1];\n const count = first & 0x7f;\n if (count === 0 || count > 2 || offset + 1 + count > bytes.length) return undefined;\n let length = 0;\n for (let index = 0; index < count; index += 1) length = (length << 8) | (bytes[offset + 1 + index] as number);\n return [length, 1 + count];\n}\n\n/** The order of the P-256 group (SEC 2 §2.4.2), for the low-S form. */\nconst P256_ORDER = 0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551n;\n\n/**\n * The low-S form of a raw ES256 signature: S replaced by n − S when S > n/2. Both forms verify; signing only the low\n * one removes the trivial malleability (a second valid signature over the same input), which is why a seal's identity\n * never rests on its signature bytes and the signing proxy still emits low-S only (#2903).\n */\nexport function toLowSEs256Signature(signature: Uint8Array): Buffer {\n const bytes = Buffer.from(signature);\n if (bytes.length !== ES256_RAW_SIGNATURE_BYTES) throw new Error(`Not a raw ES256 signature: ${bytes.length} bytes.`);\n const s = BigInt(`0x${bytes.subarray(32).toString('hex')}`);\n if (s <= P256_ORDER >> 1n) return bytes;\n const lowS = Buffer.from((P256_ORDER - s).toString(16).padStart(64, '0'), 'hex');\n return Buffer.concat([bytes.subarray(0, 32), lowS]);\n}\n\n/** Whether a raw ES256 signature is in the low-S form. */\nexport function isLowSEs256Signature(signature: Uint8Array): boolean {\n if (signature.length !== ES256_RAW_SIGNATURE_BYTES) return false;\n return BigInt(`0x${Buffer.from(signature).subarray(32).toString('hex')}`) <= P256_ORDER >> 1n;\n}\n\n/** Whether a raw ES256 signature verifies over a signing input under a public JWK. Verification is always local. */\nexport function verifyEs256(signingInput: string, signature: Uint8Array, publicJwk: P256PublicJwk): boolean {\n if (signature.length !== ES256_RAW_SIGNATURE_BYTES) return false;\n return verifyWithKey('sha256', Buffer.from(signingInput, 'ascii'), { key: p256KeyObjectOf(publicJwk), dsaEncoding: 'ieee-p1363' }, signature);\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { type KeyObject } from 'node:crypto';
2
- import type { CryptoKey_MaterialAccess, CryptoKey_MaterialProvenance, CryptoKey_OperationMode, CryptoKey_Primitive, CryptoKey_ProtectionLevel, CryptoKeyFloor } from '@wildo-ai/saas-models';
2
+ import type { CryptoKey_MaterialAccess, CryptoKey_MaterialProvenance, CryptoKey_OperationMode, CryptoKey_Primitive, CryptoKey_ProtectionEvidence, CryptoKey_ProtectionLevel, CryptoKeyFloor } from '@wildo-ai/saas-models';
3
3
  import type { EcdsaSignatureEncoding, P256PublicJwk } from './es256-jws';
4
4
  /**
5
5
  * # The key provider SPI (#2891)
@@ -36,6 +36,13 @@ export interface KeyVersionAttestation {
36
36
  readonly protectionLevel: CryptoKey_ProtectionLevel;
37
37
  readonly materialAccess: CryptoKey_MaterialAccess;
38
38
  readonly provenance: CryptoKey_MaterialProvenance;
39
+ /**
40
+ * Whose word `protectionLevel` rests on (#3016). A provider states exactly what it did: one that reads its vendor's key
41
+ * metadata answers `PROVIDER_CLAIM`, never `VERIFIED_HARDWARE_ATTESTATION`, which only a provider that verified the
42
+ * HSM's own signed statement against pinned roots and bound it to this version may answer. The keyring checks it
43
+ * against the purpose's floor like every other axis.
44
+ */
45
+ readonly protectionEvidence: CryptoKey_ProtectionEvidence;
39
46
  /** False once the provider has disabled or destroyed the version's private material. */
40
47
  readonly privateMaterialUsable: boolean;
41
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"key-provider.spi.d.ts","sourceRoot":"","sources":["../../../../src/key-management/key-provider.spi.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6D,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AACxG,OAAO,KAAK,EACV,wBAAwB,EACxB,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