@astrasyncai/verification-gateway 3.11.0 → 3.12.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/dist/adapter-interface/interface.d.mts +2 -2
- package/dist/adapter-interface/interface.d.ts +2 -2
- package/dist/adapters/express.d.mts +2 -2
- package/dist/adapters/express.d.ts +2 -2
- package/dist/adapters/express.js +22 -3
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +22 -3
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.d.ts +1 -1
- package/dist/adapters/mcp.js +22 -3
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +22 -3
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +2 -2
- package/dist/adapters/nextjs.d.ts +2 -2
- package/dist/adapters/nextjs.js +22 -3
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +22 -3
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +2 -2
- package/dist/adapters/sdk.d.ts +2 -2
- package/dist/adapters/sdk.js +22 -3
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +22 -3
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.d.mts +2 -2
- package/dist/agent/index.d.ts +2 -2
- package/dist/bin/astrasync-claude-hook.js +84 -21
- package/dist/bin/astrasync-codex-hook.js +84 -21
- package/dist/bin/astrasync-guard.js +84 -21
- package/dist/bin/astrasync.js +85 -21
- package/dist/browser/background.js +84 -21
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +84 -21
- package/dist/browser/background.mjs.map +1 -1
- package/dist/browser/browser-adapter.d.mts +2 -2
- package/dist/browser/browser-adapter.d.ts +2 -2
- package/dist/claude-code/claude-code-adapter.d.mts +2 -2
- package/dist/claude-code/claude-code-adapter.d.ts +2 -2
- package/dist/cli/index.d.mts +2 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/codex/index.d.mts +2 -2
- package/dist/codex/index.d.ts +2 -2
- package/dist/codex/index.js +84 -21
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +84 -21
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/cursor-adapter.d.mts +2 -2
- package/dist/cursor/cursor-adapter.d.ts +2 -2
- package/dist/cursor/extension.d.mts +2 -2
- package/dist/cursor/extension.d.ts +2 -2
- package/dist/cursor/extension.js +84 -21
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +84 -21
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +1 -1
- package/dist/edge-config.d.ts +1 -1
- package/dist/{express-DCXa1oqj.d.mts → express-B39o89gf.d.mts} +1 -1
- package/dist/{express-ClNtDhhc.d.ts → express-BuxKNO_q.d.ts} +1 -1
- package/dist/gateway/gateway.d.mts +2 -2
- package/dist/gateway/gateway.d.ts +2 -2
- package/dist/gateway/gateway.js +84 -21
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +84 -21
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +2 -2
- package/dist/git-trigger/git-hooks.d.ts +2 -2
- package/dist/{index-CfHurO1P.d.ts → index-BG62SXso.d.ts} +1 -1
- package/dist/{index-D2ztkumS.d.ts → index-CLHdqs2M.d.ts} +1 -1
- package/dist/{index-Dr_XiN65.d.mts → index-CqydB4ks.d.mts} +1 -1
- package/dist/{index-BrNKDmiR.d.mts → index-DME3w3lf.d.mts} +1 -1
- package/dist/index.d.mts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +42 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -3
- package/dist/index.mjs.map +1 -1
- package/dist/local-evaluator/evaluator.d.mts +11 -2
- package/dist/local-evaluator/evaluator.d.ts +11 -2
- package/dist/local-evaluator/evaluator.js +20 -9
- package/dist/local-evaluator/evaluator.js.map +1 -1
- package/dist/local-evaluator/evaluator.mjs +20 -9
- package/dist/local-evaluator/evaluator.mjs.map +1 -1
- package/dist/{nextjs-DcQIk6Zj.d.mts → nextjs-D74W7wt-.d.mts} +1 -1
- package/dist/{nextjs-CEBVBsdi.d.ts → nextjs-Ddlw_J1J.d.ts} +1 -1
- package/dist/{sdk-CZkbSOeO.d.mts → sdk-Bn6bj7kt.d.mts} +1 -1
- package/dist/{sdk-H0JCLW2y.d.ts → sdk-CT7gdkfR.d.ts} +1 -1
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/{types-sy3tq8lp.d.mts → types-BntuzEEn.d.mts} +103 -1
- package/dist/{types-BV6abBnF.d.mts → types-DHu7m9HI.d.ts} +7 -2
- package/dist/{types-C23_uaY8.d.ts → types-Djw4GLtz.d.mts} +7 -2
- package/dist/{types-9tns4wyl.d.ts → types-SDu4Llbe.d.ts} +103 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/verify.d.mts +13 -2
- package/dist/verify.d.ts +13 -2
- package/dist/verify.js +42 -3
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +41 -3
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'next/server';
|
|
2
|
-
import '../types-
|
|
3
|
-
export { c as createMatcherConfig, a as createMiddleware } from '../nextjs-
|
|
2
|
+
import '../types-BntuzEEn.mjs';
|
|
3
|
+
export { c as createMatcherConfig, a as createMiddleware } from '../nextjs-D74W7wt-.mjs';
|
|
4
4
|
import '../metadata-capture.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'next/server';
|
|
2
|
-
import '../types-
|
|
3
|
-
export { c as createMatcherConfig, a as createMiddleware } from '../nextjs-
|
|
2
|
+
import '../types-SDu4Llbe.js';
|
|
3
|
+
export { c as createMatcherConfig, a as createMiddleware } from '../nextjs-Ddlw_J1J.js';
|
|
4
4
|
import '../metadata-capture.js';
|
package/dist/adapters/nextjs.js
CHANGED
|
@@ -102,7 +102,7 @@ function getTrustLevel(score) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
// src/version.ts
|
|
105
|
-
var SDK_VERSION = "3.
|
|
105
|
+
var SDK_VERSION = "3.12.0";
|
|
106
106
|
|
|
107
107
|
// src/well-known.ts
|
|
108
108
|
var CACHE_TTL_MS = 60 * 60 * 1e3;
|
|
@@ -269,6 +269,7 @@ function createGuidanceResponse(_config, reason, options = {}) {
|
|
|
269
269
|
}
|
|
270
270
|
] : void 0,
|
|
271
271
|
correlationId: options.correlationId,
|
|
272
|
+
attemptId: options.attemptId,
|
|
272
273
|
verifiedAt: /* @__PURE__ */ new Date()
|
|
273
274
|
};
|
|
274
275
|
}
|
|
@@ -298,6 +299,8 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
298
299
|
body.runtimeChallengeOptions = requestData.runtimeChallengeOptions;
|
|
299
300
|
if (requestData.invocationProtocol) body.invocationProtocol = requestData.invocationProtocol;
|
|
300
301
|
if (requestData.commerceArtifacts) body.commerceArtifacts = requestData.commerceArtifacts;
|
|
302
|
+
if (requestData.attemptId) body.attemptId = requestData.attemptId;
|
|
303
|
+
if (requestData.considerationSet) body.considerationSet = requestData.considerationSet;
|
|
301
304
|
body.sdkVersion = SDK_VERSION;
|
|
302
305
|
if (requestData.callerMetadata || requestData.clientIp || requestData.userAgent) {
|
|
303
306
|
const meta = {
|
|
@@ -325,6 +328,9 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
325
328
|
if (response.status === 410) {
|
|
326
329
|
return {
|
|
327
330
|
success: true,
|
|
331
|
+
// 3.12.0 (Trust Record): keep the server-echoed attempt handle even on
|
|
332
|
+
// the synthesised 410 deny shape (echoed on every branch).
|
|
333
|
+
attemptId: typeof data?.attemptId === "string" ? data.attemptId : void 0,
|
|
328
334
|
access: {
|
|
329
335
|
allowed: false,
|
|
330
336
|
accessLevel: "none",
|
|
@@ -343,7 +349,8 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
343
349
|
return {
|
|
344
350
|
success: false,
|
|
345
351
|
error: data.message || data.error || `API returned ${response.status}`,
|
|
346
|
-
correlationId: typeof data?.correlationId === "string" ? data.correlationId : void 0
|
|
352
|
+
correlationId: typeof data?.correlationId === "string" ? data.correlationId : void 0,
|
|
353
|
+
attemptId: typeof data?.attemptId === "string" ? data.attemptId : void 0
|
|
347
354
|
};
|
|
348
355
|
}
|
|
349
356
|
return data;
|
|
@@ -377,7 +384,13 @@ async function verify(config, request, options) {
|
|
|
377
384
|
if (mergedConfig.debug) {
|
|
378
385
|
console.log("[VerificationGateway] Returning cached result");
|
|
379
386
|
}
|
|
380
|
-
|
|
387
|
+
const hit = { ...cached };
|
|
388
|
+
if (request.attemptId) {
|
|
389
|
+
hit.attemptId = request.attemptId;
|
|
390
|
+
} else {
|
|
391
|
+
delete hit.attemptId;
|
|
392
|
+
}
|
|
393
|
+
return hit;
|
|
381
394
|
}
|
|
382
395
|
}
|
|
383
396
|
const enrichedRequest = { ...request };
|
|
@@ -397,6 +410,7 @@ async function verify(config, request, options) {
|
|
|
397
410
|
return createGuidanceResponse(mergedConfig, apiResponse.error, {
|
|
398
411
|
source: "api_error",
|
|
399
412
|
correlationId: apiResponse.correlationId,
|
|
413
|
+
attemptId: apiResponse.attemptId,
|
|
400
414
|
urls
|
|
401
415
|
});
|
|
402
416
|
}
|
|
@@ -432,6 +446,9 @@ async function verify(config, request, options) {
|
|
|
432
446
|
// Anonymous traffic has no session → correlationId is the per-attempt
|
|
433
447
|
// linking key (the sessionId-equivalent for anonymous callers).
|
|
434
448
|
correlationId: apiResponse.correlationId,
|
|
449
|
+
// 3.12.0 (Trust Record): server echoes the attempt-chain handle on
|
|
450
|
+
// every branch — denials included (the funnel outlives one deny).
|
|
451
|
+
attemptId: apiResponse.attemptId,
|
|
435
452
|
recommendation: apiResponse.recommendation,
|
|
436
453
|
recommendationReasons: apiResponse.recommendationReasons,
|
|
437
454
|
stepUpApproval: apiResponse.stepUpApproval,
|
|
@@ -483,6 +500,8 @@ async function verify(config, request, options) {
|
|
|
483
500
|
// v2.3.10 (defect #34, round-4): anonymous responses surface correlationId
|
|
484
501
|
// (no session row exists for unverified callers).
|
|
485
502
|
correlationId: apiResponse.correlationId,
|
|
503
|
+
// 3.12.0 (Trust Record): server-echoed attempt-chain handle.
|
|
504
|
+
attemptId: apiResponse.attemptId,
|
|
486
505
|
runtimeChallenge: apiResponse.runtimeChallenge,
|
|
487
506
|
tokenGuidance: apiResponse.tokenGuidance,
|
|
488
507
|
recommendation: apiResponse.recommendation,
|