check for existence of WhitelistedIps
This commit is contained in:
@@ -179,10 +179,14 @@ public class SecretKeyAuthenticationHandler
|
|||||||
logger.LogInformation("FailedAuthForTempBan: {num}", _failedAttemptsForTempBan);
|
logger.LogInformation("FailedAuthForTempBan: {num}", _failedAttemptsForTempBan);
|
||||||
_tempBanMinutes = config.GetValue<int>("TempBanDurationInMinutes", 30);
|
_tempBanMinutes = config.GetValue<int>("TempBanDurationInMinutes", 30);
|
||||||
logger.LogInformation("TempBanMinutes: {num}", _tempBanMinutes);
|
logger.LogInformation("TempBanMinutes: {num}", _tempBanMinutes);
|
||||||
_whitelistedIps = config.GetSection("WhitelistedIps").Get<List<string>>();
|
var whitelisted = config.GetSection("WhitelistedIps");
|
||||||
foreach (var ip in _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