@astrasyncai/verification-gateway 3.11.0 → 3.12.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 +22 -3
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +22 -3
- 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 +22 -3
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +22 -3
- 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 +22 -3
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +22 -3
- 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 -3
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +22 -3
- 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 +84 -21
- package/dist/bin/astrasync-codex-hook.js +84 -21
- package/dist/bin/astrasync-guard.js +84 -21
- package/dist/bin/astrasync.js +85 -21
- package/dist/browser/background.js +84 -21
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +84 -21
- 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 +84 -21
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +84 -21
- 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 +84 -21
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +84 -21
- 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/{express-DCXa1oqj.d.mts → express-B39o89gf.d.mts} +1 -1
- package/dist/{express-ClNtDhhc.d.ts → express-BuxKNO_q.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 +84 -21
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +84 -21
- 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-CfHurO1P.d.ts → index-BG62SXso.d.ts} +1 -1
- package/dist/{index-D2ztkumS.d.ts → index-CLHdqs2M.d.ts} +1 -1
- package/dist/{index-Dr_XiN65.d.mts → index-CqydB4ks.d.mts} +1 -1
- package/dist/{index-BrNKDmiR.d.mts → index-DME3w3lf.d.mts} +1 -1
- package/dist/index.d.mts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +42 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -3
- package/dist/index.mjs.map +1 -1
- package/dist/local-evaluator/evaluator.d.mts +11 -2
- package/dist/local-evaluator/evaluator.d.ts +11 -2
- package/dist/local-evaluator/evaluator.js +20 -9
- package/dist/local-evaluator/evaluator.js.map +1 -1
- package/dist/local-evaluator/evaluator.mjs +20 -9
- package/dist/local-evaluator/evaluator.mjs.map +1 -1
- package/dist/{nextjs-DcQIk6Zj.d.mts → nextjs-D74W7wt-.d.mts} +1 -1
- package/dist/{nextjs-CEBVBsdi.d.ts → nextjs-Ddlw_J1J.d.ts} +1 -1
- package/dist/{sdk-CZkbSOeO.d.mts → sdk-Bn6bj7kt.d.mts} +1 -1
- package/dist/{sdk-H0JCLW2y.d.ts → sdk-CT7gdkfR.d.ts} +1 -1
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/{types-sy3tq8lp.d.mts → types-BntuzEEn.d.mts} +103 -1
- package/dist/{types-BV6abBnF.d.mts → types-DHu7m9HI.d.ts} +7 -2
- package/dist/{types-C23_uaY8.d.ts → types-Djw4GLtz.d.mts} +7 -2
- package/dist/{types-9tns4wyl.d.ts → types-SDu4Llbe.d.ts} +103 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/verify.d.mts +13 -2
- package/dist/verify.d.ts +13 -2
- package/dist/verify.js +42 -3
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +41 -3
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AstraSyncGateway } from '../gateway/gateway.mjs';
|
|
2
|
-
import { V as VerificationDecision, P as PDLSSContext } from '../types-
|
|
3
|
-
import '../types-
|
|
2
|
+
import { V as VerificationDecision, P as PDLSSContext } from '../types-Djw4GLtz.mjs';
|
|
3
|
+
import '../types-BntuzEEn.mjs';
|
|
4
4
|
import '../metadata-capture.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AstraSyncGateway } from '../gateway/gateway.js';
|
|
2
|
-
import { V as VerificationDecision, P as PDLSSContext } from '../types-
|
|
3
|
-
import '../types-
|
|
2
|
+
import { V as VerificationDecision, P as PDLSSContext } from '../types-DHu7m9HI.js';
|
|
3
|
+
import '../types-SDu4Llbe.js';
|
|
4
4
|
import '../metadata-capture.js';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { G as GatewayConfig,
|
|
2
|
-
export { a as AccessLevel, b as AgentCredentials, c as AstraSyncCredentials, C as CommerceArtifactsPayload,
|
|
3
|
-
export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, e as getCapabilities, f as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-
|
|
4
|
-
export { VerifyOptions, clearCache, extractCredentials, fetchRoutes, hasCredentials, quickVerify, reportUnregisteredAttempt, verify } from './verify.mjs';
|
|
5
|
-
export { e as express } from './express-
|
|
6
|
-
export { n as nextjs } from './nextjs-
|
|
7
|
-
export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-
|
|
1
|
+
import { G as GatewayConfig, s as StepUpApprovalInfo, u as StepUpOutcome, t as StepUpApprovalStatus, E as EnhancedVerificationResult, A as AccessFailure } from './types-BntuzEEn.mjs';
|
|
2
|
+
export { a as AccessLevel, b as AgentCredentials, c as AstraSyncCredentials, d as AttemptOutcome, e as AttemptReport, C as CallerMetadata, f as CommerceArtifactsPayload, g as CommerceShieldProps, h as ConsiderationItem, i as ConsiderationSet, j as CounterpartyType, k as ExpressMiddlewareOptions, F as FiatSettlementBinding, l as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, m as ProtocolTransport, R as RouteAccessConfig, n as RuntimeChallengeResult, S as SDKOptions, o as SettlementArtifact, p as SettlementArtifactBinding, q as SettlementArtifactBindingBase, r as StablecoinSettlementBinding, T as TokenGuidance, v as TrustLevel, V as VerificationRequest, w as VerificationResult, x as VerifiedAgent, y as VerifiedDeveloper, z as VerifiedOrganization } from './types-BntuzEEn.mjs';
|
|
3
|
+
export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, e as getCapabilities, f as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-Bn6bj7kt.mjs';
|
|
4
|
+
export { VerifyOptions, clearCache, extractCredentials, fetchRoutes, hasCredentials, quickVerify, reportAttempt, reportUnregisteredAttempt, verify } from './verify.mjs';
|
|
5
|
+
export { e as express } from './express-B39o89gf.mjs';
|
|
6
|
+
export { n as nextjs } from './nextjs-D74W7wt-.mjs';
|
|
7
|
+
export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-DME3w3lf.mjs';
|
|
8
8
|
export { McpMiddlewareOptions, ToolGateConfig, createMcpMiddleware } from './adapters/mcp.mjs';
|
|
9
9
|
export { AgentProtocol, AgentRecord, AstraSync, AstraSyncConfig, AstraSyncError, AuthenticationError, BuildGuidanceParams, FrameworkConfig, GuidanceEnvelope, HealthResponse, KYDRequiredError, ModelConfig, PDLSSConfig, PDLSSDuration, PDLSSLimits, PDLSSPurpose, PDLSSScope, PDLSSSelfInstantiation, PendingRegistrationResponse, PollRegistrationResult, RegisterOptions, RegisterResult, RegistrationDeniedError, RegistrationExpiredError, RegistrationResponse, RegistrationTimeoutError, VerifyResponse, WaitForApprovalOptions, buildGuidance } from './registration/index.mjs';
|
|
10
|
-
export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-
|
|
10
|
+
export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-CqydB4ks.mjs';
|
|
11
11
|
export { DEFAULT_EDGE_CONFIG, EdgeConfig, EdgeMode, EdgePathRule, EdgeVerificationDepth, FetchEdgeConfigResult, FetchEdgeConfigSuccess, _resetEdgeConfigCache, degradeToObserve, fetchEdgeConfig, getEdgeConfig, isEdgeConfig, matchEdgePathRule } from './edge-config.mjs';
|
|
12
12
|
export { DynamicPlatformFingerprint, PLATFORM_AGENT_SIGNATURES, PlatformAgentVendor, PlatformDetectionInput, PlatformFingerprint, PlatformSignatureDef, detectPlatformFingerprint, matchPlatformSignature } from './platform-signatures.mjs';
|
|
13
13
|
export { MAX_HEADERS, MAX_HEADER_VALUE_BYTES, MAX_TOTAL_BYTES, ObservedMetadata, SanitizeHeadersResult, extractApiKeyFormat, extractPlatformHeaders, sanitizeHeaders } from './metadata-capture.mjs';
|
|
@@ -145,6 +145,6 @@ declare function getCachedWellKnownUrls(apiBaseUrl: string): WellKnownAgenticCom
|
|
|
145
145
|
* is fine — bumping both in the release-ceremony commit keeps them
|
|
146
146
|
* lockstep.
|
|
147
147
|
*/
|
|
148
|
-
declare const SDK_VERSION = "3.
|
|
148
|
+
declare const SDK_VERSION = "3.12.0";
|
|
149
149
|
|
|
150
150
|
export { EnhancedVerificationResult, GatewayConfig, type SettlementDecision, type SettlementRequest, StepUpApprovalInfo, StepUpApprovalStatus, StepUpOutcome, SDK_VERSION as VERSION, type WellKnownAgenticCommerce, authorizeSettlement, awaitStepUpApproval, getCachedWellKnownUrls, getWellKnownUrls, pollStepUpStatus, prefetchWellKnown };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { G as GatewayConfig,
|
|
2
|
-
export { a as AccessLevel, b as AgentCredentials, c as AstraSyncCredentials, C as CommerceArtifactsPayload,
|
|
3
|
-
export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, e as getCapabilities, f as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-
|
|
4
|
-
export { VerifyOptions, clearCache, extractCredentials, fetchRoutes, hasCredentials, quickVerify, reportUnregisteredAttempt, verify } from './verify.js';
|
|
5
|
-
export { e as express } from './express-
|
|
6
|
-
export { n as nextjs } from './nextjs-
|
|
7
|
-
export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-
|
|
1
|
+
import { G as GatewayConfig, s as StepUpApprovalInfo, u as StepUpOutcome, t as StepUpApprovalStatus, E as EnhancedVerificationResult, A as AccessFailure } from './types-SDu4Llbe.js';
|
|
2
|
+
export { a as AccessLevel, b as AgentCredentials, c as AstraSyncCredentials, d as AttemptOutcome, e as AttemptReport, C as CallerMetadata, f as CommerceArtifactsPayload, g as CommerceShieldProps, h as ConsiderationItem, i as ConsiderationSet, j as CounterpartyType, k as ExpressMiddlewareOptions, F as FiatSettlementBinding, l as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, m as ProtocolTransport, R as RouteAccessConfig, n as RuntimeChallengeResult, S as SDKOptions, o as SettlementArtifact, p as SettlementArtifactBinding, q as SettlementArtifactBindingBase, r as StablecoinSettlementBinding, T as TokenGuidance, v as TrustLevel, V as VerificationRequest, w as VerificationResult, x as VerifiedAgent, y as VerifiedDeveloper, z as VerifiedOrganization } from './types-SDu4Llbe.js';
|
|
3
|
+
export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, e as getCapabilities, f as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-CT7gdkfR.js';
|
|
4
|
+
export { VerifyOptions, clearCache, extractCredentials, fetchRoutes, hasCredentials, quickVerify, reportAttempt, reportUnregisteredAttempt, verify } from './verify.js';
|
|
5
|
+
export { e as express } from './express-BuxKNO_q.js';
|
|
6
|
+
export { n as nextjs } from './nextjs-Ddlw_J1J.js';
|
|
7
|
+
export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-CLHdqs2M.js';
|
|
8
8
|
export { McpMiddlewareOptions, ToolGateConfig, createMcpMiddleware } from './adapters/mcp.js';
|
|
9
9
|
export { AgentProtocol, AgentRecord, AstraSync, AstraSyncConfig, AstraSyncError, AuthenticationError, BuildGuidanceParams, FrameworkConfig, GuidanceEnvelope, HealthResponse, KYDRequiredError, ModelConfig, PDLSSConfig, PDLSSDuration, PDLSSLimits, PDLSSPurpose, PDLSSScope, PDLSSSelfInstantiation, PendingRegistrationResponse, PollRegistrationResult, RegisterOptions, RegisterResult, RegistrationDeniedError, RegistrationExpiredError, RegistrationResponse, RegistrationTimeoutError, VerifyResponse, WaitForApprovalOptions, buildGuidance } from './registration/index.js';
|
|
10
|
-
export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-
|
|
10
|
+
export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-BG62SXso.js';
|
|
11
11
|
export { DEFAULT_EDGE_CONFIG, EdgeConfig, EdgeMode, EdgePathRule, EdgeVerificationDepth, FetchEdgeConfigResult, FetchEdgeConfigSuccess, _resetEdgeConfigCache, degradeToObserve, fetchEdgeConfig, getEdgeConfig, isEdgeConfig, matchEdgePathRule } from './edge-config.js';
|
|
12
12
|
export { DynamicPlatformFingerprint, PLATFORM_AGENT_SIGNATURES, PlatformAgentVendor, PlatformDetectionInput, PlatformFingerprint, PlatformSignatureDef, detectPlatformFingerprint, matchPlatformSignature } from './platform-signatures.js';
|
|
13
13
|
export { MAX_HEADERS, MAX_HEADER_VALUE_BYTES, MAX_TOTAL_BYTES, ObservedMetadata, SanitizeHeadersResult, extractApiKeyFormat, extractPlatformHeaders, sanitizeHeaders } from './metadata-capture.js';
|
|
@@ -145,6 +145,6 @@ declare function getCachedWellKnownUrls(apiBaseUrl: string): WellKnownAgenticCom
|
|
|
145
145
|
* is fine — bumping both in the release-ceremony commit keeps them
|
|
146
146
|
* lockstep.
|
|
147
147
|
*/
|
|
148
|
-
declare const SDK_VERSION = "3.
|
|
148
|
+
declare const SDK_VERSION = "3.12.0";
|
|
149
149
|
|
|
150
150
|
export { EnhancedVerificationResult, GatewayConfig, type SettlementDecision, type SettlementRequest, StepUpApprovalInfo, StepUpApprovalStatus, StepUpOutcome, SDK_VERSION as VERSION, type WellKnownAgenticCommerce, authorizeSettlement, awaitStepUpApproval, getCachedWellKnownUrls, getWellKnownUrls, pollStepUpStatus, prefetchWellKnown };
|
package/dist/index.js
CHANGED
|
@@ -82,6 +82,7 @@ __export(src_exports, {
|
|
|
82
82
|
prefetchWellKnown: () => prefetchWellKnown,
|
|
83
83
|
quickVerify: () => quickVerify,
|
|
84
84
|
recordDecision: () => recordDecision2,
|
|
85
|
+
reportAttempt: () => reportAttempt,
|
|
85
86
|
reportUnregisteredAttempt: () => reportUnregisteredAttempt,
|
|
86
87
|
sanitizeHeaders: () => sanitizeHeaders,
|
|
87
88
|
sdk: () => sdk_exports,
|
|
@@ -213,7 +214,7 @@ function getCapabilities(accessLevel) {
|
|
|
213
214
|
}
|
|
214
215
|
|
|
215
216
|
// src/version.ts
|
|
216
|
-
var SDK_VERSION = "3.
|
|
217
|
+
var SDK_VERSION = "3.12.0";
|
|
217
218
|
|
|
218
219
|
// src/well-known.ts
|
|
219
220
|
var CACHE_TTL_MS = 60 * 60 * 1e3;
|
|
@@ -472,6 +473,7 @@ function createGuidanceResponse(_config, reason, options = {}) {
|
|
|
472
473
|
}
|
|
473
474
|
] : void 0,
|
|
474
475
|
correlationId: options.correlationId,
|
|
476
|
+
attemptId: options.attemptId,
|
|
475
477
|
verifiedAt: /* @__PURE__ */ new Date()
|
|
476
478
|
};
|
|
477
479
|
}
|
|
@@ -501,6 +503,8 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
501
503
|
body.runtimeChallengeOptions = requestData.runtimeChallengeOptions;
|
|
502
504
|
if (requestData.invocationProtocol) body.invocationProtocol = requestData.invocationProtocol;
|
|
503
505
|
if (requestData.commerceArtifacts) body.commerceArtifacts = requestData.commerceArtifacts;
|
|
506
|
+
if (requestData.attemptId) body.attemptId = requestData.attemptId;
|
|
507
|
+
if (requestData.considerationSet) body.considerationSet = requestData.considerationSet;
|
|
504
508
|
body.sdkVersion = SDK_VERSION;
|
|
505
509
|
if (requestData.callerMetadata || requestData.clientIp || requestData.userAgent) {
|
|
506
510
|
const meta = {
|
|
@@ -528,6 +532,9 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
528
532
|
if (response.status === 410) {
|
|
529
533
|
return {
|
|
530
534
|
success: true,
|
|
535
|
+
// 3.12.0 (Trust Record): keep the server-echoed attempt handle even on
|
|
536
|
+
// the synthesised 410 deny shape (echoed on every branch).
|
|
537
|
+
attemptId: typeof data?.attemptId === "string" ? data.attemptId : void 0,
|
|
531
538
|
access: {
|
|
532
539
|
allowed: false,
|
|
533
540
|
accessLevel: "none",
|
|
@@ -546,7 +553,8 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
546
553
|
return {
|
|
547
554
|
success: false,
|
|
548
555
|
error: data.message || data.error || `API returned ${response.status}`,
|
|
549
|
-
correlationId: typeof data?.correlationId === "string" ? data.correlationId : void 0
|
|
556
|
+
correlationId: typeof data?.correlationId === "string" ? data.correlationId : void 0,
|
|
557
|
+
attemptId: typeof data?.attemptId === "string" ? data.attemptId : void 0
|
|
550
558
|
};
|
|
551
559
|
}
|
|
552
560
|
return data;
|
|
@@ -580,7 +588,13 @@ async function verify(config, request, options) {
|
|
|
580
588
|
if (mergedConfig.debug) {
|
|
581
589
|
console.log("[VerificationGateway] Returning cached result");
|
|
582
590
|
}
|
|
583
|
-
|
|
591
|
+
const hit = { ...cached };
|
|
592
|
+
if (request.attemptId) {
|
|
593
|
+
hit.attemptId = request.attemptId;
|
|
594
|
+
} else {
|
|
595
|
+
delete hit.attemptId;
|
|
596
|
+
}
|
|
597
|
+
return hit;
|
|
584
598
|
}
|
|
585
599
|
}
|
|
586
600
|
const enrichedRequest = { ...request };
|
|
@@ -600,6 +614,7 @@ async function verify(config, request, options) {
|
|
|
600
614
|
return createGuidanceResponse(mergedConfig, apiResponse.error, {
|
|
601
615
|
source: "api_error",
|
|
602
616
|
correlationId: apiResponse.correlationId,
|
|
617
|
+
attemptId: apiResponse.attemptId,
|
|
603
618
|
urls
|
|
604
619
|
});
|
|
605
620
|
}
|
|
@@ -635,6 +650,9 @@ async function verify(config, request, options) {
|
|
|
635
650
|
// Anonymous traffic has no session → correlationId is the per-attempt
|
|
636
651
|
// linking key (the sessionId-equivalent for anonymous callers).
|
|
637
652
|
correlationId: apiResponse.correlationId,
|
|
653
|
+
// 3.12.0 (Trust Record): server echoes the attempt-chain handle on
|
|
654
|
+
// every branch — denials included (the funnel outlives one deny).
|
|
655
|
+
attemptId: apiResponse.attemptId,
|
|
638
656
|
recommendation: apiResponse.recommendation,
|
|
639
657
|
recommendationReasons: apiResponse.recommendationReasons,
|
|
640
658
|
stepUpApproval: apiResponse.stepUpApproval,
|
|
@@ -686,6 +704,8 @@ async function verify(config, request, options) {
|
|
|
686
704
|
// v2.3.10 (defect #34, round-4): anonymous responses surface correlationId
|
|
687
705
|
// (no session row exists for unverified callers).
|
|
688
706
|
correlationId: apiResponse.correlationId,
|
|
707
|
+
// 3.12.0 (Trust Record): server-echoed attempt-chain handle.
|
|
708
|
+
attemptId: apiResponse.attemptId,
|
|
689
709
|
runtimeChallenge: apiResponse.runtimeChallenge,
|
|
690
710
|
tokenGuidance: apiResponse.tokenGuidance,
|
|
691
711
|
recommendation: apiResponse.recommendation,
|
|
@@ -730,6 +750,24 @@ async function recordDecision(config, sessionId, decision, reason) {
|
|
|
730
750
|
}).catch(() => {
|
|
731
751
|
});
|
|
732
752
|
}
|
|
753
|
+
async function reportAttempt(config, report) {
|
|
754
|
+
const apiBaseUrl = config.apiBaseUrl || DEFAULT_CONFIG.apiBaseUrl;
|
|
755
|
+
const headers = { "Content-Type": "application/json" };
|
|
756
|
+
if (config.apiKey) {
|
|
757
|
+
headers["Authorization"] = `Bearer ${config.apiKey}`;
|
|
758
|
+
headers["X-API-Key"] = config.apiKey;
|
|
759
|
+
}
|
|
760
|
+
const body = {
|
|
761
|
+
...report,
|
|
762
|
+
...!report.counterpartyId && config.counterpartyId && { counterpartyId: config.counterpartyId }
|
|
763
|
+
};
|
|
764
|
+
await fetch(`${apiBaseUrl}/agents/verify-access/attempt-report`, {
|
|
765
|
+
method: "POST",
|
|
766
|
+
headers,
|
|
767
|
+
body: JSON.stringify(body)
|
|
768
|
+
}).catch(() => {
|
|
769
|
+
});
|
|
770
|
+
}
|
|
733
771
|
async function fetchRoutes(config, counterpartyId) {
|
|
734
772
|
if (!counterpartyId) return null;
|
|
735
773
|
const headers = { "Content-Type": "application/json" };
|
|
@@ -6185,6 +6223,7 @@ function detectPlatformFingerprint(input) {
|
|
|
6185
6223
|
prefetchWellKnown,
|
|
6186
6224
|
quickVerify,
|
|
6187
6225
|
recordDecision,
|
|
6226
|
+
reportAttempt,
|
|
6188
6227
|
reportUnregisteredAttempt,
|
|
6189
6228
|
sanitizeHeaders,
|
|
6190
6229
|
sdk,
|