1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05: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

@ -128,7 +128,7 @@ public class ClientStore : IClientStore
Claims = new List<ClientClaim>
{
new(JwtClaimTypes.Subject, apiKey.ServiceAccountId.ToString()),
new(Claims.Type, ClientType.ServiceAccount.ToString()),
new(Claims.Type, IdentityClientType.ServiceAccount.ToString()),
},
};
@ -160,7 +160,7 @@ public class ClientStore : IClientStore
{
new(JwtClaimTypes.Subject, user.Id.ToString()),
new(JwtClaimTypes.AuthenticationMethod, "Application", "external"),
new(Claims.Type, ClientType.User.ToString()),
new(Claims.Type, IdentityClientType.User.ToString()),
};
var orgs = await _currentContext.OrganizationMembershipAsync(_organizationUserRepository, user.Id);
var providers = await _currentContext.ProviderMembershipAsync(_providerUserRepository, user.Id);
@ -218,7 +218,7 @@ public class ClientStore : IClientStore
Claims = new List<ClientClaim>
{
new(JwtClaimTypes.Subject, org.Id.ToString()),
new(Claims.Type, ClientType.Organization.ToString()),
new(Claims.Type, IdentityClientType.Organization.ToString()),
},
};
}