Island: Add `get_progenitor` to IAgentRepository

This commit is contained in:
Ilija Lazoroski 2022-09-22 14:43:04 +02:00 committed by Mike Salvatore
parent 4f4eea3d66
commit d10c148533
2 changed files with 13 additions and 0 deletions

View File

@ -40,6 +40,17 @@ class IAgentRepository(ABC):
:raises RetrievalError: If an error occurred while attempting to retrieve the `Agents`
"""
@abstractmethod
def get_progenitor(self, agent: Agent) -> Agent:
"""
Gets the progenitor `Agent` for the agent.
:param agent: The Agent for which we want the progenitor
:return: `Agent` progenitor ( an initial agent that started the exploitation chain)
:raises RetrievalError: If an error occured while attempting to retrieve the `Agent`
:raises UnknownRecordError: If the agent ID is not in the repository
"""
@abstractmethod
def reset(self):
"""

View File

@ -246,6 +246,8 @@ IMitigationsRepository.save_mitigations
IAgentRepository.upsert_agent
IAgentRepository.get_agent_by_id
IAgentRepository.get_running_agents
IAgentRepository.get_progenitor
descendant
agent
IAttackRepository.get_attack_report
IAttackRepository.save_attack_report