Secrets encryption #4

Merged
root merged 5 commits from secret-encryption into main 2025-01-03 15:06:09 +00:00
Showing only changes of commit 34a9b059dd - Show all commits

View file

@ -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: