mirror of
https://github.com/bitwarden/server.git
synced 2025-04-07 14:08:13 -05:00
Separate desktop and CLI for ClientType checks (#5441)
This commit is contained in:
parent
0ca1b319fd
commit
1beb5dc5c0
@ -14,5 +14,7 @@ public enum ClientType : byte
|
|||||||
[Display(Name = "Desktop App")]
|
[Display(Name = "Desktop App")]
|
||||||
Desktop = 3,
|
Desktop = 3,
|
||||||
[Display(Name = "Mobile App")]
|
[Display(Name = "Mobile App")]
|
||||||
Mobile = 4
|
Mobile = 4,
|
||||||
|
[Display(Name = "CLI")]
|
||||||
|
Cli = 5
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,11 @@ public static class DeviceTypes
|
|||||||
DeviceType.LinuxDesktop,
|
DeviceType.LinuxDesktop,
|
||||||
DeviceType.MacOsDesktop,
|
DeviceType.MacOsDesktop,
|
||||||
DeviceType.WindowsDesktop,
|
DeviceType.WindowsDesktop,
|
||||||
DeviceType.UWP,
|
DeviceType.UWP
|
||||||
|
];
|
||||||
|
|
||||||
|
public static IReadOnlyCollection<DeviceType> CliTypes { get; } =
|
||||||
|
[
|
||||||
DeviceType.WindowsCLI,
|
DeviceType.WindowsCLI,
|
||||||
DeviceType.MacOsCLI,
|
DeviceType.MacOsCLI,
|
||||||
DeviceType.LinuxCLI
|
DeviceType.LinuxCLI
|
||||||
@ -50,6 +54,7 @@ public static class DeviceTypes
|
|||||||
{
|
{
|
||||||
not null when MobileTypes.Contains(deviceType.Value) => ClientType.Mobile,
|
not null when MobileTypes.Contains(deviceType.Value) => ClientType.Mobile,
|
||||||
not null when DesktopTypes.Contains(deviceType.Value) => ClientType.Desktop,
|
not null when DesktopTypes.Contains(deviceType.Value) => ClientType.Desktop,
|
||||||
|
not null when CliTypes.Contains(deviceType.Value) => ClientType.Cli,
|
||||||
not null when BrowserExtensionTypes.Contains(deviceType.Value) => ClientType.Browser,
|
not null when BrowserExtensionTypes.Contains(deviceType.Value) => ClientType.Browser,
|
||||||
not null when BrowserTypes.Contains(deviceType.Value) => ClientType.Web,
|
not null when BrowserTypes.Contains(deviceType.Value) => ClientType.Web,
|
||||||
_ => ClientType.All
|
_ => ClientType.All
|
||||||
|
Loading…
x
Reference in New Issue
Block a user