-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: validate websocket request #7317
base: main
Are you sure you want to change the base?
Conversation
fix: shouldHandle cannot be async wip: copy isHostAllowed chore: move code chore: comment wip: allow only same origin chore: cleanup wip: isApiRequestAllowed chore: cleanup wip: switch to token check chore: unused fix: inject VITEST_API_TOKEN in orchestrator ui docs: add api.allowedHosts fix: require token for __vitest_browser_api__ request chore: cleanup refactor: combine to isWebsocketRequestAllowed
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The token protection looks good to me.
The allowedHosts
part is something I don't really understand. The WS endpoints will still be responding to any client that has the token. We are not passing allowedHosts
anywhere else, so users still won't be able to open Vitest UI or browser from these. I don't understand why allowedHosts
is needed here.
Co-authored-by: Ari Perkkiö <[email protected]>
This reverts commit 7f91828.
Description
summary
Adds
?token=xxx
requirement for websocket upgrade request on__vitest__api__
and__vitest_browser_api__
. Token is randomly generated on the server and it's injected in ui, tester, and orchestrator html, which are not accessible from cross origin.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.