Linting, refactoring, security fixes

This commit is contained in:
florian committed 2026-10-21 11:09:44 +02:00
1 parent b0dbf8f996
commit f61ee89cd0
4 files changed
+15 -19

No files matched your search

+4 -4
View File
@@ -1,6 +1,5 @@
import logging
import os
from typing import Set
logger = logging.getLogger(__name__)
_TRUTHY = {"1", "true", "yes", "on"}
@@ -52,7 +51,7 @@ def return_credentials(path: str) -> str:
raise
def cleanup_secret_files(secret_paths: Set[str], *, force: bool = False) -> None:
def cleanup_secret_files(secret_paths: set[str], *, force: bool = False) -> None:
"""Delete secret files after they've been loaded into memory.
Skipped when KEEP_SECRET_FILES is set (e.g. in development), unless force=True.
@@ -70,5 +69,6 @@ def cleanup_secret_files(secret_paths: Set[str], *, force: bool = False) -> None
logger.debug(f"Deleted secret file: {path}")
else:
logger.debug(f"Secret file already removed: {path}")
except Exception as e:
logger.warning(f"Could not delete secret file {path}: {e}")
except Exception:
logger.exception(f"Could not delete secret file {path}")
raise