mirror of
https://github.com/bitwarden/server
synced 2025-12-15 15:53:59 +00:00
[PM-8107] Remove Duo v2 from server (#4934)
refactor(TwoFactorAuthentication): Remove references to old Duo SDK version 2 code and replace them with the Duo SDK version 4 supported library DuoUniversal code. Increased unit test coverage in the Two Factor Authentication code space. We opted to use DI instead of Inheritance for the Duo and OrganizaitonDuo two factor tokens to increase testability, since creating a testing mock of the Duo.Client was non-trivial. Reviewed-by: @JaredSnider-Bitwarden
This commit is contained in:
@@ -39,12 +39,9 @@ public class TwoFactorDuoRequestModelValidationTests
|
||||
var result = model.Validate(new ValidationContext(model));
|
||||
|
||||
// Assert
|
||||
Assert.Single(result);
|
||||
Assert.Equal("Neither v2 or v4 values are valid.", result.First().ErrorMessage);
|
||||
Assert.Contains("ClientId", result.First().MemberNames);
|
||||
Assert.Contains("ClientSecret", result.First().MemberNames);
|
||||
Assert.Contains("IntegrationKey", result.First().MemberNames);
|
||||
Assert.Contains("SecretKey", result.First().MemberNames);
|
||||
Assert.NotEmpty(result);
|
||||
Assert.True(result.Select(x => x.MemberNames.Contains("ClientId")).Any());
|
||||
Assert.True(result.Select(x => x.MemberNames.Contains("ClientSecret")).Any());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user