mirror of
https://github.com/bitwarden/mobile
synced 2025-12-14 07:13:33 +00:00
35 lines
1.6 KiB
C#
35 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Bit.Core.Enums;
|
|
using Bit.Core.Models.Data;
|
|
using Bit.Core.Models.Domain;
|
|
|
|
namespace Bit.Core.Abstractions
|
|
{
|
|
public interface IPolicyService
|
|
{
|
|
void ClearCache();
|
|
Task<IEnumerable<Policy>> GetAll(PolicyType? type, string userId = null);
|
|
Task Replace(Dictionary<string, PolicyData> policies, string userId = null);
|
|
Task ClearAsync(string userId);
|
|
Task<MasterPasswordPolicyOptions> GetMasterPasswordPolicyOptions(IEnumerable<Policy> policies = null, string userId = null);
|
|
Task<bool> EvaluateMasterPassword(int passwordStrength, string newPassword,
|
|
MasterPasswordPolicyOptions enforcedPolicyOptions);
|
|
Tuple<ResetPasswordPolicyOptions, bool> GetResetPasswordPolicyOptions(IEnumerable<Policy> policies,
|
|
string orgId);
|
|
Task<bool> PolicyAppliesToUser(PolicyType policyType, Func<Policy, bool> policyFilter = null, string userId = null);
|
|
int? GetPolicyInt(Policy policy, string key);
|
|
Task<bool> ShouldShowVaultFilterAsync();
|
|
|
|
/// <summary>
|
|
/// Checks if the master password requires updating to meet the enforced policy requirements
|
|
/// </summary>
|
|
/// <param name="masterPassword"></param>
|
|
/// <param name="email">The user's email, used to help evaluate password strength</param>
|
|
/// <param name="enforcedOptions"></param>
|
|
Task<bool> RequirePasswordChangeOnLoginAsync(string masterPassword, string email,
|
|
MasterPasswordPolicyOptions enforcedOptions);
|
|
}
|
|
}
|