1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 09:32:48 -05:00

[EC-584] Removed ListResponseModel from OrganizationExportResponseModel (#2316)

* [EC-584] Removed ListResponseModel from OrganizationExportResponseModel properties

* [EC-584] Added backwards compatibility for client version 2022.9.0

* [EC-584] Added property 'ClientVersion' to ICurrentContext

* [EC-584] Added backwards compatibility for version 2022.10.0

* [EC-584] Change ICurrentContext.ClientVersion from string to Version

* [EC-584] Remove check for versions before 2022.9.0 because they do not use this endpoint
This commit is contained in:
Rui Tomé
2022-11-07 12:01:45 +00:00
committed by GitHub
parent 363dd6493a
commit 8a6f780d55
4 changed files with 41 additions and 8 deletions

View File

@ -32,6 +32,7 @@ public class CurrentContext : ICurrentContext
public virtual bool MaybeBot { get; set; }
public virtual int? BotScore { get; set; }
public virtual string ClientId { get; set; }
public virtual Version ClientVersion { get; set; }
public CurrentContext(IProviderUserRepository providerUserRepository)
{
@ -80,6 +81,11 @@ public class CurrentContext : ICurrentContext
{
MaybeBot = httpContext.Request.Headers["X-Cf-Maybe-Bot"] == "1";
}
if (httpContext.Request.Headers.ContainsKey("Bitwarden-Client-Version"))
{
ClientVersion = new Version(httpContext.Request.Headers["Bitwarden-Client-Version"]);
}
}
public async virtual Task BuildAsync(ClaimsPrincipal user, GlobalSettings globalSettings)