Agent: Add add_credentials_from_event_to_propagation_credentials_repository

Callable class that adds credentials to the propagation credentials
repository
This commit is contained in:
Ilija Lazoroski 2022-08-12 14:59:46 +02:00
parent 82c7782ff0
commit db8e1e50da
3 changed files with 15 additions and 1 deletions

View File

@ -2,3 +2,6 @@ from .i_propagation_credentials_repository import IPropagationCredentialsReposit
from .aggregating_propagation_credentials_repository import (
AggregatingPropagationCredentialsRepository,
)
from .add_credentials_from_event import (
add_credentials_from_event_to_propagation_credentials_repository,
)

View File

@ -0,0 +1,11 @@
from common.events import CredentialsStolenEvent
from . import IPropagationCredentialsRepository
class add_credentials_from_event_to_propagation_credentials_repository:
def __init__(self, credentials_repository: IPropagationCredentialsRepository):
self._credentials_repository = credentials_repository
def __call__(self, event: CredentialsStolenEvent):
self._credentials_repository.add_credentials(event.stolen_credentials)

View File

@ -217,7 +217,7 @@ _event_queue
# TODO DELETE IN #2176
CredentialsStolenEvent
add_credentials_from_event_to_propagation_credentials_repository
# TODO DELETE AFTER RESOURCE REFACTORING