@astrasyncai/verification-gateway 3.7.1 → 3.9.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/README.md +99 -11
- 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 +2 -1
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +2 -1
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/http-pdlss.d.mts +81 -0
- package/dist/adapters/http-pdlss.d.ts +81 -0
- package/dist/adapters/http-pdlss.js +117 -0
- package/dist/adapters/http-pdlss.js.map +1 -0
- package/dist/adapters/http-pdlss.mjs +87 -0
- package/dist/adapters/http-pdlss.mjs.map +1 -0
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.d.ts +1 -1
- package/dist/adapters/mcp.js +2 -1
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +2 -1
- 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 +2 -1
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +2 -1
- 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 +2 -1
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +2 -1
- 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 +14 -1
- package/dist/bin/astrasync-guard.js +14 -1
- package/dist/bin/astrasync.js +31 -1
- package/dist/browser/background.js +14 -1
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +14 -1
- 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/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 +14 -1
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +14 -1
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +130 -0
- package/dist/edge-config.d.ts +130 -0
- package/dist/edge-config.js +162 -0
- package/dist/edge-config.js.map +1 -0
- package/dist/edge-config.mjs +131 -0
- package/dist/edge-config.mjs.map +1 -0
- package/dist/{express-BnMO-H3y.d.mts → express-DXUyvv7t.d.mts} +1 -1
- package/dist/{express-DQhDzNAt.d.ts → express-sGXhDdd0.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 +14 -1
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +14 -1
- 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-D8-dvUFA.d.ts → index-C61VL_OW.d.ts} +1 -1
- package/dist/{index-rftma0ln.d.ts → index-CMg-vjEK.d.ts} +1 -1
- package/dist/{index-WHKq2v17.d.mts → index-Dalih3EB.d.mts} +1 -1
- package/dist/{index-BT_aRn-I.d.mts → index-DmmdehNu.d.mts} +1 -1
- package/dist/index.d.mts +26 -82
- package/dist/index.d.ts +26 -82
- package/dist/index.js +226 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +215 -10
- 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-DPj7ZNlq.d.ts → nextjs-DwUW-Nm1.d.ts} +1 -1
- package/dist/{nextjs-DFKYhxe6.d.mts → nextjs-F_2pbPIA.d.mts} +1 -1
- package/dist/platform-signatures.d.mts +47 -0
- package/dist/platform-signatures.d.ts +47 -0
- package/dist/platform-signatures.js +89 -0
- package/dist/platform-signatures.js.map +1 -0
- package/dist/platform-signatures.mjs +63 -0
- package/dist/platform-signatures.mjs.map +1 -0
- package/dist/{sdk-CAcHgB5x.d.ts → sdk-CfHANs4A.d.ts} +1 -1
- package/dist/{sdk-Cy3wAmDt.d.mts → sdk-Clob2-0A.d.mts} +1 -1
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/{types-CKe8O0lR.d.mts → types-ACMsV07B.d.mts} +112 -9
- package/dist/{types-CKe8O0lR.d.ts → types-ACMsV07B.d.ts} +112 -9
- package/dist/{types-B-ubjHER.d.mts → types-BtqUvK8v.d.mts} +1 -1
- package/dist/{types-Bgn5gxHQ.d.ts → types-DmSDgPpG.d.ts} +1 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/verify.d.mts +144 -0
- package/dist/verify.d.ts +144 -0
- package/dist/verify.js +593 -0
- package/dist/verify.js.map +1 -0
- package/dist/verify.mjs +557 -0
- package/dist/verify.mjs.map +1 -0
- package/package.json +21 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as AccessLevel,
|
|
1
|
+
import { a as AccessLevel, e as CounterpartyType, T as TokenGuidance } from './types-ACMsV07B.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AstraSync Gateway - Types for gateway modes, local evaluation, and adapter interface.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as AccessLevel,
|
|
1
|
+
import { a as AccessLevel, e as CounterpartyType, T as TokenGuidance } from './types-ACMsV07B.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AstraSync Gateway - Types for gateway modes, local evaluation, and adapter interface.
|
package/dist/ui/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as CommerceShieldProps, r as VerificationResult, b as AgentCredentials, g as GuidanceInfo, q as TrustLevel } from '../types-ACMsV07B.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AstraSync Commerce Shield Component
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as CommerceShieldProps, r as VerificationResult, b as AgentCredentials, g as GuidanceInfo, q as TrustLevel } from '../types-ACMsV07B.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AstraSync Commerce Shield Component
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { b as AgentCredentials, G as GatewayConfig, a as AccessLevel, V as VerificationRequest, r as VerificationResult } from './types-ACMsV07B.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AstraSync Universal Verification Gateway - Core Verification Logic
|
|
5
|
+
*
|
|
6
|
+
* This module handles the core verification logic, calling the AstraSync API
|
|
7
|
+
* and processing the response into a standardized VerificationResult.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Clear the verification cache
|
|
12
|
+
*/
|
|
13
|
+
declare function clearCache(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Extract agent credentials from various sources
|
|
16
|
+
*/
|
|
17
|
+
declare function extractCredentials(headers: Record<string, string | string[] | undefined>, query?: Record<string, string | undefined>): AgentCredentials;
|
|
18
|
+
/**
|
|
19
|
+
* Check if credentials are present
|
|
20
|
+
*/
|
|
21
|
+
declare function hasCredentials(credentials: AgentCredentials): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Options for a single verify() call (as opposed to GatewayConfig, which is
|
|
24
|
+
* per-gateway). Mirrors the Java SDK's `verify(request, bypassCache)`.
|
|
25
|
+
*/
|
|
26
|
+
interface VerifyOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Skip the cache READ for this call so the request is guaranteed to reach
|
|
29
|
+
* the backend (the result is still written to the cache if cacheable).
|
|
30
|
+
* Used by the step-up hold-and-poll retry: the re-verify after an approval
|
|
31
|
+
* must hit the server to redeem the single-use approval.
|
|
32
|
+
*/
|
|
33
|
+
bypassCache?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Main verification function
|
|
37
|
+
*/
|
|
38
|
+
declare function verify(config: GatewayConfig, request: VerificationRequest, options?: VerifyOptions): Promise<VerificationResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Record a counterparty's grant/deny decision for a verification session.
|
|
41
|
+
* Fire-and-forget — errors are silently swallowed.
|
|
42
|
+
*/
|
|
43
|
+
declare function recordDecision(config: GatewayConfig, sessionId: string, decision: 'granted' | 'denied', reason?: string): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Fetch the per-route policy for an endpoint from the AstraSync backend.
|
|
46
|
+
* v2.9.7 moved policy authority into the dashboard — the SDK no longer
|
|
47
|
+
* accepts `routes` from merchant-side source code, it fetches them from
|
|
48
|
+
* here on init (and refreshes periodically).
|
|
49
|
+
*
|
|
50
|
+
* Returns `null` when the request fails for any reason — the caller decides
|
|
51
|
+
* how to fall back (the middleware allows-all when no policy is loaded so
|
|
52
|
+
* a misconfigured init doesn't take down the merchant's API).
|
|
53
|
+
*/
|
|
54
|
+
declare function fetchRoutes(config: GatewayConfig, counterpartyId: string): Promise<RouteAccessConfigShape[] | null>;
|
|
55
|
+
/**
|
|
56
|
+
* Minimal shape of an EndpointRoute as the SDK consumes it. Mirrors the
|
|
57
|
+
* server's `EndpointRoute` type and the SDK's `RouteAccessConfig` — same
|
|
58
|
+
* JSON moves between server and SDK unchanged.
|
|
59
|
+
*/
|
|
60
|
+
interface RouteAccessConfigShape {
|
|
61
|
+
pattern: string;
|
|
62
|
+
method: string;
|
|
63
|
+
/** @deprecated 3.2.0 — band no longer gates; optional, ignored. Use minTrustScore. */
|
|
64
|
+
minAccessLevel?: 'none' | 'restricted' | 'read-only' | 'standard' | 'full' | 'internal';
|
|
65
|
+
minTrustScore?: number;
|
|
66
|
+
requiredPurposes?: string[];
|
|
67
|
+
allowedPurposes?: string[];
|
|
68
|
+
allowedJurisdictions?: string[];
|
|
69
|
+
maxDuration?: number;
|
|
70
|
+
maxTransactionValue?: number;
|
|
71
|
+
requirePurpose?: boolean;
|
|
72
|
+
/** Send-mapping (Bug 14, §4.6) — see RouteAccessConfig in types.ts. */
|
|
73
|
+
purpose?: string;
|
|
74
|
+
action?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Verify an agent AND automatically record the grant/deny decision.
|
|
78
|
+
*
|
|
79
|
+
* This is the recommended entry point for counterparties that call verify()
|
|
80
|
+
* directly (e.g. MCP servers) rather than using createMiddleware().
|
|
81
|
+
* It adds createSession: true, then fire-and-forgets the decision.
|
|
82
|
+
*/
|
|
83
|
+
declare function verifyAndRecord(config: GatewayConfig, request: VerificationRequest, options?: VerifyOptions): Promise<VerificationResult>;
|
|
84
|
+
/**
|
|
85
|
+
* Report an unregistered agent attempt (no AstraSync credentials).
|
|
86
|
+
* Called by SDK adapters when an agent is redirected to /docs/agent-access.
|
|
87
|
+
* Fire-and-forget — errors are silently swallowed.
|
|
88
|
+
*/
|
|
89
|
+
declare function reportUnregisteredAttempt(config: GatewayConfig, data: {
|
|
90
|
+
/**
|
|
91
|
+
* 3.6.0: optional — the backend attributes by counterpartyId first (sent
|
|
92
|
+
* from config below) and requires at least ONE of counterpartyId/URL.
|
|
93
|
+
* A null/undefined URL is omitted from the body, not sent as null.
|
|
94
|
+
*/
|
|
95
|
+
counterpartyUrl?: string;
|
|
96
|
+
counterpartyType?: string;
|
|
97
|
+
sourceIp?: string;
|
|
98
|
+
userAgent?: string;
|
|
99
|
+
requestPath?: string;
|
|
100
|
+
requestMethod?: string;
|
|
101
|
+
/**
|
|
102
|
+
* 3.9.0 (§33.5 #1) — edge-adapter evidence fields, persisted into the
|
|
103
|
+
* event's eventData by the backend: `protocol` = detected transport/
|
|
104
|
+
* credential protocol; `evidence` = light crypto-free detection detail.
|
|
105
|
+
*/
|
|
106
|
+
protocol?: string;
|
|
107
|
+
evidence?: Record<string, unknown>;
|
|
108
|
+
}): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Report a counterparty-side PDLSS pre-check failure.
|
|
111
|
+
* Called by SDK adapters when the agent's requested PDLSS exceeds
|
|
112
|
+
* counterparty-defined maximums BEFORE calling verify-access.
|
|
113
|
+
* Fire-and-forget — errors are silently swallowed.
|
|
114
|
+
*/
|
|
115
|
+
declare function reportCounterpartyPreCheckFailure(config: GatewayConfig, data: {
|
|
116
|
+
agentId: string;
|
|
117
|
+
counterpartyUrl: string;
|
|
118
|
+
counterpartyType?: string;
|
|
119
|
+
failures: Array<{
|
|
120
|
+
field: string;
|
|
121
|
+
requested: string | number;
|
|
122
|
+
limit: string | number | string[];
|
|
123
|
+
message: string;
|
|
124
|
+
}>;
|
|
125
|
+
requestPath?: string;
|
|
126
|
+
requestMethod?: string;
|
|
127
|
+
}): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Quick verification — checks credentials and policy in one call.
|
|
130
|
+
*
|
|
131
|
+
* Round-18 G4: return shape mirrors `VerificationResult`'s split — partners
|
|
132
|
+
* writing custom handlers around `quickVerify` get the same identity/policy
|
|
133
|
+
* distinction as those calling `verify()` directly. Map to HTTP status the
|
|
134
|
+
* same way: `!identityVerified` → 401; `identityVerified && !policyAllowed`
|
|
135
|
+
* → 403.
|
|
136
|
+
*/
|
|
137
|
+
declare function quickVerify(config: GatewayConfig, credentials: AgentCredentials): Promise<{
|
|
138
|
+
identityVerified: boolean;
|
|
139
|
+
policyAllowed: boolean;
|
|
140
|
+
accessLevel: AccessLevel;
|
|
141
|
+
reason?: string;
|
|
142
|
+
}>;
|
|
143
|
+
|
|
144
|
+
export { type RouteAccessConfigShape, type VerifyOptions, clearCache, extractCredentials, fetchRoutes, hasCredentials, quickVerify, recordDecision, reportCounterpartyPreCheckFailure, reportUnregisteredAttempt, verify, verifyAndRecord };
|
package/dist/verify.d.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { b as AgentCredentials, G as GatewayConfig, a as AccessLevel, V as VerificationRequest, r as VerificationResult } from './types-ACMsV07B.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AstraSync Universal Verification Gateway - Core Verification Logic
|
|
5
|
+
*
|
|
6
|
+
* This module handles the core verification logic, calling the AstraSync API
|
|
7
|
+
* and processing the response into a standardized VerificationResult.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Clear the verification cache
|
|
12
|
+
*/
|
|
13
|
+
declare function clearCache(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Extract agent credentials from various sources
|
|
16
|
+
*/
|
|
17
|
+
declare function extractCredentials(headers: Record<string, string | string[] | undefined>, query?: Record<string, string | undefined>): AgentCredentials;
|
|
18
|
+
/**
|
|
19
|
+
* Check if credentials are present
|
|
20
|
+
*/
|
|
21
|
+
declare function hasCredentials(credentials: AgentCredentials): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Options for a single verify() call (as opposed to GatewayConfig, which is
|
|
24
|
+
* per-gateway). Mirrors the Java SDK's `verify(request, bypassCache)`.
|
|
25
|
+
*/
|
|
26
|
+
interface VerifyOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Skip the cache READ for this call so the request is guaranteed to reach
|
|
29
|
+
* the backend (the result is still written to the cache if cacheable).
|
|
30
|
+
* Used by the step-up hold-and-poll retry: the re-verify after an approval
|
|
31
|
+
* must hit the server to redeem the single-use approval.
|
|
32
|
+
*/
|
|
33
|
+
bypassCache?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Main verification function
|
|
37
|
+
*/
|
|
38
|
+
declare function verify(config: GatewayConfig, request: VerificationRequest, options?: VerifyOptions): Promise<VerificationResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Record a counterparty's grant/deny decision for a verification session.
|
|
41
|
+
* Fire-and-forget — errors are silently swallowed.
|
|
42
|
+
*/
|
|
43
|
+
declare function recordDecision(config: GatewayConfig, sessionId: string, decision: 'granted' | 'denied', reason?: string): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Fetch the per-route policy for an endpoint from the AstraSync backend.
|
|
46
|
+
* v2.9.7 moved policy authority into the dashboard — the SDK no longer
|
|
47
|
+
* accepts `routes` from merchant-side source code, it fetches them from
|
|
48
|
+
* here on init (and refreshes periodically).
|
|
49
|
+
*
|
|
50
|
+
* Returns `null` when the request fails for any reason — the caller decides
|
|
51
|
+
* how to fall back (the middleware allows-all when no policy is loaded so
|
|
52
|
+
* a misconfigured init doesn't take down the merchant's API).
|
|
53
|
+
*/
|
|
54
|
+
declare function fetchRoutes(config: GatewayConfig, counterpartyId: string): Promise<RouteAccessConfigShape[] | null>;
|
|
55
|
+
/**
|
|
56
|
+
* Minimal shape of an EndpointRoute as the SDK consumes it. Mirrors the
|
|
57
|
+
* server's `EndpointRoute` type and the SDK's `RouteAccessConfig` — same
|
|
58
|
+
* JSON moves between server and SDK unchanged.
|
|
59
|
+
*/
|
|
60
|
+
interface RouteAccessConfigShape {
|
|
61
|
+
pattern: string;
|
|
62
|
+
method: string;
|
|
63
|
+
/** @deprecated 3.2.0 — band no longer gates; optional, ignored. Use minTrustScore. */
|
|
64
|
+
minAccessLevel?: 'none' | 'restricted' | 'read-only' | 'standard' | 'full' | 'internal';
|
|
65
|
+
minTrustScore?: number;
|
|
66
|
+
requiredPurposes?: string[];
|
|
67
|
+
allowedPurposes?: string[];
|
|
68
|
+
allowedJurisdictions?: string[];
|
|
69
|
+
maxDuration?: number;
|
|
70
|
+
maxTransactionValue?: number;
|
|
71
|
+
requirePurpose?: boolean;
|
|
72
|
+
/** Send-mapping (Bug 14, §4.6) — see RouteAccessConfig in types.ts. */
|
|
73
|
+
purpose?: string;
|
|
74
|
+
action?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Verify an agent AND automatically record the grant/deny decision.
|
|
78
|
+
*
|
|
79
|
+
* This is the recommended entry point for counterparties that call verify()
|
|
80
|
+
* directly (e.g. MCP servers) rather than using createMiddleware().
|
|
81
|
+
* It adds createSession: true, then fire-and-forgets the decision.
|
|
82
|
+
*/
|
|
83
|
+
declare function verifyAndRecord(config: GatewayConfig, request: VerificationRequest, options?: VerifyOptions): Promise<VerificationResult>;
|
|
84
|
+
/**
|
|
85
|
+
* Report an unregistered agent attempt (no AstraSync credentials).
|
|
86
|
+
* Called by SDK adapters when an agent is redirected to /docs/agent-access.
|
|
87
|
+
* Fire-and-forget — errors are silently swallowed.
|
|
88
|
+
*/
|
|
89
|
+
declare function reportUnregisteredAttempt(config: GatewayConfig, data: {
|
|
90
|
+
/**
|
|
91
|
+
* 3.6.0: optional — the backend attributes by counterpartyId first (sent
|
|
92
|
+
* from config below) and requires at least ONE of counterpartyId/URL.
|
|
93
|
+
* A null/undefined URL is omitted from the body, not sent as null.
|
|
94
|
+
*/
|
|
95
|
+
counterpartyUrl?: string;
|
|
96
|
+
counterpartyType?: string;
|
|
97
|
+
sourceIp?: string;
|
|
98
|
+
userAgent?: string;
|
|
99
|
+
requestPath?: string;
|
|
100
|
+
requestMethod?: string;
|
|
101
|
+
/**
|
|
102
|
+
* 3.9.0 (§33.5 #1) — edge-adapter evidence fields, persisted into the
|
|
103
|
+
* event's eventData by the backend: `protocol` = detected transport/
|
|
104
|
+
* credential protocol; `evidence` = light crypto-free detection detail.
|
|
105
|
+
*/
|
|
106
|
+
protocol?: string;
|
|
107
|
+
evidence?: Record<string, unknown>;
|
|
108
|
+
}): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Report a counterparty-side PDLSS pre-check failure.
|
|
111
|
+
* Called by SDK adapters when the agent's requested PDLSS exceeds
|
|
112
|
+
* counterparty-defined maximums BEFORE calling verify-access.
|
|
113
|
+
* Fire-and-forget — errors are silently swallowed.
|
|
114
|
+
*/
|
|
115
|
+
declare function reportCounterpartyPreCheckFailure(config: GatewayConfig, data: {
|
|
116
|
+
agentId: string;
|
|
117
|
+
counterpartyUrl: string;
|
|
118
|
+
counterpartyType?: string;
|
|
119
|
+
failures: Array<{
|
|
120
|
+
field: string;
|
|
121
|
+
requested: string | number;
|
|
122
|
+
limit: string | number | string[];
|
|
123
|
+
message: string;
|
|
124
|
+
}>;
|
|
125
|
+
requestPath?: string;
|
|
126
|
+
requestMethod?: string;
|
|
127
|
+
}): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Quick verification — checks credentials and policy in one call.
|
|
130
|
+
*
|
|
131
|
+
* Round-18 G4: return shape mirrors `VerificationResult`'s split — partners
|
|
132
|
+
* writing custom handlers around `quickVerify` get the same identity/policy
|
|
133
|
+
* distinction as those calling `verify()` directly. Map to HTTP status the
|
|
134
|
+
* same way: `!identityVerified` → 401; `identityVerified && !policyAllowed`
|
|
135
|
+
* → 403.
|
|
136
|
+
*/
|
|
137
|
+
declare function quickVerify(config: GatewayConfig, credentials: AgentCredentials): Promise<{
|
|
138
|
+
identityVerified: boolean;
|
|
139
|
+
policyAllowed: boolean;
|
|
140
|
+
accessLevel: AccessLevel;
|
|
141
|
+
reason?: string;
|
|
142
|
+
}>;
|
|
143
|
+
|
|
144
|
+
export { type RouteAccessConfigShape, type VerifyOptions, clearCache, extractCredentials, fetchRoutes, hasCredentials, quickVerify, recordDecision, reportCounterpartyPreCheckFailure, reportUnregisteredAttempt, verify, verifyAndRecord };
|