Skip to content

fix(mpp): enforce configured spend limits - #14

Open
mercadosclaro-eng wants to merge 3 commits into
cascade-protocol:mainfrom
mercadosclaro-eng:fix/mpp-spend-limits
Open

mercadosclaro-eng wants to merge 3 commits into
cascade-protocol:mainfrom
mercadosclaro-eng:fix/mpp-spend-limits

Conversation

@mercadosclaro-eng

Copy link
Copy Markdown

Configured daily and per-transaction spend limits currently protect x402 payments, but explicit MPP payments and automatic x402-to-MPP fallback can create credentials without checking those owner limits.

This change adds one shared pre-credential limit check and wires it into the MPP HTTP, serve, and MCP paths. It uses the existing payment history so both protocols follow the same configured limits.

Validation:

  • 123 tests passed
  • TypeScript type-check passed
  • Biome check passed

Apply the owner's daily and per-transaction limits to explicit MPP and automatic MPP fallback paths.
Validate each MPP challenge against the configured owner limits before creating a credential.
Add a shared limit check with tests for per-transaction, daily remaining, and allowed payments.
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.

1 participant