mirror of
https://github.com/bitwarden/server
synced 2025-12-21 02:33:30 +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:
@@ -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)
|
||||
|
||||
@@ -29,12 +29,13 @@ public interface ICurrentContext
|
||||
int? BotScore { get; set; }
|
||||
string ClientId { get; set; }
|
||||
Version ClientVersion { get; set; }
|
||||
bool ClientVersionIsPrerelease { get; set; }
|
||||
|
||||
Task BuildAsync(HttpContext httpContext, GlobalSettings globalSettings);
|
||||
Task BuildAsync(ClaimsPrincipal user, GlobalSettings globalSettings);
|
||||
|
||||
Task SetContextAsync(ClaimsPrincipal user);
|
||||
|
||||
|
||||
Task<bool> OrganizationUser(Guid orgId);
|
||||
Task<bool> OrganizationAdmin(Guid orgId);
|
||||
Task<bool> OrganizationOwner(Guid orgId);
|
||||
|
||||
Reference in New Issue
Block a user