Skip to content

bookmark#6

Closed
napoleond wants to merge 1 commit intomainfrom
dnr/base-app-payer
Closed

bookmark#6
napoleond wants to merge 1 commit intomainfrom
dnr/base-app-payer

Conversation

@napoleond
Copy link
Copy Markdown
Contributor

No description provided.

@badjer badjer closed this Aug 26, 2025
badjer added a commit that referenced this pull request Apr 9, 2026
…nt ordering

- Fix OAuth bypass to only skip challenge for ATXP/X402 (separate headers)
  or MPP when opaque identity verification succeeds; MPP with failed/missing
  opaque still gets OAuth challenge (#13)
- Extract parseCredentialBase64 helper for try-base64-then-raw-JSON pattern,
  use in atxpExpress.ts and protocol.ts (#14)
- Add opaqueIdentity unit tests: round-trip, tampered sig, wrong challengeId,
  missing opaque, malformed fields, different sub (#11)
- Align MppChallengeData.opaque type to Record<string, unknown> (#16)
- Reorder getSources after getExistingPaymentId check in requirePayment to
  avoid unnecessary fetch on idempotent path; extract fetchAllSources (#6)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
badjer added a commit that referenced this pull request Apr 9, 2026
* feat: multi-chain MPP support (Solana + Tempo)

Server now emits an array of MPP challenges (one per supported chain)
instead of a single Tempo-only challenge. Client extracts all challenges
and forwards the array to accounts, which picks the chain via feature
flag. Uses X-MPP-Payment header to carry the MPP credential alongside
the OAuth Bearer token without conflicts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: extract buildPaymentOptions + buildAuthorizeParamsFromSources

Shared core for building protocol-specific payment data from destination
sources. Used by both requirePayment() (MCP servers) and LLM callers.

- buildPaymentOptions: sources → X402 requirements + MPP challenges
- buildAuthorizeParamsFromSources: thin wrapper returning AuthorizeParams fields
- requirePayment refactored to use buildPaymentOptions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove unused imports buildX402Requirements and sourcesToOptions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: opaque identity for MPP Authorization: Payment ↔ OAuth coexistence

Standard MPP uses Authorization: Payment which conflicts with OAuth's
Authorization: Bearer. Instead of a custom header (X-MPP-Payment):

- Server signs user identity into MPP challenge opaque field (HMAC)
- Client sends standard Authorization: Payment (interop preserved)
- OAuth fetch skips Bearer when Payment is present
- Server recovers identity from opaque on retry (HMAC verified)

This preserves interop with external MPP clients/servers while solving
the OAuth header conflict for ATXP-to-ATXP flows.

Also: challenge ID uniqueness (random suffix), detectProtocol cleanup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: OAuth bypass, credential parsing, opaque tests, and requirePayment ordering

- Fix OAuth bypass to only skip challenge for ATXP/X402 (separate headers)
  or MPP when opaque identity verification succeeds; MPP with failed/missing
  opaque still gets OAuth challenge (#13)
- Extract parseCredentialBase64 helper for try-base64-then-raw-JSON pattern,
  use in atxpExpress.ts and protocol.ts (#14)
- Add opaqueIdentity unit tests: round-trip, tampered sig, wrong challengeId,
  missing opaque, malformed fields, different sub (#11)
- Align MppChallengeData.opaque type to Record<string, unknown> (#16)
- Reorder getSources after getExistingPaymentId check in requirePayment to
  avoid unnecessary fetch on idempotent path; extract fetchAllSources (#6)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: correct onPayment reporting, HMAC env key, inline doc, and new tests

- mppProtocolHandler: stop reporting challenge ID as transactionHash;
  use AuthorizeResult.context if available, empty string otherwise.
  Use context.network for settled chain when available.
- opaqueIdentity: derive HMAC key from ATXP_OPAQUE_KEY env var with
  random fallback for multi-instance deployments.
- oAuth: add inline comment referencing buildPaymentHeaders contract.
- omniChallenge.test: add tests for buildPaymentOptions and
  buildAuthorizeParamsFromSources covering multi-chain scenarios.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: default Tempo MPP currency fallback to USDC

Changed buildMppChallenges fallback from 'pathUSD' to 'USDC' since
Tempo mainnet now uses USDC as the default stablecoin.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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