Skip to content

feat: add public REST API for programmatic resource registration#757

Open
PurdueDM wants to merge 1 commit intoMerit-Systems:mainfrom
PurdueDM:feat/add-resources-programmatically
Open

feat: add public REST API for programmatic resource registration#757
PurdueDM wants to merge 1 commit intoMerit-Systems:mainfrom
PurdueDM:feat/add-resources-programmatically

Conversation

@PurdueDM
Copy link
Copy Markdown

@PurdueDM PurdueDM commented Apr 3, 2026

Exposes the existing TRPC resource registration functionality as public REST API endpoints (no SIWX wallet auth required).

New Endpoints

  • POST /api/v1/resources/register - Register a single x402 resource by URL
  • POST /api/v1/resources/register-origin - Discover and register all resources from an origin
  • POST /api/v1/resources/refresh - Re-probe and update an existing resource

Reuses existing logic (probeX402Endpoint, registerResource, fetchDiscoveryDocument, registerResourcesFromDiscovery). No new dependencies.

Includes full API docs at docs/PROGRAMMATIC_API.md with cURL, JS/TS, Python examples and CI/CD integration guide.

Fixes #104

Exposes the existing TRPC resource registration functionality as public
REST endpoints that can be called without wallet authentication:

- POST /api/v1/resources/register - register a single x402 resource
- POST /api/v1/resources/register-origin - discover and register all resources from an origin
- POST /api/v1/resources/refresh - re-probe and update an existing resource

Includes full API documentation with cURL, JS/TS, and Python examples.

Fixes Merit-Systems#104
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 3, 2026

@PurdueDM is attempting to deploy a commit to the Merit Systems Team on Vercel.

A member of the Team first needs to authorize it.


const { url } = parsed.data;

try {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Server-Side Request Forgery (SSRF) vulnerability in multiple public API endpoints allowing unauthenticated users to probe internal/private addresses including localhost, private IP ranges, and cloud metadata endpoints.

Fix on Vercel

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.

[Feature Request] Add Resources Programmatically

1 participant