RDAP: Use IANA identifier as the registrar handle

According to the ICAAN operation profile:

2.1.7. Registries MUST support lookup for entities with the registrar role within other objects using the handle (as described in 3.1.5 of RFC7482). The handle of the entity with the registrar role MUST be equal to IANA Registrar ID. The entity with the registrar role in the RDAP response MUST contain a publicIDs member to identify the IANA Registrar ID from the IANA’s Registrar ID registry. The type value of the publicID object MUST be equal to IANA Registrar ID.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130452501
This commit is contained in:
mountford 2016-08-16 15:09:29 -07:00 committed by Ben McIlwain
parent 27820c512e
commit 4a34807b1d
10 changed files with 114 additions and 53 deletions

View file

@ -99,12 +99,12 @@ public class RdapEntitySearchActionTest {
registrar =
persistResource(
makeRegistrar("2-Registrar", "Yes Virginia <script>", Registrar.State.ACTIVE));
makeRegistrar("2-Registrar", "Yes Virginia <script>", Registrar.State.ACTIVE, 20L));
persistSimpleResources(makeRegistrarContacts(registrar));
// inactive
registrarInactive =
persistResource(makeRegistrar("2-RegistrarInact", "No Way", Registrar.State.PENDING));
persistResource(makeRegistrar("2-RegistrarInact", "No Way", Registrar.State.PENDING, 21L));
persistSimpleResources(makeRegistrarContacts(registrarInactive));
// test
@ -270,7 +270,7 @@ public class RdapEntitySearchActionTest {
assertThat(generateActualJsonWithFullName("Yes Virginia <script>"))
.isEqualTo(
generateExpectedJsonForEntity(
"2-Registrar", "Yes Virginia <script>", null, null, "rdap_registrar.json"));
"20", "Yes Virginia <script>", null, null, "rdap_registrar.json"));
assertThat(response.getStatus()).isEqualTo(200);
}
@ -288,11 +288,11 @@ public class RdapEntitySearchActionTest {
}
@Test
public void testHandleMatch_registrar_found() throws Exception {
assertThat(generateActualJsonWithHandle("2-Registrar"))
public void testHandleMatch_20_found() throws Exception {
assertThat(generateActualJsonWithHandle("20"))
.isEqualTo(
generateExpectedJsonForEntity(
"2-Registrar", "Yes Virginia <script>", null, null, "rdap_registrar.json"));
"20", "Yes Virginia <script>", null, null, "rdap_registrar.json"));
assertThat(response.getStatus()).isEqualTo(200);
}
@ -314,13 +314,6 @@ public class RdapEntitySearchActionTest {
assertThat(response.getStatus()).isEqualTo(404);
}
@Test
public void testHandleMatch_2rstar_found() throws Exception {
assertThat(generateActualJsonWithHandle("2-R*"))
.isEqualTo(generateExpectedJson("rdap_multiple_contacts.json"));
assertThat(response.getStatus()).isEqualTo(200);
}
@Test
public void testHandleMatch_2rstarWithResultSetSize1_foundOne() throws Exception {
action.rdapResultSetMaxSize = 1;
@ -349,12 +342,9 @@ public class RdapEntitySearchActionTest {
}
@Test
public void testHandleMatch_2registstar_found() throws Exception {
assertThat(generateActualJsonWithHandle("2-Regist*"))
.isEqualTo(
generateExpectedJsonForEntity(
"2-Registrar", "Yes Virginia <script>", null, null, "rdap_registrar.json"));
assertThat(response.getStatus()).isEqualTo(200);
public void testHandleMatch_20star_notFound() throws Exception {
generateActualJsonWithHandle("20*");
assertThat(response.getStatus()).isEqualTo(404);
}
@Test