Repository navigation
mppx@0.16.0
·
16 commits
to main
since this release
Minor Changes
-
793aa2b: Replaced request attestation with per-route identity. Breaking changes:
mppx/attestationbecamemppx/identity. ServerMppx.create({ attestation })was removed (passing it now throws); routes takeidentity: [verifier, ...](all required), for examplemppx.charge({ amount, identity: [tap] }), and the result exposesresult.identity.get(verifier).- Added
Identity.anyOf(...)to accept one of several protocols. Every member runs, so each presented proof is consumed. - Verifiers return
missing,invalidorvalid(unverifiedbecameinvalidwith code 403), may set their own statuscodeandheaders, and declare astage:request(checked before any 402) orpayment(adds headers to the 402 and is checked against the answered challenge and credential before settlement). Identity rejections are returned on the non-200 branch as a 401/403 response. - A composed route can include at most one offer with payment-stage identity. Payment-stage identity is not supported on methods with a preflight hook.
- Client
attestationsigner maps becameidentity: [prover, ...]. Provers have a required originscope, receive the payment challenge inprove(request, context), and can prepare proofs or request one resend withretry(response, context). Requests that carry proofs do not follow redirects. - TAP and Web Bot Auth moved to
mppx/extensions/identity/tapandmppx/extensions/identity/web-bot-auth;Client.signerbecameClient.prover.
Patch Changes
- e555544: Fixed client payment events masking original errors when a response body had already been consumed or locked.
- 81a95e1: Fixed multi-method intent handlers rejecting every route option but
identitywhen the methods' options can't be inferred, such asmppx.charge({ amount })withstripe.create(...).defaultMethods(). - c31d932: Added optional
summaryandrequestBodyto proxy endpoint definitions, emitted in the proxy's generated/openapi.json. Free routes can carry them as{ free: true, summary, requestBody }. An endpoint that is neither a payment handler,truenor{ free: true }(such as{ pay: undefined }) now fails closed with an error instead of being proxied. - dd2c3e3: Refused to sign a zero-amount Tempo proof when the Challenge realm differs from the hostname of the server that sent it, so another origin can't relay a Challenge and replay the proof at its realm. To allow a server whose realm isn't its hostname, pin the realm to its origin with
trustedTempoProofRealmsonMppx.createandFetch.from, such as{ 'https://api.example.com': 'MPP Payment' }. Without an origin (McpClient.wrap, orMppx.createwithTransport.mcp()), these proofs are refused unlesstrustedTempoProofRealmslists the realm. ThemppxCLI andsessionManagerbootstrap apply the same check, andsessionManagertakestrustedTempoProofRealmstoo. This matches mpp-rs, mpp-go and pympp. - d78de2c: Fixed missing subscription access-key address indexes when reusing existing keys.
- 909f3db: Fixed Tempo session top-up, voucher retry, close and bootstrap requests to send the credential in the header the challenge selects (such as
Payment-AuthorizationwithrequiresAuth) instead of always usingAuthorization. These requests keep the paid request's ownAuthorizationheader and no longer follow redirects, so the credential can't reach another origin. - 464df9a: Fixed Tempo charge verification rejecting split amounts written with leading zeros by comparing them as integers.
- 9008513: Removed the
allowKeyAuthorizationfee-payer policy: sponsored transactions may now carry akeyAuthorization, so an access key can open a fee-sponsored session (or pay a sponsored charge) in the transaction that installs it. Sponsor exposure stays bounded bymaxGasandmaxTotalFee. - 4cfd556: Fixed
mppx validatefailing Tempo session responses that stream over SSE: when the receipt arrives in the event stream instead of thePayment-Receiptheader, validation checks thepayment-receiptevent in the stream instead of requiring the header, and fails when the stream has none. - 510d1ed: Fixed
mppx validatefailing valid SSE sessions: the in-streampayment-receiptevent is now read from the server's own stream, which the session client strips, and lone-CR line endings are accepted. - e6d8ffc: Fixed
mppx validatebuffering SSE session streams in memory and hanging when the session client cancelled one: in-stream receipts are now read as the client consumes the stream instead of from an unread copy. - 464df9a: Raised the zod dependency to ^4.6.7 to pick up the fix for GHSA-mrhx-c7xc-m3w5.