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

PhishingDetect to support IPFS CID blocking #4465

Merged
merged 17 commits into from
Jul 16, 2024

Conversation

409H
Copy link
Contributor

@409H 409H commented Jun 26, 2024

Explanation

This allows us to push IPFS cIDs to the blocklist and have them blocked by the eth-phishing-detect service. We only need to note the CIDs and not block the gateways.

Related issue: MetaMask/eth-phishing-detect#19532

After merged, then we can merge:

References

Changelog

@metamask/package-a

  • : Your change here
  • : Your change here

@metamask/package-b

  • : Your change here
  • : Your change here

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@409H 409H requested a review from a team as a code owner June 26, 2024 20:29
@409H 409H marked this pull request as draft June 26, 2024 20:31
@409H 409H changed the title Bump eth-phishing-detect to new version, supporting IPFS CID blocking PhishingDetect to support IPFS CID blocking Jul 6, 2024
@409H 409H marked this pull request as ready for review July 6, 2024 13:42
@409H 409H added the enhancement New feature or request label Jul 6, 2024
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Hey, I just had one comment, but this otherwise looks good to me. You may need to run yarn lint:fix to handle the lint failures.

* @param hostname - the hostname of the URL.
* @returns the href property of a URL object.
*/
export const formatHostnameToUrl = (hostname: string): string => {
Copy link
Contributor

@mcmire mcmire Jul 10, 2024

Choose a reason for hiding this comment

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

It seems that this function is only used in the tests. Do we want the package to export this function? If we only want to share it in tests, we've typically solved this by:

  • extracting it to a file in packages/phishing-controller/tests/ (we may have to create that directory first)
  • adding ./tests to include in packages/phishing-controller/tsconfig.json

And now we can import this file from the tests/ directory instead of the src/ directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@mcmire mcmire 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!

@mcmire mcmire merged commit 4511d58 into main Jul 16, 2024
116 checks passed
@mcmire mcmire deleted the feature/phishing-controller-ipfs branch July 16, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants