Skip to content

mppx validate: multi-challenge support, per-method validation, streaming output#629

Open
bensandler-stripe wants to merge 1 commit into
wevm:mainfrom
bensandler-stripe:bensandler-validate-improvements
Open

mppx validate: multi-challenge support, per-method validation, streaming output#629
bensandler-stripe wants to merge 1 commit into
wevm:mainfrom
bensandler-stripe:bensandler-validate-improvements

Conversation

@bensandler-stripe

@bensandler-stripe bensandler-stripe commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

A number of improvements to mppx validate. Builds on #631.

Bug fixes:

  • Instead of picking first method for automatic crypto transfer, iterates over all methods and makes transfers for any supported method (tempo, soon to be base)
  • Fixed URL resolution when base URL has a subpath (e.g. mppx validate https://api.example.com/mpp now correctly resolves to /mpp/openapi.json instead of /openapi.json)
  • Guarded all BigInt conversions with isValidIntegerAmount regex check first (prevents crash on non-integer amounts like "5.000000")
  • Multi-challenge parsing: uses fromResponseList to parse all payment methods from WWW-Authenticate (previously only picked the first one)
  • Amount is always required (fail not warn when missing)
  • Console.log leak fixed in JSON mode

UX and validation improvements:

  • Per-method field validation: validates Stripe (amount, currency, networkId, paymentMethodTypes), EVM (recipient, currency, amount, chainId), and Tempo (recipient/splits, currency, amount) challenge fields
  • Common field checks reduced across all challenges (id, realm, expiration, realm-match) into single pass/fail per field
  • Token symbol and chain name in payment prompts ("USDC.e on Tempo Mainnet")
  • Tempo recipient validation: must have either recipient or splits
  • Unsupported payment methods silently skipped (no noise in summary count)

Diffs before/after

@bensandler-stripe bensandler-stripe force-pushed the bensandler-validate-improvements branch from 09fafb7 to 5a9072e Compare July 9, 2026 21:54
@pkg-pr-new

pkg-pr-new Bot commented Jul 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/mppx@629

commit: a23b9ca

@bensandler-stripe bensandler-stripe force-pushed the bensandler-validate-improvements branch 2 times, most recently from 7bec8d5 to 9241fef Compare July 9, 2026 22:04
@bensandler-stripe bensandler-stripe marked this pull request as draft July 9, 2026 22:09
@bensandler-stripe bensandler-stripe force-pushed the bensandler-validate-improvements branch from 9241fef to 91e84bf Compare July 9, 2026 22:10
@bensandler-stripe bensandler-stripe marked this pull request as ready for review July 10, 2026 14:32
@bensandler-stripe

Copy link
Copy Markdown
Contributor Author

r? @brendanjryan

@bensandler-stripe bensandler-stripe marked this pull request as draft July 10, 2026 15:17
@bensandler-stripe bensandler-stripe force-pushed the bensandler-validate-improvements branch 8 times, most recently from ea9256f to ecc5e92 Compare July 10, 2026 16:19
@brendanjryan brendanjryan marked this pull request as ready for review July 10, 2026 16:32

@brendanjryan brendanjryan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bensandler-stripe -- some CI issues but content-wise this look good!

@bensandler-stripe bensandler-stripe force-pushed the bensandler-validate-improvements branch 10 times, most recently from 0eca153 to e474a0c Compare July 10, 2026 17:45
@bensandler-stripe bensandler-stripe marked this pull request as draft July 10, 2026 17:47
@bensandler-stripe

Copy link
Copy Markdown
Contributor Author

ah @brendanjryan sorry if I wasted your time, I was adding a few other fixes to this branch. Will get your review in a few.

@bensandler-stripe bensandler-stripe force-pushed the bensandler-validate-improvements branch 5 times, most recently from b77cf89 to fb93ddf Compare July 10, 2026 18:28
@bensandler-stripe bensandler-stripe changed the title Improve mppx validate error reporting and fix URL resolution mppx validate: multi-challenge support, per-method validation, streaming output Jul 10, 2026
@bensandler-stripe bensandler-stripe force-pushed the bensandler-validate-improvements branch 7 times, most recently from 65bd823 to 6f5a7dc Compare July 10, 2026 21:13
@bensandler-stripe

Copy link
Copy Markdown
Contributor Author

@brendanjryan let's merge #631 first (this PR is now rebased off that branch) and then I'll have you review this one

…ment loop

  - Multi-challenge parsing (fromResponseList) with per-method [tag] prefixes
  - Per-method field validation for Stripe, EVM, and Tempo
  - Payment loop tries each supported method with per-method prompts
  - Common field checks reduced across all challenges
  - URL resolution fix for subpath-mounted servers
  - BigInt guards with isValidIntegerAmount
  - Malformed challenge detection and reporting

  GIT_VALID_PII_OVERRIDE
@bensandler-stripe bensandler-stripe force-pushed the bensandler-validate-improvements branch from 6f5a7dc to a23b9ca Compare July 11, 2026 16:11
@@ -0,0 +1,5 @@
---

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff is a bit easier to review with hiding whitespace:

Image

@bensandler-stripe bensandler-stripe marked this pull request as ready for review July 11, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants