/opt/imunify360/venv/lib/python3.11/site-packages/im360/simple_rpc
from defence360agent.rpc_tools import lookup from defence360agent.utils import Scope from defence360agent.contracts.config import ControlPanelConfig from defence360agent.myimunify.advice.advice_manager import ( get_advice_notifications, make_advice, ) from defence360agent.myimunify.advice.hosting_smart_advice_api import ( sync_advices, ) class SmartAdviceEndpoints(lookup.RootEndpoints): SCOPE = Scope.IM360 @lookup.bind("smart-advice", "notifications") async def smart_advice_notifications(self): if not ControlPanelConfig.SMART_ADVICE_ALLOWED: return [] return await get_advice_notifications() @lookup.bind("smart-advice", "get-options") async def smart_advice_get_options(self): return { "mu_plugin_installation": ControlPanelConfig.SMART_ADVICE_ALLOWED, "advice_email_notification": ControlPanelConfig.ADVICE_EMAIL_NOTIFICATION, } @lookup.bind("smart-advice", "sync") async def sync_smart_advice(self): if not ControlPanelConfig.SMART_ADVICE_ALLOWED: return [] advices = await make_advice() ok = await sync_advices(advices) if ok: return [] else: raise Exception("Failed to sync advices")
.
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