From 8fd226cd232f034f609ee5fb40b2353fcfd24985 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 6 Sep 2022 09:46:52 -0400 Subject: [PATCH] UT: Add safety test since we will switch to pydantic.SecretType --- .../cc/repository/test_mongo_credentials_repository.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/monkey/tests/unit_tests/monkey_island/cc/repository/test_mongo_credentials_repository.py b/monkey/tests/unit_tests/monkey_island/cc/repository/test_mongo_credentials_repository.py index 4b660e6d9..07b7807d6 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/repository/test_mongo_credentials_repository.py +++ b/monkey/tests/unit_tests/monkey_island/cc/repository/test_mongo_credentials_repository.py @@ -119,6 +119,10 @@ def check_if_stored_credentials_encrypted(mongo_client: MongoClient, original_cr for key, value in credentials_component.items(): assert original_credentials_mapping[identity_or_secret][key] != value.decode() + # Since secrets use the pydantic.SecretType, make sure we're not just storing + # all '*' characters. + assert "***" not in value.decode() + def get_all_credentials_in_mongo( mongo_client: MongoClient,