@astrasyncai/verification-gateway 4.4.0 → 4.5.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/adapters/express.js +14 -10
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +14 -10
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.js +12 -9
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +12 -9
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.js +15 -11
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +15 -11
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.js +10 -7
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +10 -7
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +10 -7
- package/dist/bin/astrasync-codex-hook.js +10 -7
- package/dist/bin/astrasync-guard.js +10 -7
- package/dist/bin/astrasync.js +10 -7
- package/dist/browser/background.js +10 -7
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +10 -7
- package/dist/browser/background.mjs.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/codex/index.js +10 -7
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +10 -7
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +10 -7
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +10 -7
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +11 -4
- package/dist/edge-config.d.ts +11 -4
- package/dist/edge-config.js +1 -1
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs +1 -1
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.d.mts +21 -7
- package/dist/edge-core/index.d.ts +21 -7
- package/dist/edge-core/index.js +75 -15
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +75 -15
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.js +10 -7
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +10 -7
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +19 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -15
- package/dist/index.mjs.map +1 -1
- package/dist/registration/index.js +1 -1
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +1 -1
- package/dist/registration/index.mjs.map +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +1 -1
- package/dist/transport/index.mjs.map +1 -1
- package/dist/verify.js +10 -7
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +10 -7
- package/dist/verify.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -173,7 +173,7 @@ declare function detectRuntime(userAgent: string | undefined | null): string | u
|
|
|
173
173
|
* silently (never throwing), so this is a no-op there — which is correct:
|
|
174
174
|
* in a browser the page's real UA is the honest identity.
|
|
175
175
|
*/
|
|
176
|
-
declare const SDK_USER_AGENT = "astrasync-sdk/4.
|
|
176
|
+
declare const SDK_USER_AGENT = "astrasync-sdk/4.5.0";
|
|
177
177
|
declare const sdkFetch: typeof fetch;
|
|
178
178
|
|
|
179
179
|
/**
|
|
@@ -194,6 +194,6 @@ declare const sdkFetch: typeof fetch;
|
|
|
194
194
|
* is fine — bumping both in the release-ceremony commit keeps them
|
|
195
195
|
* lockstep.
|
|
196
196
|
*/
|
|
197
|
-
declare const SDK_VERSION = "4.
|
|
197
|
+
declare const SDK_VERSION = "4.5.0";
|
|
198
198
|
|
|
199
199
|
export { EnhancedVerificationResult, GatewayConfig, RUNTIME_SIGNATURES, type RuntimeSignature, SDK_USER_AGENT, type SettlementDecision, type SettlementRequest, StepUpApprovalInfo, StepUpApprovalStatus, StepUpOutcome, SDK_VERSION as VERSION, type WellKnownAgenticCommerce, authorizeSettlement, awaitStepUpApproval, detectRuntime, getCachedWellKnownUrls, getWellKnownUrls, pollStepUpStatus, prefetchWellKnown, sdkFetch };
|
package/dist/index.d.ts
CHANGED
|
@@ -173,7 +173,7 @@ declare function detectRuntime(userAgent: string | undefined | null): string | u
|
|
|
173
173
|
* silently (never throwing), so this is a no-op there — which is correct:
|
|
174
174
|
* in a browser the page's real UA is the honest identity.
|
|
175
175
|
*/
|
|
176
|
-
declare const SDK_USER_AGENT = "astrasync-sdk/4.
|
|
176
|
+
declare const SDK_USER_AGENT = "astrasync-sdk/4.5.0";
|
|
177
177
|
declare const sdkFetch: typeof fetch;
|
|
178
178
|
|
|
179
179
|
/**
|
|
@@ -194,6 +194,6 @@ declare const sdkFetch: typeof fetch;
|
|
|
194
194
|
* is fine — bumping both in the release-ceremony commit keeps them
|
|
195
195
|
* lockstep.
|
|
196
196
|
*/
|
|
197
|
-
declare const SDK_VERSION = "4.
|
|
197
|
+
declare const SDK_VERSION = "4.5.0";
|
|
198
198
|
|
|
199
199
|
export { EnhancedVerificationResult, GatewayConfig, RUNTIME_SIGNATURES, type RuntimeSignature, SDK_USER_AGENT, type SettlementDecision, type SettlementRequest, StepUpApprovalInfo, StepUpApprovalStatus, StepUpOutcome, SDK_VERSION as VERSION, type WellKnownAgenticCommerce, authorizeSettlement, awaitStepUpApproval, detectRuntime, getCachedWellKnownUrls, getWellKnownUrls, pollStepUpStatus, prefetchWellKnown, sdkFetch };
|
package/dist/index.js
CHANGED
|
@@ -221,7 +221,7 @@ function getCapabilities(accessLevel) {
|
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
// src/version.ts
|
|
224
|
-
var SDK_VERSION = "4.
|
|
224
|
+
var SDK_VERSION = "4.5.0";
|
|
225
225
|
|
|
226
226
|
// src/http.ts
|
|
227
227
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -770,12 +770,15 @@ async function verify(config, request, options) {
|
|
|
770
770
|
const verificationContext = apiResponse.verificationContext;
|
|
771
771
|
const accessLevel = apiResponse.access?.accessLevel ?? "standard";
|
|
772
772
|
const result = {
|
|
773
|
-
//
|
|
774
|
-
//
|
|
775
|
-
//
|
|
776
|
-
//
|
|
777
|
-
//
|
|
778
|
-
|
|
773
|
+
// 4.5.0 (probe F1): read idVerified from verificationContext with the
|
|
774
|
+
// SAME absent⇒false default as the deny branch. The previous `!== false`
|
|
775
|
+
// default manufactured `identityVerified: true` for anonymous
|
|
776
|
+
// allow_full/allow_partial/audit responses (which allow access but omit
|
|
777
|
+
// verificationContext entirely) — the "anonymous caller labelled
|
|
778
|
+
// verified" defect. Every authenticated success response has carried
|
|
779
|
+
// `verificationContext.idVerified: true` since v2.2.4, so a truth claim
|
|
780
|
+
// this load-bearing must never be defaulted on.
|
|
781
|
+
identityVerified: apiResponse.verificationContext?.idVerified === true,
|
|
779
782
|
policyAllowed: true,
|
|
780
783
|
accessLevel,
|
|
781
784
|
agent,
|
|
@@ -1748,9 +1751,10 @@ function detectPlatformFingerprint(input) {
|
|
|
1748
1751
|
|
|
1749
1752
|
// src/edge-core/classify.ts
|
|
1750
1753
|
var STATIC_EXTENSIONS = /\.(css|js|mjs|map|png|jpe?g|gif|webp|avif|svg|ico|woff2?|ttf|otf|eot|mp4|webm|pdf|txt|xml)$/i;
|
|
1754
|
+
var SELF_UA_PATTERN = /^astrasync-sdk\//i;
|
|
1751
1755
|
var BOT_UA_PATTERN = /curl|wget|python-requests|python-urllib|node-fetch|axios|got|okhttp|go-http-client|libwww|httpie|java\/|ruby|php|scrapy|headless|phantomjs|selenium|playwright|puppeteer|bot|crawler|spider|slurp/i;
|
|
1752
1756
|
var BROWSER_UA_PATTERN = /mozilla\/\d/i;
|
|
1753
|
-
var _patterns = { STATIC_EXTENSIONS, BOT_UA_PATTERN, BROWSER_UA_PATTERN };
|
|
1757
|
+
var _patterns = { STATIC_EXTENSIONS, BOT_UA_PATTERN, BROWSER_UA_PATTERN, SELF_UA_PATTERN };
|
|
1754
1758
|
|
|
1755
1759
|
// src/edge-core/events.ts
|
|
1756
1760
|
function sampled(rate, random = Math.random) {
|
|
@@ -2170,7 +2174,7 @@ function createMiddleware(options) {
|
|
|
2170
2174
|
let result = await verify(config, verificationRequest);
|
|
2171
2175
|
req.agentVerification = result;
|
|
2172
2176
|
let sessionId = result.sessionId;
|
|
2173
|
-
if (config.stepUpMaxWaitMs !== void 0 && result.
|
|
2177
|
+
if (config.stepUpMaxWaitMs !== void 0 && result.policyAllowed && requiresHumanApproval(result) && result.stepUpApproval?.pollUrl) {
|
|
2174
2178
|
const outcome = await awaitStepUpApproval(config, result.stepUpApproval);
|
|
2175
2179
|
res.setHeader("X-Astra-Step-Up", outcome);
|
|
2176
2180
|
if (outcome === "approved") {
|
|
@@ -2181,7 +2185,7 @@ function createMiddleware(options) {
|
|
|
2181
2185
|
result.stepUpOutcome = outcome;
|
|
2182
2186
|
}
|
|
2183
2187
|
}
|
|
2184
|
-
if (!result.
|
|
2188
|
+
if (!result.policyAllowed) {
|
|
2185
2189
|
if (shouldRecordDecisions && sessionId) {
|
|
2186
2190
|
recordDecision(config, sessionId, "denied", result.denialReasons?.[0]).catch(() => {
|
|
2187
2191
|
});
|
|
@@ -2682,7 +2686,7 @@ function createMiddleware2(options) {
|
|
|
2682
2686
|
};
|
|
2683
2687
|
let result = await verify(config, verificationRequest);
|
|
2684
2688
|
let stepUpHoldOutcome;
|
|
2685
|
-
if (config.stepUpMaxWaitMs !== void 0 && result.
|
|
2689
|
+
if (config.stepUpMaxWaitMs !== void 0 && result.policyAllowed && requiresHumanApproval(result) && result.stepUpApproval?.pollUrl) {
|
|
2686
2690
|
stepUpHoldOutcome = await awaitStepUpApproval(config, result.stepUpApproval);
|
|
2687
2691
|
if (stepUpHoldOutcome === "approved") {
|
|
2688
2692
|
result = await verify(config, verificationRequest, { bypassCache: true });
|
|
@@ -2690,9 +2694,9 @@ function createMiddleware2(options) {
|
|
|
2690
2694
|
result.stepUpOutcome = stepUpHoldOutcome;
|
|
2691
2695
|
}
|
|
2692
2696
|
}
|
|
2693
|
-
const approvalRequired = result.
|
|
2697
|
+
const approvalRequired = result.policyAllowed && requiresHumanApproval(result);
|
|
2694
2698
|
if (approvalRequired) annotateApprovalRequired(result);
|
|
2695
|
-
if (!result.
|
|
2699
|
+
if (!result.policyAllowed || approvalRequired) {
|
|
2696
2700
|
if (result.misconfigured && pathname.startsWith("/api/")) {
|
|
2697
2701
|
return NextResponse.json(
|
|
2698
2702
|
{
|
|
@@ -5825,7 +5829,7 @@ function createMcpMiddleware(options) {
|
|
|
5825
5829
|
let result = await verify(config, verificationRequest);
|
|
5826
5830
|
req.agentVerification = result;
|
|
5827
5831
|
let sessionId = result.sessionId;
|
|
5828
|
-
if (config.stepUpMaxWaitMs !== void 0 && result.
|
|
5832
|
+
if (config.stepUpMaxWaitMs !== void 0 && result.policyAllowed && requiresHumanApproval(result) && result.stepUpApproval?.pollUrl) {
|
|
5829
5833
|
const outcome = await awaitStepUpApproval(config, result.stepUpApproval);
|
|
5830
5834
|
res.setHeader("X-Astra-Step-Up", outcome);
|
|
5831
5835
|
if (outcome === "approved") {
|
|
@@ -5836,7 +5840,7 @@ function createMcpMiddleware(options) {
|
|
|
5836
5840
|
result.stepUpOutcome = outcome;
|
|
5837
5841
|
}
|
|
5838
5842
|
}
|
|
5839
|
-
if (!result.
|
|
5843
|
+
if (!result.policyAllowed) {
|
|
5840
5844
|
if (shouldRecordDecisions && sessionId) {
|
|
5841
5845
|
recordDecision(config, sessionId, "denied", result.denialReasons?.[0]).catch(() => {
|
|
5842
5846
|
});
|