Island: Add AgentID type alias

This commit is contained in:
Mike Salvatore 2022-08-30 06:22:17 -04:00
parent 453f45e403
commit f79d2fd8a6
2 changed files with 6 additions and 3 deletions

View File

@ -12,4 +12,4 @@ from .user_credentials import UserCredentials
from .machine import Machine, MachineID
from .communication_type import CommunicationType
from .node import Node
from .agent import Agent
from .agent import Agent, AgentID

View File

@ -3,17 +3,20 @@ 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
class Agent(MutableInfectionMonkeyBaseModel):
id: UUID = Field(..., allow_mutation=False)
id: AgentID = Field(..., allow_mutation=False)
machine_id: MachineID = Field(..., allow_mutation=False)
start_time: datetime = Field(..., allow_mutation=False)
stop_time: Optional[datetime]
parent_id: UUID = Field(..., allow_mutation=False)
parent_id: AgentID = Field(..., allow_mutation=False)
cc_server: str = Field(default="")
log_contents: str = Field(default="")