diff --git a/monkey/common/types.py b/monkey/common/types.py index d1808d762..56dee91a5 100644 --- a/monkey/common/types.py +++ b/monkey/common/types.py @@ -1,4 +1,7 @@ +from uuid import UUID + from pydantic import PositiveInt from typing_extensions import TypeAlias +AgentID: TypeAlias = UUID HardwareID: TypeAlias = PositiveInt diff --git a/monkey/monkey_island/cc/models/__init__.py b/monkey/monkey_island/cc/models/__init__.py index 29c38674a..30cb5ad95 100644 --- a/monkey/monkey_island/cc/models/__init__.py +++ b/monkey/monkey_island/cc/models/__init__.py @@ -12,4 +12,5 @@ from .user_credentials import UserCredentials from .machine import Machine, MachineID from .communication_type import CommunicationType from .node import Node -from .agent import Agent, AgentID +from common.types import AgentID +from .agent import Agent diff --git a/monkey/monkey_island/cc/models/agent.py b/monkey/monkey_island/cc/models/agent.py index 66bca7b54..c5ae10d22 100644 --- a/monkey/monkey_island/cc/models/agent.py +++ b/monkey/monkey_island/cc/models/agent.py @@ -1,15 +1,11 @@ from datetime import datetime from typing import Optional -from uuid import UUID from pydantic import Field -from typing_extensions import TypeAlias from common.base_models import MutableInfectionMonkeyBaseModel -from . import MachineID - -AgentID: TypeAlias = UUID +from . import AgentID, MachineID class Agent(MutableInfectionMonkeyBaseModel):