mirror of
https://github.com/bitwarden/server
synced 2026-01-02 08:33:48 +00:00
fix(auth-validator): [PM-22975] Client Version Validator - Rename function
This commit is contained in:
@@ -222,7 +222,7 @@ public abstract class BaseRequestValidator<T> where T : class
|
||||
/// <returns>true if the scheme successfully passed validation, otherwise false.</returns>
|
||||
private async Task<bool> ValidateClientVersionAsync(T context, CustomValidatorRequestContext validatorContext)
|
||||
{
|
||||
var ok = _clientVersionValidator.ValidateAsync(validatorContext.User, validatorContext);
|
||||
var ok = _clientVersionValidator.Validate(validatorContext.User, validatorContext);
|
||||
if (ok)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Bit.Identity.IdentityServer.RequestValidators;
|
||||
|
||||
public interface IClientVersionValidator
|
||||
{
|
||||
bool ValidateAsync(User user, CustomValidatorRequestContext requestContext);
|
||||
bool Validate(User user, CustomValidatorRequestContext requestContext);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -28,7 +28,7 @@ public class ClientVersionValidator(
|
||||
private const string _noUserMessage = "No user found while trying to validate client version";
|
||||
private const string _versionHeaderMissing = "No client version header found, required to prevent encryption errors. Please confirm your client is supplying the header: \"Bitwarden-Client-Version\"";
|
||||
|
||||
public bool ValidateAsync(User? user, CustomValidatorRequestContext requestContext)
|
||||
public bool Validate(User? user, CustomValidatorRequestContext requestContext)
|
||||
{
|
||||
// Do this nullish check because the base request validator currently is not
|
||||
// strict null checking. Once that gets fixed then we can see about making
|
||||
|
||||
Reference in New Issue
Block a user