diff --git a/pssecret_server/utils.py b/pssecret_server/utils.py index b1ae479..239ff37 100644 --- a/pssecret_server/utils.py +++ b/pssecret_server/utils.py @@ -7,8 +7,8 @@ from pssecret_server.models import Secret def encrypt_secret(data: Secret, fernet: Fernet) -> Secret: - data.data = fernet.encrypt(data.data.encode()).decode() - return data + encrypted = fernet.encrypt(data.data.encode()).decode() + return Secret(data=encrypted) def decrypt_secret(secret: bytes, fernet: Fernet) -> bytes: