mirror of
https://github.com/mblanke/ThreatHunt.git
synced 2026-03-01 14:00:20 -05:00
feat: Add Playbook Manager, Saved Searches, and Timeline View components
- Implemented PlaybookManager for creating and managing investigation playbooks with templates. - Added SavedSearches component for managing bookmarked queries and recurring scans. - Introduced TimelineView for visualizing forensic event timelines with zoomable charts. - Enhanced backend processing with auto-queued jobs for dataset uploads and improved database concurrency. - Updated frontend components for better user experience and performance optimizations. - Documented changes in update log for future reference.
This commit is contained in:
@@ -197,3 +197,27 @@ async def test_quick_scan(client: AsyncClient):
|
||||
assert "total_hits" in data
|
||||
# powershell should match at least one row
|
||||
assert data["total_hits"] > 0
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_quick_scan_cache_hit(client: AsyncClient):
|
||||
"""Second quick scan should return cache hit metadata."""
|
||||
theme_res = await client.post("/api/keywords/themes", json={"name": "Quick Cache Theme", "color": "#00aa00"})
|
||||
tid = theme_res.json()["id"]
|
||||
await client.post(f"/api/keywords/themes/{tid}/keywords", json={"value": "chrome.exe"})
|
||||
|
||||
from tests.conftest import SAMPLE_CSV
|
||||
import io
|
||||
files = {"file": ("cache_quick.csv", io.BytesIO(SAMPLE_CSV), "text/csv")}
|
||||
upload = await client.post("/api/datasets/upload", files=files)
|
||||
ds_id = upload.json()["id"]
|
||||
|
||||
first = await client.get(f"/api/keywords/scan/quick?dataset_id={ds_id}")
|
||||
assert first.status_code == 200
|
||||
assert first.json().get("cache_status") in ("miss", "hit")
|
||||
|
||||
second = await client.get(f"/api/keywords/scan/quick?dataset_id={ds_id}")
|
||||
assert second.status_code == 200
|
||||
body = second.json()
|
||||
assert body.get("cache_used") is True
|
||||
assert body.get("cache_status") == "hit"
|
||||
|
||||
Reference in New Issue
Block a user