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

Closed
opened 2025-11-26 23:37:54 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/2867

State: closed
Merged: Yes


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

**Original Pull Request:** https://github.com/bitwarden/android/pull/2867 **State:** closed **Merged:** Yes --- ## 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
GiteaMirror added the pull-request label 2025-11-26 23:37:54 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#3852