pass AesProvider to session

This commit is contained in:
Timothy Schenk 2023-01-02 12:25:58 +01:00
parent 2a9f1bc244
commit 5f69b25950

View file

@ -7,18 +7,21 @@ using Microsoft.Extensions.Configuration;
public class AuthorizationServer : NetCoreServer.TcpServer
{
[Inject] private readonly ILogger _logger;
private readonly AesProvider _aesProvider;
private readonly ILogger _logger;
public AuthorizationServer(IConfiguration configuration, ILoggerFactory loggerFactory) : base(
public AuthorizationServer(IConfiguration configuration, ILoggerFactory loggerFactory, AesProvider aesProvider) : base(
configuration["auth:address"]!,
configuration.GetValue<int>("auth:port"))
{
_aesProvider = aesProvider;
_logger = loggerFactory.CreateLogger(nameof(AuthorizationServer));
}
protected override NetCoreServer.TcpSession CreateSession()
{
return null;
var session = new AuthorizationServerSession(this, _logger, _aesProvider);
return session;
}
protected override void OnStarting()