@kya-os/checkpoint-shared 1.9.0 → 1.11.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 +113 -0
- package/README.md +1 -1
- package/dist/base64url-BbVG8f-v.js +65 -0
- package/dist/base64url-D2MvsR20.mjs +49 -0
- package/dist/base64url-D2MvsR20.mjs.map +1 -0
- package/dist/beacon-forward-secret/index.d.mts +4 -0
- package/dist/beacon-forward-secret/index.d.mts.map +1 -0
- package/dist/beacon-forward-secret/index.d.ts +4 -0
- package/dist/beacon-forward-secret/index.d.ts.map +1 -0
- package/dist/beacon-forward-secret/index.js +15 -0
- package/dist/beacon-forward-secret/index.mjs +15 -0
- package/dist/beacon-forward-secret/index.mjs.map +1 -0
- package/dist/beacon-types/index.d.mts +53 -1
- package/dist/beacon-types/index.d.mts.map +1 -1
- package/dist/beacon-types/index.d.ts +53 -1
- package/dist/beacon-types/index.d.ts.map +1 -1
- package/dist/beacon-types/index.js +86 -1
- package/dist/beacon-types/index.mjs +77 -2
- package/dist/beacon-types/index.mjs.map +1 -1
- package/dist/{browser-posture-5fPrsxx7.d.mts → browser-posture-WPk0kl9u.d.mts} +18 -1
- package/dist/browser-posture-WPk0kl9u.d.mts.map +1 -0
- package/dist/{browser-posture-CCR1kh5e.d.ts → browser-posture-_y6BcdXw.d.ts} +18 -1
- package/dist/browser-posture-_y6BcdXw.d.ts.map +1 -0
- package/dist/browser-posture-cookie.mjs.map +1 -1
- package/dist/browser-posture-proof-verifier.js +136 -5
- package/dist/browser-posture-proof-verifier.mjs +134 -2
- package/dist/browser-posture-proof-verifier.mjs.map +1 -0
- package/dist/browser-posture-proof.d.mts +1 -1
- package/dist/browser-posture-proof.d.ts +1 -1
- package/dist/browser-posture-proof.js +1 -1
- package/dist/browser-posture-proof.mjs +1 -1
- package/dist/browser-posture-report.d.mts +17 -0
- package/dist/browser-posture-report.d.mts.map +1 -1
- package/dist/browser-posture-report.d.ts +17 -0
- package/dist/browser-posture-report.d.ts.map +1 -1
- package/dist/browser-posture.d.mts +1 -1
- package/dist/browser-posture.d.ts +1 -1
- package/dist/browser-posture.js +53 -5
- package/dist/browser-posture.mjs +53 -5
- package/dist/browser-posture.mjs.map +1 -1
- package/dist/browser.d.mts +10 -0
- package/dist/browser.d.mts.map +1 -1
- package/dist/browser.d.ts +10 -0
- 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.d.mts.map +1 -1
- package/dist/canonical-signer/index.d.ts.map +1 -1
- package/dist/canonical-signer/index.js +0 -4
- package/dist/canonical-signer/index.mjs +0 -4
- package/dist/canonical-signer/index.mjs.map +1 -1
- package/dist/{client-ip-B7w-uHfS.d.ts → client-ip-8KneiMK0.d.mts} +12 -2
- package/dist/{client-ip-B7w-uHfS.d.mts.map → client-ip-8KneiMK0.d.mts.map} +1 -1
- package/dist/{client-ip-B7w-uHfS.d.mts → client-ip-8KneiMK0.d.ts} +12 -2
- package/dist/{client-ip-B7w-uHfS.d.ts.map → client-ip-8KneiMK0.d.ts.map} +1 -1
- package/dist/{client-ip-B8wFzJ5f.js → client-ip-BEmLC4I4.js} +71 -0
- package/dist/{client-ip-DIJyr6px.mjs → client-ip-DlHx7GGh.mjs} +61 -2
- package/dist/client-ip-DlHx7GGh.mjs.map +1 -0
- package/dist/client-ip.d.mts +2 -2
- package/dist/client-ip.d.ts +2 -2
- package/dist/client-ip.js +3 -1
- package/dist/client-ip.mjs +2 -2
- package/dist/deploy/index.d.mts +1 -0
- package/dist/deploy/index.d.mts.map +1 -1
- package/dist/deploy/index.d.ts +1 -0
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/index.js +14 -2
- package/dist/deploy/index.mjs +14 -2
- package/dist/deploy/index.mjs.map +1 -1
- package/dist/{detection-reason-mapping-CQexNvR7.d.ts → detection-reason-mapping-BemDaDED.d.mts} +5 -2
- package/dist/detection-reason-mapping-BemDaDED.d.mts.map +1 -0
- package/dist/{detection-reason-mapping-CQexNvR7.d.mts → detection-reason-mapping-BemDaDED.d.ts} +5 -2
- package/dist/detection-reason-mapping-BemDaDED.d.ts.map +1 -0
- package/dist/{detection-reason-mapping-B9RSkOs8.js → detection-reason-mapping-BxYaQ8kb.js} +33 -8
- package/dist/{detection-reason-mapping-BGymWIPl.mjs → detection-reason-mapping-j-7bXsVb.mjs} +29 -10
- package/dist/detection-reason-mapping-j-7bXsVb.mjs.map +1 -0
- package/dist/errors/index.d.mts +4 -0
- package/dist/errors/index.d.mts.map +1 -1
- package/dist/errors/index.d.ts +4 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +24 -8
- package/dist/errors/index.mjs +24 -8
- package/dist/errors/index.mjs.map +1 -1
- package/dist/{fetcher-D2vjr7jB.d.mts → fetcher-CTKz07jg.d.mts} +13 -3
- package/dist/fetcher-CTKz07jg.d.mts.map +1 -0
- package/dist/{fetcher-C8qvwdnA.d.ts → fetcher-DCr920hx.d.ts} +13 -3
- package/dist/fetcher-DCr920hx.d.ts.map +1 -0
- package/dist/gateway-client-ip.js +1 -1
- package/dist/gateway-client-ip.mjs +1 -1
- package/dist/host-adapter/index.d.mts +1 -1
- package/dist/host-adapter/index.d.ts +1 -1
- package/dist/identity-cookie/index.d.mts +14 -0
- package/dist/identity-cookie/index.d.mts.map +1 -0
- package/dist/identity-cookie/index.d.ts +14 -0
- package/dist/identity-cookie/index.d.ts.map +1 -0
- package/dist/identity-cookie/index.js +45 -0
- package/dist/identity-cookie/index.mjs +43 -0
- package/dist/identity-cookie/index.mjs.map +1 -0
- package/dist/{index-DnFsmr_o.d.ts → index-Cdv_FH0H.d.ts} +2 -2
- package/dist/{index-DnFsmr_o.d.ts.map → index-Cdv_FH0H.d.ts.map} +1 -1
- package/dist/{index-rvw5Bz-r.d.mts → index-DL_dmQBY.d.mts} +2 -2
- package/dist/{index-rvw5Bz-r.d.mts.map → index-DL_dmQBY.d.mts.map} +1 -1
- package/dist/index.d.mts +641 -169
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +641 -169
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +819 -210
- package/dist/index.mjs +765 -200
- package/dist/index.mjs.map +1 -1
- package/dist/kya-http.d.mts +2 -2
- package/dist/kya-http.d.ts +2 -2
- package/dist/kya-http.js +7 -2
- package/dist/kya-http.mjs +2 -2
- package/dist/mcpi/dashboard-config/index.mjs.map +1 -1
- package/dist/patterns-CdTh7LU2.d.mts +35 -0
- package/dist/patterns-CdTh7LU2.d.mts.map +1 -0
- package/dist/patterns-CdTh7LU2.d.ts +35 -0
- package/dist/patterns-CdTh7LU2.d.ts.map +1 -0
- package/dist/{patterns-CiMpbdAF.js → patterns-CnNxRnaK.js} +3 -130
- package/dist/{patterns-D4OAsNQY.mjs → patterns-CpRk9R3M.mjs} +5 -96
- package/dist/patterns-CpRk9R3M.mjs.map +1 -0
- package/dist/patterns.d.mts +2 -2
- package/dist/patterns.d.ts +2 -2
- package/dist/patterns.js +1 -7
- package/dist/patterns.mjs +2 -2
- package/dist/policy/fetcher.d.mts +2 -2
- package/dist/policy/fetcher.d.ts +2 -2
- package/dist/policy/fetcher.js +100 -8
- package/dist/policy/fetcher.mjs +99 -9
- package/dist/policy/fetcher.mjs.map +1 -1
- package/dist/policy/schemas.d.mts +1 -1
- package/dist/policy/schemas.d.ts +1 -1
- package/dist/proxy-assertion-mapping-BVwXVSMZ.mjs +81 -0
- package/dist/proxy-assertion-mapping-BVwXVSMZ.mjs.map +1 -0
- package/dist/proxy-assertion-mapping-BxhENrcY.d.mts +70 -0
- package/dist/proxy-assertion-mapping-BxhENrcY.d.mts.map +1 -0
- package/dist/proxy-assertion-mapping-D64AyZfG.js +85 -0
- package/dist/proxy-assertion-mapping-DhAynFqG.d.ts +70 -0
- package/dist/proxy-assertion-mapping-DhAynFqG.d.ts.map +1 -0
- package/dist/proxy-assertions.d.mts +2 -0
- package/dist/proxy-assertions.d.ts +2 -0
- package/dist/proxy-assertions.js +4 -0
- package/dist/proxy-assertions.mjs +3 -0
- package/dist/reason-codes.d.mts +2 -2
- package/dist/reason-codes.d.ts +2 -2
- package/dist/reason-codes.js +3 -2
- package/dist/reason-codes.mjs +2 -2
- package/dist/{registered-sid-D6KCaT1E.d.ts → registered-sid-BgDhdj2l.d.mts} +24 -2
- package/dist/registered-sid-BgDhdj2l.d.mts.map +1 -0
- package/dist/{registered-sid-D6KCaT1E.d.mts → registered-sid-BgDhdj2l.d.ts} +24 -2
- package/dist/registered-sid-BgDhdj2l.d.ts.map +1 -0
- package/dist/{registered-sid-DVGTSH0L.js → registered-sid-DG1tSSvl.js} +162 -4
- package/dist/{registered-sid-26hNxp6t.mjs → registered-sid-D__xiDPu.mjs} +134 -6
- package/dist/registered-sid-D__xiDPu.mjs.map +1 -0
- package/dist/{schemas-m-GqyfyO.d.mts → schemas-BhC88D1-.d.mts} +5 -5
- package/dist/{schemas-m-GqyfyO.d.mts.map → schemas-BhC88D1-.d.mts.map} +1 -1
- package/dist/{schemas-CGKHzcMV.d.ts → schemas-DZa1ouGs.d.ts} +5 -5
- package/dist/{schemas-CGKHzcMV.d.ts.map → schemas-DZa1ouGs.d.ts.map} +1 -1
- package/dist/signals/index.d.mts.map +1 -1
- package/dist/signals/index.d.ts.map +1 -1
- package/dist/signals/index.js +4 -0
- package/dist/signals/index.mjs +4 -0
- package/dist/signals/index.mjs.map +1 -1
- package/dist/timezone-country-B6PkDyNP.d.mts +15 -0
- package/dist/timezone-country-B6PkDyNP.d.mts.map +1 -0
- package/dist/timezone-country-B6PkDyNP.d.ts +15 -0
- package/dist/timezone-country-B6PkDyNP.d.ts.map +1 -0
- package/dist/timezone-country-CROxU2Tl.js +505 -0
- package/dist/timezone-country-CrrnkOdy.mjs +489 -0
- package/dist/timezone-country-CrrnkOdy.mjs.map +1 -0
- package/dist/timezone-country.d.mts +2 -0
- package/dist/timezone-country.d.ts +2 -0
- package/dist/timezone-country.js +6 -0
- package/dist/timezone-country.mjs +3 -0
- package/dist/tool-protection/index.mjs.map +1 -1
- package/fixtures/detection/cloudflare-alias-parity.json +383 -0
- package/fixtures/detection/reason-codes.json +3 -1
- package/fixtures/detection/signal-exposure-example.json +1 -1
- package/fixtures/iana-tzdata/backward +375 -0
- package/fixtures/iana-tzdata/renamed-zones.json +21 -0
- package/fixtures/iana-tzdata/version +1 -0
- package/fixtures/iana-tzdata/zone.tab +448 -0
- package/fixtures/workbench/management-session.v1.json +20 -0
- package/fixtures/workbench/model-credentials.v1.json +8 -0
- package/fixtures/workbench/task-grant.v1.json +37 -0
- package/package.json +25 -3
- package/src/data/compiled/merged-rules.json +9 -7
- package/dist/browser-posture-5fPrsxx7.d.mts.map +0 -1
- package/dist/browser-posture-CCR1kh5e.d.ts.map +0 -1
- package/dist/browser-posture-proof-verifier-DvsOmFrM.js +0 -202
- package/dist/browser-posture-proof-verifier-I0HP2Ics.mjs +0 -180
- package/dist/browser-posture-proof-verifier-I0HP2Ics.mjs.map +0 -1
- package/dist/client-ip-DIJyr6px.mjs.map +0 -1
- package/dist/detection-reason-mapping-BGymWIPl.mjs.map +0 -1
- package/dist/detection-reason-mapping-CQexNvR7.d.mts.map +0 -1
- package/dist/detection-reason-mapping-CQexNvR7.d.ts.map +0 -1
- package/dist/fetcher-C8qvwdnA.d.ts.map +0 -1
- package/dist/fetcher-D2vjr7jB.d.mts.map +0 -1
- package/dist/patterns-Bp40cwh2.d.mts +0 -110
- package/dist/patterns-Bp40cwh2.d.mts.map +0 -1
- package/dist/patterns-Bp40cwh2.d.ts +0 -110
- package/dist/patterns-Bp40cwh2.d.ts.map +0 -1
- package/dist/patterns-D4OAsNQY.mjs.map +0 -1
- package/dist/registered-sid-26hNxp6t.mjs.map +0 -1
- package/dist/registered-sid-D6KCaT1E.d.mts.map +0 -1
- package/dist/registered-sid-D6KCaT1E.d.ts.map +0 -1
|
@@ -101,14 +101,142 @@ function looksLikeVcJwt(token) {
|
|
|
101
101
|
/** Same definition as the .NET / Java `IsCredentialPresented`. */
|
|
102
102
|
function requestPresentedCredential(headers) {
|
|
103
103
|
if (!headers) return false;
|
|
104
|
-
|
|
105
|
-
const value = headerText(headers, name);
|
|
106
|
-
if (value && hasKyaMember(value)) return true;
|
|
107
|
-
}
|
|
104
|
+
if (requestPresentsKyaSignature(headers)) return true;
|
|
108
105
|
if (requestCarriesDelegationProof(headers)) return true;
|
|
109
106
|
const bearer = headerText(headers, "authorization")?.match(/^bearer\s+(\S+)/i);
|
|
110
107
|
return bearer !== null && bearer !== void 0 && looksLikeVcJwt(bearer[1]);
|
|
111
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* True when `Signature-Input` or `Signature` carries a `kya` member, i.e. the
|
|
111
|
+
* request presents a KYA HTTP Binding (kya-http/2) signature. Same member scan
|
|
112
|
+
* as {@link requestPresentedCredential}; routing only, the engine validates it.
|
|
113
|
+
*/
|
|
114
|
+
function requestPresentsKyaSignature(headers) {
|
|
115
|
+
if (!headers) return false;
|
|
116
|
+
return ["signature-input", "signature"].some((name) => {
|
|
117
|
+
const value = headerText(headers, name);
|
|
118
|
+
return value !== void 0 && hasKyaMember(value);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* True when the request's framing says it carries a body: a
|
|
123
|
+
* `Transfer-Encoding` header, or a `Content-Length` other than exactly `0`
|
|
124
|
+
* (an empty, blank or malformed length counts as a body, so it fails closed).
|
|
125
|
+
* This is `type-is`'s `hasBody`, except that `Content-Length: 0` is an empty
|
|
126
|
+
* body. A kya-http/2 verifier uses it to tell a request with no body apart
|
|
127
|
+
* from one whose body bytes it never received. HTTP/2 can carry a body with
|
|
128
|
+
* neither header, so a host that can read the body should pass its bytes
|
|
129
|
+
* instead of relying on this.
|
|
130
|
+
*/
|
|
131
|
+
function requestDeclaresBody(headers) {
|
|
132
|
+
if (!headers) return false;
|
|
133
|
+
if (headerText(headers, "transfer-encoding") !== void 0) return true;
|
|
134
|
+
const contentLength = headerText(headers, "content-length");
|
|
135
|
+
return contentLength !== void 0 && contentLength !== "0";
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/mcpi/signed-body.ts
|
|
140
|
+
/**
|
|
141
|
+
* The body bound of a kya-http/2 (KYA HTTP Binding) signed request.
|
|
142
|
+
*
|
|
143
|
+
* A kya-http/2 signature binds the body through `Content-Digest`, so a host
|
|
144
|
+
* hands the engine the exact body bytes. Every host bounds them the same way,
|
|
145
|
+
* at the .NET adapters' 1 MiB: a larger signed body is answered 413 and never
|
|
146
|
+
* verified in part. In observe mode it goes on without its bytes, and the
|
|
147
|
+
* refusal it would have been is reported.
|
|
148
|
+
*/
|
|
149
|
+
/** Largest kya-http/2 signed body a host hands the engine. */
|
|
150
|
+
const KYA_SIGNED_BODY_MAX_BYTES = 1048576;
|
|
151
|
+
const EXPIRED = Symbol("expired");
|
|
152
|
+
function expiryAfter(deadlineMs) {
|
|
153
|
+
let timer;
|
|
154
|
+
return {
|
|
155
|
+
expired: new Promise((resolve) => {
|
|
156
|
+
timer = setTimeout(() => resolve(EXPIRED), deadlineMs);
|
|
157
|
+
}),
|
|
158
|
+
clear: () => clearTimeout(timer)
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
async function readBodyBounded(request, maxBytes, options) {
|
|
162
|
+
const declaredLength = Number(request.headers.get("content-length"));
|
|
163
|
+
if (Number.isFinite(declaredLength) && declaredLength > maxBytes) return { failure: "too-large" };
|
|
164
|
+
const stream = request.clone().body;
|
|
165
|
+
if (!stream) return requestDeclaresBody(request.headers) ? { failure: "unreadable" } : { bytes: /* @__PURE__ */ new Uint8Array(0) };
|
|
166
|
+
const reader = stream.getReader();
|
|
167
|
+
const chunks = [];
|
|
168
|
+
let total = 0;
|
|
169
|
+
const expiry = options === void 0 ? void 0 : expiryAfter(options.deadlineMs);
|
|
170
|
+
try {
|
|
171
|
+
for (;;) {
|
|
172
|
+
const next = await (expiry === void 0 ? reader.read() : Promise.race([reader.read(), expiry.expired]));
|
|
173
|
+
if (next === EXPIRED) {
|
|
174
|
+
reader.cancel().catch(() => void 0);
|
|
175
|
+
return {
|
|
176
|
+
failure: "timed-out",
|
|
177
|
+
bytesRead: total
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
const { done, value } = next;
|
|
181
|
+
if (done) break;
|
|
182
|
+
total += value.byteLength;
|
|
183
|
+
if (total > maxBytes) {
|
|
184
|
+
reader.cancel().catch(() => void 0);
|
|
185
|
+
return { failure: "too-large" };
|
|
186
|
+
}
|
|
187
|
+
chunks.push(value);
|
|
188
|
+
}
|
|
189
|
+
} catch {
|
|
190
|
+
return { failure: "unreadable" };
|
|
191
|
+
} finally {
|
|
192
|
+
expiry?.clear();
|
|
193
|
+
}
|
|
194
|
+
const bytes = new Uint8Array(total);
|
|
195
|
+
let offset = 0;
|
|
196
|
+
for (const chunk of chunks) {
|
|
197
|
+
bytes.set(chunk, offset);
|
|
198
|
+
offset += chunk.byteLength;
|
|
199
|
+
}
|
|
200
|
+
return { bytes };
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/mcpi/relayed-request-target.ts
|
|
205
|
+
/**
|
|
206
|
+
* An absolute URL with an authority: an RFC 3986 §3.1 scheme (a letter, then
|
|
207
|
+
* letters, digits, `+`, `-` or `.`, in any case) followed by `://`. A scheme
|
|
208
|
+
* without `//` (`https:/x`, `https:x`) is not one, though a WHATWG URL parser
|
|
209
|
+
* would still read a host from it for a special scheme.
|
|
210
|
+
*/
|
|
211
|
+
const ABSOLUTE_URL = /^[a-z][a-z0-9+.-]*:\/\//i;
|
|
212
|
+
/**
|
|
213
|
+
* The request target (path plus query) of a request a caller relays to a
|
|
214
|
+
* Checkpoint enforce endpoint (the gateway Worker's `/__detect/enforce`, the
|
|
215
|
+
* dashboard's `/api/v1/enforce` and `/api/v1/verdict`). The engine verifies a
|
|
216
|
+
* signature over that target, reading `@path` and `@query` from it, with the
|
|
217
|
+
* authority from the relayed `host` header.
|
|
218
|
+
*
|
|
219
|
+
* The SDKs send `url` as an absolute URL (`withCheckpointApi` sends
|
|
220
|
+
* `request.url`), so a `scheme://` URL gives its path and query. Any other `url`
|
|
221
|
+
* is already a request target and is read exactly as sent, less a fragment:
|
|
222
|
+
* resolving it as a URL would read `//host/x` or `/\host/x` as a host and the
|
|
223
|
+
* path `/x`, so a signature over `/x` would verify for it. Without a `url`, the
|
|
224
|
+
* target is `path`. A `url` or `path` that isn't a string counts as absent: the
|
|
225
|
+
* gateway reads its body without validating it.
|
|
226
|
+
*/
|
|
227
|
+
function relayedRequestTarget(url, path) {
|
|
228
|
+
if (typeof url === "string" && url) {
|
|
229
|
+
if (!ABSOLUTE_URL.test(url)) {
|
|
230
|
+
const target = url.split("#", 1)[0];
|
|
231
|
+
return target.startsWith("/") ? target : `/${target}`;
|
|
232
|
+
}
|
|
233
|
+
try {
|
|
234
|
+
const parsed = new URL(url);
|
|
235
|
+
return parsed.pathname + parsed.search;
|
|
236
|
+
} catch {}
|
|
237
|
+
}
|
|
238
|
+
return typeof path === "string" && path ? path : "/";
|
|
239
|
+
}
|
|
112
240
|
|
|
113
241
|
//#endregion
|
|
114
242
|
//#region src/mcpi/anonymous-principal.ts
|
|
@@ -159,6 +287,12 @@ Object.defineProperty(exports, 'DELEGATION_PROOF_HEADERS', {
|
|
|
159
287
|
return DELEGATION_PROOF_HEADERS;
|
|
160
288
|
}
|
|
161
289
|
});
|
|
290
|
+
Object.defineProperty(exports, 'KYA_SIGNED_BODY_MAX_BYTES', {
|
|
291
|
+
enumerable: true,
|
|
292
|
+
get: function () {
|
|
293
|
+
return KYA_SIGNED_BODY_MAX_BYTES;
|
|
294
|
+
}
|
|
295
|
+
});
|
|
162
296
|
Object.defineProperty(exports, 'REGISTERED_SID_MAX_LENGTH', {
|
|
163
297
|
enumerable: true,
|
|
164
298
|
get: function () {
|
|
@@ -171,15 +305,39 @@ Object.defineProperty(exports, 'SID_ATTRIBUTABLE_RESULT', {
|
|
|
171
305
|
return SID_ATTRIBUTABLE_RESULT;
|
|
172
306
|
}
|
|
173
307
|
});
|
|
308
|
+
Object.defineProperty(exports, 'readBodyBounded', {
|
|
309
|
+
enumerable: true,
|
|
310
|
+
get: function () {
|
|
311
|
+
return readBodyBounded;
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
Object.defineProperty(exports, 'relayedRequestTarget', {
|
|
315
|
+
enumerable: true,
|
|
316
|
+
get: function () {
|
|
317
|
+
return relayedRequestTarget;
|
|
318
|
+
}
|
|
319
|
+
});
|
|
174
320
|
Object.defineProperty(exports, 'requestCarriesDelegationProof', {
|
|
175
321
|
enumerable: true,
|
|
176
322
|
get: function () {
|
|
177
323
|
return requestCarriesDelegationProof;
|
|
178
324
|
}
|
|
179
325
|
});
|
|
326
|
+
Object.defineProperty(exports, 'requestDeclaresBody', {
|
|
327
|
+
enumerable: true,
|
|
328
|
+
get: function () {
|
|
329
|
+
return requestDeclaresBody;
|
|
330
|
+
}
|
|
331
|
+
});
|
|
180
332
|
Object.defineProperty(exports, 'requestPresentedCredential', {
|
|
181
333
|
enumerable: true,
|
|
182
334
|
get: function () {
|
|
183
335
|
return requestPresentedCredential;
|
|
184
336
|
}
|
|
337
|
+
});
|
|
338
|
+
Object.defineProperty(exports, 'requestPresentsKyaSignature', {
|
|
339
|
+
enumerable: true,
|
|
340
|
+
get: function () {
|
|
341
|
+
return requestPresentsKyaSignature;
|
|
342
|
+
}
|
|
185
343
|
});
|
|
@@ -101,14 +101,142 @@ function looksLikeVcJwt(token) {
|
|
|
101
101
|
/** Same definition as the .NET / Java `IsCredentialPresented`. */
|
|
102
102
|
function requestPresentedCredential(headers) {
|
|
103
103
|
if (!headers) return false;
|
|
104
|
-
|
|
105
|
-
const value = headerText(headers, name);
|
|
106
|
-
if (value && hasKyaMember(value)) return true;
|
|
107
|
-
}
|
|
104
|
+
if (requestPresentsKyaSignature(headers)) return true;
|
|
108
105
|
if (requestCarriesDelegationProof(headers)) return true;
|
|
109
106
|
const bearer = headerText(headers, "authorization")?.match(/^bearer\s+(\S+)/i);
|
|
110
107
|
return bearer !== null && bearer !== void 0 && looksLikeVcJwt(bearer[1]);
|
|
111
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* True when `Signature-Input` or `Signature` carries a `kya` member, i.e. the
|
|
111
|
+
* request presents a KYA HTTP Binding (kya-http/2) signature. Same member scan
|
|
112
|
+
* as {@link requestPresentedCredential}; routing only, the engine validates it.
|
|
113
|
+
*/
|
|
114
|
+
function requestPresentsKyaSignature(headers) {
|
|
115
|
+
if (!headers) return false;
|
|
116
|
+
return ["signature-input", "signature"].some((name) => {
|
|
117
|
+
const value = headerText(headers, name);
|
|
118
|
+
return value !== void 0 && hasKyaMember(value);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* True when the request's framing says it carries a body: a
|
|
123
|
+
* `Transfer-Encoding` header, or a `Content-Length` other than exactly `0`
|
|
124
|
+
* (an empty, blank or malformed length counts as a body, so it fails closed).
|
|
125
|
+
* This is `type-is`'s `hasBody`, except that `Content-Length: 0` is an empty
|
|
126
|
+
* body. A kya-http/2 verifier uses it to tell a request with no body apart
|
|
127
|
+
* from one whose body bytes it never received. HTTP/2 can carry a body with
|
|
128
|
+
* neither header, so a host that can read the body should pass its bytes
|
|
129
|
+
* instead of relying on this.
|
|
130
|
+
*/
|
|
131
|
+
function requestDeclaresBody(headers) {
|
|
132
|
+
if (!headers) return false;
|
|
133
|
+
if (headerText(headers, "transfer-encoding") !== void 0) return true;
|
|
134
|
+
const contentLength = headerText(headers, "content-length");
|
|
135
|
+
return contentLength !== void 0 && contentLength !== "0";
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/mcpi/signed-body.ts
|
|
140
|
+
/**
|
|
141
|
+
* The body bound of a kya-http/2 (KYA HTTP Binding) signed request.
|
|
142
|
+
*
|
|
143
|
+
* A kya-http/2 signature binds the body through `Content-Digest`, so a host
|
|
144
|
+
* hands the engine the exact body bytes. Every host bounds them the same way,
|
|
145
|
+
* at the .NET adapters' 1 MiB: a larger signed body is answered 413 and never
|
|
146
|
+
* verified in part. In observe mode it goes on without its bytes, and the
|
|
147
|
+
* refusal it would have been is reported.
|
|
148
|
+
*/
|
|
149
|
+
/** Largest kya-http/2 signed body a host hands the engine. */
|
|
150
|
+
const KYA_SIGNED_BODY_MAX_BYTES = 1048576;
|
|
151
|
+
const EXPIRED = Symbol("expired");
|
|
152
|
+
function expiryAfter(deadlineMs) {
|
|
153
|
+
let timer;
|
|
154
|
+
return {
|
|
155
|
+
expired: new Promise((resolve) => {
|
|
156
|
+
timer = setTimeout(() => resolve(EXPIRED), deadlineMs);
|
|
157
|
+
}),
|
|
158
|
+
clear: () => clearTimeout(timer)
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
async function readBodyBounded(request, maxBytes, options) {
|
|
162
|
+
const declaredLength = Number(request.headers.get("content-length"));
|
|
163
|
+
if (Number.isFinite(declaredLength) && declaredLength > maxBytes) return { failure: "too-large" };
|
|
164
|
+
const stream = request.clone().body;
|
|
165
|
+
if (!stream) return requestDeclaresBody(request.headers) ? { failure: "unreadable" } : { bytes: /* @__PURE__ */ new Uint8Array(0) };
|
|
166
|
+
const reader = stream.getReader();
|
|
167
|
+
const chunks = [];
|
|
168
|
+
let total = 0;
|
|
169
|
+
const expiry = options === void 0 ? void 0 : expiryAfter(options.deadlineMs);
|
|
170
|
+
try {
|
|
171
|
+
for (;;) {
|
|
172
|
+
const next = await (expiry === void 0 ? reader.read() : Promise.race([reader.read(), expiry.expired]));
|
|
173
|
+
if (next === EXPIRED) {
|
|
174
|
+
reader.cancel().catch(() => void 0);
|
|
175
|
+
return {
|
|
176
|
+
failure: "timed-out",
|
|
177
|
+
bytesRead: total
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
const { done, value } = next;
|
|
181
|
+
if (done) break;
|
|
182
|
+
total += value.byteLength;
|
|
183
|
+
if (total > maxBytes) {
|
|
184
|
+
reader.cancel().catch(() => void 0);
|
|
185
|
+
return { failure: "too-large" };
|
|
186
|
+
}
|
|
187
|
+
chunks.push(value);
|
|
188
|
+
}
|
|
189
|
+
} catch {
|
|
190
|
+
return { failure: "unreadable" };
|
|
191
|
+
} finally {
|
|
192
|
+
expiry?.clear();
|
|
193
|
+
}
|
|
194
|
+
const bytes = new Uint8Array(total);
|
|
195
|
+
let offset = 0;
|
|
196
|
+
for (const chunk of chunks) {
|
|
197
|
+
bytes.set(chunk, offset);
|
|
198
|
+
offset += chunk.byteLength;
|
|
199
|
+
}
|
|
200
|
+
return { bytes };
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/mcpi/relayed-request-target.ts
|
|
205
|
+
/**
|
|
206
|
+
* An absolute URL with an authority: an RFC 3986 §3.1 scheme (a letter, then
|
|
207
|
+
* letters, digits, `+`, `-` or `.`, in any case) followed by `://`. A scheme
|
|
208
|
+
* without `//` (`https:/x`, `https:x`) is not one, though a WHATWG URL parser
|
|
209
|
+
* would still read a host from it for a special scheme.
|
|
210
|
+
*/
|
|
211
|
+
const ABSOLUTE_URL = /^[a-z][a-z0-9+.-]*:\/\//i;
|
|
212
|
+
/**
|
|
213
|
+
* The request target (path plus query) of a request a caller relays to a
|
|
214
|
+
* Checkpoint enforce endpoint (the gateway Worker's `/__detect/enforce`, the
|
|
215
|
+
* dashboard's `/api/v1/enforce` and `/api/v1/verdict`). The engine verifies a
|
|
216
|
+
* signature over that target, reading `@path` and `@query` from it, with the
|
|
217
|
+
* authority from the relayed `host` header.
|
|
218
|
+
*
|
|
219
|
+
* The SDKs send `url` as an absolute URL (`withCheckpointApi` sends
|
|
220
|
+
* `request.url`), so a `scheme://` URL gives its path and query. Any other `url`
|
|
221
|
+
* is already a request target and is read exactly as sent, less a fragment:
|
|
222
|
+
* resolving it as a URL would read `//host/x` or `/\host/x` as a host and the
|
|
223
|
+
* path `/x`, so a signature over `/x` would verify for it. Without a `url`, the
|
|
224
|
+
* target is `path`. A `url` or `path` that isn't a string counts as absent: the
|
|
225
|
+
* gateway reads its body without validating it.
|
|
226
|
+
*/
|
|
227
|
+
function relayedRequestTarget(url, path) {
|
|
228
|
+
if (typeof url === "string" && url) {
|
|
229
|
+
if (!ABSOLUTE_URL.test(url)) {
|
|
230
|
+
const target = url.split("#", 1)[0];
|
|
231
|
+
return target.startsWith("/") ? target : `/${target}`;
|
|
232
|
+
}
|
|
233
|
+
try {
|
|
234
|
+
const parsed = new URL(url);
|
|
235
|
+
return parsed.pathname + parsed.search;
|
|
236
|
+
} catch {}
|
|
237
|
+
}
|
|
238
|
+
return typeof path === "string" && path ? path : "/";
|
|
239
|
+
}
|
|
112
240
|
|
|
113
241
|
//#endregion
|
|
114
242
|
//#region src/mcpi/anonymous-principal.ts
|
|
@@ -147,5 +275,5 @@ const REGISTERED_SID_MAX_LENGTH = 100;
|
|
|
147
275
|
const SID_ATTRIBUTABLE_RESULT = "verified";
|
|
148
276
|
|
|
149
277
|
//#endregion
|
|
150
|
-
export {
|
|
151
|
-
//# sourceMappingURL=registered-sid-
|
|
278
|
+
export { KYA_SIGNED_BODY_MAX_BYTES as a, requestCarriesDelegationProof as c, requestPresentsKyaSignature as d, relayedRequestTarget as i, requestDeclaresBody as l, SID_ATTRIBUTABLE_RESULT as n, readBodyBounded as o, ANONYMOUS_PRINCIPAL_DID as r, DELEGATION_PROOF_HEADERS as s, REGISTERED_SID_MAX_LENGTH as t, requestPresentedCredential as u };
|
|
279
|
+
//# sourceMappingURL=registered-sid-D__xiDPu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registered-sid-D__xiDPu.mjs","names":[],"sources":["../src/mcpi/delegation-headers.ts","../src/mcpi/signed-body.ts","../src/mcpi/relayed-request-target.ts","../src/mcpi/anonymous-principal.ts","../src/mcpi/registered-sid.ts"],"sourcesContent":["/**\n * Delegation-proof request detection (P2 / DR-1).\n *\n * The engine's L2 delegation-root pinning (`ContextSpec.trustedDelegationRoots`)\n * is consulted for every credential the engine verifies: the delegation-proof\n * headers below AND an `Authorization: Bearer` VC-JWT. Consumers gate root\n * resolution on `requestPresentedCredential`, so the human / no-credential hot\n * path stays a precise no-op.\n *\n * Keeping the header set here (rather than re-listing the literals at each site)\n * is the whole point: a new delegation transport header is added in one place\n * and every verifier surface agrees.\n */\n\n/**\n * Lowercased delegation-proof header names. `kya-os-delegation-credential` is the\n * canonical KYA-OS transport; `kya-delegation` is the legacy envelope form still\n * accepted via `legacyEnvelopeFallback`.\n */\nexport const DELEGATION_PROOF_HEADERS = ['kya-os-delegation-credential', 'kya-delegation'] as const;\n\n/** A header value is \"present\" when it is a non-empty string (or non-empty list). */\nfunction isPresent(value: unknown): boolean {\n if (Array.isArray(value)) return value.length > 0;\n return typeof value === 'string' && value.length > 0;\n}\n\n/**\n * Does the request carry a KYA-OS delegation-proof header?\n *\n * Accepts either a `Headers` instance (Next.js / fetch — case-insensitive\n * lookup) or a plain header record (raw Node/Express headers, gateway worker's\n * lowercased map). Record keys are matched case-insensitively, so callers do not\n * need to pre-normalize. Returns `false` for `null`/`undefined`.\n */\nexport function requestCarriesDelegationProof(\n headers: Headers | Record<string, unknown> | null | undefined\n): boolean {\n if (!headers) return false;\n\n if (typeof (headers as Headers).get === 'function') {\n const h = headers as Headers;\n return DELEGATION_PROOF_HEADERS.some((name) => isPresent(h.get(name)));\n }\n\n const record = headers as Record<string, unknown>;\n const lowerKeyed = new Map<string, unknown>();\n for (const key of Object.keys(record)) {\n lowerKeyed.set(key.toLowerCase(), record[key]);\n }\n return DELEGATION_PROOF_HEADERS.some((name) => isPresent(lowerKeyed.get(name)));\n}\n\nconst MAX_VC_JWT_PAYLOAD_CHARS = 16 * 1024;\n\nfunction headerText(headers: Headers | Record<string, unknown>, name: string): string | undefined {\n if (typeof (headers as Headers).get === 'function') {\n return (headers as Headers).get(name) ?? undefined;\n }\n for (const [key, value] of Object.entries(headers as Record<string, unknown>)) {\n if (key.toLowerCase() !== name) continue;\n if (Array.isArray(value)) return value.join(', ');\n return typeof value === 'string' ? value : undefined;\n }\n return undefined;\n}\n\nfunction isMemberDelimiter(c: string): boolean {\n return c === '=' || c === ';' || c === ',' || c === ' ' || c === '\\t';\n}\n\n// Quote-aware member scan; the engine owns the authoritative parse.\nfunction hasKyaMember(value: string): boolean {\n let memberStart = true;\n let quoted = false;\n let escaped = false;\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n if (quoted) {\n if (escaped) escaped = false;\n else if (c === '\\\\') escaped = true;\n else if (c === '\"') quoted = false;\n continue;\n }\n if (memberStart) {\n if (c === ' ' || c === '\\t') continue;\n if (\n value.startsWith('kya', i) &&\n (i + 3 === value.length || isMemberDelimiter(value[i + 3]))\n ) {\n return true;\n }\n memberStart = false;\n }\n if (c === '\"') quoted = true;\n else if (c === ',') memberStart = true;\n }\n return false;\n}\n\nfunction decodeBase64UrlJson(segment: string): unknown {\n const padded = segment.replace(/-/g, '+').replace(/_/g, '/');\n const binary = atob(padded + '='.repeat((4 - (padded.length % 4)) % 4));\n const bytes = Uint8Array.from(binary, (ch) => ch.charCodeAt(0));\n return JSON.parse(new TextDecoder().decode(bytes));\n}\n\nfunction isDelegationCredentialPayload(payload: unknown): boolean {\n if (typeof payload !== 'object' || payload === null) return false;\n if ('vc' in payload) return true;\n const type = (payload as { type?: unknown }).type;\n return Array.isArray(type) && type.includes('DelegationCredential');\n}\n\n// Must equal the orchestrator's delegation routing (`vc` claim OR flat `type`\n// DelegationCredential); an oversized payload counts as presented.\nfunction looksLikeVcJwt(token: string): boolean {\n const parts = token.split('.');\n if (parts.length !== 3 || parts.some((part) => part.length === 0)) return false;\n if (parts[1].length > MAX_VC_JWT_PAYLOAD_CHARS) return true;\n try {\n return isDelegationCredentialPayload(decodeBase64UrlJson(parts[1]));\n } catch {\n return false;\n }\n}\n\n/** Same definition as the .NET / Java `IsCredentialPresented`. */\nexport function requestPresentedCredential(\n headers: Headers | Record<string, unknown> | null | undefined\n): boolean {\n if (!headers) return false;\n if (requestPresentsKyaSignature(headers)) return true;\n if (requestCarriesDelegationProof(headers)) return true;\n const authorization = headerText(headers, 'authorization');\n const bearer = authorization?.match(/^bearer\\s+(\\S+)/i);\n return bearer !== null && bearer !== undefined && looksLikeVcJwt(bearer[1]);\n}\n\n/**\n * True when `Signature-Input` or `Signature` carries a `kya` member, i.e. the\n * request presents a KYA HTTP Binding (kya-http/2) signature. Same member scan\n * as {@link requestPresentedCredential}; routing only, the engine validates it.\n */\nexport function requestPresentsKyaSignature(\n headers: Headers | Record<string, unknown> | null | undefined\n): boolean {\n if (!headers) return false;\n return ['signature-input', 'signature'].some((name) => {\n const value = headerText(headers, name);\n return value !== undefined && hasKyaMember(value);\n });\n}\n\n/**\n * True when the request's framing says it carries a body: a\n * `Transfer-Encoding` header, or a `Content-Length` other than exactly `0`\n * (an empty, blank or malformed length counts as a body, so it fails closed).\n * This is `type-is`'s `hasBody`, except that `Content-Length: 0` is an empty\n * body. A kya-http/2 verifier uses it to tell a request with no body apart\n * from one whose body bytes it never received. HTTP/2 can carry a body with\n * neither header, so a host that can read the body should pass its bytes\n * instead of relying on this.\n */\nexport function requestDeclaresBody(\n headers: Headers | Record<string, unknown> | null | undefined\n): boolean {\n if (!headers) return false;\n if (headerText(headers, 'transfer-encoding') !== undefined) return true;\n const contentLength = headerText(headers, 'content-length');\n // A string compare, not Number(): Number('') and Number(' ') are 0.\n return contentLength !== undefined && contentLength !== '0';\n}\n","/**\n * The body bound of a kya-http/2 (KYA HTTP Binding) signed request.\n *\n * A kya-http/2 signature binds the body through `Content-Digest`, so a host\n * hands the engine the exact body bytes. Every host bounds them the same way,\n * at the .NET adapters' 1 MiB: a larger signed body is answered 413 and never\n * verified in part. In observe mode it goes on without its bytes, and the\n * refusal it would have been is reported.\n */\n\nimport { requestDeclaresBody } from './delegation-headers';\n\n/** Largest kya-http/2 signed body a host hands the engine. */\nexport const KYA_SIGNED_BODY_MAX_BYTES = 1_048_576;\n\n/** A bounded read: the whole body, or why there is none. Never a prefix. */\nexport type BoundedBody = { bytes: Uint8Array } | { failure: 'too-large' | 'unreadable' };\n\nexport type DeadlineBoundedBody = BoundedBody | { failure: 'timed-out'; bytesRead: number };\n\nexport interface BodyReadOptions {\n deadlineMs: number;\n}\n\nconst EXPIRED = Symbol('expired');\n\nfunction expiryAfter(deadlineMs: number) {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const expired = new Promise<typeof EXPIRED>((resolve) => {\n timer = setTimeout(() => resolve(EXPIRED), deadlineMs);\n });\n return { expired, clear: () => clearTimeout(timer) };\n}\n\n/**\n * Read a clone of `request`'s body, stopping at `maxBytes`, so the original\n * body is still owed, whole, downstream. A request with no body stream reads\n * as empty, unless its framing declares a body (one the host dropped): that is\n * `unreadable`, never an empty body.\n *\n * Streamed with an early stop, not `arrayBuffer()`: a chunked body with no\n * `Content-Length` would otherwise be pulled whole (into both branches of the\n * clone's tee) before its size was ever looked at.\n */\nexport function readBodyBounded(request: Request, maxBytes: number): Promise<BoundedBody>;\nexport function readBodyBounded(\n request: Request,\n maxBytes: number,\n options: BodyReadOptions\n): Promise<DeadlineBoundedBody>;\nexport async function readBodyBounded(\n request: Request,\n maxBytes: number,\n options?: BodyReadOptions\n): Promise<DeadlineBoundedBody> {\n const declaredLength = Number(request.headers.get('content-length'));\n if (Number.isFinite(declaredLength) && declaredLength > maxBytes) {\n return { failure: 'too-large' };\n }\n const stream = request.clone().body;\n if (!stream) {\n return requestDeclaresBody(request.headers)\n ? { failure: 'unreadable' }\n : { bytes: new Uint8Array(0) };\n }\n const reader = stream.getReader();\n const chunks: Uint8Array[] = [];\n let total = 0;\n const expiry = options === undefined ? undefined : expiryAfter(options.deadlineMs);\n try {\n for (;;) {\n const next = await (expiry === undefined\n ? reader.read()\n : Promise.race([reader.read(), expiry.expired]));\n if (next === EXPIRED) {\n reader.cancel().catch(() => undefined);\n return { failure: 'timed-out', bytesRead: total };\n }\n const { done, value } = next;\n if (done) break;\n total += value.byteLength;\n if (total > maxBytes) {\n // Not awaited: cancelling one branch of a tee settles only once the\n // other branch (the original body, still owed downstream) is\n // cancelled too, so awaiting here would never return.\n reader.cancel().catch(() => undefined);\n return { failure: 'too-large' };\n }\n chunks.push(value);\n }\n } catch {\n return { failure: 'unreadable' };\n } finally {\n expiry?.clear();\n }\n const bytes = new Uint8Array(total);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.byteLength;\n }\n return { bytes };\n}\n","/**\n * An absolute URL with an authority: an RFC 3986 §3.1 scheme (a letter, then\n * letters, digits, `+`, `-` or `.`, in any case) followed by `://`. A scheme\n * without `//` (`https:/x`, `https:x`) is not one, though a WHATWG URL parser\n * would still read a host from it for a special scheme.\n */\nconst ABSOLUTE_URL = /^[a-z][a-z0-9+.-]*:\\/\\//i;\n\n/**\n * The request target (path plus query) of a request a caller relays to a\n * Checkpoint enforce endpoint (the gateway Worker's `/__detect/enforce`, the\n * dashboard's `/api/v1/enforce` and `/api/v1/verdict`). The engine verifies a\n * signature over that target, reading `@path` and `@query` from it, with the\n * authority from the relayed `host` header.\n *\n * The SDKs send `url` as an absolute URL (`withCheckpointApi` sends\n * `request.url`), so a `scheme://` URL gives its path and query. Any other `url`\n * is already a request target and is read exactly as sent, less a fragment:\n * resolving it as a URL would read `//host/x` or `/\\host/x` as a host and the\n * path `/x`, so a signature over `/x` would verify for it. Without a `url`, the\n * target is `path`. A `url` or `path` that isn't a string counts as absent: the\n * gateway reads its body without validating it.\n */\nexport function relayedRequestTarget(url: unknown, path: unknown): string {\n if (typeof url === 'string' && url) {\n if (!ABSOLUTE_URL.test(url)) {\n const target = url.split('#', 1)[0];\n return target.startsWith('/') ? target : `/${target}`;\n }\n try {\n const parsed = new URL(url);\n return parsed.pathname + parsed.search;\n } catch {\n // Not a URL: fall back to the path.\n }\n }\n return typeof path === 'string' && path ? path : '/';\n}\n","/**\n * Canonical did:web for the anonymous-principal sentinel (see `./principal.ts`).\n * Kept apart from the client DID derivation, which loads `@noble/hashes`, so\n * request-path code can take it from the `./kya-http` lean entry.\n */\nexport const ANONYMOUS_PRINCIPAL_DID = 'did:web:kya.vouched.id:principals:anonymous';\n","/**\n * The registered session anchor (`sid`) contract between a reporter and\n * Checkpoint ingest. Kept apart from `reported-identity.ts`, which builds Zod\n * schemas when it loads, so the runtime and the `./kya-http` entry can read\n * these values without loading Zod.\n */\n\n/**\n * Max length of a registered session anchor (`sid`) accepted on the wire and\n * enforced again at the customer route. The join partner\n * `bouncer_sessions.id` is `varchar(100)`; `detections.registered_sid` stays\n * `text` (converting a live column to `varchar` would take an ACCESS EXCLUSIVE\n * rewrite of the hottest table), so this constant is the width contract\n * instead of the column type.\n */\nexport const REGISTERED_SID_MAX_LENGTH = 100;\n\n/**\n * The one delegation result that may attribute a `sid` to a session timeline.\n * A rejected presentation carries no engine-emitted sid, and a sid on a\n * `failed` / `not_presented` report is attacker-shaped, so ingest stamps\n * `registered_sid` only for this result and nulls it otherwise (D4 / D15).\n * One member on purpose: Section 13 of the plan records how an explicitly\n * unverified-labeled `failed` could join it later.\n */\nexport const SID_ATTRIBUTABLE_RESULT = 'verified' as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAa,2BAA2B,CAAC,gCAAgC,gBAAgB;;AAGzF,SAAS,UAAU,OAAyB;CAC1C,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,SAAS;CAChD,OAAO,OAAO,UAAU,YAAY,MAAM,SAAS;AACrD;;;;;;;;;AAUA,SAAgB,8BACd,SACS;CACT,IAAI,CAAC,SAAS,OAAO;CAErB,IAAI,OAAQ,QAAoB,QAAQ,YAAY;EAClD,MAAM,IAAI;EACV,OAAO,yBAAyB,MAAM,SAAS,UAAU,EAAE,IAAI,IAAI,CAAC,CAAC;CACvE;CAEA,MAAM,SAAS;CACf,MAAM,6BAAa,IAAI,IAAqB;CAC5C,KAAK,MAAM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E,SAAS,YAAY;GAChC;GACA,OAAO,KAAK,KAAK;EACnB;CACF,QAAQ;EACN,OAAO,EAAE,SAAS,aAAa;CACjC,UAAU;EACR,QAAQ,MAAM;CAChB;CACA,MAAM,QAAQ,IAAI,WAAW,KAAK;CAClC,IAAI,SAAS;CACb,KAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,IAAI,OAAO,MAAM;EACvB,UAAU,MAAM;CAClB;CACA,OAAO,EAAE,MAAM;AACjB;;;;;;;;;;AChGA,MAAM,eAAe;;;;;;;;;;;;;;;;AAiBrB,SAAgB,qBAAqB,KAAc,MAAuB;CACxE,IAAI,OAAO,QAAQ,YAAY,KAAK;EAClC,IAAI,CAAC,aAAa,KAAK,GAAG,GAAG;GAC3B,MAAM,SAAS,IAAI,MAAM,KAAK,CAAC,CAAC,CAAC;GACjC,OAAO,OAAO,WAAW,GAAG,IAAI,SAAS,IAAI;EAC/C;EACA,IAAI;GACF,MAAM,SAAS,IAAI,IAAI,GAAG;GAC1B,OAAO,OAAO,WAAW,OAAO;EAClC,QAAQ,CAER;CACF;CACA,OAAO,OAAO,SAAS,YAAY,OAAO,OAAO;AACnD;;;;;;;;;AChCA,MAAa,0BAA0B;;;;;;;;;;;;;;;;;;ACUvC,MAAa,4BAA4B;;;;;;;;;AAUzC,MAAa,0BAA0B"}
|
|
@@ -265,8 +265,8 @@ declare const ConditionOperatorSchema: ZodEnum<{
|
|
|
265
265
|
notIn: "notIn";
|
|
266
266
|
}>;
|
|
267
267
|
declare const ConditionFieldSchema: ZodEnum<{
|
|
268
|
-
origin: "origin";
|
|
269
268
|
path: "path";
|
|
269
|
+
origin: "origin";
|
|
270
270
|
confidence: "confidence";
|
|
271
271
|
clientDid: "clientDid";
|
|
272
272
|
agentDid: "agentDid";
|
|
@@ -284,8 +284,8 @@ declare const ConditionFieldSchema: ZodEnum<{
|
|
|
284
284
|
declare const ConditionValueSchema: ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>;
|
|
285
285
|
declare const PolicyConditionSchema: ZodObject<{
|
|
286
286
|
field: ZodEnum<{
|
|
287
|
-
origin: "origin";
|
|
288
287
|
path: "path";
|
|
288
|
+
origin: "origin";
|
|
289
289
|
confidence: "confidence";
|
|
290
290
|
clientDid: "clientDid";
|
|
291
291
|
agentDid: "agentDid";
|
|
@@ -330,8 +330,8 @@ declare const PolicyRuleSchema: ZodObject<{
|
|
|
330
330
|
priority: ZodDefault<ZodNumber>;
|
|
331
331
|
conditions: ZodArray<ZodObject<{
|
|
332
332
|
field: ZodEnum<{
|
|
333
|
-
origin: "origin";
|
|
334
333
|
path: "path";
|
|
334
|
+
origin: "origin";
|
|
335
335
|
confidence: "confidence";
|
|
336
336
|
clientDid: "clientDid";
|
|
337
337
|
agentDid: "agentDid";
|
|
@@ -451,8 +451,8 @@ declare const PolicyConfigSchema: ZodObject<{
|
|
|
451
451
|
priority: ZodDefault<ZodNumber>;
|
|
452
452
|
conditions: ZodArray<ZodObject<{
|
|
453
453
|
field: ZodEnum<{
|
|
454
|
-
origin: "origin";
|
|
455
454
|
path: "path";
|
|
455
|
+
origin: "origin";
|
|
456
456
|
confidence: "confidence";
|
|
457
457
|
clientDid: "clientDid";
|
|
458
458
|
agentDid: "agentDid";
|
|
@@ -532,4 +532,4 @@ type PolicyConfig = output<typeof PolicyConfigSchema>;
|
|
|
532
532
|
declare function safeParsePolicyConfig(data: unknown): PolicyConfig | null;
|
|
533
533
|
//#endregion
|
|
534
534
|
export { PolicyMetadataSchema as A, ThresholdConfigSchema as B, InstructPayload as C, PolicyConfig as D, PolicyConditionSchema as E, RuleMetadata as F, RuleMetadataSchema as I, SuggestedAction as L, PolicyRuleSchema as M, RedirectTarget as N, PolicyConfigSchema as O, RedirectTargetSchema as P, SuggestedActionSchema as R, EnforcementModeSchema as S, PolicyCondition as T, safeParsePolicyConfig as V, DenyListEntry as _, BlockReason as a, EnforcementActionSchema as b, ChallengeParamsSchema as c, ConditionOperator as d, ConditionOperatorSchema as f, DecisionSchema as g, Decision as h, AssuranceTierSchema as i, PolicyRule as j, PolicyMetadata as k, ConditionField as l, ConditionValueSchema as m, AllowListEntrySchema as n, BlockReasonSchema as o, ConditionValue as p, AssuranceTier as r, ChallengeParams as s, AllowListEntry as t, ConditionFieldSchema as u, DenyListEntrySchema as v, InstructPayloadSchema as w, EnforcementMode as x, EnforcementAction as y, ThresholdConfig as z };
|
|
535
|
-
//# sourceMappingURL=schemas-
|
|
535
|
+
//# sourceMappingURL=schemas-BhC88D1-.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas-
|
|
1
|
+
{"version":3,"file":"schemas-BhC88D1-.d.mts","names":[],"sources":["../src/policy/schemas.ts"],"mappings":";;cAiCa,yBAAuB;;;;;;;;;cAgBvB,uBAAqB;;;;KAEtB,kBAAkB,cAAe;cAoBhC,mBAAiB,uBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6C5B;KAEU,cAAc,cAAe;cAS5B,qBAAmB;;;;;;;KASpB,gBAAgB,cAAe;cAQ9B,uBAAqB;;;;;;;;;;;;;;GAsBhC;KAEU,kBAAkB,cAAe;cAIhC,sBAAoB;;;;;GAM/B;KAEU,iBAAiB,cAAe;cAE/B,uBAAqB,uBAAA;;;;;;;;;;;;;;GAShC;KAEU,kBAAkB,cAAe;cAEhC,uBAAqB;;;;;;;;;;;;;;;;;;;GAMhC;KAEU,kBAAkB,cAAe;cAUhC,gBAAc,uBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GASzB;KAEU,WAAW,cAAe;cAMzB,uBAAqB;;;;;;;;;;;;;;;;;;;;;;;GAiBhC;cAMW,qBAAmB;;;;;;;;;;GAmB9B;cAEW,sBAAoB;;;;;;;;GAe/B;cAMW,yBAAuB;;;;;;;;;;;;;;;cAgBvB,sBAAoB;;;;;;;;;;;;;;;;;cAsBpB,sBAAoB,mBAAA,WAAA,WAAA,YAAA,SAAA;cAOpB,uBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAShC;cAMW,oBAAkB;;;;GAI7B;cAEW,kBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqB3B;cAMW,sBAAoB;;;;GAI/B;cAEW,oBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsF7B;KAMU,oBAAoB,cAAe;KACnC,kBAAkB,cAAe;KACjC,gBAAgB,cAAe;KAC/B,iBAAiB,cAAe;KAChC,oBAAoB,cAAe;KACnC,iBAAiB,cAAe;KAChC,iBAAiB,cAAe;KAChC,kBAAkB,cAAe;KACjC,eAAe,cAAe;KAC9B,aAAa,cAAe;KAC5B,iBAAiB,cAAe;KAChC,eAAe,cAAe;iBAW1B,sBAAsB,gBAAgB"}
|
|
@@ -265,8 +265,8 @@ declare const ConditionOperatorSchema: ZodEnum<{
|
|
|
265
265
|
notIn: "notIn";
|
|
266
266
|
}>;
|
|
267
267
|
declare const ConditionFieldSchema: ZodEnum<{
|
|
268
|
-
origin: "origin";
|
|
269
268
|
path: "path";
|
|
269
|
+
origin: "origin";
|
|
270
270
|
confidence: "confidence";
|
|
271
271
|
clientDid: "clientDid";
|
|
272
272
|
agentDid: "agentDid";
|
|
@@ -284,8 +284,8 @@ declare const ConditionFieldSchema: ZodEnum<{
|
|
|
284
284
|
declare const ConditionValueSchema: ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>;
|
|
285
285
|
declare const PolicyConditionSchema: ZodObject<{
|
|
286
286
|
field: ZodEnum<{
|
|
287
|
-
origin: "origin";
|
|
288
287
|
path: "path";
|
|
288
|
+
origin: "origin";
|
|
289
289
|
confidence: "confidence";
|
|
290
290
|
clientDid: "clientDid";
|
|
291
291
|
agentDid: "agentDid";
|
|
@@ -330,8 +330,8 @@ declare const PolicyRuleSchema: ZodObject<{
|
|
|
330
330
|
priority: ZodDefault<ZodNumber>;
|
|
331
331
|
conditions: ZodArray<ZodObject<{
|
|
332
332
|
field: ZodEnum<{
|
|
333
|
-
origin: "origin";
|
|
334
333
|
path: "path";
|
|
334
|
+
origin: "origin";
|
|
335
335
|
confidence: "confidence";
|
|
336
336
|
clientDid: "clientDid";
|
|
337
337
|
agentDid: "agentDid";
|
|
@@ -451,8 +451,8 @@ declare const PolicyConfigSchema: ZodObject<{
|
|
|
451
451
|
priority: ZodDefault<ZodNumber>;
|
|
452
452
|
conditions: ZodArray<ZodObject<{
|
|
453
453
|
field: ZodEnum<{
|
|
454
|
-
origin: "origin";
|
|
455
454
|
path: "path";
|
|
455
|
+
origin: "origin";
|
|
456
456
|
confidence: "confidence";
|
|
457
457
|
clientDid: "clientDid";
|
|
458
458
|
agentDid: "agentDid";
|
|
@@ -532,4 +532,4 @@ type PolicyConfig = output<typeof PolicyConfigSchema>;
|
|
|
532
532
|
declare function safeParsePolicyConfig(data: unknown): PolicyConfig | null;
|
|
533
533
|
//#endregion
|
|
534
534
|
export { PolicyMetadataSchema as A, ThresholdConfigSchema as B, InstructPayload as C, PolicyConfig as D, PolicyConditionSchema as E, RuleMetadata as F, RuleMetadataSchema as I, SuggestedAction as L, PolicyRuleSchema as M, RedirectTarget as N, PolicyConfigSchema as O, RedirectTargetSchema as P, SuggestedActionSchema as R, EnforcementModeSchema as S, PolicyCondition as T, safeParsePolicyConfig as V, DenyListEntry as _, BlockReason as a, EnforcementActionSchema as b, ChallengeParamsSchema as c, ConditionOperator as d, ConditionOperatorSchema as f, DecisionSchema as g, Decision as h, AssuranceTierSchema as i, PolicyRule as j, PolicyMetadata as k, ConditionField as l, ConditionValueSchema as m, AllowListEntrySchema as n, BlockReasonSchema as o, ConditionValue as p, AssuranceTier as r, ChallengeParams as s, AllowListEntry as t, ConditionFieldSchema as u, DenyListEntrySchema as v, InstructPayloadSchema as w, EnforcementMode as x, EnforcementAction as y, ThresholdConfig as z };
|
|
535
|
-
//# sourceMappingURL=schemas-
|
|
535
|
+
//# sourceMappingURL=schemas-DZa1ouGs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas-
|
|
1
|
+
{"version":3,"file":"schemas-DZa1ouGs.d.ts","names":[],"sources":["../src/policy/schemas.ts"],"mappings":";;cAiCa,yBAAuB;;;;;;;;;cAgBvB,uBAAqB;;;;KAEtB,kBAAkB,cAAe;cAoBhC,mBAAiB,uBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6C5B;KAEU,cAAc,cAAe;cAS5B,qBAAmB;;;;;;;KASpB,gBAAgB,cAAe;cAQ9B,uBAAqB;;;;;;;;;;;;;;GAsBhC;KAEU,kBAAkB,cAAe;cAIhC,sBAAoB;;;;;GAM/B;KAEU,iBAAiB,cAAe;cAE/B,uBAAqB,uBAAA;;;;;;;;;;;;;;GAShC;KAEU,kBAAkB,cAAe;cAEhC,uBAAqB;;;;;;;;;;;;;;;;;;;GAMhC;KAEU,kBAAkB,cAAe;cAUhC,gBAAc,uBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GASzB;KAEU,WAAW,cAAe;cAMzB,uBAAqB;;;;;;;;;;;;;;;;;;;;;;;GAiBhC;cAMW,qBAAmB;;;;;;;;;;GAmB9B;cAEW,sBAAoB;;;;;;;;GAe/B;cAMW,yBAAuB;;;;;;;;;;;;;;;cAgBvB,sBAAoB;;;;;;;;;;;;;;;;;cAsBpB,sBAAoB,mBAAA,WAAA,WAAA,YAAA,SAAA;cAOpB,uBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAShC;cAMW,oBAAkB;;;;GAI7B;cAEW,kBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqB3B;cAMW,sBAAoB;;;;GAI/B;cAEW,oBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsF7B;KAMU,oBAAoB,cAAe;KACnC,kBAAkB,cAAe;KACjC,gBAAgB,cAAe;KAC/B,iBAAiB,cAAe;KAChC,oBAAoB,cAAe;KACnC,iBAAiB,cAAe;KAChC,iBAAiB,cAAe;KAChC,kBAAkB,cAAe;KACjC,eAAe,cAAe;KAC9B,aAAa,cAAe;KAC5B,iBAAiB,cAAe;KAChC,eAAe,cAAe;iBAW1B,sBAAsB,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/signals/types.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../src/signals/merkle.ts","../../src/signals/session-fingerprint-hash.ts","../../src/signals/device-fingerprint.ts","../../src/signals/validate.ts","../../src/signals/immutability.ts","../../src/signals/docs.ts","../../src/signals/sensitive-attributes.ts"],"mappings":";qBAuBa;KAED,0BAA0B;qBAEzB,0BAA0B;KAU3B;KAQA;KASA;KAEA;EAAkB;;EAAmB;EAAe;;UAS/C;EAEf;EACA;EAEA;EAEA;EACA;EACA;;qBAIW;KAED,wCAAwC;KAMxC;UAgBK;EAEf,aAAa;EACb;EAEA;EAEA;EAEA,iBAAiB;EAEjB;;UAGe;EAEf;EAEA,cAAc;EAEd,gBAAgB;EAChB,MAAM;EACN,aAAa;EACb,SAAS;EACT,MAAM;EACN,OAAO;EAEP;EAEA;EAEA;EACA;EAOA,QAAQ;;qBAIG;qBASA;UASI;EACf;EACA,cAAc;EACd,gBAAgB;EAChB,SAAS;EACT,MAAM;EACN,OAAO;EACP;EACA,eAAe;;;;qBCrCJ,iBAAiB;;;wBC3Gd,iBACd,UAAU,oBACV,UAAS,kBACR;wBASa,UACd,UAAU,oBACV,YACA,UAAS,kBACR;wBAKa,mBAAmB,UAAU,qBAAqB;KAItD,iBAAiB,OAAO,aAAa,eAAe;wBAOhD,aAAa,SAAS,qBAAqB;;;KCG/C;EACN;EAAiB;;EACjB;;EACA;EAAe;;UAEJ;EAEf;EAEA,QAAQ;;UAGO;EAEf;EAKA;EACA,QAAQ,eAAe;;UAGR;EAEf,iBAAiB;EAEjB;EAEA,QAAQ,QAAQ,OAAO,aAAa;;wBAiFtB,qBACd,UAAU,oBACV,UAAU,eAAe,gBACzB,kBAAiB,kBAChB;;;wBC7Fa,8BACd,kBAAkB;;;qBCjFP;qBAEA;KAED;UAEK;WACN,MAAM;WACN;WACA;WACA;;qBA2BE;qBAEA;qBAEA;qBA6BA,iCAAiC,oBAAoB;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/signals/types.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../src/signals/merkle.ts","../../src/signals/session-fingerprint-hash.ts","../../src/signals/device-fingerprint.ts","../../src/signals/validate.ts","../../src/signals/immutability.ts","../../src/signals/docs.ts","../../src/signals/sensitive-attributes.ts"],"mappings":";qBAuBa;KAED,0BAA0B;qBAEzB,0BAA0B;KAU3B;KAQA;KASA;KAEA;EAAkB;;EAAmB;EAAe;;UAS/C;EAEf;EACA;EAEA;EAEA;EACA;EACA;;qBAIW;KAED,wCAAwC;KAMxC;UAgBK;EAEf,aAAa;EACb;EAEA;EAEA;EAEA,iBAAiB;EAEjB;;UAGe;EAEf;EAEA,cAAc;EAEd,gBAAgB;EAChB,MAAM;EACN,aAAa;EACb,SAAS;EACT,MAAM;EACN,OAAO;EAEP;EAEA;EAEA;EACA;EAOA,QAAQ;;qBAIG;qBASA;UASI;EACf;EACA,cAAc;EACd,gBAAgB;EAChB,SAAS;E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oBa,sBACd,QAAQ,KAAK,8CACb,UAAS,gCACR;wBAuBa,2BACd,QAAQ,wCACR,iBAAgB,gCACf;wBAsCa,qCACd,QAAQ,mBACP;qBAiBU,yCAAyC;WAC3C;WACA,YAAY;EAET,YAAA,kBAAkB,YAAY;;wBAqB5B,eAAe,YAAY,mBAAmB;wBAa9C,kCAAkC,QAAQ;EACxD;EACA,YAAY;;wBAaE,+BACd,SAAS,oBACT,iBAAgB,gCACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/signals/types.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../src/signals/merkle.ts","../../src/signals/session-fingerprint-hash.ts","../../src/signals/device-fingerprint.ts","../../src/signals/validate.ts","../../src/signals/immutability.ts","../../src/signals/docs.ts","../../src/signals/sensitive-attributes.ts"],"mappings":";qBAuBa;KAED,0BAA0B;qBAEzB,0BAA0B;KAU3B;KAQA;KASA;KAEA;EAAkB;;EAAmB;EAAe;;UAS/C;EAEf;EACA;EAEA;EAEA;EACA;EACA;;qBAIW;KAED,wCAAwC;KAMxC;UAgBK;EAEf,aAAa;EACb;EAEA;EAEA;EAEA,iBAAiB;EAEjB;;UAGe;EAEf;EAEA,cAAc;EAEd,gBAAgB;EAChB,MAAM;EACN,aAAa;EACb,SAAS;EACT,MAAM;EACN,OAAO;EAEP;EAEA;EAEA;EACA;EAOA,QAAQ;;qBAIG;qBASA;UASI;EACf;EACA,cAAc;EACd,gBAAgB;EAChB,SAAS;EACT,MAAM;EACN,OAAO;EACP;EACA,eAAe;;;;qBCrCJ,iBAAiB;;;wBC3Gd,iBACd,UAAU,oBACV,UAAS,kBACR;wBASa,UACd,UAAU,oBACV,YACA,UAAS,kBACR;wBAKa,mBAAmB,UAAU,qBAAqB;KAItD,iBAAiB,OAAO,aAAa,eAAe;wBAOhD,aAAa,SAAS,qBAAqB;;;KCG/C;EACN;EAAiB;;EACjB;;EACA;EAAe;;UAEJ;EAEf;EAEA,QAAQ;;UAGO;EAEf;EAKA;EACA,QAAQ,eAAe;;UAGR;EAEf,iBAAiB;EAEjB;EAEA,QAAQ,QAAQ,OAAO,aAAa;;wBAiFtB,qBACd,UAAU,oBACV,UAAU,eAAe,gBACzB,kBAAiB,kBAChB;;;wBC7Fa,8BACd,kBAAkB;;;qBCjFP;qBAEA;KAED;UAEK;WACN,MAAM;WACN;WACA;WACA;;qBA2BE;qBAEA;qBAEA;qBA6BA,iCAAiC,oBAAoB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/signals/types.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../src/signals/merkle.ts","../../src/signals/session-fingerprint-hash.ts","../../src/signals/device-fingerprint.ts","../../src/signals/validate.ts","../../src/signals/immutability.ts","../../src/signals/docs.ts","../../src/signals/sensitive-attributes.ts"],"mappings":";qBAuBa;KAED,0BAA0B;qBAEzB,0BAA0B;KAU3B;KAQA;KASA;KAEA;EAAkB;;EAAmB;EAAe;;UAS/C;EAEf;EACA;EAEA;EAEA;EACA;EACA;;qBAIW;KAED,wCAAwC;KAMxC;UAgBK;EAEf,aAAa;EACb;EAEA;EAEA;EAEA,iBAAiB;EAEjB;;UAGe;EAEf;EAEA,cAAc;EAEd,gBAAgB;EAChB,MAAM;EACN,aAAa;EACb,SAAS;EACT,MAAM;EACN,OAAO;EAEP;EAEA;EAEA;EACA;EAOA,QAAQ;;qBAIG;qBASA;UASI;EACf;EACA,cAAc;EACd,gBAAgB;EAChB,SAAS;EACT,MAAM;EACN,OAAO;EACP;EACA,eAAe;;;;qBCrCJ,iBAAiB;;;wBC3Gd,iBACd,UAAU,oBACV,UAAS,kBACR;wBASa,UACd,UAAU,oBACV,YACA,UAAS,kBACR;wBAKa,mBAAmB,UAAU,qBAAqB;KAItD,iBAAiB,OAAO,aAAa,eAAe;wBAOhD,aAAa,SAAS,qBAAqB;;;KCG/C;EACN;EAAiB;;EACjB;;EACA;EAAe;;UAEJ;EAEf;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
|
package/dist/signals/index.js
CHANGED
|
@@ -1681,6 +1681,8 @@ const CLIENT_ATTRIBUTE_CLASSIFICATION = /* @__PURE__ */ new Map([
|
|
|
1681
1681
|
["client.keyDwellCount", counter],
|
|
1682
1682
|
["client.keyDwellUnder5", counter],
|
|
1683
1683
|
["client.keyDwellSumMs", counter],
|
|
1684
|
+
["client.keyDwellCongested", counter],
|
|
1685
|
+
["client.keyDwellStampFlat", counter],
|
|
1684
1686
|
["client.keyGapCount", counter],
|
|
1685
1687
|
["client.keyGapUnder5", counter],
|
|
1686
1688
|
["client.pressCount", counter],
|
|
@@ -1688,6 +1690,8 @@ const CLIENT_ATTRIBUTE_CLASSIFICATION = /* @__PURE__ */ new Map([
|
|
|
1688
1690
|
["client.pressAdjacentUnder5", counter],
|
|
1689
1691
|
["client.pressUnder10", counter],
|
|
1690
1692
|
["client.pressSumMs", counter],
|
|
1693
|
+
["client.pressCongested", counter],
|
|
1694
|
+
["client.pressStampFlat", counter],
|
|
1691
1695
|
["client.mouseClicks", counter],
|
|
1692
1696
|
["client.zeroTrailClicks", counter],
|
|
1693
1697
|
["client.pointerMoves", counter],
|
package/dist/signals/index.mjs
CHANGED
|
@@ -1680,6 +1680,8 @@ const CLIENT_ATTRIBUTE_CLASSIFICATION = /* @__PURE__ */ new Map([
|
|
|
1680
1680
|
["client.keyDwellCount", counter],
|
|
1681
1681
|
["client.keyDwellUnder5", counter],
|
|
1682
1682
|
["client.keyDwellSumMs", counter],
|
|
1683
|
+
["client.keyDwellCongested", counter],
|
|
1684
|
+
["client.keyDwellStampFlat", counter],
|
|
1683
1685
|
["client.keyGapCount", counter],
|
|
1684
1686
|
["client.keyGapUnder5", counter],
|
|
1685
1687
|
["client.pressCount", counter],
|
|
@@ -1687,6 +1689,8 @@ const CLIENT_ATTRIBUTE_CLASSIFICATION = /* @__PURE__ */ new Map([
|
|
|
1687
1689
|
["client.pressAdjacentUnder5", counter],
|
|
1688
1690
|
["client.pressUnder10", counter],
|
|
1689
1691
|
["client.pressSumMs", counter],
|
|
1692
|
+
["client.pressCongested", counter],
|
|
1693
|
+
["client.pressStampFlat", counter],
|
|
1690
1694
|
["client.mouseClicks", counter],
|
|
1691
1695
|
["client.zeroTrailClicks", counter],
|
|
1692
1696
|
["client.pointerMoves", counter],
|