summaryrefslogtreecommitdiff
path: root/DomainDig/DiffService.swift
diff options
context:
space:
mode:
Diffstat (limited to 'DomainDig/DiffService.swift')
-rw-r--r--DomainDig/DiffService.swift15
1 files changed, 15 insertions, 0 deletions
diff --git a/DomainDig/DiffService.swift b/DomainDig/DiffService.swift
index 948f470..211a16e 100644
--- a/DomainDig/DiffService.swift
+++ b/DomainDig/DiffService.swift
@@ -115,6 +115,7 @@ enum DiffService {
emailSection(from: oldReport, to: newReport),
networkSection(from: oldReport, to: newReport),
subdomainsSection(from: oldReport, to: newReport),
+ intelligenceSection(from: oldReport, to: newReport),
riskSection(from: oldReport, to: newReport)
]
@@ -384,6 +385,20 @@ enum DiffService {
)
}
+ private static func intelligenceSection(from oldReport: DomainReport, to newReport: DomainReport) -> DiffSection {
+ DiffSection(
+ id: "intelligence",
+ title: "Data+ Intelligence",
+ items: [
+ compare(id: "intel-provider", label: "Provider", oldValue: oldReport.inferredProvider?.name, newValue: newReport.inferredProvider?.name, severity: .medium),
+ compare(id: "intel-classification", label: "Classification", oldValue: oldReport.domainClassification?.kind.title, newValue: newReport.domainClassification?.kind.title, severity: .medium),
+ compare(id: "intel-hosting-history", label: "Hosting Transitions", oldValue: joined(oldReport.hostingTransitions.map(\.summary)), newValue: joined(newReport.hostingTransitions.map(\.summary)), severity: .medium),
+ compare(id: "intel-ownership-history", label: "Ownership Transitions", oldValue: joined(oldReport.ownershipTransitions.map(\.summary)), newValue: joined(newReport.ownershipTransitions.map(\.summary)), severity: .high),
+ compare(id: "intel-risk-signals", label: "Risk Signals", oldValue: joined(oldReport.riskSignals.map(\.title)), newValue: joined(newReport.riskSignals.map(\.title)), severity: .medium)
+ ].compactMap { $0 }
+ )
+ }
+
private static func compare(
id: String,
label: String,