This commit is contained in:
larssand
2026-06-21 15:19:24 +02:00
parent d41d318134
commit 5bb381a063
6 changed files with 81 additions and 20 deletions

View File

@@ -29,6 +29,11 @@ class ThreatIntelClient:
self.ttl_seconds = ttl_seconds
self.cache = self._read_cache()
def status(self) -> dict[str, object]:
provider = self._select_provider()
has_key = bool(self.abuseipdb_key if provider == "abuseipdb" else self.virustotal_key)
return {"enabled": self.enabled, "provider": provider, "configured": has_key}
def _read_cache(self) -> dict[str, dict[str, object]]:
if not self.cache_path.exists():
return {}