mirror of
https://github.com/bitwarden/server.git
synced 2025-12-10 00:42:07 -06:00
* add metrics endpoint for an organization to return completed and total security tasks * refactor metrics fetch to use sql sproc for efficiency rather than having to pull all security task data * add separate response model for security task metrics endpoint * Pascal Case to match existing implementations * refactor org to organization for consistency with other methods * alter security task endpoint: - remove "count" from variable naming - update sproc naming * remove enablement check * replace orgId with organizationId
31 lines
1.4 KiB
C#
31 lines
1.4 KiB
C#
using Bit.Core.Vault.Commands;
|
|
using Bit.Core.Vault.Commands.Interfaces;
|
|
using Bit.Core.Vault.Queries;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Bit.Core.Vault;
|
|
|
|
public static class VaultServiceCollectionExtensions
|
|
{
|
|
public static IServiceCollection AddVaultServices(this IServiceCollection services)
|
|
{
|
|
services.AddVaultQueries();
|
|
|
|
return services;
|
|
}
|
|
|
|
private static void AddVaultQueries(this IServiceCollection services)
|
|
{
|
|
services.AddScoped<IOrganizationCiphersQuery, OrganizationCiphersQuery>();
|
|
services.AddScoped<IGetTaskDetailsForUserQuery, GetTaskDetailsForUserQuery>();
|
|
services.AddScoped<IMarkTaskAsCompleteCommand, MarkTaskAsCompletedCommand>();
|
|
services.AddScoped<IGetCipherPermissionsForUserQuery, GetCipherPermissionsForUserQuery>();
|
|
services.AddScoped<IGetTasksForOrganizationQuery, GetTasksForOrganizationQuery>();
|
|
services.AddScoped<IGetSecurityTasksNotificationDetailsQuery, GetSecurityTasksNotificationDetailsQuery>();
|
|
services.AddScoped<ICreateManyTaskNotificationsCommand, CreateManyTaskNotificationsCommand>();
|
|
services.AddScoped<ICreateManyTasksCommand, CreateManyTasksCommand>();
|
|
services.AddScoped<IMarkNotificationsForTaskAsDeletedCommand, MarkNotificationsForTaskAsDeletedCommand>();
|
|
services.AddScoped<IGetTaskMetricsForOrganizationQuery, GetTaskMetricsForOrganizationQuery>();
|
|
}
|
|
}
|