Default to skipping optional domain RDAP events (#2995)

We don't need these, so there's no point in adding database load (but we
leave the option to include them in the future). Note that these are,
and were, only ever included for domains so we don't need to worry about
hosts.
This commit is contained in:
gbrodman
2026-04-02 19:12:17 +00:00
committed by GitHub
parent 60e84e72d7
commit 9f3dfec118
8 changed files with 342 additions and 47 deletions
@@ -143,7 +143,7 @@ class RdapJsonFormatterTest {
makeDomain("cat.みんな", hostIpv4, hostIpv6, registrar)
.asBuilder()
.setCreationTimeForTest(clock.nowUtc().minusMonths(4))
.setLastEppUpdateTime(clock.nowUtc().minusMonths(3))
.setLastEppUpdateTime(clock.nowUtc().minusMonths(1))
.build());
domainNoNameserversNoTransfers =
persistResource(
@@ -307,6 +307,14 @@ class RdapJsonFormatterTest {
.isEqualTo(loadJson("rdapjson_domain_full.json"));
}
@Test
void testDomain_full_withHistory() {
rdapJsonFormatter.rdapIncludeOptionalHistoryResults = true;
assertAboutJson()
.that(rdapJsonFormatter.createRdapDomain(domainFull, OutputDataType.FULL).toJson())
.isEqualTo(loadJson("rdapjson_domain_full_with_history.json"));
}
@Test
void testDomain_summary() {
assertAboutJson()
@@ -333,6 +341,15 @@ class RdapJsonFormatterTest {
.isEqualTo(loadJson("rdapjson_domain_logged_out.json"));
}
@Test
void testDomain_logged_out_withHistory() {
rdapJsonFormatter.rdapAuthorization = RdapAuthorization.PUBLIC_AUTHORIZATION;
rdapJsonFormatter.rdapIncludeOptionalHistoryResults = true;
assertAboutJson()
.that(rdapJsonFormatter.createRdapDomain(domainFull, OutputDataType.FULL).toJson())
.isEqualTo(loadJson("rdapjson_domain_logged_out_with_history.json"));
}
@Test
void testDomain_noNameserversNoTransfers() {
assertAboutJson()
@@ -42,11 +42,6 @@
"eventAction": "last update of RDAP database",
"eventDate": "2000-01-01T00:00:00.000Z"
},
{
"eventAction": "deletion",
"eventActor": "evilregistrar",
"eventDate": "1999-07-01T00:00:00.000Z"
},
{
"eventAction": "last changed",
"eventDate": "2009-05-29T20:13:00.000Z"
@@ -37,11 +37,6 @@
"eventAction": "last update of RDAP database",
"eventDate": "2000-01-01T00:00:00.000Z"
},
{
"eventAction": "transfer",
"eventActor": "unicoderegistrar",
"eventDate": "1999-12-01T00:00:00.000Z"
},
{
"eventAction": "last changed",
"eventDate": "1999-12-01T00:00:00.000Z"
@@ -0,0 +1,144 @@
{
"objectClassName" : "domain",
"handle" : "F-Q9JYB4C",
"ldhName" : "cat.xn--q9jyb4c",
"unicodeName" : "cat.みんな",
"status" :
[
"client delete prohibited",
"client renew prohibited",
"client transfer prohibited",
"server update prohibited"
],
"links" :
[
{
"rel" : "self",
"href" : "https://example.tld/rdap/domain/cat.xn--q9jyb4c",
"type" : "application/rdap+json"
},
{
"rel" : "related",
"href" : "https://rdap.example.com/withSlash/domain/cat.xn--q9jyb4c",
"type" : "application/rdap+json"
}
],
"events": [
{
"eventAction": "registration",
"eventActor": "unicoderegistrar",
"eventDate": "1999-09-01T00:00:00.000Z"
},
{
"eventAction": "expiration",
"eventDate": "2110-10-08T00:44:59.000Z"
},
{
"eventAction": "last update of RDAP database",
"eventDate": "2000-01-01T00:00:00.000Z"
},
{
"eventAction": "last changed",
"eventDate": "1999-12-01T00:00:00.000Z"
},
{
"eventAction": "transfer",
"eventActor": "unicoderegistrar",
"eventDate": "1999-12-01T00:00:00.000Z"
}
],
"nameservers" :
[
{
"objectClassName" : "nameserver",
"handle" : "2-ROID",
"ldhName" : "ns1.cat.xn--q9jyb4c",
"unicodeName" : "ns1.cat.みんな",
"links" : [
{
"rel" : "self",
"href" : "https://example.tld/rdap/nameserver/ns1.cat.xn--q9jyb4c",
"type" : "application/rdap+json"
}
],
"remarks": [
{
"title": "Incomplete Data",
"type": "object truncated due to unexplainable reasons",
"description": ["Summary data only. For complete data, send a specific query for the object."]
}
]
},
{
"objectClassName" : "nameserver",
"handle" : "4-ROID",
"ldhName" : "ns2.cat.xn--q9jyb4c",
"unicodeName" : "ns2.cat.みんな",
"links" : [
{
"rel" : "self",
"href" : "https://example.tld/rdap/nameserver/ns2.cat.xn--q9jyb4c",
"type" : "application/rdap+json"
}
],
"remarks": [
{
"title": "Incomplete Data",
"type": "object truncated due to unexplainable reasons",
"description": ["Summary data only. For complete data, send a specific query for the object."]
}
]
}
],
"secureDNS": {
"delegationSigned": true,
"zoneSigned": true,
"dsData": [{"algorithm":2,"digest":"DEADFACE","digestType":3,"keyTag":1}]
},
"entities" :
[
{
"objectClassName" : "entity",
"handle" : "1",
"roles" : ["registrar"],
"links" :
[
{
"rel" : "self",
"href" : "https://example.tld/rdap/entity/1",
"type" : "application/rdap+json"
},
{
"rel": "about",
"href": "http://my.fake.url",
"type": "text/html",
"value": "https://rdap.example.com/withSlash/"
}
],
"publicIds" :
[
{
"type" : "IANA Registrar ID",
"identifier" : "1"
}
],
"vcardArray" :
[
"vcard",
[
["version", {}, "text", "4.0"],
["fn", {}, "text", "みんな"]
]
],
"remarks": [
{
"title": "Incomplete Data",
"description": [
"Summary data only. For complete data, send a specific query for the object."
],
"type": "object truncated due to unexplainable reasons"
}
]
}
]
}
@@ -37,11 +37,6 @@
"eventAction": "last update of RDAP database",
"eventDate": "2000-01-01T00:00:00.000Z"
},
{
"eventAction": "transfer",
"eventActor": "unicoderegistrar",
"eventDate": "1999-12-01T00:00:00.000Z"
},
{
"eventAction": "last changed",
"eventDate": "1999-12-01T00:00:00.000Z"
@@ -0,0 +1,140 @@
{
"objectClassName": "domain",
"handle": "F-Q9JYB4C",
"ldhName": "cat.xn--q9jyb4c",
"unicodeName": "cat.みんな",
"status":
[
"client delete prohibited",
"client renew prohibited",
"client transfer prohibited",
"server update prohibited"
],
"links":
[
{
"rel": "self",
"href": "https://example.tld/rdap/domain/cat.xn--q9jyb4c",
"type": "application/rdap+json"
},
{
"href": "https://rdap.example.com/withSlash/domain/cat.xn--q9jyb4c",
"type": "application/rdap+json",
"rel": "related"
}
],
"events": [
{
"eventAction": "registration",
"eventActor": "unicoderegistrar",
"eventDate": "1999-09-01T00:00:00.000Z"
},
{
"eventAction": "expiration",
"eventDate": "2110-10-08T00:44:59.000Z"
},
{
"eventAction": "last update of RDAP database",
"eventDate": "2000-01-01T00:00:00.000Z"
},
{
"eventAction": "last changed",
"eventDate": "1999-12-01T00:00:00.000Z"
},
{
"eventAction": "transfer",
"eventActor": "unicoderegistrar",
"eventDate": "1999-12-01T00:00:00.000Z"
}
],
"nameservers": [
{
"objectClassName": "nameserver",
"handle": "2-ROID",
"ldhName": "ns1.cat.xn--q9jyb4c",
"unicodeName": "ns1.cat.みんな",
"links": [
{
"rel": "self",
"href": "https://example.tld/rdap/nameserver/ns1.cat.xn--q9jyb4c",
"type": "application/rdap+json"
}
],
"remarks": [
{
"title": "Incomplete Data",
"type": "object truncated due to unexplainable reasons",
"description": ["Summary data only. For complete data, send a specific query for the object."]
}
]
},
{
"objectClassName": "nameserver",
"handle": "4-ROID",
"ldhName": "ns2.cat.xn--q9jyb4c",
"unicodeName": "ns2.cat.みんな",
"links": [
{
"rel": "self",
"href": "https://example.tld/rdap/nameserver/ns2.cat.xn--q9jyb4c",
"type": "application/rdap+json"
}
],
"remarks": [
{
"title": "Incomplete Data",
"type": "object truncated due to unexplainable reasons",
"description": ["Summary data only. For complete data, send a specific query for the object."]
}
]
}
],
"secureDNS": {
"delegationSigned": true,
"dsData": [{"algorithm":2,"digest":"DEADFACE","digestType":3,"keyTag":1}],
"zoneSigned": true
},
"entities": [
{
"objectClassName": "entity",
"handle": "1",
"roles": ["registrar"],
"links": [
{
"rel": "self",
"href": "https://example.tld/rdap/entity/1",
"type": "application/rdap+json"
},
{
"rel": "about",
"href": "http://my.fake.url",
"type": "text/html",
"value": "https://rdap.example.com/withSlash/"
}
],
"publicIds": [
{
"type": "IANA Registrar ID",
"identifier": "1"
}
],
"vcardArray":
[
"vcard",
[
["version", {}, "text", "4.0"],
["fn", {}, "text", "みんな"]
]
],
"remarks": [
{
"title": "Incomplete Data",
"description": [
"Summary data only. For complete data, send a specific query for the object."
],
"type": "object truncated due to unexplainable reasons"
}
]
}
]
}