feat: B2 uit voor veilige archive-downloads

This commit is contained in:
kodi
2026-03-14 14:24:52 +01:00
parent 592b10acc2
commit d463b3977d
24 changed files with 754 additions and 195 deletions
@@ -59,6 +59,27 @@ class TaskRepositoryTest(unittest.TestCase):
}
)
def test_create_download_task_with_requested_status_and_artifact(self) -> None:
created = self.repo.create_task(
operation="download",
source="storage1/docs",
destination="docs.zip",
status="requested",
)
self.repo.upsert_artifact(
task_id=created["id"],
file_path="/tmp/archive.zip",
file_name="docs.zip",
expires_at="2026-03-10T10:30:00Z",
)
task = self.repo.get_task(created["id"])
artifact = self.repo.get_artifact(created["id"])
self.assertEqual(task["operation"], "download")
self.assertEqual(task["status"], "requested")
self.assertEqual(artifact["file_name"], "docs.zip")
def test_migrates_legacy_tasks_schema_missing_source_destination(self) -> None:
legacy_db_path = Path(self.temp_dir.name) / "legacy.db"
conn = sqlite3.connect(legacy_db_path)