REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.82 KB
Close
/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/api/server/events.py
Text
Base64
import urllib.request import logging import datetime from defence360agent.api.server import API from defence360agent.internals.iaid import IndependentAgentIDAPI from defence360agent.rpc_tools.utils import run_in_executor_decorator logger = logging.getLogger(__name__) class EventsAPI(API): ADVICES_API_URL_TEMPLATE = ( "{base}/api/dashboard/events?dashboard=false&" "popup=true¬_snoozed_at={not_snoozed_at}" ) NOTIFICATIONS_API_URL_TEMPLATE = ( "{base}/api/dashboard/v2/events?notification=1&enduser=true" ) SMART_ADVICE_API_URL_TEMPLATE = ( "{base}/api/dashboard/v2/events?smartadvice=true" ) @classmethod @run_in_executor_decorator def advices(cls): request = urllib.request.Request( cls.ADVICES_API_URL_TEMPLATE.format( base=cls._BASE_URL, not_snoozed_at=int(datetime.datetime.now().timestamp()), ), method="GET", ) result = cls.request(request) return result["result"] @classmethod async def notification(cls): request = urllib.request.Request( cls.NOTIFICATIONS_API_URL_TEMPLATE.format(base=cls._BASE_URL), method="GET", headers={"X-Auth": await IndependentAgentIDAPI.get_token()}, ) return await cls._send_notifications(request) @classmethod async def smart_advices(cls): request = urllib.request.Request( cls.SMART_ADVICE_API_URL_TEMPLATE.format(base=cls._BASE_URL), method="GET", headers={"X-Auth": await IndependentAgentIDAPI.get_token()}, ) return cls.request(request)["result"] @classmethod @run_in_executor_decorator def _send_notifications(cls, request): result = cls.request(request) return result["result"]
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-03-03 08:59:03
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
analyst_cleanup.py
5.24 KB
lrw-r--r--
2026-01-23 13:13:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
cleanup_revert.py
817 B
lrw-r--r--
2026-01-23 13:13:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
events.py
1.82 KB
lrw-r--r--
2026-01-23 13:13:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
reputation.py
2.24 KB
lrw-r--r--
2026-01-23 13:13:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
send_message.py
5.31 KB
lrw-r--r--
2026-01-23 13:13:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
2.79 KB
lrw-r--r--
2026-01-23 13:13:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).