@astrasyncai/verification-gateway 2.3.4 → 2.3.8
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 +101 -22
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +100 -19
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +245 -0
- package/dist/adapters/mcp.d.ts +245 -0
- package/dist/adapters/mcp.js +619 -0
- package/dist/adapters/mcp.js.map +1 -0
- package/dist/adapters/mcp.mjs +585 -0
- package/dist/adapters/mcp.mjs.map +1 -0
- package/dist/adapters/nextjs.d.mts +2 -2
- package/dist/adapters/nextjs.d.ts +2 -2
- package/dist/adapters/nextjs.js +76 -4
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +76 -4
- 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 +22 -2
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +22 -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/browser/background.js +28 -2
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +28 -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/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 +28 -2
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +28 -2
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/{express-DtvJ6BGt.d.mts → express-BNWqDVIz.d.mts} +17 -14
- package/dist/{express-CraCA8_t.d.ts → express-BYup_4Jg.d.ts} +17 -14
- package/dist/gateway/gateway.d.mts +2 -2
- package/dist/gateway/gateway.d.ts +2 -2
- package/dist/gateway/gateway.js +28 -2
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +28 -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-SEgnWzkf.d.mts → index-BHXa2WTO.d.mts} +1 -1
- package/dist/{index-BZ85CeEr.d.mts → index-CK4lNLVn.d.mts} +1 -1
- package/dist/{index--KzVRa32.d.ts → index-CSMpOcxV.d.ts} +1 -1
- package/dist/{index-BzAFmemy.d.ts → index-DN3ztP2d.d.ts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +135 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +135 -21
- 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-DZHAn9j-.d.mts → nextjs-Bzdfu8Eg.d.mts} +8 -2
- package/dist/{nextjs-B8o9C0t6.d.ts → nextjs-C4h_MpgK.d.ts} +8 -2
- package/dist/{sdk-CRSUFQH2.d.mts → sdk-CDdD7EcJ.d.mts} +1 -1
- package/dist/{sdk-BQ3olp3v.d.ts → sdk-Tzsn6s-O.d.ts} +1 -1
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/{types-osMd_dpT.d.ts → types-Bzp1SMaD.d.ts} +1 -1
- package/dist/{types-JMgPake9.d.mts → types-D_tmbDA_.d.mts} +75 -7
- package/dist/{types-JMgPake9.d.ts → types-D_tmbDA_.d.ts} +75 -7
- package/dist/{types-aN1UHhyy.d.mts → types-z-QVnG4b.d.mts} +1 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/package.json +6 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestHandler, Request } from 'express';
|
|
2
|
-
import { V as VerificationResult, E as ExpressMiddlewareOptions, A as AstraSyncCredentials
|
|
2
|
+
import { V as VerificationResult, E as ExpressMiddlewareOptions, A as AstraSyncCredentials } from './types-D_tmbDA_.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AstraSync Universal Verification Gateway - Express Middleware
|
|
@@ -41,24 +41,27 @@ declare global {
|
|
|
41
41
|
*/
|
|
42
42
|
declare function extractAstraSyncCredentials(req: Request): AstraSyncCredentials | null;
|
|
43
43
|
/**
|
|
44
|
-
* Create Express middleware for agent verification
|
|
44
|
+
* Create Express middleware for agent verification.
|
|
45
|
+
*
|
|
46
|
+
* v2.9.7 moved per-route policy authority out of merchant-side source code
|
|
47
|
+
* into the AstraSync dashboard. `createMiddleware` no longer accepts a
|
|
48
|
+
* `routes` array — it fetches the endpoint's stored policy via
|
|
49
|
+
* `GET /endpoints/:counterpartyId/routes` on init and refreshes
|
|
50
|
+
* periodically. Policy edits in the dashboard take effect on the next
|
|
51
|
+
* refresh (or sooner if the operator manually restarts the SDK).
|
|
52
|
+
*
|
|
53
|
+
* `counterpartyId` is required: the SDK can't know which endpoint's policy
|
|
54
|
+
* to fetch without it. Local-development workflows that don't have an
|
|
55
|
+
* AstraSync endpoint registered can omit it — the middleware logs a
|
|
56
|
+
* one-time warning and falls through (allows all) until a policy is
|
|
57
|
+
* fetchable.
|
|
45
58
|
*/
|
|
46
59
|
declare function createMiddleware(options: ExpressMiddlewareOptions): RequestHandler;
|
|
47
|
-
/**
|
|
48
|
-
* Create a middleware that requires a specific access level
|
|
49
|
-
*/
|
|
50
|
-
declare function requireAccess(minAccessLevel: AccessLevel, options: ExpressMiddlewareOptions): RequestHandler;
|
|
51
|
-
/**
|
|
52
|
-
* Create a middleware that only verifies (doesn't block)
|
|
53
|
-
*/
|
|
54
|
-
declare function verifyOnly(options: Omit<ExpressMiddlewareOptions, 'routes' | 'onDenied'>): RequestHandler;
|
|
55
60
|
|
|
56
61
|
declare const express_createMiddleware: typeof createMiddleware;
|
|
57
62
|
declare const express_extractAstraSyncCredentials: typeof extractAstraSyncCredentials;
|
|
58
|
-
declare const express_requireAccess: typeof requireAccess;
|
|
59
|
-
declare const express_verifyOnly: typeof verifyOnly;
|
|
60
63
|
declare namespace express {
|
|
61
|
-
export { express_createMiddleware as createMiddleware, express_extractAstraSyncCredentials as extractAstraSyncCredentials
|
|
64
|
+
export { express_createMiddleware as createMiddleware, express_extractAstraSyncCredentials as extractAstraSyncCredentials };
|
|
62
65
|
}
|
|
63
66
|
|
|
64
|
-
export { extractAstraSyncCredentials as a, createMiddleware as c, express as e
|
|
67
|
+
export { extractAstraSyncCredentials as a, createMiddleware as c, express as e };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestHandler, Request } from 'express';
|
|
2
|
-
import { V as VerificationResult, E as ExpressMiddlewareOptions, A as AstraSyncCredentials
|
|
2
|
+
import { V as VerificationResult, E as ExpressMiddlewareOptions, A as AstraSyncCredentials } from './types-D_tmbDA_.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AstraSync Universal Verification Gateway - Express Middleware
|
|
@@ -41,24 +41,27 @@ declare global {
|
|
|
41
41
|
*/
|
|
42
42
|
declare function extractAstraSyncCredentials(req: Request): AstraSyncCredentials | null;
|
|
43
43
|
/**
|
|
44
|
-
* Create Express middleware for agent verification
|
|
44
|
+
* Create Express middleware for agent verification.
|
|
45
|
+
*
|
|
46
|
+
* v2.9.7 moved per-route policy authority out of merchant-side source code
|
|
47
|
+
* into the AstraSync dashboard. `createMiddleware` no longer accepts a
|
|
48
|
+
* `routes` array — it fetches the endpoint's stored policy via
|
|
49
|
+
* `GET /endpoints/:counterpartyId/routes` on init and refreshes
|
|
50
|
+
* periodically. Policy edits in the dashboard take effect on the next
|
|
51
|
+
* refresh (or sooner if the operator manually restarts the SDK).
|
|
52
|
+
*
|
|
53
|
+
* `counterpartyId` is required: the SDK can't know which endpoint's policy
|
|
54
|
+
* to fetch without it. Local-development workflows that don't have an
|
|
55
|
+
* AstraSync endpoint registered can omit it — the middleware logs a
|
|
56
|
+
* one-time warning and falls through (allows all) until a policy is
|
|
57
|
+
* fetchable.
|
|
45
58
|
*/
|
|
46
59
|
declare function createMiddleware(options: ExpressMiddlewareOptions): RequestHandler;
|
|
47
|
-
/**
|
|
48
|
-
* Create a middleware that requires a specific access level
|
|
49
|
-
*/
|
|
50
|
-
declare function requireAccess(minAccessLevel: AccessLevel, options: ExpressMiddlewareOptions): RequestHandler;
|
|
51
|
-
/**
|
|
52
|
-
* Create a middleware that only verifies (doesn't block)
|
|
53
|
-
*/
|
|
54
|
-
declare function verifyOnly(options: Omit<ExpressMiddlewareOptions, 'routes' | 'onDenied'>): RequestHandler;
|
|
55
60
|
|
|
56
61
|
declare const express_createMiddleware: typeof createMiddleware;
|
|
57
62
|
declare const express_extractAstraSyncCredentials: typeof extractAstraSyncCredentials;
|
|
58
|
-
declare const express_requireAccess: typeof requireAccess;
|
|
59
|
-
declare const express_verifyOnly: typeof verifyOnly;
|
|
60
63
|
declare namespace express {
|
|
61
|
-
export { express_createMiddleware as createMiddleware, express_extractAstraSyncCredentials as extractAstraSyncCredentials
|
|
64
|
+
export { express_createMiddleware as createMiddleware, express_extractAstraSyncCredentials as extractAstraSyncCredentials };
|
|
62
65
|
}
|
|
63
66
|
|
|
64
|
-
export { extractAstraSyncCredentials as a, createMiddleware as c, express as e
|
|
67
|
+
export { extractAstraSyncCredentials as a, createMiddleware as c, express as e };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as AstraSyncGatewayConfig, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
2
|
-
import '../types-
|
|
1
|
+
import { b as AstraSyncGatewayConfig, P as PDLSSContext, V as VerificationDecision } from '../types-z-QVnG4b.mjs';
|
|
2
|
+
import '../types-D_tmbDA_.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AstraSyncGateway — Primary API surface for agent verification.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as AstraSyncGatewayConfig, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
2
|
-
import '../types-
|
|
1
|
+
import { b as AstraSyncGatewayConfig, P as PDLSSContext, V as VerificationDecision } from '../types-Bzp1SMaD.js';
|
|
2
|
+
import '../types-D_tmbDA_.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AstraSyncGateway — Primary API surface for agent verification.
|
package/dist/gateway/gateway.js
CHANGED
|
@@ -3179,6 +3179,23 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
3179
3179
|
body: JSON.stringify(body)
|
|
3180
3180
|
});
|
|
3181
3181
|
const data = await response.json();
|
|
3182
|
+
if (response.status === 410) {
|
|
3183
|
+
return {
|
|
3184
|
+
success: true,
|
|
3185
|
+
access: {
|
|
3186
|
+
allowed: false,
|
|
3187
|
+
accessLevel: "none",
|
|
3188
|
+
reason: "endpoint_deactivated",
|
|
3189
|
+
failures: [
|
|
3190
|
+
{
|
|
3191
|
+
dimension: "endpoint.deactivated",
|
|
3192
|
+
message: typeof data?.message === "string" ? data.message : "Endpoint has been deactivated",
|
|
3193
|
+
guidance: typeof data?.guidance === "string" ? data.guidance : "Reactivate via POST /api/endpoints/{id}/reactivate, or update the URL on the calling agent."
|
|
3194
|
+
}
|
|
3195
|
+
]
|
|
3196
|
+
}
|
|
3197
|
+
};
|
|
3198
|
+
}
|
|
3182
3199
|
if (!response.ok) {
|
|
3183
3200
|
return {
|
|
3184
3201
|
success: false,
|
|
@@ -3229,10 +3246,12 @@ async function verify(config, request) {
|
|
|
3229
3246
|
return createGuidanceResponse(mergedConfig, apiResponse.error);
|
|
3230
3247
|
}
|
|
3231
3248
|
if (!apiResponse.access?.allowed) {
|
|
3249
|
+
const aggregatedFailures = apiResponse.access?.failures;
|
|
3232
3250
|
const result2 = {
|
|
3233
3251
|
verified: false,
|
|
3234
3252
|
accessLevel: "guidance",
|
|
3235
|
-
denialReasons: apiResponse.access?.reason ? [apiResponse.access.reason] : ["Access denied"],
|
|
3253
|
+
denialReasons: aggregatedFailures && aggregatedFailures.length > 0 ? aggregatedFailures.map((f) => f.message) : apiResponse.access?.reason ? [apiResponse.access.reason] : ["Access denied"],
|
|
3254
|
+
failures: aggregatedFailures,
|
|
3236
3255
|
requiresStepUp: apiResponse.access?.requiresStepUp,
|
|
3237
3256
|
requiresApproval: apiResponse.access?.requiresApproval,
|
|
3238
3257
|
guidance: {
|
|
@@ -3286,7 +3305,8 @@ async function verify(config, request) {
|
|
|
3286
3305
|
runtimeChallenge: apiResponse.runtimeChallenge,
|
|
3287
3306
|
tokenGuidance: apiResponse.tokenGuidance,
|
|
3288
3307
|
recommendation: apiResponse.recommendation,
|
|
3289
|
-
recommendationReasons: apiResponse.recommendationReasons
|
|
3308
|
+
recommendationReasons: apiResponse.recommendationReasons,
|
|
3309
|
+
warningHeader: apiResponse.warningHeader
|
|
3290
3310
|
};
|
|
3291
3311
|
if (result.recommendation === "deny") {
|
|
3292
3312
|
result.verified = false;
|
|
@@ -3314,6 +3334,12 @@ async function verify(config, request) {
|
|
|
3314
3334
|
return result;
|
|
3315
3335
|
}
|
|
3316
3336
|
|
|
3337
|
+
// src/adapters/express.ts
|
|
3338
|
+
var DEFAULT_ROUTES_REFRESH_MS = 5 * 60 * 1e3;
|
|
3339
|
+
|
|
3340
|
+
// src/adapters/nextjs.ts
|
|
3341
|
+
var DEFAULT_ROUTES_REFRESH_MS2 = 5 * 60 * 1e3;
|
|
3342
|
+
|
|
3317
3343
|
// src/transport/rfc9421.ts
|
|
3318
3344
|
var import_structured_headers = require("structured-headers");
|
|
3319
3345
|
|