1
0
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:
Todd Martin 2025-04-01 10:06:30 -04:00 committed by GitHub
parent 0ca1b319fd
commit 1beb5dc5c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -14,5 +14,7 @@ public enum ClientType : byte
[Display(Name = "Desktop App")]
Desktop = 3,
[Display(Name = "Mobile App")]
Mobile = 4
Mobile = 4,
[Display(Name = "CLI")]
Cli = 5
}

View File

@ -16,7 +16,11 @@ public static class DeviceTypes
DeviceType.LinuxDesktop,
DeviceType.MacOsDesktop,
DeviceType.WindowsDesktop,
DeviceType.UWP,
DeviceType.UWP
];
public static IReadOnlyCollection<DeviceType> CliTypes { get; } =
[
DeviceType.WindowsCLI,
DeviceType.MacOsCLI,
DeviceType.LinuxCLI
@ -50,6 +54,7 @@ public static class DeviceTypes
{
not null when MobileTypes.Contains(deviceType.Value) => ClientType.Mobile,
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 BrowserTypes.Contains(deviceType.Value) => ClientType.Web,
_ => ClientType.All