From db6dabedecbd2fc8596434d095c939c715c5c66f Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Mon, 16 Dec 2024 16:39:06 +0200 Subject: [PATCH] Remove old type whitelist --- app/classes/ratelimitrer.php | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/app/classes/ratelimitrer.php b/app/classes/ratelimitrer.php index 34b3ca8..c7cd03d 100644 --- a/app/classes/ratelimitrer.php +++ b/app/classes/ratelimitrer.php @@ -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