@astrasyncai/verification-gateway 4.4.0 → 4.5.1
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.d.mts +3 -394
- package/dist/adapters/mcp.d.ts +3 -394
- 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 +11 -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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +30 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -15
- package/dist/index.mjs.map +1 -1
- package/dist/mcp--DgKOwfu.d.ts +396 -0
- package/dist/mcp-BgBJu4Jl.d.mts +396 -0
- package/dist/registration/index.js +2 -1
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +2 -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.mjs
CHANGED
|
@@ -126,7 +126,7 @@ function getCapabilities(accessLevel) {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
// src/version.ts
|
|
129
|
-
var SDK_VERSION = "4.
|
|
129
|
+
var SDK_VERSION = "4.5.1";
|
|
130
130
|
|
|
131
131
|
// src/http.ts
|
|
132
132
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -675,12 +675,15 @@ async function verify(config, request, options) {
|
|
|
675
675
|
const verificationContext = apiResponse.verificationContext;
|
|
676
676
|
const accessLevel = apiResponse.access?.accessLevel ?? "standard";
|
|
677
677
|
const result = {
|
|
678
|
-
//
|
|
679
|
-
//
|
|
680
|
-
//
|
|
681
|
-
//
|
|
682
|
-
//
|
|
683
|
-
|
|
678
|
+
// 4.5.0 (probe F1): read idVerified from verificationContext with the
|
|
679
|
+
// SAME absent⇒false default as the deny branch. The previous `!== false`
|
|
680
|
+
// default manufactured `identityVerified: true` for anonymous
|
|
681
|
+
// allow_full/allow_partial/audit responses (which allow access but omit
|
|
682
|
+
// verificationContext entirely) — the "anonymous caller labelled
|
|
683
|
+
// verified" defect. Every authenticated success response has carried
|
|
684
|
+
// `verificationContext.idVerified: true` since v2.2.4, so a truth claim
|
|
685
|
+
// this load-bearing must never be defaulted on.
|
|
686
|
+
identityVerified: apiResponse.verificationContext?.idVerified === true,
|
|
684
687
|
policyAllowed: true,
|
|
685
688
|
accessLevel,
|
|
686
689
|
agent,
|
|
@@ -1653,9 +1656,10 @@ function detectPlatformFingerprint(input) {
|
|
|
1653
1656
|
|
|
1654
1657
|
// src/edge-core/classify.ts
|
|
1655
1658
|
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;
|
|
1659
|
+
var SELF_UA_PATTERN = /^astrasync-sdk\//i;
|
|
1656
1660
|
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;
|
|
1657
1661
|
var BROWSER_UA_PATTERN = /mozilla\/\d/i;
|
|
1658
|
-
var _patterns = { STATIC_EXTENSIONS, BOT_UA_PATTERN, BROWSER_UA_PATTERN };
|
|
1662
|
+
var _patterns = { STATIC_EXTENSIONS, BOT_UA_PATTERN, BROWSER_UA_PATTERN, SELF_UA_PATTERN };
|
|
1659
1663
|
|
|
1660
1664
|
// src/edge-core/events.ts
|
|
1661
1665
|
function sampled(rate, random = Math.random) {
|
|
@@ -2075,7 +2079,7 @@ function createMiddleware(options) {
|
|
|
2075
2079
|
let result = await verify(config, verificationRequest);
|
|
2076
2080
|
req.agentVerification = result;
|
|
2077
2081
|
let sessionId = result.sessionId;
|
|
2078
|
-
if (config.stepUpMaxWaitMs !== void 0 && result.
|
|
2082
|
+
if (config.stepUpMaxWaitMs !== void 0 && result.policyAllowed && requiresHumanApproval(result) && result.stepUpApproval?.pollUrl) {
|
|
2079
2083
|
const outcome = await awaitStepUpApproval(config, result.stepUpApproval);
|
|
2080
2084
|
res.setHeader("X-Astra-Step-Up", outcome);
|
|
2081
2085
|
if (outcome === "approved") {
|
|
@@ -2086,7 +2090,7 @@ function createMiddleware(options) {
|
|
|
2086
2090
|
result.stepUpOutcome = outcome;
|
|
2087
2091
|
}
|
|
2088
2092
|
}
|
|
2089
|
-
if (!result.
|
|
2093
|
+
if (!result.policyAllowed) {
|
|
2090
2094
|
if (shouldRecordDecisions && sessionId) {
|
|
2091
2095
|
recordDecision(config, sessionId, "denied", result.denialReasons?.[0]).catch(() => {
|
|
2092
2096
|
});
|
|
@@ -2587,7 +2591,7 @@ function createMiddleware2(options) {
|
|
|
2587
2591
|
};
|
|
2588
2592
|
let result = await verify(config, verificationRequest);
|
|
2589
2593
|
let stepUpHoldOutcome;
|
|
2590
|
-
if (config.stepUpMaxWaitMs !== void 0 && result.
|
|
2594
|
+
if (config.stepUpMaxWaitMs !== void 0 && result.policyAllowed && requiresHumanApproval(result) && result.stepUpApproval?.pollUrl) {
|
|
2591
2595
|
stepUpHoldOutcome = await awaitStepUpApproval(config, result.stepUpApproval);
|
|
2592
2596
|
if (stepUpHoldOutcome === "approved") {
|
|
2593
2597
|
result = await verify(config, verificationRequest, { bypassCache: true });
|
|
@@ -2595,9 +2599,9 @@ function createMiddleware2(options) {
|
|
|
2595
2599
|
result.stepUpOutcome = stepUpHoldOutcome;
|
|
2596
2600
|
}
|
|
2597
2601
|
}
|
|
2598
|
-
const approvalRequired = result.
|
|
2602
|
+
const approvalRequired = result.policyAllowed && requiresHumanApproval(result);
|
|
2599
2603
|
if (approvalRequired) annotateApprovalRequired(result);
|
|
2600
|
-
if (!result.
|
|
2604
|
+
if (!result.policyAllowed || approvalRequired) {
|
|
2601
2605
|
if (result.misconfigured && pathname.startsWith("/api/")) {
|
|
2602
2606
|
return NextResponse.json(
|
|
2603
2607
|
{
|
|
@@ -5733,7 +5737,7 @@ function createMcpMiddleware(options) {
|
|
|
5733
5737
|
let result = await verify(config, verificationRequest);
|
|
5734
5738
|
req.agentVerification = result;
|
|
5735
5739
|
let sessionId = result.sessionId;
|
|
5736
|
-
if (config.stepUpMaxWaitMs !== void 0 && result.
|
|
5740
|
+
if (config.stepUpMaxWaitMs !== void 0 && result.policyAllowed && requiresHumanApproval(result) && result.stepUpApproval?.pollUrl) {
|
|
5737
5741
|
const outcome = await awaitStepUpApproval(config, result.stepUpApproval);
|
|
5738
5742
|
res.setHeader("X-Astra-Step-Up", outcome);
|
|
5739
5743
|
if (outcome === "approved") {
|
|
@@ -5744,7 +5748,7 @@ function createMcpMiddleware(options) {
|
|
|
5744
5748
|
result.stepUpOutcome = outcome;
|
|
5745
5749
|
}
|
|
5746
5750
|
}
|
|
5747
|
-
if (!result.
|
|
5751
|
+
if (!result.policyAllowed) {
|
|
5748
5752
|
if (shouldRecordDecisions && sessionId) {
|
|
5749
5753
|
recordDecision(config, sessionId, "denied", result.denialReasons?.[0]).catch(() => {
|
|
5750
5754
|
});
|
|
@@ -6187,6 +6191,7 @@ function buildGuidance(params) {
|
|
|
6187
6191
|
steps: [
|
|
6188
6192
|
"Credentialed path (recommended): have your human mint an agent-scoped API key at Settings \u2192 API Keys, then re-call register_agent with apiKey set. An agent holding its own scoped kya_ key is fine and intended.",
|
|
6189
6193
|
"No-credentials path: call request_registration({ name, ownerEmail, ... }) with the human owner's email \u2014 the only bootstrap credential. No API key is involved.",
|
|
6194
|
+
"Include as much metadata as you can in the registration \u2014 especially model ({ modelName, modelProvider }) and framework ({ frameworkName, frameworkVersion }). Declared platform/model metadata directly improves your trust score and attributes your traffic correctly.",
|
|
6190
6195
|
"The owner approves via an emailed link (first time, they create an account and complete a quick verification).",
|
|
6191
6196
|
"Use poll_registration({ requestId }) once the owner confirms approval to retrieve the astraId.",
|
|
6192
6197
|
"Never transmit a password or private key over the MCP wire \u2014 those are never required."
|
|
@@ -6572,6 +6577,8 @@ export {
|
|
|
6572
6577
|
MAX_HEADERS,
|
|
6573
6578
|
MAX_HEADER_VALUE_BYTES,
|
|
6574
6579
|
MAX_TOTAL_BYTES,
|
|
6580
|
+
MCP_VERIFIED_HOP_HEADER,
|
|
6581
|
+
MCP_VERIFIED_HOP_MAX_AGE_MS,
|
|
6575
6582
|
PLATFORM_AGENT_SIGNATURES,
|
|
6576
6583
|
RUNTIME_SIGNATURES,
|
|
6577
6584
|
RegistrationDeniedError,
|
|
@@ -6609,9 +6616,11 @@ export {
|
|
|
6609
6616
|
hasCredentials,
|
|
6610
6617
|
hasMinimumAccess,
|
|
6611
6618
|
isEdgeConfig,
|
|
6619
|
+
isVerifiedHopValidFor,
|
|
6612
6620
|
matchEdgePathRule,
|
|
6613
6621
|
matchPlatformSignature,
|
|
6614
6622
|
nextjs_exports as nextjs,
|
|
6623
|
+
parseVerifiedHop,
|
|
6615
6624
|
pollStepUpStatus,
|
|
6616
6625
|
prefetchWellKnown,
|
|
6617
6626
|
quickVerify,
|
|
@@ -6621,6 +6630,7 @@ export {
|
|
|
6621
6630
|
sanitizeHeaders,
|
|
6622
6631
|
sdk_exports as sdk,
|
|
6623
6632
|
sdkFetch,
|
|
6633
|
+
serializeVerifiedHop,
|
|
6624
6634
|
setMcpMeta,
|
|
6625
6635
|
transport_exports as transport,
|
|
6626
6636
|
verify
|