Island: Use ScanEvent for typehint in ScanEventHandler

`event` gets passed to `_get_source_machine()`, which expects
`ScanEvent`, not `AbstractAgentEvent`
This commit is contained in:
Mike Salvatore 2022-10-07 07:43:10 -04:00
parent 4c026241ea
commit 0965b97d45
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ from typing import Union
from typing_extensions import TypeAlias
from common.agent_events import AbstractAgentEvent, PingScanEvent, TCPScanEvent
from common.agent_events import PingScanEvent, TCPScanEvent
from common.types import PortStatus, SocketAddress
from monkey_island.cc.models import CommunicationType, Machine, Node
from monkey_island.cc.repository import (
@ -75,7 +75,7 @@ class ScanEventHandler:
self._machine_repository.upsert_machine(machine)
return machine
def _get_source_node(self, event: AbstractAgentEvent) -> Node:
def _get_source_node(self, event: ScanEvent) -> Node:
machine = self._get_source_machine(event)
return self._node_repository.get_node_by_machine_id(machine.id)