From b55ea8b7f3048a353b64848a7f20b76e803c8b88 Mon Sep 17 00:00:00 2001 From: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com> Date: Mon, 27 Nov 2023 14:17:36 +0530 Subject: [PATCH 1/2] use get_config (#1369) --- superagi/helper/encyption_helper.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/superagi/helper/encyption_helper.py b/superagi/helper/encyption_helper.py index f2cf6fd13..4939b1d0c 100644 --- a/superagi/helper/encyption_helper.py +++ b/superagi/helper/encyption_helper.py @@ -1,9 +1,14 @@ from cryptography.fernet import Fernet, InvalidToken, InvalidSignature - +from superagi.config.config import get_config # Generate a key # key = Fernet.generate_key() -key = b'e3mp0E0Jr3jnVb96A31_lKzGZlSTPIp4-rPaVseyn58=' +key = get_config("ENCRYPTION_KEY") +if key is None: + raise Exception("Encryption key not found in config file.") +key = key.encode( + "utf-8" +) cipher_suite = Fernet(key) From f3de47ac497ee7bf4ff64dea5a0c9d9f7d435ccc Mon Sep 17 00:00:00 2001 From: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com> Date: Mon, 27 Nov 2023 14:42:50 +0530 Subject: [PATCH 2/2] add a dummy key in encryption key (#1371) --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fe0e8a75..1b65e5263 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,6 +110,7 @@ jobs: PLAIN_OUTPUT: True REDIS_URL: "localhost:6379" IS_TESTING: True - + ENCRYPTION_KEY: "dummy key" + - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3