PHP 8.3.30
Preview: event_hook_executor.py Size: 777 B
//opt/imunify360/venv/lib64/python3.11/site-packages/defence360agent/plugins/event_hook_executor.py

from defence360agent.contracts.hook_events import HookEvent
from defence360agent.contracts.plugins import (
    MessageSink,
    MessageSource,
    expect,
)
from defence360agent.hooks.execute import execute_hooks

EVENTS = (
    HookEvent.AgentStarted,
    HookEvent.AgentMisconfig,
    HookEvent.LicenseExpired,
    HookEvent.LicenseExpiring,
    HookEvent.LicenseRenewed,
)


class EventHookExecutor(MessageSink, MessageSource):
    PROCESSING_ORDER = MessageSink.ProcessingOrder.EVENT_HOOK

    async def create_sink(self, loop):
        self._loop = loop

    async def create_source(self, loop, sink):
        self._loop = loop
        self._sink = sink

    @expect(*EVENTS)
    async def receive_event(self, event):
        self._loop.create_task(execute_hooks(event))

Directory Contents

Dirs: 1 × Files: 20

Name Size Perms Modified Actions
- drwxr-xr-x 2026-03-03 08:55:59
Edit Download
3.63 KB lrw-r--r-- 2026-01-23 13:13:44
Edit Download
5.53 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
3.06 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
5.17 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
1.23 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
10.60 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
828 B lrw-r--r-- 2026-01-23 13:13:42
Edit Download
1.89 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
777 B lrw-r--r-- 2026-01-23 13:13:42
Edit Download
3.32 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
6.33 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
1.09 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
4.42 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
1.21 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
1.58 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
1.98 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
536 B lrw-r--r-- 2026-01-23 13:13:42
Edit Download
2.78 KB lrw-r--r-- 2026-01-23 13:13:44
Edit Download
10.96 KB lrw-r--r-- 2026-01-23 13:13:42
Edit Download
0 B lrw-r--r-- 2026-01-23 13:13:42
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).