From 1b080ae5c7ee66b00addbec5e21ec5c8b2adc314 Mon Sep 17 00:00:00 2001 From: max Date: Sun, 1 Dec 2024 16:52:53 +0100 Subject: [PATCH] Deleted authentication package (later implementation) --- .../BasedAuthenticationBuilder.cs | 16 --------- .../BasedAuthenticationExtensions.cs | 34 ------------------- .../BasedAuthenticationStateProvider.cs | 11 ------ .../AuthenticationConfiguration.cs | 9 ----- .../Configuration/CacheConfiguration.cs | 6 ---- .../Configuration/LockoutConfiguration.cs | 6 ---- .../Configuration/PasswordConfiguration.cs | 6 ---- .../Configuration/UserConfiguration.cs | 6 ---- .../DotBased.ASP.Authentication.csproj | 17 ---------- .../Providers/IStateProvider.cs | 6 ---- .../Repositories/IAttributeRepository.cs | 6 ---- .../Repositories/IAuthenticationRepository.cs | 6 ---- .../Repositories/IGroupRepository.cs | 6 ---- .../Repositories/IRoleRepository.cs | 6 ---- .../Repositories/ISessionRepository.cs | 6 ---- .../Repositories/IUserRepository.cs | 6 ---- .../Repositories/RepositoryBase.cs | 6 ---- .../SecurityManager.cs | 17 ---------- 18 files changed, 176 deletions(-) delete mode 100644 DotBased.ASP.Authentication/BasedAuthenticationBuilder.cs delete mode 100644 DotBased.ASP.Authentication/BasedAuthenticationExtensions.cs delete mode 100644 DotBased.ASP.Authentication/BasedAuthenticationStateProvider.cs delete mode 100644 DotBased.ASP.Authentication/Configuration/AuthenticationConfiguration.cs delete mode 100644 DotBased.ASP.Authentication/Configuration/CacheConfiguration.cs delete mode 100644 DotBased.ASP.Authentication/Configuration/LockoutConfiguration.cs delete mode 100644 DotBased.ASP.Authentication/Configuration/PasswordConfiguration.cs delete mode 100644 DotBased.ASP.Authentication/Configuration/UserConfiguration.cs delete mode 100644 DotBased.ASP.Authentication/DotBased.ASP.Authentication.csproj delete mode 100644 DotBased.ASP.Authentication/Providers/IStateProvider.cs delete mode 100644 DotBased.ASP.Authentication/Repositories/IAttributeRepository.cs delete mode 100644 DotBased.ASP.Authentication/Repositories/IAuthenticationRepository.cs delete mode 100644 DotBased.ASP.Authentication/Repositories/IGroupRepository.cs delete mode 100644 DotBased.ASP.Authentication/Repositories/IRoleRepository.cs delete mode 100644 DotBased.ASP.Authentication/Repositories/ISessionRepository.cs delete mode 100644 DotBased.ASP.Authentication/Repositories/IUserRepository.cs delete mode 100644 DotBased.ASP.Authentication/Repositories/RepositoryBase.cs delete mode 100644 DotBased.ASP.Authentication/SecurityManager.cs diff --git a/DotBased.ASP.Authentication/BasedAuthenticationBuilder.cs b/DotBased.ASP.Authentication/BasedAuthenticationBuilder.cs deleted file mode 100644 index fe65321..0000000 --- a/DotBased.ASP.Authentication/BasedAuthenticationBuilder.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace DotBased.ASP.Authentication; - -public class BasedAuthenticationBuilder -{ - public BasedAuthenticationBuilder(Type authRepository) - { - if (authRepository.IsValueType) - { - throw new ArgumentException("Type cannot be a value type!", nameof(authRepository)); - } - - AuthenticationRepositoryType = authRepository; - } - - public Type AuthenticationRepositoryType { get; } -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/BasedAuthenticationExtensions.cs b/DotBased.ASP.Authentication/BasedAuthenticationExtensions.cs deleted file mode 100644 index e1cbf38..0000000 --- a/DotBased.ASP.Authentication/BasedAuthenticationExtensions.cs +++ /dev/null @@ -1,34 +0,0 @@ -using DotBased.ASP.Authentication.Configuration; -using DotBased.ASP.Authentication.Repositories; -using Microsoft.Extensions.DependencyInjection; - -namespace DotBased.ASP.Authentication; - -public static class BasedAuthenticationExtensions -{ - public static BasedAuthenticationBuilder AddBasedAuthentication(this IServiceCollection services, Action? configurationAction) - { - /* - * Add services - * - Validators - * - Managers - * - Services - */ - if (configurationAction != null) - { - services.Configure(configurationAction); - } - - return new BasedAuthenticationBuilder(typeof(BasedAuthenticationBuilder)); - } - - public static BasedAuthenticationBuilder AddRepository(this BasedAuthenticationBuilder builder) - { - return builder; - } - - public static BasedAuthenticationBuilder SeedData(this BasedAuthenticationBuilder builder, Action seeder) where TRepository : RepositoryBase - { - return builder; - } -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/BasedAuthenticationStateProvider.cs b/DotBased.ASP.Authentication/BasedAuthenticationStateProvider.cs deleted file mode 100644 index 9cf1969..0000000 --- a/DotBased.ASP.Authentication/BasedAuthenticationStateProvider.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Microsoft.AspNetCore.Components.Authorization; - -namespace DotBased.ASP.Authentication; - -public class BasedAuthenticationStateProvider : AuthenticationStateProvider -{ - public override async Task GetAuthenticationStateAsync() - { - throw new NotImplementedException(); - } -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/Configuration/AuthenticationConfiguration.cs b/DotBased.ASP.Authentication/Configuration/AuthenticationConfiguration.cs deleted file mode 100644 index 8ff6f8a..0000000 --- a/DotBased.ASP.Authentication/Configuration/AuthenticationConfiguration.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace DotBased.ASP.Authentication.Configuration; - -public class AuthenticationConfiguration -{ - public CacheConfiguration Cache { get; set; } = new(); - public LockoutConfiguration Lockout { get; set; } = new(); - public PasswordConfiguration Password { get; set; } = new(); - public UserConfiguration User { get; set; } = new(); -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/Configuration/CacheConfiguration.cs b/DotBased.ASP.Authentication/Configuration/CacheConfiguration.cs deleted file mode 100644 index 9aa2d8e..0000000 --- a/DotBased.ASP.Authentication/Configuration/CacheConfiguration.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace DotBased.ASP.Authentication.Configuration; - -public class CacheConfiguration -{ - -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/Configuration/LockoutConfiguration.cs b/DotBased.ASP.Authentication/Configuration/LockoutConfiguration.cs deleted file mode 100644 index ac83a60..0000000 --- a/DotBased.ASP.Authentication/Configuration/LockoutConfiguration.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace DotBased.ASP.Authentication.Configuration; - -public class LockoutConfiguration -{ - -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/Configuration/PasswordConfiguration.cs b/DotBased.ASP.Authentication/Configuration/PasswordConfiguration.cs deleted file mode 100644 index acfa7eb..0000000 --- a/DotBased.ASP.Authentication/Configuration/PasswordConfiguration.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace DotBased.ASP.Authentication.Configuration; - -public class PasswordConfiguration -{ - -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/Configuration/UserConfiguration.cs b/DotBased.ASP.Authentication/Configuration/UserConfiguration.cs deleted file mode 100644 index c98ca99..0000000 --- a/DotBased.ASP.Authentication/Configuration/UserConfiguration.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace DotBased.ASP.Authentication.Configuration; - -public class UserConfiguration -{ - -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/DotBased.ASP.Authentication.csproj b/DotBased.ASP.Authentication/DotBased.ASP.Authentication.csproj deleted file mode 100644 index 85639a9..0000000 --- a/DotBased.ASP.Authentication/DotBased.ASP.Authentication.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - - - - - diff --git a/DotBased.ASP.Authentication/Providers/IStateProvider.cs b/DotBased.ASP.Authentication/Providers/IStateProvider.cs deleted file mode 100644 index a561af8..0000000 --- a/DotBased.ASP.Authentication/Providers/IStateProvider.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace DotBased.ASP.Authentication.Providers; - -public interface IStateProvider -{ - -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/Repositories/IAttributeRepository.cs b/DotBased.ASP.Authentication/Repositories/IAttributeRepository.cs deleted file mode 100644 index 1899714..0000000 --- a/DotBased.ASP.Authentication/Repositories/IAttributeRepository.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace DotBased.ASP.Authentication.Repositories; - -public interface IAttributeRepository -{ - -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/Repositories/IAuthenticationRepository.cs b/DotBased.ASP.Authentication/Repositories/IAuthenticationRepository.cs deleted file mode 100644 index 6e71768..0000000 --- a/DotBased.ASP.Authentication/Repositories/IAuthenticationRepository.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace DotBased.ASP.Authentication.Repositories; - -public interface IAuthenticationRepository -{ - -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/Repositories/IGroupRepository.cs b/DotBased.ASP.Authentication/Repositories/IGroupRepository.cs deleted file mode 100644 index 67b0772..0000000 --- a/DotBased.ASP.Authentication/Repositories/IGroupRepository.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace DotBased.ASP.Authentication.Repositories; - -public interface IGroupRepository -{ - -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/Repositories/IRoleRepository.cs b/DotBased.ASP.Authentication/Repositories/IRoleRepository.cs deleted file mode 100644 index bbe4dbf..0000000 --- a/DotBased.ASP.Authentication/Repositories/IRoleRepository.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace DotBased.ASP.Authentication.Repositories; - -public interface IRoleRepository -{ - -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/Repositories/ISessionRepository.cs b/DotBased.ASP.Authentication/Repositories/ISessionRepository.cs deleted file mode 100644 index 114183f..0000000 --- a/DotBased.ASP.Authentication/Repositories/ISessionRepository.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace DotBased.ASP.Authentication.Repositories; - -public interface ISessionRepository -{ - -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/Repositories/IUserRepository.cs b/DotBased.ASP.Authentication/Repositories/IUserRepository.cs deleted file mode 100644 index 867cf90..0000000 --- a/DotBased.ASP.Authentication/Repositories/IUserRepository.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace DotBased.ASP.Authentication.Repositories; - -public interface IUserRepository -{ - -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/Repositories/RepositoryBase.cs b/DotBased.ASP.Authentication/Repositories/RepositoryBase.cs deleted file mode 100644 index bad4fe7..0000000 --- a/DotBased.ASP.Authentication/Repositories/RepositoryBase.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace DotBased.ASP.Authentication.Repositories; - -public abstract class RepositoryBase : IAuthenticationRepository, IAttributeRepository, IGroupRepository, ISessionRepository, IUserRepository -{ - -} \ No newline at end of file diff --git a/DotBased.ASP.Authentication/SecurityManager.cs b/DotBased.ASP.Authentication/SecurityManager.cs deleted file mode 100644 index b19b93d..0000000 --- a/DotBased.ASP.Authentication/SecurityManager.cs +++ /dev/null @@ -1,17 +0,0 @@ -using DotBased.ASP.Authentication.Configuration; -using DotBased.Logging; -using Microsoft.Extensions.Options; - -namespace DotBased.ASP.Authentication; - -public class SecurityManager -{ - public SecurityManager(IServiceProvider services, IOptions? config) - { - _services = services; - Configuration = config?.Value ?? new AuthenticationConfiguration(); - } - private ILogger _logger = LogService.RegisterLogger(); - private IServiceProvider _services; - public AuthenticationConfiguration Configuration { get; set; } -} \ No newline at end of file