From fe7188798f000205983011209c24b8a64183a76e Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 12 Jul 2022 13:23:38 -0400 Subject: [PATCH] Island: Add note about encryption decorator in MongoCredentialsRepository --- .../cc/repository/mongo_credentials_repository.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/monkey/monkey_island/cc/repository/mongo_credentials_repository.py b/monkey/monkey_island/cc/repository/mongo_credentials_repository.py index 5dd43a32f..722aa3463 100644 --- a/monkey/monkey_island/cc/repository/mongo_credentials_repository.py +++ b/monkey/monkey_island/cc/repository/mongo_credentials_repository.py @@ -74,6 +74,9 @@ class MongoCredentialsRepository(ICredentialsRepository): # NOTE: The encryption/decryption is complicated and also full of mostly duplicated code. Rather # than spend the effort to improve them now, we can revisit them when we resolve #2072. # Resolving #2072 will make it easier to simplify these methods and remove duplication. + # + # If possible, implement the encryption/decryption as a decorator so it can be reused with + # different ICredentialsRepository implementations def _encrypt_credentials_mapping(self, mapping: Mapping[str, Any]) -> Mapping[str, Any]: encrypted_mapping: Dict[str, Any] = {}