mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
[SM-244] Resolve dotnet warnings (#2283)
This commit is contained in:
@ -10,7 +10,7 @@ public class KdfRequestModel : PasswordRequestModel, IValidatableObject
|
||||
[Required]
|
||||
public int? KdfIterations { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (Kdf.HasValue && KdfIterations.HasValue)
|
||||
{
|
||||
|
@ -102,7 +102,7 @@ public class UpdateTwoFactorDuoRequestModel : SecretVerificationRequestModel, IV
|
||||
return extistingOrg;
|
||||
}
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (!Core.Utilities.Duo.DuoApi.ValidHost(Host))
|
||||
{
|
||||
@ -160,7 +160,7 @@ public class UpdateTwoFactorYubicoOtpRequestModel : SecretVerificationRequestMod
|
||||
return keyValue.Substring(0, 12);
|
||||
}
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Key1) && string.IsNullOrWhiteSpace(Key2) && string.IsNullOrWhiteSpace(Key3) &&
|
||||
string.IsNullOrWhiteSpace(Key4) && string.IsNullOrWhiteSpace(Key5))
|
||||
|
@ -23,7 +23,6 @@ public class DataProtectorTokenFactory<T> : IDataProtectorTokenFactory<T> where
|
||||
/// Unprotect token
|
||||
/// </summary>
|
||||
/// <param name="token">The token to parse</param>
|
||||
/// <typeparam name="T">The tokenable type to parse to</typeparam>
|
||||
/// <returns>The parsed tokenable</returns>
|
||||
/// <exception>Throws CryptographicException if fails to unprotect</exception>
|
||||
public T Unprotect(string token) =>
|
||||
|
@ -27,7 +27,6 @@ public static class CoreHelpers
|
||||
private static readonly DateTime _epoc = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
private static readonly DateTime _max = new DateTime(9999, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
private static readonly Random _random = new Random();
|
||||
private static string _version;
|
||||
private static readonly string CloudFlareConnectingIp = "CF-Connecting-IP";
|
||||
private static readonly string RealIp = "X-Real-IP";
|
||||
|
||||
|
@ -31,16 +31,14 @@ public class StrictEmailAddressAttribute : ValidationAttribute
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
The regex below is intended to catch edge cases that are not handled by the general parsing check above.
|
||||
This enforces the following rules:
|
||||
* Requires ASCII only in the local-part (code points 0-127)
|
||||
* Requires an @ symbol
|
||||
* Allows any char in second-level domain name, including unicode and symbols
|
||||
* Requires at least one period (.) separating SLD from TLD
|
||||
* Must end in a letter (including unicode)
|
||||
See the unit tests for examples of what is allowed.
|
||||
**/
|
||||
// The regex below is intended to catch edge cases that are not handled by the general parsing check above.
|
||||
// This enforces the following rules:
|
||||
// * Requires ASCII only in the local-part (code points 0-127)
|
||||
// * Requires an @ symbol
|
||||
// * Allows any char in second-level domain name, including unicode and symbols
|
||||
// * Requires at least one period (.) separating SLD from TLD
|
||||
// * Must end in a letter (including unicode)
|
||||
// See the unit tests for examples of what is allowed.
|
||||
var emailFormat = @"^[\x00-\x7F]+@.+\.\p{L}+$";
|
||||
if (!Regex.IsMatch(emailAddress, emailFormat))
|
||||
{
|
||||
|
Reference in New Issue
Block a user