feat: DELETE /transcripts/{filename} — delete transcript with path-confinement check

This commit is contained in:
2026-04-01 14:13:02 +02:00
parent aa3eef8fb1
commit ae3ae61593
2 changed files with 27 additions and 0 deletions
+15
View File
@@ -69,6 +69,21 @@ def test_get_transcript_rejects_path_traversal(tmp_path):
assert r.status_code == 404
def test_delete_transcript_removes_file(tmp_path):
f = tmp_path / "2026-01-01-0900-test.md"
f.write_text("content")
client = TestClient(make_app_for_dir(str(tmp_path)))
r = client.delete("/transcripts/2026-01-01-0900-test.md")
assert r.status_code == 200
assert not f.exists()
def test_delete_transcript_rejects_path_traversal(tmp_path):
client = TestClient(make_app_for_dir(str(tmp_path)))
r = client.delete("/transcripts/..%2Fsecret.md")
assert r.status_code == 404
def test_login_rejects_wrong_credentials():
import tempfile, os
from unittest.mock import patch