New privacyEnabled field to detect redaction based on keyword heuristics

Updated the DomainRecord interface to include detailed comments for clarity and added a new privacyEnabled field to indicate if the registrant's information is privacy-redacted. Enhanced normalization functions for both RDAP and WHOIS to derive the privacy flag based on registrant keywords. Updated tests to verify the correct functionality of privacy detection in both normalization processes. Additionally, the README was updated to reflect the inclusion of the privacy flag in the normalized output.
This commit is contained in:
2025-10-08 21:31:21 -04:00
parent 57209eae39
commit 2c9904e5e8
7 changed files with 146 additions and 26 deletions
+2 -1
View File
@@ -4,7 +4,7 @@ RDAPfirst domain registration lookups with WHOIS fallback. Produces a single,
- RDAP discovery via IANA bootstrap (`https://data.iana.org/rdap/dns.json`)
- WHOIS TCP 43 client with TLD discovery, registrar referral follow, and curated exceptions
- Normalized output: registrar, contacts, nameservers, statuses, dates, DNSSEC, source metadata
- Normalized output: registrar, contacts, nameservers, statuses, dates, DNSSEC, privacy flag, source metadata
- TypeScript types included; ESMonly; no external HTTP client (uses global `fetch`)
### [🦉 See it in action on hoot.sh!](https://hoot.sh)
@@ -117,6 +117,7 @@ interface DomainRecord {
country?: string;
countryCode?: string;
}>;
privacyEnabled?: boolean; // registrant appears privacy-redacted based on keyword heuristics
whoisServer?: string; // authoritative WHOIS queried (if any)
rdapServers?: string[]; // RDAP base URLs tried
rawRdap?: unknown; // raw RDAP JSON (only when options.includeRaw)