Put help information on the main page

It turns out that the RDAP spec does not envision multiple help pages. We can
still support them (for the TOS, for instance), but we shouldn't expect users
to go searching for help other than the main page. Therefore, consolidate the
useful information on the main page, and get rid of some of the others.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178792548
This commit is contained in:
mountford 2017-12-12 11:50:54 -08:00 committed by jianglai
parent b825a2b5a8
commit fb25b86212
4 changed files with 17 additions and 56 deletions

View file

@ -1086,22 +1086,6 @@ public final class RegistryConfig {
return new ImmutableMap.Builder<String, RdapNoticeDescriptor>() return new ImmutableMap.Builder<String, RdapNoticeDescriptor>()
.put("/", RdapNoticeDescriptor.builder() .put("/", RdapNoticeDescriptor.builder()
.setTitle("RDAP Help") .setTitle("RDAP Help")
.setDescription(ImmutableList.of(
"RDAP Help Topics (use /help/index for information)",
"syntax",
"tos (Terms of Service)"))
.setLinkValueSuffix("help/")
.build())
.put("/index", RdapNoticeDescriptor.builder()
.setTitle("RDAP Help")
.setDescription(ImmutableList.of(
"RDAP Help Topics (use /help/index for information)",
"syntax",
"tos (Terms of Service)"))
.setLinkValueSuffix("help/index")
.build())
.put("/syntax", RdapNoticeDescriptor.builder()
.setTitle("RDAP Command Syntax")
.setDescription(ImmutableList.of( .setDescription(ImmutableList.of(
"domain/XXXX", "domain/XXXX",
"nameserver/XXXX", "nameserver/XXXX",
@ -1114,7 +1098,7 @@ public final class RegistryConfig {
"entities?fn=XXXX", "entities?fn=XXXX",
"entities?handle=XXXX", "entities?handle=XXXX",
"help/XXXX")) "help/XXXX"))
.setLinkValueSuffix("help/syntax") .setLinkValueSuffix("help/")
.setLinkHrefUrlString("https://github.com/google/nomulus/blob/master/docs/rdap.md") .setLinkHrefUrlString("https://github.com/google/nomulus/blob/master/docs/rdap.md")
.build()) .build())
.put("/tos", RdapNoticeDescriptor.builder() .put("/tos", RdapNoticeDescriptor.builder()

View file

@ -104,13 +104,6 @@ public class RdapHelpActionTest {
assertThat(response.getStatus()).isEqualTo(404); assertThat(response.getStatus()).isEqualTo(404);
} }
@Test
public void testHelpActionIndex_works() throws Exception {
assertThat(generateActualJson("/index"))
.isEqualTo(generateExpectedJson("index", "rdap_help_index.json"));
assertThat(response.getStatus()).isEqualTo(200);
}
@Test @Test
public void testHelpActionDefault_getsIndex() throws Exception { public void testHelpActionDefault_getsIndex() throws Exception {
assertThat(generateActualJson("")) assertThat(generateActualJson(""))
@ -125,12 +118,6 @@ public class RdapHelpActionTest {
assertThat(response.getStatus()).isEqualTo(200); assertThat(response.getStatus()).isEqualTo(200);
} }
@Test
public void testHelpActionSyntax_works() throws Exception {
generateActualJson("/syntax");
assertThat(response.getStatus()).isEqualTo(200);
}
@Test @Test
public void testHelpActionTos_works() throws Exception { public void testHelpActionTos_works() throws Exception {
assertThat(generateActualJson("/tos")) assertThat(generateActualJson("/tos"))

View file

@ -200,24 +200,6 @@ public class RdapTestHelper {
"/", "/",
RdapNoticeDescriptor.builder() RdapNoticeDescriptor.builder()
.setTitle("RDAP Help") .setTitle("RDAP Help")
.setDescription(ImmutableList.of(
"RDAP Help Topics (use /help/topic for information)",
"syntax",
"tos (Terms of Service)"))
.setLinkValueSuffix("help/")
.build(),
"/index",
RdapNoticeDescriptor.builder()
.setTitle("RDAP Help")
.setDescription(ImmutableList.of(
"RDAP Help Topics (use /help/topic for information)",
"syntax",
"tos (Terms of Service)"))
.setLinkValueSuffix("help/index")
.build(),
"/syntax",
RdapNoticeDescriptor.builder()
.setTitle("RDAP Command Syntax")
.setDescription(ImmutableList.of( .setDescription(ImmutableList.of(
"domain/XXXX", "domain/XXXX",
"nameserver/XXXX", "nameserver/XXXX",
@ -230,8 +212,8 @@ public class RdapTestHelper {
"entities?fn=XXXX", "entities?fn=XXXX",
"entities?handle=XXXX", "entities?handle=XXXX",
"help/XXXX")) "help/XXXX"))
.setLinkValueSuffix("help/syntax") .setLinkValueSuffix("help/")
.setLinkHrefUrlString("https://www.registry.tld/about/rdap/syntax.html") .setLinkHrefUrlString("https://github.com/google/nomulus/blob/master/docs/rdap.md")
.build(), .build(),
"/tos", "/tos",
RdapNoticeDescriptor.builder() RdapNoticeDescriptor.builder()

View file

@ -6,17 +6,25 @@
"title" : "RDAP Help", "title" : "RDAP Help",
"description" : "description" :
[ [
"RDAP Help Topics (use \/help\/topic for information)", "domain/XXXX",
"syntax", "nameserver/XXXX",
"tos (Terms of Service)" "entity/XXXX",
"domains?name=XXXX",
"domains?nsLdhName=XXXX",
"domains?nsIp=XXXX",
"nameservers?name=XXXX",
"nameservers?ip=XXXX",
"entities?fn=XXXX",
"entities?handle=XXXX",
"help/XXXX"
], ],
"links" : "links" :
[ [
{ {
"value" : "https://example.tld/rdap/help/%NAME%", "value" : "https://example.tld/rdap/help/%NAME%",
"rel" : "self", "rel" : "alternate",
"type" : "application/rdap+json", "type" : "text/html",
"href" : "https://example.tld/rdap/help/%NAME%" "href" : "https://github.com/google/nomulus/blob/master/docs/rdap.md"
} }
] ]
}, },