Fix /reports/{report_id} returning 404 - add report detail page and API endpoint
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/4a412936-3bf7-4c02-b121-c0c342c34f1b Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -147,6 +147,22 @@ class ReportStore:
|
||||
"""
|
||||
return self.domain_summary
|
||||
|
||||
def get_report_by_id(self, report_id: str) -> Optional[Dict[str, Any]]:
|
||||
"""
|
||||
Find a report by its report_id across all domains.
|
||||
|
||||
Args:
|
||||
report_id: Report identifier from the DMARC report metadata
|
||||
|
||||
Returns:
|
||||
The report dictionary if found, None otherwise
|
||||
"""
|
||||
for reports in self.domain_reports.values():
|
||||
for report in reports:
|
||||
if report.get("report_id") == report_id:
|
||||
return report
|
||||
return None
|
||||
|
||||
def get_domain_reports(self, domain: str, limit: Optional[int] = None) -> List[Dict[str, Any]]:
|
||||
"""
|
||||
Get all reports for a domain
|
||||
|
||||
Reference in New Issue
Block a user