mirror of
https://github.com/jakejarvis/rdapper.git
synced 2026-09-23 01:25:31 -04:00
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:
@@ -80,3 +80,30 @@ test("normalizeRdap maps registrar, contacts, nameservers, events, dnssec", () =
|
||||
expect(rec.whoisServer).toBe("whois.example-registrar.test");
|
||||
expect(rec.source).toBe("rdap");
|
||||
});
|
||||
|
||||
test("normalizeRdap derives privacyEnabled from registrant keywords", () => {
|
||||
const rdap = {
|
||||
ldhName: "example.com",
|
||||
unicodeName: "example.com",
|
||||
entities: [
|
||||
{
|
||||
roles: ["registrant"],
|
||||
vcardArray: [
|
||||
"vcard",
|
||||
[
|
||||
["fn", {}, "text", "REDACTED FOR PRIVACY"],
|
||||
["org", {}, "text", "Example Org"],
|
||||
],
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
const rec = normalizeRdap(
|
||||
"example.com",
|
||||
"com",
|
||||
rdap,
|
||||
["https://rdap.example/"],
|
||||
"2025-01-01T00:00:00Z",
|
||||
);
|
||||
expect(rec.privacyEnabled).toBe(true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user