whitelist fixes, grpc stream fixes
This commit is contained in:
@@ -176,7 +176,13 @@ public class SecretKeyAuthenticationHandler
|
||||
this.metrics = metrics;
|
||||
var config = configuration.GetRequiredSection("MareSynchronos");
|
||||
_failedAttemptsForTempBan = config.GetValue<int>("FailedAuthForTempBan", 5);
|
||||
logger.LogInformation("FailedAuthForTempBan: {num}", _failedAttemptsForTempBan);
|
||||
_tempBanMinutes = config.GetValue<int>("TempBanDurationInMinutes", 30);
|
||||
_whitelistedIps = config.GetValue<List<string>>("WhitelistedIps", new List<string>());
|
||||
logger.LogInformation("TempBanMinutes: {num}", _tempBanMinutes);
|
||||
_whitelistedIps = config.GetSection("WhitelistedIps").Get<List<string>>();
|
||||
foreach (var ip in _whitelistedIps)
|
||||
{
|
||||
logger.LogInformation("Whitelisted IP: " + ip);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ internal class IdentityService : IdentificationService.IdentificationServiceBase
|
||||
_handler.RegisterServerForQueue(server.ServerId);
|
||||
_logger.LogInformation("Registered Server " + server.ServerId + " input stream");
|
||||
|
||||
while (await requestStream.MoveNext().ConfigureAwait(false))
|
||||
while (await requestStream.MoveNext(context.CancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
var cur = requestStream.Current.IdentChange;
|
||||
if (cur == null) throw new System.Exception("Expected client ident change");
|
||||
|
||||
@@ -44,11 +44,11 @@ public class Startup
|
||||
MetricsAPI.GaugeUsersRegistered
|
||||
}));
|
||||
|
||||
services.AddTransient(_ => Configuration);
|
||||
services.AddSingleton<SecretKeyAuthenticationHandler>();
|
||||
services.AddSingleton<DiscordBotServices>();
|
||||
services.AddSingleton<IdentityHandler>();
|
||||
services.AddSingleton<CleanupService>();
|
||||
services.AddTransient(_ => Configuration);
|
||||
services.AddHostedService(provider => provider.GetService<CleanupService>());
|
||||
services.AddHostedService<DiscordBot>();
|
||||
services.AddGrpc();
|
||||
|
||||
Reference in New Issue
Block a user