MetaMask / test-dapp

The sample dapp used for e2e testing and metamask-extension QA
https://metamask.github.io/test-dapp/
MIT License
587 stars 347 forks source link

feat: add sdk support #331

Closed seaona closed 4 months ago

seaona commented 4 months ago

Description

This PR adds support for SDK Connection as well as moves the logic for WalletConnect + SDKConnect to its own file.

For the future, we could also move the provider logic and updatingButtons etc, to a utils file, since those functions are quite heavy and the index.js file is growing too big. Leaving this out of scope of this PR as would be harder to review.

Screenshots

https://github.com/MetaMask/test-dapp/assets/54408225/98f85f38-33d1-4ab5-a141-43d9d5d6b95c

Manual QA

Check that WalletConnect continues to work (any tx or signature) Check that SDK connect works as expected (any tx or signature)

socket-security[bot] commented 4 months ago

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

Package New capabilities Transitives Size Publisher
npm/@metamask/sdk@0.18.6 Transitive: environment, filesystem, network, shell +66 59 MB metamaskbot
npm/abort-controller@3.0.0 None +1 265 kB mysticatea
npm/browserify-sha3@0.0.4 None +1 110 kB null_radix
npm/eth-rpc-errors@4.0.3 None +1 91.9 kB rekmarks
npm/ethereumjs-abi@0.6.5 None +13 6.29 MB axic
npm/webextension-polyfill@0.10.0 None 0 198 kB addons-robot

View full report↗︎

socket-security[bot] commented 4 months ago

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Network access npm/source-map@0.7.4
New author npm/source-map@0.7.4
Shell access npm/xmlhttprequest-ssl@2.0.0
Network access npm/xmlhttprequest-ssl@2.0.0
Network access npm/xmlhttprequest-ssl@2.0.0
Native code npm/secp256k1@5.0.0
Native code npm/utf-8-validate@6.0.3
Native code npm/sha3@1.2.6
New author npm/@metamask/onboarding@1.0.1
New author npm/extension-port-stream@3.0.0
New author npm/@metamask/safe-event-emitter@3.1.1

View full report↗︎

Next steps

What is network access?

This module accesses the network.

Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

What is new author?

A new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.

Scrutinize new collaborator additions to packages because they now have the ability to publish code into your dependency tree. Packages should avoid frequent or unnecessary additions or changes to publishing rights.

What is shell access?

This module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.

Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.

What's wrong with native code?

Contains native code which could be a vector to obscure malicious code, and generally decrease the likelihood of reproducible or reliable installs.

Ensure that native code bindings are expected. Consumers may consider pure JS and functionally similar alternatives to avoid the challenges and risks associated with native code bindings.

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

  • @SocketSecurity ignore npm/source-map@0.7.4
  • @SocketSecurity ignore npm/xmlhttprequest-ssl@2.0.0
  • @SocketSecurity ignore npm/secp256k1@5.0.0
  • @SocketSecurity ignore npm/utf-8-validate@6.0.3
  • @SocketSecurity ignore npm/sha3@1.2.6
  • @SocketSecurity ignore npm/@metamask/onboarding@1.0.1
  • @SocketSecurity ignore npm/extension-port-stream@3.0.0
  • @SocketSecurity ignore npm/@metamask/safe-event-emitter@3.1.1