1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-20 02:48:03 -05:00

Move registration to core

This commit is contained in:
Bernd Schoolmann 2025-06-18 20:10:20 +02:00
parent 49c130f91f
commit 898fcba95f
No known key found for this signature in database
2 changed files with 9 additions and 15 deletions

View File

@ -1,14 +0,0 @@
using Bit.Api.KeyManagement.Queries.Interfaces;
using Bit.Core.KeyManagement.Queries;
namespace Bit.Api.KeyManagement;
#nullable enable
public static class Registrations
{
public static void AddKeyManagementQueries(this IServiceCollection services)
{
services.AddTransient<IUserAccountKeysQuery, UserAccountKeysQuery>();
}
}

View File

@ -1,5 +1,7 @@
using Bit.Core.KeyManagement.Commands; using Bit.Api.KeyManagement.Queries.Interfaces;
using Bit.Core.KeyManagement.Commands;
using Bit.Core.KeyManagement.Commands.Interfaces; using Bit.Core.KeyManagement.Commands.Interfaces;
using Bit.Core.KeyManagement.Queries;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Bit.Core.KeyManagement; namespace Bit.Core.KeyManagement;
@ -9,10 +11,16 @@ public static class KeyManagementServiceCollectionExtensions
public static void AddKeyManagementServices(this IServiceCollection services) public static void AddKeyManagementServices(this IServiceCollection services)
{ {
services.AddKeyManagementCommands(); services.AddKeyManagementCommands();
services.AddKeyManagementQueries();
} }
private static void AddKeyManagementCommands(this IServiceCollection services) private static void AddKeyManagementCommands(this IServiceCollection services)
{ {
services.AddScoped<IRegenerateUserAsymmetricKeysCommand, RegenerateUserAsymmetricKeysCommand>(); services.AddScoped<IRegenerateUserAsymmetricKeysCommand, RegenerateUserAsymmetricKeysCommand>();
} }
private static void AddKeyManagementQueries(this IServiceCollection services)
{
services.AddScoped<IUserAccountKeysQuery, UserAccountKeysQuery>();
}
} }