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

PM-11123: Device Type mapping (#4768)

* PM-11123: Device Type mapping

* PM-11123: Moving ClientType out of NotificationCenter, naming clash with Identity ClientType

* PM-11123: Rename ClientType in ICurrentContext to match the type
This commit is contained in:
Maciej Zieniuk
2024-09-23 23:02:32 +02:00
committed by GitHub
parent e1bf8a9206
commit 9a5c6fe527
20 changed files with 89 additions and 52 deletions

View File

@@ -39,7 +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 ClientType ClientType { get; set; }
public virtual IdentityClientType IdentityClientType { get; set; }
public virtual Guid? ServiceAccountOrganizationId { get; set; }
public CurrentContext(
@@ -151,11 +151,11 @@ public class CurrentContext : ICurrentContext
var clientType = GetClaimValue(claimsDict, Claims.Type);
if (clientType != null)
{
Enum.TryParse(clientType, out ClientType c);
ClientType = c;
Enum.TryParse(clientType, out IdentityClientType c);
IdentityClientType = c;
}
if (ClientType == ClientType.ServiceAccount)
if (IdentityClientType == IdentityClientType.ServiceAccount)
{
ServiceAccountOrganizationId = new Guid(GetClaimValue(claimsDict, Claims.Organization));
}