1
0
mirror of https://github.com/bitwarden/server synced 2026-01-02 08:33:48 +00:00

fix(auth-validator): [PM-22975] Client Version Validator - Took in feedback from km. Removed IsV2User in favor of checking the security version on the user.

This commit is contained in:
Patrick Pimentel
2025-12-03 09:46:00 -05:00
parent c1bc10bf40
commit 753670d26f
10 changed files with 36 additions and 125 deletions

View File

@@ -11,6 +11,16 @@ public interface IClientVersionValidator
Task<bool> ValidateAsync(User user, CustomValidatorRequestContext requestContext);
}
/// <summary>
/// This validator will use the Client Version on a request, which currently maps
/// to the "Bitwarden-Client-Version" header, to determine if a user meets minimum
/// required client version for issuing tokens on an old client. This is done to
/// incentivize users getting on an updated client when their password encryption
/// method has already been updated. Currently this validator looks for the version
/// defined by MinimumClientVersionForV2Encryption.
///
/// If the header is omitted, then the validator returns that this request is valid.
/// </summary>
public class ClientVersionValidator(
ICurrentContext currentContext,
IGetMinimumClientVersionForUserQuery getMinimumClientVersionForUserQuery)