From 7dcadaecf62d7a7ff48af3ef9703ccf9a18c2618 Mon Sep 17 00:00:00 2001 From: mountford Date: Fri, 17 Aug 2018 12:34:13 -0700 Subject: [PATCH] RDAP: Always use summary output format for registrar entities For domains (and soon for hosts as well), we output data about the owning registrar. These subrecords wind up being really big if we include all data, because they also list all the registrar contacts. To avoid bloating the RDAP responses, change to output domain response registrar information in summary format, meaning we skip the registrar contacts and events. The requester can still get this information by using the link provided to request the registrar directly. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=209189993 --- .../registry/rdap/RdapJsonFormatter.java | 23 +++---- .../registry/rdap/testdata/rdap_domain.json | 44 ++---------- .../rdap/testdata/rdap_domain_cat2.json | 44 ++---------- .../rdap/testdata/rdap_domain_deleted.json | 44 ++---------- .../testdata/rdap_domain_no_contacts.json | 50 ++------------ .../rdap_domain_no_contacts_with_remark.json | 50 ++------------ .../rdap/testdata/rdap_domain_unicode.json | 44 ++---------- ...omain_unicode_no_contacts_with_remark.json | 50 ++------------ .../rdap/testdata/rdapjson_domain_full.json | 66 ++---------------- .../testdata/rdapjson_domain_logged_out.json | 68 ++----------------- .../rdapjson_domain_no_nameservers.json | 66 ++---------------- 11 files changed, 65 insertions(+), 484 deletions(-) diff --git a/java/google/registry/rdap/RdapJsonFormatter.java b/java/google/registry/rdap/RdapJsonFormatter.java index 1101ca695..cbf345b0c 100644 --- a/java/google/registry/rdap/RdapJsonFormatter.java +++ b/java/google/registry/rdap/RdapJsonFormatter.java @@ -545,12 +545,7 @@ public class RdapJsonFormatter { } entities = addRegistrarEntity( - entities, - domainResource.getCurrentSponsorClientId(), - linkBase, - whoisServer, - now, - outputDataType); + entities, domainResource.getCurrentSponsorClientId(), linkBase, whoisServer, now); if (!entities.isEmpty()) { jsonBuilder.put("entities", entities); } @@ -582,22 +577,21 @@ public class RdapJsonFormatter { } /** - * Adds a JSON object for the desired registrar to an existing array of JSON objects. + * Adds a JSON object for the desired registrar to an existing list of JSON objects. * + * @param entities list of entities to which the desired registrar should be added * @param clientId the registrar client ID * @param linkBase the URL base to be used when creating links * @param whoisServer the fully-qualified domain name of the WHOIS server to be listed in the - * port43 field; if null, port43 is not added to the object + * port43 field; if null, port43 is not added to the object * @param now the as-date - * @param outputDataType whether to generate full or summary data */ ImmutableList> addRegistrarEntity( ImmutableList> entities, @Nullable String clientId, @Nullable String linkBase, @Nullable String whoisServer, - DateTime now, - OutputDataType outputDataType) { + DateTime now) { if (clientId == null) { return entities; } @@ -609,7 +603,12 @@ public class RdapJsonFormatter { builder.addAll(entities); builder.add( makeRdapJsonForRegistrar( - registrar.get(), false /* isTopLevel */, linkBase, whoisServer, now, outputDataType)); + registrar.get(), + false /* isTopLevel */, + linkBase, + whoisServer, + now, + OutputDataType.SUMMARY)); return builder.build(); } diff --git a/javatests/google/registry/rdap/testdata/rdap_domain.json b/javatests/google/registry/rdap/testdata/rdap_domain.json index c4c822ade..a0ddc3655 100644 --- a/javatests/google/registry/rdap/testdata/rdap_domain.json +++ b/javatests/google/registry/rdap/testdata/rdap_domain.json @@ -395,17 +395,6 @@ "value": "https://example.com/rdap/entity/1" } ], - "events": [ - { - "eventAction": "registration", - "eventActor": "1", - "eventDate": "2000-01-01T00:00:00.000Z" - }, - { - "eventAction": "last update of RDAP database", - "eventDate": "2000-01-01T00:00:00.000Z" - } - ], "vcardArray" : [ "vcard", [ @@ -436,36 +425,13 @@ "identifier":"1" } ], - "entities" : [ + "remarks": [ { - "status" : ["active"], - "vcardArray" : [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "Jane Doe"], - ["tel", {"type":["voice"]}, "uri", "tel:+1.2125551215"], - ["tel", {"type":["fax"]}, "uri","tel:+1.2125551216"], - ["email", {}, "text", "janedoe@example.com"] - ] + "title": "Incomplete Data", + "description": [ + "Summary data only. For complete data, send a specific query for the object." ], - "roles" : ["administrative"], - "objectClassName" : "entity" - }, - { - "status" : ["active"], - "vcardArray" : [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "John Doe"], - ["tel", {"type":["voice"]}, "uri", "tel:+1.2125551213"], - ["tel", {"type":["fax"]}, "uri", "tel:+1.2125551213"], - ["email", {}, "text", "johndoe@example.com"] - ] - ], - "roles" : ["technical"], - "objectClassName" : "entity" + "type": "object truncated due to unexplainable reasons" } ] } diff --git a/javatests/google/registry/rdap/testdata/rdap_domain_cat2.json b/javatests/google/registry/rdap/testdata/rdap_domain_cat2.json index f6c7659e9..94c974aa5 100644 --- a/javatests/google/registry/rdap/testdata/rdap_domain_cat2.json +++ b/javatests/google/registry/rdap/testdata/rdap_domain_cat2.json @@ -395,17 +395,6 @@ "value": "https://example.com/rdap/entity/1" } ], - "events": [ - { - "eventAction": "registration", - "eventActor": "1", - "eventDate": "2000-01-01T00:00:00.000Z" - }, - { - "eventAction": "last update of RDAP database", - "eventDate": "2000-01-01T00:00:00.000Z" - } - ], "vcardArray" : [ "vcard", [ @@ -436,36 +425,13 @@ "identifier":"1" } ], - "entities" : [ + "remarks": [ { - "status" : ["active"], - "vcardArray" : [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "Jane Doe"], - ["tel", {"type":["voice"]}, "uri", "tel:+1.2125551215"], - ["tel", {"type":["fax"]}, "uri","tel:+1.2125551216"], - ["email", {}, "text", "janedoe@example.com"] - ] + "title": "Incomplete Data", + "description": [ + "Summary data only. For complete data, send a specific query for the object." ], - "roles" : ["administrative"], - "objectClassName" : "entity" - }, - { - "status" : ["active"], - "vcardArray" : [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "John Doe"], - ["tel", {"type":["voice"]}, "uri", "tel:+1.2125551213"], - ["tel", {"type":["fax"]}, "uri", "tel:+1.2125551213"], - ["email", {}, "text", "johndoe@example.com"] - ] - ], - "roles" : ["technical"], - "objectClassName" : "entity" + "type": "object truncated due to unexplainable reasons" } ] } diff --git a/javatests/google/registry/rdap/testdata/rdap_domain_deleted.json b/javatests/google/registry/rdap/testdata/rdap_domain_deleted.json index 05bd8d0c8..275bcdeea 100644 --- a/javatests/google/registry/rdap/testdata/rdap_domain_deleted.json +++ b/javatests/google/registry/rdap/testdata/rdap_domain_deleted.json @@ -397,17 +397,6 @@ "value": "https://example.com/rdap/entity/1" } ], - "events": [ - { - "eventAction": "registration", - "eventActor": "1", - "eventDate": "2000-01-01T00:00:00.000Z" - }, - { - "eventAction": "last update of RDAP database", - "eventDate": "2000-01-01T00:00:00.000Z" - } - ], "vcardArray" : [ "vcard", [ @@ -438,36 +427,13 @@ "identifier":"1" } ], - "entities" : [ + "remarks": [ { - "status" : ["active"], - "vcardArray" : [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "Jane Doe"], - ["tel", {"type":["voice"]}, "uri", "tel:+1.2125551215"], - ["tel", {"type":["fax"]}, "uri","tel:+1.2125551216"], - ["email", {}, "text", "janedoe@example.com"] - ] + "title": "Incomplete Data", + "description": [ + "Summary data only. For complete data, send a specific query for the object." ], - "roles" : ["administrative"], - "objectClassName" : "entity" - }, - { - "status" : ["active"], - "vcardArray" : [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "John Doe"], - ["tel", {"type":["voice"]}, "uri", "tel:+1.2125551213"], - ["tel", {"type":["fax"]}, "uri", "tel:+1.2125551213"], - ["email", {}, "text", "johndoe@example.com"] - ] - ], - "roles" : ["technical"], - "objectClassName" : "entity" + "type": "object truncated due to unexplainable reasons" } ] } diff --git a/javatests/google/registry/rdap/testdata/rdap_domain_no_contacts.json b/javatests/google/registry/rdap/testdata/rdap_domain_no_contacts.json index 1cb55933f..45d568469 100644 --- a/javatests/google/registry/rdap/testdata/rdap_domain_no_contacts.json +++ b/javatests/google/registry/rdap/testdata/rdap_domain_no_contacts.json @@ -118,18 +118,6 @@ "type" : "application/rdap+json" } ], - "events" : - [ - { - "eventAction": "registration", - "eventActor": "1", - "eventDate": "2000-01-01T00:00:00.000Z" - }, - { - "eventAction": "last update of RDAP database", - "eventDate": "2000-01-01T00:00:00.000Z" - } - ], "publicIds" : [ { @@ -156,39 +144,13 @@ ["email", {}, "text", "contact-us@example.com"] ] ], - "entities" : - [ + "remarks": [ { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["administrative"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "Jane Doe"], - ["tel", {"type" : ["voice"]}, "uri", "tel:+1.2125551215"], - ["tel", {"type" : ["fax"]}, "uri", "tel:+1.2125551216"], - ["email", {}, "text", "janedoe@example.com"] - ] - ] - }, - { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["technical"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "John Doe"], - ["tel", {"type" : ["voice"]}, "uri", "tel:+1.2125551213"], - ["tel", {"type" : ["fax"]}, "uri", "tel:+1.2125551213"], - ["email", {}, "text", "johndoe@example.com"] - ] - ] + "title": "Incomplete Data", + "description": [ + "Summary data only. For complete data, send a specific query for the object." + ], + "type": "object truncated due to unexplainable reasons" } ] } diff --git a/javatests/google/registry/rdap/testdata/rdap_domain_no_contacts_with_remark.json b/javatests/google/registry/rdap/testdata/rdap_domain_no_contacts_with_remark.json index 7ba08d810..56401a7df 100644 --- a/javatests/google/registry/rdap/testdata/rdap_domain_no_contacts_with_remark.json +++ b/javatests/google/registry/rdap/testdata/rdap_domain_no_contacts_with_remark.json @@ -118,18 +118,6 @@ "type" : "application/rdap+json" } ], - "events" : - [ - { - "eventAction": "registration", - "eventActor": "1", - "eventDate": "2000-01-01T00:00:00.000Z" - }, - { - "eventAction": "last update of RDAP database", - "eventDate": "2000-01-01T00:00:00.000Z" - } - ], "publicIds" : [ { @@ -156,39 +144,13 @@ ["email", {}, "text", "contact-us@example.com"] ] ], - "entities" : - [ + "remarks": [ { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["administrative"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "Jane Doe"], - ["tel", {"type" : ["voice"]}, "uri", "tel:+1.2125551215"], - ["tel", {"type" : ["fax"]}, "uri", "tel:+1.2125551216"], - ["email", {}, "text", "janedoe@example.com"] - ] - ] - }, - { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["technical"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "John Doe"], - ["tel", {"type" : ["voice"]}, "uri", "tel:+1.2125551213"], - ["tel", {"type" : ["fax"]}, "uri", "tel:+1.2125551213"], - ["email", {}, "text", "johndoe@example.com"] - ] - ] + "title": "Incomplete Data", + "description": [ + "Summary data only. For complete data, send a specific query for the object." + ], + "type": "object truncated due to unexplainable reasons" } ] } diff --git a/javatests/google/registry/rdap/testdata/rdap_domain_unicode.json b/javatests/google/registry/rdap/testdata/rdap_domain_unicode.json index bf6ce0712..36bba7422 100644 --- a/javatests/google/registry/rdap/testdata/rdap_domain_unicode.json +++ b/javatests/google/registry/rdap/testdata/rdap_domain_unicode.json @@ -400,17 +400,6 @@ "value": "https://example.com/rdap/entity/1" } ], - "events": [ - { - "eventAction": "registration", - "eventActor": "1", - "eventDate": "2000-01-01T00:00:00.000Z" - }, - { - "eventAction": "last update of RDAP database", - "eventDate": "2000-01-01T00:00:00.000Z" - } - ], "vcardArray" : [ "vcard", [ @@ -441,36 +430,13 @@ "identifier":"1" } ], - "entities" : [ + "remarks": [ { - "status" : ["active"], - "vcardArray" : [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "Jane Doe"], - ["tel", {"type":["voice"]}, "uri", "tel:+1.2125551215"], - ["tel", {"type":["fax"]}, "uri","tel:+1.2125551216"], - ["email", {}, "text", "janedoe@example.com"] - ] + "title": "Incomplete Data", + "description": [ + "Summary data only. For complete data, send a specific query for the object." ], - "roles" : ["administrative"], - "objectClassName" : "entity" - }, - { - "status" : ["active"], - "vcardArray" : [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "John Doe"], - ["tel", {"type":["voice"]}, "uri", "tel:+1.2125551213"], - ["tel", {"type":["fax"]}, "uri", "tel:+1.2125551213"], - ["email", {}, "text", "johndoe@example.com"] - ] - ], - "roles" : ["technical"], - "objectClassName" : "entity" + "type": "object truncated due to unexplainable reasons" } ] } diff --git a/javatests/google/registry/rdap/testdata/rdap_domain_unicode_no_contacts_with_remark.json b/javatests/google/registry/rdap/testdata/rdap_domain_unicode_no_contacts_with_remark.json index 1785870f9..ac4bcd985 100644 --- a/javatests/google/registry/rdap/testdata/rdap_domain_unicode_no_contacts_with_remark.json +++ b/javatests/google/registry/rdap/testdata/rdap_domain_unicode_no_contacts_with_remark.json @@ -121,18 +121,6 @@ "type" : "application/rdap+json" } ], - "events" : - [ - { - "eventAction": "registration", - "eventActor": "1", - "eventDate": "2000-01-01T00:00:00.000Z" - }, - { - "eventAction": "last update of RDAP database", - "eventDate": "2000-01-01T00:00:00.000Z" - } - ], "publicIds" : [ { @@ -159,39 +147,13 @@ ["email", {}, "text", "contact-us@example.com"] ] ], - "entities" : - [ + "remarks": [ { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["administrative"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "Jane Doe"], - ["tel", {"type" : ["voice"]}, "uri", "tel:+1.2125551215"], - ["tel", {"type" : ["fax"]}, "uri", "tel:+1.2125551216"], - ["email", {}, "text", "janedoe@example.com"] - ] - ] - }, - { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["technical"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "John Doe"], - ["tel", {"type" : ["voice"]}, "uri", "tel:+1.2125551213"], - ["tel", {"type" : ["fax"]}, "uri", "tel:+1.2125551213"], - ["email", {}, "text", "johndoe@example.com"] - ] - ] + "title": "Incomplete Data", + "description": [ + "Summary data only. For complete data, send a specific query for the object." + ], + "type": "object truncated due to unexplainable reasons" } ] } diff --git a/javatests/google/registry/rdap/testdata/rdapjson_domain_full.json b/javatests/google/registry/rdap/testdata/rdapjson_domain_full.json index bbffe50bb..660137266 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_domain_full.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_domain_full.json @@ -255,22 +255,6 @@ "type" : "application/rdap+json" } ], - "events" : - [ - { - "eventAction": "registration", - "eventActor": "1", - "eventDate": "1999-01-01T00:00:00.000Z" - }, - { - "eventAction": "last changed", - "eventDate": "2000-01-01T00:00:00.000Z" - }, - { - "eventAction": "last update of RDAP database", - "eventDate": "2000-01-01T00:00:00.000Z" - } - ], "publicIds" : [ { @@ -297,53 +281,13 @@ ["email", {}, "text", "contact-us@example.com"] ] ], - "entities" : - [ + "remarks": [ { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["administrative"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "Jane Doe"], - ["tel", {"type" : ["voice"]}, "uri", "tel:+1.2125551215"], - ["email", {}, "text", "janedoe@example.com"] - ] - ], - }, - { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["technical"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "John Doe"], - ["tel", {"type" : ["fax"]}, "uri", "tel:+1.2125551213"], - ["email", {}, "text", "johndoe@example.com"] - ] - ], - }, - { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["administrative", "technical"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "Play Doe"], - ["tel", {"type" : ["voice"]}, "uri", "tel:+1.2125551217"], - ["tel", {"type" : ["fax"]}, "uri", "tel:+1.2125551218"], - ["email", {}, "text", "playdoe@example.com"] - ] + "title": "Incomplete Data", + "description": [ + "Summary data only. For complete data, send a specific query for the object." ], + "type": "object truncated due to unexplainable reasons" } ] } diff --git a/javatests/google/registry/rdap/testdata/rdapjson_domain_logged_out.json b/javatests/google/registry/rdap/testdata/rdapjson_domain_logged_out.json index b93e2dca6..a8b34ab4b 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_domain_logged_out.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_domain_logged_out.json @@ -118,22 +118,6 @@ "type" : "application/rdap+json" } ], - "events" : - [ - { - "eventAction": "registration", - "eventActor": "1", - "eventDate": "1999-01-01T00:00:00.000Z" - }, - { - "eventAction": "last changed", - "eventDate": "2000-01-01T00:00:00.000Z" - }, - { - "eventAction": "last update of RDAP database", - "eventDate": "2000-01-01T00:00:00.000Z" - } - ], "publicIds" : [ { @@ -160,53 +144,13 @@ ["email", {}, "text", "contact-us@example.com"] ] ], - "entities" : - [ + "remarks": [ { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["administrative"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "Jane Doe"], - ["tel", {"type" : ["voice"]}, "uri", "tel:+1.2125551215"], - ["email", {}, "text", "janedoe@example.com"] - ] - ] - }, - { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["technical"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "John Doe"], - ["tel", {"type" : ["fax"]}, "uri", "tel:+1.2125551213"], - ["email", {}, "text", "johndoe@example.com"] - ] - ] - }, - { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["administrative", "technical"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "Play Doe"], - ["tel", {"type" : ["voice"]}, "uri", "tel:+1.2125551217"], - ["tel", {"type" : ["fax"]}, "uri", "tel:+1.2125551218"], - ["email", {}, "text", "playdoe@example.com"] - ] - ] + "title": "Incomplete Data", + "description": [ + "Summary data only. For complete data, send a specific query for the object." + ], + "type": "object truncated due to unexplainable reasons" } ] } diff --git a/javatests/google/registry/rdap/testdata/rdapjson_domain_no_nameservers.json b/javatests/google/registry/rdap/testdata/rdapjson_domain_no_nameservers.json index f5df2c39c..00651e034 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_domain_no_nameservers.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_domain_no_nameservers.json @@ -191,22 +191,6 @@ "type" : "application/rdap+json" } ], - "events" : - [ - { - "eventAction": "registration", - "eventActor": "1", - "eventDate": "1999-01-01T00:00:00.000Z" - }, - { - "eventAction": "last changed", - "eventDate": "2000-01-01T00:00:00.000Z" - }, - { - "eventAction": "last update of RDAP database", - "eventDate": "2000-01-01T00:00:00.000Z" - } - ], "publicIds" : [ { @@ -233,53 +217,13 @@ ["email", {}, "text", "contact-us@example.com"] ] ], - "entities" : - [ + "remarks": [ { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["administrative"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "Jane Doe"], - ["tel", {"type" : ["voice"]}, "uri", "tel:+1.2125551215"], - ["email", {}, "text", "janedoe@example.com"] - ] - ], - }, - { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["technical"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "John Doe"], - ["tel", {"type" : ["fax"]}, "uri", "tel:+1.2125551213"], - ["email", {}, "text", "johndoe@example.com"] - ] - ], - }, - { - "objectClassName" : "entity", - "status" : ["active"], - "roles" : ["administrative", "technical"], - "vcardArray" : - [ - "vcard", - [ - ["version", {}, "text", "4.0"], - ["fn", {}, "text", "Play Doe"], - ["tel", {"type" : ["voice"]}, "uri", "tel:+1.2125551217"], - ["tel", {"type" : ["fax"]}, "uri", "tel:+1.2125551218"], - ["email", {}, "text", "playdoe@example.com"] - ] + "title": "Incomplete Data", + "description": [ + "Summary data only. For complete data, send a specific query for the object." ], + "type": "object truncated due to unexplainable reasons" } ] }