summaryrefslogtreecommitdiff
path: root/DomainDig/SubdomainDiscoveryService.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-24 12:38:38 -0500
committerChristian Cleberg <[email protected]>2026-04-24 12:38:38 -0500
commitd0b3b7a15b59266b4ae4262fdb0364245092c17c (patch)
tree5adb0df9963caf78aa98fa17adfb2c175291ded9 /DomainDig/SubdomainDiscoveryService.swift
parentb35f1b432fc24fbab1fa05593c9a0bca7e4d95a6 (diff)
downloaddomain-dig-d0b3b7a15b59266b4ae4262fdb0364245092c17c.tar.gz
domain-dig-d0b3b7a15b59266b4ae4262fdb0364245092c17c.tar.bz2
domain-dig-d0b3b7a15b59266b4ae4262fdb0364245092c17c.zip
feat(v3.7.0): add timeline and advanced diffing system
- introduce TimelineView for historical snapshots - allow comparison between any two snapshots - implement DiffService for structured domain diffs - improve diff visualization with clear change indicators - add navigation across changes - optimize history loading for performance - extend CLI and export to support timeline data
Diffstat (limited to 'DomainDig/SubdomainDiscoveryService.swift')
-rw-r--r--DomainDig/SubdomainDiscoveryService.swift11
1 files changed, 11 insertions, 0 deletions
diff --git a/DomainDig/SubdomainDiscoveryService.swift b/DomainDig/SubdomainDiscoveryService.swift
index 7339648..4511edd 100644
--- a/DomainDig/SubdomainDiscoveryService.swift
+++ b/DomainDig/SubdomainDiscoveryService.swift
@@ -17,6 +17,7 @@ enum SubdomainDiscoveryService {
}
private static func fetchSubdomains(for domain: String, limit: Int) async -> ServiceResult<[DiscoveredSubdomain]> {
+ let startedAt = DomainDebugLog.signpostStart("SubdomainDiscovery.fetch", domain: domain)
var components = URLComponents(string: "https://crt.sh/")!
components.queryItems = [
URLQueryItem(name: "q", value: "%.\(domain)"),
@@ -29,15 +30,25 @@ enum SubdomainDiscoveryService {
do {
let request = URLRequest(url: url, timeoutInterval: 10)
+ DomainDebugLog.debug("SubdomainDiscovery.request url=\(url.absoluteString) timeout=10")
let (data, response) = try await URLSession.shared.data(for: request)
guard let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode == 200 else {
+ DomainDebugLog.error("SubdomainDiscovery.badResponse domain=\(domain)")
return .error("Subdomain discovery unavailable")
}
let entries = try JSONDecoder().decode([CRTShEntry].self, from: data)
let subdomains = parseSubdomains(from: entries, domain: domain, limit: limit)
+ DomainDebugLog.signpostEnd(
+ "SubdomainDiscovery.fetch",
+ start: startedAt,
+ domain: domain,
+ extra: "entries=\(entries.count) subdomains=\(subdomains.count)"
+ )
return subdomains.isEmpty ? .empty("No passive subdomains found") : .success(subdomains)
} catch {
+ DomainDebugLog.error("SubdomainDiscovery.error domain=\(domain) error=\(error.localizedDescription)")
+ DomainDebugLog.signpostEnd("SubdomainDiscovery.fetch", start: startedAt, domain: domain, extra: "error")
return .error(error.localizedDescription)
}
}