@astrasyncai/verification-gateway 2.4.7 → 2.4.9
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 +29 -15
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +29 -15
- 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 +30 -14
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +30 -14
- 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 +37 -16
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +37 -16
- 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 +31 -13
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +31 -13
- 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.js +6 -1
- package/dist/browser/background.js +25 -12
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +25 -12
- 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 +25 -12
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +25 -12
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/{express-D5hAJ2Gv.d.mts → express-4WStX3PV.d.mts} +1 -1
- package/dist/{express-XCkk7BsJ.d.ts → express-C1ePFB7n.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 +25 -12
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +25 -12
- 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-u08qcXq9.d.mts → index-ChPX4WHl.d.mts} +1 -1
- package/dist/{index-CH4TfcbL.d.ts → index-Cjm-zBeZ.d.ts} +1 -1
- package/dist/{index-WL4d9e9_.d.ts → index-CzJMCgEy.d.ts} +2 -2
- package/dist/{index-ZkHvXsMo.d.mts → index-D8IEntil.d.mts} +2 -2
- package/dist/index.d.mts +22 -11
- package/dist/index.d.ts +22 -11
- package/dist/index.js +86 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -26
- 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-DP2EpI-4.d.ts → nextjs-BIORS__0.d.ts} +1 -1
- package/dist/{nextjs-CFA0J_4x.d.mts → nextjs-CjzHdaXA.d.mts} +1 -1
- package/dist/registration/index.d.mts +90 -1
- package/dist/registration/index.d.ts +90 -1
- package/dist/registration/index.js +33 -3
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +31 -2
- package/dist/registration/index.mjs.map +1 -1
- package/dist/{sdk-CwwCGDzK.d.ts → sdk-Chhz-FcT.d.mts} +10 -5
- package/dist/{sdk-C8W54WZS.d.mts → sdk-CqTEQAc6.d.ts} +10 -5
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/{types-tBNFSbw_.d.mts → types-DNK2BgIf.d.mts} +2 -2
- package/dist/{types-DXNkr61h.d.ts → types-DoWIuzfj.d.ts} +2 -2
- package/dist/{types-CbZOkIr-.d.mts → types-L15pYd2c.d.mts} +22 -5
- package/dist/{types-CbZOkIr-.d.ts → types-L15pYd2c.d.ts} +22 -5
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +1 -1
- package/dist/ui/index.mjs.map +1 -1
- package/package.json +4 -2
|
@@ -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-DNK2BgIf.mjs';
|
|
3
|
+
import '../types-L15pYd2c.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Git Trigger — Enterprise git push / PR verification
|
|
@@ -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-DoWIuzfj.js';
|
|
3
|
+
import '../types-L15pYd2c.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Git Trigger — Enterprise git push / PR verification
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as AstraSyncCredentials, f as ProtocolTransport } from './types-L15pYd2c.js';
|
|
2
2
|
import { JWK } from 'jose';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1394,4 +1394,4 @@ declare namespace index {
|
|
|
1394
1394
|
export { type index_ACPEndpoint as ACPEndpoint, type index_ACPPaymentTokenType as ACPPaymentTokenType, type index_ACPRequestContext as ACPRequestContext, type index_ACPRequestLike as ACPRequestLike, type index_ACPSignatureAlgorithm as ACPSignatureAlgorithm, type index_ACPTotal as ACPTotal, type index_ACPVerifyInput as ACPVerifyInput, type index_ACPVerifyResult as ACPVerifyResult, type index_AP2CartMandateClaims as AP2CartMandateClaims, type index_AP2ChainResult as AP2ChainResult, type index_AP2IntentMandateClaims as AP2IntentMandateClaims, type index_AP2MandateClaims as AP2MandateClaims, type index_AP2MandateTriple as AP2MandateTriple, type index_AP2MandateTripleInput as AP2MandateTripleInput, type index_AP2MandateType as AP2MandateType, type index_AP2PaymentDetailsTotal as AP2PaymentDetailsTotal, type index_AP2PaymentMandateClaims as AP2PaymentMandateClaims, type index_AP2PaymentMandateForValue as AP2PaymentMandateForValue, type index_AP2VerifyInput as AP2VerifyInput, type index_CommerceContext as CommerceContext, type index_CommercePipelineInput as CommercePipelineInput, type index_CommerceProtocol as CommerceProtocol, type index_CommercePurpose as CommercePurpose, type index_CommerceSignatureStack as CommerceSignatureStack, type index_ConstraintEvalResult as ConstraintEvalResult, type index_ConstraintKey as ConstraintKey, type index_ConstraintResult as ConstraintResult, type index_ExtractorRequestLike as ExtractorRequestLike, type index_IdentityBindingResult as IdentityBindingResult, type index_IdentityClaim as IdentityClaim, type index_IdentityResolver as IdentityResolver, type index_MPPChallengeForValue as MPPChallengeForValue, type index_MPPChallengeSummary as MPPChallengeSummary, type index_MPPCredentialSummary as MPPCredentialSummary, type index_MPPIntent as MPPIntent, type index_MPPKind as MPPKind, type index_MPPReceiptSummary as MPPReceiptSummary, type index_MPPRequestContext as MPPRequestContext, type index_MPPRequestLike as MPPRequestLike, type index_MPPResponseLike as MPPResponseLike, type index_MPPVerifyInput as MPPVerifyInput, type index_MPPVerifyResult as MPPVerifyResult, type index_ParsedRFC9421 as ParsedRFC9421, type index_PaymentMethodAllowlistInput as PaymentMethodAllowlistInput, type index_RFC9421SignatureParams as RFC9421SignatureParams, type index_RFC9421Tag as RFC9421Tag, type index_RFC9421VerifyOptions as RFC9421VerifyOptions, type index_RFC9421VerifyRequest as RFC9421VerifyRequest, type index_RFC9421VerifyResult as RFC9421VerifyResult, type index_RegistryName as RegistryName, type index_RegistryResolver as RegistryResolver, type index_ResolveContext as ResolveContext, index_STRIPE_WEBHOOK_INFORMATIONAL_EVENTS as STRIPE_WEBHOOK_INFORMATIONAL_EVENTS, type index_SpendingLimitInput as SpendingLimitInput, type index_StripeWebhookInformationalEvent as StripeWebhookInformationalEvent, type index_TransactionContext as TransactionContext, type index_TransactionValueContext as TransactionValueContext, type index_TransportExtractor as TransportExtractor, type index_UCPCheckoutContext as UCPCheckoutContext, type index_UCPManifestValidationResult as UCPManifestValidationResult, type index_UCPRequestLike as UCPRequestLike, type index_UCPTotal as UCPTotal, type index_VIAllowedParty as VIAllowedParty, type index_VIBudgetLimit as VIBudgetLimit, type index_VIClaimsForValue as VIClaimsForValue, type index_VIConstraintEvalInput as VIConstraintEvalInput, type index_VIConstraints as VIConstraints, type index_VIExecutionMode as VIExecutionMode, type index_VIExtractedClaims as VIExtractedClaims, type index_VILayer as VILayer, type index_VILineItem as VILineItem, type index_VIMandateType as VIMandateType, type index_VIPaymentAmount as VIPaymentAmount, type index_VIRecurrence as VIRecurrence, type index_VIVerifyInput as VIVerifyInput, type index_VIVerifyResult as VIVerifyResult, type index_VerifyStripeWebhookOptions as VerifyStripeWebhookOptions, type index_VerifyStripeWebhookResult as VerifyStripeWebhookResult, type index_X402Kind as X402Kind, type index_X402RequestContext as X402RequestContext, type index_X402RequestForValue as X402RequestForValue, type index_X402RequestLike as X402RequestLike, type index_X402RequirementsSummary as X402RequirementsSummary, type index_X402ResponseLike as X402ResponseLike, index_applyCredentials as applyCredentials, index_bindIdentity as bindIdentity, index_claim as claim, index_clearTransportExtractors as clearTransportExtractors, index_createMastercardRegistry as createMastercardRegistry, index_createVisaRegistry as createVisaRegistry, index_createWebBotAuthRegistry as createWebBotAuthRegistry, index_detectProtocol as detectProtocol, index_evaluatePaymentMethodAllowlist as evaluatePaymentMethodAllowlist, index_evaluateSpendingLimit as evaluateSpendingLimit, index_evaluateVIConstraints as evaluateVIConstraints, index_extractA2ACredentials as extractA2ACredentials, index_extractACPContext as extractACPContext, index_extractACPTransactionValue as extractACPTransactionValue, index_extractAP2Mandate as extractAP2Mandate, index_extractAP2Mandates as extractAP2Mandates, index_extractAP2TransactionValue as extractAP2TransactionValue, index_extractCredentialsFromProtocol as extractCredentialsFromProtocol, index_extractHttpCredentials as extractHttpCredentials, index_extractMPPContext as extractMPPContext, index_extractMPPFromRequest as extractMPPFromRequest, index_extractMPPFromResponse as extractMPPFromResponse, index_extractMPPTransactionValue as extractMPPTransactionValue, index_extractMcpCredentials as extractMcpCredentials, index_extractUCPContext as extractUCPContext, index_extractUCPTransactionValue as extractUCPTransactionValue, index_extractVIClaims as extractVIClaims, index_extractVITransactionValue as extractVITransactionValue, index_extractX402Context as extractX402Context, index_extractX402FromRequest as extractX402FromRequest, index_extractX402FromResponse as extractX402FromResponse, index_extractX402TransactionValue as extractX402TransactionValue, index_fetchUCPManifest as fetchUCPManifest, index_getTransportExtractor as getTransportExtractor, index_getTransportExtractors as getTransportExtractors, index_isStripeWebhookInformational as isStripeWebhookInformational, index_mapACPRequestToPurpose as mapACPRequestToPurpose, index_mapAP2MandateToPurpose as mapAP2MandateToPurpose, index_mapMPPRequestToPurpose as mapMPPRequestToPurpose, index_mapRFC9421TagToPurpose as mapRFC9421TagToPurpose, index_mapUCPRequestToPurpose as mapUCPRequestToPurpose, index_mapVIMandateToPurpose as mapVIMandateToPurpose, index_mapX402RequestToPurpose as mapX402RequestToPurpose, index_parseRFC9421 as parseRFC9421, index_registerTransportExtractor as registerTransportExtractor, index_runCommercePipeline as runCommercePipeline, index_runMatchingExtractors as runMatchingExtractors, index_setA2AMetadata as setA2AMetadata, index_setHttpHeaders as setHttpHeaders, index_setMcpMeta as setMcpMeta, index_validateUCPManifest as validateUCPManifest, index_verifyACPSignature as verifyACPSignature, index_verifyAP2Chain as verifyAP2Chain, index_verifyMPP as verifyMPP, index_verifyRFC9421 as verifyRFC9421, index_verifyStripeWebhook as verifyStripeWebhook, index_verifyVIChain as verifyVIChain };
|
|
1395
1395
|
}
|
|
1396
1396
|
|
|
1397
|
-
export { type
|
|
1397
|
+
export { type SpendingLimitInput as $, type ACPEndpoint as A, type IdentityResolver as B, type CommerceContext as C, type MPPChallengeSummary as D, type ExtractorRequestLike as E, type MPPCredentialSummary as F, type MPPIntent as G, type MPPKind as H, type IdentityBindingResult as I, type MPPReceiptSummary as J, type MPPRequestContext as K, type MPPRequestLike as L, type MPPChallengeForValue as M, type MPPResponseLike as N, type MPPVerifyInput as O, type MPPVerifyResult as P, type ParsedRFC9421 as Q, type PaymentMethodAllowlistInput as R, type RFC9421SignatureParams as S, type RFC9421Tag as T, type RFC9421VerifyOptions as U, type RFC9421VerifyRequest as V, type RFC9421VerifyResult as W, type RegistryName as X, type RegistryResolver as Y, type ResolveContext as Z, STRIPE_WEBHOOK_INFORMATIONAL_EVENTS as _, type ACPPaymentTokenType as a, getTransportExtractor as a$, type StripeWebhookInformationalEvent as a0, type TransactionContext as a1, type TransactionValueContext as a2, type TransportExtractor as a3, type UCPCheckoutContext as a4, type UCPManifestValidationResult as a5, type UCPRequestLike as a6, type UCPTotal as a7, type VIAllowedParty as a8, type VIBudgetLimit as a9, createWebBotAuthRegistry as aA, detectProtocol as aB, evaluatePaymentMethodAllowlist as aC, evaluateSpendingLimit as aD, evaluateVIConstraints as aE, extractA2ACredentials as aF, extractACPContext as aG, extractACPTransactionValue as aH, extractAP2Mandate as aI, extractAP2Mandates as aJ, extractAP2TransactionValue as aK, extractCredentialsFromProtocol as aL, extractHttpCredentials as aM, extractMPPContext as aN, extractMPPFromRequest as aO, extractMPPFromResponse as aP, extractMPPTransactionValue as aQ, extractMcpCredentials as aR, extractUCPContext as aS, extractUCPTransactionValue as aT, extractVIClaims as aU, extractVITransactionValue as aV, extractX402Context as aW, extractX402FromRequest as aX, extractX402FromResponse as aY, extractX402TransactionValue as aZ, fetchUCPManifest as a_, type VIClaimsForValue as aa, type VIConstraintEvalInput as ab, type VIConstraints as ac, type VIExecutionMode as ad, type VIExtractedClaims as ae, type VILayer as af, type VILineItem as ag, type VIMandateType as ah, type VIPaymentAmount as ai, type VIRecurrence as aj, type VIVerifyInput as ak, type VIVerifyResult as al, type VerifyStripeWebhookOptions as am, type VerifyStripeWebhookResult as an, type X402Kind as ao, type X402RequestContext as ap, type X402RequestForValue as aq, type X402RequestLike as ar, type X402RequirementsSummary as as, type X402ResponseLike as at, applyCredentials as au, bindIdentity as av, claim as aw, clearTransportExtractors as ax, createMastercardRegistry as ay, createVisaRegistry as az, type ACPRequestContext as b, getTransportExtractors as b0, index as b1, isStripeWebhookInformational as b2, mapACPRequestToPurpose as b3, mapAP2MandateToPurpose as b4, mapMPPRequestToPurpose as b5, mapRFC9421TagToPurpose as b6, mapUCPRequestToPurpose as b7, mapVIMandateToPurpose as b8, mapX402RequestToPurpose as b9, parseRFC9421 as ba, registerTransportExtractor as bb, runCommercePipeline as bc, runMatchingExtractors as bd, setA2AMetadata as be, setHttpHeaders as bf, setMcpMeta as bg, validateUCPManifest as bh, verifyACPSignature as bi, verifyAP2Chain as bj, verifyMPP as bk, verifyRFC9421 as bl, verifyStripeWebhook as bm, verifyVIChain as bn, type ACPRequestLike as c, type ACPSignatureAlgorithm as d, type ACPTotal as e, type ACPVerifyInput as f, type ACPVerifyResult as g, type AP2CartMandateClaims as h, type AP2ChainResult as i, type AP2IntentMandateClaims as j, type AP2MandateClaims as k, type AP2MandateTriple as l, type AP2MandateTripleInput as m, type AP2MandateType as n, type AP2PaymentDetailsTotal as o, type AP2PaymentMandateClaims as p, type AP2PaymentMandateForValue as q, type AP2VerifyInput as r, type CommercePipelineInput as s, type CommerceProtocol as t, type CommercePurpose as u, type CommerceSignatureStack as v, type ConstraintEvalResult as w, type ConstraintKey as x, type ConstraintResult as y, type IdentityClaim as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as AstraSyncCredentials, f as ProtocolTransport } from './types-L15pYd2c.mjs';
|
|
2
2
|
import { JWK } from 'jose';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1394,4 +1394,4 @@ declare namespace index {
|
|
|
1394
1394
|
export { type index_ACPEndpoint as ACPEndpoint, type index_ACPPaymentTokenType as ACPPaymentTokenType, type index_ACPRequestContext as ACPRequestContext, type index_ACPRequestLike as ACPRequestLike, type index_ACPSignatureAlgorithm as ACPSignatureAlgorithm, type index_ACPTotal as ACPTotal, type index_ACPVerifyInput as ACPVerifyInput, type index_ACPVerifyResult as ACPVerifyResult, type index_AP2CartMandateClaims as AP2CartMandateClaims, type index_AP2ChainResult as AP2ChainResult, type index_AP2IntentMandateClaims as AP2IntentMandateClaims, type index_AP2MandateClaims as AP2MandateClaims, type index_AP2MandateTriple as AP2MandateTriple, type index_AP2MandateTripleInput as AP2MandateTripleInput, type index_AP2MandateType as AP2MandateType, type index_AP2PaymentDetailsTotal as AP2PaymentDetailsTotal, type index_AP2PaymentMandateClaims as AP2PaymentMandateClaims, type index_AP2PaymentMandateForValue as AP2PaymentMandateForValue, type index_AP2VerifyInput as AP2VerifyInput, type index_CommerceContext as CommerceContext, type index_CommercePipelineInput as CommercePipelineInput, type index_CommerceProtocol as CommerceProtocol, type index_CommercePurpose as CommercePurpose, type index_CommerceSignatureStack as CommerceSignatureStack, type index_ConstraintEvalResult as ConstraintEvalResult, type index_ConstraintKey as ConstraintKey, type index_ConstraintResult as ConstraintResult, type index_ExtractorRequestLike as ExtractorRequestLike, type index_IdentityBindingResult as IdentityBindingResult, type index_IdentityClaim as IdentityClaim, type index_IdentityResolver as IdentityResolver, type index_MPPChallengeForValue as MPPChallengeForValue, type index_MPPChallengeSummary as MPPChallengeSummary, type index_MPPCredentialSummary as MPPCredentialSummary, type index_MPPIntent as MPPIntent, type index_MPPKind as MPPKind, type index_MPPReceiptSummary as MPPReceiptSummary, type index_MPPRequestContext as MPPRequestContext, type index_MPPRequestLike as MPPRequestLike, type index_MPPResponseLike as MPPResponseLike, type index_MPPVerifyInput as MPPVerifyInput, type index_MPPVerifyResult as MPPVerifyResult, type index_ParsedRFC9421 as ParsedRFC9421, type index_PaymentMethodAllowlistInput as PaymentMethodAllowlistInput, type index_RFC9421SignatureParams as RFC9421SignatureParams, type index_RFC9421Tag as RFC9421Tag, type index_RFC9421VerifyOptions as RFC9421VerifyOptions, type index_RFC9421VerifyRequest as RFC9421VerifyRequest, type index_RFC9421VerifyResult as RFC9421VerifyResult, type index_RegistryName as RegistryName, type index_RegistryResolver as RegistryResolver, type index_ResolveContext as ResolveContext, index_STRIPE_WEBHOOK_INFORMATIONAL_EVENTS as STRIPE_WEBHOOK_INFORMATIONAL_EVENTS, type index_SpendingLimitInput as SpendingLimitInput, type index_StripeWebhookInformationalEvent as StripeWebhookInformationalEvent, type index_TransactionContext as TransactionContext, type index_TransactionValueContext as TransactionValueContext, type index_TransportExtractor as TransportExtractor, type index_UCPCheckoutContext as UCPCheckoutContext, type index_UCPManifestValidationResult as UCPManifestValidationResult, type index_UCPRequestLike as UCPRequestLike, type index_UCPTotal as UCPTotal, type index_VIAllowedParty as VIAllowedParty, type index_VIBudgetLimit as VIBudgetLimit, type index_VIClaimsForValue as VIClaimsForValue, type index_VIConstraintEvalInput as VIConstraintEvalInput, type index_VIConstraints as VIConstraints, type index_VIExecutionMode as VIExecutionMode, type index_VIExtractedClaims as VIExtractedClaims, type index_VILayer as VILayer, type index_VILineItem as VILineItem, type index_VIMandateType as VIMandateType, type index_VIPaymentAmount as VIPaymentAmount, type index_VIRecurrence as VIRecurrence, type index_VIVerifyInput as VIVerifyInput, type index_VIVerifyResult as VIVerifyResult, type index_VerifyStripeWebhookOptions as VerifyStripeWebhookOptions, type index_VerifyStripeWebhookResult as VerifyStripeWebhookResult, type index_X402Kind as X402Kind, type index_X402RequestContext as X402RequestContext, type index_X402RequestForValue as X402RequestForValue, type index_X402RequestLike as X402RequestLike, type index_X402RequirementsSummary as X402RequirementsSummary, type index_X402ResponseLike as X402ResponseLike, index_applyCredentials as applyCredentials, index_bindIdentity as bindIdentity, index_claim as claim, index_clearTransportExtractors as clearTransportExtractors, index_createMastercardRegistry as createMastercardRegistry, index_createVisaRegistry as createVisaRegistry, index_createWebBotAuthRegistry as createWebBotAuthRegistry, index_detectProtocol as detectProtocol, index_evaluatePaymentMethodAllowlist as evaluatePaymentMethodAllowlist, index_evaluateSpendingLimit as evaluateSpendingLimit, index_evaluateVIConstraints as evaluateVIConstraints, index_extractA2ACredentials as extractA2ACredentials, index_extractACPContext as extractACPContext, index_extractACPTransactionValue as extractACPTransactionValue, index_extractAP2Mandate as extractAP2Mandate, index_extractAP2Mandates as extractAP2Mandates, index_extractAP2TransactionValue as extractAP2TransactionValue, index_extractCredentialsFromProtocol as extractCredentialsFromProtocol, index_extractHttpCredentials as extractHttpCredentials, index_extractMPPContext as extractMPPContext, index_extractMPPFromRequest as extractMPPFromRequest, index_extractMPPFromResponse as extractMPPFromResponse, index_extractMPPTransactionValue as extractMPPTransactionValue, index_extractMcpCredentials as extractMcpCredentials, index_extractUCPContext as extractUCPContext, index_extractUCPTransactionValue as extractUCPTransactionValue, index_extractVIClaims as extractVIClaims, index_extractVITransactionValue as extractVITransactionValue, index_extractX402Context as extractX402Context, index_extractX402FromRequest as extractX402FromRequest, index_extractX402FromResponse as extractX402FromResponse, index_extractX402TransactionValue as extractX402TransactionValue, index_fetchUCPManifest as fetchUCPManifest, index_getTransportExtractor as getTransportExtractor, index_getTransportExtractors as getTransportExtractors, index_isStripeWebhookInformational as isStripeWebhookInformational, index_mapACPRequestToPurpose as mapACPRequestToPurpose, index_mapAP2MandateToPurpose as mapAP2MandateToPurpose, index_mapMPPRequestToPurpose as mapMPPRequestToPurpose, index_mapRFC9421TagToPurpose as mapRFC9421TagToPurpose, index_mapUCPRequestToPurpose as mapUCPRequestToPurpose, index_mapVIMandateToPurpose as mapVIMandateToPurpose, index_mapX402RequestToPurpose as mapX402RequestToPurpose, index_parseRFC9421 as parseRFC9421, index_registerTransportExtractor as registerTransportExtractor, index_runCommercePipeline as runCommercePipeline, index_runMatchingExtractors as runMatchingExtractors, index_setA2AMetadata as setA2AMetadata, index_setHttpHeaders as setHttpHeaders, index_setMcpMeta as setMcpMeta, index_validateUCPManifest as validateUCPManifest, index_verifyACPSignature as verifyACPSignature, index_verifyAP2Chain as verifyAP2Chain, index_verifyMPP as verifyMPP, index_verifyRFC9421 as verifyRFC9421, index_verifyStripeWebhook as verifyStripeWebhook, index_verifyVIChain as verifyVIChain };
|
|
1395
1395
|
}
|
|
1396
1396
|
|
|
1397
|
-
export { type
|
|
1397
|
+
export { type SpendingLimitInput as $, type ACPEndpoint as A, type IdentityResolver as B, type CommerceContext as C, type MPPChallengeSummary as D, type ExtractorRequestLike as E, type MPPCredentialSummary as F, type MPPIntent as G, type MPPKind as H, type IdentityBindingResult as I, type MPPReceiptSummary as J, type MPPRequestContext as K, type MPPRequestLike as L, type MPPChallengeForValue as M, type MPPResponseLike as N, type MPPVerifyInput as O, type MPPVerifyResult as P, type ParsedRFC9421 as Q, type PaymentMethodAllowlistInput as R, type RFC9421SignatureParams as S, type RFC9421Tag as T, type RFC9421VerifyOptions as U, type RFC9421VerifyRequest as V, type RFC9421VerifyResult as W, type RegistryName as X, type RegistryResolver as Y, type ResolveContext as Z, STRIPE_WEBHOOK_INFORMATIONAL_EVENTS as _, type ACPPaymentTokenType as a, getTransportExtractor as a$, type StripeWebhookInformationalEvent as a0, type TransactionContext as a1, type TransactionValueContext as a2, type TransportExtractor as a3, type UCPCheckoutContext as a4, type UCPManifestValidationResult as a5, type UCPRequestLike as a6, type UCPTotal as a7, type VIAllowedParty as a8, type VIBudgetLimit as a9, createWebBotAuthRegistry as aA, detectProtocol as aB, evaluatePaymentMethodAllowlist as aC, evaluateSpendingLimit as aD, evaluateVIConstraints as aE, extractA2ACredentials as aF, extractACPContext as aG, extractACPTransactionValue as aH, extractAP2Mandate as aI, extractAP2Mandates as aJ, extractAP2TransactionValue as aK, extractCredentialsFromProtocol as aL, extractHttpCredentials as aM, extractMPPContext as aN, extractMPPFromRequest as aO, extractMPPFromResponse as aP, extractMPPTransactionValue as aQ, extractMcpCredentials as aR, extractUCPContext as aS, extractUCPTransactionValue as aT, extractVIClaims as aU, extractVITransactionValue as aV, extractX402Context as aW, extractX402FromRequest as aX, extractX402FromResponse as aY, extractX402TransactionValue as aZ, fetchUCPManifest as a_, type VIClaimsForValue as aa, type VIConstraintEvalInput as ab, type VIConstraints as ac, type VIExecutionMode as ad, type VIExtractedClaims as ae, type VILayer as af, type VILineItem as ag, type VIMandateType as ah, type VIPaymentAmount as ai, type VIRecurrence as aj, type VIVerifyInput as ak, type VIVerifyResult as al, type VerifyStripeWebhookOptions as am, type VerifyStripeWebhookResult as an, type X402Kind as ao, type X402RequestContext as ap, type X402RequestForValue as aq, type X402RequestLike as ar, type X402RequirementsSummary as as, type X402ResponseLike as at, applyCredentials as au, bindIdentity as av, claim as aw, clearTransportExtractors as ax, createMastercardRegistry as ay, createVisaRegistry as az, type ACPRequestContext as b, getTransportExtractors as b0, index as b1, isStripeWebhookInformational as b2, mapACPRequestToPurpose as b3, mapAP2MandateToPurpose as b4, mapMPPRequestToPurpose as b5, mapRFC9421TagToPurpose as b6, mapUCPRequestToPurpose as b7, mapVIMandateToPurpose as b8, mapX402RequestToPurpose as b9, parseRFC9421 as ba, registerTransportExtractor as bb, runCommercePipeline as bc, runMatchingExtractors as bd, setA2AMetadata as be, setHttpHeaders as bf, setMcpMeta as bg, validateUCPManifest as bh, verifyACPSignature as bi, verifyAP2Chain as bj, verifyMPP as bk, verifyRFC9421 as bl, verifyStripeWebhook as bm, verifyVIChain as bn, type ACPRequestLike as c, type ACPSignatureAlgorithm as d, type ACPTotal as e, type ACPVerifyInput as f, type ACPVerifyResult as g, type AP2CartMandateClaims as h, type AP2ChainResult as i, type AP2IntentMandateClaims as j, type AP2MandateClaims as k, type AP2MandateTriple as l, type AP2MandateTripleInput as m, type AP2MandateType as n, type AP2PaymentDetailsTotal as o, type AP2PaymentMandateClaims as p, type AP2PaymentMandateForValue as q, type AP2VerifyInput as r, type CommercePipelineInput as s, type CommerceProtocol as t, type CommercePurpose as u, type CommerceSignatureStack as v, type ConstraintEvalResult as w, type ConstraintKey as x, type ConstraintResult as y, type IdentityClaim as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
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,
|
|
4
|
-
export { e as express } from './express-
|
|
5
|
-
export { n as nextjs } from './nextjs-
|
|
6
|
-
export {
|
|
1
|
+
import { a as AgentCredentials, G as GatewayConfig, A as AccessLevel, V as VerificationRequest, i as VerificationResult } from './types-L15pYd2c.mjs';
|
|
2
|
+
export { b as AstraSyncCredentials, C as CommerceShieldProps, c as CounterpartyType, E as EnhancedVerificationResult, d as ExpressMiddlewareOptions, e as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, f as ProtocolTransport, R as RouteAccessConfig, g as RuntimeChallengeResult, S as SDKOptions, T as TokenGuidance, h as TrustLevel, j as VerifiedAgent, k as VerifiedDeveloper, l as VerifiedOrganization } from './types-L15pYd2c.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-Chhz-FcT.mjs';
|
|
4
|
+
export { e as express } from './express-4WStX3PV.mjs';
|
|
5
|
+
export { n as nextjs } from './nextjs-CjzHdaXA.mjs';
|
|
6
|
+
export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-D8IEntil.mjs';
|
|
7
7
|
export { McpMiddlewareOptions, createMcpMiddleware } from './adapters/mcp.mjs';
|
|
8
|
-
export { AgentProtocol, AgentRecord, AstraSync, AstraSyncConfig, AstraSyncError, AuthenticationError, FrameworkConfig, HealthResponse, KYDRequiredError, ModelConfig, PDLSSConfig, PDLSSDuration, PDLSSLimits, PDLSSPurpose, PDLSSScope, PDLSSSelfInstantiation, PendingRegistrationResponse, PollRegistrationResult, RegisterOptions, RegisterResult, RegistrationDeniedError, RegistrationExpiredError, RegistrationResponse, RegistrationTimeoutError, VerifyResponse, WaitForApprovalOptions } from './registration/index.mjs';
|
|
9
|
-
export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-
|
|
8
|
+
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';
|
|
9
|
+
export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-ChPX4WHl.mjs';
|
|
10
10
|
import 'express';
|
|
11
11
|
import 'next/server';
|
|
12
12
|
import 'jose';
|
|
@@ -35,10 +35,17 @@ declare function hasCredentials(credentials: AgentCredentials): boolean;
|
|
|
35
35
|
*/
|
|
36
36
|
declare function verify(config: GatewayConfig, request: VerificationRequest): Promise<VerificationResult>;
|
|
37
37
|
/**
|
|
38
|
-
* Quick verification
|
|
38
|
+
* Quick verification — checks credentials and policy in one call.
|
|
39
|
+
*
|
|
40
|
+
* Round-18 G4: return shape mirrors `VerificationResult`'s split — partners
|
|
41
|
+
* writing custom handlers around `quickVerify` get the same identity/policy
|
|
42
|
+
* distinction as those calling `verify()` directly. Map to HTTP status the
|
|
43
|
+
* same way: `!identityVerified` → 401; `identityVerified && !policyAllowed`
|
|
44
|
+
* → 403.
|
|
39
45
|
*/
|
|
40
46
|
declare function quickVerify(config: GatewayConfig, credentials: AgentCredentials): Promise<{
|
|
41
|
-
|
|
47
|
+
identityVerified: boolean;
|
|
48
|
+
policyAllowed: boolean;
|
|
42
49
|
accessLevel: AccessLevel;
|
|
43
50
|
reason?: string;
|
|
44
51
|
}>;
|
|
@@ -56,9 +63,13 @@ declare function quickVerify(config: GatewayConfig, credentials: AgentCredential
|
|
|
56
63
|
* const credentials = extractCredentials(request.headers);
|
|
57
64
|
* const result = await verify(config, { credentials, purpose: 'data-access' });
|
|
58
65
|
*
|
|
59
|
-
* if (result.
|
|
66
|
+
* if (result.identityVerified && result.policyAllowed && result.accessLevel !== 'none') {
|
|
60
67
|
* // Grant access based on result.accessLevel
|
|
61
68
|
* }
|
|
69
|
+
*
|
|
70
|
+
* // Or map to HTTP status codes directly:
|
|
71
|
+
* if (!result.identityVerified) return res.status(401).json({ ... }); // re-auth
|
|
72
|
+
* if (!result.policyAllowed) return res.status(403).json({ ... }); // step up / update PDLSS
|
|
62
73
|
* ```
|
|
63
74
|
*
|
|
64
75
|
* @packageDocumentation
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
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,
|
|
4
|
-
export { e as express } from './express-
|
|
5
|
-
export { n as nextjs } from './nextjs-
|
|
6
|
-
export {
|
|
1
|
+
import { a as AgentCredentials, G as GatewayConfig, A as AccessLevel, V as VerificationRequest, i as VerificationResult } from './types-L15pYd2c.js';
|
|
2
|
+
export { b as AstraSyncCredentials, C as CommerceShieldProps, c as CounterpartyType, E as EnhancedVerificationResult, d as ExpressMiddlewareOptions, e as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, f as ProtocolTransport, R as RouteAccessConfig, g as RuntimeChallengeResult, S as SDKOptions, T as TokenGuidance, h as TrustLevel, j as VerifiedAgent, k as VerifiedDeveloper, l as VerifiedOrganization } from './types-L15pYd2c.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-CqTEQAc6.js';
|
|
4
|
+
export { e as express } from './express-C1ePFB7n.js';
|
|
5
|
+
export { n as nextjs } from './nextjs-BIORS__0.js';
|
|
6
|
+
export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-CzJMCgEy.js';
|
|
7
7
|
export { McpMiddlewareOptions, createMcpMiddleware } from './adapters/mcp.js';
|
|
8
|
-
export { AgentProtocol, AgentRecord, AstraSync, AstraSyncConfig, AstraSyncError, AuthenticationError, FrameworkConfig, HealthResponse, KYDRequiredError, ModelConfig, PDLSSConfig, PDLSSDuration, PDLSSLimits, PDLSSPurpose, PDLSSScope, PDLSSSelfInstantiation, PendingRegistrationResponse, PollRegistrationResult, RegisterOptions, RegisterResult, RegistrationDeniedError, RegistrationExpiredError, RegistrationResponse, RegistrationTimeoutError, VerifyResponse, WaitForApprovalOptions } from './registration/index.js';
|
|
9
|
-
export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-
|
|
8
|
+
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';
|
|
9
|
+
export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-Cjm-zBeZ.js';
|
|
10
10
|
import 'express';
|
|
11
11
|
import 'next/server';
|
|
12
12
|
import 'jose';
|
|
@@ -35,10 +35,17 @@ declare function hasCredentials(credentials: AgentCredentials): boolean;
|
|
|
35
35
|
*/
|
|
36
36
|
declare function verify(config: GatewayConfig, request: VerificationRequest): Promise<VerificationResult>;
|
|
37
37
|
/**
|
|
38
|
-
* Quick verification
|
|
38
|
+
* Quick verification — checks credentials and policy in one call.
|
|
39
|
+
*
|
|
40
|
+
* Round-18 G4: return shape mirrors `VerificationResult`'s split — partners
|
|
41
|
+
* writing custom handlers around `quickVerify` get the same identity/policy
|
|
42
|
+
* distinction as those calling `verify()` directly. Map to HTTP status the
|
|
43
|
+
* same way: `!identityVerified` → 401; `identityVerified && !policyAllowed`
|
|
44
|
+
* → 403.
|
|
39
45
|
*/
|
|
40
46
|
declare function quickVerify(config: GatewayConfig, credentials: AgentCredentials): Promise<{
|
|
41
|
-
|
|
47
|
+
identityVerified: boolean;
|
|
48
|
+
policyAllowed: boolean;
|
|
42
49
|
accessLevel: AccessLevel;
|
|
43
50
|
reason?: string;
|
|
44
51
|
}>;
|
|
@@ -56,9 +63,13 @@ declare function quickVerify(config: GatewayConfig, credentials: AgentCredential
|
|
|
56
63
|
* const credentials = extractCredentials(request.headers);
|
|
57
64
|
* const result = await verify(config, { credentials, purpose: 'data-access' });
|
|
58
65
|
*
|
|
59
|
-
* if (result.
|
|
66
|
+
* if (result.identityVerified && result.policyAllowed && result.accessLevel !== 'none') {
|
|
60
67
|
* // Grant access based on result.accessLevel
|
|
61
68
|
* }
|
|
69
|
+
*
|
|
70
|
+
* // Or map to HTTP status codes directly:
|
|
71
|
+
* if (!result.identityVerified) return res.status(401).json({ ... }); // re-auth
|
|
72
|
+
* if (!result.policyAllowed) return res.status(403).json({ ... }); // step up / update PDLSS
|
|
62
73
|
* ```
|
|
63
74
|
*
|
|
64
75
|
* @packageDocumentation
|
package/dist/index.js
CHANGED
|
@@ -45,6 +45,7 @@ __export(src_exports, {
|
|
|
45
45
|
TRUST_LEVEL_RANGES: () => TRUST_LEVEL_RANGES,
|
|
46
46
|
VERSION: () => VERSION,
|
|
47
47
|
agent: () => agent_exports,
|
|
48
|
+
buildGuidance: () => buildGuidance,
|
|
48
49
|
clearCache: () => clearCache,
|
|
49
50
|
createMcpMiddleware: () => createMcpMiddleware,
|
|
50
51
|
determineAccessLevel: () => determineAccessLevel,
|
|
@@ -188,7 +189,7 @@ function getCapabilities(accessLevel) {
|
|
|
188
189
|
}
|
|
189
190
|
|
|
190
191
|
// src/version.ts
|
|
191
|
-
var SDK_VERSION = "2.4.
|
|
192
|
+
var SDK_VERSION = "2.4.9";
|
|
192
193
|
|
|
193
194
|
// src/verify.ts
|
|
194
195
|
var DEFAULT_CONFIG = {
|
|
@@ -305,12 +306,17 @@ function createGuidanceResponse(config, reason, options = {}) {
|
|
|
305
306
|
]
|
|
306
307
|
};
|
|
307
308
|
return {
|
|
308
|
-
|
|
309
|
+
// Round-18 G4: createGuidanceResponse fires for unverified-agent path or
|
|
310
|
+
// API-error fallback. Identity is not verified (no agent resolved);
|
|
311
|
+
// policy is not evaluated (we never reached the gate).
|
|
312
|
+
identityVerified: false,
|
|
313
|
+
policyAllowed: false,
|
|
309
314
|
// v2.3.9 (defect #30): denials grant `'none'`, NEVER a positive band.
|
|
310
|
-
// Adapters additionally short-circuit on
|
|
311
|
-
// the gate check, but the access level still has
|
|
312
|
-
// data layer so downstream consumers (SDK adapters
|
|
313
|
-
// custom integrations) inherit the correct
|
|
315
|
+
// Adapters additionally short-circuit on `!identityVerified ||
|
|
316
|
+
// !policyAllowed` before the gate check, but the access level still has
|
|
317
|
+
// to be honest at the data layer so downstream consumers (SDK adapters
|
|
318
|
+
// in other languages, custom integrations) inherit the correct
|
|
319
|
+
// semantics.
|
|
314
320
|
accessLevel: "none",
|
|
315
321
|
guidance,
|
|
316
322
|
denialReasons: reason ? [reason] : ["No valid agent credentials provided"],
|
|
@@ -454,15 +460,17 @@ async function verify(config, request) {
|
|
|
454
460
|
}
|
|
455
461
|
if (!apiResponse.access?.allowed) {
|
|
456
462
|
const aggregatedFailures = apiResponse.access?.failures;
|
|
463
|
+
const idVerifiedFromBackend = apiResponse.verificationContext?.idVerified === true;
|
|
457
464
|
const result2 = {
|
|
458
|
-
|
|
465
|
+
identityVerified: idVerifiedFromBackend,
|
|
466
|
+
policyAllowed: false,
|
|
459
467
|
// v2.3.9 (defect #30): denials grant `'none'`, NEVER a positive band.
|
|
460
468
|
// Pre-rename this hardcoded `'guidance'`, which conflated with the
|
|
461
469
|
// colocated `guidance: {...}` help-payload object below and let
|
|
462
470
|
// denied requests pass any route gated at `'guidance'` because
|
|
463
471
|
// `hasMinimumAccess('guidance', 'guidance') === true`. Adapters now
|
|
464
|
-
// ALSO short-circuit on
|
|
465
|
-
// belt-and-braces.
|
|
472
|
+
// ALSO short-circuit on `!identityVerified || !policyAllowed` before
|
|
473
|
+
// the gate check — belt-and-braces.
|
|
466
474
|
accessLevel: "none",
|
|
467
475
|
denialReasons: aggregatedFailures && aggregatedFailures.length > 0 ? aggregatedFailures.map((f) => f.message) : apiResponse.access?.reason ? [apiResponse.access.reason] : ["Access denied"],
|
|
468
476
|
failures: aggregatedFailures,
|
|
@@ -506,7 +514,13 @@ async function verify(config, request) {
|
|
|
506
514
|
const verificationContext = apiResponse.verificationContext;
|
|
507
515
|
const accessLevel = apiResponse.access?.accessLevel ?? "standard";
|
|
508
516
|
const result = {
|
|
509
|
-
|
|
517
|
+
// Round-18 G4: backend allowed access. Identity is verified (we resolved
|
|
518
|
+
// the caller to an agent) and policy passed all gates. Read idVerified
|
|
519
|
+
// from verificationContext for symmetry with the deny branch; default true
|
|
520
|
+
// on success path since `access.allowed === true` implies identity was
|
|
521
|
+
// resolvable (anonymous-allow paths flow through createGuidanceResponse).
|
|
522
|
+
identityVerified: apiResponse.verificationContext?.idVerified !== false,
|
|
523
|
+
policyAllowed: true,
|
|
510
524
|
accessLevel,
|
|
511
525
|
agent,
|
|
512
526
|
developer,
|
|
@@ -529,7 +543,7 @@ async function verify(config, request) {
|
|
|
529
543
|
warningHeader: apiResponse.warningHeader
|
|
530
544
|
};
|
|
531
545
|
if (result.recommendation === "deny") {
|
|
532
|
-
result.
|
|
546
|
+
result.policyAllowed = false;
|
|
533
547
|
result.accessLevel = "none";
|
|
534
548
|
result.denialReasons = result.recommendationReasons || [
|
|
535
549
|
"Access denied by AstraSync recommendation"
|
|
@@ -629,7 +643,8 @@ async function quickVerify(config, credentials) {
|
|
|
629
643
|
purpose: "verification"
|
|
630
644
|
});
|
|
631
645
|
return {
|
|
632
|
-
|
|
646
|
+
identityVerified: result.identityVerified,
|
|
647
|
+
policyAllowed: result.policyAllowed,
|
|
633
648
|
accessLevel: result.accessLevel,
|
|
634
649
|
reason: result.denialReasons?.[0]
|
|
635
650
|
};
|
|
@@ -801,12 +816,12 @@ function findRouteConfig(routes, path, method) {
|
|
|
801
816
|
});
|
|
802
817
|
}
|
|
803
818
|
function defaultOnDenied(result, _req, res) {
|
|
804
|
-
const statusCode = result.
|
|
819
|
+
const statusCode = !result.identityVerified ? 401 : 403;
|
|
805
820
|
res.setHeader("X-Astra-Gateway-Mode", "enforced");
|
|
806
821
|
res.status(statusCode).json({
|
|
807
822
|
success: false,
|
|
808
823
|
error: {
|
|
809
|
-
code: result.
|
|
824
|
+
code: !result.identityVerified ? "UNAUTHORIZED" : "INSUFFICIENT_ACCESS",
|
|
810
825
|
message: result.denialReasons?.[0] || "Access denied",
|
|
811
826
|
accessLevel: result.accessLevel,
|
|
812
827
|
guidance: result.guidance,
|
|
@@ -900,7 +915,8 @@ function createMiddleware(options) {
|
|
|
900
915
|
const preCheckFailures = performCounterpartyPreCheck(routeConfig, astraCreds, purpose);
|
|
901
916
|
if (preCheckFailures.length > 0) {
|
|
902
917
|
const result2 = {
|
|
903
|
-
|
|
918
|
+
identityVerified: false,
|
|
919
|
+
policyAllowed: false,
|
|
904
920
|
accessLevel: "none",
|
|
905
921
|
denialReasons: preCheckFailures.map((f) => f.message),
|
|
906
922
|
guidance: {
|
|
@@ -949,7 +965,7 @@ function createMiddleware(options) {
|
|
|
949
965
|
});
|
|
950
966
|
req.agentVerification = result;
|
|
951
967
|
const sessionId = result.sessionId;
|
|
952
|
-
if (!result.
|
|
968
|
+
if (!result.identityVerified || !result.policyAllowed) {
|
|
953
969
|
if (shouldRecordDecisions && sessionId) {
|
|
954
970
|
recordDecision(config, sessionId, "denied", result.denialReasons?.[0]).catch(() => {
|
|
955
971
|
});
|
|
@@ -1300,7 +1316,8 @@ function createMiddleware2(options) {
|
|
|
1300
1316
|
const preCheckFailures = performCounterpartyPreCheck(routeConfig, astraCreds, purpose);
|
|
1301
1317
|
if (preCheckFailures.length > 0) {
|
|
1302
1318
|
const preCheckResult = {
|
|
1303
|
-
|
|
1319
|
+
identityVerified: false,
|
|
1320
|
+
policyAllowed: false,
|
|
1304
1321
|
accessLevel: "none",
|
|
1305
1322
|
denialReasons: preCheckFailures.map((f) => f.message),
|
|
1306
1323
|
guidance: {
|
|
@@ -1363,20 +1380,22 @@ function createMiddleware2(options) {
|
|
|
1363
1380
|
agentCardUrl: request.headers.get("x-astrasync-agent-card") || void 0
|
|
1364
1381
|
}
|
|
1365
1382
|
});
|
|
1366
|
-
if (!result.
|
|
1383
|
+
if (!result.identityVerified || !result.policyAllowed || !hasMinimumAccess(result.accessLevel, routeConfig.minAccessLevel)) {
|
|
1367
1384
|
if (pathname.startsWith("/api/")) {
|
|
1368
1385
|
return NextResponse.json(
|
|
1369
1386
|
{
|
|
1370
1387
|
success: false,
|
|
1371
1388
|
error: {
|
|
1372
|
-
|
|
1389
|
+
// Round-18 G4: 401 → identity missing (re-auth); 403 → identity
|
|
1390
|
+
// OK, policy denied (update PDLSS / step up).
|
|
1391
|
+
code: !result.identityVerified ? "UNAUTHORIZED" : "INSUFFICIENT_ACCESS",
|
|
1373
1392
|
message: result.denialReasons?.[0] || "Access denied",
|
|
1374
1393
|
accessLevel: result.accessLevel,
|
|
1375
1394
|
required: routeConfig.minAccessLevel,
|
|
1376
1395
|
guidance: result.guidance
|
|
1377
1396
|
}
|
|
1378
1397
|
},
|
|
1379
|
-
{ status: result.
|
|
1398
|
+
{ status: !result.identityVerified ? 401 : 403 }
|
|
1380
1399
|
);
|
|
1381
1400
|
}
|
|
1382
1401
|
if (showCommerceShield) {
|
|
@@ -1391,7 +1410,12 @@ function createMiddleware2(options) {
|
|
|
1391
1410
|
return NextResponse.redirect(new URL("/unauthorized", request.url));
|
|
1392
1411
|
}
|
|
1393
1412
|
const response = NextResponse.next();
|
|
1394
|
-
response.headers.set(
|
|
1413
|
+
response.headers.set(
|
|
1414
|
+
"X-AstraSync-Verified",
|
|
1415
|
+
(result.identityVerified && result.policyAllowed).toString()
|
|
1416
|
+
);
|
|
1417
|
+
response.headers.set("X-AstraSync-Identity-Verified", result.identityVerified.toString());
|
|
1418
|
+
response.headers.set("X-AstraSync-Policy-Allowed", result.policyAllowed.toString());
|
|
1395
1419
|
response.headers.set("X-AstraSync-Access-Level", result.accessLevel);
|
|
1396
1420
|
if (result.agent) {
|
|
1397
1421
|
response.headers.set("X-AstraSync-Agent-Id", result.agent.astraId);
|
|
@@ -1459,7 +1483,11 @@ var VerificationGatewayClient = class {
|
|
|
1459
1483
|
);
|
|
1460
1484
|
}
|
|
1461
1485
|
/**
|
|
1462
|
-
* Quick verification
|
|
1486
|
+
* Quick verification — checks credentials and policy in one call.
|
|
1487
|
+
*
|
|
1488
|
+
* Round-18 G4: return shape mirrors `VerificationResult`'s identity/policy
|
|
1489
|
+
* split. Map to HTTP status the same way: `!identityVerified` → 401,
|
|
1490
|
+
* `identityVerified && !policyAllowed` → 403.
|
|
1463
1491
|
*/
|
|
1464
1492
|
async quickVerify(credentials) {
|
|
1465
1493
|
return this.executeWithRetry(() => quickVerify(this.config, credentials));
|
|
@@ -4102,13 +4130,16 @@ function readSingleHeader(value) {
|
|
|
4102
4130
|
}
|
|
4103
4131
|
function defaultMcpDenied(result, req, res) {
|
|
4104
4132
|
const id = req.body?.id ?? null;
|
|
4105
|
-
const status = result.
|
|
4133
|
+
const status = !result.identityVerified ? 401 : 403;
|
|
4106
4134
|
res.setHeader("X-Astra-Gateway-Mode", "enforced");
|
|
4107
4135
|
res.status(status).json({
|
|
4108
4136
|
jsonrpc: "2.0",
|
|
4109
4137
|
id,
|
|
4110
4138
|
error: {
|
|
4111
|
-
|
|
4139
|
+
// JSON-RPC error codes:
|
|
4140
|
+
// -32000 → unauthorized (no identity resolved)
|
|
4141
|
+
// -32001 → insufficient access (identity OK, policy denied)
|
|
4142
|
+
code: !result.identityVerified ? -32e3 : -32001,
|
|
4112
4143
|
message: result.denialReasons?.[0] ?? "Access denied",
|
|
4113
4144
|
data: {
|
|
4114
4145
|
accessLevel: result.accessLevel,
|
|
@@ -4242,7 +4273,7 @@ function createMcpMiddleware(options) {
|
|
|
4242
4273
|
req.agentVerification = result;
|
|
4243
4274
|
const sessionId = result.sessionId;
|
|
4244
4275
|
const correlationId = result.correlationId;
|
|
4245
|
-
if (!result.
|
|
4276
|
+
if (!result.identityVerified || !result.policyAllowed) {
|
|
4246
4277
|
if (shouldRecordDecisions && sessionId) {
|
|
4247
4278
|
recordDecision(config, sessionId, "denied", result.denialReasons?.[0]).catch(() => {
|
|
4248
4279
|
});
|
|
@@ -4403,10 +4434,15 @@ var AstraSync = class {
|
|
|
4403
4434
|
}
|
|
4404
4435
|
}
|
|
4405
4436
|
this.baseUrl = raw;
|
|
4406
|
-
this.apiKey = config.apiKey || process.env.ASTRASYNC_API_KEY;
|
|
4437
|
+
this.apiKey = config.disableEnvFallback ? config.apiKey : config.apiKey || process.env.ASTRASYNC_API_KEY;
|
|
4407
4438
|
this.email = config.email;
|
|
4408
4439
|
this.password = config.password;
|
|
4409
4440
|
this.privateKey = config.privateKey;
|
|
4441
|
+
if (!config.apiKey && !config.disableEnvFallback && process.env.ASTRASYNC_API_KEY && !config.silent) {
|
|
4442
|
+
console.warn(
|
|
4443
|
+
"[AstraSync] No apiKey passed to constructor; using process.env.ASTRASYNC_API_KEY. If this code wraps user-facing flows (e.g. MCP tool handlers), pass disableEnvFallback: true to prevent ambient credentials from impersonating callers. See https://astrasync.ai/docs/agent-access#disableenvfallback for details."
|
|
4444
|
+
);
|
|
4445
|
+
}
|
|
4410
4446
|
if (!this.apiKey && !this.email) {
|
|
4411
4447
|
throw new AuthenticationError(
|
|
4412
4448
|
"Authentication required. Provide apiKey, or email+password. Set ASTRASYNC_API_KEY env var or pass config to constructor."
|
|
@@ -4654,6 +4690,29 @@ var AstraSync = class {
|
|
|
4654
4690
|
}
|
|
4655
4691
|
};
|
|
4656
4692
|
|
|
4693
|
+
// src/registration/guidance.ts
|
|
4694
|
+
function buildGuidance(params) {
|
|
4695
|
+
const origin = params.origin.replace(/\/+$/, "");
|
|
4696
|
+
const docsPath = params.documentationPath ?? "/docs/agent-access";
|
|
4697
|
+
const message = params.message ?? "AstraSync registration requires credentials.";
|
|
4698
|
+
return {
|
|
4699
|
+
status: "credentials_required",
|
|
4700
|
+
message,
|
|
4701
|
+
guidance: {
|
|
4702
|
+
message: "AstraSync registration requires credentials. Get an account + API key, then call register_agent again.",
|
|
4703
|
+
registrationUrl: `${origin}/register`,
|
|
4704
|
+
documentationUrl: `${origin}${docsPath.startsWith("/") ? docsPath : `/${docsPath}`}`,
|
|
4705
|
+
steps: [
|
|
4706
|
+
"Visit registrationUrl and create an AstraSync account (or log in if you have one).",
|
|
4707
|
+
"Generate an API key from Settings \u2192 API Keys.",
|
|
4708
|
+
"Re-call register_agent with the apiKey populated.",
|
|
4709
|
+
"After registration returns status: pending_approval, the owner approves via email.",
|
|
4710
|
+
"Use poll_registration({ requestId }) to retrieve the astraId once approved."
|
|
4711
|
+
]
|
|
4712
|
+
}
|
|
4713
|
+
};
|
|
4714
|
+
}
|
|
4715
|
+
|
|
4657
4716
|
// src/agent/index.ts
|
|
4658
4717
|
var agent_exports = {};
|
|
4659
4718
|
__export(agent_exports, {
|
|
@@ -4987,6 +5046,7 @@ var VERSION = "2.0.0";
|
|
|
4987
5046
|
TRUST_LEVEL_RANGES,
|
|
4988
5047
|
VERSION,
|
|
4989
5048
|
agent,
|
|
5049
|
+
buildGuidance,
|
|
4990
5050
|
clearCache,
|
|
4991
5051
|
createMcpMiddleware,
|
|
4992
5052
|
determineAccessLevel,
|