mirror of
https://github.com/bitwarden/server.git
synced 2024-11-24 12:35:25 +01:00
Provide client type in LD context (#4798)
This commit is contained in:
parent
f7bc5dfb2e
commit
080057c564
@ -21,6 +21,7 @@ public class LaunchDarklyFeatureService : IFeatureService
|
|||||||
|
|
||||||
private const string _contextAttributeClientVersion = "client-version";
|
private const string _contextAttributeClientVersion = "client-version";
|
||||||
private const string _contextAttributeDeviceType = "device-type";
|
private const string _contextAttributeDeviceType = "device-type";
|
||||||
|
private const string _contextAttributeClientType = "client-type";
|
||||||
private const string _contextAttributeOrganizations = "organizations";
|
private const string _contextAttributeOrganizations = "organizations";
|
||||||
|
|
||||||
public LaunchDarklyFeatureService(
|
public LaunchDarklyFeatureService(
|
||||||
@ -149,6 +150,7 @@ public class LaunchDarklyFeatureService : IFeatureService
|
|||||||
if (_currentContext.DeviceType.HasValue)
|
if (_currentContext.DeviceType.HasValue)
|
||||||
{
|
{
|
||||||
builder.Set(_contextAttributeDeviceType, (int)_currentContext.DeviceType.Value);
|
builder.Set(_contextAttributeDeviceType, (int)_currentContext.DeviceType.Value);
|
||||||
|
builder.Set(_contextAttributeClientType, (int)DeviceTypes.ToClientType(_currentContext.DeviceType.Value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ public static class DeviceTypes
|
|||||||
DeviceType.LinuxCLI
|
DeviceType.LinuxCLI
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
public static IReadOnlyCollection<DeviceType> BrowserExtensionTypes { get; } =
|
public static IReadOnlyCollection<DeviceType> BrowserExtensionTypes { get; } =
|
||||||
[
|
[
|
||||||
DeviceType.ChromeExtension,
|
DeviceType.ChromeExtension,
|
||||||
@ -45,7 +44,7 @@ public static class DeviceTypes
|
|||||||
DeviceType.UnknownBrowser
|
DeviceType.UnknownBrowser
|
||||||
];
|
];
|
||||||
|
|
||||||
private static ClientType ToClientType(DeviceType? deviceType)
|
public static ClientType ToClientType(DeviceType? deviceType)
|
||||||
{
|
{
|
||||||
return deviceType switch
|
return deviceType switch
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user