Skip to content

Display SIWX (Free) resources on server pages#919

Merged
onchainlu merged 12 commits into
mainfrom
siwx-server-display
May 22, 2026
Merged

Display SIWX (Free) resources on server pages#919
onchainlu merged 12 commits into
mainfrom
siwx-server-display

Conversation

@onchainlu
Copy link
Copy Markdown
Contributor

@onchainlu onchainlu commented May 22, 2026

Summary

  • SIWX (Free) resources on server pages — were registered to DB but hidden from display. Now show with green "Free" label.
  • Dynamic pricing — endpoints with scheme !== 'exact' now show "Up to $X" instead of a misleading flat price.
  • Skip unprotected endpoints — registration no longer probes unprotected/apiKey endpoints, eliminating misleading "No valid x402 response" failures.
  • Banner count fix — success banner denominator now excludes skipped endpoints, matching the pre-registration button count.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
x402scan Ready Ready Preview, Comment May 22, 2026 5:42am

Request Review

SIWX resources were registered to the DB but filtered out of the server
page display because the filter required accepts.length > 0. SIWX
resources have no accepts (they're identity-gated, not paid).

Now includes resources with metadata.authMode === 'siwx' in the display
filter and shows a green "Free" label where the pricing would normally
appear.
SIWX resources have no ResourceResponse row (no 402 body), so
parseX402Response returned success:false. The display filter then
excluded them. Now treats SIWX resources as successful with empty
payment data so they render on server pages.
… count

- ResourcePricing: show "Up to $X" when any accept has scheme !== 'exact'
  (dynamic pricing). Previously showed a single price regardless of scheme.
- Skip unprotected/apiKey endpoints in registerResourcesFromDiscovery
  instead of probing them and showing misleading failures.
- Banner denominator now excludes skipped endpoints (unprotected/apiKey)
  so "N of M" matches what the client showed in the pre-registration list.
onchainlu added 4 commits May 22, 2026 00:55
Instead of hiding skipped endpoints entirely, show them in a collapsed
"N unprotected endpoints skipped" section with guidance on security: []
for intentionally free endpoints. Separate from the red "Not Registered"
errors which are actual probe failures.
- useDiscovery now exposes skippedResources (unprotected/apiKey endpoints
  filtered from discovery)
- Pre-registration: yellow dropdown sourced from skippedResources, shows
  immediately after discovery (no need to wait for batch test)
- Post-registration: error state count also excludes skipped
- Unprotected endpoints never appear in any numerator or denominator
- Deduplicate actualDiscoveredUrls — same URL with different methods
  (e.g. GET siwx + POST paid) was counted twice
- Exclude tested URLs from siwxCount to prevent double-counting when
  a URL appears as both paid (probed) and siwx (in authModeMap)
- Disable Add API button after registration completes
onchainlu added 2 commits May 22, 2026 01:37
…ed map

The authModeMap is keyed by URL so siwx overwrites paid for same-URL
different-method entries (e.g. GET siwx + POST paid on /api/site).
This made siwxCount unreliable.

Now: siwxResourceCount is computed from discoveryResources entries with
authMode === 'siwx'. No URL dedup needed — SIWX entries are never
probed, so there's no overlap with testedResources.
@onchainlu onchainlu merged commit b37b6ff into main May 22, 2026
3 checks passed
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