Skip to content

Add x402 access pass middleware#496

Open
DenisCarriere wants to merge 1 commit into
mainfrom
codex/x402-access-pass
Open

Add x402 access pass middleware#496
DenisCarriere wants to merge 1 commit into
mainfrom
codex/x402-access-pass

Conversation

@DenisCarriere
Copy link
Copy Markdown
Contributor

Summary

  • Add optional x402 V2 middleware for a $0.10 one-hour Token API Pro access pass.
  • Accept both EVM and SVM payments via the CDP facilitator, with default pay-to addresses from the tracking issue.
  • Configure concrete paid GET routes and explicit free routes, with Bazaar discovery and required payment-identifier extensions.
  • Cache settled payment identifiers in memory for one hour and fall back to facilitator verification on cache miss/restart.
  • Prevent public cache headers on x402 payment-bearing responses.

Defaults

  • Disabled unless X402_ENABLED=true.
  • Facilitator: https://api.cdp.coinbase.com/platform/v2/x402
  • EVM: eip155:8453, 0x49D581486438aAD93f4114084Ac5B09A8b7C9685
  • SVM: solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp, EpRR35QnB5PfTczy3j5rp9bCw4NKzHkd8S1ubdza4my9
  • Access plan: pro, price $0.10, duration 3600 seconds

Validation

  • bun lint
  • bun test --coverage

Refs #494
Closes #495

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.

Add x402 1-hour access pass with in-memory receipt cache

2 participants