1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-22 02:51:33 +01:00

Rename services implementations

This commit is contained in:
Kyle Spearrin 2016-12-02 23:37:08 -05:00
parent bfb98131e5
commit 63243eddc6
5 changed files with 22 additions and 9 deletions

View File

@ -133,12 +133,12 @@ namespace Bit.Api
services.AddScoped<AuthenticatorTokenProvider>();
// Services
services.AddSingleton<IMailService, MailService>();
services.AddSingleton<IMailService, SendGridMailService>();
services.AddSingleton<ICipherService, CipherService>();
services.AddScoped<IUserService, UserService>();
services.AddScoped<IPushService, PushService>();
services.AddScoped<IPushService, PushSharpPushService>();
services.AddScoped<IDeviceService, DeviceService>();
services.AddScoped<IBlockIpService, AzureBlockIpService>();
services.AddScoped<IBlockIpService, AzureQueueBlockIpService>();
// Cors
services.AddCors(config =>

View File

@ -5,12 +5,12 @@ using System;
namespace Bit.Core.Services
{
public class AzureBlockIpService : IBlockIpService
public class AzureQueueBlockIpService : IBlockIpService
{
private readonly CloudQueue _blockIpQueue;
private readonly CloudQueue _unblockIpQueue;
public AzureBlockIpService(
public AzureQueueBlockIpService(
GlobalSettings globalSettings)
{
var storageAccount = CloudStorageAccount.Parse(globalSettings.Storage.ConnectionString);

View 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);
}
}
}

View File

@ -18,7 +18,7 @@ using System.Diagnostics;
namespace Bit.Core.Services
{
public class PushService : IPushService
public class PushSharpPushService : IPushService
{
private readonly IDeviceRepository _deviceRepository;
private readonly ILogger<IPushService> _logger;
@ -26,7 +26,7 @@ namespace Bit.Core.Services
private GcmServiceBroker _gcmBroker;
private ApnsServiceBroker _apnsBroker;
public PushService(
public PushSharpPushService(
IDeviceRepository deviceRepository,
ILogger<IPushService> logger,
CurrentContext currentContext,

View File

@ -7,7 +7,7 @@ using SendGrid;
namespace Bit.Core.Services
{
public class MailService : IMailService
public class SendGridMailService : IMailService
{
private const string WelcomeTemplateId = "045f8ad5-5547-4fa2-8d3d-6d46e401164d";
private const string ChangeEmailAlreadyExistsTemplateId = "b69d2038-6ad9-4cf6-8f7f-7880921cba43";
@ -21,7 +21,7 @@ namespace Bit.Core.Services
private readonly GlobalSettings _globalSettings;
private readonly Web _web;
public MailService(GlobalSettings globalSettings)
public SendGridMailService(GlobalSettings globalSettings)
{
_globalSettings = globalSettings;
_web = new Web(_globalSettings.Mail.ApiKey);