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: Pass URLs to PhishingController #2835

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

FrederikBolding
Copy link
Member

Following MetaMask/metamask-extension#25839 full URLs are required as the argument for PhishingController:testOrigin. This PR makes sure that our calls to isOnPhishingList pass strictly full URLs.

@FrederikBolding FrederikBolding requested a review from a team as a code owner October 14, 2024 10:16
Mrtenz
Mrtenz previously approved these changes Oct 14, 2024
Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.46%. Comparing base (4be3dd3) to head (f839bc5).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2835   +/-   ##
=======================================
  Coverage   94.46%   94.46%           
=======================================
  Files         484      484           
  Lines       10343    10345    +2     
  Branches     1576     1576           
=======================================
+ Hits         9770     9772    +2     
  Misses        573      573           

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

@FrederikBolding FrederikBolding merged commit b78d274 into main Oct 14, 2024
166 checks passed
@FrederikBolding FrederikBolding deleted the fb/fix-usage-of-phishing-controller branch October 14, 2024 10:45
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Oct 14, 2024
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Fixes two problems with Snaps usage of `PhishingController`. Following
#25839 the
PhishingController expects full URLs instead of hostnames as the input
to `testOrigin`. In that PR, the argument of `isOnPhishingList` was
incorrectly changed. This PR also patches in some changes from the
`snaps` repo that are currently blocked by a release:
MetaMask/snaps#2835,
MetaMask/snaps#2750

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27817?quickstart=1)

## **Manual testing steps**

1. Create a Snap that links to an URL blocked with `eth-phishing-detect`
2. See that triggering the Snap is disallowed if the user has phishing
detection enabled
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Oct 14, 2024
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Fixes two problems with Snaps usage of `PhishingController`. Following
#25839 the
PhishingController expects full URLs instead of hostnames as the input
to `testOrigin`. In that PR, the argument of `isOnPhishingList` was
incorrectly changed. This PR also patches in some changes from the
`snaps` repo that are currently blocked by a release:
MetaMask/snaps#2835,
MetaMask/snaps#2750

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27817?quickstart=1)

## **Manual testing steps**

1. Create a Snap that links to an URL blocked with `eth-phishing-detect`
2. See that triggering the Snap is disallowed if the user has phishing
detection enabled
FrederikBolding added a commit to MetaMask/metamask-extension that referenced this pull request Oct 14, 2024
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

Fixes two problems with Snaps usage of `PhishingController`. Following
#25839 the
PhishingController expects full URLs instead of hostnames as the input
to `testOrigin`. In that PR, the argument of `isOnPhishingList` was
incorrectly changed. This PR also patches in some changes from the
`snaps` repo that are currently blocked by a release:
MetaMask/snaps#2835,
MetaMask/snaps#2750

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27817?quickstart=1)

1. Create a Snap that links to an URL blocked with `eth-phishing-detect`
2. See that triggering the Snap is disallowed if the user has phishing
detection enabled
danjm pushed a commit to MetaMask/metamask-extension that referenced this pull request Oct 15, 2024
## **Description**

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

Fixes two problems with Snaps usage of `PhishingController`. Following
#25839 the
PhishingController expects full URLs instead of hostnames as the input
to `testOrigin`. In that PR, the argument of `isOnPhishingList` was
incorrectly changed. This PR also patches in some changes from the
`snaps` repo that are currently blocked by a release:
MetaMask/snaps#2835,
MetaMask/snaps#2750

This PR cherry-picks a commit from `develop` that fixes this:
1f1e142

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27833?quickstart=1)

## **Manual testing steps**

1. Create a Snap that links to an URL blocked with `eth-phishing-detect`
2. See that triggering the Snap is disallowed if the user has phishing
detection enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants