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

@ -75,7 +75,7 @@ public class RdapEntityActionTest {
// lol
createTld("lol");
registrarLol = persistResource(makeRegistrar(
"evilregistrar", "Yes Virginia <script>", Registrar.State.ACTIVE));
"evilregistrar", "Yes Virginia <script>", Registrar.State.ACTIVE, 101L));
persistSimpleResources(makeRegistrarContacts(registrarLol));
registrant = makeAndPersistContactResource(
"8372808-ERL",
@ -108,8 +108,8 @@ public class RdapEntityActionTest {
registrarLol));
// xn--q9jyb4c
createTld("xn--q9jyb4c");
Registrar registrarIdn =
persistResource(makeRegistrar("idnregistrar", "IDN Registrar", Registrar.State.ACTIVE));
Registrar registrarIdn = persistResource(
makeRegistrar("idnregistrar", "IDN Registrar", Registrar.State.ACTIVE, 102L));
persistSimpleResources(makeRegistrarContacts(registrarIdn));
persistResource(makeDomainResource("cat.みんな",
registrant,
@ -120,7 +120,7 @@ public class RdapEntityActionTest {
registrarIdn));
createTld("1.tld");
Registrar registrar1tld = persistResource(
makeRegistrar("1tldregistrar", "Multilevel Registrar", Registrar.State.ACTIVE));
makeRegistrar("1tldregistrar", "Multilevel Registrar", Registrar.State.ACTIVE, 103L));
persistSimpleResources(makeRegistrarContacts(registrar1tld));
persistResource(makeDomainResource("cat.1.tld",
registrant,
@ -238,12 +238,29 @@ public class RdapEntityActionTest {
@Test
public void testRegistrar_works() throws Exception {
assertThat(generateActualJson(registrarLol.getClientIdentifier())).isEqualTo(
generateExpectedJsonWithTopLevelEntries(
registrarLol.getClientIdentifier(), "rdap_registrar.json"));
assertThat(generateActualJson("101")).isEqualTo(
generateExpectedJsonWithTopLevelEntries("101", "rdap_registrar.json"));
assertThat(response.getStatus()).isEqualTo(200);
}
@Test
public void testRegistrar102_works() throws Exception {
generateActualJson("102");
assertThat(response.getStatus()).isEqualTo(200);
}
@Test
public void testRegistrar103_works() throws Exception {
generateActualJson("103");
assertThat(response.getStatus()).isEqualTo(200);
}
@Test
public void testRegistrar104_doesNotExist() throws Exception {
generateActualJson("104");
assertThat(response.getStatus()).isEqualTo(404);
}
@Test
public void testDeletedContact_returns404() throws Exception {
assertThat(generateActualJson(deletedContact.getRepoId())).isEqualTo(