/opt/imunify360/venv/lib/python3.11/site-packages/im360/simple_rpc
from functools import wraps from im360.internals.strategy import Strategy from im360.model.firewall import IPList def add_strategy(f): @wraps(f) async def wrapper(*args, **kwargs): result = await f(*args, **kwargs) assert isinstance(result, dict), ( "Result should be a dictionary %s" % result ) result["strategy"] = Strategy.get() return result return wrapper def replace_gray_splashscreen_with_gray(f): """ Replaces 'GRAY_SPLASHSCREEN' value for *listname* field for queries like `graylist ip list` for compatibility with UI """ @wraps(f) async def wrapper(*args, **kwargs): result = await f(*args, **kwargs) if not isinstance(result.get("items"), list): return result gray_splashscreen = IPList.GRAY_SPLASHSCREEN.lower() for item in result.get("items", []): if ( isinstance(item, dict) and item.get("listname") and item["listname"].lower() == gray_splashscreen ): # use same case as it is item["listname"] = ( IPList.GRAY if item["listname"].isupper() else IPList.GRAY.lower() ) return result return wrapper
.
Edit
..
Edit
__init__.py
Edit
__pycache__
Edit
configuration_management.py
Edit
conflicts.py
Edit
control_panel.py
Edit
countries.py
Edit
csf_imports.py
Edit
custom_lists.py
Edit
disabled_rules.py
Edit
feature.py
Edit
health.py
Edit
hosting_panel.py
Edit
incidents.py
Edit
kcarectl.py
Edit
lists.py
Edit
malware.py
Edit
middleware.py
Edit
proactive.py
Edit
remote_proxy.py
Edit
resident_socket.py
Edit
schema
Edit
schema.py
Edit
schema_responses
Edit
smart_advice.py
Edit
smtp_blocking.py
Edit
unavailable_on_freemium.py
Edit
uninstall_cleanup.py
Edit
validate.py
Edit
whitelist_rbl.py
Edit
whitelisted_crawlers.py
Edit
whitelisted_domains.py
Edit