Reworked encryption to use less heap allocated buffers for secrets.
Also some work on plugin system.
This commit is contained in:
parent
8782ef39c6
commit
054754f553
42 changed files with 1452 additions and 242 deletions
38
IdentityShroud.Core/CoreServiceCollectionExtensions.cs
Normal file
38
IdentityShroud.Core/CoreServiceCollectionExtensions.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using IdentityShroud.Core.Contracts;
|
||||
using IdentityShroud.Core.EFCore;
|
||||
using IdentityShroud.Core.Security;
|
||||
using IdentityShroud.Core.Security.Keys;
|
||||
using IdentityShroud.Core.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace IdentityShroud.Core;
|
||||
|
||||
public static class CoreServiceCollectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddCore(this IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<Db>();
|
||||
|
||||
services.Scan(scan => scan
|
||||
.FromAssemblyOf<RealmService>()
|
||||
.AddClasses(classes => classes.AssignableTo<IJwtSigner>())
|
||||
.AsImplementedInterfaces()
|
||||
.WithSingletonLifetime());
|
||||
services.AddSingleton<IJwtSignerFactory, JwtSignerFactory>();
|
||||
|
||||
services.AddSingleton<IClock, ClockService>();
|
||||
services.AddSingleton<IDekEncryptionService, DekEncryptionService>();
|
||||
services.AddScoped<IDataEncryptionService, DataEncryptionService>();
|
||||
services.AddScoped<IRealmContext, RealmContext>();
|
||||
services.AddScoped<IKeyProviderFactory, KeyProviderFactory>();
|
||||
services.AddScoped<IKeyService, KeyService>();
|
||||
services.AddSingleton<ISecretProvider, ConfigurationSecretProvider>();
|
||||
|
||||
|
||||
services.AddScoped<IClientService, ClientService>();
|
||||
services.AddScoped<IRealmService, RealmService>();
|
||||
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue