Skip to content

mppx@0.22.4

Choose a tag to compare

@github-actions github-actions released this 02 Dec 02:36
· 11 commits to main since this release
1aa94e8

Patch Changes

  • a1d7a34: Fixed the Express adapter to pass the raw request body to mppx: it now uses req.rawBody when 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 compose to throw a TypeError when it would advertise x402 offers that bind the request body together with x402 offers that do not in one PAYMENT-REQUIRED header. 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 digest routes: mppx/client now replays a request body byte for byte (a body with a leading BOM or invalid UTF-8 is no longer re-encoded) and encodes a FormData body once, so the retry keeps its multipart boundary. A digest route's default expiry now counts from when the request body has arrived, and mppx/proxy bounds a digest route's request body by maxRequestBodySize before issuing a Challenge.
  • a6fc556: Updated the glob override to 14.0.6 and vite-plus to 1.5.1.
  • 7e3094a: Added the credentialGraceMs option to tempo.charge, which also accepts a hash Credential presented after its Challenge expires when its transaction was mined before the expiry, for Challenges issued by this release; zoneCredentialGraceMs is now a deprecated alias for it. The fetch client and McpClient.wrap no longer pay a new Challenge after one answers a push (hash) or Zone (zone) payment the client already made, and throw PaymentOutcomeUnknownError with 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+json Problem 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. Sibling tempo.charge() and tempo() 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.charge on the server to require the attribution memo bound to the Challenge on every transaction credential 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 GET or HEAD route 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 Proxy replay 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 (or MPP_REQUIRE_HTTPS=1) on the server and client Mppx.create, Fetch.from, McpClient.wrap and sessionManager. Servers answer 400 instead of a Challenge unless the request URL is https:, its host is loopback, or X-Forwarded-Proto is https; clients throw instead of sending a Credential to an http: or ws: URL on a host other than loopback.
  • a6e11e9: Added retryAfter to VerificationFailedError, InternalPaymentError and custom payment errors, which the HTTP transport sends as a Retry-After header. Tempo subscription activations and renewals that are already in flight now answer their 402 with Retry-After: 1.
  • 8b68a38: Added rebuildChallengeOnFailure to Method.toServer: when set, the retry Challenge after a failed verify runs the request hook again with a null Credential, so it reflects state that verify changed (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() and Challenge.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 digest route option to mppx/server handlers. With digest: 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 need extensions.mppx and Tempo transaction credentials need the attribution memo bound to the Challenge to pay it, a Method's own digest request input (any non-boolean value) still reaches the Method, and Mppx.toNodeListener now 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 ttlMs to Store.put, honored by every store adapter: reads return null once the value expires, and adapters with a native expiry (memory, Redis psetex, Upstash px, Cloudflare KV expirationTtl) 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-params or give a component parameters other than key, 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.charge to 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-digest against a body that was already read, parsed by Express without its raw bytes, or dropped from a GET or HEAD request, 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 @query request components to HTTP message signature signing and verification, allowing TAP signatures to cover more than the required authority and path. Behind Mppx.toNodeListener, Request.toNodeListener and the Express adapter, with or without a request body, @method, @path, and @query are 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 clockSkew and per-intent requiredComponents to the TAP verifier, a components option to the TAP prover, and Tap.Jwks.resolver for an agent provider's JSON Web Key Set. HTTP message signatures that cover content-digest are now checked against the request body, and TAP verification rejects a request carrying more than one TAP signature.
  • a12e750: Tap.Jwks.resolver now 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 its content-digest.
  • ad30fb6: Made tempo.charge proof credentials single use per Challenge by default, claimed in the configured store (or the default fallback store) until the Challenge expires, rather than only when store was 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 feeToken option, 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 extensions and resource before /verify and /settle; the facilitator now gets them. Added x402.extensions to declare extensions, such as Bazaar discovery, in PAYMENT-REQUIRED. A payload that leaves out resource is 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.