Deleted authentication package (later implementation)

This commit is contained in:
max 2024-12-01 16:52:53 +01:00
parent 4580c5f5dc
commit 1b080ae5c7
18 changed files with 0 additions and 176 deletions

View File

@ -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; }
}

View File

@ -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<AuthenticationConfiguration>? configurationAction)
{
/*
* Add services
* - Validators
* - Managers
* - Services
*/
if (configurationAction != null)
{
services.Configure(configurationAction);
}
return new BasedAuthenticationBuilder(typeof(BasedAuthenticationBuilder));
}
public static BasedAuthenticationBuilder AddRepository<TRepository>(this BasedAuthenticationBuilder builder)
{
return builder;
}
public static BasedAuthenticationBuilder SeedData<TRepository>(this BasedAuthenticationBuilder builder, Action<TRepository> seeder) where TRepository : RepositoryBase
{
return builder;
}
}

View File

@ -1,11 +0,0 @@
using Microsoft.AspNetCore.Components.Authorization;
namespace DotBased.ASP.Authentication;
public class BasedAuthenticationStateProvider : AuthenticationStateProvider
{
public override async Task<AuthenticationState> GetAuthenticationStateAsync()
{
throw new NotImplementedException();
}
}

View File

@ -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();
}

View File

@ -1,6 +0,0 @@
namespace DotBased.ASP.Authentication.Configuration;
public class CacheConfiguration
{
}

View File

@ -1,6 +0,0 @@
namespace DotBased.ASP.Authentication.Configuration;
public class LockoutConfiguration
{
}

View File

@ -1,6 +0,0 @@
namespace DotBased.ASP.Authentication.Configuration;
public class PasswordConfiguration
{
}

View File

@ -1,6 +0,0 @@
namespace DotBased.ASP.Authentication.Configuration;
public class UserConfiguration
{
}

View File

@ -1,17 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.11" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DotBased\DotBased.csproj" />
</ItemGroup>
</Project>

View File

@ -1,6 +0,0 @@
namespace DotBased.ASP.Authentication.Providers;
public interface IStateProvider
{
}

View File

@ -1,6 +0,0 @@
namespace DotBased.ASP.Authentication.Repositories;
public interface IAttributeRepository
{
}

View File

@ -1,6 +0,0 @@
namespace DotBased.ASP.Authentication.Repositories;
public interface IAuthenticationRepository
{
}

View File

@ -1,6 +0,0 @@
namespace DotBased.ASP.Authentication.Repositories;
public interface IGroupRepository
{
}

View File

@ -1,6 +0,0 @@
namespace DotBased.ASP.Authentication.Repositories;
public interface IRoleRepository
{
}

View File

@ -1,6 +0,0 @@
namespace DotBased.ASP.Authentication.Repositories;
public interface ISessionRepository
{
}

View File

@ -1,6 +0,0 @@
namespace DotBased.ASP.Authentication.Repositories;
public interface IUserRepository
{
}

View File

@ -1,6 +0,0 @@
namespace DotBased.ASP.Authentication.Repositories;
public abstract class RepositoryBase : IAuthenticationRepository, IAttributeRepository, IGroupRepository, ISessionRepository, IUserRepository
{
}

View File

@ -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<AuthenticationConfiguration>? config)
{
_services = services;
Configuration = config?.Value ?? new AuthenticationConfiguration();
}
private ILogger _logger = LogService.RegisterLogger<SecurityManager>();
private IServiceProvider _services;
public AuthenticationConfiguration Configuration { get; set; }
}