2021-09-08 19:43:24 +02:00
|
|
|
|
using System;
|
2020-02-21 16:23:38 +01:00
|
|
|
|
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();
|
2022-02-23 18:40:17 +01:00
|
|
|
|
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);
|
2020-09-03 18:30:40 +02:00
|
|
|
|
Task<bool> EvaluateMasterPassword(int passwordStrength, string newPassword,
|
|
|
|
|
MasterPasswordPolicyOptions enforcedPolicyOptions);
|
2021-09-08 19:43:24 +02:00
|
|
|
|
Tuple<ResetPasswordPolicyOptions, bool> GetResetPasswordPolicyOptions(IEnumerable<Policy> policies,
|
|
|
|
|
string orgId);
|
2022-02-23 18:40:17 +01:00
|
|
|
|
Task<bool> PolicyAppliesToUser(PolicyType policyType, Func<Policy, bool> policyFilter = null, string userId = null);
|
2021-09-23 15:42:38 +02:00
|
|
|
|
int? GetPolicyInt(Policy policy, string key);
|
2022-05-31 19:34:54 +02:00
|
|
|
|
Task<bool> ShouldShowVaultFilterAsync();
|
2020-02-21 16:23:38 +01:00
|
|
|
|
}
|
|
|
|
|
}
|