@astrasyncai/verification-gateway 3.4.0 → 3.6.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/README.md +102 -0
- 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 +113 -20
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +113 -20
- 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 +96 -20
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +96 -20
- 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 +101 -20
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +101 -20
- 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 +19 -16
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +19 -16
- 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/browser/background.js +22 -16
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +22 -16
- 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 +22 -16
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +22 -16
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/{express-CeFvNWDD.d.mts → express-BnMO-H3y.d.mts} +1 -1
- package/dist/{express-RIh05wW2.d.ts → express-DQhDzNAt.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 +22 -16
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +22 -16
- 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-DgVBEiwI.d.mts → index-BT_aRn-I.d.mts} +1 -1
- package/dist/{index-BYu1FKMy.d.ts → index-D8-dvUFA.d.ts} +1 -1
- package/dist/{index-Bw4FeHMY.d.mts → index-WHKq2v17.d.mts} +5 -1
- package/dist/{index-C-K0WCrk.d.ts → index-rftma0ln.d.ts} +5 -1
- package/dist/index.d.mts +55 -9
- package/dist/index.d.ts +55 -9
- package/dist/index.js +184 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +182 -34
- 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-xciaMpsZ.d.mts → nextjs-DFKYhxe6.d.mts} +1 -1
- package/dist/{nextjs--xR9zbSJ.d.ts → nextjs-DPj7ZNlq.d.ts} +1 -1
- package/dist/{sdk-FP7xT9F8.d.ts → sdk-CAcHgB5x.d.ts} +1 -1
- package/dist/{sdk-CJYCLMI0.d.mts → sdk-Cy3wAmDt.d.mts} +1 -1
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/transport/index.js +22 -4
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +22 -4
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-Cj92yKeA.d.mts → types-B-ubjHER.d.mts} +1 -1
- package/dist/{types-DOeL-dIw.d.ts → types-Bgn5gxHQ.d.ts} +1 -1
- package/dist/{types-Cwrvo30g.d.mts → types-CKe8O0lR.d.mts} +65 -3
- package/dist/{types-Cwrvo30g.d.ts → types-CKe8O0lR.d.ts} +65 -3
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
|
|
2
|
-
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
2
|
+
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-B-ubjHER.mjs';
|
|
3
3
|
import '../gateway/gateway.mjs';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-CKe8O0lR.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @astrasyncai/adapter-openclaw-browser
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
|
|
2
|
-
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
2
|
+
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-Bgn5gxHQ.js';
|
|
3
3
|
import '../gateway/gateway.js';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-CKe8O0lR.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @astrasyncai/adapter-openclaw-browser
|
package/dist/cli/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as LocalPurposeRule, d as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
1
|
+
import { b as LocalPurposeRule, d as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-B-ubjHER.mjs';
|
|
2
2
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-CKe8O0lR.mjs';
|
|
4
4
|
import '../gateway/gateway.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as LocalPurposeRule, d as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
1
|
+
import { b as LocalPurposeRule, d as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-Bgn5gxHQ.js';
|
|
2
2
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-CKe8O0lR.js';
|
|
4
4
|
import '../gateway/gateway.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
|
|
2
|
-
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
2
|
+
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-B-ubjHER.mjs';
|
|
3
3
|
import '../gateway/gateway.mjs';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-CKe8O0lR.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @astrasyncai/adapter-cursor
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
|
|
2
|
-
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
2
|
+
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-Bgn5gxHQ.js';
|
|
3
3
|
import '../gateway/gateway.js';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-CKe8O0lR.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @astrasyncai/adapter-cursor
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { VSCodeAPI } from './cursor-adapter.mjs';
|
|
2
2
|
import '../adapter-interface/interface.mjs';
|
|
3
3
|
import '../gateway/gateway.mjs';
|
|
4
|
-
import '../types-
|
|
5
|
-
import '../types-
|
|
4
|
+
import '../types-B-ubjHER.mjs';
|
|
5
|
+
import '../types-CKe8O0lR.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* VS Code Extension entry point for AstraSync Local Guard (Cursor/VS Code).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { VSCodeAPI } from './cursor-adapter.js';
|
|
2
2
|
import '../adapter-interface/interface.js';
|
|
3
3
|
import '../gateway/gateway.js';
|
|
4
|
-
import '../types-
|
|
5
|
-
import '../types-
|
|
4
|
+
import '../types-Bgn5gxHQ.js';
|
|
5
|
+
import '../types-CKe8O0lR.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* VS Code Extension entry point for AstraSync Local Guard (Cursor/VS Code).
|
package/dist/cursor/extension.js
CHANGED
|
@@ -3773,7 +3773,7 @@ function getTrustLevel(score) {
|
|
|
3773
3773
|
}
|
|
3774
3774
|
|
|
3775
3775
|
// src/version.ts
|
|
3776
|
-
var SDK_VERSION = "3.
|
|
3776
|
+
var SDK_VERSION = "3.6.0";
|
|
3777
3777
|
|
|
3778
3778
|
// src/well-known.ts
|
|
3779
3779
|
var CACHE_TTL_MS = 60 * 60 * 1e3;
|
|
@@ -3791,10 +3791,10 @@ var DEFAULT_CONFIG = {
|
|
|
3791
3791
|
// through (`hasMinimumAccess('guidance', 'guidance') === true`).
|
|
3792
3792
|
defaultAccessLevel: "none",
|
|
3793
3793
|
// minTrustScore + minTrustScoreForFull deprecated in v2.3.0 — server decides.
|
|
3794
|
-
//
|
|
3795
|
-
//
|
|
3796
|
-
//
|
|
3797
|
-
// Set cacheTtl: 0 to disable caching entirely.
|
|
3794
|
+
// cacheTtl deliberately unset. When undefined, cacheResult applies the 60s
|
|
3795
|
+
// default; the caller's explicit value is honoured for cacheable results.
|
|
3796
|
+
// Denials and step-up escalations are NEVER cached (3.6.0) regardless of
|
|
3797
|
+
// cacheTtl. Set cacheTtl: 0 to disable caching entirely.
|
|
3798
3798
|
debug: false
|
|
3799
3799
|
};
|
|
3800
3800
|
var initCheckPerformed = false;
|
|
@@ -3881,10 +3881,9 @@ function getCachedResult(request, counterpartyId) {
|
|
|
3881
3881
|
}
|
|
3882
3882
|
return null;
|
|
3883
3883
|
}
|
|
3884
|
-
var
|
|
3885
|
-
var DEFAULT_STEP_UP_TTL_SECONDS = 300;
|
|
3884
|
+
var DEFAULT_CACHE_TTL_SECONDS = 60;
|
|
3886
3885
|
function cacheResult(request, result, configuredTtl, counterpartyId) {
|
|
3887
|
-
const ttlSeconds = configuredTtl && configuredTtl > 0 ? configuredTtl :
|
|
3886
|
+
const ttlSeconds = configuredTtl && configuredTtl > 0 ? configuredTtl : DEFAULT_CACHE_TTL_SECONDS;
|
|
3888
3887
|
const key = getCacheKey(request, counterpartyId);
|
|
3889
3888
|
verificationCache.set(key, {
|
|
3890
3889
|
result,
|
|
@@ -4026,7 +4025,7 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
4026
4025
|
};
|
|
4027
4026
|
}
|
|
4028
4027
|
}
|
|
4029
|
-
async function verify(config, request) {
|
|
4028
|
+
async function verify(config, request, options) {
|
|
4030
4029
|
const mergedConfig = { ...DEFAULT_CONFIG, ...config };
|
|
4031
4030
|
const urls = mergedConfig.apiBaseUrl ? getCachedWellKnownUrls(mergedConfig.apiBaseUrl) : void 0;
|
|
4032
4031
|
if (!initCheckPerformed && !mergedConfig.disableInitChecks && mergedConfig.apiBaseUrl) {
|
|
@@ -4042,7 +4041,7 @@ async function verify(config, request) {
|
|
|
4042
4041
|
"[VerificationGateway] minTrustScore / minTrustScoreForFull are deprecated in v2.3.0 and have no effect. Server is now the single source of truth for access-level decisions (the SDK reads access.accessLevel from the verify-access response). To gate access to an endpoint, configure the endpoint's trust_score_requirement server-side."
|
|
4043
4042
|
);
|
|
4044
4043
|
}
|
|
4045
|
-
if (mergedConfig.cacheTtl !== 0) {
|
|
4044
|
+
if (mergedConfig.cacheTtl !== 0 && !options?.bypassCache) {
|
|
4046
4045
|
const cached = getCachedResult(request, mergedConfig.counterpartyId);
|
|
4047
4046
|
if (cached) {
|
|
4048
4047
|
if (mergedConfig.debug) {
|
|
@@ -4062,6 +4061,8 @@ async function verify(config, request) {
|
|
|
4062
4061
|
console.log("[VerificationGateway] Calling verify-access API");
|
|
4063
4062
|
}
|
|
4064
4063
|
const apiResponse = await callVerifyAccessAPI(mergedConfig, enrichedRequest);
|
|
4064
|
+
const rawServerDenialReasons = apiResponse.denialReasons;
|
|
4065
|
+
const serverDenialReasons = Array.isArray(rawServerDenialReasons) && rawServerDenialReasons.length > 0 ? rawServerDenialReasons : void 0;
|
|
4065
4066
|
if (!apiResponse.success) {
|
|
4066
4067
|
return createGuidanceResponse(mergedConfig, apiResponse.error, {
|
|
4067
4068
|
source: "api_error",
|
|
@@ -4083,7 +4084,10 @@ async function verify(config, request) {
|
|
|
4083
4084
|
// ALSO short-circuit on `!identityVerified || !policyAllowed` before
|
|
4084
4085
|
// the gate check — belt-and-braces.
|
|
4085
4086
|
accessLevel: "none",
|
|
4086
|
-
|
|
4087
|
+
// 3.6.0: the server now emits top-level denialReasons on every deny
|
|
4088
|
+
// path — prefer it verbatim; the failure-message reconstruction remains
|
|
4089
|
+
// as the fallback for older backends.
|
|
4090
|
+
denialReasons: serverDenialReasons ?? (aggregatedFailures && aggregatedFailures.length > 0 ? aggregatedFailures.map((f) => f.message) : apiResponse.access?.reason ? [apiResponse.access.reason] : ["Access denied"]),
|
|
4087
4091
|
failures: aggregatedFailures,
|
|
4088
4092
|
requiresStepUp: apiResponse.access?.requiresStepUp,
|
|
4089
4093
|
requiresApproval: apiResponse.access?.requiresApproval,
|
|
@@ -4160,9 +4164,7 @@ async function verify(config, request) {
|
|
|
4160
4164
|
if (result.recommendation === "deny") {
|
|
4161
4165
|
result.policyAllowed = false;
|
|
4162
4166
|
result.accessLevel = "none";
|
|
4163
|
-
result.denialReasons = result.recommendationReasons
|
|
4164
|
-
"Access denied by AstraSync recommendation"
|
|
4165
|
-
];
|
|
4167
|
+
result.denialReasons = serverDenialReasons ?? result.recommendationReasons ?? ["Access denied by AstraSync recommendation"];
|
|
4166
4168
|
result.guidance = result.runtimeChallenge ? {
|
|
4167
4169
|
message: `Verification failed: ${result.runtimeChallenge.reason || "runtime challenge failed"}`,
|
|
4168
4170
|
registrationUrl: urls?.registrationUrl ?? "",
|
|
@@ -4174,14 +4176,18 @@ async function verify(config, request) {
|
|
|
4174
4176
|
};
|
|
4175
4177
|
} else if (result.recommendation === "step_up_required") {
|
|
4176
4178
|
result.requiresStepUp = true;
|
|
4177
|
-
result.denialReasons = result.recommendationReasons
|
|
4179
|
+
result.denialReasons = serverDenialReasons ?? result.recommendationReasons ?? ["Step-up verification required"];
|
|
4178
4180
|
}
|
|
4179
|
-
|
|
4181
|
+
const escalates = result.requiresStepUp === true || result.requiresApproval === true || result.recommendation === "step_up_required";
|
|
4182
|
+
if (mergedConfig.cacheTtl !== 0 && result.recommendation !== "deny" && !escalates) {
|
|
4180
4183
|
cacheResult(request, result, mergedConfig.cacheTtl, mergedConfig.counterpartyId);
|
|
4181
4184
|
}
|
|
4182
4185
|
return result;
|
|
4183
4186
|
}
|
|
4184
4187
|
|
|
4188
|
+
// src/adapters/stepup-poll.ts
|
|
4189
|
+
var FALLBACK_MAX_WAIT_MS = 5 * 60 * 1e3;
|
|
4190
|
+
|
|
4185
4191
|
// src/adapters/express.ts
|
|
4186
4192
|
var DEFAULT_ROUTES_REFRESH_MS = 5 * 60 * 1e3;
|
|
4187
4193
|
|