mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
Resolve auth warnings (#5784)
This commit is contained in:
@ -8,7 +8,6 @@ using Bit.Core.Entities;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Repositories;
|
||||
using Bit.Core.Services;
|
||||
using Bit.Core.Settings;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NSubstitute;
|
||||
using Xunit;
|
||||
@ -23,7 +22,6 @@ public class DevicesControllerTest
|
||||
private readonly IUntrustDevicesCommand _untrustDevicesCommand;
|
||||
private readonly IUserRepository _userRepositoryMock;
|
||||
private readonly ICurrentContext _currentContextMock;
|
||||
private readonly IGlobalSettings _globalSettingsMock;
|
||||
private readonly ILogger<DevicesController> _loggerMock;
|
||||
private readonly DevicesController _sut;
|
||||
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<IsPackable>false</IsPackable>
|
||||
<!-- Temp exclusions until warnings are fixed -->
|
||||
<WarningsNotAsErrors>$(WarningsNotAsErrors);CS0672;CS1998</WarningsNotAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -96,6 +96,7 @@ IBaseRequestValidatorTestWrapper
|
||||
return context.ValidatedTokenRequest.Subject ?? new ClaimsPrincipal();
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
protected override void SetErrorResult(
|
||||
BaseRequestValidationContextFake context,
|
||||
Dictionary<string, object> customResponse)
|
||||
@ -103,6 +104,7 @@ IBaseRequestValidatorTestWrapper
|
||||
context.GrantResult = new GrantValidationResult(TokenRequestErrors.InvalidGrant, customResponse: customResponse);
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
protected override void SetSsoResult(
|
||||
BaseRequestValidationContextFake context,
|
||||
Dictionary<string, object> customResponse)
|
||||
@ -121,6 +123,7 @@ IBaseRequestValidatorTestWrapper
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
protected override void SetTwoFactorResult(
|
||||
BaseRequestValidationContextFake context,
|
||||
Dictionary<string, object> customResponse)
|
||||
|
@ -56,9 +56,9 @@ public class UserManagerTestWrapper<TUser> : UserManager<TUser> where TUser : cl
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<bool> GetTwoFactorEnabledAsync(TUser user)
|
||||
public override Task<bool> GetTwoFactorEnabledAsync(TUser user)
|
||||
{
|
||||
return TWO_FACTOR_ENABLED;
|
||||
return Task.FromResult(TWO_FACTOR_ENABLED);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -66,9 +66,9 @@ public class UserManagerTestWrapper<TUser> : UserManager<TUser> where TUser : cl
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<IList<string>> GetValidTwoFactorProvidersAsync(TUser user)
|
||||
public override Task<IList<string>> GetValidTwoFactorProvidersAsync(TUser user)
|
||||
{
|
||||
return TWO_FACTOR_PROVIDERS;
|
||||
return Task.FromResult(TWO_FACTOR_PROVIDERS);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -77,9 +77,9 @@ public class UserManagerTestWrapper<TUser> : UserManager<TUser> where TUser : cl
|
||||
/// <param name="user"></param>
|
||||
/// <param name="tokenProvider"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<string> GenerateTwoFactorTokenAsync(TUser user, string tokenProvider)
|
||||
public override Task<string> GenerateTwoFactorTokenAsync(TUser user, string tokenProvider)
|
||||
{
|
||||
return TWO_FACTOR_TOKEN;
|
||||
return Task.FromResult(TWO_FACTOR_TOKEN);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -89,8 +89,8 @@ public class UserManagerTestWrapper<TUser> : UserManager<TUser> where TUser : cl
|
||||
/// <param name="tokenProvider"></param>
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<bool> VerifyTwoFactorTokenAsync(TUser user, string tokenProvider, string token)
|
||||
public override Task<bool> VerifyTwoFactorTokenAsync(TUser user, string tokenProvider, string token)
|
||||
{
|
||||
return TWO_FACTOR_TOKEN_VERIFIED;
|
||||
return Task.FromResult(TWO_FACTOR_TOKEN_VERIFIED);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user