pssecret-server/pssecret_server/fernet.py

9 lines
289 B
Python
Raw Normal View History

2025-01-03 11:04:51 +00:00
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)