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

Email aliases implementation #27127

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Email aliases implementation #27127

wants to merge 9 commits into from

Conversation

arthuredelstein
Copy link
Collaborator

Resolves brave/brave-browser#43115

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

@arthuredelstein arthuredelstein requested review from a team and bridiver as code owners January 6, 2025 14:05
@github-actions github-actions bot added CI/storybook-url Deploy storybook and provide a unique URL for each build CI/run-upstream-tests Run upstream unit and browser tests on Linux and Windows (otherwise only on Linux) puLL-Merge needs-security-review labels Jan 6, 2025
Copy link
Contributor

github-actions bot commented Jan 7, 2025

The following commits were not verified:
19a90a3 (unsigned)
ce6ca42 (unsigned)
0fb4706 (unsigned)

@arthuredelstein
Copy link
Collaborator Author

(Not we are using a temporary Brave API Key; we will use the real one programmatically once the backend is ready to use it.)

Copy link
Contributor

github-actions bot commented Jan 8, 2025

[puLL-Merge] - brave/brave-core@27127

Description

This PR introduces a new Email Aliases feature to the Brave browser. It adds functionality for users to create, manage, and use email aliases to protect their primary email address. The feature includes a new settings page, a bubble UI for quick alias creation, and integration with Brave's existing systems.

Possible Issues

  1. The PR introduces new network requests to external services, which could potentially impact performance or privacy if not handled carefully.
  2. The implementation adds new preferences and storage mechanisms, which may require migration strategies for existing users.

Security Hotspots

  1. The PR includes API calls to external services (accounts.bsg.bravesoftware.com and aliases.bsg.bravesoftware.com) which handle sensitive user data. Ensure all communications are properly encrypted and authenticated.
  2. The new feature stores authentication tokens and email aliases locally. Verify that this sensitive information is stored securely and not accessible to malicious extensions or scripts.
  3. The implementation allows for the creation and management of email aliases, which could be abused if not properly rate-limited or protected against automated creation.
Changes

Changes

  1. app/brave_command_ids.h:

    • Added new command IDs for showing email aliases and creating new aliases.
  2. app/brave_generated_resources.grd:

    • Added new string resources for the Email Aliases feature.
  3. app/brave_settings_strings.grdp:

    • Added numerous new string resources for the Email Aliases settings page.
  4. browser/brave_browser_features.cc and .h:

    • Added a new feature flag kBraveEmailAliases for the Email Aliases feature.
  5. browser/brave_local_state_prefs.cc and browser/brave_profile_prefs.cc:

    • Added registration for new Email Aliases preferences.
  6. browser/resources/settings/:

    • Added new files for the Email Aliases settings page implementation.
  7. browser/ui/:

    • Added new files for the Email Aliases bubble view implementation.
    • Modified existing files to integrate the new feature into the browser UI.
  8. browser/ui/webui/:

    • Added new handlers and UI implementations for the Email Aliases feature.
  9. chromium_src/:

    • Modified various files to integrate the new feature into existing Chrome structures.
  10. components/:

    • Added new components for Email Aliases, including preference handling and resources.
  11. ui/webui/resources/:

    • Added new icon resources for the Email Aliases feature.
sequenceDiagram
    User->>BraveUI: Clicks "Email Aliases" in settings
    BraveUI->>EmailAliasesHandler: Load Email Aliases page
    EmailAliasesHandler->>MappingService: Get account email
    MappingService->>EmailAliasesHandler: Return account email
    EmailAliasesHandler->>BraveUI: Display Email Aliases page
    User->>BraveUI: Creates new alias
    BraveUI->>EmailAliasesHandler: Create new alias request
    EmailAliasesHandler->>MappingService: Generate new alias
    MappingService->>ExternalService: API call to create alias
    ExternalService->>MappingService: Confirm alias creation
    MappingService->>EmailAliasesHandler: Return new alias
    EmailAliasesHandler->>BraveUI: Update UI with new alias
    BraveUI->>User: Display confirmation
Loading

@@ -493,6 +494,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
base::Value(false));

webcompat_reporter::prefs::RegisterProfilePrefs(registry);

email_aliases::RegisterProfilePrefs(registry);
Copy link
Member

Choose a reason for hiding this comment

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

what's the use of these prefs here for? I'm curious if you think it would be useful to integrity protect them to prevent filesystem tampering here

Copy link
Member

Choose a reason for hiding this comment

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

ui::SimpleMenuModel* autofill_menu_model =
static_cast<ui::SimpleMenuModel*>(GetSubmenuModelAt(
GetIndexOfCommandId(IDC_PASSWORDS_AND_AUTOFILL_MENU).value()));
DCHECK(autofill_menu_model);
Copy link
Member

Choose a reason for hiding this comment

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

is it an issue if this var doesn't get set? Thinking CHECK or error handling with a nil return might be better here if so instead of DCHECK which I believe gets optimized out at build time unless it's a debug build

@iefremov
Copy link
Contributor

iefremov commented Jan 9, 2025

@arthuredelstein is this one ready for review? Can you link a spec please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/run-upstream-tests Run upstream unit and browser tests on Linux and Windows (otherwise only on Linux) CI/storybook-url Deploy storybook and provide a unique URL for each build needs-security-review puLL-Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

email aliases
4 participants