INNER CODE UNIT · Python

normalize_docker_event_type

ChrispyBacon-dev/DockFlare · dockflare-agent/app/main.py:137

def normalize_docker_event_type(action):
    if action == "start":
        return "container_start"
    if action in {"stop", "die"}:
        return "container_stop"
    return None


def apply_registration_response(data):
    global AGENT_ID, PROTOCOL_VERSION, AGENT_SESSION_ID, _event_sequence, _report_sequence
    agent_id = data.get("agent_id") if isinstance(data, dict) else None
    protocol = data.get("protocol_version") if isinstance(data, dict) else None
    session_id = data.get("agent_session_id") if isinstance(data, dict) else None
    if not agent_id:
        return False
    if protocol == 2 and not session_id:
        return False
    if protocol not in (None, 1, 2):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…