mirror of
https://github.com/bitwarden/server.git
synced 2025-07-05 10:02:47 -05:00
Run formatting (#2230)
This commit is contained in:
@ -13,65 +13,64 @@ using Bit.Core.Tokens;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Bit.Core.OrganizationFeatures
|
||||
namespace Bit.Core.OrganizationFeatures;
|
||||
|
||||
public static class OrganizationServiceCollectionExtensions
|
||||
{
|
||||
public static class OrganizationServiceCollectionExtensions
|
||||
public static void AddOrganizationServices(this IServiceCollection services, IGlobalSettings globalSettings)
|
||||
{
|
||||
public static void AddOrganizationServices(this IServiceCollection services, IGlobalSettings globalSettings)
|
||||
{
|
||||
services.AddScoped<IOrganizationService, OrganizationService>();
|
||||
services.AddTokenizers();
|
||||
services.AddOrganizationConnectionCommands();
|
||||
services.AddOrganizationSponsorshipCommands(globalSettings);
|
||||
services.AddOrganizationApiKeyCommands();
|
||||
}
|
||||
services.AddScoped<IOrganizationService, OrganizationService>();
|
||||
services.AddTokenizers();
|
||||
services.AddOrganizationConnectionCommands();
|
||||
services.AddOrganizationSponsorshipCommands(globalSettings);
|
||||
services.AddOrganizationApiKeyCommands();
|
||||
}
|
||||
|
||||
private static void AddOrganizationConnectionCommands(this IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<ICreateOrganizationConnectionCommand, CreateOrganizationConnectionCommand>();
|
||||
services.AddScoped<IDeleteOrganizationConnectionCommand, DeleteOrganizationConnectionCommand>();
|
||||
services.AddScoped<IUpdateOrganizationConnectionCommand, UpdateOrganizationConnectionCommand>();
|
||||
}
|
||||
private static void AddOrganizationConnectionCommands(this IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<ICreateOrganizationConnectionCommand, CreateOrganizationConnectionCommand>();
|
||||
services.AddScoped<IDeleteOrganizationConnectionCommand, DeleteOrganizationConnectionCommand>();
|
||||
services.AddScoped<IUpdateOrganizationConnectionCommand, UpdateOrganizationConnectionCommand>();
|
||||
}
|
||||
|
||||
private static void AddOrganizationSponsorshipCommands(this IServiceCollection services, IGlobalSettings globalSettings)
|
||||
private static void AddOrganizationSponsorshipCommands(this IServiceCollection services, IGlobalSettings globalSettings)
|
||||
{
|
||||
services.AddScoped<ICreateSponsorshipCommand, CreateSponsorshipCommand>();
|
||||
services.AddScoped<IRemoveSponsorshipCommand, RemoveSponsorshipCommand>();
|
||||
services.AddScoped<ISendSponsorshipOfferCommand, SendSponsorshipOfferCommand>();
|
||||
services.AddScoped<ISetUpSponsorshipCommand, SetUpSponsorshipCommand>();
|
||||
services.AddScoped<IValidateRedemptionTokenCommand, ValidateRedemptionTokenCommand>();
|
||||
services.AddScoped<IValidateSponsorshipCommand, ValidateSponsorshipCommand>();
|
||||
services.AddScoped<IValidateBillingSyncKeyCommand, ValidateBillingSyncKeyCommand>();
|
||||
services.AddScoped<IOrganizationSponsorshipRenewCommand, OrganizationSponsorshipRenewCommand>();
|
||||
services.AddScoped<ICloudSyncSponsorshipsCommand, CloudSyncSponsorshipsCommand>();
|
||||
services.AddScoped<ISelfHostedSyncSponsorshipsCommand, SelfHostedSyncSponsorshipsCommand>();
|
||||
services.AddScoped<ISelfHostedSyncSponsorshipsCommand, SelfHostedSyncSponsorshipsCommand>();
|
||||
services.AddScoped<ICloudSyncSponsorshipsCommand, CloudSyncSponsorshipsCommand>();
|
||||
services.AddScoped<IValidateBillingSyncKeyCommand, ValidateBillingSyncKeyCommand>();
|
||||
if (globalSettings.SelfHosted)
|
||||
{
|
||||
services.AddScoped<ICreateSponsorshipCommand, CreateSponsorshipCommand>();
|
||||
services.AddScoped<IRemoveSponsorshipCommand, RemoveSponsorshipCommand>();
|
||||
services.AddScoped<ISendSponsorshipOfferCommand, SendSponsorshipOfferCommand>();
|
||||
services.AddScoped<ISetUpSponsorshipCommand, SetUpSponsorshipCommand>();
|
||||
services.AddScoped<IValidateRedemptionTokenCommand, ValidateRedemptionTokenCommand>();
|
||||
services.AddScoped<IValidateSponsorshipCommand, ValidateSponsorshipCommand>();
|
||||
services.AddScoped<IValidateBillingSyncKeyCommand, ValidateBillingSyncKeyCommand>();
|
||||
services.AddScoped<IOrganizationSponsorshipRenewCommand, OrganizationSponsorshipRenewCommand>();
|
||||
services.AddScoped<ICloudSyncSponsorshipsCommand, CloudSyncSponsorshipsCommand>();
|
||||
services.AddScoped<ISelfHostedSyncSponsorshipsCommand, SelfHostedSyncSponsorshipsCommand>();
|
||||
services.AddScoped<ISelfHostedSyncSponsorshipsCommand, SelfHostedSyncSponsorshipsCommand>();
|
||||
services.AddScoped<ICloudSyncSponsorshipsCommand, CloudSyncSponsorshipsCommand>();
|
||||
services.AddScoped<IValidateBillingSyncKeyCommand, ValidateBillingSyncKeyCommand>();
|
||||
if (globalSettings.SelfHosted)
|
||||
{
|
||||
services.AddScoped<IRevokeSponsorshipCommand, SelfHostedRevokeSponsorshipCommand>();
|
||||
}
|
||||
else
|
||||
{
|
||||
services.AddScoped<IRevokeSponsorshipCommand, CloudRevokeSponsorshipCommand>();
|
||||
}
|
||||
services.AddScoped<IRevokeSponsorshipCommand, SelfHostedRevokeSponsorshipCommand>();
|
||||
}
|
||||
|
||||
private static void AddOrganizationApiKeyCommands(this IServiceCollection services)
|
||||
else
|
||||
{
|
||||
services.AddScoped<IGetOrganizationApiKeyCommand, GetOrganizationApiKeyCommand>();
|
||||
services.AddScoped<IRotateOrganizationApiKeyCommand, RotateOrganizationApiKeyCommand>();
|
||||
}
|
||||
|
||||
private static void AddTokenizers(this IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton<IDataProtectorTokenFactory<OrganizationSponsorshipOfferTokenable>>(serviceProvider =>
|
||||
new DataProtectorTokenFactory<OrganizationSponsorshipOfferTokenable>(
|
||||
OrganizationSponsorshipOfferTokenable.ClearTextPrefix,
|
||||
OrganizationSponsorshipOfferTokenable.DataProtectorPurpose,
|
||||
serviceProvider.GetDataProtectionProvider())
|
||||
);
|
||||
services.AddScoped<IRevokeSponsorshipCommand, CloudRevokeSponsorshipCommand>();
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddOrganizationApiKeyCommands(this IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<IGetOrganizationApiKeyCommand, GetOrganizationApiKeyCommand>();
|
||||
services.AddScoped<IRotateOrganizationApiKeyCommand, RotateOrganizationApiKeyCommand>();
|
||||
}
|
||||
|
||||
private static void AddTokenizers(this IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton<IDataProtectorTokenFactory<OrganizationSponsorshipOfferTokenable>>(serviceProvider =>
|
||||
new DataProtectorTokenFactory<OrganizationSponsorshipOfferTokenable>(
|
||||
OrganizationSponsorshipOfferTokenable.ClearTextPrefix,
|
||||
OrganizationSponsorshipOfferTokenable.DataProtectorPurpose,
|
||||
serviceProvider.GetDataProtectionProvider())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user