Added optional rate limiting for services

This commit is contained in:
Pinga 2024-03-01 10:54:46 +02:00
parent b0f63ffb25
commit b3113da4f4
15 changed files with 110 additions and 13 deletions

View file

@ -91,4 +91,11 @@ function mapContactToVCard($contactDetails, $role, $c) {
]
],
];
}
function isIpWhitelisted($ip, $pdo) {
$stmt = $pdo->prepare("SELECT COUNT(*) FROM registrar_whitelist WHERE addr = ?");
$stmt->execute([$ip]);
$count = $stmt->fetchColumn();
return $count > 0;
}