forked from p15670423/monkey
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:
parent
82c7782ff0
commit
db8e1e50da
|
@ -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,
|
||||
)
|
||||
|
|
|
@ -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)
|
|
@ -217,7 +217,7 @@ _event_queue
|
|||
|
||||
# TODO DELETE IN #2176
|
||||
CredentialsStolenEvent
|
||||
|
||||
add_credentials_from_event_to_propagation_credentials_repository
|
||||
|
||||
# TODO DELETE AFTER RESOURCE REFACTORING
|
||||
|
||||
|
|
Loading…
Reference in New Issue