mirror of
https://github.com/bitwarden/server.git
synced 2024-11-25 12:45:18 +01:00
* Extend StringLength attributes for emails to 256 char * Modified validations to check email lengths > 256
This commit is contained in:
parent
584d3e771c
commit
e6902179f8
@ -27,9 +27,9 @@ namespace Bit.Core.Models.Api.Public
|
||||
yield return new ValidationResult($"Email is not valid.",
|
||||
new string[] { nameof(Email) });
|
||||
}
|
||||
else if (Email.Length > 50)
|
||||
else if (Email.Length > 256)
|
||||
{
|
||||
yield return new ValidationResult($"Email is longer than 50 characters.",
|
||||
yield return new ValidationResult($"Email is longer than 256 characters.",
|
||||
new string[] { nameof(Email) });
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ namespace Bit.Core.Models.Api.Public
|
||||
/// </summary>
|
||||
/// <example>jsmith@example.com</example>
|
||||
[EmailAddress]
|
||||
[StringLength(50)]
|
||||
[StringLength(256)]
|
||||
public string Email { get; set; }
|
||||
/// <summary>
|
||||
/// External identifier for reference or linking this member to another system, such as a user directory.
|
||||
|
@ -6,7 +6,7 @@ namespace Bit.Core.Models.Api
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[StringLength(50)]
|
||||
[StringLength(256)]
|
||||
public string Email { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ namespace Bit.Core.Models.Api
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[StringLength(50)]
|
||||
[StringLength(256)]
|
||||
public string NewEmail { get; set; }
|
||||
[Required]
|
||||
[StringLength(300)]
|
||||
|
@ -6,7 +6,7 @@ namespace Bit.Core.Models.Api
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[StringLength(50)]
|
||||
[StringLength(256)]
|
||||
public string NewEmail { get; set; }
|
||||
[Required]
|
||||
[StringLength(300)]
|
||||
|
@ -6,7 +6,7 @@ namespace Bit.Core.Models.Api
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[StringLength(50)]
|
||||
[StringLength(256)]
|
||||
public string Email { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ namespace Bit.Core.Models.Api
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[StringLength(50)]
|
||||
[StringLength(256)]
|
||||
public string Email { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ namespace Bit.Core.Models.Api
|
||||
public string Name { get; set; }
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[StringLength(50)]
|
||||
[StringLength(256)]
|
||||
public string Email { get; set; }
|
||||
[Required]
|
||||
[StringLength(1000)]
|
||||
|
@ -7,7 +7,7 @@ namespace Bit.Core.Models.Api.Request
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[StringLength(50)]
|
||||
[StringLength(256)]
|
||||
public string Email { get; set; }
|
||||
[Required]
|
||||
public Enums.EmergencyAccessType? Type { get; set; }
|
||||
|
@ -7,7 +7,7 @@ namespace Bit.Core.Models.Api
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[StringLength(50)]
|
||||
[StringLength(256)]
|
||||
public string Email { get; set; }
|
||||
|
||||
public Installation ToInstallation()
|
||||
|
@ -42,7 +42,7 @@ namespace Bit.Core.Models.Api
|
||||
public class User : IValidatableObject
|
||||
{
|
||||
[EmailAddress]
|
||||
[StringLength(50)]
|
||||
[StringLength(256)]
|
||||
public string Email { get; set; }
|
||||
public bool Deleted { get; set; }
|
||||
[Required]
|
||||
|
@ -15,7 +15,7 @@ namespace Bit.Core.Models.Api
|
||||
[StringLength(50)]
|
||||
public string BusinessName { get; set; }
|
||||
[Required]
|
||||
[StringLength(50)]
|
||||
[StringLength(256)]
|
||||
[EmailAddress]
|
||||
public string BillingEmail { get; set; }
|
||||
public PlanType PlanType { get; set; }
|
||||
|
@ -16,7 +16,7 @@ namespace Bit.Core.Models.Api
|
||||
public string Identifier { get; set; }
|
||||
[EmailAddress]
|
||||
[Required]
|
||||
[StringLength(50)]
|
||||
[StringLength(256)]
|
||||
public string BillingEmail { get; set; }
|
||||
|
||||
public Permissions Permissions { get; set; }
|
||||
|
@ -38,9 +38,9 @@ namespace Bit.Core.Models.Api
|
||||
yield return new ValidationResult($"Email #{i + 1} is not valid.",
|
||||
new string[] { nameof(Emails) });
|
||||
}
|
||||
else if (email.Length > 50)
|
||||
else if (email.Length > 256)
|
||||
{
|
||||
yield return new ValidationResult($"Email #{i + 1} is longer than 50 characters.",
|
||||
yield return new ValidationResult($"Email #{i + 1} is longer than 256 characters.",
|
||||
new string[] { nameof(Emails) });
|
||||
}
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ namespace Bit.Core.Models.Api
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[StringLength(50)]
|
||||
[StringLength(256)]
|
||||
public string Email { get; set; }
|
||||
|
||||
public User ToUser(User extistingUser)
|
||||
|
Loading…
Reference in New Issue
Block a user