PATH:
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
[-] unavailable_on_freemium.py
[edit]
[-] configuration_management.py
[edit]
[-] whitelisted_domains.py
[edit]
[-] smtp_blocking.py
[edit]
[-] control_panel.py
[edit]
[-] schema.py
[edit]
[-] proactive.py
[edit]
[-] whitelist_rbl.py
[edit]
[-] countries.py
[edit]
[+]
schema
[-] feature.py
[edit]
[+]
__pycache__
[-] middleware.py
[edit]
[-] whitelisted_crawlers.py
[edit]
[-] hosting_panel.py
[edit]
[-] validate.py
[edit]
[-] uninstall_cleanup.py
[edit]
[-] conflicts.py
[edit]
[-] resident_socket.py
[edit]
[-] remote_proxy.py
[edit]
[-] health.py
[edit]
[-] smart_advice.py
[edit]
[-] malware.py
[edit]
[-] __init__.py
[edit]
[-] lists.py
[edit]
[-] csf_imports.py
[edit]
[+]
schema_responses
[+]
..
[-] incidents.py
[edit]
[-] kcarectl.py
[edit]
[-] disabled_rules.py
[edit]
[-] custom_lists.py
[edit]