Skip to content

Commit 5b0590c

Browse files
NAOR YUVALNAOR YUVAL
authored andcommitted
fix: address PR review — undefined decision, vector rename, merge compat, JSDoc
- README Quick Start: define `decision` variable before use in verifySettlement - Rename intent-hash-mismatch.json → settlement-amount-mismatch.json (no intent hash after SPA removal) - merge.ts: write to both vendorAllowlist and operatorAllowlist during deprecation window so callers reading operatorAllowlist from resolveEffectivePolicy() still get the merged result - types.ts: fix trustBundles JSDoc wording ("pre-configured key" not "env-var") Made-with: Cursor
1 parent 932ffbd commit 5b0590c

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const sba = createSignedBudgetAuthorization({
4848
});
4949

5050
// 3. Verify the chain (merchant / Trust Gateway)
51+
const decision = { /* PaymentPolicyDecision from evaluatePaymentPolicy() */ };
5152
const result = verifySettlement({
5253
policyGrant: grant,
5354
signedBudgetAuthorization: sba,

src/policy-core/merge.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ function mergeTwo(base: Policy, override: Policy): Policy {
5252
base.vendorAllowlist ?? base.operatorAllowlist,
5353
override.vendorAllowlist ?? override.operatorAllowlist,
5454
),
55-
operatorAllowlist: undefined,
55+
operatorAllowlist: mergeAllowlist(
56+
base.vendorAllowlist ?? base.operatorAllowlist,
57+
override.vendorAllowlist ?? override.operatorAllowlist,
58+
),
5659
geoAllowlist: mergeGeoAllowlist(base.geoAllowlist, override.geoAllowlist),
5760
railAllowlist: mergeRailAllowlist(base.railAllowlist, override.railAllowlist),
5861
assetAllowlist: mergeAssetAllowlist(base.assetAllowlist, override.assetAllowlist),

src/verifier/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@ export interface SettlementVerificationContext {
9595
cumulativeSpentMinor?: string;
9696
/** Pre-verified Trust Bundles for offline key resolution.
9797
* When provided, SBA and PolicyGrant signature verification resolves issuer keys
98-
* from the bundles before falling back to env-var or HTTPS well-known. */
98+
* from the bundles before falling back to pre-configured key or HTTPS well-known. */
9999
trustBundles?: TrustBundle[];
100100
}
File renamed without changes.

0 commit comments

Comments
 (0)