Remove old type whitelist

main
Yasen Pramatarov 2024-12-16 16:39:06 +02:00
parent bfa467996f
commit db6dabedec
1 changed files with 0 additions and 18 deletions

View File

@ -6,13 +6,10 @@ class RateLimiter {
private $decayMinutes = 15; // Time window in minutes
private $ratelimitTable = 'login_attempts';
private $whitelistTable = 'ip_whitelist';
private $whitelistedIps = []; // Whitelisted IPs
private $whitelistedNetworks = []; // Whitelisted CIDR ranges
public function __construct($database) {
$this->db = $database->getConnection();
$this->createTablesIfNotExists();
$this->loadWhitelist();
}
// Database preparation
@ -40,21 +37,6 @@ class RateLimiter {
$this->db->exec($sql);
}
// List of IPs to bypass rate limiting
private function loadWhitelist() {
// FIXME Load from database or config
$this->whitelistedIps = [
'127.0.0.1', // localhost
'::1' // localhost IPv6
];
$this->whitelistedNetworks = [
'10.0.0.0/8', // Private network
'172.16.0.0/12', // Private network
'192.168.0.0/16' // Private network
];
}
// Check if IP is whitelisted
private function isIpWhitelisted($ip) {
// Check exact IP match and CIDR ranges