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

fix: removes addSubjectMetadata and improves Snaps Execution Environment Webview origin restriction. #8751

Merged
merged 9 commits into from
Mar 27, 2024

Conversation

Jonathansoufer
Copy link
Contributor

Description

This PR address removal of subjectMetadata in favor of SnapController triggering addSubjectMetadata itself now, and adding a more restrictive originWhiteList on Snaps Execution Environment Webview.

Related issues

Fixes: Comments on the closed PR 8700

Manual testing steps

  1. Go to Explore and Install any snap.

Screenshots/Recordings

After

Screen.Recording.2024-02-27.at.15.10.34.mov

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

Copy link
Contributor

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.

@Jonathansoufer Jonathansoufer changed the title Fix: removes addSubjectMetadata and improves Snaps Execution Environment Webview origin restriction. fix: removes addSubjectMetadata and improves Snaps Execution Environment Webview origin restriction. Feb 27, 2024
app/core/Engine.ts Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.42%. Comparing base (01c6724) to head (14f70e0).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8751      +/-   ##
==========================================
+ Coverage   41.38%   41.42%   +0.03%     
==========================================
  Files        1266     1270       +4     
  Lines       30768    30819      +51     
  Branches     3028     3041      +13     
==========================================
+ Hits        12733    12766      +33     
- Misses      17275    17290      +15     
- Partials      760      763       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gauthierpetetin gauthierpetetin added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Mar 7, 2024
Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Copy link

sonarcloud bot commented Mar 27, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@Jonathansoufer Jonathansoufer merged commit 8068fb0 into main Mar 27, 2024
31 checks passed
@Jonathansoufer Jonathansoufer deleted the fix/remove-addSubjectMetadata branch March 27, 2024 13:51
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Mar 27, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2024
@metamaskbot metamaskbot added the release-7.20.0 Issue or pull request that will be included in release 7.20.0 label Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
mobile-snaps release-7.20.0 Issue or pull request that will be included in release 7.20.0 team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants