check for existence of WhitelistedIps
This commit is contained in:
@@ -179,10 +179,14 @@ public class SecretKeyAuthenticationHandler
|
||||
logger.LogInformation("FailedAuthForTempBan: {num}", _failedAttemptsForTempBan);
|
||||
_tempBanMinutes = config.GetValue<int>("TempBanDurationInMinutes", 30);
|
||||
logger.LogInformation("TempBanMinutes: {num}", _tempBanMinutes);
|
||||
_whitelistedIps = config.GetSection("WhitelistedIps").Get<List<string>>();
|
||||
foreach (var ip in _whitelistedIps)
|
||||
var whitelisted = config.GetSection("WhitelistedIps");
|
||||
if (!string.IsNullOrEmpty(whitelisted.Value))
|
||||
{
|
||||
logger.LogInformation("Whitelisted IP: " + ip);
|
||||
_whitelistedIps = whitelisted.Get<List<string>>();
|
||||
foreach (var ip in _whitelistedIps)
|
||||
{
|
||||
logger.LogInformation("Whitelisted IP: " + ip);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user