From 64e548957f1457e3ef56fc356089a9c9f1a2bdd3 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 5 Jul 2022 10:59:28 -0400 Subject: [PATCH] Island: Reorder methods in ICredentialsRepository --- .../cc/repository/i_credentials_repository.py | 70 +++++++++---------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/monkey/monkey_island/cc/repository/i_credentials_repository.py b/monkey/monkey_island/cc/repository/i_credentials_repository.py index 26a21b980..769175301 100644 --- a/monkey/monkey_island/cc/repository/i_credentials_repository.py +++ b/monkey/monkey_island/cc/repository/i_credentials_repository.py @@ -15,24 +15,6 @@ class ICredentialsRepository(ABC): """ pass - def save_configured_credentials(self, credentials: Credentials): - """ - Save credentials that were configured. - - :param credentials: Configured Credentials to store in the repository - :raises StorageError: If an error is encountered while attempting to store configured - credentials - """ - pass - - def remove_configured_credentials(self): - """ - Remove credentials that were configured from the repository. - - :raises RemovalError: If an error is encountered while attempting to remove the credentials - """ - pass - def get_stolen_credentials(self) -> Sequence[Credentials]: """ Retrieve credentials that were stolen during a simulation. @@ -43,24 +25,6 @@ class ICredentialsRepository(ABC): """ pass - def save_stolen_credentials(self, credentials: Credentials): - """ - Save credentials that were stolen during a simulation. - - :param credentials: Stolen Credentials to store in the repository - :raises StorageError: If an error is encountered while attempting to store stolen - credentials - """ - pass - - def remove_stolen_credentials(self): - """ - Remove stolen credentials from the repository. - - :raises RemovalError: If an error is encountered while attempting to remove the credentials - """ - pass - def get_all_credentials(self) -> Sequence[Credentials]: """ Retrieve all credentials in the repository. @@ -71,6 +35,40 @@ class ICredentialsRepository(ABC): """ pass + def save_configured_credentials(self, credentials: Credentials): + """ + Save credentials that were configured. + + :param credentials: Configured Credentials to store in the repository + :raises StorageError: If an error is encountered while attempting to store the credentials + """ + pass + + def save_stolen_credentials(self, credentials: Credentials): + """ + Save credentials that were stolen during a simulation. + + :param credentials: Stolen Credentials to store in the repository + :raises StorageError: If an error is encountered while attempting to store the credentials + """ + pass + + def remove_configured_credentials(self): + """ + Remove credentials that were configured from the repository. + + :raises RemovalError: If an error is encountered while attempting to remove the credentials + """ + pass + + def remove_stolen_credentials(self): + """ + Remove stolen credentials from the repository. + + :raises RemovalError: If an error is encountered while attempting to remove the credentials + """ + pass + def remove_all_credentials(self): """ Remove all credentials in the repository.