Repository navigation
mppx@0.22.4
·
11 commits
to main
since this release
Patch Changes
- a1d7a34: Fixed the Express adapter to pass the raw request body to mppx: it now uses
req.rawBodywhen a body parser keeps it, so body digests and signatures over the body verify. - bd98291: Fixed the Tempo charge client to never pay by push (hash or Zone) for a challenge whose request sets
methodDetails.memo, which servers must reject; it pays by pull instead, or refuses a push-only challenge without paying. - 266c388: Fixed loading CLI config files whose paths contain
#or%. - a81113a: Changed
composeto throw aTypeErrorwhen it would advertise x402 offers that bind the request body together with x402 offers that do not in onePAYMENT-REQUIREDheader. An x402 requirement that another advertised offer already lists is now left out of that header instead of replacing it with an error. - 1aa7155: Fixed composed routes to send a Credential to the offer whose whole binding matches its Challenge, so an offer that leaves a field such as metadata unset no longer takes a Credential issued for a twin offer that sets it.
- 61c070e: Updated cross-spawn to a patched release.
- 3d1c254: Fixed paid retries of
digestroutes:mppx/clientnow replays a request body byte for byte (a body with a leading BOM or invalid UTF-8 is no longer re-encoded) and encodes aFormDatabody once, so the retry keeps its multipart boundary. Adigestroute's default expiry now counts from when the request body has arrived, andmppx/proxybounds adigestroute's request body bymaxRequestBodySizebefore issuing a Challenge. - a6fc556: Updated the glob override to 14.0.6 and vite-plus to 1.5.1.
- 7e3094a: Added the
credentialGraceMsoption totempo.charge, which also accepts ahashCredential presented after its Challenge expires when its transaction was mined before the expiry, for Challenges issued by this release;zoneCredentialGraceMsis now a deprecated alias for it. The fetch client andMcpClient.wrapno longer pay a new Challenge after one answers a push (hash) or Zone (zone) payment the client already made, and throwPaymentOutcomeUnknownErrorwith the transaction hash instead; a 402 without a new Challenge is returned as before. The tempo client now throws when its push transaction reverts instead of sending a Credential for it. - 69736ca: Changed a 403 identity rejection to answer with an
application/problem+jsonProblem Details body (https://paymentauth.org/problems/access-denied) that says access was denied and no payment was settled. Other identity rejections still answer with the reason as plain text. - 5bc9922: Fixed the Tempo charge client to report that push mode is not supported for a challenge with a memo, instead of a generic unsupported-mode error.
- a68be2e: Fixed
Store.memory()keeping expired replay claims: it now removes them when their key is next read or written and sweeps a few on every write, so memory stays bounded by unexpired claims. Siblingtempo.charge()andtempo()charge offers now share one store when none is passed, and a zero-amount proof whose Challenge expires before its claim is now rejected as expired. - 8d4a24f: Pointed the package homepage at mpp.dev and added a description and keywords.
- b6aa28c: Changed
tempo.chargeon the server to require the attribution memo bound to the Challenge on everytransactioncredential the server does not co-sign as fee payer, not only when the node already held the transaction. mppx clients already add this memo. A retry of a transaction the server already broadcast for the same Challenge with an unknown outcome is still recovered without it. - 06446e3: Added recovery of a Tempo charge whose response was lost: when the Challenge carries a nonce (the default), on a
GETorHEADroute or one whose Challenge binds the request body digest, the server answers the same Credential sent again for the same request once with the original Receipt instead of charging again, even after its Challenge expired. Other requests are unchanged. - e311e44: Fixed
Proxyreplay so a request carrying more than one Payment credential gets 400 from its route instead of a stored delivery. - 6419914: Added an opt-in HTTPS-only mode:
requireHttps: true(orMPP_REQUIRE_HTTPS=1) on the server and clientMppx.create,Fetch.from,McpClient.wrapandsessionManager. Servers answer 400 instead of a Challenge unless the request URL ishttps:, its host is loopback, orX-Forwarded-Protoishttps; clients throw instead of sending a Credential to anhttp:orws:URL on a host other than loopback. - a6e11e9: Added
retryAftertoVerificationFailedError,InternalPaymentErrorand custom payment errors, which the HTTP transport sends as aRetry-Afterheader. Tempo subscription activations and renewals that are already in flight now answer their 402 withRetry-After: 1. - 8b68a38: Added
rebuildChallengeOnFailuretoMethod.toServer: when set, the retry Challenge after a failedverifyruns therequesthook again with anullCredential, so it reflects state thatverifychanged (such as a retired single-use recipient). A rebuild that fails or takes longer than 2 seconds falls back to the original Challenge, which other methods always reuse. - c3c90b1: Added support for passing several secret keys to
Mppx.create()andChallenge.verify(), so servers keep verifying Challenges issued under a previous key while rotating it. Challenges are issued with the first key, and a single string works as before. - 3d1c254: Added a
digestroute option tomppx/serverhandlers. Withdigest: true, a route binds each Challenge to the request body and accepts a Credential only with the same body; requests without a body get no digest. In Express such a route needs a body parser, x402 credentials needextensions.mppxand Tempo transaction credentials need the attribution memo bound to the Challenge to pay it, a Method's owndigestrequest input (any non-boolean value) still reaches the Method, andMppx.toNodeListenernow passes handlers a readable request body. - 6682c48: Fixed session management requests through an identity-wrapped fetch timing the whole request against one deadline: each wire send is now timed on its own, and a refresh that fails or times out after a 401 returns that 401 instead of leaving a top-up's outcome unknown.
- b78943f: Fixed request-priced SSE POST requests accepting the same voucher more than once when unused credit remained.
- 28198a1: Added an optional
ttlMstoStore.put, honored by every store adapter: reads returnnullonce the value expires, and adapters with a native expiry (memory, Redispsetex, Upstashpx, Cloudflare KVexpirationTtl) also set it. The Tempo charge now writes the Receipt it keeps for recovering a lost response with that expiry. - cfce76c: Rejected HTTP message signatures that cover a component twice, cover
@signature-paramsor give a component parameters other thankey, and Web Bot Auth signatures in algorithms its profile does not support. TAP verification now rejects a nonce already used by any key within the signature lifetime. - 1aa7155: Fixed
stripe.chargeto reject a Credential whose Challenge was issued with a different Business Network (networkId) or metadata than the route now requests. The 402 retry carries a fresh Challenge for the current request. - a12e750: HTTP message signature verification now throws instead of checking a covered
content-digestagainst a body that was already read, parsed by Express without its raw bytes, or dropped from aGETorHEADrequest, and claims a digest-bound nonce before reading the body when the nonce store can release it again. - a97a6cb: Added RFC 9421
@method,@scheme, and@queryrequest components to HTTP message signature signing and verification, allowing TAP signatures to cover more than the required authority and path. BehindMppx.toNodeListener,Request.toNodeListenerand the Express adapter, with or without a request body,@method,@path, and@queryare verified as the request sent them rather than as Fetch normalizes them. - cfce76c: Added RFC 9421 ECDSA P-256/SHA-256 and P-384/SHA-384 signing and verification for TAP, including local key pairs and remote signers returning fixed-width raw signatures.
- a12e750: Added
clockSkewand per-intentrequiredComponentsto the TAP verifier, acomponentsoption to the TAP prover, andTap.Jwks.resolverfor an agent provider's JSON Web Key Set. HTTP message signatures that covercontent-digestare now checked against the request body, and TAP verification rejects a request carrying more than one TAP signature. - a12e750:
Tap.Jwks.resolvernow fails a fetch whose key set is larger than 64 KiB or holds more than 64 keys, and caches only the key members it reads. HTTP message signature verification refuses a used nonce before reading a request body to check itscontent-digest. - ad30fb6: Made
tempo.chargeproof credentials single use per Challenge by default, claimed in the configuredstore(or the default fallback store) until the Challenge expires, rather than only whenstorewas passed. - 70da480: Fixed the Tempo charge client to set a fee token on transactions whose payer pays its own fees, including a local account's push payment for a challenge that offers a fee payer. It sets the token the chain would charge: the
feeTokenoption, else the chain's fee token, else the payer's fee-token preference, else the payment currency when it is a default fee token (pathUSD, or USDC.e on mainnet). Other currencies, a failed preference read, access keys, auto-swap payments, sponsored transactions and wallets that send the calls themselves leave the choice to the chain as before. - fbcc9be: Updated ws and minimatch to patched releases.
- fbd88a7: Fixed x402 EVM charges dropping the payment payload's
extensionsandresourcebefore/verifyand/settle; the facilitator now gets them. Addedx402.extensionsto declare extensions, such as Bazaar discovery, inPAYMENT-REQUIRED. A payload that leaves outresourceis forwarded with the route's resource, the forwarded resource URL leaves out the request's query string and fragment, an echoed SIWX extension stays on the server, and composed offers whose methods declare different extensions now merge them instead of keeping only the first offer.