Island: Register FileAgentLogRegister in DI container

This commit is contained in:
Shreya Malviya 2022-09-28 15:42:07 +05:30
parent 1c6cfa1ce6
commit 01d8875f22
1 changed files with 3 additions and 0 deletions

View File

@ -21,6 +21,7 @@ from monkey_island.cc.event_queue import IIslandEventQueue, PyPubSubIslandEventQ
from monkey_island.cc.repository import ( from monkey_island.cc.repository import (
AgentBinaryRepository, AgentBinaryRepository,
FileAgentConfigurationRepository, FileAgentConfigurationRepository,
FileAgentLogRepository,
FileRepositoryCachingDecorator, FileRepositoryCachingDecorator,
FileRepositoryLockingDecorator, FileRepositoryLockingDecorator,
FileRepositoryLoggingDecorator, FileRepositoryLoggingDecorator,
@ -28,6 +29,7 @@ from monkey_island.cc.repository import (
IAgentBinaryRepository, IAgentBinaryRepository,
IAgentConfigurationRepository, IAgentConfigurationRepository,
IAgentEventRepository, IAgentEventRepository,
IAgentLogRepository,
IAgentRepository, IAgentRepository,
ICredentialsRepository, ICredentialsRepository,
IFileRepository, IFileRepository,
@ -117,6 +119,7 @@ def _register_repositories(container: DIContainer, data_dir: Path):
container.register_instance(INodeRepository, container.resolve(MongoNodeRepository)) container.register_instance(INodeRepository, container.resolve(MongoNodeRepository))
container.register_instance(IMachineRepository, _build_machine_repository(container)) container.register_instance(IMachineRepository, _build_machine_repository(container))
container.register_instance(IAgentRepository, container.resolve(MongoAgentRepository)) container.register_instance(IAgentRepository, container.resolve(MongoAgentRepository))
container.register_instance(IAgentLogRepository, container.resolve(FileAgentLogRepository))
def _decorate_file_repository(file_repository: IFileRepository) -> IFileRepository: def _decorate_file_repository(file_repository: IFileRepository) -> IFileRepository: