mirror of
https://github.com/bitwarden/mobile
synced 2025-12-19 01:33:22 +00:00
[SG-516] Additional forwarded email providers for username generator - mobile (#2304)
* [SG-516] Added DuckDuckGo provider * [SG-516] Add Fastmail as generator provider * [SG-516] code clean up * [SG-516] Default to service empty if first time on screen. Order services by alphabetic order. * [SG-516] Removed unnecessary prop. * [PS-2278] Fixed inverted eye bug. * [SG-516] Add icon glyph converter * [SG-516] Fixed enum default value and ordering
This commit is contained in:
@@ -171,6 +171,29 @@ namespace Bit.Core.Services
|
||||
ApiToken = options.SimpleLoginApiKey,
|
||||
Url = "https://app.simplelogin.io/api/alias/random/new"
|
||||
});
|
||||
case ForwardedEmailServiceType.DuckDuckGo:
|
||||
if (string.IsNullOrWhiteSpace(options.DuckDuckGoApiKey))
|
||||
{
|
||||
return Constants.DefaultUsernameGenerated;
|
||||
}
|
||||
return await _apiService.GetUsernameFromAsync(ForwardedEmailServiceType.DuckDuckGo,
|
||||
new UsernameGeneratorConfig()
|
||||
{
|
||||
ApiToken = options.DuckDuckGoApiKey,
|
||||
Url = "https://quack.duckduckgo.com/api/email/addresses"
|
||||
});
|
||||
case ForwardedEmailServiceType.Fastmail:
|
||||
if (string.IsNullOrWhiteSpace(options.FastMailApiKey))
|
||||
{
|
||||
return Constants.DefaultUsernameGenerated;
|
||||
}
|
||||
|
||||
return await _apiService.GetUsernameFromAsync(ForwardedEmailServiceType.Fastmail,
|
||||
new UsernameGeneratorConfig()
|
||||
{
|
||||
ApiToken = options.FastMailApiKey,
|
||||
Url = "https://api.fastmail.com/jmap/api/"
|
||||
});
|
||||
default:
|
||||
_logger.Value.Error($"Error UsernameGenerationService: ForwardedEmailServiceType {options.ServiceType} not implemented.");
|
||||
return Constants.DefaultUsernameGenerated;
|
||||
|
||||
Reference in New Issue
Block a user