Island: Register MongoCredentialsRepository in DI container

This commit is contained in:
Ilija Lazoroski 2022-07-08 17:34:45 +02:00
parent 8ff8ad1f17
commit 45a6693263
1 changed files with 5 additions and 0 deletions

View File

@ -18,9 +18,11 @@ from monkey_island.cc.repository import (
FileSimulationRepository, FileSimulationRepository,
IAgentBinaryRepository, IAgentBinaryRepository,
IAgentConfigurationRepository, IAgentConfigurationRepository,
ICredentialsRepository,
IFileRepository, IFileRepository,
ISimulationRepository, ISimulationRepository,
LocalStorageFileRepository, LocalStorageFileRepository,
MongoCredentialsRepository,
RetrievalError, RetrievalError,
) )
from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH
@ -73,6 +75,9 @@ def _register_repositories(container: DIContainer, data_dir: Path):
IAgentConfigurationRepository, container.resolve(FileAgentConfigurationRepository) IAgentConfigurationRepository, container.resolve(FileAgentConfigurationRepository)
) )
container.register_instance(ISimulationRepository, container.resolve(FileSimulationRepository)) container.register_instance(ISimulationRepository, container.resolve(FileSimulationRepository))
container.register_instance(
ICredentialsRepository, container.resolve(MongoCredentialsRepository)
)
def _decorate_file_repository(file_repository: IFileRepository) -> IFileRepository: def _decorate_file_repository(file_repository: IFileRepository) -> IFileRepository: