mirror of
https://github.com/bitwarden/server.git
synced 2025-04-06 21:48:12 -05:00
Initial stubbing out of the phishing service
This commit is contained in:
parent
ac25ec4519
commit
9a6d0e93f8
@ -177,6 +177,7 @@ public class Startup
|
|||||||
services.AddBillingOperations();
|
services.AddBillingOperations();
|
||||||
services.AddReportingServices();
|
services.AddReportingServices();
|
||||||
services.AddImportServices();
|
services.AddImportServices();
|
||||||
|
services.AddPhishingDomainService();
|
||||||
|
|
||||||
// Authorization Handlers
|
// Authorization Handlers
|
||||||
services.AddAuthorizationHandlers();
|
services.AddAuthorizationHandlers();
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using Bit.Api.Vault.AuthorizationHandlers.Collections;
|
using Bit.Api.Vault.AuthorizationHandlers.Collections;
|
||||||
using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Authorization;
|
using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Authorization;
|
||||||
using Bit.Core.IdentityServer;
|
using Bit.Core.IdentityServer;
|
||||||
|
using Bit.Core.Services;
|
||||||
using Bit.Core.Settings;
|
using Bit.Core.Settings;
|
||||||
using Bit.Core.Utilities;
|
using Bit.Core.Utilities;
|
||||||
using Bit.Core.Vault.Authorization.SecurityTasks;
|
using Bit.Core.Vault.Authorization.SecurityTasks;
|
||||||
@ -106,4 +107,9 @@ public static class ServiceCollectionExtensions
|
|||||||
services.AddScoped<IAuthorizationHandler, SecurityTaskAuthorizationHandler>();
|
services.AddScoped<IAuthorizationHandler, SecurityTaskAuthorizationHandler>();
|
||||||
services.AddScoped<IAuthorizationHandler, SecurityTaskOrganizationAuthorizationHandler>();
|
services.AddScoped<IAuthorizationHandler, SecurityTaskOrganizationAuthorizationHandler>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void AddPhishingDomainService(this IServiceCollection services)
|
||||||
|
{
|
||||||
|
services.AddSingleton<IPhishingDomainService, PhishingDomainService>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
6
src/Core/Services/IPhishingDomainService.cs
Normal file
6
src/Core/Services/IPhishingDomainService.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace Bit.Core.Services;
|
||||||
|
|
||||||
|
public interface IPhishingDomainService
|
||||||
|
{
|
||||||
|
Task<IEnumerable<string>> GetPhishingDomainsAsync();
|
||||||
|
}
|
13
src/Core/Services/Implementations/PhishingDomainService.cs
Normal file
13
src/Core/Services/Implementations/PhishingDomainService.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using System.Collections.Concurrent;
|
||||||
|
|
||||||
|
namespace Bit.Core.Services;
|
||||||
|
|
||||||
|
public class PhishingDomainService : IPhishingDomainService
|
||||||
|
{
|
||||||
|
private readonly ConcurrentDictionary<string, byte> _phishingDomains = new();
|
||||||
|
|
||||||
|
public Task<IEnumerable<string>> GetPhishingDomainsAsync()
|
||||||
|
{
|
||||||
|
return Task.FromResult(_phishingDomains.Keys.AsEnumerable());
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user