@kya-os/checkpoint-nextjs 1.10.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 +245 -0
- package/README.md +205 -31
- package/dist/{adapt.mjs → adapt-BdQ9R7Iw.mjs} +15 -4
- package/dist/adapt-BdQ9R7Iw.mjs.map +1 -0
- package/dist/{adapt.js → adapt-CCSKGjVH.js} +34 -13
- package/dist/api-client-JHOrRUA_.d.mts +222 -0
- package/dist/api-client-JHOrRUA_.d.mts.map +1 -0
- package/dist/api-client-JHOrRUA_.d.ts +222 -0
- package/dist/api-client-JHOrRUA_.d.ts.map +1 -0
- package/dist/api-client.d.mts +2 -204
- package/dist/api-client.d.ts +2 -204
- package/dist/api-client.js +19 -18
- package/dist/api-client.mjs +20 -16
- package/dist/api-client.mjs.map +1 -1
- package/dist/api-middleware-BWjokNis.d.mts +131 -0
- package/dist/api-middleware-BWjokNis.d.mts.map +1 -0
- package/dist/{api-middleware-CDSh3TSE.js → api-middleware-Bf3xmM9W.js} +75 -63
- package/dist/{api-middleware-CMDRoQik.mjs → api-middleware-C-ngFX_8.mjs} +68 -38
- package/dist/api-middleware-C-ngFX_8.mjs.map +1 -0
- package/dist/api-middleware-DyLDqOYF.d.ts +131 -0
- package/dist/api-middleware-DyLDqOYF.d.ts.map +1 -0
- package/dist/api-middleware.d.mts +2 -152
- package/dist/api-middleware.d.ts +2 -152
- package/dist/api-middleware.js +1 -5
- package/dist/api-middleware.mjs +2 -3
- package/dist/cedar-wasm.d.mts +20 -0
- package/dist/cedar-wasm.d.mts.map +1 -0
- package/dist/cedar-wasm.d.ts +19 -0
- package/dist/cedar-wasm.d.ts.map +1 -0
- package/dist/cedar-wasm.js +24 -0
- package/dist/cedar-wasm.mjs +23 -0
- package/dist/cedar-wasm.mjs.map +1 -0
- package/dist/{config-Doe0Tn53.d.mts → config-CPP1RV0f.d.mts} +65 -29
- package/dist/config-CPP1RV0f.d.mts.map +1 -0
- package/dist/{config-CbAg2mze.d.ts → config-DVgOFxJs.d.ts} +66 -30
- package/dist/config-DVgOFxJs.d.ts.map +1 -0
- package/dist/engine-wasm.d.mts +20 -0
- package/dist/engine-wasm.d.mts.map +1 -0
- package/dist/engine-wasm.d.ts +19 -0
- package/dist/engine-wasm.d.ts.map +1 -0
- package/dist/engine-wasm.js +24 -0
- package/dist/engine-wasm.mjs +23 -0
- package/dist/engine-wasm.mjs.map +1 -0
- package/dist/index-edge.d.mts +8 -0
- package/dist/index-edge.d.ts +8 -0
- package/dist/index-edge.js +14 -0
- package/dist/index-edge.mjs +7 -0
- package/dist/index.d.mts +8 -10
- package/dist/index.d.ts +8 -10
- package/dist/index.js +20 -49
- package/dist/index.mjs +21 -8
- package/dist/index.mjs.map +1 -1
- package/dist/middleware-bundler.d.mts +1 -1
- package/dist/middleware-bundler.d.mts.map +1 -1
- package/dist/middleware-bundler.d.ts +1 -1
- package/dist/middleware-bundler.d.ts.map +1 -1
- package/dist/middleware-bundler.js +4 -4
- package/dist/middleware-bundler.mjs +4 -4
- package/dist/middleware-bundler.mjs.map +1 -1
- package/dist/middleware-core-B0jf5_Hm.mjs +264 -0
- package/dist/middleware-core-B0jf5_Hm.mjs.map +1 -0
- package/dist/middleware-core-Bol44X9C.d.ts +17 -0
- package/dist/middleware-core-Bol44X9C.d.ts.map +1 -0
- package/dist/middleware-core-CMc-2QkU.js +274 -0
- package/dist/middleware-core-DycsbHUd.d.mts +17 -0
- package/dist/middleware-core-DycsbHUd.d.mts.map +1 -0
- package/dist/middleware-edge.d.mts +11 -3
- package/dist/middleware-edge.d.mts.map +1 -1
- package/dist/middleware-edge.d.ts +11 -3
- package/dist/middleware-edge.d.ts.map +1 -1
- package/dist/middleware-edge.js +77 -24
- package/dist/middleware-edge.mjs +74 -23
- package/dist/middleware-edge.mjs.map +1 -1
- package/dist/{middleware-node-context-rgnc7UNR.js → middleware-node-context-591KsiYg.js} +8 -7
- package/dist/{middleware-node-context-BqPbf-fI.mjs → middleware-node-context-D_ZyUEcA.mjs} +6 -5
- package/dist/middleware-node-context-D_ZyUEcA.mjs.map +1 -0
- package/dist/middleware-node.d.mts +12 -3
- package/dist/middleware-node.d.mts.map +1 -0
- package/dist/middleware-node.d.ts +12 -3
- package/dist/middleware-node.d.ts.map +1 -0
- package/dist/middleware-node.js +13 -5
- package/dist/middleware-node.mjs +13 -5
- package/dist/middleware-node.mjs.map +1 -1
- package/dist/posture-outcome-Ccujx_9V.d.mts +14 -0
- package/dist/posture-outcome-Ccujx_9V.d.mts.map +1 -0
- package/dist/posture-outcome-Ccujx_9V.d.ts +14 -0
- package/dist/posture-outcome-Ccujx_9V.d.ts.map +1 -0
- package/dist/posture-outcome-DQ4fdMfq.mjs +21 -0
- package/dist/posture-outcome-DQ4fdMfq.mjs.map +1 -0
- package/dist/posture-outcome-DddsJtL8.js +25 -0
- package/dist/public-api-CYsHrTQI.d.ts +5 -0
- package/dist/public-api-DkG7pRE0.d.mts +5 -0
- package/dist/rolldown-runtime-C24Yb2bl.js +33 -0
- package/dist/utils-Cnwg0VrY.mjs +88 -0
- package/dist/utils-Cnwg0VrY.mjs.map +1 -0
- package/dist/utils-dyFxqlFI.js +104 -0
- package/package.json +27 -62
- package/EDGE_RUNTIME_WASM_SETUP.md +0 -342
- package/bin/setup-edge-wasm.js +0 -513
- package/dist/adapt.d.mts +0 -11
- package/dist/adapt.d.mts.map +0 -1
- package/dist/adapt.d.ts +0 -11
- package/dist/adapt.d.ts.map +0 -1
- package/dist/adapt.mjs.map +0 -1
- package/dist/api-client.d.mts.map +0 -1
- package/dist/api-client.d.ts.map +0 -1
- package/dist/api-middleware-CMDRoQik.mjs.map +0 -1
- package/dist/api-middleware.d.mts.map +0 -1
- package/dist/api-middleware.d.ts.map +0 -1
- package/dist/composed-policy-BCaNiVHv.d.mts +0 -98
- package/dist/composed-policy-BCaNiVHv.d.mts.map +0 -1
- package/dist/composed-policy-zzJYNFTb.d.ts +0 -98
- package/dist/composed-policy-zzJYNFTb.d.ts.map +0 -1
- package/dist/composed-policy.d.mts +0 -2
- package/dist/composed-policy.d.ts +0 -2
- package/dist/composed-policy.js +0 -136
- package/dist/composed-policy.mjs +0 -132
- package/dist/composed-policy.mjs.map +0 -1
- package/dist/config-CbAg2mze.d.ts.map +0 -1
- package/dist/config-Doe0Tn53.d.mts.map +0 -1
- package/dist/create-middleware.d.mts +0 -11
- package/dist/create-middleware.d.mts.map +0 -1
- package/dist/create-middleware.d.ts +0 -11
- package/dist/create-middleware.d.ts.map +0 -1
- package/dist/create-middleware.js +0 -39
- package/dist/create-middleware.mjs +0 -38
- package/dist/create-middleware.mjs.map +0 -1
- package/dist/edge/index.d.mts +0 -88
- package/dist/edge/index.d.mts.map +0 -1
- package/dist/edge/index.d.ts +0 -88
- package/dist/edge/index.d.ts.map +0 -1
- package/dist/edge/index.js +0 -362
- package/dist/edge/index.mjs +0 -362
- package/dist/edge/index.mjs.map +0 -1
- package/dist/edge-runtime-loader.d.mts +0 -49
- package/dist/edge-runtime-loader.d.mts.map +0 -1
- package/dist/edge-runtime-loader.d.ts +0 -49
- package/dist/edge-runtime-loader.d.ts.map +0 -1
- package/dist/edge-runtime-loader.js +0 -297
- package/dist/edge-runtime-loader.mjs +0 -292
- package/dist/edge-runtime-loader.mjs.map +0 -1
- package/dist/edge-wasm-middleware.d.mts +0 -43
- package/dist/edge-wasm-middleware.d.mts.map +0 -1
- package/dist/edge-wasm-middleware.d.ts +0 -43
- package/dist/edge-wasm-middleware.d.ts.map +0 -1
- package/dist/edge-wasm-middleware.js +0 -37
- package/dist/edge-wasm-middleware.mjs +0 -35
- package/dist/edge-wasm-middleware.mjs.map +0 -1
- package/dist/middleware-core-BYQP9FND.mjs +0 -165
- package/dist/middleware-core-BYQP9FND.mjs.map +0 -1
- package/dist/middleware-core-D6TijE6P.js +0 -175
- package/dist/middleware-node-CE4GevYs.d.ts +0 -20
- package/dist/middleware-node-CE4GevYs.d.ts.map +0 -1
- package/dist/middleware-node-DtyOuPta.d.mts +0 -20
- package/dist/middleware-node-DtyOuPta.d.mts.map +0 -1
- package/dist/middleware-node-context-BqPbf-fI.mjs.map +0 -1
- package/dist/middleware.d.mts +0 -25
- package/dist/middleware.d.mts.map +0 -1
- package/dist/middleware.d.ts +0 -25
- package/dist/middleware.d.ts.map +0 -1
- package/dist/middleware.js +0 -53
- package/dist/middleware.mjs +0 -51
- package/dist/middleware.mjs.map +0 -1
- package/dist/nodejs-wasm-loader.d.mts +0 -42
- package/dist/nodejs-wasm-loader.d.mts.map +0 -1
- package/dist/nodejs-wasm-loader.d.ts +0 -42
- package/dist/nodejs-wasm-loader.d.ts.map +0 -1
- package/dist/nodejs-wasm-loader.js +0 -70
- package/dist/nodejs-wasm-loader.mjs +0 -66
- package/dist/nodejs-wasm-loader.mjs.map +0 -1
- package/dist/policy.d.mts +0 -138
- package/dist/policy.d.mts.map +0 -1
- package/dist/policy.d.ts +0 -138
- package/dist/policy.d.ts.map +0 -1
- package/dist/policy.js +0 -236
- package/dist/policy.mjs +0 -205
- package/dist/policy.mjs.map +0 -1
- package/dist/session-tracker.d.mts +0 -50
- package/dist/session-tracker.d.mts.map +0 -1
- package/dist/session-tracker.d.ts +0 -50
- package/dist/session-tracker.d.ts.map +0 -1
- package/dist/session-tracker.js +0 -148
- package/dist/session-tracker.mjs +0 -147
- package/dist/session-tracker.mjs.map +0 -1
- package/dist/translate.d.mts +0 -48
- package/dist/translate.d.mts.map +0 -1
- package/dist/translate.d.ts +0 -48
- package/dist/translate.d.ts.map +0 -1
- package/dist/translate.js +0 -79
- package/dist/translate.mjs +0 -79
- package/dist/translate.mjs.map +0 -1
- package/dist/types-C0SkqLMM.d.mts +0 -102
- package/dist/types-C0SkqLMM.d.mts.map +0 -1
- package/dist/types-C7DNSCTO.d.ts +0 -102
- package/dist/types-C7DNSCTO.d.ts.map +0 -1
- package/dist/utils-Cj4XNhIY.mjs +0 -35
- package/dist/utils-Cj4XNhIY.mjs.map +0 -1
- package/dist/utils-DAisnYnI.js +0 -45
- package/dist/wasm-setup.d.mts +0 -47
- package/dist/wasm-setup.d.mts.map +0 -1
- package/dist/wasm-setup.d.ts +0 -47
- package/dist/wasm-setup.d.ts.map +0 -1
- package/dist/wasm-setup.js +0 -91
- package/dist/wasm-setup.mjs +0 -95
- package/dist/wasm-setup.mjs.map +0 -1
- package/wasm/agentshield_wasm.d.ts +0 -479
- package/wasm/agentshield_wasm.js +0 -1536
- package/wasm/agentshield_wasm_bg.wasm +0 -0
- package/wasm/package.json +0 -30
- package/wasm.d.ts +0 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cedar-wasm.mjs","names":[],"sources":["../src/cedar-wasm.ts"],"sourcesContent":["/**\n * The Cedar build's compiled `WebAssembly.Module`: the engine plus the Cedar\n * policy evaluator. Pass it as `withCheckpoint`'s `engineWasmModule` on the\n * Edge runtime, in place of `./engine-wasm`, and one module runs detection and\n * the project's Cedar policy:\n *\n * ```ts\n * import engineWasmModule from '@kya-os/checkpoint-nextjs/cedar-wasm';\n * export default withCheckpoint({ tenantHost, projectId, engineWasmModule });\n * ```\n *\n * Opt-in because it is larger than the engine-only build; a project whose\n * Cedar policy is enforcing needs it on the Edge runtime. Imported through\n * this package, the binary always matches the glue this package loads.\n */\n\nimport compiled from '@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine-cedar-web/kya_os_engine_bg.wasm?module';\n\n// Typed here so the published declaration names no `?module` specifier.\nconst cedarWasmModule: WebAssembly.Module = compiled;\nexport default cedarWasmModule;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,MAAM,kBAAsC"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import { n as ComposedPolicyContext } from "./composed-policy-BCaNiVHv.mjs";
|
|
2
1
|
import { BrowserPostureConfig } from "@kya-os/checkpoint-shared/browser-posture";
|
|
2
|
+
import { ComposedPolicyContext, RequestClaimStore } from "@kya-os/checkpoint-wasm-runtime/composed-policy";
|
|
3
3
|
import { DidResolverAdapter, PolicyEvaluatorAdapter, ReputationOracleAdapter, StatusListCacheAdapter } from "@kya-os/checkpoint-wasm-runtime/adapters";
|
|
4
|
+
import { NextRequest } from "next/server.js";
|
|
4
5
|
import { ChallengeContextFailureEvent, ChallengeEnvelopeMode, ChallengeWireInput, ClientIpTrustPolicy } from "@kya-os/checkpoint-shared";
|
|
5
|
-
import { NextRequest } from "next/server";
|
|
6
6
|
import { EnforcementMode, EngineConfig, VerifyResult } from "@kya-os/checkpoint-wasm-runtime/engine";
|
|
7
7
|
//#region src/config.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* Configuration for `withCheckpoint`.
|
|
10
|
-
*
|
|
11
|
-
* The new minimal shape Phase D's middleware needs. Legacy
|
|
12
|
-
* `AgentShieldMiddlewareConfig` (from `./api-middleware`) remains
|
|
13
|
-
* exported during the deprecation window — see D.4 cutover.
|
|
14
10
|
*/
|
|
15
11
|
interface CheckpointConfig {
|
|
16
12
|
/**
|
|
17
|
-
* Selects the infrastructure allowed to vouch for client
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
13
|
+
* Selects the infrastructure allowed to vouch for observed client addresses.
|
|
14
|
+
* Vercel headers are honored only inside its managed runtime (`VERCEL=1`).
|
|
15
|
+
* NextRequest exposes no socket peer, so generic proxy and Cloudflare origin
|
|
16
|
+
* profiles cannot authenticate that boundary and return no address. Use a
|
|
17
|
+
* transport-aware ingress, such as the Express adapter, for those profiles.
|
|
21
18
|
*/
|
|
22
19
|
clientIpPolicy?: ClientIpTrustPolicy;
|
|
23
20
|
/**
|
|
@@ -48,7 +45,7 @@ interface CheckpointConfig {
|
|
|
48
45
|
*/
|
|
49
46
|
delegationChallengeMode?: ChallengeEnvelopeMode;
|
|
50
47
|
/**
|
|
51
|
-
* Resolve a policy `Challenge
|
|
48
|
+
* Resolve a policy `Challenge`, or a block consent can remedy, into registered wire context.
|
|
52
49
|
* The callback performs any Authorization-Host registration asynchronously;
|
|
53
50
|
* the synchronous engine renderer never fabricates a sid, consent URI, or proof.
|
|
54
51
|
*/
|
|
@@ -71,8 +68,9 @@ interface CheckpointConfig {
|
|
|
71
68
|
*/
|
|
72
69
|
argusUrl?: string;
|
|
73
70
|
/**
|
|
74
|
-
* Dashboard base URL for the
|
|
75
|
-
*
|
|
71
|
+
* Dashboard base URL for the composed policy fetch
|
|
72
|
+
* (`<dashboardUrl>/api/internal/policies/{projectId}`). Takes precedence over
|
|
73
|
+
* `baseUrl`; omit both to use the hosted dashboard.
|
|
76
74
|
*/
|
|
77
75
|
dashboardUrl?: string;
|
|
78
76
|
/**
|
|
@@ -182,8 +180,9 @@ interface CheckpointConfig {
|
|
|
182
180
|
* The reporter is fire-and-forget; enable during development to
|
|
183
181
|
* confirm `apiKey` / `baseUrl` are routed correctly.
|
|
184
182
|
*
|
|
185
|
-
* Also wires the composed-policy shadow-divergence +
|
|
186
|
-
* telemetry
|
|
183
|
+
* Also wires the composed-policy shadow-divergence + evaluation-error
|
|
184
|
+
* telemetry, and pipeline-failure logging (the 503 fail-closed path), to
|
|
185
|
+
* `console.warn`/`console.error` (otherwise silent).
|
|
187
186
|
*
|
|
188
187
|
* @default false
|
|
189
188
|
*/
|
|
@@ -209,6 +208,14 @@ interface CheckpointConfig {
|
|
|
209
208
|
projectId?: string;
|
|
210
209
|
/** Signed browser risk; configure explicit route scopes to enable consent step-up. */
|
|
211
210
|
browserPosture?: BrowserPostureConfig;
|
|
211
|
+
/**
|
|
212
|
+
* Where accepted signed requests are claimed, so each is used once. Defaults
|
|
213
|
+
* to the dashboard's shared ledger when `apiKey` and `projectId` are set,
|
|
214
|
+
* otherwise to a store in this process or isolate (with a one-time warning,
|
|
215
|
+
* since a deployment with several instances needs a shared store). Pass
|
|
216
|
+
* `createLocalRequestClaimStore()` to choose the in-process store explicitly.
|
|
217
|
+
*/
|
|
218
|
+
requestClaimStore?: RequestClaimStore;
|
|
212
219
|
/**
|
|
213
220
|
* Policy-fetch cache TTL in seconds. Defaults to 300 (5 minutes). How long
|
|
214
221
|
* a fetched project policy is reused before the middleware refetches from
|
|
@@ -231,25 +238,54 @@ interface CheckpointConfig {
|
|
|
231
238
|
*/
|
|
232
239
|
composedPolicyEnforcer?: ComposedPolicyContext;
|
|
233
240
|
/**
|
|
234
|
-
* EDGE runtime only. The
|
|
235
|
-
*
|
|
241
|
+
* EDGE runtime only. The Cedar build's `WebAssembly.Module`. Prefer passing
|
|
242
|
+
* it as `engineWasmModule` (see there); this field is kept so existing
|
|
243
|
+
* configs work. Passed alone it serves both roles, detection and policy, on
|
|
244
|
+
* one instance. Passed next to the engine-only build it runs as a second
|
|
245
|
+
* instance, and the Edge bundle carries the engine twice (`debug` logs a
|
|
246
|
+
* hint).
|
|
247
|
+
*
|
|
248
|
+
* Without a Cedar module the project's policy is still fetched and never
|
|
249
|
+
* skipped: with no Cedar policy nothing changes, a policy in shadow mode
|
|
250
|
+
* keeps the structured decision, and an enforcing policy answers every
|
|
251
|
+
* request 503 and logs which module is missing. The Node runtime ignores
|
|
252
|
+
* this field (it loads Cedar through `createPolicyEvaluator`).
|
|
253
|
+
*
|
|
254
|
+
* Added in `@kya-os/checkpoint-nextjs@1.5.0` (@Policy middleware-Cedar, #3076).
|
|
255
|
+
*/
|
|
256
|
+
cedarWasmModule?: WebAssembly.Module;
|
|
257
|
+
/**
|
|
258
|
+
* EDGE runtime only, and required there unless `cedarWasmModule` is set.
|
|
259
|
+
* The module the engine runs on, statically imported by the host:
|
|
236
260
|
*
|
|
237
261
|
* ```ts
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
262
|
+
* // Detection only:
|
|
263
|
+
* import engineWasmModule from '@kya-os/checkpoint-nextjs/engine-wasm';
|
|
264
|
+
* // Detection and the project's Cedar policy, on one module:
|
|
265
|
+
* import engineWasmModule from '@kya-os/checkpoint-nextjs/cedar-wasm';
|
|
266
|
+
*
|
|
267
|
+
* export default withCheckpoint({ tenantHost, projectId, engineWasmModule });
|
|
241
268
|
* ```
|
|
242
269
|
*
|
|
243
|
-
* The
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
* Without it the Edge seam stays inert (behaves exactly as 1.4.0); the Node
|
|
247
|
-
* runtime ignores this field (it loads cedar via `createPolicyEvaluator`).
|
|
270
|
+
* The Cedar build is the engine plus Cedar, so it replaces the engine-only
|
|
271
|
+
* build rather than adding to it; it is larger, which is why it is opt-in.
|
|
272
|
+
* A project whose Cedar policy is enforcing needs it on the Edge runtime.
|
|
248
273
|
*
|
|
249
|
-
*
|
|
274
|
+
* The Edge runtime does not let code compile WebAssembly from bytes, so the
|
|
275
|
+
* engine cannot fetch and compile its own binary there; the bundler has to
|
|
276
|
+
* hand it over as a compiled module. The Node runtime ignores this field.
|
|
250
277
|
*/
|
|
251
|
-
|
|
278
|
+
engineWasmModule?: WebAssembly.Module;
|
|
252
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* `withCheckpoint` configuration for the Edge runtime (`./edge`): the engine
|
|
282
|
+
* needs a module, `engineWasmModule` or, on its own, `cedarWasmModule`.
|
|
283
|
+
*/
|
|
284
|
+
type CheckpointEdgeConfig = CheckpointConfig & ({
|
|
285
|
+
engineWasmModule: WebAssembly.Module;
|
|
286
|
+
} | {
|
|
287
|
+
cedarWasmModule: WebAssembly.Module;
|
|
288
|
+
});
|
|
253
289
|
//#endregion
|
|
254
|
-
export { CheckpointConfig as t };
|
|
255
|
-
//# sourceMappingURL=config-
|
|
290
|
+
export { CheckpointEdgeConfig as n, CheckpointConfig as t };
|
|
291
|
+
//# sourceMappingURL=config-CPP1RV0f.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-CPP1RV0f.d.mts","names":[],"sources":["../src/config.ts"],"mappings":";;;;;;;;;;UAoCiB;;;;;;;;EAQf,iBAAiB;;;;;;EAMjB;;EAEA;;EAEA;;;;;;;EAQA,kBAAkB;;;;;;;;;;EAWlB,0BAA0B;;;;;;EAO1B,8BAA8B;IAC5B,QAAQ;IACR,SAAS;QACL,iCAAiC,QAAQ;;;;;;EAO/C;;EAGA,gCAAgC,OAAO;;;;;;EAOvC;;;;;;EAOA;;;;;;;EAQA;;;;;;;EAQA,WAAW;IACT,aAAa;IACb,iBAAiB;IACjB,kBAAkB;IAClB,iBAAiB;;;;;;;;;EAUnB,YAAY,QAAQ,cAAc,KAAK,uBAAuB;;;;;;;;;;;;;;;;;;;;EAqB9D;;;;;;;;;;;;;;;;;;;EAoBA;;;;;;;;;;;;;;;;EAiBA,eAAe;;;;;;;;;;;;;;EAef;;;;;;EAOA;;;;;;;;;;;;EAaA;;;;;;;;;;;;;;;;;;;EAoBA;;EAEA,iBAAiB;;;;;;;;EAQjB,oBAAoB;;;;;;;;;;;;;;EAepB;;;;;;;EAQA,yBAAyB;;;;;;;;;;;;;;;;;EAkBzB,kBAAkB,YAAY;;;;;;;;;;;;;;;;;;;;;;EAuB9B,mBAAmB,YAAY;;;;;;KAOrB,uBAAuB;EAC9B,kBAAkB,YAAY;;EAAa,iBAAiB,YAAY"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import { n as ComposedPolicyContext } from "./composed-policy-zzJYNFTb.js";
|
|
2
|
-
import { NextRequest } from "next/server";
|
|
3
1
|
import { ChallengeContextFailureEvent, ChallengeEnvelopeMode, ChallengeWireInput, ClientIpTrustPolicy } from "@kya-os/checkpoint-shared";
|
|
4
|
-
import {
|
|
2
|
+
import { NextRequest } from "next/server.js";
|
|
5
3
|
import { BrowserPostureConfig } from "@kya-os/checkpoint-shared/browser-posture";
|
|
4
|
+
import { ComposedPolicyContext, RequestClaimStore } from "@kya-os/checkpoint-wasm-runtime/composed-policy";
|
|
6
5
|
import { DidResolverAdapter, PolicyEvaluatorAdapter, ReputationOracleAdapter, StatusListCacheAdapter } from "@kya-os/checkpoint-wasm-runtime/adapters";
|
|
6
|
+
import { EnforcementMode, EngineConfig, VerifyResult } from "@kya-os/checkpoint-wasm-runtime/engine";
|
|
7
7
|
//#region src/config.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* Configuration for `withCheckpoint`.
|
|
10
|
-
*
|
|
11
|
-
* The new minimal shape Phase D's middleware needs. Legacy
|
|
12
|
-
* `AgentShieldMiddlewareConfig` (from `./api-middleware`) remains
|
|
13
|
-
* exported during the deprecation window — see D.4 cutover.
|
|
14
10
|
*/
|
|
15
11
|
interface CheckpointConfig {
|
|
16
12
|
/**
|
|
17
|
-
* Selects the infrastructure allowed to vouch for client
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
13
|
+
* Selects the infrastructure allowed to vouch for observed client addresses.
|
|
14
|
+
* Vercel headers are honored only inside its managed runtime (`VERCEL=1`).
|
|
15
|
+
* NextRequest exposes no socket peer, so generic proxy and Cloudflare origin
|
|
16
|
+
* profiles cannot authenticate that boundary and return no address. Use a
|
|
17
|
+
* transport-aware ingress, such as the Express adapter, for those profiles.
|
|
21
18
|
*/
|
|
22
19
|
clientIpPolicy?: ClientIpTrustPolicy;
|
|
23
20
|
/**
|
|
@@ -48,7 +45,7 @@ interface CheckpointConfig {
|
|
|
48
45
|
*/
|
|
49
46
|
delegationChallengeMode?: ChallengeEnvelopeMode;
|
|
50
47
|
/**
|
|
51
|
-
* Resolve a policy `Challenge
|
|
48
|
+
* Resolve a policy `Challenge`, or a block consent can remedy, into registered wire context.
|
|
52
49
|
* The callback performs any Authorization-Host registration asynchronously;
|
|
53
50
|
* the synchronous engine renderer never fabricates a sid, consent URI, or proof.
|
|
54
51
|
*/
|
|
@@ -71,8 +68,9 @@ interface CheckpointConfig {
|
|
|
71
68
|
*/
|
|
72
69
|
argusUrl?: string;
|
|
73
70
|
/**
|
|
74
|
-
* Dashboard base URL for the
|
|
75
|
-
*
|
|
71
|
+
* Dashboard base URL for the composed policy fetch
|
|
72
|
+
* (`<dashboardUrl>/api/internal/policies/{projectId}`). Takes precedence over
|
|
73
|
+
* `baseUrl`; omit both to use the hosted dashboard.
|
|
76
74
|
*/
|
|
77
75
|
dashboardUrl?: string;
|
|
78
76
|
/**
|
|
@@ -182,8 +180,9 @@ interface CheckpointConfig {
|
|
|
182
180
|
* The reporter is fire-and-forget; enable during development to
|
|
183
181
|
* confirm `apiKey` / `baseUrl` are routed correctly.
|
|
184
182
|
*
|
|
185
|
-
* Also wires the composed-policy shadow-divergence +
|
|
186
|
-
* telemetry
|
|
183
|
+
* Also wires the composed-policy shadow-divergence + evaluation-error
|
|
184
|
+
* telemetry, and pipeline-failure logging (the 503 fail-closed path), to
|
|
185
|
+
* `console.warn`/`console.error` (otherwise silent).
|
|
187
186
|
*
|
|
188
187
|
* @default false
|
|
189
188
|
*/
|
|
@@ -209,6 +208,14 @@ interface CheckpointConfig {
|
|
|
209
208
|
projectId?: string;
|
|
210
209
|
/** Signed browser risk; configure explicit route scopes to enable consent step-up. */
|
|
211
210
|
browserPosture?: BrowserPostureConfig;
|
|
211
|
+
/**
|
|
212
|
+
* Where accepted signed requests are claimed, so each is used once. Defaults
|
|
213
|
+
* to the dashboard's shared ledger when `apiKey` and `projectId` are set,
|
|
214
|
+
* otherwise to a store in this process or isolate (with a one-time warning,
|
|
215
|
+
* since a deployment with several instances needs a shared store). Pass
|
|
216
|
+
* `createLocalRequestClaimStore()` to choose the in-process store explicitly.
|
|
217
|
+
*/
|
|
218
|
+
requestClaimStore?: RequestClaimStore;
|
|
212
219
|
/**
|
|
213
220
|
* Policy-fetch cache TTL in seconds. Defaults to 300 (5 minutes). How long
|
|
214
221
|
* a fetched project policy is reused before the middleware refetches from
|
|
@@ -231,25 +238,54 @@ interface CheckpointConfig {
|
|
|
231
238
|
*/
|
|
232
239
|
composedPolicyEnforcer?: ComposedPolicyContext;
|
|
233
240
|
/**
|
|
234
|
-
* EDGE runtime only. The
|
|
235
|
-
*
|
|
241
|
+
* EDGE runtime only. The Cedar build's `WebAssembly.Module`. Prefer passing
|
|
242
|
+
* it as `engineWasmModule` (see there); this field is kept so existing
|
|
243
|
+
* configs work. Passed alone it serves both roles, detection and policy, on
|
|
244
|
+
* one instance. Passed next to the engine-only build it runs as a second
|
|
245
|
+
* instance, and the Edge bundle carries the engine twice (`debug` logs a
|
|
246
|
+
* hint).
|
|
247
|
+
*
|
|
248
|
+
* Without a Cedar module the project's policy is still fetched and never
|
|
249
|
+
* skipped: with no Cedar policy nothing changes, a policy in shadow mode
|
|
250
|
+
* keeps the structured decision, and an enforcing policy answers every
|
|
251
|
+
* request 503 and logs which module is missing. The Node runtime ignores
|
|
252
|
+
* this field (it loads Cedar through `createPolicyEvaluator`).
|
|
253
|
+
*
|
|
254
|
+
* Added in `@kya-os/checkpoint-nextjs@1.5.0` (@Policy middleware-Cedar, #3076).
|
|
255
|
+
*/
|
|
256
|
+
cedarWasmModule?: WebAssembly.Module;
|
|
257
|
+
/**
|
|
258
|
+
* EDGE runtime only, and required there unless `cedarWasmModule` is set.
|
|
259
|
+
* The module the engine runs on, statically imported by the host:
|
|
236
260
|
*
|
|
237
261
|
* ```ts
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
262
|
+
* // Detection only:
|
|
263
|
+
* import engineWasmModule from '@kya-os/checkpoint-nextjs/engine-wasm';
|
|
264
|
+
* // Detection and the project's Cedar policy, on one module:
|
|
265
|
+
* import engineWasmModule from '@kya-os/checkpoint-nextjs/cedar-wasm';
|
|
266
|
+
*
|
|
267
|
+
* export default withCheckpoint({ tenantHost, projectId, engineWasmModule });
|
|
241
268
|
* ```
|
|
242
269
|
*
|
|
243
|
-
* The
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
* Without it the Edge seam stays inert (behaves exactly as 1.4.0); the Node
|
|
247
|
-
* runtime ignores this field (it loads cedar via `createPolicyEvaluator`).
|
|
270
|
+
* The Cedar build is the engine plus Cedar, so it replaces the engine-only
|
|
271
|
+
* build rather than adding to it; it is larger, which is why it is opt-in.
|
|
272
|
+
* A project whose Cedar policy is enforcing needs it on the Edge runtime.
|
|
248
273
|
*
|
|
249
|
-
*
|
|
274
|
+
* The Edge runtime does not let code compile WebAssembly from bytes, so the
|
|
275
|
+
* engine cannot fetch and compile its own binary there; the bundler has to
|
|
276
|
+
* hand it over as a compiled module. The Node runtime ignores this field.
|
|
250
277
|
*/
|
|
251
|
-
|
|
278
|
+
engineWasmModule?: WebAssembly.Module;
|
|
252
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* `withCheckpoint` configuration for the Edge runtime (`./edge`): the engine
|
|
282
|
+
* needs a module, `engineWasmModule` or, on its own, `cedarWasmModule`.
|
|
283
|
+
*/
|
|
284
|
+
type CheckpointEdgeConfig = CheckpointConfig & ({
|
|
285
|
+
engineWasmModule: WebAssembly.Module;
|
|
286
|
+
} | {
|
|
287
|
+
cedarWasmModule: WebAssembly.Module;
|
|
288
|
+
});
|
|
253
289
|
//#endregion
|
|
254
|
-
export { CheckpointConfig as t };
|
|
255
|
-
//# sourceMappingURL=config-
|
|
290
|
+
export { CheckpointEdgeConfig as n, CheckpointConfig as t };
|
|
291
|
+
//# sourceMappingURL=config-DVgOFxJs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-DVgOFxJs.d.ts","names":[],"sources":["../src/config.ts"],"mappings":";;;;;;;;;;UAoCiB;;;;;;;;EAQf,iBAAiB;;;;;;EAMjB;;EAEA;;EAEA;;;;;;;EAQA,kBAAkB;;;;;;;;;;EAWlB,0BAA0B;;;;;;EAO1B,8BAA8B;IAC5B,QAAQ;IACR,SAAS;QACL,iCAAiC,QAAQ;;;;;;EAO/C;;EAGA,gCAAgC,OAAO;;;;;;EAOvC;;;;;;EAOA;;;;;;;EAQA;;;;;;;EAQA,WAAW;IACT,aAAa;IACb,iBAAiB;IACjB,kBAAkB;IAClB,iBAAiB;;;;;;;;;EAUnB,YAAY,QAAQ,cAAc,KAAK,uBAAuB;;;;;;;;;;;;;;;;;;;;EAqB9D;;;;;;;;;;;;;;;;;;;EAoBA;;;;;;;;;;;;;;;;EAiBA,eAAe;;;;;;;;;;;;;;EAef;;;;;;EAOA;;;;;;;;;;;;EAaA;;;;;;;;;;;;;;;;;;;EAoBA;;EAEA,iBAAiB;;;;;;;;EAQjB,oBAAoB;;;;;;;;;;;;;;EAepB;;;;;;;EAQA,yBAAyB;;;;;;;;;;;;;;;;;EAkBzB,kBAAkB,YAAY;;;;;;;;;;;;;;;;;;;;;;EAuB9B,mBAAmB,YAAY;;;;;;KAOrB,uBAAuB;EAC9B,kBAAkB,YAAY;;EAAa,iBAAiB,YAAY"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/engine-wasm.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The engine's compiled `WebAssembly.Module`, for `withCheckpoint`'s
|
|
4
|
+
* `engineWasmModule` on the Edge runtime:
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import engineWasmModule from '@kya-os/checkpoint-nextjs/engine-wasm';
|
|
8
|
+
* export default withCheckpoint({ tenantHost, engineWasmModule });
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* `?module` is how Next.js imports a `.wasm` file as a compiled module, which
|
|
12
|
+
* the Edge runtime needs because it does not let code compile WebAssembly from
|
|
13
|
+
* bytes. Importing it through this package keeps the binary the same version
|
|
14
|
+
* as the engine glue this package loads, and works without a direct
|
|
15
|
+
* dependency on `@kya-os/checkpoint-wasm-runtime`.
|
|
16
|
+
*/
|
|
17
|
+
declare const engineWasmModule: WebAssembly.Module;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { engineWasmModule as default };
|
|
20
|
+
//# sourceMappingURL=engine-wasm.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-wasm.d.mts","names":[],"sources":["../src/engine-wasm.ts"],"mappings":";;;;;;;;;;;;;;;;cAmBM,kBAAkB,YAAY"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/engine-wasm.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The engine's compiled `WebAssembly.Module`, for `withCheckpoint`'s
|
|
4
|
+
* `engineWasmModule` on the Edge runtime:
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import engineWasmModule from '@kya-os/checkpoint-nextjs/engine-wasm';
|
|
8
|
+
* export default withCheckpoint({ tenantHost, engineWasmModule });
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* `?module` is how Next.js imports a `.wasm` file as a compiled module, which
|
|
12
|
+
* the Edge runtime needs because it does not let code compile WebAssembly from
|
|
13
|
+
* bytes. Importing it through this package keeps the binary the same version
|
|
14
|
+
* as the engine glue this package loads, and works without a direct
|
|
15
|
+
* dependency on `@kya-os/checkpoint-wasm-runtime`.
|
|
16
|
+
*/
|
|
17
|
+
declare const engineWasmModule: WebAssembly.Module;
|
|
18
|
+
export = engineWasmModule;
|
|
19
|
+
//# sourceMappingURL=engine-wasm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-wasm.d.ts","names":[],"sources":["../src/engine-wasm.ts"],"mappings":";;;;;;;;;;;;;;;;cAmBM,kBAAkB,YAAY"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.js');
|
|
2
|
+
let _kya_os_checkpoint_wasm_runtime_wasm_kya_os_engine_web_kya_os_engine_bg_wasm_module = require("@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine-web/kya_os_engine_bg.wasm?module");
|
|
3
|
+
_kya_os_checkpoint_wasm_runtime_wasm_kya_os_engine_web_kya_os_engine_bg_wasm_module = require_rolldown_runtime.__toESM(_kya_os_checkpoint_wasm_runtime_wasm_kya_os_engine_web_kya_os_engine_bg_wasm_module);
|
|
4
|
+
|
|
5
|
+
//#region src/engine-wasm.ts
|
|
6
|
+
/**
|
|
7
|
+
* The engine's compiled `WebAssembly.Module`, for `withCheckpoint`'s
|
|
8
|
+
* `engineWasmModule` on the Edge runtime:
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import engineWasmModule from '@kya-os/checkpoint-nextjs/engine-wasm';
|
|
12
|
+
* export default withCheckpoint({ tenantHost, engineWasmModule });
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* `?module` is how Next.js imports a `.wasm` file as a compiled module, which
|
|
16
|
+
* the Edge runtime needs because it does not let code compile WebAssembly from
|
|
17
|
+
* bytes. Importing it through this package keeps the binary the same version
|
|
18
|
+
* as the engine glue this package loads, and works without a direct
|
|
19
|
+
* dependency on `@kya-os/checkpoint-wasm-runtime`.
|
|
20
|
+
*/
|
|
21
|
+
const engineWasmModule = _kya_os_checkpoint_wasm_runtime_wasm_kya_os_engine_web_kya_os_engine_bg_wasm_module.default;
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
module.exports = engineWasmModule;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import compiled from "@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine-web/kya_os_engine_bg.wasm?module";
|
|
2
|
+
|
|
3
|
+
//#region src/engine-wasm.ts
|
|
4
|
+
/**
|
|
5
|
+
* The engine's compiled `WebAssembly.Module`, for `withCheckpoint`'s
|
|
6
|
+
* `engineWasmModule` on the Edge runtime:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import engineWasmModule from '@kya-os/checkpoint-nextjs/engine-wasm';
|
|
10
|
+
* export default withCheckpoint({ tenantHost, engineWasmModule });
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* `?module` is how Next.js imports a `.wasm` file as a compiled module, which
|
|
14
|
+
* the Edge runtime needs because it does not let code compile WebAssembly from
|
|
15
|
+
* bytes. Importing it through this package keeps the binary the same version
|
|
16
|
+
* as the engine glue this package loads, and works without a direct
|
|
17
|
+
* dependency on `@kya-os/checkpoint-wasm-runtime`.
|
|
18
|
+
*/
|
|
19
|
+
const engineWasmModule = compiled;
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { engineWasmModule as default };
|
|
23
|
+
//# sourceMappingURL=engine-wasm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-wasm.mjs","names":[],"sources":["../src/engine-wasm.ts"],"sourcesContent":["/**\n * The engine's compiled `WebAssembly.Module`, for `withCheckpoint`'s\n * `engineWasmModule` on the Edge runtime:\n *\n * ```ts\n * import engineWasmModule from '@kya-os/checkpoint-nextjs/engine-wasm';\n * export default withCheckpoint({ tenantHost, engineWasmModule });\n * ```\n *\n * `?module` is how Next.js imports a `.wasm` file as a compiled module, which\n * the Edge runtime needs because it does not let code compile WebAssembly from\n * bytes. Importing it through this package keeps the binary the same version\n * as the engine glue this package loads, and works without a direct\n * dependency on `@kya-os/checkpoint-wasm-runtime`.\n */\n\nimport compiled from '@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine-web/kya_os_engine_bg.wasm?module';\n\n// Typed here so the published declaration names no `?module` specifier.\nconst engineWasmModule: WebAssembly.Module = compiled;\nexport default engineWasmModule;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,MAAM,mBAAuC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { a as EnforceResponse, c as LogDetectionInput, i as EnforceInput, l as getCheckpointApiClient, n as CheckpointApiClient, o as EnforcementAction, r as CheckpointApiClientConfig, s as EnforcementDecision, u as resetCheckpointApiClient } from "./api-client-JHOrRUA_.mjs";
|
|
2
|
+
import { n as withCheckpointApi, t as CheckpointApiMiddlewareConfig } from "./api-middleware-BWjokNis.mjs";
|
|
3
|
+
import { t as CheckpointConfig } from "./config-CPP1RV0f.mjs";
|
|
4
|
+
import { n as CheckpointPostureOutcome, r as getCheckpointPostureOutcome, t as CheckpointPostureOptions } from "./posture-outcome-Ccujx_9V.mjs";
|
|
5
|
+
import { withCheckpoint } from "./middleware-edge.mjs";
|
|
6
|
+
import { t as VERSION } from "./middleware-core-DycsbHUd.mjs";
|
|
7
|
+
import "./public-api-DkG7pRE0.mjs";
|
|
8
|
+
export { CheckpointApiClient, type CheckpointApiClientConfig, type CheckpointApiMiddlewareConfig, type CheckpointConfig, type CheckpointPostureOptions, type CheckpointPostureOutcome, type EnforceInput, type EnforceResponse, type EnforcementAction, type EnforcementDecision, type LogDetectionInput, VERSION, getCheckpointApiClient, getCheckpointPostureOutcome, resetCheckpointApiClient, withCheckpoint, withCheckpointApi };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { a as EnforceResponse, c as LogDetectionInput, i as EnforceInput, l as getCheckpointApiClient, n as CheckpointApiClient, o as EnforcementAction, r as CheckpointApiClientConfig, s as EnforcementDecision, u as resetCheckpointApiClient } from "./api-client-JHOrRUA_.js";
|
|
2
|
+
import { n as withCheckpointApi, t as CheckpointApiMiddlewareConfig } from "./api-middleware-DyLDqOYF.js";
|
|
3
|
+
import { t as CheckpointConfig } from "./config-DVgOFxJs.js";
|
|
4
|
+
import { n as CheckpointPostureOutcome, r as getCheckpointPostureOutcome, t as CheckpointPostureOptions } from "./posture-outcome-Ccujx_9V.js";
|
|
5
|
+
import { withCheckpoint } from "./middleware-edge.js";
|
|
6
|
+
import { t as VERSION } from "./middleware-core-Bol44X9C.js";
|
|
7
|
+
import "./public-api-CYsHrTQI.js";
|
|
8
|
+
export { CheckpointApiClient, type CheckpointApiClientConfig, type CheckpointApiMiddlewareConfig, type CheckpointConfig, type CheckpointPostureOptions, type CheckpointPostureOutcome, type EnforceInput, type EnforceResponse, type EnforcementAction, type EnforcementDecision, type LogDetectionInput, VERSION, getCheckpointApiClient, getCheckpointPostureOutcome, resetCheckpointApiClient, withCheckpoint, withCheckpointApi };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_middleware_core = require('./middleware-core-CMc-2QkU.js');
|
|
3
|
+
const require_posture_outcome = require('./posture-outcome-DddsJtL8.js');
|
|
4
|
+
const require_api_client = require('./api-client.js');
|
|
5
|
+
const require_api_middleware = require('./api-middleware-Bf3xmM9W.js');
|
|
6
|
+
const require_middleware_edge = require('./middleware-edge.js');
|
|
7
|
+
|
|
8
|
+
exports.CheckpointApiClient = require_api_client.CheckpointApiClient;
|
|
9
|
+
exports.VERSION = require_middleware_core.VERSION;
|
|
10
|
+
exports.getCheckpointApiClient = require_api_client.getCheckpointApiClient;
|
|
11
|
+
exports.getCheckpointPostureOutcome = require_posture_outcome.getCheckpointPostureOutcome;
|
|
12
|
+
exports.resetCheckpointApiClient = require_api_client.resetCheckpointApiClient;
|
|
13
|
+
exports.withCheckpoint = require_middleware_edge.withCheckpoint;
|
|
14
|
+
exports.withCheckpointApi = require_api_middleware.withCheckpointApi;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { t as VERSION } from "./middleware-core-B0jf5_Hm.mjs";
|
|
2
|
+
import { t as getCheckpointPostureOutcome } from "./posture-outcome-DQ4fdMfq.mjs";
|
|
3
|
+
import { CheckpointApiClient, getCheckpointApiClient, resetCheckpointApiClient } from "./api-client.mjs";
|
|
4
|
+
import { t as withCheckpointApi } from "./api-middleware-C-ngFX_8.mjs";
|
|
5
|
+
import { withCheckpoint } from "./middleware-edge.mjs";
|
|
6
|
+
|
|
7
|
+
export { CheckpointApiClient, VERSION, getCheckpointApiClient, getCheckpointPostureOutcome, resetCheckpointApiClient, withCheckpoint, withCheckpointApi };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { DEFAULT_POLICY, ENFORCEMENT_ACTIONS, NextJSPolicyMiddlewareConfig, PolicyConfig, PolicyEvaluationContext, PolicyEvaluationResult, PolicyMiddlewareConfig, applyPolicy, buildBlockedResponse, buildRedirectResponse, createContextFromDetection, createEvaluationContext, evaluatePolicy, evaluatePolicyForDetection, getPolicy, handlePolicyDecision } from "./policy.mjs";
|
|
10
|
-
export { type AgentDetectionEvent, type AgentSession, AgentShieldClient, type AgentShieldClientConfig, type AgentShieldMiddlewareConfig, AgentShieldRequest, CheckpointApiClient, type CheckpointApiClientConfig, type CheckpointApiMiddlewareConfig, type CheckpointConfig, DEFAULT_POLICY, DetectionContext, ENFORCEMENT_ACTIONS, EdgeSessionTracker, type EnforceInput, type EnforceResponse, type EnforcementAction, type EnforcementDecision, type EnhancedMiddlewareConfig, type LogDetectionInput, NextJSMiddlewareConfig, type NextJSPolicyMiddlewareConfig, type PolicyConfig, type PolicyEvaluationContext, type PolicyEvaluationResult, type PolicyMiddlewareConfig, type SessionData, type SessionTrackingConfig, StatelessSessionChecker, type StorageAdapter, type StorageConfig, VERSION, agentShieldMiddleware, applyPolicy, buildBlockedResponse as buildPolicyBlockedResponse, buildRedirectResponse as buildPolicyRedirectResponse, createAgentShieldMiddleware, createAgentShieldMiddleware as createMiddleware, createAgentShieldMiddleware$1 as createAgentShieldMiddlewareBase, createContextFromDetection, createEnhancedAgentShieldMiddleware, createEvaluationContext, evaluatePolicy, evaluatePolicyForDetection, getAgentShieldClient, getCheckpointApiClient, getPolicy, handlePolicyDecision, resetAgentShieldClient, resetCheckpointApiClient, withAgentShield, withCheckpoint, withCheckpointApi };
|
|
1
|
+
import { a as EnforceResponse, c as LogDetectionInput, i as EnforceInput, l as getCheckpointApiClient, n as CheckpointApiClient, o as EnforcementAction, r as CheckpointApiClientConfig, s as EnforcementDecision, u as resetCheckpointApiClient } from "./api-client-JHOrRUA_.mjs";
|
|
2
|
+
import { n as withCheckpointApi, t as CheckpointApiMiddlewareConfig } from "./api-middleware-BWjokNis.mjs";
|
|
3
|
+
import { t as CheckpointConfig } from "./config-CPP1RV0f.mjs";
|
|
4
|
+
import { n as CheckpointPostureOutcome, r as getCheckpointPostureOutcome, t as CheckpointPostureOptions } from "./posture-outcome-Ccujx_9V.mjs";
|
|
5
|
+
import { t as VERSION } from "./middleware-core-DycsbHUd.mjs";
|
|
6
|
+
import "./public-api-DkG7pRE0.mjs";
|
|
7
|
+
import { withCheckpoint } from "./middleware-node.mjs";
|
|
8
|
+
export { CheckpointApiClient, type CheckpointApiClientConfig, type CheckpointApiMiddlewareConfig, type CheckpointConfig, type CheckpointPostureOptions, type CheckpointPostureOutcome, type EnforceInput, type EnforceResponse, type EnforcementAction, type EnforcementDecision, type LogDetectionInput, VERSION, getCheckpointApiClient, getCheckpointPostureOutcome, resetCheckpointApiClient, withCheckpoint, withCheckpointApi };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { DEFAULT_POLICY, ENFORCEMENT_ACTIONS, NextJSPolicyMiddlewareConfig, PolicyConfig, PolicyEvaluationContext, PolicyEvaluationResult, PolicyMiddlewareConfig, applyPolicy, buildBlockedResponse, buildRedirectResponse, createContextFromDetection, createEvaluationContext, evaluatePolicy, evaluatePolicyForDetection, getPolicy, handlePolicyDecision } from "./policy.js";
|
|
10
|
-
export { type AgentDetectionEvent, type AgentSession, AgentShieldClient, type AgentShieldClientConfig, type AgentShieldMiddlewareConfig, AgentShieldRequest, CheckpointApiClient, type CheckpointApiClientConfig, type CheckpointApiMiddlewareConfig, type CheckpointConfig, DEFAULT_POLICY, DetectionContext, ENFORCEMENT_ACTIONS, EdgeSessionTracker, type EnforceInput, type EnforceResponse, type EnforcementAction, type EnforcementDecision, type EnhancedMiddlewareConfig, type LogDetectionInput, NextJSMiddlewareConfig, type NextJSPolicyMiddlewareConfig, type PolicyConfig, type PolicyEvaluationContext, type PolicyEvaluationResult, type PolicyMiddlewareConfig, type SessionData, type SessionTrackingConfig, StatelessSessionChecker, type StorageAdapter, type StorageConfig, VERSION, agentShieldMiddleware, applyPolicy, buildBlockedResponse as buildPolicyBlockedResponse, buildRedirectResponse as buildPolicyRedirectResponse, createAgentShieldMiddleware, createAgentShieldMiddleware as createMiddleware, createAgentShieldMiddleware$1 as createAgentShieldMiddlewareBase, createContextFromDetection, createEnhancedAgentShieldMiddleware, createEvaluationContext, evaluatePolicy, evaluatePolicyForDetection, getAgentShieldClient, getCheckpointApiClient, getPolicy, handlePolicyDecision, resetAgentShieldClient, resetCheckpointApiClient, withAgentShield, withCheckpoint, withCheckpointApi };
|
|
1
|
+
import { a as EnforceResponse, c as LogDetectionInput, i as EnforceInput, l as getCheckpointApiClient, n as CheckpointApiClient, o as EnforcementAction, r as CheckpointApiClientConfig, s as EnforcementDecision, u as resetCheckpointApiClient } from "./api-client-JHOrRUA_.js";
|
|
2
|
+
import { n as withCheckpointApi, t as CheckpointApiMiddlewareConfig } from "./api-middleware-DyLDqOYF.js";
|
|
3
|
+
import { t as CheckpointConfig } from "./config-DVgOFxJs.js";
|
|
4
|
+
import { n as CheckpointPostureOutcome, r as getCheckpointPostureOutcome, t as CheckpointPostureOptions } from "./posture-outcome-Ccujx_9V.js";
|
|
5
|
+
import { t as VERSION } from "./middleware-core-Bol44X9C.js";
|
|
6
|
+
import "./public-api-CYsHrTQI.js";
|
|
7
|
+
import { withCheckpoint } from "./middleware-node.js";
|
|
8
|
+
export { CheckpointApiClient, type CheckpointApiClientConfig, type CheckpointApiMiddlewareConfig, type CheckpointConfig, type CheckpointPostureOptions, type CheckpointPostureOutcome, type EnforceInput, type EnforceResponse, type EnforcementAction, type EnforcementDecision, type LogDetectionInput, VERSION, getCheckpointApiClient, getCheckpointPostureOutcome, resetCheckpointApiClient, withCheckpoint, withCheckpointApi };
|
package/dist/index.js
CHANGED
|
@@ -1,66 +1,37 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_middleware_core = require('./middleware-core-
|
|
2
|
+
const require_middleware_core = require('./middleware-core-CMc-2QkU.js');
|
|
3
3
|
const require_middleware_node = require('./middleware-node.js');
|
|
4
|
-
const
|
|
5
|
-
const require_create_middleware = require('./create-middleware.js');
|
|
4
|
+
const require_posture_outcome = require('./posture-outcome-DddsJtL8.js');
|
|
6
5
|
const require_api_client = require('./api-client.js');
|
|
7
|
-
const require_api_middleware = require('./api-middleware-
|
|
8
|
-
const require_session_tracker = require('./session-tracker.js');
|
|
9
|
-
const require_policy = require('./policy.js');
|
|
10
|
-
let _kya_os_checkpoint_shared = require("@kya-os/checkpoint-shared");
|
|
6
|
+
const require_api_middleware = require('./api-middleware-Bf3xmM9W.js');
|
|
11
7
|
|
|
12
8
|
//#region src/index.ts
|
|
13
9
|
/**
|
|
14
10
|
* @fileoverview Checkpoint Next.js Integration
|
|
15
11
|
* @license MIT OR Apache-2.0
|
|
12
|
+
*
|
|
13
|
+
* Two deployment shapes ship from this package:
|
|
14
|
+
*
|
|
15
|
+
* 1. `withCheckpoint` runs `kya-os-engine` in-process through WebAssembly:
|
|
16
|
+
* no network round trip per request, and every verdict comes from the
|
|
17
|
+
* engine.
|
|
18
|
+
* 2. `withCheckpointApi` sends each request to the hosted gateway instead. It
|
|
19
|
+
* is opt-in, for runtimes that cannot run WebAssembly.
|
|
20
|
+
*
|
|
21
|
+
* This is the `.` entry outside the Edge runtime, the same as `./node`: the
|
|
22
|
+
* engine's Node build, which loads its `.wasm` through `new URL(...,
|
|
23
|
+
* import.meta.url)`, so it works unbundled and when Next.js bundles `proxy.ts`
|
|
24
|
+
* or `middleware.ts` (the bundler copies the file it names). `index-edge.ts` is
|
|
25
|
+
* the `.` entry on the Edge runtime.
|
|
26
|
+
*
|
|
27
|
+
* See `README.md` ("Two deployment shapes").
|
|
16
28
|
*/
|
|
17
29
|
|
|
18
30
|
//#endregion
|
|
19
|
-
exports.AgentShieldClient = require_api_client.AgentShieldClient;
|
|
20
31
|
exports.CheckpointApiClient = require_api_client.CheckpointApiClient;
|
|
21
|
-
Object.defineProperty(exports, 'DEFAULT_POLICY', {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _kya_os_checkpoint_shared.DEFAULT_POLICY;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
Object.defineProperty(exports, 'ENFORCEMENT_ACTIONS', {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () {
|
|
30
|
-
return _kya_os_checkpoint_shared.ENFORCEMENT_ACTIONS;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
exports.EdgeSessionTracker = require_session_tracker.EdgeSessionTracker;
|
|
34
|
-
exports.StatelessSessionChecker = require_session_tracker.StatelessSessionChecker;
|
|
35
32
|
exports.VERSION = require_middleware_core.VERSION;
|
|
36
|
-
exports.agentShieldMiddleware = require_api_middleware.agentShieldMiddleware;
|
|
37
|
-
exports.applyPolicy = require_policy.applyPolicy;
|
|
38
|
-
exports.buildPolicyBlockedResponse = require_policy.buildBlockedResponse;
|
|
39
|
-
exports.buildPolicyRedirectResponse = require_policy.buildRedirectResponse;
|
|
40
|
-
exports.createAgentShieldMiddleware = require_create_middleware.createAgentShieldMiddleware;
|
|
41
|
-
exports.createAgentShieldMiddlewareBase = require_middleware.createAgentShieldMiddleware;
|
|
42
|
-
exports.createContextFromDetection = require_policy.createContextFromDetection;
|
|
43
|
-
exports.createEnhancedAgentShieldMiddleware = require_api_middleware.createEnhancedAgentShieldMiddleware;
|
|
44
|
-
Object.defineProperty(exports, 'createEvaluationContext', {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
get: function () {
|
|
47
|
-
return _kya_os_checkpoint_shared.createEvaluationContext;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
exports.createMiddleware = require_create_middleware.createAgentShieldMiddleware;
|
|
51
|
-
Object.defineProperty(exports, 'evaluatePolicy', {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function () {
|
|
54
|
-
return _kya_os_checkpoint_shared.evaluatePolicy;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
exports.evaluatePolicyForDetection = require_policy.evaluatePolicyForDetection;
|
|
58
|
-
exports.getAgentShieldClient = require_api_client.getAgentShieldClient;
|
|
59
33
|
exports.getCheckpointApiClient = require_api_client.getCheckpointApiClient;
|
|
60
|
-
exports.
|
|
61
|
-
exports.handlePolicyDecision = require_policy.handlePolicyDecision;
|
|
62
|
-
exports.resetAgentShieldClient = require_api_client.resetAgentShieldClient;
|
|
34
|
+
exports.getCheckpointPostureOutcome = require_posture_outcome.getCheckpointPostureOutcome;
|
|
63
35
|
exports.resetCheckpointApiClient = require_api_client.resetCheckpointApiClient;
|
|
64
|
-
exports.withAgentShield = require_api_middleware.withAgentShield;
|
|
65
36
|
exports.withCheckpoint = require_middleware_node.withCheckpoint;
|
|
66
37
|
exports.withCheckpointApi = require_api_middleware.withCheckpointApi;
|