feat: DELETE /transcripts/{filename} — delete transcript with path-confinement check
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user