@kya-os/checkpoint-shared 1.7.0 → 1.9.0

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 (277) hide show
  1. package/CHANGELOG.md +159 -9
  2. package/README.md +24 -7
  3. package/dist/agent-catalog.d.mts +12 -0
  4. package/dist/agent-catalog.d.mts.map +1 -0
  5. package/dist/agent-catalog.d.ts +12 -0
  6. package/dist/agent-catalog.d.ts.map +1 -0
  7. package/dist/agent-catalog.js +105 -0
  8. package/dist/agent-catalog.mjs +105 -0
  9. package/dist/agent-catalog.mjs.map +1 -0
  10. package/dist/beacon-nonce/index.d.mts +1 -0
  11. package/dist/beacon-nonce/index.d.mts.map +1 -1
  12. package/dist/beacon-nonce/index.d.ts +1 -0
  13. package/dist/beacon-nonce/index.d.ts.map +1 -1
  14. package/dist/beacon-nonce/index.js +9 -3
  15. package/dist/beacon-nonce/index.mjs +9 -4
  16. package/dist/beacon-nonce/index.mjs.map +1 -1
  17. package/dist/beacon-types/index.d.mts +41 -1
  18. package/dist/beacon-types/index.d.mts.map +1 -1
  19. package/dist/beacon-types/index.d.ts +41 -1
  20. package/dist/beacon-types/index.d.ts.map +1 -1
  21. package/dist/beacon-types/index.js +153 -4
  22. package/dist/beacon-types/index.mjs +139 -4
  23. package/dist/beacon-types/index.mjs.map +1 -1
  24. package/dist/{browser-posture-BLhw-MON.d.mts → browser-posture-5fPrsxx7.d.mts} +6 -6
  25. package/dist/{browser-posture-BLhw-MON.d.mts.map → browser-posture-5fPrsxx7.d.mts.map} +1 -1
  26. package/dist/{browser-posture-B8YiPa5c.d.ts → browser-posture-CCR1kh5e.d.ts} +6 -6
  27. package/dist/{browser-posture-B8YiPa5c.d.ts.map → browser-posture-CCR1kh5e.d.ts.map} +1 -1
  28. package/dist/browser-posture-cookie.js +1 -1
  29. package/dist/browser-posture-cookie.mjs +1 -1
  30. package/dist/browser-posture-cookie.mjs.map +1 -1
  31. package/dist/browser-posture-proof-verifier-DvsOmFrM.js +202 -0
  32. package/dist/browser-posture-proof-verifier-I0HP2Ics.mjs +180 -0
  33. package/dist/browser-posture-proof-verifier-I0HP2Ics.mjs.map +1 -0
  34. package/dist/browser-posture-proof-verifier.d.mts +25 -0
  35. package/dist/browser-posture-proof-verifier.d.mts.map +1 -0
  36. package/dist/browser-posture-proof-verifier.d.ts +25 -0
  37. package/dist/browser-posture-proof-verifier.d.ts.map +1 -0
  38. package/dist/browser-posture-proof-verifier.js +7 -0
  39. package/dist/browser-posture-proof-verifier.mjs +3 -0
  40. package/dist/browser-posture-proof.d.mts +4 -5
  41. package/dist/browser-posture-proof.d.mts.map +1 -1
  42. package/dist/browser-posture-proof.d.ts +4 -5
  43. package/dist/browser-posture-proof.d.ts.map +1 -1
  44. package/dist/browser-posture-proof.js +10 -79
  45. package/dist/browser-posture-proof.mjs +6 -77
  46. package/dist/browser-posture-proof.mjs.map +1 -1
  47. package/dist/browser-posture.d.mts +1 -1
  48. package/dist/browser-posture.d.ts +1 -1
  49. package/dist/browser-posture.js +6 -5
  50. package/dist/browser-posture.mjs +4 -3
  51. package/dist/browser-posture.mjs.map +1 -1
  52. package/dist/browser.d.mts +25 -286
  53. package/dist/browser.d.mts.map +1 -1
  54. package/dist/browser.d.ts +25 -286
  55. package/dist/browser.d.ts.map +1 -1
  56. package/dist/browser.js +1 -1
  57. package/dist/browser.mjs +1 -1
  58. package/dist/browser.mjs.map +1 -1
  59. package/dist/canonical-signer/index.js +30 -28
  60. package/dist/canonical-signer/index.mjs +31 -1
  61. package/dist/canonical-signer/index.mjs.map +1 -1
  62. package/dist/clearance.d.mts +1 -1
  63. package/dist/clearance.d.ts +1 -1
  64. package/dist/clearance.js +2 -2
  65. package/dist/clearance.mjs +2 -2
  66. package/dist/client-ip-B7w-uHfS.d.mts +55 -0
  67. package/dist/client-ip-B7w-uHfS.d.mts.map +1 -0
  68. package/dist/client-ip-B7w-uHfS.d.ts +55 -0
  69. package/dist/client-ip-B7w-uHfS.d.ts.map +1 -0
  70. package/dist/{client-ip-CW6pRyLf.js → client-ip-B8wFzJ5f.js} +117 -7
  71. package/dist/{client-ip-B2Xeo-GK.mjs → client-ip-DIJyr6px.mjs} +113 -9
  72. package/dist/client-ip-DIJyr6px.mjs.map +1 -0
  73. package/dist/client-ip.d.mts +2 -2
  74. package/dist/client-ip.d.ts +2 -2
  75. package/dist/client-ip.js +3 -2
  76. package/dist/client-ip.mjs +2 -2
  77. package/dist/consent-handoff.d.mts +0 -3
  78. package/dist/consent-handoff.d.mts.map +1 -1
  79. package/dist/consent-handoff.d.ts +0 -3
  80. package/dist/consent-handoff.d.ts.map +1 -1
  81. package/dist/consent-handoff.mjs.map +1 -1
  82. package/dist/default-sign-in-host.d.mts +10 -0
  83. package/dist/default-sign-in-host.d.mts.map +1 -0
  84. package/dist/default-sign-in-host.d.ts +10 -0
  85. package/dist/default-sign-in-host.d.ts.map +1 -0
  86. package/dist/default-sign-in-host.js +72 -0
  87. package/dist/default-sign-in-host.mjs +66 -0
  88. package/dist/default-sign-in-host.mjs.map +1 -0
  89. package/dist/detection-reason-mapping-B9RSkOs8.js +277 -0
  90. package/dist/detection-reason-mapping-BGymWIPl.mjs +249 -0
  91. package/dist/detection-reason-mapping-BGymWIPl.mjs.map +1 -0
  92. package/dist/detection-reason-mapping-CQexNvR7.d.mts +52 -0
  93. package/dist/detection-reason-mapping-CQexNvR7.d.mts.map +1 -0
  94. package/dist/detection-reason-mapping-CQexNvR7.d.ts +52 -0
  95. package/dist/detection-reason-mapping-CQexNvR7.d.ts.map +1 -0
  96. package/dist/engine-enforcing-AYEcgNsb.js +39 -0
  97. package/dist/engine-enforcing-B5eNfCpG.mjs +29 -0
  98. package/dist/engine-enforcing-B5eNfCpG.mjs.map +1 -0
  99. package/dist/engine-enforcing-DiOclGqf.d.mts +11 -0
  100. package/dist/engine-enforcing-DiOclGqf.d.mts.map +1 -0
  101. package/dist/engine-enforcing-DiOclGqf.d.ts +11 -0
  102. package/dist/engine-enforcing-DiOclGqf.d.ts.map +1 -0
  103. package/dist/engine-info.d.mts +2 -0
  104. package/dist/engine-info.d.ts +2 -0
  105. package/dist/engine-info.js +4 -0
  106. package/dist/engine-info.mjs +3 -0
  107. package/dist/errors/index.d.mts +6 -0
  108. package/dist/errors/index.d.mts.map +1 -1
  109. package/dist/errors/index.d.ts +6 -0
  110. package/dist/errors/index.d.ts.map +1 -1
  111. package/dist/errors/index.js +28 -6
  112. package/dist/errors/index.mjs +28 -6
  113. package/dist/errors/index.mjs.map +1 -1
  114. package/dist/{external-B7WI9FyQ.d.ts → external-m3Kmafwj.d.mts} +2 -2
  115. package/dist/{external-B7WI9FyQ.d.mts.map → external-m3Kmafwj.d.mts.map} +1 -1
  116. package/dist/{external-B7WI9FyQ.d.mts → external-m3Kmafwj.d.ts} +2 -2
  117. package/dist/{external-B7WI9FyQ.d.ts.map → external-m3Kmafwj.d.ts.map} +1 -1
  118. package/dist/fetcher-C8qvwdnA.d.ts +44 -0
  119. package/dist/fetcher-C8qvwdnA.d.ts.map +1 -0
  120. package/dist/fetcher-D2vjr7jB.d.mts +44 -0
  121. package/dist/fetcher-D2vjr7jB.d.mts.map +1 -0
  122. package/dist/gateway-client-ip.d.mts +1 -3
  123. package/dist/gateway-client-ip.d.mts.map +1 -1
  124. package/dist/gateway-client-ip.d.ts +1 -3
  125. package/dist/gateway-client-ip.d.ts.map +1 -1
  126. package/dist/gateway-client-ip.js +2 -2
  127. package/dist/gateway-client-ip.mjs +2 -2
  128. package/dist/gateway-client-ip.mjs.map +1 -1
  129. package/dist/host-adapter/index.d.mts +2 -2
  130. package/dist/host-adapter/index.d.ts +2 -2
  131. package/dist/host-adapter/index.js +2 -1
  132. package/dist/host-adapter/index.mjs +2 -2
  133. package/dist/{host-adapter-C-4IxmqM.mjs → host-adapter-BKdQHwbi.mjs} +56 -3
  134. package/dist/{host-adapter-C-4IxmqM.mjs.map → host-adapter-BKdQHwbi.mjs.map} +1 -1
  135. package/dist/{host-adapter-CwW9YB0U.js → host-adapter-bWftXA9T.js} +60 -1
  136. package/dist/index-DnFsmr_o.d.ts +156 -0
  137. package/dist/index-DnFsmr_o.d.ts.map +1 -0
  138. package/dist/index-rvw5Bz-r.d.mts +156 -0
  139. package/dist/index-rvw5Bz-r.d.mts.map +1 -0
  140. package/dist/index.d.mts +6681 -11335
  141. package/dist/index.d.mts.map +1 -1
  142. package/dist/index.d.ts +6681 -11335
  143. package/dist/index.d.ts.map +1 -1
  144. package/dist/index.js +2322 -6900
  145. package/dist/index.mjs +2236 -6574
  146. package/dist/index.mjs.map +1 -1
  147. package/dist/{kya-http-error-codes-UYb1zpGM.js → kya-http-error-codes-B4rUmUEI.js} +2 -0
  148. package/dist/{kya-http-error-codes-7ewV5RuK.d.ts → kya-http-error-codes-C14E4gi3.d.mts} +2 -1
  149. package/dist/kya-http-error-codes-C14E4gi3.d.mts.map +1 -0
  150. package/dist/{kya-http-error-codes-7ewV5RuK.d.mts → kya-http-error-codes-C14E4gi3.d.ts} +2 -1
  151. package/dist/kya-http-error-codes-C14E4gi3.d.ts.map +1 -0
  152. package/dist/{kya-http-error-codes-C2JiWPsi.mjs → kya-http-error-codes-DSBrxNry.mjs} +3 -1
  153. package/dist/kya-http-error-codes-DSBrxNry.mjs.map +1 -0
  154. package/dist/kya-http.d.mts +3 -3
  155. package/dist/kya-http.d.ts +3 -3
  156. package/dist/kya-http.js +10 -2
  157. package/dist/kya-http.mjs +4 -3
  158. package/dist/mcpi/dashboard-config/index.d.mts.map +1 -1
  159. package/dist/mcpi/dashboard-config/index.d.ts.map +1 -1
  160. package/dist/mcpi/dashboard-config/index.mjs.map +1 -1
  161. package/dist/mcpi/status-list/index.d.mts +72 -0
  162. package/dist/mcpi/status-list/index.d.mts.map +1 -0
  163. package/dist/mcpi/status-list/index.d.ts +72 -0
  164. package/dist/mcpi/status-list/index.d.ts.map +1 -0
  165. package/dist/mcpi/status-list/index.js +703 -0
  166. package/dist/mcpi/status-list/index.mjs +684 -0
  167. package/dist/mcpi/status-list/index.mjs.map +1 -0
  168. package/dist/patterns-Bp40cwh2.d.mts +110 -0
  169. package/dist/patterns-Bp40cwh2.d.mts.map +1 -0
  170. package/dist/patterns-Bp40cwh2.d.ts +110 -0
  171. package/dist/patterns-Bp40cwh2.d.ts.map +1 -0
  172. package/dist/patterns-CiMpbdAF.js +243 -0
  173. package/dist/patterns-D4OAsNQY.mjs +173 -0
  174. package/dist/patterns-D4OAsNQY.mjs.map +1 -0
  175. package/dist/patterns.d.mts +2 -0
  176. package/dist/patterns.d.ts +2 -0
  177. package/dist/patterns.js +15 -0
  178. package/dist/patterns.mjs +3 -0
  179. package/dist/policy/enforcement.d.mts +3 -2
  180. package/dist/policy/enforcement.d.ts +3 -2
  181. package/dist/policy/enforcement.js +8 -2
  182. package/dist/policy/enforcement.mjs +3 -2
  183. package/dist/policy/fetcher.d.mts +2 -0
  184. package/dist/policy/fetcher.d.ts +2 -0
  185. package/dist/policy/fetcher.js +240 -0
  186. package/dist/policy/fetcher.mjs +238 -0
  187. package/dist/policy/fetcher.mjs.map +1 -0
  188. package/dist/policy/schemas.d.mts +3 -0
  189. package/dist/policy/schemas.d.ts +3 -0
  190. package/dist/policy/schemas.js +27 -0
  191. package/dist/policy/schemas.mjs +4 -0
  192. package/dist/{posture-origins-Ba83O0cD.mjs → posture-origins-Ci6k4Zh1.js} +24 -173
  193. package/dist/{posture-origins-CdVOdiMT.js → posture-origins-DGyS4Vuk.mjs} +2 -267
  194. package/dist/posture-origins-DGyS4Vuk.mjs.map +1 -0
  195. package/dist/{project-verification-key-BccT12tQ.js → project-verification-key-B-L3D2nC.js} +1 -1
  196. package/dist/{project-verification-key-66N4edKn.mjs → project-verification-key-CWXdu3-n.mjs} +2 -2
  197. package/dist/{project-verification-key-66N4edKn.mjs.map → project-verification-key-CWXdu3-n.mjs.map} +1 -1
  198. package/dist/provider-registry.d.mts +2 -0
  199. package/dist/provider-registry.d.ts +2 -0
  200. package/dist/provider-registry.js +51 -0
  201. package/dist/provider-registry.mjs +3 -0
  202. package/dist/reason-codes.d.mts +2 -0
  203. package/dist/reason-codes.d.ts +2 -0
  204. package/dist/reason-codes.js +8 -0
  205. package/dist/reason-codes.mjs +3 -0
  206. package/dist/{registered-sid-hUl-bvM5.mjs → registered-sid-26hNxp6t.mjs} +11 -2
  207. package/dist/registered-sid-26hNxp6t.mjs.map +1 -0
  208. package/dist/registered-sid-D6KCaT1E.d.mts +33 -0
  209. package/dist/registered-sid-D6KCaT1E.d.mts.map +1 -0
  210. package/dist/registered-sid-D6KCaT1E.d.ts +33 -0
  211. package/dist/registered-sid-D6KCaT1E.d.ts.map +1 -0
  212. package/dist/{registered-sid-eLCNZvIF.js → registered-sid-DVGTSH0L.js} +15 -0
  213. package/dist/ruleset-hash-Cmv8MSO5.js +34 -0
  214. package/dist/ruleset-hash-IRN5eI9H.d.mts +5 -0
  215. package/dist/ruleset-hash-IRN5eI9H.d.mts.map +1 -0
  216. package/dist/ruleset-hash-IRN5eI9H.d.ts +5 -0
  217. package/dist/ruleset-hash-IRN5eI9H.d.ts.map +1 -0
  218. package/dist/ruleset-hash-QQIaLuPi.mjs +30 -0
  219. package/dist/ruleset-hash-QQIaLuPi.mjs.map +1 -0
  220. package/dist/{schemas-YhagYDx_.js → schemas-BlScS1it.js} +0 -20
  221. package/dist/{index-HaqfPtaL.d.ts → schemas-CGKHzcMV.d.ts} +23 -195
  222. package/dist/schemas-CGKHzcMV.d.ts.map +1 -0
  223. package/dist/schemas-Cm4C4Z5G.js +703 -0
  224. package/dist/schemas-DPIT8usF.mjs +525 -0
  225. package/dist/schemas-DPIT8usF.mjs.map +1 -0
  226. package/dist/{schemas-7qodsG-Z.mjs → schemas-IHAhH3gV.mjs} +2 -16
  227. package/dist/schemas-IHAhH3gV.mjs.map +1 -0
  228. package/dist/{index-B7rTovHa.d.mts → schemas-m-GqyfyO.d.mts} +23 -195
  229. package/dist/schemas-m-GqyfyO.d.mts.map +1 -0
  230. package/dist/{step-up-COlmWJN8.mjs → step-up-BK0oBi11.mjs} +91 -41
  231. package/dist/step-up-BK0oBi11.mjs.map +1 -0
  232. package/dist/{step-up-C2d8C20x.js → step-up-Bp8RAQwv.js} +117 -55
  233. package/dist/{step-up-BjP--hG-.d.mts → step-up-Bz12gYKT.d.mts} +28 -12
  234. package/dist/step-up-Bz12gYKT.d.mts.map +1 -0
  235. package/dist/{step-up-BjP--hG-.d.ts → step-up-Bz12gYKT.d.ts} +28 -12
  236. package/dist/step-up-Bz12gYKT.d.ts.map +1 -0
  237. package/dist/test-fixtures/index.d.mts +4 -4
  238. package/dist/test-fixtures/index.d.mts.map +1 -1
  239. package/dist/test-fixtures/index.d.ts +4 -4
  240. package/dist/test-fixtures/index.d.ts.map +1 -1
  241. package/dist/test-fixtures/index.js +4 -4
  242. package/dist/test-fixtures/index.mjs +4 -4
  243. package/dist/test-fixtures/index.mjs.map +1 -1
  244. package/dist/tool-protection/index.d.mts +12 -0
  245. package/dist/tool-protection/index.d.mts.map +1 -1
  246. package/dist/tool-protection/index.d.ts +12 -0
  247. package/dist/tool-protection/index.d.ts.map +1 -1
  248. package/dist/tool-protection/index.js +46 -0
  249. package/dist/tool-protection/index.mjs +44 -1
  250. package/dist/tool-protection/index.mjs.map +1 -1
  251. package/dist/verification-BAw9N8Pt.js +181 -0
  252. package/dist/verification-Cvvv86TT.mjs +123 -0
  253. package/dist/verification-Cvvv86TT.mjs.map +1 -0
  254. package/fixtures/client-ip-resolution.n01.json +101 -0
  255. package/fixtures/kya-http/error-codes.json +2 -1
  256. package/fixtures/reviewer-grant-revocation.v1.json +53 -81
  257. package/package.json +55 -4
  258. package/dist/client-ip-B2Xeo-GK.mjs.map +0 -1
  259. package/dist/client-ip-DFamiNoz.d.mts +0 -34
  260. package/dist/client-ip-DFamiNoz.d.mts.map +0 -1
  261. package/dist/client-ip-DFamiNoz.d.ts +0 -34
  262. package/dist/client-ip-DFamiNoz.d.ts.map +0 -1
  263. package/dist/index-B7rTovHa.d.mts.map +0 -1
  264. package/dist/index-HaqfPtaL.d.ts.map +0 -1
  265. package/dist/kya-http-error-codes-7ewV5RuK.d.mts.map +0 -1
  266. package/dist/kya-http-error-codes-7ewV5RuK.d.ts.map +0 -1
  267. package/dist/kya-http-error-codes-C2JiWPsi.mjs.map +0 -1
  268. package/dist/posture-origins-Ba83O0cD.mjs.map +0 -1
  269. package/dist/registered-sid-D3g-gZQF.d.mts +0 -11
  270. package/dist/registered-sid-D3g-gZQF.d.mts.map +0 -1
  271. package/dist/registered-sid-D3g-gZQF.d.ts +0 -11
  272. package/dist/registered-sid-D3g-gZQF.d.ts.map +0 -1
  273. package/dist/registered-sid-hUl-bvM5.mjs.map +0 -1
  274. package/dist/schemas-7qodsG-Z.mjs.map +0 -1
  275. package/dist/step-up-BjP--hG-.d.mts.map +0 -1
  276. package/dist/step-up-BjP--hG-.d.ts.map +0 -1
  277. package/dist/step-up-COlmWJN8.mjs.map +0 -1
@@ -1,18 +1,17 @@
1
- import { E as ZodObject, L as output, T as ZodNumber, V as $strip, j as ZodString, t as external_d_exports } from "./external-B7WI9FyQ.js";
2
- import { N as BrowserPosture } from "./browser-posture-B8YiPa5c.js";
1
+ import { A as ZodString, B as $strip, T as ZodObject, t as external_d_exports, w as ZodNumber } from "./external-m3Kmafwj.js";
2
+ import { BrowserPostureProof, BrowserPostureProofFailure, BrowserPostureProofResult, DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS, POSTURE_PROOF_TYPE, browserPostureKeyThumbprint, verifyBrowserPostureProofKey } from "./browser-posture-proof-verifier.js";
3
+ import { N as BrowserPosture } from "./browser-posture-CCR1kh5e.js";
3
4
  //#region src/browser-posture-proof.d.ts
4
- export declare const POSTURE_PROOF_TYPE = "dpop+jwt";
5
- export declare const DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS = 60;
6
5
  export declare const BrowserPostureProofSchema: ZodObject<{
7
6
  jti: ZodString;
8
7
  htm: ZodString;
9
8
  htu: ZodString;
10
9
  iat: ZodNumber;
11
10
  }, $strip>;
12
- export type BrowserPostureProof = output<typeof BrowserPostureProofSchema>;
13
11
  export declare function verifyBrowserPostureProof(proofJws: string | undefined, posture: BrowserPosture, request: {
14
12
  method: string;
15
13
  url: string;
16
14
  }, now?: number, maxAgeSeconds?: number): Promise<BrowserPostureProof | undefined>;
17
15
  //#endregion
16
+ export { type BrowserPostureProof, type BrowserPostureProofFailure, type BrowserPostureProofResult, DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS, POSTURE_PROOF_TYPE, browserPostureKeyThumbprint, verifyBrowserPostureProofKey };
18
17
  //# sourceMappingURL=browser-posture-proof.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser-posture-proof.d.ts","names":[],"sources":["../src/browser-posture-proof.ts"],"mappings":";;;qBAaa;qBAKA;qBAEA,2BAAyB;;;;;GAKpC;YACU,sBAAsB,cAAe;wBAgB3B,0BACpB,8BACA,SAAS,gBACT;EAAW;EAAgB;GAC3B,cACA,yBACC,QAAQ"}
1
+ {"version":3,"file":"browser-posture-proof.d.ts","names":[],"sources":["../src/browser-posture-proof.ts"],"mappings":";;;;qBAoBa,2BAAyB;;;;;GAKK;wBAgBrB,0BACpB,8BACA,SAAS,gBACT;EAAW;EAAgB;GAC3B,cACA,yBACC,QAAQ"}
@@ -1,63 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_schemas = require('./schemas-YhagYDx_.js');
3
- let jose = require("jose");
2
+ const require_schemas = require('./schemas-BlScS1it.js');
3
+ const require_browser_posture_proof_verifier = require('./browser-posture-proof-verifier-DvsOmFrM.js');
4
4
 
5
- //#region src/utils/base64url.ts
6
- /**
7
- * Base64url (RFC 4648 § 5) built on `atob` and `btoa` rather than Node's
8
- * buffer API, so it runs on every runtime the SDKs support, Cloudflare Workers
9
- * without `nodejs_compat` included.
10
- */
11
- const BASE64URL_UNPADDED = /^[A-Za-z0-9_-]*$/;
12
- const PADDING = 61;
13
- /**
14
- * `text` without its trailing `=` padding. A backward scan, not
15
- * `replace(/=+$/, '')`: that regex retries from every `=` in a long run that
16
- * does not reach the end, which is quadratic on hostile input.
17
- */
18
- function withoutPadding(text) {
19
- let end = text.length;
20
- while (end > 0 && text.charCodeAt(end - 1) === PADDING) end -= 1;
21
- return text.slice(0, end);
22
- }
23
- /**
24
- * Decode base64url, with or without `=` padding.
25
- *
26
- * Strict where Node's buffer decoder is lenient: a character outside the
27
- * alphabet, or a length no encoder produces (one character past a multiple of
28
- * four), throws a `TypeError` instead of being skipped or truncated. This
29
- * matches the engine's decoder.
30
- */
31
- function base64UrlToBytes(text) {
32
- const unpadded = withoutPadding(text);
33
- if (!BASE64URL_UNPADDED.test(unpadded) || unpadded.length % 4 === 1) throw new TypeError("not valid base64url (RFC 4648 § 5)");
34
- const base64 = unpadded.replace(/-/g, "+").replace(/_/g, "/");
35
- const binary = atob(base64 + "=".repeat((4 - base64.length % 4) % 4));
36
- const bytes = new Uint8Array(binary.length);
37
- for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
38
- return bytes;
39
- }
40
- /** Decode base64url to a string as UTF-8, replacing invalid sequences with U+FFFD. */
41
- function base64UrlToString(text) {
42
- return new TextDecoder().decode(base64UrlToBytes(text));
43
- }
44
-
45
- //#endregion
46
5
  //#region src/browser-posture-proof.ts
47
- /**
48
- * RFC 9449 DPoP-shaped proof verification (P37): binds a browser-posture
49
- * token to a non-extractable key the page holds, so the posture token's
50
- * TTL stops being the whole replay window. The literal RFC 9449 `typ`
51
- * value, not a project-specific string like the posture token's own
52
- * `checkpoint-posture+jwt` - adopting the registered value buys real
53
- * interoperability with any existing DPoP-aware tooling for no cost.
54
- */
55
- const POSTURE_PROOF_TYPE = "dpop+jwt";
56
- /** Half the posture TTL: a per-request, single-use artifact needs a much
57
- * tighter freshness window than a session-scoped token. A caller-supplied
58
- * parameter, not a private constant - this must never repeat
59
- * `POSTURE_TTL_SECONDS`'s own hardcoding mistake. */
60
- const DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS = 60;
61
6
  const BrowserPostureProofSchema = require_schemas.object({
62
7
  jti: require_schemas.string().min(1).max(255),
63
8
  htm: require_schemas.string().min(1).max(16),
@@ -79,29 +24,15 @@ const BrowserPostureProofSchema = require_schemas.object({
79
24
  * replay store as the final step before trusting the request.
80
25
  */
81
26
  async function verifyBrowserPostureProof(proofJws, posture, request, now = Math.floor(Date.now() / 1e3), maxAgeSeconds = 60) {
82
- if (!proofJws || proofJws.length > 2e3 || !posture.cnf) return void 0;
83
- try {
84
- const decoded = JSON.parse(base64UrlToString(proofJws.split(".")[0]));
85
- if (decoded.typ !== "dpop+jwt" || decoded.alg !== "ES256" || !decoded.jwk || decoded.jwk.kty !== "EC" || decoded.jwk.crv !== "P-256" || decoded.jwk.d) return void 0;
86
- if (await (0, jose.calculateJwkThumbprint)(decoded.jwk, "sha256") !== posture.cnf.jkt) return void 0;
87
- const key = await (0, jose.importJWK)(decoded.jwk, "ES256");
88
- const { payload } = await (0, jose.jwtVerify)(proofJws, key, {
89
- algorithms: ["ES256"],
90
- typ: POSTURE_PROOF_TYPE,
91
- currentDate: /* @__PURE__ */ new Date(now * 1e3)
92
- });
93
- const parsed = BrowserPostureProofSchema.safeParse(payload);
94
- if (!parsed.success) return void 0;
95
- const claims = parsed.data;
96
- if (claims.htm.toUpperCase() !== request.method.toUpperCase() || claims.htu !== request.url || Math.abs(now - claims.iat) > maxAgeSeconds) return void 0;
97
- return claims;
98
- } catch {
99
- return;
100
- }
27
+ if (!posture.cnf) return void 0;
28
+ const result = await require_browser_posture_proof_verifier.verifyBrowserPostureProofKey(proofJws, request, posture.cnf.jkt, now, maxAgeSeconds);
29
+ return result.verified ? result.claims : void 0;
101
30
  }
102
31
 
103
32
  //#endregion
104
33
  exports.BrowserPostureProofSchema = BrowserPostureProofSchema;
105
- exports.DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS = DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS;
106
- exports.POSTURE_PROOF_TYPE = POSTURE_PROOF_TYPE;
107
- exports.verifyBrowserPostureProof = verifyBrowserPostureProof;
34
+ exports.DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS = require_browser_posture_proof_verifier.DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS;
35
+ exports.POSTURE_PROOF_TYPE = require_browser_posture_proof_verifier.POSTURE_PROOF_TYPE;
36
+ exports.browserPostureKeyThumbprint = require_browser_posture_proof_verifier.browserPostureKeyThumbprint;
37
+ exports.verifyBrowserPostureProof = verifyBrowserPostureProof;
38
+ exports.verifyBrowserPostureProofKey = require_browser_posture_proof_verifier.verifyBrowserPostureProofKey;
@@ -1,62 +1,7 @@
1
- import { C as string, v as number, y as object } from "./schemas-7qodsG-Z.mjs";
2
- import { calculateJwkThumbprint, importJWK, jwtVerify } from "jose";
1
+ import { S as string, _ as number, v as object } from "./schemas-IHAhH3gV.mjs";
2
+ import { i as verifyBrowserPostureProofKey, n as POSTURE_PROOF_TYPE, r as browserPostureKeyThumbprint, t as DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS } from "./browser-posture-proof-verifier-I0HP2Ics.mjs";
3
3
 
4
- //#region src/utils/base64url.ts
5
- /**
6
- * Base64url (RFC 4648 § 5) built on `atob` and `btoa` rather than Node's
7
- * buffer API, so it runs on every runtime the SDKs support, Cloudflare Workers
8
- * without `nodejs_compat` included.
9
- */
10
- const BASE64URL_UNPADDED = /^[A-Za-z0-9_-]*$/;
11
- const PADDING = 61;
12
- /**
13
- * `text` without its trailing `=` padding. A backward scan, not
14
- * `replace(/=+$/, '')`: that regex retries from every `=` in a long run that
15
- * does not reach the end, which is quadratic on hostile input.
16
- */
17
- function withoutPadding(text) {
18
- let end = text.length;
19
- while (end > 0 && text.charCodeAt(end - 1) === PADDING) end -= 1;
20
- return text.slice(0, end);
21
- }
22
- /**
23
- * Decode base64url, with or without `=` padding.
24
- *
25
- * Strict where Node's buffer decoder is lenient: a character outside the
26
- * alphabet, or a length no encoder produces (one character past a multiple of
27
- * four), throws a `TypeError` instead of being skipped or truncated. This
28
- * matches the engine's decoder.
29
- */
30
- function base64UrlToBytes(text) {
31
- const unpadded = withoutPadding(text);
32
- if (!BASE64URL_UNPADDED.test(unpadded) || unpadded.length % 4 === 1) throw new TypeError("not valid base64url (RFC 4648 § 5)");
33
- const base64 = unpadded.replace(/-/g, "+").replace(/_/g, "/");
34
- const binary = atob(base64 + "=".repeat((4 - base64.length % 4) % 4));
35
- const bytes = new Uint8Array(binary.length);
36
- for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
37
- return bytes;
38
- }
39
- /** Decode base64url to a string as UTF-8, replacing invalid sequences with U+FFFD. */
40
- function base64UrlToString(text) {
41
- return new TextDecoder().decode(base64UrlToBytes(text));
42
- }
43
-
44
- //#endregion
45
4
  //#region src/browser-posture-proof.ts
46
- /**
47
- * RFC 9449 DPoP-shaped proof verification (P37): binds a browser-posture
48
- * token to a non-extractable key the page holds, so the posture token's
49
- * TTL stops being the whole replay window. The literal RFC 9449 `typ`
50
- * value, not a project-specific string like the posture token's own
51
- * `checkpoint-posture+jwt` - adopting the registered value buys real
52
- * interoperability with any existing DPoP-aware tooling for no cost.
53
- */
54
- const POSTURE_PROOF_TYPE = "dpop+jwt";
55
- /** Half the posture TTL: a per-request, single-use artifact needs a much
56
- * tighter freshness window than a session-scoped token. A caller-supplied
57
- * parameter, not a private constant - this must never repeat
58
- * `POSTURE_TTL_SECONDS`'s own hardcoding mistake. */
59
- const DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS = 60;
60
5
  const BrowserPostureProofSchema = object({
61
6
  jti: string().min(1).max(255),
62
7
  htm: string().min(1).max(16),
@@ -78,27 +23,11 @@ const BrowserPostureProofSchema = object({
78
23
  * replay store as the final step before trusting the request.
79
24
  */
80
25
  async function verifyBrowserPostureProof(proofJws, posture, request, now = Math.floor(Date.now() / 1e3), maxAgeSeconds = 60) {
81
- if (!proofJws || proofJws.length > 2e3 || !posture.cnf) return void 0;
82
- try {
83
- const decoded = JSON.parse(base64UrlToString(proofJws.split(".")[0]));
84
- if (decoded.typ !== "dpop+jwt" || decoded.alg !== "ES256" || !decoded.jwk || decoded.jwk.kty !== "EC" || decoded.jwk.crv !== "P-256" || decoded.jwk.d) return void 0;
85
- if (await calculateJwkThumbprint(decoded.jwk, "sha256") !== posture.cnf.jkt) return void 0;
86
- const key = await importJWK(decoded.jwk, "ES256");
87
- const { payload } = await jwtVerify(proofJws, key, {
88
- algorithms: ["ES256"],
89
- typ: POSTURE_PROOF_TYPE,
90
- currentDate: /* @__PURE__ */ new Date(now * 1e3)
91
- });
92
- const parsed = BrowserPostureProofSchema.safeParse(payload);
93
- if (!parsed.success) return void 0;
94
- const claims = parsed.data;
95
- if (claims.htm.toUpperCase() !== request.method.toUpperCase() || claims.htu !== request.url || Math.abs(now - claims.iat) > maxAgeSeconds) return void 0;
96
- return claims;
97
- } catch {
98
- return;
99
- }
26
+ if (!posture.cnf) return void 0;
27
+ const result = await verifyBrowserPostureProofKey(proofJws, request, posture.cnf.jkt, now, maxAgeSeconds);
28
+ return result.verified ? result.claims : void 0;
100
29
  }
101
30
 
102
31
  //#endregion
103
- export { BrowserPostureProofSchema, DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS, POSTURE_PROOF_TYPE, verifyBrowserPostureProof };
32
+ export { BrowserPostureProofSchema, DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS, POSTURE_PROOF_TYPE, browserPostureKeyThumbprint, verifyBrowserPostureProof, verifyBrowserPostureProofKey };
104
33
  //# sourceMappingURL=browser-posture-proof.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser-posture-proof.mjs","names":["z.object","z.string","z.number"],"sources":["../src/utils/base64url.ts","../src/browser-posture-proof.ts"],"sourcesContent":["/**\n * Base64url (RFC 4648 § 5) built on `atob` and `btoa` rather than Node's\n * buffer API, so it runs on every runtime the SDKs support, Cloudflare Workers\n * without `nodejs_compat` included.\n */\n\nconst BASE64URL_UNPADDED = /^[A-Za-z0-9_-]*$/;\nconst PADDING = 61; // '='\n\n/**\n * `text` without its trailing `=` padding. A backward scan, not\n * `replace(/=+$/, '')`: that regex retries from every `=` in a long run that\n * does not reach the end, which is quadratic on hostile input.\n */\nfunction withoutPadding(text: string): string {\n let end = text.length;\n while (end > 0 && text.charCodeAt(end - 1) === PADDING) end -= 1;\n return text.slice(0, end);\n}\n\n/**\n * Decode base64url, with or without `=` padding.\n *\n * Strict where Node's buffer decoder is lenient: a character outside the\n * alphabet, or a length no encoder produces (one character past a multiple of\n * four), throws a `TypeError` instead of being skipped or truncated. This\n * matches the engine's decoder.\n */\nexport function base64UrlToBytes(text: string): Uint8Array {\n const unpadded = withoutPadding(text);\n if (!BASE64URL_UNPADDED.test(unpadded) || unpadded.length % 4 === 1) {\n throw new TypeError('not valid base64url (RFC 4648 § 5)');\n }\n const base64 = unpadded.replace(/-/g, '+').replace(/_/g, '/');\n const binary = atob(base64 + '='.repeat((4 - (base64.length % 4)) % 4));\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) {\n bytes[index] = binary.charCodeAt(index);\n }\n return bytes;\n}\n\n/** Decode base64url to a string as UTF-8, replacing invalid sequences with U+FFFD. */\nexport function base64UrlToString(text: string): string {\n return new TextDecoder().decode(base64UrlToBytes(text));\n}\n\n/** Encode bytes as base64url without padding. */\nexport function bytesToBase64Url(bytes: Uint8Array): string {\n let binary = '';\n for (const byte of bytes) binary += String.fromCharCode(byte);\n return withoutPadding(btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_'));\n}\n","import { calculateJwkThumbprint, importJWK, jwtVerify, type JWK } from 'jose';\nimport { z } from 'zod';\nimport type { BrowserPosture } from './browser-posture';\nimport { base64UrlToString } from './utils/base64url';\n\n/**\n * RFC 9449 DPoP-shaped proof verification (P37): binds a browser-posture\n * token to a non-extractable key the page holds, so the posture token's\n * TTL stops being the whole replay window. The literal RFC 9449 `typ`\n * value, not a project-specific string like the posture token's own\n * `checkpoint-posture+jwt` - adopting the registered value buys real\n * interoperability with any existing DPoP-aware tooling for no cost.\n */\nexport const POSTURE_PROOF_TYPE = 'dpop+jwt';\n/** Half the posture TTL: a per-request, single-use artifact needs a much\n * tighter freshness window than a session-scoped token. A caller-supplied\n * parameter, not a private constant - this must never repeat\n * `POSTURE_TTL_SECONDS`'s own hardcoding mistake. */\nexport const DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS = 60;\n\nexport const BrowserPostureProofSchema = z.object({\n jti: z.string().min(1).max(255),\n htm: z.string().min(1).max(16),\n htu: z.string().url(),\n iat: z.number().int().nonnegative(),\n});\nexport type BrowserPostureProof = z.infer<typeof BrowserPostureProofSchema>;\n\n/**\n * Verifies a DPoP-shaped proof (RFC 9449) against an ALREADY-VERIFIED\n * `BrowserPosture` (call `verifyBrowserPosture` first). Checks, in order:\n * the proof's own header shape (`typ`, `alg`, embedded `jwk`); that the\n * embedded key's RFC 7638 thumbprint matches `posture.cnf.jkt`; the\n * proof's ES256 signature against that same embedded key; `htm`/`htu`\n * against the real request; `iat` freshness. Returns `undefined` on ANY\n * failure, including when `posture.cnf` is absent (no binding to check\n * against), never throws.\n *\n * Does NOT check `jti` replay: that needs a store this library does not\n * own. The caller checks the returned proof's `jti` against their own\n * replay store as the final step before trusting the request.\n */\nexport async function verifyBrowserPostureProof(\n proofJws: string | undefined,\n posture: BrowserPosture,\n request: { method: string; url: string },\n now = Math.floor(Date.now() / 1000),\n maxAgeSeconds = DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS\n): Promise<BrowserPostureProof | undefined> {\n if (!proofJws || proofJws.length > 2000 || !posture.cnf) return undefined;\n try {\n // `proofJws` is already a non-empty, length-bounded string (checked\n // above), so `split('.')[0]` always yields a string, never `undefined`\n // - no `?? ''` fallback to dead-code around.\n const decoded = JSON.parse(base64UrlToString(proofJws.split('.')[0])) as {\n typ?: string;\n alg?: string;\n jwk?: JWK;\n };\n if (\n decoded.typ !== POSTURE_PROOF_TYPE ||\n decoded.alg !== 'ES256' ||\n !decoded.jwk ||\n decoded.jwk.kty !== 'EC' ||\n decoded.jwk.crv !== 'P-256' ||\n decoded.jwk.d\n )\n return undefined;\n const thumbprint = await calculateJwkThumbprint(decoded.jwk, 'sha256');\n if (thumbprint !== posture.cnf.jkt) return undefined;\n const key = await importJWK(decoded.jwk, 'ES256');\n const { payload } = await jwtVerify(proofJws, key, {\n algorithms: ['ES256'],\n typ: POSTURE_PROOF_TYPE,\n currentDate: new Date(now * 1000),\n });\n const parsed = BrowserPostureProofSchema.safeParse(payload);\n if (!parsed.success) return undefined;\n const claims = parsed.data;\n if (\n claims.htm.toUpperCase() !== request.method.toUpperCase() ||\n claims.htu !== request.url ||\n Math.abs(now - claims.iat) > maxAgeSeconds\n )\n return undefined;\n return claims;\n } catch {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;AAMA,MAAM,qBAAqB;AAC3B,MAAM,UAAU;;;;;;AAOhB,SAAS,eAAe,MAAsB;CAC5C,IAAI,MAAM,KAAK;CACf,OAAO,MAAM,KAAK,KAAK,WAAW,MAAM,CAAC,MAAM,SAAS,OAAO;CAC/D,OAAO,KAAK,MAAM,GAAG,GAAG;AAC1B;;;;;;;;;AAUA,SAAgB,iBAAiB,MAA0B;CACzD,MAAM,WAAW,eAAe,IAAI;CACpC,IAAI,CAAC,mBAAmB,KAAK,QAAQ,KAAK,SAAS,SAAS,MAAM,GAChE,MAAM,IAAI,UAAU,oCAAoC;CAE1D,MAAM,SAAS,SAAS,QAAQ,MAAM,GAAG,CAAC,CAAC,QAAQ,MAAM,GAAG;CAC5D,MAAM,SAAS,KAAK,SAAS,IAAI,QAAQ,IAAK,OAAO,SAAS,KAAM,CAAC,CAAC;CACtE,MAAM,QAAQ,IAAI,WAAW,OAAO,MAAM;CAC1C,KAAK,IAAI,QAAQ,GAAG,QAAQ,OAAO,QAAQ,SAAS,GAClD,MAAM,SAAS,OAAO,WAAW,KAAK;CAExC,OAAO;AACT;;AAGA,SAAgB,kBAAkB,MAAsB;CACtD,OAAO,IAAI,YAAY,CAAC,CAAC,OAAO,iBAAiB,IAAI,CAAC;AACxD;;;;;;;;;;;;AChCA,MAAa,qBAAqB;;;;;AAKlC,MAAa,wCAAwC;AAErD,MAAa,4BAA4BA,OAAS;CAChD,KAAKC,OAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CAC9B,KAAKA,OAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;CAC7B,KAAKA,OAAS,CAAC,CAAC,IAAI;CACpB,KAAKC,OAAS,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY;AACpC,CAAC;;;;;;;;;;;;;;;AAiBD,eAAsB,0BACpB,UACA,SACA,SACA,MAAM,KAAK,MAAM,KAAK,IAAI,IAAI,GAAI,GAClC,oBAC0C;CAC1C,IAAI,CAAC,YAAY,SAAS,SAAS,OAAQ,CAAC,QAAQ,KAAK,OAAO;CAChE,IAAI;EAIF,MAAM,UAAU,KAAK,MAAM,kBAAkB,SAAS,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;EAKpE,IACE,QAAQ,sBACR,QAAQ,QAAQ,WAChB,CAAC,QAAQ,OACT,QAAQ,IAAI,QAAQ,QACpB,QAAQ,IAAI,QAAQ,WACpB,QAAQ,IAAI,GAEZ,OAAO;EAET,IAAI,MADqB,uBAAuB,QAAQ,KAAK,QAAQ,MAClD,QAAQ,IAAI,KAAK,OAAO;EAC3C,MAAM,MAAM,MAAM,UAAU,QAAQ,KAAK,OAAO;EAChD,MAAM,EAAE,YAAY,MAAM,UAAU,UAAU,KAAK;GACjD,YAAY,CAAC,OAAO;GACpB,KAAK;GACL,6BAAa,IAAI,KAAK,MAAM,GAAI;EAClC,CAAC;EACD,MAAM,SAAS,0BAA0B,UAAU,OAAO;EAC1D,IAAI,CAAC,OAAO,SAAS,OAAO;EAC5B,MAAM,SAAS,OAAO;EACtB,IACE,OAAO,IAAI,YAAY,MAAM,QAAQ,OAAO,YAAY,KACxD,OAAO,QAAQ,QAAQ,OACvB,KAAK,IAAI,MAAM,OAAO,GAAG,IAAI,eAE7B,OAAO;EACT,OAAO;CACT,QAAQ;EACN;CACF;AACF"}
1
+ {"version":3,"file":"browser-posture-proof.mjs","names":["z.object","z.string","z.number"],"sources":["../src/browser-posture-proof.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { BrowserPosture } from './browser-posture';\nimport {\n DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS,\n verifyBrowserPostureProofKey,\n type BrowserPostureProof,\n} from './browser-posture-proof-verifier';\n\nexport {\n browserPostureKeyThumbprint,\n DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS,\n POSTURE_PROOF_TYPE,\n verifyBrowserPostureProofKey,\n} from './browser-posture-proof-verifier';\nexport type {\n BrowserPostureProof,\n BrowserPostureProofFailure,\n BrowserPostureProofResult,\n} from './browser-posture-proof-verifier';\n\nexport const BrowserPostureProofSchema = z.object({\n jti: z.string().min(1).max(255),\n htm: z.string().min(1).max(16),\n htu: z.string().url(),\n iat: z.number().int().nonnegative(),\n}) satisfies z.ZodType<BrowserPostureProof>;\n\n/**\n * Verifies a DPoP-shaped proof (RFC 9449) against an ALREADY-VERIFIED\n * `BrowserPosture` (call `verifyBrowserPosture` first). Checks, in order:\n * the proof's own header shape (`typ`, `alg`, embedded `jwk`); that the\n * embedded key's RFC 7638 thumbprint matches `posture.cnf.jkt`; the\n * proof's ES256 signature against that same embedded key; `htm`/`htu`\n * against the real request; `iat` freshness. Returns `undefined` on ANY\n * failure, including when `posture.cnf` is absent (no binding to check\n * against), never throws.\n *\n * Does NOT check `jti` replay: that needs a store this library does not\n * own. The caller checks the returned proof's `jti` against their own\n * replay store as the final step before trusting the request.\n */\nexport async function verifyBrowserPostureProof(\n proofJws: string | undefined,\n posture: BrowserPosture,\n request: { method: string; url: string },\n now = Math.floor(Date.now() / 1000),\n maxAgeSeconds = DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS\n): Promise<BrowserPostureProof | undefined> {\n if (!posture.cnf) return undefined;\n const result = await verifyBrowserPostureProofKey(\n proofJws,\n request,\n posture.cnf.jkt,\n now,\n maxAgeSeconds\n );\n return result.verified ? result.claims : undefined;\n}\n"],"mappings":";;;;AAoBA,MAAa,4BAA4BA,OAAS;CAChD,KAAKC,OAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CAC9B,KAAKA,OAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;CAC7B,KAAKA,OAAS,CAAC,CAAC,IAAI;CACpB,KAAKC,OAAS,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY;AACpC,CAAC;;;;;;;;;;;;;;;AAgBD,eAAsB,0BACpB,UACA,SACA,SACA,MAAM,KAAK,MAAM,KAAK,IAAI,IAAI,GAAI,GAClC,oBAC0C;CAC1C,IAAI,CAAC,QAAQ,KAAK,OAAO;CACzB,MAAM,SAAS,MAAM,6BACnB,UACA,SACA,QAAQ,IAAI,KACZ,KACA,aACF;CACA,OAAO,OAAO,WAAW,OAAO,SAAS;AAC3C"}
@@ -1,2 +1,2 @@
1
- import { A as POSTURE_VERIFICATION_STATUSES, C as verifyBrowserPosture, D as BrowserPostureRejectionReason, E as BrowserPostureOutcomeSchema, F as POSTURE_TTL_SECONDS, I as postureCookieName, M as browserPostureReport, N as BrowserPosture, O as BrowserPostureReportIngestSchema, P as BrowserPostureSchema, S as validateBrowserPostureConfig, T as BrowserPostureOutcome, _ as postureRequiredScopes, a as POSTURE_SESSION_HEADER, b as readPostureCookie, c as PostureVerification, d as inspectBrowserPosture, f as postureFromCookies, g as postureRequestFromHeaders, h as postureOutcomeReport, i as POSTURE_ISSUER, j as PostureVerificationStatus, k as BrowserPostureReportSchema, l as UNSIGNED_BROWSER_AGENT, m as postureOutcomeFromRequest, n as JWK, o as POSTURE_TYPE, p as postureFromRequest, r as POSTURE_HEADER, s as PostureRequest, t as BrowserPostureConfig, u as behavioralConfidence, v as postureSessionBinding, w as BROWSER_POSTURE_REJECTION_REASONS, x as signBrowserPosture, y as postureUpgrade } from "./browser-posture-BLhw-MON.mjs";
1
+ import { A as POSTURE_VERIFICATION_STATUSES, C as verifyBrowserPosture, D as BrowserPostureRejectionReason, E as BrowserPostureOutcomeSchema, F as POSTURE_TTL_SECONDS, I as postureCookieName, M as browserPostureReport, N as BrowserPosture, O as BrowserPostureReportIngestSchema, P as BrowserPostureSchema, S as validateBrowserPostureConfig, T as BrowserPostureOutcome, _ as postureRequiredScopes, a as POSTURE_SESSION_HEADER, b as readPostureCookie, c as PostureVerification, d as inspectBrowserPosture, f as postureFromCookies, g as postureRequestFromHeaders, h as postureOutcomeReport, i as POSTURE_ISSUER, j as PostureVerificationStatus, k as BrowserPostureReportSchema, l as UNSIGNED_BROWSER_AGENT, m as postureOutcomeFromRequest, n as JWK, o as POSTURE_TYPE, p as postureFromRequest, r as POSTURE_HEADER, s as PostureRequest, t as BrowserPostureConfig, u as behavioralConfidence, v as postureSessionBinding, w as BROWSER_POSTURE_REJECTION_REASONS, x as signBrowserPosture, y as postureUpgrade } from "./browser-posture-5fPrsxx7.mjs";
2
2
  export { BROWSER_POSTURE_REJECTION_REASONS, type BrowserPosture, BrowserPostureConfig, type BrowserPostureOutcome, BrowserPostureOutcomeSchema, type BrowserPostureRejectionReason, BrowserPostureReportIngestSchema, BrowserPostureReportSchema, BrowserPostureSchema, type JWK, POSTURE_HEADER, POSTURE_ISSUER, POSTURE_SESSION_HEADER, POSTURE_TTL_SECONDS, POSTURE_TYPE, POSTURE_VERIFICATION_STATUSES, PostureRequest, PostureVerification, type PostureVerificationStatus, UNSIGNED_BROWSER_AGENT, behavioralConfidence, browserPostureReport, inspectBrowserPosture, postureCookieName, postureFromCookies, postureFromRequest, postureOutcomeFromRequest, postureOutcomeReport, postureRequestFromHeaders, postureRequiredScopes, postureSessionBinding, postureUpgrade, readPostureCookie, signBrowserPosture, validateBrowserPostureConfig, verifyBrowserPosture };
@@ -1,2 +1,2 @@
1
- import { A as POSTURE_VERIFICATION_STATUSES, C as verifyBrowserPosture, D as BrowserPostureRejectionReason, E as BrowserPostureOutcomeSchema, F as POSTURE_TTL_SECONDS, I as postureCookieName, M as browserPostureReport, N as BrowserPosture, O as BrowserPostureReportIngestSchema, P as BrowserPostureSchema, S as validateBrowserPostureConfig, T as BrowserPostureOutcome, _ as postureRequiredScopes, a as POSTURE_SESSION_HEADER, b as readPostureCookie, c as PostureVerification, d as inspectBrowserPosture, f as postureFromCookies, g as postureRequestFromHeaders, h as postureOutcomeReport, i as POSTURE_ISSUER, j as PostureVerificationStatus, k as BrowserPostureReportSchema, l as UNSIGNED_BROWSER_AGENT, m as postureOutcomeFromRequest, n as JWK, o as POSTURE_TYPE, p as postureFromRequest, r as POSTURE_HEADER, s as PostureRequest, t as BrowserPostureConfig, u as behavioralConfidence, v as postureSessionBinding, w as BROWSER_POSTURE_REJECTION_REASONS, x as signBrowserPosture, y as postureUpgrade } from "./browser-posture-B8YiPa5c.js";
1
+ import { A as POSTURE_VERIFICATION_STATUSES, C as verifyBrowserPosture, D as BrowserPostureRejectionReason, E as BrowserPostureOutcomeSchema, F as POSTURE_TTL_SECONDS, I as postureCookieName, M as browserPostureReport, N as BrowserPosture, O as BrowserPostureReportIngestSchema, P as BrowserPostureSchema, S as validateBrowserPostureConfig, T as BrowserPostureOutcome, _ as postureRequiredScopes, a as POSTURE_SESSION_HEADER, b as readPostureCookie, c as PostureVerification, d as inspectBrowserPosture, f as postureFromCookies, g as postureRequestFromHeaders, h as postureOutcomeReport, i as POSTURE_ISSUER, j as PostureVerificationStatus, k as BrowserPostureReportSchema, l as UNSIGNED_BROWSER_AGENT, m as postureOutcomeFromRequest, n as JWK, o as POSTURE_TYPE, p as postureFromRequest, r as POSTURE_HEADER, s as PostureRequest, t as BrowserPostureConfig, u as behavioralConfidence, v as postureSessionBinding, w as BROWSER_POSTURE_REJECTION_REASONS, x as signBrowserPosture, y as postureUpgrade } from "./browser-posture-CCR1kh5e.js";
2
2
  export { BROWSER_POSTURE_REJECTION_REASONS, type BrowserPosture, BrowserPostureConfig, type BrowserPostureOutcome, BrowserPostureOutcomeSchema, type BrowserPostureRejectionReason, BrowserPostureReportIngestSchema, BrowserPostureReportSchema, BrowserPostureSchema, type JWK, POSTURE_HEADER, POSTURE_ISSUER, POSTURE_SESSION_HEADER, POSTURE_TTL_SECONDS, POSTURE_TYPE, POSTURE_VERIFICATION_STATUSES, PostureRequest, PostureVerification, type PostureVerificationStatus, UNSIGNED_BROWSER_AGENT, behavioralConfidence, browserPostureReport, inspectBrowserPosture, postureCookieName, postureFromCookies, postureFromRequest, postureOutcomeFromRequest, postureOutcomeReport, postureRequestFromHeaders, postureRequiredScopes, postureSessionBinding, postureUpgrade, readPostureCookie, signBrowserPosture, validateBrowserPostureConfig, verifyBrowserPosture };
@@ -1,7 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_schemas = require('./schemas-YhagYDx_.js');
3
- const require_posture_origins = require('./posture-origins-CdVOdiMT.js');
4
- const require_project_verification_key = require('./project-verification-key-BccT12tQ.js');
2
+ const require_schemas = require('./schemas-BlScS1it.js');
3
+ const require_patterns = require('./patterns-CiMpbdAF.js');
4
+ const require_posture_origins = require('./posture-origins-Ci6k4Zh1.js');
5
+ const require_project_verification_key = require('./project-verification-key-B-L3D2nC.js');
5
6
  let jose = require("jose");
6
7
 
7
8
  //#region src/browser-posture-cookie.ts
@@ -17,7 +18,7 @@ let jose = require("jose");
17
18
  * reader will look for.
18
19
  */
19
20
  function postureCookieName(projectId) {
20
- if (!require_posture_origins.UUID_PATTERN.test(projectId) || projectId !== projectId.toLowerCase()) throw new Error("Invalid posture project id");
21
+ if (!require_patterns.UUID_PATTERN.test(projectId) || projectId !== projectId.toLowerCase()) throw new Error("Invalid posture project id");
21
22
  return `__Host-checkpoint_posture_${projectId}`;
22
23
  }
23
24
 
@@ -302,7 +303,7 @@ function postureRequiredScopes(config, path) {
302
303
  }
303
304
  /** Validate operator configuration at startup, before any request can depend on it. */
304
305
  function validateBrowserPostureConfig(config, projectId) {
305
- if (!projectId || !require_posture_origins.VALIDATION_PATTERNS.UUID.test(projectId) || projectId !== projectId.toLowerCase()) throw new Error("Browser posture requires projectId to be the lowercase project UUID (the friendly id is not accepted)");
306
+ if (!projectId || !require_patterns.VALIDATION_PATTERNS.UUID.test(projectId) || projectId !== projectId.toLowerCase()) throw new Error("Browser posture requires projectId to be the lowercase project UUID (the friendly id is not accepted)");
306
307
  if (!validOrigin(config.origin) || !config.keyId || config.publicKey.kty !== "EC" || config.publicKey.crv !== "P-256" || !config.publicKey.x || !config.publicKey.y || config.publicKey.d) throw new Error("Browser posture requires projectId, an exact HTTPS origin, and a public ES256 key");
307
308
  const origins = config.origins ?? [];
308
309
  if (origins.length > 20) throw new Error(`Browser posture accepts at most ${20} additional origins`);
@@ -1,6 +1,7 @@
1
- import { C as string, T as unknown, c as array, g as literal, i as _enum, l as boolean, p as guid, v as number, x as record, y as object } from "./schemas-7qodsG-Z.mjs";
2
- import { d as UUID_PATTERN, f as VALIDATION_PATTERNS, n as matchAllowedOrigin, r as parseOriginPattern } from "./posture-origins-Ba83O0cD.mjs";
3
- import { t as projectVerificationKey } from "./project-verification-key-66N4edKn.mjs";
1
+ import { S as string, _ as number, b as record, c as array, f as guid, h as literal, i as _enum, l as boolean, v as object, w as unknown } from "./schemas-IHAhH3gV.mjs";
2
+ import { c as VALIDATION_PATTERNS, s as UUID_PATTERN } from "./patterns-D4OAsNQY.mjs";
3
+ import { n as matchAllowedOrigin, r as parseOriginPattern } from "./posture-origins-DGyS4Vuk.mjs";
4
+ import { t as projectVerificationKey } from "./project-verification-key-CWXdu3-n.mjs";
4
5
  import { SignJWT, compactVerify, decodeProtectedHeader, importJWK } from "jose";
5
6
 
6
7
  //#region src/browser-posture-cookie.ts