Common: Rename MutableBaseModel -> MutableInfectionMonkeyBaseModel

This commit is contained in:
Mike Salvatore 2022-08-25 11:50:12 -04:00
parent 8e3abe7601
commit def1dce86b
4 changed files with 7 additions and 7 deletions

View File

@ -46,7 +46,7 @@ class InfectionMonkeyBaseModel(BaseModel):
return BaseModel.dict(self, **kwargs)
class MutableBaseModel(InfectionMonkeyBaseModel):
class MutableInfectionMonkeyBaseModel(InfectionMonkeyBaseModel):
class Config(InfectionMonkeyModelConfig):
allow_mutation = True
validate_assignment = True

View File

@ -4,12 +4,12 @@ from uuid import UUID
from pydantic import Field
from common.base_models import MutableBaseModel
from common.base_models import MutableInfectionMonkeyBaseModel
from . import MachineID
class Agent(MutableBaseModel):
class Agent(MutableInfectionMonkeyBaseModel):
id: UUID = Field(..., allow_mutation=False)
machine_id: MachineID = Field(..., allow_mutation=False)
start_time: datetime = Field(..., allow_mutation=False)

View File

@ -4,14 +4,14 @@ from typing import Optional, Sequence
from pydantic import Field, PositiveInt, validator
from common import OperatingSystem
from common.base_models import MutableBaseModel
from common.base_models import MutableInfectionMonkeyBaseModel
from common.transforms import make_immutable_sequence
from common.types import HardwareID
MachineID = PositiveInt
class Machine(MutableBaseModel):
class Machine(MutableInfectionMonkeyBaseModel):
id: MachineID = Field(..., allow_mutation=False)
hardware_id: Optional[HardwareID]
network_interfaces: Sequence[IPv4Interface]

View File

@ -2,7 +2,7 @@ from typing import Sequence, Tuple
from pydantic import Field, validator
from common.base_models import MutableBaseModel
from common.base_models import MutableInfectionMonkeyBaseModel
from common.transforms import make_immutable_nested_sequence
from . import CommunicationType, MachineID
@ -10,7 +10,7 @@ from . import CommunicationType, MachineID
ConnectionsSequence = Sequence[Tuple[MachineID, Sequence[CommunicationType]]]
class Node(MutableBaseModel):
class Node(MutableInfectionMonkeyBaseModel):
machine_id: MachineID = Field(..., allow_mutation=False)
connections: ConnectionsSequence