@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,6 +1,6 @@
|
|
|
1
1
|
import { AstraSyncGateway } from '../gateway/gateway.mjs';
|
|
2
|
-
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
3
|
-
import '../types-
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-Djw4GLtz.mjs';
|
|
3
|
+
import '../types-BntuzEEn.mjs';
|
|
4
4
|
import '../metadata-capture.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AstraSyncGateway } from '../gateway/gateway.js';
|
|
2
|
-
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
3
|
-
import '../types-
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-DHu7m9HI.js';
|
|
3
|
+
import '../types-SDu4Llbe.js';
|
|
4
4
|
import '../metadata-capture.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'express';
|
|
2
|
-
import '../types-
|
|
3
|
-
export { c as createMiddleware, a as extractAstraSyncCredentials } from '../express-
|
|
2
|
+
import '../types-BntuzEEn.mjs';
|
|
3
|
+
export { c as createMiddleware, a as extractAstraSyncCredentials } from '../express-B39o89gf.mjs';
|
|
4
4
|
import '../metadata-capture.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'express';
|
|
2
|
-
import '../types-
|
|
3
|
-
export { c as createMiddleware, a as extractAstraSyncCredentials } from '../express-
|
|
2
|
+
import '../types-SDu4Llbe.js';
|
|
3
|
+
export { c as createMiddleware, a as extractAstraSyncCredentials } from '../express-BuxKNO_q.js';
|
|
4
4
|
import '../metadata-capture.js';
|
package/dist/adapters/express.js
CHANGED
|
@@ -92,7 +92,7 @@ function getTrustLevel(score) {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
// src/version.ts
|
|
95
|
-
var SDK_VERSION = "3.
|
|
95
|
+
var SDK_VERSION = "3.12.0";
|
|
96
96
|
|
|
97
97
|
// src/well-known.ts
|
|
98
98
|
var CACHE_TTL_MS = 60 * 60 * 1e3;
|
|
@@ -345,6 +345,7 @@ function createGuidanceResponse(_config, reason, options = {}) {
|
|
|
345
345
|
}
|
|
346
346
|
] : void 0,
|
|
347
347
|
correlationId: options.correlationId,
|
|
348
|
+
attemptId: options.attemptId,
|
|
348
349
|
verifiedAt: /* @__PURE__ */ new Date()
|
|
349
350
|
};
|
|
350
351
|
}
|
|
@@ -374,6 +375,8 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
374
375
|
body.runtimeChallengeOptions = requestData.runtimeChallengeOptions;
|
|
375
376
|
if (requestData.invocationProtocol) body.invocationProtocol = requestData.invocationProtocol;
|
|
376
377
|
if (requestData.commerceArtifacts) body.commerceArtifacts = requestData.commerceArtifacts;
|
|
378
|
+
if (requestData.attemptId) body.attemptId = requestData.attemptId;
|
|
379
|
+
if (requestData.considerationSet) body.considerationSet = requestData.considerationSet;
|
|
377
380
|
body.sdkVersion = SDK_VERSION;
|
|
378
381
|
if (requestData.callerMetadata || requestData.clientIp || requestData.userAgent) {
|
|
379
382
|
const meta = {
|
|
@@ -401,6 +404,9 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
401
404
|
if (response.status === 410) {
|
|
402
405
|
return {
|
|
403
406
|
success: true,
|
|
407
|
+
// 3.12.0 (Trust Record): keep the server-echoed attempt handle even on
|
|
408
|
+
// the synthesised 410 deny shape (echoed on every branch).
|
|
409
|
+
attemptId: typeof data?.attemptId === "string" ? data.attemptId : void 0,
|
|
404
410
|
access: {
|
|
405
411
|
allowed: false,
|
|
406
412
|
accessLevel: "none",
|
|
@@ -419,7 +425,8 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
419
425
|
return {
|
|
420
426
|
success: false,
|
|
421
427
|
error: data.message || data.error || `API returned ${response.status}`,
|
|
422
|
-
correlationId: typeof data?.correlationId === "string" ? data.correlationId : void 0
|
|
428
|
+
correlationId: typeof data?.correlationId === "string" ? data.correlationId : void 0,
|
|
429
|
+
attemptId: typeof data?.attemptId === "string" ? data.attemptId : void 0
|
|
423
430
|
};
|
|
424
431
|
}
|
|
425
432
|
return data;
|
|
@@ -453,7 +460,13 @@ async function verify(config, request, options) {
|
|
|
453
460
|
if (mergedConfig.debug) {
|
|
454
461
|
console.log("[VerificationGateway] Returning cached result");
|
|
455
462
|
}
|
|
456
|
-
|
|
463
|
+
const hit = { ...cached };
|
|
464
|
+
if (request.attemptId) {
|
|
465
|
+
hit.attemptId = request.attemptId;
|
|
466
|
+
} else {
|
|
467
|
+
delete hit.attemptId;
|
|
468
|
+
}
|
|
469
|
+
return hit;
|
|
457
470
|
}
|
|
458
471
|
}
|
|
459
472
|
const enrichedRequest = { ...request };
|
|
@@ -473,6 +486,7 @@ async function verify(config, request, options) {
|
|
|
473
486
|
return createGuidanceResponse(mergedConfig, apiResponse.error, {
|
|
474
487
|
source: "api_error",
|
|
475
488
|
correlationId: apiResponse.correlationId,
|
|
489
|
+
attemptId: apiResponse.attemptId,
|
|
476
490
|
urls
|
|
477
491
|
});
|
|
478
492
|
}
|
|
@@ -508,6 +522,9 @@ async function verify(config, request, options) {
|
|
|
508
522
|
// Anonymous traffic has no session → correlationId is the per-attempt
|
|
509
523
|
// linking key (the sessionId-equivalent for anonymous callers).
|
|
510
524
|
correlationId: apiResponse.correlationId,
|
|
525
|
+
// 3.12.0 (Trust Record): server echoes the attempt-chain handle on
|
|
526
|
+
// every branch — denials included (the funnel outlives one deny).
|
|
527
|
+
attemptId: apiResponse.attemptId,
|
|
511
528
|
recommendation: apiResponse.recommendation,
|
|
512
529
|
recommendationReasons: apiResponse.recommendationReasons,
|
|
513
530
|
stepUpApproval: apiResponse.stepUpApproval,
|
|
@@ -559,6 +576,8 @@ async function verify(config, request, options) {
|
|
|
559
576
|
// v2.3.10 (defect #34, round-4): anonymous responses surface correlationId
|
|
560
577
|
// (no session row exists for unverified callers).
|
|
561
578
|
correlationId: apiResponse.correlationId,
|
|
579
|
+
// 3.12.0 (Trust Record): server-echoed attempt-chain handle.
|
|
580
|
+
attemptId: apiResponse.attemptId,
|
|
562
581
|
runtimeChallenge: apiResponse.runtimeChallenge,
|
|
563
582
|
tokenGuidance: apiResponse.tokenGuidance,
|
|
564
583
|
recommendation: apiResponse.recommendation,
|