1
0
mirror of https://github.com/bitwarden/server synced 2025-12-20 02:03:46 +00:00

add support for multiple u2f keys

This commit is contained in:
Kyle Spearrin
2018-10-08 14:38:11 -04:00
parent 7176e0ea22
commit bfc74060b6
8 changed files with 170 additions and 92 deletions

View File

@@ -223,10 +223,25 @@ namespace Bit.Core.Models.Api
}
}
public class TwoFactorU2fRequestModel : TwoFactorRequestModel
public class TwoFactorU2fRequestModel : TwoFactorU2fDeleteRequestModel
{
[Required]
public string DeviceResponse { get; set; }
public string Name { get; set; }
}
public class TwoFactorU2fDeleteRequestModel : TwoFactorRequestModel, IValidatableObject
{
[Required]
public int? Id { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if(!Id.HasValue || Id < 0 || Id > 5)
{
yield return new ValidationResult("Invalid Key Id", new string[] { nameof(Id) });
}
}
}
public class UpdateTwoFactorEmailRequestModel : TwoFactorEmailRequestModel