@kya-os/checkpoint-shared 1.8.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.
- package/CHANGELOG.md +37 -0
- package/dist/agent-catalog.d.mts +12 -0
- package/dist/agent-catalog.d.mts.map +1 -0
- package/dist/agent-catalog.d.ts +12 -0
- package/dist/agent-catalog.d.ts.map +1 -0
- package/dist/agent-catalog.js +105 -0
- package/dist/agent-catalog.mjs +105 -0
- package/dist/agent-catalog.mjs.map +1 -0
- package/dist/beacon-types/index.d.mts +18 -0
- package/dist/beacon-types/index.d.mts.map +1 -1
- package/dist/beacon-types/index.d.ts +18 -0
- package/dist/beacon-types/index.d.ts.map +1 -1
- package/dist/beacon-types/index.js +116 -12
- package/dist/beacon-types/index.mjs +105 -13
- package/dist/beacon-types/index.mjs.map +1 -1
- package/dist/browser-posture-5fPrsxx7.d.mts.map +1 -1
- package/dist/browser-posture-CCR1kh5e.d.ts.map +1 -1
- package/dist/browser-posture-cookie.js +1 -1
- package/dist/browser-posture-cookie.mjs +1 -1
- package/dist/browser-posture-cookie.mjs.map +1 -1
- package/dist/browser-posture-proof-verifier-DvsOmFrM.js +202 -0
- package/dist/browser-posture-proof-verifier-I0HP2Ics.mjs +180 -0
- package/dist/browser-posture-proof-verifier-I0HP2Ics.mjs.map +1 -0
- package/dist/browser-posture-proof-verifier.d.mts +25 -0
- package/dist/browser-posture-proof-verifier.d.mts.map +1 -0
- package/dist/browser-posture-proof-verifier.d.ts +25 -0
- package/dist/browser-posture-proof-verifier.d.ts.map +1 -0
- package/dist/browser-posture-proof-verifier.js +7 -0
- package/dist/browser-posture-proof-verifier.mjs +3 -0
- package/dist/browser-posture-proof.d.mts +3 -18
- package/dist/browser-posture-proof.d.mts.map +1 -1
- package/dist/browser-posture-proof.d.ts +3 -18
- package/dist/browser-posture-proof.d.ts.map +1 -1
- package/dist/browser-posture-proof.js +6 -131
- package/dist/browser-posture-proof.mjs +1 -126
- package/dist/browser-posture-proof.mjs.map +1 -1
- package/dist/browser-posture.js +1 -1
- package/dist/browser-posture.mjs +1 -1
- package/dist/browser-posture.mjs.map +1 -1
- package/dist/browser.d.mts +0 -282
- package/dist/browser.d.mts.map +1 -1
- package/dist/browser.d.ts +0 -282
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +1 -1
- package/dist/browser.mjs +1 -1
- package/dist/browser.mjs.map +1 -1
- package/dist/canonical-signer/index.mjs.map +1 -1
- package/dist/consent-handoff.d.mts +0 -3
- package/dist/consent-handoff.d.mts.map +1 -1
- package/dist/consent-handoff.d.ts +0 -3
- package/dist/consent-handoff.d.ts.map +1 -1
- package/dist/consent-handoff.mjs.map +1 -1
- package/dist/default-sign-in-host.d.mts +10 -0
- package/dist/default-sign-in-host.d.mts.map +1 -0
- package/dist/default-sign-in-host.d.ts +10 -0
- package/dist/default-sign-in-host.d.ts.map +1 -0
- package/dist/default-sign-in-host.js +72 -0
- package/dist/default-sign-in-host.mjs +66 -0
- package/dist/default-sign-in-host.mjs.map +1 -0
- package/dist/errors/index.d.mts +1 -0
- package/dist/errors/index.d.mts.map +1 -1
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +5 -2
- package/dist/errors/index.mjs +5 -2
- package/dist/errors/index.mjs.map +1 -1
- package/dist/{fetcher-CivUCbhL.d.ts → fetcher-C8qvwdnA.d.ts} +2 -2
- package/dist/{fetcher-CivUCbhL.d.ts.map → fetcher-C8qvwdnA.d.ts.map} +1 -1
- package/dist/{fetcher-cXQsbm6s.d.mts → fetcher-D2vjr7jB.d.mts} +2 -2
- package/dist/{fetcher-cXQsbm6s.d.mts.map → fetcher-D2vjr7jB.d.mts.map} +1 -1
- package/dist/gateway-client-ip.d.mts +0 -2
- package/dist/gateway-client-ip.d.mts.map +1 -1
- package/dist/gateway-client-ip.d.ts +0 -2
- package/dist/gateway-client-ip.d.ts.map +1 -1
- package/dist/gateway-client-ip.mjs.map +1 -1
- package/dist/host-adapter/index.d.mts +1 -1
- package/dist/host-adapter/index.d.ts +1 -1
- package/dist/host-adapter/index.js +1 -1
- package/dist/host-adapter/index.mjs +1 -1
- package/dist/{host-adapter-DHyISsIf.mjs → host-adapter-BKdQHwbi.mjs} +2 -2
- package/dist/{host-adapter-DHyISsIf.mjs.map → host-adapter-BKdQHwbi.mjs.map} +1 -1
- package/dist/{host-adapter-0F8EpbD6.js → host-adapter-bWftXA9T.js} +1 -1
- package/dist/{index-CXbOY7gB.d.ts → index-DnFsmr_o.d.ts} +3 -3
- package/dist/{index-CXbOY7gB.d.ts.map → index-DnFsmr_o.d.ts.map} +1 -1
- package/dist/{index-B3cHxr3O.d.mts → index-rvw5Bz-r.d.mts} +3 -3
- package/dist/{index-B3cHxr3O.d.mts.map → index-rvw5Bz-r.d.mts.map} +1 -1
- package/dist/index.d.mts +94 -449
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +94 -449
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -455
- package/dist/index.mjs +17 -422
- package/dist/index.mjs.map +1 -1
- package/dist/{kya-http-error-codes-UYb1zpGM.js → kya-http-error-codes-B4rUmUEI.js} +2 -0
- package/dist/{kya-http-error-codes-7ewV5RuK.d.ts → kya-http-error-codes-C14E4gi3.d.mts} +2 -1
- package/dist/kya-http-error-codes-C14E4gi3.d.mts.map +1 -0
- package/dist/{kya-http-error-codes-7ewV5RuK.d.mts → kya-http-error-codes-C14E4gi3.d.ts} +2 -1
- package/dist/kya-http-error-codes-C14E4gi3.d.ts.map +1 -0
- package/dist/{kya-http-error-codes-C2JiWPsi.mjs → kya-http-error-codes-DSBrxNry.mjs} +3 -1
- package/dist/kya-http-error-codes-DSBrxNry.mjs.map +1 -0
- package/dist/kya-http.d.mts +1 -1
- package/dist/kya-http.d.ts +1 -1
- package/dist/kya-http.js +1 -1
- package/dist/kya-http.mjs +1 -1
- package/dist/mcpi/dashboard-config/index.d.mts.map +1 -1
- package/dist/mcpi/dashboard-config/index.d.ts.map +1 -1
- package/dist/mcpi/dashboard-config/index.mjs.map +1 -1
- package/dist/{patterns-B2r7M9wR.js → patterns-CiMpbdAF.js} +1 -1
- package/dist/{patterns-B7dQoeE3.mjs → patterns-D4OAsNQY.mjs} +2 -2
- package/dist/{patterns-B7dQoeE3.mjs.map → patterns-D4OAsNQY.mjs.map} +1 -1
- package/dist/patterns.js +1 -1
- package/dist/patterns.mjs +1 -1
- package/dist/policy/fetcher.d.mts +1 -1
- package/dist/policy/fetcher.d.ts +1 -1
- package/dist/policy/schemas.d.mts +1 -1
- package/dist/policy/schemas.d.ts +1 -1
- package/dist/{schemas-C_3C72SR.d.ts → schemas-CGKHzcMV.d.ts} +21 -21
- package/dist/{schemas-C_3C72SR.d.ts.map → schemas-CGKHzcMV.d.ts.map} +1 -1
- package/dist/{schemas-02CI7jgm.d.mts → schemas-m-GqyfyO.d.mts} +21 -21
- package/dist/{schemas-02CI7jgm.d.mts.map → schemas-m-GqyfyO.d.mts.map} +1 -1
- package/dist/tool-protection/index.d.mts +12 -0
- package/dist/tool-protection/index.d.mts.map +1 -1
- package/dist/tool-protection/index.d.ts +12 -0
- package/dist/tool-protection/index.d.ts.map +1 -1
- package/dist/tool-protection/index.js +46 -0
- package/dist/tool-protection/index.mjs +44 -1
- package/dist/tool-protection/index.mjs.map +1 -1
- package/fixtures/kya-http/error-codes.json +2 -1
- package/package.json +19 -3
- package/dist/kya-http-error-codes-7ewV5RuK.d.mts.map +0 -1
- package/dist/kya-http-error-codes-7ewV5RuK.d.ts.map +0 -1
- package/dist/kya-http-error-codes-C2JiWPsi.mjs.map +0 -1
|
@@ -1,124 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_schemas = require('./schemas-BlScS1it.js');
|
|
3
|
-
|
|
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),
|
|
64
9
|
htu: require_schemas.string().url(),
|
|
65
10
|
iat: require_schemas.number().int().nonnegative()
|
|
66
11
|
});
|
|
67
|
-
const MALFORMED = {
|
|
68
|
-
verified: false,
|
|
69
|
-
reason: "malformed"
|
|
70
|
-
};
|
|
71
|
-
async function verifyBrowserPostureProofKey(proofJws, request, expectedJkt, now = Math.floor(Date.now() / 1e3), maxAgeSeconds = 60) {
|
|
72
|
-
if (!proofJws || proofJws.length > 2e3) return MALFORMED;
|
|
73
|
-
let decoded;
|
|
74
|
-
let jkt;
|
|
75
|
-
let key;
|
|
76
|
-
try {
|
|
77
|
-
decoded = JSON.parse(base64UrlToString(proofJws.split(".")[0]));
|
|
78
|
-
if (decoded.typ !== "dpop+jwt" || decoded.alg !== "ES256" || !decoded.jwk || decoded.jwk.kty !== "EC" || decoded.jwk.crv !== "P-256" || decoded.jwk.d) return MALFORMED;
|
|
79
|
-
jkt = await (0, jose.calculateJwkThumbprint)(decoded.jwk, "sha256");
|
|
80
|
-
if (expectedJkt !== void 0 && jkt !== expectedJkt) return {
|
|
81
|
-
verified: false,
|
|
82
|
-
reason: "jkt-mismatch"
|
|
83
|
-
};
|
|
84
|
-
key = await (0, jose.importJWK)(decoded.jwk, "ES256");
|
|
85
|
-
} catch {
|
|
86
|
-
return MALFORMED;
|
|
87
|
-
}
|
|
88
|
-
let payload;
|
|
89
|
-
try {
|
|
90
|
-
({payload} = await (0, jose.jwtVerify)(proofJws, key, {
|
|
91
|
-
algorithms: ["ES256"],
|
|
92
|
-
typ: POSTURE_PROOF_TYPE,
|
|
93
|
-
currentDate: /* @__PURE__ */ new Date(now * 1e3)
|
|
94
|
-
}));
|
|
95
|
-
} catch {
|
|
96
|
-
return {
|
|
97
|
-
verified: false,
|
|
98
|
-
reason: "bad-signature"
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
const parsed = BrowserPostureProofSchema.safeParse(payload);
|
|
102
|
-
if (!parsed.success) return {
|
|
103
|
-
verified: false,
|
|
104
|
-
reason: "invalid-claims"
|
|
105
|
-
};
|
|
106
|
-
const claims = parsed.data;
|
|
107
|
-
const acceptedUrls = typeof request.url === "string" ? [request.url] : request.url;
|
|
108
|
-
if (claims.htm.toUpperCase() !== request.method.toUpperCase() || !acceptedUrls.includes(claims.htu)) return {
|
|
109
|
-
verified: false,
|
|
110
|
-
reason: "htu-mismatch"
|
|
111
|
-
};
|
|
112
|
-
if (Math.abs(now - claims.iat) > maxAgeSeconds) return {
|
|
113
|
-
verified: false,
|
|
114
|
-
reason: "stale-iat"
|
|
115
|
-
};
|
|
116
|
-
return {
|
|
117
|
-
verified: true,
|
|
118
|
-
claims,
|
|
119
|
-
jkt
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
12
|
/**
|
|
123
13
|
* Verifies a DPoP-shaped proof (RFC 9449) against an ALREADY-VERIFIED
|
|
124
14
|
* `BrowserPosture` (call `verifyBrowserPosture` first). Checks, in order:
|
|
@@ -135,29 +25,14 @@ async function verifyBrowserPostureProofKey(proofJws, request, expectedJkt, now
|
|
|
135
25
|
*/
|
|
136
26
|
async function verifyBrowserPostureProof(proofJws, posture, request, now = Math.floor(Date.now() / 1e3), maxAgeSeconds = 60) {
|
|
137
27
|
if (!posture.cnf) return void 0;
|
|
138
|
-
const result = await verifyBrowserPostureProofKey(proofJws, request, posture.cnf.jkt, now, maxAgeSeconds);
|
|
28
|
+
const result = await require_browser_posture_proof_verifier.verifyBrowserPostureProofKey(proofJws, request, posture.cnf.jkt, now, maxAgeSeconds);
|
|
139
29
|
return result.verified ? result.claims : void 0;
|
|
140
30
|
}
|
|
141
|
-
async function browserPostureKeyThumbprint(jwk) {
|
|
142
|
-
if (typeof jwk !== "object" || jwk === null) return void 0;
|
|
143
|
-
const { kty, crv, x, y, d } = jwk;
|
|
144
|
-
if (kty !== "EC" || crv !== "P-256" || typeof x !== "string" || typeof y !== "string" || d) return;
|
|
145
|
-
try {
|
|
146
|
-
return await (0, jose.calculateJwkThumbprint)({
|
|
147
|
-
kty,
|
|
148
|
-
crv,
|
|
149
|
-
x,
|
|
150
|
-
y
|
|
151
|
-
}, "sha256");
|
|
152
|
-
} catch {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
31
|
|
|
157
32
|
//#endregion
|
|
158
33
|
exports.BrowserPostureProofSchema = BrowserPostureProofSchema;
|
|
159
|
-
exports.DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS = DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS;
|
|
160
|
-
exports.POSTURE_PROOF_TYPE = POSTURE_PROOF_TYPE;
|
|
161
|
-
exports.browserPostureKeyThumbprint = browserPostureKeyThumbprint;
|
|
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;
|
|
162
37
|
exports.verifyBrowserPostureProof = verifyBrowserPostureProof;
|
|
163
|
-
exports.verifyBrowserPostureProofKey = verifyBrowserPostureProofKey;
|
|
38
|
+
exports.verifyBrowserPostureProofKey = require_browser_posture_proof_verifier.verifyBrowserPostureProofKey;
|
|
@@ -1,123 +1,13 @@
|
|
|
1
1
|
import { S as string, _ as number, v as object } from "./schemas-IHAhH3gV.mjs";
|
|
2
|
-
import {
|
|
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),
|
|
63
8
|
htu: string().url(),
|
|
64
9
|
iat: number().int().nonnegative()
|
|
65
10
|
});
|
|
66
|
-
const MALFORMED = {
|
|
67
|
-
verified: false,
|
|
68
|
-
reason: "malformed"
|
|
69
|
-
};
|
|
70
|
-
async function verifyBrowserPostureProofKey(proofJws, request, expectedJkt, now = Math.floor(Date.now() / 1e3), maxAgeSeconds = 60) {
|
|
71
|
-
if (!proofJws || proofJws.length > 2e3) return MALFORMED;
|
|
72
|
-
let decoded;
|
|
73
|
-
let jkt;
|
|
74
|
-
let key;
|
|
75
|
-
try {
|
|
76
|
-
decoded = JSON.parse(base64UrlToString(proofJws.split(".")[0]));
|
|
77
|
-
if (decoded.typ !== "dpop+jwt" || decoded.alg !== "ES256" || !decoded.jwk || decoded.jwk.kty !== "EC" || decoded.jwk.crv !== "P-256" || decoded.jwk.d) return MALFORMED;
|
|
78
|
-
jkt = await calculateJwkThumbprint(decoded.jwk, "sha256");
|
|
79
|
-
if (expectedJkt !== void 0 && jkt !== expectedJkt) return {
|
|
80
|
-
verified: false,
|
|
81
|
-
reason: "jkt-mismatch"
|
|
82
|
-
};
|
|
83
|
-
key = await importJWK(decoded.jwk, "ES256");
|
|
84
|
-
} catch {
|
|
85
|
-
return MALFORMED;
|
|
86
|
-
}
|
|
87
|
-
let payload;
|
|
88
|
-
try {
|
|
89
|
-
({payload} = await jwtVerify(proofJws, key, {
|
|
90
|
-
algorithms: ["ES256"],
|
|
91
|
-
typ: POSTURE_PROOF_TYPE,
|
|
92
|
-
currentDate: /* @__PURE__ */ new Date(now * 1e3)
|
|
93
|
-
}));
|
|
94
|
-
} catch {
|
|
95
|
-
return {
|
|
96
|
-
verified: false,
|
|
97
|
-
reason: "bad-signature"
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
const parsed = BrowserPostureProofSchema.safeParse(payload);
|
|
101
|
-
if (!parsed.success) return {
|
|
102
|
-
verified: false,
|
|
103
|
-
reason: "invalid-claims"
|
|
104
|
-
};
|
|
105
|
-
const claims = parsed.data;
|
|
106
|
-
const acceptedUrls = typeof request.url === "string" ? [request.url] : request.url;
|
|
107
|
-
if (claims.htm.toUpperCase() !== request.method.toUpperCase() || !acceptedUrls.includes(claims.htu)) return {
|
|
108
|
-
verified: false,
|
|
109
|
-
reason: "htu-mismatch"
|
|
110
|
-
};
|
|
111
|
-
if (Math.abs(now - claims.iat) > maxAgeSeconds) return {
|
|
112
|
-
verified: false,
|
|
113
|
-
reason: "stale-iat"
|
|
114
|
-
};
|
|
115
|
-
return {
|
|
116
|
-
verified: true,
|
|
117
|
-
claims,
|
|
118
|
-
jkt
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
11
|
/**
|
|
122
12
|
* Verifies a DPoP-shaped proof (RFC 9449) against an ALREADY-VERIFIED
|
|
123
13
|
* `BrowserPosture` (call `verifyBrowserPosture` first). Checks, in order:
|
|
@@ -137,21 +27,6 @@ async function verifyBrowserPostureProof(proofJws, posture, request, now = Math.
|
|
|
137
27
|
const result = await verifyBrowserPostureProofKey(proofJws, request, posture.cnf.jkt, now, maxAgeSeconds);
|
|
138
28
|
return result.verified ? result.claims : void 0;
|
|
139
29
|
}
|
|
140
|
-
async function browserPostureKeyThumbprint(jwk) {
|
|
141
|
-
if (typeof jwk !== "object" || jwk === null) return void 0;
|
|
142
|
-
const { kty, crv, x, y, d } = jwk;
|
|
143
|
-
if (kty !== "EC" || crv !== "P-256" || typeof x !== "string" || typeof y !== "string" || d) return;
|
|
144
|
-
try {
|
|
145
|
-
return await calculateJwkThumbprint({
|
|
146
|
-
kty,
|
|
147
|
-
crv,
|
|
148
|
-
x,
|
|
149
|
-
y
|
|
150
|
-
}, "sha256");
|
|
151
|
-
} catch {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
30
|
|
|
156
31
|
//#endregion
|
|
157
32
|
export { BrowserPostureProofSchema, DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS, POSTURE_PROOF_TYPE, browserPostureKeyThumbprint, verifyBrowserPostureProof, verifyBrowserPostureProofKey };
|
|
@@ -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\nexport type BrowserPostureProofFailure =\n | 'malformed'\n | 'jkt-mismatch'\n | 'bad-signature'\n | 'invalid-claims'\n | 'htu-mismatch'\n | 'stale-iat';\n\nexport type BrowserPostureProofResult =\n | { verified: true; claims: BrowserPostureProof; jkt: string }\n | { verified: false; reason: BrowserPostureProofFailure };\n\nconst MALFORMED: BrowserPostureProofResult = { verified: false, reason: 'malformed' };\n\nexport async function verifyBrowserPostureProofKey(\n proofJws: string | undefined,\n request: { method: string; url: string | readonly string[] },\n expectedJkt?: string,\n now = Math.floor(Date.now() / 1000),\n maxAgeSeconds = DEFAULT_POSTURE_PROOF_MAX_AGE_SECONDS\n): Promise<BrowserPostureProofResult> {\n if (!proofJws || proofJws.length > 2000) return MALFORMED;\n let decoded: { typ?: string; alg?: string; jwk?: JWK };\n let jkt: string;\n let key: Awaited<ReturnType<typeof importJWK>>;\n try {\n decoded = JSON.parse(base64UrlToString(proofJws.split('.')[0]));\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 MALFORMED;\n jkt = await calculateJwkThumbprint(decoded.jwk, 'sha256');\n if (expectedJkt !== undefined && jkt !== expectedJkt) {\n return { verified: false, reason: 'jkt-mismatch' };\n }\n key = await importJWK(decoded.jwk, 'ES256');\n } catch {\n return MALFORMED;\n }\n let payload: Awaited<ReturnType<typeof jwtVerify>>['payload'];\n try {\n ({ payload } = await jwtVerify(proofJws, key, {\n algorithms: ['ES256'],\n typ: POSTURE_PROOF_TYPE,\n currentDate: new Date(now * 1000),\n }));\n } catch {\n return { verified: false, reason: 'bad-signature' };\n }\n const parsed = BrowserPostureProofSchema.safeParse(payload);\n if (!parsed.success) return { verified: false, reason: 'invalid-claims' };\n const claims = parsed.data;\n const acceptedUrls = typeof request.url === 'string' ? [request.url] : request.url;\n if (\n claims.htm.toUpperCase() !== request.method.toUpperCase() ||\n !acceptedUrls.includes(claims.htu)\n ) {\n return { verified: false, reason: 'htu-mismatch' };\n }\n if (Math.abs(now - claims.iat) > maxAgeSeconds) return { verified: false, reason: 'stale-iat' };\n return { verified: true, claims, jkt };\n}\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\nexport async function browserPostureKeyThumbprint(jwk: unknown): Promise<string | undefined> {\n if (typeof jwk !== 'object' || jwk === null) return undefined;\n const { kty, crv, x, y, d } = jwk as Record<string, unknown>;\n if (kty !== 'EC' || crv !== 'P-256' || typeof x !== 'string' || typeof y !== 'string' || d) {\n return undefined;\n }\n try {\n return await calculateJwkThumbprint({ kty, crv, x, y }, 'sha256');\n } catch {\n return undefined;\n }\n}\n"],"mappings":"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"}
|
|
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"}
|
package/dist/browser-posture.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_schemas = require('./schemas-BlScS1it.js');
|
|
3
|
-
const require_patterns = require('./patterns-
|
|
3
|
+
const require_patterns = require('./patterns-CiMpbdAF.js');
|
|
4
4
|
const require_posture_origins = require('./posture-origins-Ci6k4Zh1.js');
|
|
5
5
|
const require_project_verification_key = require('./project-verification-key-B-L3D2nC.js');
|
|
6
6
|
let jose = require("jose");
|
package/dist/browser-posture.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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-
|
|
2
|
+
import { c as VALIDATION_PATTERNS, s as UUID_PATTERN } from "./patterns-D4OAsNQY.mjs";
|
|
3
3
|
import { n as matchAllowedOrigin, r as parseOriginPattern } from "./posture-origins-DGyS4Vuk.mjs";
|
|
4
4
|
import { t as projectVerificationKey } from "./project-verification-key-CWXdu3-n.mjs";
|
|
5
5
|
import { SignJWT, compactVerify, decodeProtectedHeader, importJWK } from "jose";
|