@kya-os/checkpoint-nextjs 1.7.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/EDGE_RUNTIME_WASM_SETUP.md +12 -12
- package/README.md +144 -251
- package/bin/setup-edge-wasm.js +10 -2
- package/dist/adapt.js +9 -6
- package/dist/adapt.mjs +9 -6
- package/dist/api-client.d.mts +9 -0
- package/dist/api-client.d.ts +9 -0
- package/dist/api-middleware.d.mts +12 -2
- package/dist/api-middleware.d.ts +12 -2
- package/dist/api-middleware.js +28 -31
- package/dist/api-middleware.mjs +29 -32
- package/dist/composed-policy.d.mts +7 -0
- package/dist/composed-policy.d.ts +7 -0
- package/dist/composed-policy.js +14 -2
- package/dist/composed-policy.mjs +15 -3
- package/dist/{config-_nfPN3E3.d.mts → config-CleTeeoW.d.mts} +39 -11
- package/dist/{config-kxFihzR_.d.ts → config-XMOIkxFN.d.ts} +39 -11
- package/dist/create-middleware.d.mts +1 -1
- package/dist/create-middleware.d.ts +1 -1
- package/dist/edge/index.d.mts +3 -1
- package/dist/edge/index.d.ts +3 -1
- package/dist/edge/index.js +5 -16
- package/dist/edge/index.mjs +5 -16
- package/dist/edge-runtime-loader.d.mts +3 -1
- package/dist/edge-runtime-loader.d.ts +3 -1
- package/dist/edge-runtime-loader.js +4 -16
- package/dist/edge-runtime-loader.mjs +5 -17
- package/dist/edge-wasm-middleware.d.mts +1 -1
- package/dist/edge-wasm-middleware.d.ts +1 -1
- package/dist/edge-wasm-middleware.js +1 -1
- package/dist/edge-wasm-middleware.mjs +1 -1
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +151 -84
- package/dist/index.mjs +153 -86
- package/dist/middleware-bundler.d.mts +13 -0
- package/dist/middleware-bundler.d.ts +13 -0
- package/dist/middleware-bundler.js +354 -0
- package/dist/middleware-bundler.mjs +352 -0
- package/dist/middleware-edge.d.mts +5 -41
- package/dist/middleware-edge.d.ts +5 -41
- package/dist/middleware-edge.js +161 -97
- package/dist/middleware-edge.mjs +164 -100
- package/dist/middleware-node.d.mts +16 -52
- package/dist/middleware-node.d.ts +16 -52
- package/dist/middleware-node.js +115 -56
- package/dist/middleware-node.mjs +118 -55
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/policy.js +6 -1
- package/dist/policy.mjs +6 -1
- package/dist/session-tracker.js +2 -0
- package/dist/session-tracker.mjs +2 -0
- package/dist/translate.d.mts +7 -4
- package/dist/translate.d.ts +7 -4
- package/dist/translate.js +9 -8
- package/dist/translate.mjs +9 -8
- package/dist/{types-D9RQvPNy.d.mts → types-Chgi5TFC.d.mts} +2 -2
- package/dist/{types-D9RQvPNy.d.ts → types-Chgi5TFC.d.ts} +2 -2
- package/package.json +17 -10
- package/dist/signature-verifier.d.mts +0 -33
- package/dist/signature-verifier.d.ts +0 -33
- package/dist/signature-verifier.js +0 -384
- package/dist/signature-verifier.mjs +0 -360
|
@@ -1,16 +1,10 @@
|
|
|
1
|
+
import { BrowserPostureConfig } from '@kya-os/checkpoint-shared/browser-posture';
|
|
1
2
|
import { NextRequest } from 'next/server';
|
|
2
3
|
import { DidResolverAdapter, StatusListCacheAdapter, ReputationOracleAdapter, PolicyEvaluatorAdapter } from '@kya-os/checkpoint-wasm-runtime/adapters';
|
|
3
4
|
import { EnforcementMode, VerifyResult, EngineConfig } from '@kya-os/checkpoint-wasm-runtime/engine';
|
|
5
|
+
import { ClientIpTrustPolicy, ChallengeEnvelopeMode, ChallengeWireInput, ChallengeContextFailureEvent } from '@kya-os/checkpoint-shared';
|
|
4
6
|
import { ComposedPolicyContext } from './composed-policy.js';
|
|
5
7
|
|
|
6
|
-
/**
|
|
7
|
-
* `CheckpointConfig` — the `withCheckpoint` config contract for both the Node
|
|
8
|
-
* (`./node`) and Edge (`./edge`) middleware entries. Extracted from
|
|
9
|
-
* `middleware-node.ts` (a 190-line documented contract); both entries import it
|
|
10
|
-
* from here and re-export it so the public import paths
|
|
11
|
-
* (`@kya-os/checkpoint-nextjs`, `/node`, `/edge`) are unchanged.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
8
|
/**
|
|
15
9
|
* Configuration for `withCheckpoint`.
|
|
16
10
|
*
|
|
@@ -19,17 +13,49 @@ import { ComposedPolicyContext } from './composed-policy.js';
|
|
|
19
13
|
* exported during the deprecation window — see D.4 cutover.
|
|
20
14
|
*/
|
|
21
15
|
interface CheckpointConfig {
|
|
16
|
+
/**
|
|
17
|
+
* Selects the infrastructure allowed to vouch for client IP headers.
|
|
18
|
+
* Defaults to direct peer/framework resolution; set `platform: 'vercel'`
|
|
19
|
+
* for Vercel-hosted requests or `platform: 'trusted-proxy'` with an
|
|
20
|
+
* explicit hop count for a configured proxy chain.
|
|
21
|
+
*/
|
|
22
|
+
clientIpPolicy?: ClientIpTrustPolicy;
|
|
22
23
|
/**
|
|
23
24
|
* Tenant identifier — typically the customer's dashboard hostname
|
|
24
25
|
* (e.g. `acme.checkpoint.example`). The PolicyEvaluator uses this
|
|
25
26
|
* to look up tenant policy from the dashboard.
|
|
26
27
|
*/
|
|
27
28
|
tenantHost: string;
|
|
29
|
+
/** Exact org DID used to verify the consent credential's audience. */
|
|
30
|
+
resourceOrgDid?: string;
|
|
31
|
+
/** Explicit trusted delegation issuers; otherwise resolved from project policy. */
|
|
32
|
+
trustedDelegationRoots?: string[];
|
|
28
33
|
/**
|
|
29
34
|
* `'enforce'` (default) blocks; `'observe'` passes everything
|
|
30
35
|
* through with `X-Checkpoint-Would-Have-Been` headers. Per Phase 0.2.
|
|
31
36
|
*/
|
|
32
37
|
enforcementMode?: EnforcementMode;
|
|
38
|
+
/**
|
|
39
|
+
* Challenge-emission envelope mode (draft-kya-http-02 §8.1 fetcher-200).
|
|
40
|
+
* `negotiated` serves a body-readable HTTP 200 step-up response to
|
|
41
|
+
* cooperative agents (fetchers that drop 4xx/5xx bodies), keeping the spec
|
|
42
|
+
* 401/422 for everyone else. Defaults to `negotiated` (#3530). A cooperative-UX
|
|
43
|
+
* bridge, NOT an access control.
|
|
44
|
+
*/
|
|
45
|
+
delegationChallengeMode?: ChallengeEnvelopeMode;
|
|
46
|
+
/**
|
|
47
|
+
* Resolve a policy `Challenge` into complete registered wire context.
|
|
48
|
+
* The callback performs any Authorization-Host registration asynchronously;
|
|
49
|
+
* the synchronous engine renderer never fabricates a sid, consent URI, or proof.
|
|
50
|
+
*/
|
|
51
|
+
resolveDelegationChallenge?: (context: {
|
|
52
|
+
result: VerifyResult;
|
|
53
|
+
request: NextRequest;
|
|
54
|
+
}) => ChallengeWireInput | undefined | Promise<ChallengeWireInput | undefined>;
|
|
55
|
+
/** Registration/resolution budget. Defaults to 3000 milliseconds. */
|
|
56
|
+
delegationChallengeTimeoutMs?: number;
|
|
57
|
+
/** Sanitized registration failure hook for metrics and operator warnings. */
|
|
58
|
+
onDelegationChallengeFailure?: (event: ChallengeContextFailureEvent) => void;
|
|
33
59
|
/**
|
|
34
60
|
* Argus reputation oracle base URL. Omit to use the trust-by-default
|
|
35
61
|
* baseline (reputation defaults to 1.0; orchestrator logs a one-shot
|
|
@@ -71,7 +97,7 @@ interface CheckpointConfig {
|
|
|
71
97
|
* canonical `_meta.proof.jws` body form. Default `false`.
|
|
72
98
|
*
|
|
73
99
|
* **When to enable** — customers whose agents pre-date Envelope-1
|
|
74
|
-
* (#2537) and ship
|
|
100
|
+
* (#2537) and ship KYA-OS proofs as `{protected,payload,signature}`
|
|
75
101
|
* JSON in a `KYA-Delegation` HTTP header. Post-Envelope-1 agents
|
|
76
102
|
* ship compact JWS in the request body's `_meta.proof.jws` field;
|
|
77
103
|
* those don't need this flag.
|
|
@@ -86,12 +112,12 @@ interface CheckpointConfig {
|
|
|
86
112
|
legacyEnvelopeFallback?: boolean;
|
|
87
113
|
/**
|
|
88
114
|
* Read the request body when `content-type` is `application/json` so
|
|
89
|
-
* the orchestrator can extract
|
|
115
|
+
* the orchestrator can extract a KYA-OS envelope from
|
|
90
116
|
* `_meta.proof.jws`. Default `true`.
|
|
91
117
|
*
|
|
92
118
|
* **When to disable** — streaming middlewares that can't tolerate
|
|
93
119
|
* the `req.clone()` memory overhead (one full-body copy is buffered
|
|
94
|
-
* during the read). For those, set `false` and route
|
|
120
|
+
* during the read). For those, set `false` and route KYA-OS
|
|
95
121
|
* envelopes through the `KYA-Delegation` header transport instead
|
|
96
122
|
* (requires `legacyEnvelopeFallback: true`).
|
|
97
123
|
*
|
|
@@ -162,6 +188,8 @@ interface CheckpointConfig {
|
|
|
162
188
|
* Added in `@kya-os/checkpoint-nextjs@1.5.0` (@Policy middleware-Cedar, #3076).
|
|
163
189
|
*/
|
|
164
190
|
projectId?: string;
|
|
191
|
+
/** Signed browser risk; configure explicit route scopes to enable consent step-up. */
|
|
192
|
+
browserPosture?: BrowserPostureConfig;
|
|
165
193
|
/**
|
|
166
194
|
* Policy-fetch cache TTL in seconds. Defaults to 300 (5 minutes). How long
|
|
167
195
|
* a fetched project policy is reused before the middleware refetches from
|
package/dist/edge/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
-
import { DetectionDetail } from '@kya-os/checkpoint-shared';
|
|
2
|
+
import { ClientIpTrustPolicy, DetectionDetail } from '@kya-os/checkpoint-shared';
|
|
3
3
|
export { DetectionDetail } from '@kya-os/checkpoint-shared';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -30,6 +30,8 @@ export { DetectionDetail } from '@kya-os/checkpoint-shared';
|
|
|
30
30
|
* Edge middleware configuration
|
|
31
31
|
*/
|
|
32
32
|
interface EdgeMiddlewareConfig {
|
|
33
|
+
/** Explicit deployment/proxy trust profile for client-IP resolution. */
|
|
34
|
+
clientIpPolicy?: ClientIpTrustPolicy;
|
|
33
35
|
/**
|
|
34
36
|
* Pre-compiled WebAssembly.Module for Edge Runtime
|
|
35
37
|
* Use static import: `import wasmModule from '@kya-os/checkpoint-wasm-runtime/wasm?module'`
|
package/dist/edge/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
-
import { DetectionDetail } from '@kya-os/checkpoint-shared';
|
|
2
|
+
import { ClientIpTrustPolicy, DetectionDetail } from '@kya-os/checkpoint-shared';
|
|
3
3
|
export { DetectionDetail } from '@kya-os/checkpoint-shared';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -30,6 +30,8 @@ export { DetectionDetail } from '@kya-os/checkpoint-shared';
|
|
|
30
30
|
* Edge middleware configuration
|
|
31
31
|
*/
|
|
32
32
|
interface EdgeMiddlewareConfig {
|
|
33
|
+
/** Explicit deployment/proxy trust profile for client-IP resolution. */
|
|
34
|
+
clientIpPolicy?: ClientIpTrustPolicy;
|
|
33
35
|
/**
|
|
34
36
|
* Pre-compiled WebAssembly.Module for Edge Runtime
|
|
35
37
|
* Use static import: `import wasmModule from '@kya-os/checkpoint-wasm-runtime/wasm?module'`
|
package/dist/edge/index.js
CHANGED
|
@@ -1,23 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var server = require('next/server');
|
|
4
|
+
var checkpointShared = require('@kya-os/checkpoint-shared');
|
|
4
5
|
|
|
5
6
|
// src/edge/index.ts
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const forwardedFor = request.headers.get("x-forwarded-for");
|
|
10
|
-
if (forwardedFor) {
|
|
11
|
-
const ip = forwardedFor.split(",")[0]?.trim();
|
|
12
|
-
if (ip) return ip;
|
|
13
|
-
}
|
|
14
|
-
const realIp = request.headers.get("x-real-ip");
|
|
15
|
-
if (realIp) return realIp;
|
|
16
|
-
const cfIp = request.headers.get("cf-connecting-ip");
|
|
17
|
-
if (cfIp) return cfIp;
|
|
18
|
-
const clientIp = request.headers.get("x-client-ip");
|
|
19
|
-
if (clientIp) return clientIp;
|
|
20
|
-
return void 0;
|
|
7
|
+
function getClientIp(request, policy = { platform: "direct" }) {
|
|
8
|
+
const frameworkAddress = request.ip;
|
|
9
|
+
return checkpointShared.resolveClientIp({ headers: request.headers, frameworkAddress, policy }).ip ?? void 0;
|
|
21
10
|
}
|
|
22
11
|
|
|
23
12
|
// src/local-detection-gate.ts
|
|
@@ -185,7 +174,7 @@ function createEdgeMiddleware(config = {}) {
|
|
|
185
174
|
const url = new URL(request.url);
|
|
186
175
|
const input = {
|
|
187
176
|
userAgent: request.headers.get("user-agent") || void 0,
|
|
188
|
-
ipAddress: getClientIp(request),
|
|
177
|
+
ipAddress: getClientIp(request, config.clientIpPolicy),
|
|
189
178
|
headers: Object.fromEntries(request.headers.entries()),
|
|
190
179
|
url: url.pathname + url.search,
|
|
191
180
|
method: request.method
|
package/dist/edge/index.mjs
CHANGED
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server';
|
|
2
|
+
import { resolveClientIp } from '@kya-os/checkpoint-shared';
|
|
2
3
|
|
|
3
4
|
// src/edge/index.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const forwardedFor = request.headers.get("x-forwarded-for");
|
|
8
|
-
if (forwardedFor) {
|
|
9
|
-
const ip = forwardedFor.split(",")[0]?.trim();
|
|
10
|
-
if (ip) return ip;
|
|
11
|
-
}
|
|
12
|
-
const realIp = request.headers.get("x-real-ip");
|
|
13
|
-
if (realIp) return realIp;
|
|
14
|
-
const cfIp = request.headers.get("cf-connecting-ip");
|
|
15
|
-
if (cfIp) return cfIp;
|
|
16
|
-
const clientIp = request.headers.get("x-client-ip");
|
|
17
|
-
if (clientIp) return clientIp;
|
|
18
|
-
return void 0;
|
|
5
|
+
function getClientIp(request, policy = { platform: "direct" }) {
|
|
6
|
+
const frameworkAddress = request.ip;
|
|
7
|
+
return resolveClientIp({ headers: request.headers, frameworkAddress, policy }).ip ?? void 0;
|
|
19
8
|
}
|
|
20
9
|
|
|
21
10
|
// src/local-detection-gate.ts
|
|
@@ -183,7 +172,7 @@ function createEdgeMiddleware(config = {}) {
|
|
|
183
172
|
const url = new URL(request.url);
|
|
184
173
|
const input = {
|
|
185
174
|
userAgent: request.headers.get("user-agent") || void 0,
|
|
186
|
-
ipAddress: getClientIp(request),
|
|
175
|
+
ipAddress: getClientIp(request, config.clientIpPolicy),
|
|
187
176
|
headers: Object.fromEntries(request.headers.entries()),
|
|
188
177
|
url: url.pathname + url.search,
|
|
189
178
|
method: request.method
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DetectionDetail } from '@kya-os/checkpoint-shared';
|
|
1
|
+
import { ClientIpTrustPolicy, DetectionDetail } from '@kya-os/checkpoint-shared';
|
|
2
2
|
import { NextRequest } from 'next/server';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -38,6 +38,8 @@ type EdgeRuntimeDetectionDetail = DetectionDetail & {
|
|
|
38
38
|
interface EdgeCheckpointConfig {
|
|
39
39
|
wasmModule?: WebAssembly.Module;
|
|
40
40
|
enableWasm?: boolean;
|
|
41
|
+
/** Explicit deployment/proxy trust profile for client-IP resolution. */
|
|
42
|
+
clientIpPolicy?: ClientIpTrustPolicy;
|
|
41
43
|
onAgentDetected?: (result: EdgeRuntimeDetectionDetail) => void;
|
|
42
44
|
blockAgents?: boolean;
|
|
43
45
|
allowedAgents?: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DetectionDetail } from '@kya-os/checkpoint-shared';
|
|
1
|
+
import { ClientIpTrustPolicy, DetectionDetail } from '@kya-os/checkpoint-shared';
|
|
2
2
|
import { NextRequest } from 'next/server';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -38,6 +38,8 @@ type EdgeRuntimeDetectionDetail = DetectionDetail & {
|
|
|
38
38
|
interface EdgeCheckpointConfig {
|
|
39
39
|
wasmModule?: WebAssembly.Module;
|
|
40
40
|
enableWasm?: boolean;
|
|
41
|
+
/** Explicit deployment/proxy trust profile for client-IP resolution. */
|
|
42
|
+
clientIpPolicy?: ClientIpTrustPolicy;
|
|
41
43
|
onAgentDetected?: (result: EdgeRuntimeDetectionDetail) => void;
|
|
42
44
|
blockAgents?: boolean;
|
|
43
45
|
allowedAgents?: string[];
|
|
@@ -3,21 +3,9 @@
|
|
|
3
3
|
var checkpointShared = require('@kya-os/checkpoint-shared');
|
|
4
4
|
|
|
5
5
|
// src/edge-runtime-loader.ts
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const forwardedFor = request.headers.get("x-forwarded-for");
|
|
10
|
-
if (forwardedFor) {
|
|
11
|
-
const ip = forwardedFor.split(",")[0]?.trim();
|
|
12
|
-
if (ip) return ip;
|
|
13
|
-
}
|
|
14
|
-
const realIp = request.headers.get("x-real-ip");
|
|
15
|
-
if (realIp) return realIp;
|
|
16
|
-
const cfIp = request.headers.get("cf-connecting-ip");
|
|
17
|
-
if (cfIp) return cfIp;
|
|
18
|
-
const clientIp = request.headers.get("x-client-ip");
|
|
19
|
-
if (clientIp) return clientIp;
|
|
20
|
-
return void 0;
|
|
6
|
+
function getClientIp(request, policy = { platform: "direct" }) {
|
|
7
|
+
const frameworkAddress = request.ip;
|
|
8
|
+
return checkpointShared.resolveClientIp({ headers: request.headers, frameworkAddress, policy }).ip ?? void 0;
|
|
21
9
|
}
|
|
22
10
|
|
|
23
11
|
// src/edge-runtime-loader.ts
|
|
@@ -132,7 +120,7 @@ var EdgeRuntimeCheckpoint = class {
|
|
|
132
120
|
}
|
|
133
121
|
const metadata = {
|
|
134
122
|
userAgent: request.headers.get("user-agent") || "",
|
|
135
|
-
ipAddress: getClientIp(request) || "",
|
|
123
|
+
ipAddress: getClientIp(request, this.config.clientIpPolicy) || "",
|
|
136
124
|
headers: Object.fromEntries(request.headers.entries())
|
|
137
125
|
};
|
|
138
126
|
if (this.wasmInstance && this.config.enableWasm !== false) {
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
import { KNOWN_AGENT_PATTERNS } from '@kya-os/checkpoint-shared';
|
|
1
|
+
import { resolveClientIp, KNOWN_AGENT_PATTERNS } from '@kya-os/checkpoint-shared';
|
|
2
2
|
|
|
3
3
|
// src/edge-runtime-loader.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const forwardedFor = request.headers.get("x-forwarded-for");
|
|
8
|
-
if (forwardedFor) {
|
|
9
|
-
const ip = forwardedFor.split(",")[0]?.trim();
|
|
10
|
-
if (ip) return ip;
|
|
11
|
-
}
|
|
12
|
-
const realIp = request.headers.get("x-real-ip");
|
|
13
|
-
if (realIp) return realIp;
|
|
14
|
-
const cfIp = request.headers.get("cf-connecting-ip");
|
|
15
|
-
if (cfIp) return cfIp;
|
|
16
|
-
const clientIp = request.headers.get("x-client-ip");
|
|
17
|
-
if (clientIp) return clientIp;
|
|
18
|
-
return void 0;
|
|
4
|
+
function getClientIp(request, policy = { platform: "direct" }) {
|
|
5
|
+
const frameworkAddress = request.ip;
|
|
6
|
+
return resolveClientIp({ headers: request.headers, frameworkAddress, policy }).ip ?? void 0;
|
|
19
7
|
}
|
|
20
8
|
|
|
21
9
|
// src/edge-runtime-loader.ts
|
|
@@ -130,7 +118,7 @@ var EdgeRuntimeCheckpoint = class {
|
|
|
130
118
|
}
|
|
131
119
|
const metadata = {
|
|
132
120
|
userAgent: request.headers.get("user-agent") || "",
|
|
133
|
-
ipAddress: getClientIp(request) || "",
|
|
121
|
+
ipAddress: getClientIp(request, this.config.clientIpPolicy) || "",
|
|
134
122
|
headers: Object.fromEntries(request.headers.entries())
|
|
135
123
|
};
|
|
136
124
|
if (this.wasmInstance && this.config.enableWasm !== false) {
|
|
@@ -15,7 +15,7 @@ import { NextRequest, NextResponse } from 'next/server';
|
|
|
15
15
|
*
|
|
16
16
|
* Migrate to `withCheckpoint` from `@kya-os/checkpoint-nextjs/edge` —
|
|
17
17
|
* engine-backed, runs the full kya-os-engine orchestrator including
|
|
18
|
-
*
|
|
18
|
+
* KYA-OS envelope verification. See `packages/checkpoint-nextjs/README.md`
|
|
19
19
|
* for the canonical recipe.
|
|
20
20
|
*/
|
|
21
21
|
|
|
@@ -15,7 +15,7 @@ import { NextRequest, NextResponse } from 'next/server';
|
|
|
15
15
|
*
|
|
16
16
|
* Migrate to `withCheckpoint` from `@kya-os/checkpoint-nextjs/edge` —
|
|
17
17
|
* engine-backed, runs the full kya-os-engine orchestrator including
|
|
18
|
-
*
|
|
18
|
+
* KYA-OS envelope verification. See `packages/checkpoint-nextjs/README.md`
|
|
19
19
|
* for the canonical recipe.
|
|
20
20
|
*/
|
|
21
21
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// src/edge-wasm-middleware.ts
|
|
4
|
-
var MIGRATION_ERROR = "`@kya-os/checkpoint-nextjs/edge-wasm-middleware` was deprecated in Phase-D.9a (legacy `agentshield-wasm` Rust crate retirement). Migrate to `withCheckpoint` from `@kya-os/checkpoint-nextjs/edge` \u2014 engine-backed via the Rust `kya-os-engine` crate (PDM-1 #2560), runs the full orchestrator including
|
|
4
|
+
var MIGRATION_ERROR = "`@kya-os/checkpoint-nextjs/edge-wasm-middleware` was deprecated in Phase-D.9a (legacy `agentshield-wasm` Rust crate retirement). Migrate to `withCheckpoint` from `@kya-os/checkpoint-nextjs/edge` \u2014 engine-backed via the Rust `kya-os-engine` crate (PDM-1 #2560), runs the full orchestrator including KYA-OS envelope verification. See packages/checkpoint-nextjs/README.md for the canonical recipe.";
|
|
5
5
|
var _edgeWasmWarned = false;
|
|
6
6
|
function warnEdgeWasmDeprecated() {
|
|
7
7
|
if (_edgeWasmWarned) return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/edge-wasm-middleware.ts
|
|
2
|
-
var MIGRATION_ERROR = "`@kya-os/checkpoint-nextjs/edge-wasm-middleware` was deprecated in Phase-D.9a (legacy `agentshield-wasm` Rust crate retirement). Migrate to `withCheckpoint` from `@kya-os/checkpoint-nextjs/edge` \u2014 engine-backed via the Rust `kya-os-engine` crate (PDM-1 #2560), runs the full orchestrator including
|
|
2
|
+
var MIGRATION_ERROR = "`@kya-os/checkpoint-nextjs/edge-wasm-middleware` was deprecated in Phase-D.9a (legacy `agentshield-wasm` Rust crate retirement). Migrate to `withCheckpoint` from `@kya-os/checkpoint-nextjs/edge` \u2014 engine-backed via the Rust `kya-os-engine` crate (PDM-1 #2560), runs the full orchestrator including KYA-OS envelope verification. See packages/checkpoint-nextjs/README.md for the canonical recipe.";
|
|
3
3
|
var _edgeWasmWarned = false;
|
|
4
4
|
function warnEdgeWasmDeprecated() {
|
|
5
5
|
if (_edgeWasmWarned) return;
|
package/dist/index.d.mts
CHANGED
|
@@ -4,14 +4,14 @@ export { AgentDetectionEvent, AgentSession, AgentShieldMiddlewareConfig, Checkpo
|
|
|
4
4
|
export { createAgentShieldMiddleware as createAgentShieldMiddlewareBase } from './middleware.mjs';
|
|
5
5
|
export { EdgeSessionTracker, SessionData, SessionTrackingConfig, StatelessSessionChecker } from './session-tracker.mjs';
|
|
6
6
|
export { AgentShieldClient, AgentShieldClientConfig, CheckpointApiClient, CheckpointApiClientConfig, EnforceInput, EnforceResponse, EnforcementDecision, LogDetectionInput, getAgentShieldClient, getCheckpointApiClient, resetAgentShieldClient, resetCheckpointApiClient } from './api-client.mjs';
|
|
7
|
-
export { A as AgentShieldRequest, D as DetectionContext, N as NextJSMiddlewareConfig } from './types-
|
|
7
|
+
export { A as AgentShieldRequest, D as DetectionContext, N as NextJSMiddlewareConfig } from './types-Chgi5TFC.mjs';
|
|
8
8
|
export { NextJSPolicyMiddlewareConfig, PolicyMiddlewareConfig, applyPolicy, buildBlockedResponse as buildPolicyBlockedResponse, buildRedirectResponse as buildPolicyRedirectResponse, createContextFromDetection, evaluatePolicyForDetection, getPolicy, handlePolicyDecision } from './policy.mjs';
|
|
9
|
-
export { C as CheckpointConfig } from './config-
|
|
9
|
+
export { C as CheckpointConfig } from './config-CleTeeoW.mjs';
|
|
10
10
|
export { DEFAULT_POLICY, ENFORCEMENT_ACTIONS, EnforcementAction, PolicyConfig, PolicyEvaluationContext, PolicyEvaluationResult, createEvaluationContext, evaluatePolicy } from '@kya-os/checkpoint-shared';
|
|
11
|
-
import '@kya-os/checkpoint-wasm-runtime/engine';
|
|
12
|
-
import '@kya-os/checkpoint-wasm-runtime/adapters';
|
|
13
11
|
import 'next/server';
|
|
14
|
-
import '@kya-os/checkpoint
|
|
12
|
+
import '@kya-os/checkpoint';
|
|
13
|
+
import '@kya-os/checkpoint-shared/browser-posture';
|
|
14
|
+
import '@kya-os/checkpoint-wasm-runtime/adapters';
|
|
15
|
+
import '@kya-os/checkpoint-wasm-runtime/engine';
|
|
15
16
|
import './composed-policy.mjs';
|
|
16
17
|
import '@kya-os/checkpoint-wasm-runtime/composed-policy';
|
|
17
|
-
import '@kya-os/checkpoint';
|
package/dist/index.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ export { AgentDetectionEvent, AgentSession, AgentShieldMiddlewareConfig, Checkpo
|
|
|
4
4
|
export { createAgentShieldMiddleware as createAgentShieldMiddlewareBase } from './middleware.js';
|
|
5
5
|
export { EdgeSessionTracker, SessionData, SessionTrackingConfig, StatelessSessionChecker } from './session-tracker.js';
|
|
6
6
|
export { AgentShieldClient, AgentShieldClientConfig, CheckpointApiClient, CheckpointApiClientConfig, EnforceInput, EnforceResponse, EnforcementDecision, LogDetectionInput, getAgentShieldClient, getCheckpointApiClient, resetAgentShieldClient, resetCheckpointApiClient } from './api-client.js';
|
|
7
|
-
export { A as AgentShieldRequest, D as DetectionContext, N as NextJSMiddlewareConfig } from './types-
|
|
7
|
+
export { A as AgentShieldRequest, D as DetectionContext, N as NextJSMiddlewareConfig } from './types-Chgi5TFC.js';
|
|
8
8
|
export { NextJSPolicyMiddlewareConfig, PolicyMiddlewareConfig, applyPolicy, buildBlockedResponse as buildPolicyBlockedResponse, buildRedirectResponse as buildPolicyRedirectResponse, createContextFromDetection, evaluatePolicyForDetection, getPolicy, handlePolicyDecision } from './policy.js';
|
|
9
|
-
export { C as CheckpointConfig } from './config-
|
|
9
|
+
export { C as CheckpointConfig } from './config-XMOIkxFN.js';
|
|
10
10
|
export { DEFAULT_POLICY, ENFORCEMENT_ACTIONS, EnforcementAction, PolicyConfig, PolicyEvaluationContext, PolicyEvaluationResult, createEvaluationContext, evaluatePolicy } from '@kya-os/checkpoint-shared';
|
|
11
|
-
import '@kya-os/checkpoint-wasm-runtime/engine';
|
|
12
|
-
import '@kya-os/checkpoint-wasm-runtime/adapters';
|
|
13
11
|
import 'next/server';
|
|
14
|
-
import '@kya-os/checkpoint
|
|
12
|
+
import '@kya-os/checkpoint';
|
|
13
|
+
import '@kya-os/checkpoint-shared/browser-posture';
|
|
14
|
+
import '@kya-os/checkpoint-wasm-runtime/adapters';
|
|
15
|
+
import '@kya-os/checkpoint-wasm-runtime/engine';
|
|
15
16
|
import './composed-policy.js';
|
|
16
17
|
import '@kya-os/checkpoint-wasm-runtime/composed-policy';
|
|
17
|
-
import '@kya-os/checkpoint';
|