Returning new secret instead of replacing data
This commit is contained in:
parent
ba7537e15e
commit
34a9b059dd
1 changed files with 2 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue