mirror of
https://github.com/bitwarden/server
synced 2025-12-29 06:33:43 +00:00
[PM-18239] Master password policy requirement (#5936)
* wip * initial implementation * add tests * more tests, fix policy Enabled * remove exempt statuses * test EnforcedOptions is populated * clean up, add test * fix test, add json attributes for deserialization * fix attribute casing * fix test --------- Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
This commit is contained in:
@@ -1,20 +1,28 @@
|
||||
namespace Bit.Core.AdminConsole.Models.Data.Organizations.Policies;
|
||||
using System.Text.Json.Serialization;
|
||||
namespace Bit.Core.AdminConsole.Models.Data.Organizations.Policies;
|
||||
|
||||
public class MasterPasswordPolicyData : IPolicyDataModel
|
||||
{
|
||||
[JsonPropertyName("minComplexity")]
|
||||
public int? MinComplexity { get; set; }
|
||||
[JsonPropertyName("minLength")]
|
||||
public int? MinLength { get; set; }
|
||||
[JsonPropertyName("requireLower")]
|
||||
public bool? RequireLower { get; set; }
|
||||
[JsonPropertyName("requireUpper")]
|
||||
public bool? RequireUpper { get; set; }
|
||||
[JsonPropertyName("requireNumbers")]
|
||||
public bool? RequireNumbers { get; set; }
|
||||
[JsonPropertyName("requireSpecial")]
|
||||
public bool? RequireSpecial { get; set; }
|
||||
[JsonPropertyName("enforceOnLogin")]
|
||||
public bool? EnforceOnLogin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Combine the other policy data with this instance, taking the most secure options
|
||||
/// </summary>
|
||||
/// <param name="other">The other policy instance to combine with this</param>
|
||||
public void CombineWith(MasterPasswordPolicyData other)
|
||||
public void CombineWith(MasterPasswordPolicyData? other)
|
||||
{
|
||||
if (other == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user