mirror of
https://github.com/bitwarden/server
synced 2026-02-05 03:03:42 +00:00
Enhance MasterPasswordPolicyData with validation attributes
Added data annotations for MinComplexity and MinLength properties to enforce validation rules. MinComplexity must be between 0 and 4, and MinLength must be between 12 and 128.
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
namespace Bit.Core.AdminConsole.Models.Data.Organizations.Policies;
|
||||
|
||||
public class MasterPasswordPolicyData : IPolicyDataModel
|
||||
{
|
||||
[JsonPropertyName("minComplexity")]
|
||||
[Range(0, 4)]
|
||||
public int? MinComplexity { get; set; }
|
||||
[JsonPropertyName("minLength")]
|
||||
[Range(12, 128)]
|
||||
public int? MinLength { get; set; }
|
||||
[JsonPropertyName("requireLower")]
|
||||
public bool? RequireLower { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user