pssecret-server/pssecret_server/fernet.py
Ivan Golikov 7fae1a18b6 Secrets encryption (#4)
Reviewed-on: #4
Co-authored-by: Ivan Golikov <root@ivnglkv.me>
Co-committed-by: Ivan Golikov <root@ivnglkv.me>
2025-01-03 15:06:08 +00:00

10 lines
291 B
Python

from typing import Annotated
from cryptography.fernet import Fernet
from fastapi import Depends
from pssecret_server.settings import Settings, get_settings
def get_fernet(settings: Annotated[Settings, Depends(get_settings)]) -> Fernet:
return Fernet(settings.secrets_encryption_key)