-
Notifications
You must be signed in to change notification settings - Fork 895
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
Adds rust_to_wasm
and rust_to_wasm
support to transpile_web_ui
#27215
base: master
Are you sure you want to change the base?
Adds rust_to_wasm
and rust_to_wasm
support to transpile_web_ui
#27215
Conversation
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is a medium CVE?Contains a medium severity Common Vulnerability and Exposure (CVE). Remove or replace dependencies that include known medium severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
A Storybook has been deployed to preview UI for the latest push |
12fdd7c
to
3753b31
Compare
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.
Could we add this as a Git submodule rather than committing all the files to brave-core
?
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.
Let's see what @bridiver has to say about it. Last I checked with him, we wanted to add wasm-pack
like cargo-audit
.
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.
We should keep this vendored like everything else
3753b31
to
123f48d
Compare
The security team is monitoring all repositories for certain keywords. This PR includes the word(s) "policy, csp" and so security team members have been added as reviewers to take a look. |
transpile_web_ui
rust_to_wasm
and rust_to_wasm
support to transpile_web_ui
123f48d
to
9a24c64
Compare
Resolves brave/brave-browser#43273.
Depends on https://github.com/brave/devops/issues/12869 — the PR itself can be merged, but using
rust_to_wasm
(wasm-pack
) will requirewasm32-unknown-unknown
andrust-lld
to be present.rust_to_wasm
example:transpile_web_ui
example:ui/webui/resources/some_resource/rust_package_1/Cargo.toml
:ui/webui/resources/some_resource/rust_package_1/src/lib.rs
:ui/webui/resources/some_resource/rust_package_2/Cargo.toml
:ui/webui/resources/some_resource/rust_package_2/src/lib.rs
:ui/webui/resources/some_resource/index.js
:ui/webui/resources/BUILD.gn
:ui/webui/resources/sources.gni
:ui/webui/resources/tools/bundle_js_excludes.gni
(patch):In the
WebUI
page:Note: you'll need
wasm-unsafe-eval
in CSP, as by default we're not allowed to compile WASM in aWebUI
(see here and here). This, however, would allow arbitrary WASM code execution in the page. Since at this time there doesn't seem to exist a CSP directive to specify same-origin WASM execution, or file hashes (i.e.script-src
for WASM), the only legit way to isolate the WASM is to embed achrome-untrusted://
frame into theWebUI
, have the WASM compile and execute there, and add a communication mechanism to thechrome-untrusted://
frame.Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: