[PR #2867] [MERGED] [PM-4800] Send item domain name to fastmail #40942

Closed
opened 2026-04-23 19:45:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2867
Author: @cubemike
Created: 11/12/2023
Status: Merged
Merged: 11/17/2023
Merged by: @audreyality

Base: masterHead: master


📝 Commits (3)

📊 Changes

3 files changed (+22 additions, -8 deletions)

View changed files

📝 src/Core/Models/Domain/UsernameGenerationOptions.cs (+5 -1)
📝 src/Core/Services/EmailForwarders/FastmailForwarder.cs (+10 -4)
📝 src/Core/Services/UsernameGenerationService.cs (+7 -3)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Added a metadata field (forDomain:) to the Fastmail Forwarder API request that's set to the domain name of the item being added to the vault, or to "" if the username generator is being used in standalone mode. This allows the user's Fastmail account to display the domain name for the username that was generated.

Code changes

  • src/Core/Models/Domain/UsernameGenerationOptions.cs: GetForwarderOptions() will now return a FastmailForwarderOptions object with the new Website member set to the EmailWebsite of UsernameGenerationOptions for the fastmail case
  • src/Core/Services/EmailForwarders/FastmailForwarder.cs: Added the FastmailForwarderOptions class that extends ForwarderOptions and updated declarations accordingly. Added the forDomain: field to the API request
  • src/Core/Services/UsernameGenerationService.cs: Removed the fastmail case from the switch, and turned it into an if that casts the ForwarderOptions to FastmailForwarderOptions, mirroring handling of AnonAddy

Screenshots

A Masked Email entry in Fastmail before the changes for the domain google.com:
image
281215619-7a499a65-ab41-4294-a934-eaffb3a7bdbd

A Masked Email entry in Fastmail after the changes for the domain google.com:
image
281215539-e908bd01-faed-43dc-828a-46f19a6bedae

Testing

Tested in the Android emulator and on Android hardware

Dotnet Format Changes

None found


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/2867 **Author:** [@cubemike](https://github.com/cubemike) **Created:** 11/12/2023 **Status:** ✅ Merged **Merged:** 11/17/2023 **Merged by:** [@audreyality](https://github.com/audreyality) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (3) - [`c8bbad9`](https://github.com/bitwarden/android/commit/c8bbad983819331e84aa5c41c0080a88b0b54efa) Send item domain name to fastmail - [`8faebde`](https://github.com/bitwarden/android/commit/8faebde3caa0fe3438a515a0c3d422223560d4fa) Minor changes for readability - [`8221f3b`](https://github.com/bitwarden/android/commit/8221f3b6f3c50655b33ff1476130203577144627) dotnet format ### 📊 Changes **3 files changed** (+22 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/Core/Models/Domain/UsernameGenerationOptions.cs` (+5 -1) 📝 `src/Core/Services/EmailForwarders/FastmailForwarder.cs` (+10 -4) 📝 `src/Core/Services/UsernameGenerationService.cs` (+7 -3) </details> ### 📄 Description ## Type of change - [ ] Bug fix - [X] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective Added a metadata field (forDomain:) to the Fastmail Forwarder API request that's set to the domain name of the item being added to the vault, or to "" if the username generator is being used in standalone mode. This allows the user's Fastmail account to display the domain name for the username that was generated. ## Code changes - **src/Core/Models/Domain/UsernameGenerationOptions.cs:** `GetForwarderOptions()` will now return a `FastmailForwarderOptions` object with the new `Website` member set to the `EmailWebsite` of `UsernameGenerationOptions` for the fastmail case - **src/Core/Services/EmailForwarders/FastmailForwarder.cs:** Added the `FastmailForwarderOptions` class that extends `ForwarderOptions` and updated declarations accordingly. Added the `forDomain:` field to the API request - **src/Core/Services/UsernameGenerationService.cs:** Removed the fastmail case from the switch, and turned it into an if that casts the `ForwarderOptions` to `FastmailForwarderOptions`, mirroring handling of AnonAddy ## Screenshots A Masked Email entry in Fastmail before the changes for the domain google.com: image ![281215619-7a499a65-ab41-4294-a934-eaffb3a7bdbd](https://github.com/bitwarden/mobile/assets/16997120/d0a65800-6814-4ef9-a850-87f8af08575b) A Masked Email entry in Fastmail after the changes for the domain google.com: image ![281215539-e908bd01-faed-43dc-828a-46f19a6bedae](https://github.com/bitwarden/mobile/assets/16997120/6c271410-e97b-4550-b674-20e434821b54) ## Testing Tested in the Android emulator and on Android hardware ## Dotnet Format Changes None found --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 19:45:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#40942