Harden v1.1.0 commercial schema validation#12
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
$defswithout reintroducing_shared.Description
merchantinauthorize.requestby adding it to the top-levelrequiredarray so authorize requests explicitly name the merchant counterparty (schemas/v1.1.0/commercial/authorize/authorize.request.schema.json).authorization_idconditional inauthorize.receiptby removing it from the unconditionalrequiredlist and adding a status-basedif/thenthat requiresauthorization_idandapproved_untilwhenstatusisapproved, and requiresreasonwhenstatusisdenied, leavingpendingfree of forced fake details (schemas/v1.1.0/commercial/authorize/authorize.receipt.schema.json).requesteras the initiator of a verification request and distinguish it from the receipt-sideverifierinREADME.md,SPEC.md, andPOLICY.md, and add brief property-level descriptions to the verify request schema (schemas/v1.1.0/commercial/verify/verify.request.schema.json,README.md,SPEC.md,POLICY.md).$defsconsistency guard toscripts/validate-all.mjsthat normalizes JSON and asserts exact equality for the intended duplicate defs:actor_identity,payer_actor,payee_actor,merchant_actor,provider_actor,carrier_actor,verifier_actor,reference,money, andpayment_proof, failing with a helpful message on drift (scripts/validate-all.mjs).$defsref inverify.receipt($defs.actor→$defs.actor_identity), remove a stalepayment_reffrom the purchase valid example, and update the authorize invalid example to still demonstrate a single focused failure (schemas/v1.1.0/commercial/verify/verify.receipt.schema.json,examples/v1.1.0/commercial/purchase/valid/900-purchase.receipt.valid.json,examples/v1.1.0/commercial/authorize/invalid/001-authorize.request.invalid.json).checksums.txtto reflect the edited checksum-covered artifacts (checksums.txt).Testing
npm run validateand the updatedscripts/validate-all.mjs(which now includes canonical$defsconsistency checks) and it completed successfully.npm run validate:examplesand all current-line valid/invalid examples validated successfully.npm run generate:checksumsand the checksum ledger was regenerated to cover the modified machine-artifact set.Codex Task