Repository navigation
fix(sdk): reject payment constraints without a type - #397
Draft
williammacarini wants to merge 2 commits into
Draft
williammacarini wants to merge 2 commits into
williammacarini wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
OpenPaymentMandatecurrently accepts a constraint such as{"foo": "bar"}as an emptyExecutionDate. No date limits remain to evaluate, so a malformed constraint can silently become a no-op.Require mapping-based payment constraints to declare
typebefore generated model defaults are applied. Known-type validation remains with Pydantic. Typed SDK constructors such asExecutionDate()keep their existing default identifiers.Register the pre-validation hook in the SDK generator, regenerate
OpenPaymentMandate, and document the tested generator version. The protocol JSON schemas are unchanged, keeping this contribution within the SDK scope of CONTRIBUTING.md.Fixes #395.
Validation
Tested source tree:
cba3969079640f40328027dbeb5145cc52235c5c; published commit:f21731f26ee210820d92ea196f1cd4e6dd286a67.kb_sd_jwt_intermediate_tests.py::test_verify_rejects_aud_mismatchkb_sd_jwt_intermediate_tests.py::test_verify_rejects_nonce_mismatchgit diff --checkpass.open_payment_mandate.pychanges semantically, and its regenerated content matches this patch.types/jwk.py: optionalcrvandalgdefaults. That unrelated generated file is unchanged in this PR.Environment: Python 3.12, Pydantic 2.12.5, pytest 9.0.2, datamodel-code-generator 0.87.0. These are SDK parsing and regression checks, not payment E2E tests or a claim of an unconditional authorization bypass.
CI follow-up
Register the existing SDK terms
PISP,pisp,Pisps,pisps,datamodelandcodegenin the spelling dictionary, and fix the generation guide heading and shell example formatting.The initial Super-Linter run also reported 75 Biome errors in unchanged
code/web-clientanddocs/assetsfiles. This is the existing repository-wide scan described in #306 and #366; it is separate from this SDK patch.