From cafbe97880eb1a10955178a46f783d035026b15e Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Thu, 24 Mar 2022 18:03:59 +0100 Subject: [PATCH] Agent: Add interface for Credentials Store --- .../credential_store/__init__.py | 1 + .../credential_store/i_credentials_store.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 monkey/infection_monkey/credential_store/__init__.py create mode 100644 monkey/infection_monkey/credential_store/i_credentials_store.py diff --git a/monkey/infection_monkey/credential_store/__init__.py b/monkey/infection_monkey/credential_store/__init__.py new file mode 100644 index 000000000..636e9baa7 --- /dev/null +++ b/monkey/infection_monkey/credential_store/__init__.py @@ -0,0 +1 @@ +from .i_credentials_store import ICredentialsStore diff --git a/monkey/infection_monkey/credential_store/i_credentials_store.py b/monkey/infection_monkey/credential_store/i_credentials_store.py new file mode 100644 index 000000000..7730c99d2 --- /dev/null +++ b/monkey/infection_monkey/credential_store/i_credentials_store.py @@ -0,0 +1,19 @@ +import abc +from typing import Mapping + + +class ICredentialsStore(metaclass=abc.ABCMeta): + @abc.abstractmethod + def add_credentials(self, credentials_to_add: Mapping = {}) -> None: + """ + Method that adds credentials to the CredentialStore + :param Credentials credentials: The credentials which will be added + """ + + @abc.abstractmethod + def get_credentials(self) -> Mapping: + """ + Method that gets credentials from the ControlChannel + :return: A squence of Credentials that have been added for propagation + :rtype: Mapping + """