pssecret-server/pssecret_server/fernet.py

11 lines
291 B
Python
Raw Normal View History

2025-01-03 11:04:51 +00:00
from typing import Annotated
2025-01-03 14:32:01 +00:00
from cryptography.fernet import Fernet
2025-01-03 11:04:51 +00:00
from fastapi import Depends
2025-01-03 14:32:01 +00:00
from pssecret_server.settings import Settings, get_settings
2025-01-03 11:04:51 +00:00
def get_fernet(settings: Annotated[Settings, Depends(get_settings)]) -> Fernet:
return Fernet(settings.secrets_encryption_key)