feat: add data: and ipfs:// URI support in fetchRegistrationFile#8
Conversation
Support all three ERC-8004 agentURI schemes: - https:// (existing) - data:application/json;base64,... and data:application/json,... - ipfs://<cid> via configurable gateway (default: ipfs.io) Add FetchRegistrationFileOptions with optional ipfsGateway parameter, threaded through resolveServiceEndpoint. Bump to 0.1.0-alpha.2. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1b1fe0e to
59bae49
Compare
- Fix atob → Buffer.from for correct UTF-8 handling in base64 data URIs - Move FetchRegistrationFileOptions to types.ts with other param types - Compose ResolveServiceEndpointParameters extends FetchRegistrationFileOptions - Extract MAX_REGISTRATION_FILE_SIZE constant (was duplicated 1_048_576) - Add resolveServiceEndpoint + ipfsGateway integration tests Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
SDK ReviewFound 2 issues (reviewed: tests, conventions, dead code, SDK design):
Generated with Claude Code using review-sdk skill |
Address review feedback: - Replace Node-only Buffer.from with atob + TextDecoder for portable UTF-8 base64 decoding (works in browsers, Workers, Deno) - Validate IPFS CID path: reject empty CIDs and .. path traversal segments to prevent SSRF against the gateway Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Summary
fetchRegistrationFile:https://(existing)data:application/json;base64,...anddata:application/json,...(on-chain storage)ipfs://<cid>via configurable gateway (default:ipfs.io)FetchRegistrationFileOptionswith optionalipfsGatewayparameteripfsGatewaythroughresolveServiceEndpoint0.1.0-alpha.2Depends on #7 (revert of direct push) being merged first.
Test plan
pnpm typecheckpassespnpm buildclean🤖 Generated with Claude Code