added firewall strategy pattern
This commit is contained in:
20
src/firewall/raw.py
Normal file
20
src/firewall/raw.py
Normal 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)
|
||||
Reference in New Issue
Block a user