-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Parent: #89
Context
#94 was marked completed and merged via PR #107, adding @x402x/hono_v2 and @x402x/express_v2.
While reviewing main, a few items look either missing vs the original acceptance criteria or potentially risky for real middleware behavior.
Issues to address
- Workspace-only requirement not enforced
typescript/packages/hono_v2/package.jsonandtypescript/packages/express_v2/package.jsoncurrently do not set"private": true.
- Potential payment-required flow / security semantics
typescript/packages/express_v2/src/index.tscurrently callsnext()unconditionally, and may also call it inside the official middleware callback.- This can lead to handlers executing even when payment is required (or after a response was already sent), which is risky.
typescript/packages/hono_v2/src/index.tscontains logic that returns 200 with arequiresPaymentJSON payload “for testing purposes” whenx402Response.requiresPaymentis set.- If the official middleware sets
x402Responsein production, this could accidentally override a proper 402.
- If the official middleware sets
- Tests do not assert real 402 flow
- Current integration tests primarily assert
200responses under mocked behavior and do not validate402 PAYMENT-REQUIREDsemantics, extension echo, oreip155:*wildcard behavior.
- Unexpected submodule bump
- PR feat(hono_v2, express_v2): Add v2 middleware packages wrapping official x402 #107 also updated
deps/x402submodule pointer; confirm if this is intentional.
Goal
Align v2 middleware wrappers with the intended contract:
- Workspace-only (
private: true) - Correct
PAYMENT-REQUIREDbehavior (no handler execution without payment) - Tests that assert real 402 responses and required fields
Acceptance Criteria
hono_v2andexpress_v2packages are markedprivate: true.- Middleware does not call downstream handlers when payment is required.
- Integration tests validate:
402response on missing paymentacceptsincludes settlementextraand required extension (if applicable)- No
next()leak in Express when payment is required
- Confirm / document why
deps/x402submodule changed, or revert if accidental.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels