refactor: JSON data column for findings, code snippets captured and displayed
This commit is contained in:
@@ -21,9 +21,9 @@ async def list_findings(
|
||||
):
|
||||
q = select(Finding)
|
||||
if rule:
|
||||
q = q.where(Finding.rule == rule)
|
||||
q = q.where(func.json_extract(Finding.data, "$.rule") == rule)
|
||||
if severity:
|
||||
q = q.where(Finding.severity == severity)
|
||||
q = q.where(func.json_extract(Finding.data, "$.severity") == severity)
|
||||
if scan_id:
|
||||
q = q.where(Finding.scan_id == scan_id)
|
||||
|
||||
@@ -38,10 +38,7 @@ async def list_findings(
|
||||
{
|
||||
"id": f.id,
|
||||
"scan_id": f.scan_id,
|
||||
"rule": f.rule,
|
||||
"severity": f.severity,
|
||||
"message": f.message,
|
||||
"location": f.location,
|
||||
**f.data,
|
||||
"created_at": f.created_at.isoformat() if f.created_at else None,
|
||||
}
|
||||
for f in findings
|
||||
|
||||
Reference in New Issue
Block a user