pssecret-server/pssecret_server/fernet.py
2025-01-03 12:04:51 +01:00

8 lines
289 B
Python

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