1
0
mirror of https://github.com/bitwarden/server synced 2026-01-19 00:43:47 +00:00
* Delete U2F tokens alongside WebAuthn

* Bring back u2f apis
This commit is contained in:
Oscar Hinton
2021-05-05 16:14:49 +02:00
committed by GitHub
parent f0baf7e6a4
commit ce4f025a0c
7 changed files with 294 additions and 0 deletions

View File

@@ -224,6 +224,27 @@ namespace Bit.Core.Models.Api
}
}
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 TwoFactorWebAuthnRequestModel : TwoFactorWebAuthnDeleteRequestModel
{
[Required]