From 6f4c3d4669b94f23803e3fdbe932c8436a094699 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 14 Sep 2022 13:36:55 -0400 Subject: [PATCH] Island: Register StubbedEventRepository in DIContainer --- monkey/monkey_island/cc/services/initialize.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/monkey/monkey_island/cc/services/initialize.py b/monkey/monkey_island/cc/services/initialize.py index 1b6a3e4d5..6f363f3ed 100644 --- a/monkey/monkey_island/cc/services/initialize.py +++ b/monkey/monkey_island/cc/services/initialize.py @@ -25,6 +25,7 @@ from monkey_island.cc.repository import ( IAgentBinaryRepository, IAgentConfigurationRepository, ICredentialsRepository, + IEventRepository, IFileRepository, ISimulationRepository, IUserRepository, @@ -32,6 +33,7 @@ from monkey_island.cc.repository import ( LocalStorageFileRepository, MongoCredentialsRepository, RetrievalError, + StubbedEventRepository, ) from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH from monkey_island.cc.server_utils.encryption import ILockableEncryptor, RepositoryEncryptor @@ -106,6 +108,9 @@ def _register_repositories(container: DIContainer, data_dir: Path): ) container.register_instance(IUserRepository, container.resolve(JSONFileUserRepository)) + # TODO: Replace with MongoEventRepository + container.register_instance(IEventRepository, StubbedEventRepository()) + def _decorate_file_repository(file_repository: IFileRepository) -> IFileRepository: return FileRepositoryLockingDecorator(