Skip to content
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

feat: Implement partially local Snaps execution environment #11653

Merged
merged 8 commits into from
Oct 10, 2024

Conversation

FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Oct 7, 2024

Description

Replaces the remote WebView with a locally bundled WebView. This WebView still uses a remote iframe for execution, but the initial load will be using all local code. This is attempt number two since #10214 was reverted. This PR is slightly different from the aforementioned PR since the HTML is inlined using babel-plugin-inline-import AND the execution environment is considered a secure context due to the baseUrl being set.

Related issues

Fixes:

Manual testing steps

  1. Install any Snap
  2. See that it works

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@FrederikBolding FrederikBolding added the team-snaps-platform Snaps Platform team label Oct 7, 2024
@FrederikBolding FrederikBolding requested review from a team as code owners October 7, 2024 11:00
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Oct 7, 2024
Copy link

socket-security bot commented Oct 7, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/babel-plugin-inline-import@3.0.0

View full report↗︎

Next steps

Take a deeper look at the dependency

Take 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 package

If 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 risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

yarn.lock Outdated Show resolved Hide resolved
@Jonathansoufer Jonathansoufer added No QA Needed Apply this label when your PR does not need any QA effort. Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 9, 2024
Copy link
Contributor

github-actions bot commented Oct 9, 2024

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link

socket-security bot commented Oct 9, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/babel-plugin-inline-import@3.0.0 filesystem 0 11.9 kB aldeed
npm/path-extra@1.0.3 environment 0 6.46 kB jprichardson
npm/require-resolve@0.0.2 None 0 17.3 kB qiu8310
npm/x-path@0.0.2 filesystem 0 11.3 kB qiu8310

View full report↗︎

@Jonathansoufer Jonathansoufer self-assigned this Oct 9, 2024
Jonathansoufer
Jonathansoufer previously approved these changes Oct 9, 2024
Copy link
Contributor

@Jonathansoufer Jonathansoufer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested on real device and simulators.

naugtur
naugtur previously approved these changes Oct 10, 2024
@FrederikBolding
Copy link
Member Author

@SocketSecurity ignore npm/babel-plugin-inline-import@3.0.0

New author ok.

@metamaskbot metamaskbot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Oct 10, 2024
Copy link

sonarcloud bot commented Oct 10, 2024

Copy link
Contributor

@Jonathansoufer Jonathansoufer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reapproving after allowlist change.

@FrederikBolding FrederikBolding added this pull request to the merge queue Oct 10, 2024
Merged via the queue into main with commit 678d468 Oct 10, 2024
36 of 37 checks passed
@FrederikBolding FrederikBolding deleted the fb/partially-local-snaps-env-v2 branch October 10, 2024 09:15
@github-actions github-actions bot locked and limited conversation to collaborators Oct 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No QA Needed Apply this label when your PR does not need any QA effort. release-7.34.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-snaps-platform Snaps Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants