mirror of
https://github.com/bitwarden/server.git
synced 2025-05-21 03:24:31 -05:00
Rename services implementations
This commit is contained in:
parent
bfb98131e5
commit
63243eddc6
@ -133,12 +133,12 @@ namespace Bit.Api
|
|||||||
services.AddScoped<AuthenticatorTokenProvider>();
|
services.AddScoped<AuthenticatorTokenProvider>();
|
||||||
|
|
||||||
// Services
|
// Services
|
||||||
services.AddSingleton<IMailService, MailService>();
|
services.AddSingleton<IMailService, SendGridMailService>();
|
||||||
services.AddSingleton<ICipherService, CipherService>();
|
services.AddSingleton<ICipherService, CipherService>();
|
||||||
services.AddScoped<IUserService, UserService>();
|
services.AddScoped<IUserService, UserService>();
|
||||||
services.AddScoped<IPushService, PushService>();
|
services.AddScoped<IPushService, PushSharpPushService>();
|
||||||
services.AddScoped<IDeviceService, DeviceService>();
|
services.AddScoped<IDeviceService, DeviceService>();
|
||||||
services.AddScoped<IBlockIpService, AzureBlockIpService>();
|
services.AddScoped<IBlockIpService, AzureQueueBlockIpService>();
|
||||||
|
|
||||||
// Cors
|
// Cors
|
||||||
services.AddCors(config =>
|
services.AddCors(config =>
|
||||||
|
@ -5,12 +5,12 @@ using System;
|
|||||||
|
|
||||||
namespace Bit.Core.Services
|
namespace Bit.Core.Services
|
||||||
{
|
{
|
||||||
public class AzureBlockIpService : IBlockIpService
|
public class AzureQueueBlockIpService : IBlockIpService
|
||||||
{
|
{
|
||||||
private readonly CloudQueue _blockIpQueue;
|
private readonly CloudQueue _blockIpQueue;
|
||||||
private readonly CloudQueue _unblockIpQueue;
|
private readonly CloudQueue _unblockIpQueue;
|
||||||
|
|
||||||
public AzureBlockIpService(
|
public AzureQueueBlockIpService(
|
||||||
GlobalSettings globalSettings)
|
GlobalSettings globalSettings)
|
||||||
{
|
{
|
||||||
var storageAccount = CloudStorageAccount.Parse(globalSettings.Storage.ConnectionString);
|
var storageAccount = CloudStorageAccount.Parse(globalSettings.Storage.ConnectionString);
|
13
src/Core/Services/Implementations/NoopBlockIpService.cs
Normal file
13
src/Core/Services/Implementations/NoopBlockIpService.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Bit.Core.Services
|
||||||
|
{
|
||||||
|
public class NoopBlockIpService : IBlockIpService
|
||||||
|
{
|
||||||
|
public Task BlockIpAsync(string ipAddress, bool permanentBlock)
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
return Task.FromResult(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,7 @@ using System.Diagnostics;
|
|||||||
|
|
||||||
namespace Bit.Core.Services
|
namespace Bit.Core.Services
|
||||||
{
|
{
|
||||||
public class PushService : IPushService
|
public class PushSharpPushService : IPushService
|
||||||
{
|
{
|
||||||
private readonly IDeviceRepository _deviceRepository;
|
private readonly IDeviceRepository _deviceRepository;
|
||||||
private readonly ILogger<IPushService> _logger;
|
private readonly ILogger<IPushService> _logger;
|
||||||
@ -26,7 +26,7 @@ namespace Bit.Core.Services
|
|||||||
private GcmServiceBroker _gcmBroker;
|
private GcmServiceBroker _gcmBroker;
|
||||||
private ApnsServiceBroker _apnsBroker;
|
private ApnsServiceBroker _apnsBroker;
|
||||||
|
|
||||||
public PushService(
|
public PushSharpPushService(
|
||||||
IDeviceRepository deviceRepository,
|
IDeviceRepository deviceRepository,
|
||||||
ILogger<IPushService> logger,
|
ILogger<IPushService> logger,
|
||||||
CurrentContext currentContext,
|
CurrentContext currentContext,
|
@ -7,7 +7,7 @@ using SendGrid;
|
|||||||
|
|
||||||
namespace Bit.Core.Services
|
namespace Bit.Core.Services
|
||||||
{
|
{
|
||||||
public class MailService : IMailService
|
public class SendGridMailService : IMailService
|
||||||
{
|
{
|
||||||
private const string WelcomeTemplateId = "045f8ad5-5547-4fa2-8d3d-6d46e401164d";
|
private const string WelcomeTemplateId = "045f8ad5-5547-4fa2-8d3d-6d46e401164d";
|
||||||
private const string ChangeEmailAlreadyExistsTemplateId = "b69d2038-6ad9-4cf6-8f7f-7880921cba43";
|
private const string ChangeEmailAlreadyExistsTemplateId = "b69d2038-6ad9-4cf6-8f7f-7880921cba43";
|
||||||
@ -21,7 +21,7 @@ namespace Bit.Core.Services
|
|||||||
private readonly GlobalSettings _globalSettings;
|
private readonly GlobalSettings _globalSettings;
|
||||||
private readonly Web _web;
|
private readonly Web _web;
|
||||||
|
|
||||||
public MailService(GlobalSettings globalSettings)
|
public SendGridMailService(GlobalSettings globalSettings)
|
||||||
{
|
{
|
||||||
_globalSettings = globalSettings;
|
_globalSettings = globalSettings;
|
||||||
_web = new Web(_globalSettings.Mail.ApiKey);
|
_web = new Web(_globalSettings.Mail.ApiKey);
|
Loading…
x
Reference in New Issue
Block a user