added firewall strategy pattern

This commit is contained in:
carnivuth
2026-01-27 17:41:41 +01:00
parent 323c7f31a2
commit 8fb24b1db4
3 changed files with 103 additions and 0 deletions

20
src/firewall/raw.py Normal file
View File

@@ -0,0 +1,20 @@
from typing_extensions import override
from firewall.fwtype import FWType
class Raw(FWType):
@override
def getBanlist(self,ips) -> str:
"""
Generate raw list of bad IP addresses.
Args:
ips: List of IP addresses to ban
Returns:
String containing raw ips, one per line
"""
if not ips:
return ""
return "\n".join(ips)