@kya-os/checkpoint-shared 1.4.0 → 1.5.1
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 +41 -0
- package/dist/beacon-types/index.d.mts +448 -432
- package/dist/beacon-types/index.d.mts.map +1 -0
- package/dist/beacon-types/index.d.ts +448 -432
- package/dist/beacon-types/index.d.ts.map +1 -0
- package/dist/beacon-types/index.js +286 -182
- package/dist/beacon-types/index.mjs +284 -180
- package/dist/beacon-types/index.mjs.map +1 -0
- package/dist/browser-posture-cookie-Dmq9Brf_.d.mts +5 -0
- package/dist/browser-posture-cookie-Dmq9Brf_.d.mts.map +1 -0
- package/dist/browser-posture-cookie-Dmq9Brf_.d.ts +5 -0
- package/dist/browser-posture-cookie-Dmq9Brf_.d.ts.map +1 -0
- package/dist/browser-posture-cookie.d.mts +2 -0
- package/dist/browser-posture-cookie.d.ts +2 -0
- package/dist/browser-posture-cookie.js +1 -0
- package/dist/browser-posture-cookie.mjs +2 -0
- package/dist/browser-posture-cookie.mjs.map +1 -0
- package/dist/browser-posture-report.d.mts +48 -44
- package/dist/browser-posture-report.d.mts.map +1 -0
- package/dist/browser-posture-report.d.ts +48 -44
- package/dist/browser-posture-report.d.ts.map +1 -0
- package/dist/browser-posture-report.js +1 -1
- package/dist/browser-posture-report.mjs +2 -1
- package/dist/browser-posture-report.mjs.map +1 -0
- package/dist/browser-posture.d.mts +82 -75
- package/dist/browser-posture.d.mts.map +1 -0
- package/dist/browser-posture.d.ts +82 -75
- package/dist/browser-posture.d.ts.map +1 -0
- package/dist/browser-posture.js +167 -18993
- package/dist/browser-posture.mjs +166 -18990
- package/dist/browser-posture.mjs.map +1 -0
- package/dist/browser.d.mts +323 -316
- package/dist/browser.d.mts.map +1 -0
- package/dist/browser.d.ts +323 -316
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +1 -1
- package/dist/browser.mjs +2 -1
- package/dist/browser.mjs.map +1 -0
- package/dist/canonical-signer/index.d.mts +38 -33
- package/dist/canonical-signer/index.d.mts.map +1 -0
- package/dist/canonical-signer/index.d.ts +38 -33
- package/dist/canonical-signer/index.d.ts.map +1 -0
- package/dist/canonical-signer/index.js +411 -181
- package/dist/canonical-signer/index.mjs +383 -175
- package/dist/canonical-signer/index.mjs.map +1 -0
- package/dist/clearance.d.mts +30 -0
- package/dist/clearance.d.mts.map +1 -0
- package/dist/clearance.d.ts +30 -0
- package/dist/clearance.d.ts.map +1 -0
- package/dist/clearance.js +120 -0
- package/dist/clearance.mjs +112 -0
- package/dist/clearance.mjs.map +1 -0
- package/dist/client-ip-1y2iXAYW.js +237 -0
- package/dist/client-ip-HOfe6ucV.mjs +215 -0
- package/dist/client-ip-HOfe6ucV.mjs.map +1 -0
- package/dist/deploy/index.d.mts +339 -339
- package/dist/deploy/index.d.mts.map +1 -0
- package/dist/deploy/index.d.ts +339 -339
- package/dist/deploy/index.d.ts.map +1 -0
- package/dist/deploy/index.js +505 -413
- package/dist/deploy/index.mjs +504 -410
- package/dist/deploy/index.mjs.map +1 -0
- package/dist/errors/index.d.mts +101 -101
- package/dist/errors/index.d.mts.map +1 -0
- package/dist/errors/index.d.ts +101 -101
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +341 -314
- package/dist/errors/index.mjs +340 -311
- package/dist/errors/index.mjs.map +1 -0
- package/dist/external-jr_S4iSS.d.mts +4187 -0
- package/dist/external-jr_S4iSS.d.mts.map +1 -0
- package/dist/external-jr_S4iSS.d.ts +4187 -0
- package/dist/external-jr_S4iSS.d.ts.map +1 -0
- package/dist/gateway/index.d.mts +138 -132
- package/dist/gateway/index.d.mts.map +1 -0
- package/dist/gateway/index.d.ts +138 -132
- package/dist/gateway/index.d.ts.map +1 -0
- package/dist/gateway/index.js +117 -81
- package/dist/gateway/index.mjs +116 -78
- package/dist/gateway/index.mjs.map +1 -0
- package/dist/gateway-client-ip.d.mts +59 -0
- package/dist/gateway-client-ip.d.mts.map +1 -0
- package/dist/gateway-client-ip.d.ts +59 -0
- package/dist/gateway-client-ip.d.ts.map +1 -0
- package/dist/gateway-client-ip.js +149 -0
- package/dist/gateway-client-ip.mjs +139 -0
- package/dist/gateway-client-ip.mjs.map +1 -0
- package/dist/index.d.mts +14901 -14246
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +14901 -14246
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15180 -31025
- package/dist/index.mjs +15065 -30942
- package/dist/index.mjs.map +1 -0
- package/dist/mcpi/agentshield-api/index.d.mts +45 -44
- package/dist/mcpi/agentshield-api/index.d.mts.map +1 -0
- package/dist/mcpi/agentshield-api/index.d.ts +45 -44
- package/dist/mcpi/agentshield-api/index.d.ts.map +1 -0
- package/dist/mcpi/agentshield-api/index.js +0 -2
- package/dist/mcpi/agentshield-api/index.mjs +1 -1
- package/dist/mcpi/approval-grant/index.d.mts +63 -61
- package/dist/mcpi/approval-grant/index.d.mts.map +1 -0
- package/dist/mcpi/approval-grant/index.d.ts +63 -61
- package/dist/mcpi/approval-grant/index.d.ts.map +1 -0
- package/dist/mcpi/approval-grant/index.js +220 -140
- package/dist/mcpi/approval-grant/index.mjs +219 -137
- package/dist/mcpi/approval-grant/index.mjs.map +1 -0
- package/dist/mcpi/dashboard-config/index.d.mts +2323 -2318
- package/dist/mcpi/dashboard-config/index.d.mts.map +1 -0
- package/dist/mcpi/dashboard-config/index.d.ts +2323 -2318
- package/dist/mcpi/dashboard-config/index.d.ts.map +1 -0
- package/dist/mcpi/dashboard-config/index.js +605 -458
- package/dist/mcpi/dashboard-config/index.mjs +604 -455
- package/dist/mcpi/dashboard-config/index.mjs.map +1 -0
- package/dist/mcpi/multibase-ed25519.d.mts +10 -8
- package/dist/mcpi/multibase-ed25519.d.mts.map +1 -0
- package/dist/mcpi/multibase-ed25519.d.ts +10 -8
- package/dist/mcpi/multibase-ed25519.d.ts.map +1 -0
- package/dist/mcpi/multibase-ed25519.js +182 -106
- package/dist/mcpi/multibase-ed25519.mjs +181 -103
- package/dist/mcpi/multibase-ed25519.mjs.map +1 -0
- package/dist/patterns-CkRVOdtV.js +243 -0
- package/dist/patterns-DzkGy_qk.mjs +173 -0
- package/dist/patterns-DzkGy_qk.mjs.map +1 -0
- package/dist/project-verification-key-C3L5rd8a.js +41 -0
- package/dist/project-verification-key-CgSVX9_m.mjs +37 -0
- package/dist/project-verification-key-CgSVX9_m.mjs.map +1 -0
- package/dist/rolldown-runtime-iY2fYEqi.mjs +19 -0
- package/dist/schemas-BmjNLAE7.js +5677 -0
- package/dist/schemas-DxY-dk9y.mjs +5511 -0
- package/dist/schemas-DxY-dk9y.mjs.map +1 -0
- package/dist/signals/index.d.mts +125 -115
- package/dist/signals/index.d.mts.map +1 -0
- package/dist/signals/index.d.ts +125 -115
- package/dist/signals/index.d.ts.map +1 -0
- package/dist/signals/index.js +1693 -1536
- package/dist/signals/index.mjs +1692 -1533
- package/dist/signals/index.mjs.map +1 -0
- package/dist/test-fixtures/index.d.mts +124 -119
- package/dist/test-fixtures/index.d.mts.map +1 -0
- package/dist/test-fixtures/index.d.ts +124 -119
- package/dist/test-fixtures/index.d.ts.map +1 -0
- package/dist/test-fixtures/index.js +460 -228
- package/dist/test-fixtures/index.mjs +459 -225
- package/dist/test-fixtures/index.mjs.map +1 -0
- package/dist/tool-protection/index.d.mts +343 -343
- package/dist/tool-protection/index.d.mts.map +1 -0
- package/dist/tool-protection/index.d.ts +343 -343
- package/dist/tool-protection/index.d.ts.map +1 -0
- package/dist/tool-protection/index.js +366 -285
- package/dist/tool-protection/index.mjs +365 -282
- package/dist/tool-protection/index.mjs.map +1 -0
- package/fixtures/bot-signal-resolution.json +142 -0
- package/fixtures/browser-posture-claims.json +421 -0
- package/fixtures/browser-posture-headers.json +46 -0
- package/fixtures/detection/reason-codes.json +10 -1
- package/fixtures/kya-http/challenge.delegation.fetcher-200.json +9 -3
- package/fixtures/kya-http/challenge.delegation.full.json +9 -3
- package/fixtures/kya-http/challenge.delegation.minimal.json +9 -3
- package/fixtures/kya-http/error-codes.json +7 -2
- package/package.json +20 -6
|
@@ -1,78 +1,85 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
import { C as ZodObject, O as ZodString, P as output, R as $strip, S as ZodNumber, b as ZodLiteral, g as ZodGUID, h as ZodEnum, l as ZodArray, p as ZodDefault, t as external_d_exports, u as ZodBoolean, x as ZodNullable } from "./external-jr_S4iSS.js";
|
|
2
|
+
import { JWK, JWK as JWK$1 } from "jose";
|
|
3
|
+
//#region src/browser-posture-cookie.d.ts
|
|
4
|
+
export declare function postureCookieName(projectId: string): string;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/beacon-types/index.d.ts
|
|
7
|
+
export declare const POSTURE_TTL_SECONDS = 120;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/browser-posture-report.d.ts
|
|
10
|
+
export declare const BrowserPostureReportSchema: ZodObject<{
|
|
11
|
+
projectId: ZodString;
|
|
12
|
+
sessionId: ZodGUID;
|
|
13
|
+
verdict: ZodEnum<{
|
|
14
|
+
"agent-driven": "agent-driven";
|
|
15
|
+
human: "human";
|
|
16
|
+
insufficient: "insufficient";
|
|
17
|
+
}>;
|
|
18
|
+
score: ZodNullable<ZodNumber>;
|
|
19
|
+
scorerVersion: ZodNumber;
|
|
20
|
+
reasons: ZodArray<ZodString>;
|
|
21
|
+
issuedAt: ZodNumber;
|
|
22
|
+
expiresAt: ZodNumber;
|
|
23
|
+
source: ZodLiteral<"verified-posture">;
|
|
24
|
+
}, $strip>;
|
|
25
|
+
export declare function browserPostureReport(posture: BrowserPosture): {
|
|
26
|
+
projectId: string;
|
|
27
|
+
sessionId: string;
|
|
28
|
+
verdict: "agent-driven" | "human" | "insufficient";
|
|
29
|
+
score: number | null;
|
|
30
|
+
scorerVersion: number;
|
|
31
|
+
reasons: string[];
|
|
32
|
+
issuedAt: number;
|
|
33
|
+
expiresAt: number;
|
|
34
|
+
source: "verified-posture";
|
|
30
35
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/browser-posture.d.ts
|
|
38
|
+
export declare const UNSIGNED_BROWSER_AGENT: {
|
|
39
|
+
readonly agentType: "Browser agent (unsigned)";
|
|
40
|
+
readonly detectionClass: "ai_agent";
|
|
41
|
+
readonly verificationMethod: "behavioral";
|
|
36
42
|
};
|
|
37
|
-
declare const behavioralConfidence: (score: number | null) => number;
|
|
38
|
-
declare const
|
|
39
|
-
declare const
|
|
40
|
-
declare const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
43
|
+
export declare const behavioralConfidence: (score: number | null) => number;
|
|
44
|
+
export declare const POSTURE_ISSUER = "checkpoint:browser-posture:v1";
|
|
45
|
+
export declare const POSTURE_TYPE = "checkpoint-posture+jwt";
|
|
46
|
+
export declare const BrowserPostureSchema: ZodObject<{
|
|
47
|
+
v: ZodLiteral<1>;
|
|
48
|
+
project_id: ZodString;
|
|
49
|
+
origin: ZodString;
|
|
50
|
+
session_id: ZodGUID;
|
|
51
|
+
binding: ZodString;
|
|
52
|
+
verdict: ZodEnum<{
|
|
53
|
+
"agent-driven": "agent-driven";
|
|
54
|
+
human: "human";
|
|
55
|
+
insufficient: "insufficient";
|
|
56
|
+
}>;
|
|
57
|
+
score: ZodNullable<ZodNumber>;
|
|
58
|
+
scorer_version: ZodNumber;
|
|
59
|
+
reasons: ZodArray<ZodString>;
|
|
60
|
+
automation_disclosed: ZodDefault<ZodBoolean>;
|
|
61
|
+
automation_corroborated: ZodDefault<ZodBoolean>;
|
|
62
|
+
iat: ZodNumber;
|
|
63
|
+
exp: ZodNumber;
|
|
64
|
+
}, $strip>;
|
|
65
|
+
export type BrowserPosture = output<typeof BrowserPostureSchema>;
|
|
66
|
+
export interface BrowserPostureConfig {
|
|
67
|
+
publicKey: JWK$1;
|
|
68
|
+
keyId: string;
|
|
69
|
+
origin: string;
|
|
70
|
+
sessionCookieName?: string;
|
|
71
|
+
protectedRoutes?: Array<{
|
|
72
|
+
path: string;
|
|
73
|
+
scopes: string[];
|
|
74
|
+
}>;
|
|
68
75
|
}
|
|
69
|
-
declare function
|
|
70
|
-
declare function
|
|
71
|
-
declare function
|
|
72
|
-
declare function
|
|
73
|
-
declare function
|
|
74
|
-
declare function
|
|
75
|
-
declare function
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
export declare function readPostureCookie(header: string | null | undefined, name: string): string | undefined;
|
|
77
|
+
export declare function postureSessionBinding(sessionId: string): Promise<string>;
|
|
78
|
+
export declare function signBrowserPosture(posture: BrowserPosture, privateKey: JWK$1, keyId: string): Promise<string>;
|
|
79
|
+
export declare function verifyBrowserPosture(token: string | undefined, config: BrowserPostureConfig, projectId: string, browserSessionId: string | undefined, now?: number): Promise<BrowserPosture | undefined>;
|
|
80
|
+
export declare function postureFromCookies(header: string | null | undefined, config: BrowserPostureConfig, projectId: string): Promise<BrowserPosture | undefined>;
|
|
81
|
+
export declare function postureRequiredScopes(config: BrowserPostureConfig, path: string): string[] | undefined;
|
|
82
|
+
export declare function validateBrowserPostureConfig(config: BrowserPostureConfig, projectId: string | undefined): void;
|
|
83
|
+
//#endregion
|
|
84
|
+
export type { JWK };
|
|
85
|
+
//# sourceMappingURL=browser-posture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-posture.d.ts","names":[],"sources":["../src/browser-posture-cookie.ts","../src/beacon-types/index.ts","../src/browser-posture-report.ts","../src/browser-posture.ts"],"mappings":";;;wBAgBgB,kBAAkB;;;qBC+8CrB;;;qBC39CA,4BAA0B;;;;;;;;;;;;;;GAWrC;wBACc,qBAAqB,SAAS;;;;;;;;;;;;;qBCPjC;;;;;qBAKA,uBAAwB;qBAGxB;qBAGA;qBAEA,sBAAoB;;;;;;;;;;;;;;;;;;GAoB/B;YAGU,iBAAiB,cAAe;iBAC3B;EAEf,WAAW;EACX;EAEA;EACA;EAEA,kBAAkB;IAAQ;IAAc;;;wBAI1B,kBACd,mCACA;wBAcoB,sBAAsB,oBAAoB;wBAc1C,mBACpB,SAAS,gBACT,YAAY,OACZ,gBACC;wBAqBmB,qBACpB,2BACA,QAAQ,sBACR,mBACA,sCACA,eACC,QAAQ;wBAgDW,mBACpB,mCACA,QAAQ,sBACR,oBACC,QAAQ;wBAUK,sBACd,QAAQ,sBACR;wBAmBc,6BACd,QAAQ,sBACR"}
|