21 lines
927 B
C#
21 lines
927 B
C#
namespace MxGateway.Server.Security.Authentication;
|
|
|
|
public static class AuthStoreServiceCollectionExtensions
|
|
{
|
|
public static IServiceCollection AddSqliteAuthStore(this IServiceCollection services)
|
|
{
|
|
services.AddSingleton<IApiKeyParser, ApiKeyParser>();
|
|
services.AddSingleton<IApiKeySecretHasher, ApiKeySecretHasher>();
|
|
services.AddSingleton<IApiKeyVerifier, ApiKeyVerifier>();
|
|
services.AddSingleton<ApiKeyAdminCliRunner>();
|
|
services.AddSingleton<AuthSqliteConnectionFactory>();
|
|
services.AddSingleton<IAuthStoreMigrator, SqliteAuthStoreMigrator>();
|
|
services.AddSingleton<IApiKeyStore, SqliteApiKeyStore>();
|
|
services.AddSingleton<IApiKeyAdminStore, SqliteApiKeyAdminStore>();
|
|
services.AddSingleton<IApiKeyAuditStore, SqliteApiKeyAuditStore>();
|
|
services.AddHostedService<AuthStoreMigrationHostedService>();
|
|
|
|
return services;
|
|
}
|
|
}
|