1
0
mirror of https://github.com/bitwarden/server synced 2025-12-31 23:53:17 +00:00

encrypted string length attr

This commit is contained in:
Kyle Spearrin
2018-08-02 08:57:32 -04:00
parent 8393af9afc
commit 14956f6383
11 changed files with 56 additions and 36 deletions

View File

@@ -0,0 +1,17 @@
using System.ComponentModel.DataAnnotations;
namespace Bit.Core.Utilities
{
public class EncryptedStringLengthAttribute : StringLengthAttribute
{
public EncryptedStringLengthAttribute(int maximumLength)
: base(maximumLength)
{ }
public override string FormatErrorMessage(string name)
{
return string.Format("The field {0} exceeds the maximum encrypted value length of {1} characters.",
name, MaximumLength);
}
}
}