1
0
mirror of https://github.com/bitwarden/server synced 2025-12-17 08:43:27 +00:00

Support client version prerelease flag in context and LD targeting (#4994)

* Support client version prerelease flag in context and LD targeting

* Use integer instead of Boolean
This commit is contained in:
Matt Bishop
2024-11-07 16:13:57 -05:00
committed by GitHub
parent d6e624d639
commit 21b7c3b73a
4 changed files with 11 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ public class CurrentContext : ICurrentContext
public virtual int? BotScore { get; set; }
public virtual string ClientId { get; set; }
public virtual Version ClientVersion { get; set; }
public virtual bool ClientVersionIsPrerelease { get; set; }
public virtual IdentityClientType IdentityClientType { get; set; }
public virtual Guid? ServiceAccountOrganizationId { get; set; }
@@ -97,6 +98,11 @@ public class CurrentContext : ICurrentContext
{
ClientVersion = cVersion;
}
if (httpContext.Request.Headers.TryGetValue("Is-Prerelease", out var clientVersionIsPrerelease))
{
ClientVersionIsPrerelease = clientVersionIsPrerelease == "1";
}
}
public async virtual Task BuildAsync(ClaimsPrincipal user, GlobalSettings globalSettings)