1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-06-25 10:26:02 +02:00
bitwarden-mobile/src/Core/Abstractions/IPasswordGenerationService.cs
Federico Maccaroni 1c8328f62d
[PM-1402] Refactor PasswordGenerationService alongside PolicyService (#2443)
* PM-1402 Refactor pass generation service alongside policyservice

* PM-1402 Refactor PasswordGenerationService and PolicyService to have a simpler code and more specific to each class

* PM-1402 Fix format

* PM-1402 Moved policy consts from PolicyService to Policy

* PM-1402 fix crash due to lack of null checking

* PM-1402 fix format

* PM-1402 removed GetValueOrDefault() given that it was not needed and was changing the behavior
2023-05-11 18:41:32 +02:00

24 lines
1.0 KiB
C#

using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Bit.Core.Models.Domain;
using Zxcvbn;
namespace Bit.Core.Abstractions
{
public interface IPasswordGenerationService
{
Task AddHistoryAsync(string password, CancellationToken token = default(CancellationToken));
Task ClearAsync(string userId = null);
void ClearCache();
Task<string> GeneratePassphraseAsync(PasswordGenerationOptions options);
Task<string> GeneratePasswordAsync(PasswordGenerationOptions options);
Task<List<GeneratedPasswordHistory>> GetHistoryAsync();
Task<(PasswordGenerationOptions, PasswordGeneratorPolicyOptions)> GetOptionsAsync();
Result PasswordStrength(string password, List<string> userInputs = null);
Task SaveOptionsAsync(PasswordGenerationOptions options);
void NormalizeOptions(PasswordGenerationOptions options, PasswordGeneratorPolicyOptions enforcedPolicyOptions);
List<string> GetPasswordStrengthUserInput(string email);
}
}