test(landing): cover the /open route whitelist with vitest - #12
Merged
Conversation
landing/ had no test runner, so the fragment whitelist on /open — the boundary that decides which deep-link routes may hop out to voltius:// — had no regression coverage. Adds vitest, 24 cases over readFragment (whitelist, per-route parameter validation, hostile parameters), and a GitHub Actions job running lint and test on landing changes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
landing/had no test runner. The route whitelist inlanding/app/open/fragment.tsdecides which deep-link routes may hop out to avoltius://URL, and it must stay in step with the client'sROUTEStable — a security boundary with zero regression coverage until now.app/**/*.test.ts),pnpm test.readFragment: valid join and verified targets, the whitelist failing closed on unlisted routes (settings,plugin/install,snippet/install,connect, wrong case, path traversal), per-route parameter validation, and hostile parameters that must not inject another scheme or authority.pnpm lintandpnpm testonlanding/changes. The repo had no workflows at all.Mutation-checked: adding
settings: () => truetoROUTE_VALIDATORSfailsrejects #settings?section=mcp. Adding a route in Part 3 of VoltiusApp/voltius#144 will have to touch this file too, which is the intent.pnpm lint,pnpm test(24 passed) andpnpm buildclean locally.