Release v1.0.0 #16
.envDbInitializer.csDependencyInjection.csPersistence.csprojUberDbContext.cs
.gitea/workflows
ApiDto
ApiDto.csproj
Common
Requests
Configuration
ScheduleRequest.csResponses
Application
Application.csprojDependencyInjection.cs
Backend.slnCommon
Behaviors
Exceptions
Mappings
Cqrs
Campus
Queries
Discipline
Queries
Faculty
Queries
Group
Queries
LectureHall
Queries
Professor
Queries
Schedule
Interfaces
Domain/Schedule
Campus.csDiscipline.csFaculty.csGroup.csLectureHall.csLesson.csLessonAssociation.csProfessor.csSpecificWeek.csTypeOfOccupation.cs
Endpoint
Common
Attributes
BadRequestResponseAttribute.csLocalhostAttribute.csMaintenanceModeIgnoreAttribute.csNotFoundResponseAttribute.csTokenAuthenticationAttribute.cs
Exceptions
Interfaces
Services
Configuration
EnvironmentManager.cs
General
Swagger
Controllers
BaseController.cs
Endpoint.csprojConfiguration
V1
CampusController.csDisciplineController.csFacultyController.csGroupController.csLectureHallController.csProfessorController.csScheduleController.cs
WeatherForecastController.csMiddleware
Program.csWeatherForecast.csPersistence
Contexts
Schedule
EntityTypeConfigurations
Schedule
Security
28
Security/DependencyInjection.cs
Normal file
28
Security/DependencyInjection.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Mirea.Api.Security;
|
||||
|
||||
public static class DependencyInjection
|
||||
{
|
||||
public static IServiceCollection AddApplicationServices(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
var saltSize = int.Parse(configuration["SECURITY_SALT_SIZE"]!);
|
||||
var hashSize = int.Parse(configuration["SECURITY_HASH_SIZE"]!);
|
||||
var iteration = int.Parse(configuration["SECURITY_HASH_ITERATION"]!);
|
||||
var memory = int.Parse(configuration["SECURITY_HASH_MEMORY"]!);
|
||||
var parallelism = int.Parse(configuration["SECURITY_HASH_PARALLELISM"]!);
|
||||
|
||||
services.AddSingleton(new PasswordHashService
|
||||
{
|
||||
SaltSize = saltSize,
|
||||
HashSize = hashSize,
|
||||
Iterations = iteration,
|
||||
Memory = memory,
|
||||
Parallelism = parallelism,
|
||||
Secret = configuration["SECURITY_HASH_TOKEN"]
|
||||
});
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user