Display SIWX (Free) resources on server pages#919
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
eb54728 to
7e83a32
Compare
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.
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
…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.
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.
Summary
scheme !== 'exact'now show "Up to $X" instead of a misleading flat price.unprotected/apiKeyendpoints, eliminating misleading "No valid x402 response" failures.