@astrasyncai/verification-gateway 5.0.0 → 5.1.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 +19 -2
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +19 -2
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +2 -2
- package/dist/adapters/mcp.d.ts +2 -2
- package/dist/adapters/mcp.js +19 -2
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +19 -2
- 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 +19 -2
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +19 -2
- 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 -2
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +19 -2
- 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 +19 -2
- package/dist/bin/astrasync-codex-hook.js +19 -2
- package/dist/bin/astrasync-guard.js +19 -2
- package/dist/bin/astrasync.js +19 -2
- package/dist/browser/background.js +19 -2
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +19 -2
- 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 +19 -2
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +19 -2
- 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 +19 -2
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +19 -2
- 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/edge-core/index.d.mts +12 -1
- package/dist/edge-core/index.d.ts +12 -1
- package/dist/edge-core/index.js +36 -3
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +36 -3
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/{express-Dm-snUuY.d.mts → express-KkBZBMqi.d.mts} +1 -1
- package/dist/{express-B5lWuemA.d.ts → express-xK8pRrmj.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 +19 -2
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +19 -2
- 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-B5k_vUmK.d.mts → index-DIRzR5IS.d.mts} +1 -1
- package/dist/{index-y8xToocF.d.ts → index-DLQ4Rcuc.d.ts} +1 -1
- package/dist/{index-BOzM6xUq.d.mts → index-GPDn_EGI.d.mts} +1 -1
- package/dist/{index-dRfxUdFA.d.ts → index-Hnz5VyMR.d.ts} +1 -1
- package/dist/index.d.mts +12 -8
- package/dist/index.d.ts +12 -8
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -2
- 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/{mcp-OosmAcKf.d.ts → mcp-DPpu4xQz.d.ts} +1 -1
- package/dist/{mcp-DgsyQiQq.d.mts → mcp-Dju_Sr1o.d.mts} +1 -1
- package/dist/{nextjs-B1sBdEav.d.mts → nextjs-BuoDBN4g.d.mts} +1 -1
- package/dist/{nextjs-DoRmhV_Z.d.ts → nextjs-rZKzY_8o.d.ts} +1 -1
- package/dist/{sdk-B83N3xKc.d.mts → sdk-CdO6TIEf.d.mts} +1 -1
- package/dist/{sdk-H_9BTNBS.d.ts → sdk-DxHuIJBm.d.ts} +1 -1
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/{types-CXf3q4kZ.d.ts → types-3UV7IZx7.d.ts} +1 -1
- package/dist/{types-BK2POWNc.d.ts → types-CNBaZKxY.d.ts} +9 -0
- package/dist/{types-CJjZvPr9.d.mts → types-CSHcByFX.d.mts} +9 -0
- package/dist/{types-DQmop7ZW.d.mts → types-CoDjpbVY.d.mts} +1 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/verify.d.mts +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js +19 -2
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +19 -2
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
package/dist/edge-config.d.mts
CHANGED
package/dist/edge-config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EdgeMode, EdgeVerificationDepth, EdgeConfig } from '../edge-config.mjs';
|
|
2
2
|
import { PlatformFingerprint } from '../platform-signatures.mjs';
|
|
3
|
-
import { e as CommerceArtifactsPayload, v as VerificationRequest } from '../types-
|
|
3
|
+
import { e as CommerceArtifactsPayload, v as VerificationRequest } from '../types-CSHcByFX.mjs';
|
|
4
4
|
import { verify } from '../verify.mjs';
|
|
5
5
|
import { ObservedMetadata } from '../metadata-capture.mjs';
|
|
6
6
|
|
|
@@ -132,6 +132,11 @@ interface TierOutcome {
|
|
|
132
132
|
message?: string;
|
|
133
133
|
registrationUrl?: string;
|
|
134
134
|
documentationUrl?: string;
|
|
135
|
+
mcp?: {
|
|
136
|
+
endpoint?: string;
|
|
137
|
+
discoveryUrl?: string;
|
|
138
|
+
message?: string;
|
|
139
|
+
};
|
|
135
140
|
};
|
|
136
141
|
stepUp?: {
|
|
137
142
|
pollUrl?: string;
|
|
@@ -362,6 +367,12 @@ interface DenyBody {
|
|
|
362
367
|
message?: string;
|
|
363
368
|
registrationUrl?: string;
|
|
364
369
|
documentationUrl?: string;
|
|
370
|
+
/** 5.1.0: MCP-connector steering — the keyless, human-approved path. */
|
|
371
|
+
mcp?: {
|
|
372
|
+
endpoint: string;
|
|
373
|
+
discoveryUrl?: string;
|
|
374
|
+
message: string;
|
|
375
|
+
};
|
|
365
376
|
};
|
|
366
377
|
};
|
|
367
378
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EdgeMode, EdgeVerificationDepth, EdgeConfig } from '../edge-config.js';
|
|
2
2
|
import { PlatformFingerprint } from '../platform-signatures.js';
|
|
3
|
-
import { e as CommerceArtifactsPayload, v as VerificationRequest } from '../types-
|
|
3
|
+
import { e as CommerceArtifactsPayload, v as VerificationRequest } from '../types-CNBaZKxY.js';
|
|
4
4
|
import { verify } from '../verify.js';
|
|
5
5
|
import { ObservedMetadata } from '../metadata-capture.js';
|
|
6
6
|
|
|
@@ -132,6 +132,11 @@ interface TierOutcome {
|
|
|
132
132
|
message?: string;
|
|
133
133
|
registrationUrl?: string;
|
|
134
134
|
documentationUrl?: string;
|
|
135
|
+
mcp?: {
|
|
136
|
+
endpoint?: string;
|
|
137
|
+
discoveryUrl?: string;
|
|
138
|
+
message?: string;
|
|
139
|
+
};
|
|
135
140
|
};
|
|
136
141
|
stepUp?: {
|
|
137
142
|
pollUrl?: string;
|
|
@@ -362,6 +367,12 @@ interface DenyBody {
|
|
|
362
367
|
message?: string;
|
|
363
368
|
registrationUrl?: string;
|
|
364
369
|
documentationUrl?: string;
|
|
370
|
+
/** 5.1.0: MCP-connector steering — the keyless, human-approved path. */
|
|
371
|
+
mcp?: {
|
|
372
|
+
endpoint: string;
|
|
373
|
+
discoveryUrl?: string;
|
|
374
|
+
message: string;
|
|
375
|
+
};
|
|
365
376
|
};
|
|
366
377
|
};
|
|
367
378
|
}
|
package/dist/edge-core/index.js
CHANGED
|
@@ -528,6 +528,14 @@ function extractCredentials(headers, query) {
|
|
|
528
528
|
}
|
|
529
529
|
return credentials;
|
|
530
530
|
}
|
|
531
|
+
function mcpGuidance(urls) {
|
|
532
|
+
if (!urls?.mcpEndpoint) return void 0;
|
|
533
|
+
return {
|
|
534
|
+
endpoint: urls.mcpEndpoint,
|
|
535
|
+
discoveryUrl: urls.mcpDiscoveryUrl,
|
|
536
|
+
message: "If you are operating inside an MCP-capable host (Claude, ChatGPT, Cursor, or any MCP client), add the AstraSync MCP connector instead of integrating these URLs by hand: registration through the connector is KEYLESS and HUMAN-APPROVED \u2014 your human approves in an in-chat card, and you never see, hold, or transmit an API key, password, or private key."
|
|
537
|
+
};
|
|
538
|
+
}
|
|
531
539
|
function createGuidanceResponse(_config, reason, options = {}) {
|
|
532
540
|
const source = options.source ?? "no_credentials";
|
|
533
541
|
const isApiError = source === "api_error";
|
|
@@ -554,11 +562,17 @@ function createGuidanceResponse(_config, reason, options = {}) {
|
|
|
554
562
|
registrationUrl: urls?.registrationUrl ?? "",
|
|
555
563
|
documentationUrl: urls?.documentationUrl ?? "",
|
|
556
564
|
steps: [
|
|
565
|
+
// MCP steering leads when the hosted bridge is advertised — the
|
|
566
|
+
// connector is the agent-actionable path (keyless, human-approved).
|
|
567
|
+
...urls?.mcpEndpoint ? [
|
|
568
|
+
`Fastest path (inside an MCP host): add the AstraSync MCP connector at ${urls.mcpEndpoint} \u2014 keyless, human-approved registration`
|
|
569
|
+
] : [],
|
|
557
570
|
"Register for an AstraSync account",
|
|
558
571
|
"Create and register your agent",
|
|
559
572
|
"Add your ASTRA-ID to request headers",
|
|
560
573
|
"Retry your request"
|
|
561
|
-
]
|
|
574
|
+
],
|
|
575
|
+
...mcpGuidance(urls) && { mcp: mcpGuidance(urls) }
|
|
562
576
|
};
|
|
563
577
|
return {
|
|
564
578
|
// Round-18 G4: createGuidanceResponse fires for unverified-agent path or
|
|
@@ -777,7 +791,10 @@ async function verify(config, request, options) {
|
|
|
777
791
|
guidance: {
|
|
778
792
|
message: apiResponse.access?.reason || "Access denied by PDLSS policy",
|
|
779
793
|
registrationUrl: urls?.registrationUrl ?? "",
|
|
780
|
-
documentationUrl: urls?.documentationUrl ?? ""
|
|
794
|
+
documentationUrl: urls?.documentationUrl ?? "",
|
|
795
|
+
// 5.1.0: anonymous callers land on this branch — steer MCP-hosted
|
|
796
|
+
// agents to the connector (this is what the edge deny body surfaces).
|
|
797
|
+
...mcpGuidance(urls) && { mcp: mcpGuidance(urls) }
|
|
781
798
|
},
|
|
782
799
|
verifiedAt: /* @__PURE__ */ new Date(),
|
|
783
800
|
// Extract sessionId so decisions can be recorded for denials too
|
|
@@ -1140,8 +1157,17 @@ var PROTOCOL_MESSAGES = {
|
|
|
1140
1157
|
"platform-ua": "This traffic was identified as a platform AI agent without AstraSync credentials. Register the agent to access this property with a verified identity.",
|
|
1141
1158
|
"x-astra": "The presented AstraSync credentials failed verification or were denied by this property\u2019s access policy."
|
|
1142
1159
|
};
|
|
1160
|
+
function fallbackMcpEndpoint(origin) {
|
|
1161
|
+
try {
|
|
1162
|
+
const host = new URL(origin).hostname.replace(/^www\./, "");
|
|
1163
|
+
if (host === "astrasync.ai" || host.endsWith(".astrasync.ai")) return `https://mcp.${host}/mcp`;
|
|
1164
|
+
} catch {
|
|
1165
|
+
}
|
|
1166
|
+
return void 0;
|
|
1167
|
+
}
|
|
1143
1168
|
function buildDenyBody(outcome, apiBaseUrl) {
|
|
1144
1169
|
const origin = apiBaseUrl.replace(/\/api\/?$/, "");
|
|
1170
|
+
const mcpEndpoint = outcome.guidance?.mcp?.endpoint || fallbackMcpEndpoint(origin);
|
|
1145
1171
|
const protocolMessage = (outcome.protocol && PROTOCOL_MESSAGES[outcome.protocol]) ?? "This request could not be verified by AstraSync.";
|
|
1146
1172
|
return {
|
|
1147
1173
|
success: false,
|
|
@@ -1158,7 +1184,14 @@ function buildDenyBody(outcome, apiBaseUrl) {
|
|
|
1158
1184
|
// well-known cache is cold — empty means "use the fallback".
|
|
1159
1185
|
message: outcome.guidance?.message || "Register this agent with AstraSync to receive verifiable credentials.",
|
|
1160
1186
|
registrationUrl: outcome.guidance?.registrationUrl || `${origin}/register`,
|
|
1161
|
-
documentationUrl: outcome.guidance?.documentationUrl || `${origin}/docs/edge-adapter
|
|
1187
|
+
documentationUrl: outcome.guidance?.documentationUrl || `${origin}/docs/edge-adapter`,
|
|
1188
|
+
...mcpEndpoint && {
|
|
1189
|
+
mcp: {
|
|
1190
|
+
endpoint: mcpEndpoint,
|
|
1191
|
+
discoveryUrl: outcome.guidance?.mcp?.discoveryUrl || `${mcpEndpoint.replace(/\/mcp$/, "")}/.well-known/mcp.json`,
|
|
1192
|
+
message: outcome.guidance?.mcp?.message || "Inside an MCP host? Add the AstraSync MCP connector at this endpoint instead of the registration URL \u2014 registration through the connector is keyless and human-approved (your human approves in an in-chat card; you never handle credentials)."
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1162
1195
|
}
|
|
1163
1196
|
}
|
|
1164
1197
|
};
|