mirror of
https://github.com/bitwarden/mobile.git
synced 2024-06-25 10:26:02 +02:00
* 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
24 lines
1.0 KiB
C#
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);
|
|
}
|
|
}
|