@astrasyncai/verification-gateway 2.4.7 → 2.4.9
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 +29 -15
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +29 -15
- 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 +30 -14
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +30 -14
- 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 +37 -16
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +37 -16
- 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 +31 -13
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +31 -13
- 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.js +6 -1
- package/dist/browser/background.js +25 -12
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +25 -12
- 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/cli/index.d.mts +2 -2
- package/dist/cli/index.d.ts +2 -2
- 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 +25 -12
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +25 -12
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/{express-D5hAJ2Gv.d.mts → express-4WStX3PV.d.mts} +1 -1
- package/dist/{express-XCkk7BsJ.d.ts → express-C1ePFB7n.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 +25 -12
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +25 -12
- 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-u08qcXq9.d.mts → index-ChPX4WHl.d.mts} +1 -1
- package/dist/{index-CH4TfcbL.d.ts → index-Cjm-zBeZ.d.ts} +1 -1
- package/dist/{index-WL4d9e9_.d.ts → index-CzJMCgEy.d.ts} +2 -2
- package/dist/{index-ZkHvXsMo.d.mts → index-D8IEntil.d.mts} +2 -2
- package/dist/index.d.mts +22 -11
- package/dist/index.d.ts +22 -11
- package/dist/index.js +86 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -26
- package/dist/index.mjs.map +1 -1
- package/dist/local-evaluator/evaluator.d.mts +2 -2
- package/dist/local-evaluator/evaluator.d.ts +2 -2
- package/dist/{nextjs-DP2EpI-4.d.ts → nextjs-BIORS__0.d.ts} +1 -1
- package/dist/{nextjs-CFA0J_4x.d.mts → nextjs-CjzHdaXA.d.mts} +1 -1
- package/dist/registration/index.d.mts +90 -1
- package/dist/registration/index.d.ts +90 -1
- package/dist/registration/index.js +33 -3
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +31 -2
- package/dist/registration/index.mjs.map +1 -1
- package/dist/{sdk-CwwCGDzK.d.ts → sdk-Chhz-FcT.d.mts} +10 -5
- package/dist/{sdk-C8W54WZS.d.mts → sdk-CqTEQAc6.d.ts} +10 -5
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/{types-tBNFSbw_.d.mts → types-DNK2BgIf.d.mts} +2 -2
- package/dist/{types-DXNkr61h.d.ts → types-DoWIuzfj.d.ts} +2 -2
- package/dist/{types-CbZOkIr-.d.mts → types-L15pYd2c.d.mts} +22 -5
- package/dist/{types-CbZOkIr-.d.ts → types-L15pYd2c.d.ts} +22 -5
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +1 -1
- package/dist/ui/index.mjs.map +1 -1
- package/package.json +4 -2
|
@@ -3293,7 +3293,7 @@ function getTrustLevel(score) {
|
|
|
3293
3293
|
}
|
|
3294
3294
|
|
|
3295
3295
|
// src/version.ts
|
|
3296
|
-
var SDK_VERSION = "2.4.
|
|
3296
|
+
var SDK_VERSION = "2.4.9";
|
|
3297
3297
|
|
|
3298
3298
|
// src/verify.ts
|
|
3299
3299
|
var DEFAULT_CONFIG = {
|
|
@@ -3376,12 +3376,17 @@ function createGuidanceResponse(config, reason, options = {}) {
|
|
|
3376
3376
|
]
|
|
3377
3377
|
};
|
|
3378
3378
|
return {
|
|
3379
|
-
|
|
3379
|
+
// Round-18 G4: createGuidanceResponse fires for unverified-agent path or
|
|
3380
|
+
// API-error fallback. Identity is not verified (no agent resolved);
|
|
3381
|
+
// policy is not evaluated (we never reached the gate).
|
|
3382
|
+
identityVerified: false,
|
|
3383
|
+
policyAllowed: false,
|
|
3380
3384
|
// v2.3.9 (defect #30): denials grant `'none'`, NEVER a positive band.
|
|
3381
|
-
// Adapters additionally short-circuit on
|
|
3382
|
-
// the gate check, but the access level still has
|
|
3383
|
-
// data layer so downstream consumers (SDK adapters
|
|
3384
|
-
// custom integrations) inherit the correct
|
|
3385
|
+
// Adapters additionally short-circuit on `!identityVerified ||
|
|
3386
|
+
// !policyAllowed` before the gate check, but the access level still has
|
|
3387
|
+
// to be honest at the data layer so downstream consumers (SDK adapters
|
|
3388
|
+
// in other languages, custom integrations) inherit the correct
|
|
3389
|
+
// semantics.
|
|
3385
3390
|
accessLevel: "none",
|
|
3386
3391
|
guidance,
|
|
3387
3392
|
denialReasons: reason ? [reason] : ["No valid agent credentials provided"],
|
|
@@ -3525,15 +3530,17 @@ async function verify(config, request) {
|
|
|
3525
3530
|
}
|
|
3526
3531
|
if (!apiResponse.access?.allowed) {
|
|
3527
3532
|
const aggregatedFailures = apiResponse.access?.failures;
|
|
3533
|
+
const idVerifiedFromBackend = apiResponse.verificationContext?.idVerified === true;
|
|
3528
3534
|
const result2 = {
|
|
3529
|
-
|
|
3535
|
+
identityVerified: idVerifiedFromBackend,
|
|
3536
|
+
policyAllowed: false,
|
|
3530
3537
|
// v2.3.9 (defect #30): denials grant `'none'`, NEVER a positive band.
|
|
3531
3538
|
// Pre-rename this hardcoded `'guidance'`, which conflated with the
|
|
3532
3539
|
// colocated `guidance: {...}` help-payload object below and let
|
|
3533
3540
|
// denied requests pass any route gated at `'guidance'` because
|
|
3534
3541
|
// `hasMinimumAccess('guidance', 'guidance') === true`. Adapters now
|
|
3535
|
-
// ALSO short-circuit on
|
|
3536
|
-
// belt-and-braces.
|
|
3542
|
+
// ALSO short-circuit on `!identityVerified || !policyAllowed` before
|
|
3543
|
+
// the gate check — belt-and-braces.
|
|
3537
3544
|
accessLevel: "none",
|
|
3538
3545
|
denialReasons: aggregatedFailures && aggregatedFailures.length > 0 ? aggregatedFailures.map((f) => f.message) : apiResponse.access?.reason ? [apiResponse.access.reason] : ["Access denied"],
|
|
3539
3546
|
failures: aggregatedFailures,
|
|
@@ -3577,7 +3584,13 @@ async function verify(config, request) {
|
|
|
3577
3584
|
const verificationContext = apiResponse.verificationContext;
|
|
3578
3585
|
const accessLevel = apiResponse.access?.accessLevel ?? "standard";
|
|
3579
3586
|
const result = {
|
|
3580
|
-
|
|
3587
|
+
// Round-18 G4: backend allowed access. Identity is verified (we resolved
|
|
3588
|
+
// the caller to an agent) and policy passed all gates. Read idVerified
|
|
3589
|
+
// from verificationContext for symmetry with the deny branch; default true
|
|
3590
|
+
// on success path since `access.allowed === true` implies identity was
|
|
3591
|
+
// resolvable (anonymous-allow paths flow through createGuidanceResponse).
|
|
3592
|
+
identityVerified: apiResponse.verificationContext?.idVerified !== false,
|
|
3593
|
+
policyAllowed: true,
|
|
3581
3594
|
accessLevel,
|
|
3582
3595
|
agent,
|
|
3583
3596
|
developer,
|
|
@@ -3600,7 +3613,7 @@ async function verify(config, request) {
|
|
|
3600
3613
|
warningHeader: apiResponse.warningHeader
|
|
3601
3614
|
};
|
|
3602
3615
|
if (result.recommendation === "deny") {
|
|
3603
|
-
result.
|
|
3616
|
+
result.policyAllowed = false;
|
|
3604
3617
|
result.accessLevel = "none";
|
|
3605
3618
|
result.denialReasons = result.recommendationReasons || [
|
|
3606
3619
|
"Access denied by AstraSync recommendation"
|
|
@@ -3695,7 +3708,7 @@ function toVerificationRequest(context, astraId) {
|
|
|
3695
3708
|
};
|
|
3696
3709
|
}
|
|
3697
3710
|
function toDecision(result) {
|
|
3698
|
-
if (result.
|
|
3711
|
+
if (result.identityVerified && result.policyAllowed) {
|
|
3699
3712
|
return {
|
|
3700
3713
|
recommendation: "ALLOW",
|
|
3701
3714
|
reason: `Verified with access level: ${result.accessLevel}`,
|