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

Add privacy setting to disable external name sources #21045

Merged
merged 42 commits into from
Oct 3, 2023

Conversation

matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Sep 26, 2023

Description

Add a toggle to the Security & privacy settings in the Flask build to disable the use of any NameProvider which uses an external source.

This disables the EtherscanNameProvider, LensNameProvider, and TokenNameProvider from making any callouts and therefore prevents any proposed names being displayed in the NameDetails component, except for any values provided by installed snaps.

Manual Testing Steps

  1. Go to test dApp.
  2. Connect.
  3. Switch to mainnet.
  4. Copy this URL and replace %CURRENT_ACCOUNT_ADDRESS% with your current account address.
  5. This will load a V4 signature request in the test dapp including addresses which will should all have proposed names.
  6. Select the last address and verify there is a Lens Protocol and ENS proposed name.
  7. Go to Settings > Security & privacy > Suggest address names and disable it.
  8. Wait 2 minutes.
  9. Go back to the above URL and select the last address.
  10. Ensure only the ENS proposed name is shown.

Screenshots

petnames_external_sources_toggle

Pre-merge Author Checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained:
    • What problem this PR is solving.
    • How this problem was solved.
    • How reviewers can test my changes.
  • I’ve indicated what issue this PR is linked to: Fixes #???
  • I’ve included tests if applicable.
  • I’ve documented any added code.
  • I’ve applied the right labels on the PR (see labeling guidelines).
  • 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.

@matthewwalsh0 matthewwalsh0 requested a review from a team as a code owner September 26, 2023 12:48
@github-actions
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.

@codecov
Copy link

codecov bot commented Sep 29, 2023

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (b7ad9f6) 68.49% compared to head (bad1b19) 68.47%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #21045      +/-   ##
===========================================
- Coverage    68.49%   68.47%   -0.02%     
===========================================
  Files         1012     1012              
  Lines        40588    40610      +22     
  Branches     10843    10839       -4     
===========================================
+ Hits         27799    27807       +8     
- Misses       12789    12803      +14     
Files Coverage Δ
app/scripts/controllers/preferences.js 57.05% <80.00%> (+0.09%) ⬆️
...es/settings/security-tab/security-tab.component.js 99.24% <80.00%> (-0.76%) ⬇️
app/scripts/metamask-controller.js 53.74% <75.00%> (-0.11%) ⬇️
...es/settings/security-tab/security-tab.container.js 86.36% <0.00%> (-8.64%) ⬇️
ui/store/actions.ts 43.24% <0.00%> (-0.10%) ⬇️

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

@metamaskbot
Copy link
Collaborator

Builds ready [a585e1e]
Page Load Metrics (1144 ± 332 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint8112697115
domContentLoaded7211891115
load7717911144692332
domInteractive7211891115
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 719 Bytes (0.02%)
  • ui: -16.16 KiB (-0.20%)
  • common: 55.22 KiB (1.18%)

@metamaskbot
Copy link
Collaborator

Builds ready [d70efc7]
Page Load Metrics (1084 ± 348 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint8412899136
domContentLoaded7212094126
load8017551084725348
domInteractive7212094126
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 719 Bytes (0.02%)
  • ui: -16.16 KiB (-0.20%)
  • common: 55.22 KiB (1.18%)

Copy link

@Ameralameri Ameralameri left a comment

Choose a reason for hiding this comment

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

Approv

@sleepytanya
Copy link
Contributor

sleepytanya commented Oct 1, 2023

Toggle Settings > Security & privacy > Suggest address names works as designed.

  1. Suggested addresses with Suggest address names toggle on:
Screenshot 2023-10-01 at 12 43 48 PM

Last address with Lens Protocol and ENS proposed name:

Screenshot 2023-10-01 at 12 44 34 PM
  1. Proposed names not displayed in the NameDetails component after disabling Suggest address names:
Screenshot 2023-10-01 at 12 52 40 PM

For the last address only ENS proposed name is shown:

Screenshot 2023-10-01 at 12 47 01 PM

OGPoyraz
OGPoyraz previously approved these changes Oct 2, 2023
Base automatically changed from feat/petnames-metrics to develop October 2, 2023 09:21
@matthewwalsh0 matthewwalsh0 dismissed OGPoyraz’s stale review October 2, 2023 09:21

The base branch was changed.

@matthewwalsh0 matthewwalsh0 requested review from a team as code owners October 2, 2023 09:21
@matthewwalsh0 matthewwalsh0 added the team-confirmations-system DEPRECATED: please use "team-confirmations" label instead label Oct 2, 2023
@metamaskbot
Copy link
Collaborator

Builds ready [bad1b19]
Page Load Metrics (928 ± 393 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint95159118147
domContentLoaded76146109189
load871972928819393
domInteractive76146108189
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 372 Bytes (0.01%)

@matthewwalsh0 matthewwalsh0 merged commit ab0fdee into develop Oct 3, 2023
64 of 65 checks passed
@matthewwalsh0 matthewwalsh0 deleted the feat/external-name-sources-toggle branch October 3, 2023 09:58
@github-actions github-actions bot locked and limited conversation to collaborators Oct 3, 2023
@metamaskbot metamaskbot added the release-11.3.0 Issue or pull request that will be included in release 11.3.0 label Oct 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.3.0 Issue or pull request that will be included in release 11.3.0 team-confirmations-system DEPRECATED: please use "team-confirmations" label instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants