feat(sdk): 0.2.0 — 掲載 URL のクエリ違い第三者 URL に catalog trust を適用 (PR-A)#226
Merged
Conversation
外部出品でクエリ型 API (例: ?q=質問 の AI 相談ゲートウェイ) を解禁する買い手ガード拡張。 計画=plans/x402-query-catalog-trust.md (Codex 敵対的レビュー: CRITICAL/HIGH バイパスなし)。 open-pay.jp サーバ側は無変更 (買い手 SDK のみ)。 - catalog lookup を 2 段に: 従来の完全一致 → miss 時のみ search/hash を剥がした origin+pathname で再 lookup。ヒット時は従来と同じ catalogAcceptConsistent (金銭フィールド照合 = bait-and-switch 防御) を必ず適用。 - 防御は不変+強化: path 完全一致 (prefix 緩和なし)・掲載キー側にクエリがある場合は 緩和なし・resource_mismatch (ライブ accept.resource=要求 URL) 不変・ **userinfo 付き URL は fallback 対象外** (credential 混入 URL を query variant と みなさない・レビュー指摘の防御)。 - 敵対ベクトルをテスト化: クエリ付き pass / 金銭改ざん (merchant/feeValue/forwarder) mismatch / path・prefix 拒否 / 掲載キー側クエリ非緩和 / fragment・空クエリ / URL 正規化 (host 大文字・default port)・scheme / 完全一致・open-pay.jp 回帰。 MCP/SDK 両 runtime 同一ベクトル (transition) でクエリ付き e2e 支払い成立+ 金銭すり替え拒否。 SDK 0.2.0・CHANGELOG・README 追記。PR-B (SDK publish 後): MCP 0.11.0 が dep ^0.2.0 へ bump (wire 不変)。 検証: typecheck / eslint / full vitest 364 files・7,531 tests green。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CNMEwurCJNTrzvr2qypSd
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
cipherwebllc
added a commit
that referenced
this pull request
Jul 15, 2026
…ump (PR-B) (#227) #226 (SDK 0.2.0・npm publish 済み) の MCP 側追従。money-path 実装は SDK 側のみで 本パッケージはバージョン/依存/文書の更新 — tool wire JSON は不変 (SHA fence green)。 - dependencies: openpay-x402-sdk ^0.1.0 → ^0.2.0。package-lock は実 registry の 0.2.0 で再生成 (rm -rf node_modules → npm ci で再現性検証済み)。 - README: CATALOG_TRUST の説明に「掲載 URL のクエリ違いは同じ金銭照合の後に信頼・ 掲載キー側にクエリがある場合は完全一致のみ」を追記。CHANGELOG 0.11.0。 - smoke:list-tools で両プロファイル不変を確認 (x402=9 / order=4 ツール)。 検証: typecheck / full vitest 364 files・7,531 tests green (wire SHA fence 含む)。 残= user: openpay-x402-mcp 0.11.0 の npm publish。 Claude-Session: https://claude.ai/code/session_015CNMEwurCJNTrzvr2qypSd Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
外部出品者のクエリ型 API (例:
?q=質問を受ける AI 相談ゲートウェイ) は、買い手ガードの catalog trust が URL 完全一致のため既定設定で支払えなかった (host_not_allowed)。外部出品の適用範囲を「固定 URL リソース」から「クエリ型 API」へ広げる買い手側拡張。open-pay.jp サーバは無変更。計画= plans/x402-query-catalog-trust.md。変更 (packages/x402-sdk 0.2.0)
レビュー
Codex sol の敵対的レビュー (URL 正規化の穴・金銭照合すり抜け・quote/pay 非対称) を実装前に実施 — CRITICAL/HIGH バイパスなし、LOW (userinfo) は防御+テスト化。
検証
merge 後
cd packages/x402-sdk && npm publish(0.2.0)🤖 Generated with Claude Code
https://claude.ai/code/session_015CNMEwurCJNTrzvr2qypSd