forked from p15670423/monkey
Island: Register StubbedEventRepository in DIContainer
This commit is contained in:
parent
f5711e2fab
commit
6f4c3d4669
|
@ -25,6 +25,7 @@ from monkey_island.cc.repository import (
|
||||||
IAgentBinaryRepository,
|
IAgentBinaryRepository,
|
||||||
IAgentConfigurationRepository,
|
IAgentConfigurationRepository,
|
||||||
ICredentialsRepository,
|
ICredentialsRepository,
|
||||||
|
IEventRepository,
|
||||||
IFileRepository,
|
IFileRepository,
|
||||||
ISimulationRepository,
|
ISimulationRepository,
|
||||||
IUserRepository,
|
IUserRepository,
|
||||||
|
@ -32,6 +33,7 @@ from monkey_island.cc.repository import (
|
||||||
LocalStorageFileRepository,
|
LocalStorageFileRepository,
|
||||||
MongoCredentialsRepository,
|
MongoCredentialsRepository,
|
||||||
RetrievalError,
|
RetrievalError,
|
||||||
|
StubbedEventRepository,
|
||||||
)
|
)
|
||||||
from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH
|
from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH
|
||||||
from monkey_island.cc.server_utils.encryption import ILockableEncryptor, RepositoryEncryptor
|
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))
|
container.register_instance(IUserRepository, container.resolve(JSONFileUserRepository))
|
||||||
|
|
||||||
|
# TODO: Replace with MongoEventRepository
|
||||||
|
container.register_instance(IEventRepository, StubbedEventRepository())
|
||||||
|
|
||||||
|
|
||||||
def _decorate_file_repository(file_repository: IFileRepository) -> IFileRepository:
|
def _decorate_file_repository(file_repository: IFileRepository) -> IFileRepository:
|
||||||
return FileRepositoryLockingDecorator(
|
return FileRepositoryLockingDecorator(
|
||||||
|
|
Loading…
Reference in New Issue