@kya-os/checkpoint-shared 1.9.0 → 1.10.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 +24 -0
- package/README.md +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.js +35 -4
- package/dist/browser-posture.mjs +35 -4
- package/dist/browser-posture.mjs.map +1 -1
- 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 +9 -1
- package/dist/deploy/index.mjs +9 -1
- package/dist/deploy/index.mjs.map +1 -1
- package/dist/{fetcher-C8qvwdnA.d.ts → fetcher-CCw4Q95g.d.ts} +2 -2
- package/dist/{fetcher-C8qvwdnA.d.ts.map → fetcher-CCw4Q95g.d.ts.map} +1 -1
- package/dist/{fetcher-D2vjr7jB.d.mts → fetcher-CZfLcbRZ.d.mts} +2 -2
- package/dist/{fetcher-D2vjr7jB.d.mts.map → fetcher-CZfLcbRZ.d.mts.map} +1 -1
- package/dist/host-adapter/index.d.mts +1 -1
- package/dist/host-adapter/index.d.ts +1 -1
- 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 +68 -52
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +68 -52
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -13
- package/dist/index.mjs +24 -14
- 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 +6 -2
- package/dist/kya-http.mjs +2 -2
- 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/{registered-sid-DVGTSH0L.js → registered-sid-BZfDOfXy.js} +107 -4
- package/dist/{registered-sid-26hNxp6t.mjs → registered-sid-CS9V8nPr.mjs} +85 -6
- package/dist/registered-sid-CS9V8nPr.mjs.map +1 -0
- package/dist/{registered-sid-D6KCaT1E.d.ts → registered-sid-CnWIU_l1.d.mts} +13 -2
- package/dist/registered-sid-CnWIU_l1.d.mts.map +1 -0
- package/dist/{registered-sid-D6KCaT1E.d.mts → registered-sid-CnWIU_l1.d.ts} +13 -2
- package/dist/registered-sid-CnWIU_l1.d.ts.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/package.json +1 -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
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
# @kya-os/checkpoint-shared
|
|
4
4
|
|
|
5
|
+
## 1.10.0 - 2026-10-22
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `requestPresentsKyaSignature(headers)`: true when `Signature-Input` or `Signature` carries a `kya` member
|
|
10
|
+
(the same scan `requestPresentedCredential` uses, which now calls it). (#6147)
|
|
11
|
+
- `requestDeclaresBody(headers)`: true when `Transfer-Encoding` is present or `Content-Length` is anything but
|
|
12
|
+
exactly `0` (an empty, blank or malformed length counts as a body). The TypeScript SDKs and the gateway use these to
|
|
13
|
+
read and bind a kya-http/2 request's body. (#6147)
|
|
14
|
+
- `KYA_SIGNED_BODY_MAX_BYTES` (1 MiB), the largest kya-http/2 signed body a host hands the engine, and
|
|
15
|
+
`readBodyBounded(request, maxBytes)`, which reads a clone of a request's body up to a bound and returns the whole
|
|
16
|
+
body or `too-large` / `unreadable`, never a prefix. Exported from `./kya-http` and the root entry. Next.js, Express
|
|
17
|
+
and the gateway share them. (#6147)
|
|
18
|
+
- `HeartbeatRequestSchema` takes an optional `lastUserActivityAt`, an ISO 8601 time (UTC or with an offset) of the agent's last user or channel message, which Checkpoint records as user activity for a managed agent's tier. A value that isn't such a time parses as absent rather than failing the heartbeat. (#6744)
|
|
19
|
+
- the pixel interaction schema accepts four timing counters, `keyDwellCongested`, `keyDwellStampFlat`, `pressCongested` and `pressStampFlat`, which count where the handler clock and the events' own timestamps disagreed; the device fingerprint classifies them as churning counters. (#6738)
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- The descriptions on `RiskScoreSchema`, `RiskScoreSourceSchema` and the signal-exposure `riskScore` and `riskScoreSource` fields now say what each field means, its range and its values, instead of how the engine computes it. The schemas themselves are unchanged. (#6803)
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- browser-integrity protected routes match a request path the way routers do, so every path a router serves from a protected route is covered. (#6792)
|
|
28
|
+
|
|
5
29
|
## 1.9.0 - 2026-10-22
|
|
6
30
|
|
|
7
31
|
### Breaking changes
|
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ The `vercel` profile resolves only when the caller passes `vercelRuntime: true`
|
|
|
44
44
|
|
|
45
45
|
Replace the documentation address with your configured proxy allowlist. `observedClientAddress` and its `ip` compatibility alias are null when authentication or parsing fails. Check `status` and `reason`; do not substitute an untrusted header.
|
|
46
46
|
|
|
47
|
-
`resolveClientIp` remains the legacy platform-assumed API with its original three-field result. Existing gateway
|
|
47
|
+
`resolveClientIp` remains the legacy platform-assumed API with its original three-field result. Existing gateway and bouncer consumers retain their behavior until migrated explicitly. That compatibility API does not authenticate the nearest peer and does not provide the new N01 guarantees. See the [client-IP resolution runbook](https://github.com/Know-That-Ai/checkpoint/blob/main/docs/runbooks/client-ip-resolution.md) for supported SDK boundaries and migration guidance.
|
|
48
48
|
|
|
49
49
|
## Usage
|
|
50
50
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-posture-5fPrsxx7.d.mts","names":[],"sources":["../src/browser-posture-cookie.ts","../src/beacon-types/index.ts","../src/browser-posture-schema.ts","../src/browser-posture-report.ts","../src/browser-posture.ts"],"mappings":";;;iBAgBgB,kBAAkB;;;cC+pDrB;;;cC7qDA,sBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2C/B;KAGU,iBAAiB,cAAe;;;cC7C/B;KACD,oCAAoC;cAGnC,4BAA0B;;;;;;;;;;;;;;GAWrC;cAEW;KAaD,wCAAwC;cAEvC,6BAA2B;;;;;;;;;;;;;;;;;;;GAQpC;KACQ,wBAAwB,cAAe;cA2BtC,kCAAgC;;;;;;;;;;;;;;GAE3C;iBAEc,qBAAqB,SAAS;;;;;;;;;;;;;cClDjC;;;;;cAKA,uBAAwB;UAG3B;EACR;EACA;EACA;EACA;EACA;EACA;;iBAGc,eAAe,SAAS,iBAAiB;cAyC5C;cAGA;UAEI;EAEf,WAAW;EACX;EAEA;EACA;EACA;EAEA,kBAAkB;IAAQ;IAAc;;;iBAI1B,kBACd,mCACA;iBAcoB,sBAAsB,oBAAoB;iBAc1C,mBACpB,SAAS,gBACT,YAAY,KACZ,gBACC;KAqBS;EACN;EAAoB,SAAS;;EAC7B;;EACA;EAAoB,QAAQ;;cAOrB,uBAAwB,SAAS,wBAAsB;iBAM9C,sBACpB,2BACA,QAAQ,sBACR,mBACA,sCACA,eACC,QAAQ;iBA2EW,qBACpB,2BACA,QAAQ,sBACR,mBACA,sCACA,eACC,QAAQ;cAYE;cACA;UAGI;EACf;EAEA;EAEA;;iBAIc,0BACd,MAAM,iEACL;iBA6BmB,0BACpB,SAAS,gBACT,QAAQ,sBACR,mBACA,eACC,QAAQ;iBAcW,mBACpB,SAAS,gBACT,QAAQ,sBACR,mBACA,eACC,QAAQ;iBAIW,mBACpB,mCACA,QAAQ,sBACR,oBACC,QAAQ;
|
|
1
|
+
{"version":3,"file":"browser-posture-5fPrsxx7.d.mts","names":[],"sources":["../src/browser-posture-cookie.ts","../src/beacon-types/index.ts","../src/browser-posture-schema.ts","../src/browser-posture-report.ts","../src/browser-posture.ts"],"mappings":";;;iBAgBgB,kBAAkB;;;cC+pDrB;;;cC7qDA,sBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2C/B;KAGU,iBAAiB,cAAe;;;cC7C/B;KACD,oCAAoC;cAGnC,4BAA0B;;;;;;;;;;;;;;GAWrC;cAEW;KAaD,wCAAwC;cAEvC,6BAA2B;;;;;;;;;;;;;;;;;;;GAQpC;KACQ,wBAAwB,cAAe;cA2BtC,kCAAgC;;;;;;;;;;;;;;GAE3C;iBAEc,qBAAqB,SAAS;;;;;;;;;;;;;cClDjC;;;;;cAKA,uBAAwB;UAG3B;EACR;EACA;EACA;EACA;EACA;EACA;;iBAGc,eAAe,SAAS,iBAAiB;cAyC5C;cAGA;UAEI;EAEf,WAAW;EACX;EAEA;EACA;EACA;EAEA,kBAAkB;IAAQ;IAAc;;;iBAI1B,kBACd,mCACA;iBAcoB,sBAAsB,oBAAoB;iBAc1C,mBACpB,SAAS,gBACT,YAAY,KACZ,gBACC;KAqBS;EACN;EAAoB,SAAS;;EAC7B;;EACA;EAAoB,QAAQ;;cAOrB,uBAAwB,SAAS,wBAAsB;iBAM9C,sBACpB,2BACA,QAAQ,sBACR,mBACA,sCACA,eACC,QAAQ;iBA2EW,qBACpB,2BACA,QAAQ,sBACR,mBACA,sCACA,eACC,QAAQ;cAYE;cACA;UAGI;EACf;EAEA;EAEA;;iBAIc,0BACd,MAAM,iEACL;iBA6BmB,0BACpB,SAAS,gBACT,QAAQ,sBACR,mBACA,eACC,QAAQ;iBAcW,mBACpB,SAAS,gBACT,QAAQ,sBACR,mBACA,eACC,QAAQ;iBAIW,mBACpB,mCACA,QAAQ,sBACR,oBACC,QAAQ;iBA2CK,sBACd,QAAQ,sBACR;iBAiBc,6BACd,QAAQ,sBACR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-posture-CCR1kh5e.d.ts","names":[],"sources":["../src/browser-posture-cookie.ts","../src/beacon-types/index.ts","../src/browser-posture-schema.ts","../src/browser-posture-report.ts","../src/browser-posture.ts"],"mappings":";;;iBAgBgB,kBAAkB;;;cC+pDrB;;;cC7qDA,sBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2C/B;KAGU,iBAAiB,cAAe;;;cC7C/B;KACD,oCAAoC;cAGnC,4BAA0B;;;;;;;;;;;;;;GAWrC;cAEW;KAaD,wCAAwC;cAEvC,6BAA2B;;;;;;;;;;;;;;;;;;;GAQpC;KACQ,wBAAwB,cAAe;cA2BtC,kCAAgC;;;;;;;;;;;;;;GAE3C;iBAEc,qBAAqB,SAAS;;;;;;;;;;;;;cClDjC;;;;;cAKA,uBAAwB;UAG3B;EACR;EACA;EACA;EACA;EACA;EACA;;iBAGc,eAAe,SAAS,iBAAiB;cAyC5C;cAGA;UAEI;EAEf,WAAW;EACX;EAEA;EACA;EACA;EAEA,kBAAkB;IAAQ;IAAc;;;iBAI1B,kBACd,mCACA;iBAcoB,sBAAsB,oBAAoB;iBAc1C,mBACpB,SAAS,gBACT,YAAY,KACZ,gBACC;KAqBS;EACN;EAAoB,SAAS;;EAC7B;;EACA;EAAoB,QAAQ;;cAOrB,uBAAwB,SAAS,wBAAsB;iBAM9C,sBACpB,2BACA,QAAQ,sBACR,mBACA,sCACA,eACC,QAAQ;iBA2EW,qBACpB,2BACA,QAAQ,sBACR,mBACA,sCACA,eACC,QAAQ;cAYE;cACA;UAGI;EACf;EAEA;EAEA;;iBAIc,0BACd,MAAM,iEACL;iBA6BmB,0BACpB,SAAS,gBACT,QAAQ,sBACR,mBACA,eACC,QAAQ;iBAcW,mBACpB,SAAS,gBACT,QAAQ,sBACR,mBACA,eACC,QAAQ;iBAIW,mBACpB,mCACA,QAAQ,sBACR,oBACC,QAAQ;
|
|
1
|
+
{"version":3,"file":"browser-posture-CCR1kh5e.d.ts","names":[],"sources":["../src/browser-posture-cookie.ts","../src/beacon-types/index.ts","../src/browser-posture-schema.ts","../src/browser-posture-report.ts","../src/browser-posture.ts"],"mappings":";;;iBAgBgB,kBAAkB;;;cC+pDrB;;;cC7qDA,sBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2C/B;KAGU,iBAAiB,cAAe;;;cC7C/B;KACD,oCAAoC;cAGnC,4BAA0B;;;;;;;;;;;;;;GAWrC;cAEW;KAaD,wCAAwC;cAEvC,6BAA2B;;;;;;;;;;;;;;;;;;;GAQpC;KACQ,wBAAwB,cAAe;cA2BtC,kCAAgC;;;;;;;;;;;;;;GAE3C;iBAEc,qBAAqB,SAAS;;;;;;;;;;;;;cClDjC;;;;;cAKA,uBAAwB;UAG3B;EACR;EACA;EACA;EACA;EACA;EACA;;iBAGc,eAAe,SAAS,iBAAiB;cAyC5C;cAGA;UAEI;EAEf,WAAW;EACX;EAEA;EACA;EACA;EAEA,kBAAkB;IAAQ;IAAc;;;iBAI1B,kBACd,mCACA;iBAcoB,sBAAsB,oBAAoB;iBAc1C,mBACpB,SAAS,gBACT,YAAY,KACZ,gBACC;KAqBS;EACN;EAAoB,SAAS;;EAC7B;;EACA;EAAoB,QAAQ;;cAOrB,uBAAwB,SAAS,wBAAsB;iBAM9C,sBACpB,2BACA,QAAQ,sBACR,mBACA,sCACA,eACC,QAAQ;iBA2EW,qBACpB,2BACA,QAAQ,sBACR,mBACA,sCACA,eACC,QAAQ;cAYE;cACA;UAGI;EACf;EAEA;EAEA;;iBAIc,0BACd,MAAM,iEACL;iBA6BmB,0BACpB,SAAS,gBACT,QAAQ,sBACR,mBACA,eACC,QAAQ;iBAcW,mBACpB,SAAS,gBACT,QAAQ,sBACR,mBACA,eACC,QAAQ;iBAIW,mBACpB,mCACA,QAAQ,sBACR,oBACC,QAAQ;iBA2CK,sBACd,QAAQ,sBACR;iBAiBc,6BACd,QAAQ,sBACR"}
|
package/dist/browser-posture.js
CHANGED
|
@@ -294,9 +294,39 @@ async function postureFromRequest(request, config, projectId, now) {
|
|
|
294
294
|
async function postureFromCookies(header, config, projectId) {
|
|
295
295
|
return postureFromRequest({ cookie: header }, config, projectId);
|
|
296
296
|
}
|
|
297
|
-
/**
|
|
297
|
+
/**
|
|
298
|
+
* A path the way routers commonly match one: letter case and trailing
|
|
299
|
+
* slashes do not change which handler serves a request (Express routes are
|
|
300
|
+
* case-insensitive and non-strict by default), so they cannot change which
|
|
301
|
+
* designation covers it either. Folding them can only add a step-up.
|
|
302
|
+
*/
|
|
303
|
+
function routeKey(path) {
|
|
304
|
+
let end = path.length;
|
|
305
|
+
while (end > 0 && path.charCodeAt(end - 1) === 47) end--;
|
|
306
|
+
return end === 0 ? "/" : path.slice(0, end).toLowerCase();
|
|
307
|
+
}
|
|
308
|
+
/** The key a designation is matched and deduplicated by. */
|
|
309
|
+
function designationKey(path) {
|
|
310
|
+
return path.endsWith("/*") ? `${routeKey(path.slice(0, -2))}/*` : routeKey(path);
|
|
311
|
+
}
|
|
312
|
+
/** More specific first: the longer path, then an exact path before its own subtree. */
|
|
313
|
+
function bySpecificity(a, b) {
|
|
314
|
+
const length = (path) => routeKey(path.endsWith("/*") ? path.slice(0, -2) : path).length;
|
|
315
|
+
const subtree = (path) => path.endsWith("/*") ? 1 : 0;
|
|
316
|
+
return length(b.path) - length(a.path) || subtree(a.path) - subtree(b.path);
|
|
317
|
+
}
|
|
318
|
+
function designationCovers(designation, path) {
|
|
319
|
+
const key = routeKey(path);
|
|
320
|
+
if (!designation.endsWith("/*")) return key === routeKey(designation);
|
|
321
|
+
const root = routeKey(designation.slice(0, -2));
|
|
322
|
+
return root === "/" || key === root || key.startsWith(`${root}/`);
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Exact paths or an explicit subtree ending in /*, matched without letter
|
|
326
|
+
* case or trailing slashes. The most specific designation wins.
|
|
327
|
+
*/
|
|
298
328
|
function postureRequiredScopes(config, path) {
|
|
299
|
-
const route = [...config.protectedRoutes ?? []].sort(
|
|
329
|
+
const route = [...config.protectedRoutes ?? []].sort(bySpecificity).find((r) => designationCovers(r.path, path));
|
|
300
330
|
if (!route) return void 0;
|
|
301
331
|
if (!route.scopes.length || route.scopes.length > 50 || route.scopes.some((s) => s.length > 200 || !/^[\x21\x23-\x5b\x5d-\x7e]+$/.test(s)) || new Set(route.scopes).size !== route.scopes.length) throw new Error("Integrity-protected routes require explicit, unique scopes");
|
|
302
332
|
return route.scopes;
|
|
@@ -314,8 +344,9 @@ function validateBrowserPostureConfig(config, projectId) {
|
|
|
314
344
|
const paths = /* @__PURE__ */ new Set();
|
|
315
345
|
for (const route of config.protectedRoutes ?? []) {
|
|
316
346
|
if (!/^\/(?:[^?#*\\]*)(?:\/\*)?$/.test(route.path) && route.path !== "/*") throw new Error("Invalid integrity-protected path");
|
|
317
|
-
|
|
318
|
-
paths.
|
|
347
|
+
const key = designationKey(route.path);
|
|
348
|
+
if (paths.has(key)) throw new Error("Duplicate integrity-protected path");
|
|
349
|
+
paths.add(key);
|
|
319
350
|
postureRequiredScopes({
|
|
320
351
|
...config,
|
|
321
352
|
protectedRoutes: [route]
|
package/dist/browser-posture.mjs
CHANGED
|
@@ -293,9 +293,39 @@ async function postureFromRequest(request, config, projectId, now) {
|
|
|
293
293
|
async function postureFromCookies(header, config, projectId) {
|
|
294
294
|
return postureFromRequest({ cookie: header }, config, projectId);
|
|
295
295
|
}
|
|
296
|
-
/**
|
|
296
|
+
/**
|
|
297
|
+
* A path the way routers commonly match one: letter case and trailing
|
|
298
|
+
* slashes do not change which handler serves a request (Express routes are
|
|
299
|
+
* case-insensitive and non-strict by default), so they cannot change which
|
|
300
|
+
* designation covers it either. Folding them can only add a step-up.
|
|
301
|
+
*/
|
|
302
|
+
function routeKey(path) {
|
|
303
|
+
let end = path.length;
|
|
304
|
+
while (end > 0 && path.charCodeAt(end - 1) === 47) end--;
|
|
305
|
+
return end === 0 ? "/" : path.slice(0, end).toLowerCase();
|
|
306
|
+
}
|
|
307
|
+
/** The key a designation is matched and deduplicated by. */
|
|
308
|
+
function designationKey(path) {
|
|
309
|
+
return path.endsWith("/*") ? `${routeKey(path.slice(0, -2))}/*` : routeKey(path);
|
|
310
|
+
}
|
|
311
|
+
/** More specific first: the longer path, then an exact path before its own subtree. */
|
|
312
|
+
function bySpecificity(a, b) {
|
|
313
|
+
const length = (path) => routeKey(path.endsWith("/*") ? path.slice(0, -2) : path).length;
|
|
314
|
+
const subtree = (path) => path.endsWith("/*") ? 1 : 0;
|
|
315
|
+
return length(b.path) - length(a.path) || subtree(a.path) - subtree(b.path);
|
|
316
|
+
}
|
|
317
|
+
function designationCovers(designation, path) {
|
|
318
|
+
const key = routeKey(path);
|
|
319
|
+
if (!designation.endsWith("/*")) return key === routeKey(designation);
|
|
320
|
+
const root = routeKey(designation.slice(0, -2));
|
|
321
|
+
return root === "/" || key === root || key.startsWith(`${root}/`);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Exact paths or an explicit subtree ending in /*, matched without letter
|
|
325
|
+
* case or trailing slashes. The most specific designation wins.
|
|
326
|
+
*/
|
|
297
327
|
function postureRequiredScopes(config, path) {
|
|
298
|
-
const route = [...config.protectedRoutes ?? []].sort(
|
|
328
|
+
const route = [...config.protectedRoutes ?? []].sort(bySpecificity).find((r) => designationCovers(r.path, path));
|
|
299
329
|
if (!route) return void 0;
|
|
300
330
|
if (!route.scopes.length || route.scopes.length > 50 || route.scopes.some((s) => s.length > 200 || !/^[\x21\x23-\x5b\x5d-\x7e]+$/.test(s)) || new Set(route.scopes).size !== route.scopes.length) throw new Error("Integrity-protected routes require explicit, unique scopes");
|
|
301
331
|
return route.scopes;
|
|
@@ -313,8 +343,9 @@ function validateBrowserPostureConfig(config, projectId) {
|
|
|
313
343
|
const paths = /* @__PURE__ */ new Set();
|
|
314
344
|
for (const route of config.protectedRoutes ?? []) {
|
|
315
345
|
if (!/^\/(?:[^?#*\\]*)(?:\/\*)?$/.test(route.path) && route.path !== "/*") throw new Error("Invalid integrity-protected path");
|
|
316
|
-
|
|
317
|
-
paths.
|
|
346
|
+
const key = designationKey(route.path);
|
|
347
|
+
if (paths.has(key)) throw new Error("Duplicate integrity-protected path");
|
|
348
|
+
paths.add(key);
|
|
318
349
|
postureRequiredScopes({
|
|
319
350
|
...config,
|
|
320
351
|
protectedRoutes: [route]
|