RDAP: Add link to static TOS page

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219332975
This commit is contained in:
mountford 2018-10-30 11:17:40 -07:00 committed by jianglai
parent 57f06258d3
commit 09202562c7
3 changed files with 48 additions and 23 deletions

View file

@ -1225,6 +1225,18 @@ public final class RegistryConfig {
return ImmutableList.copyOf(Splitter.on('\n').split(config.registryPolicy.rdapTos)); return ImmutableList.copyOf(Splitter.on('\n').split(config.registryPolicy.rdapTos));
} }
/**
* Link to static Web page with RDAP terms of service. Displayed in RDAP responses.
*
* @see google.registry.rdap.RdapJsonFormatter
*/
@Provides
@Config("rdapTosStaticUrl")
@Nullable
public static String provideRdapTosStaticUrl(RegistryConfigSettings config) {
return config.registryPolicy.rdapTosStaticUrl;
}
/** /**
* Returns the help text to be used by RDAP. * Returns the help text to be used by RDAP.
* *
@ -1235,30 +1247,38 @@ public final class RegistryConfig {
@Provides @Provides
@Config("rdapHelpMap") @Config("rdapHelpMap")
public static ImmutableMap<String, RdapNoticeDescriptor> provideRdapHelpMap( public static ImmutableMap<String, RdapNoticeDescriptor> provideRdapHelpMap(
@Config("rdapTos") ImmutableList<String> rdapTos) { @Config("rdapTos") ImmutableList<String> rdapTos,
@Config("rdapTosStaticUrl") @Nullable String rdapTosStaticUrl) {
return new ImmutableMap.Builder<String, RdapNoticeDescriptor>() return new ImmutableMap.Builder<String, RdapNoticeDescriptor>()
.put("/", RdapNoticeDescriptor.builder() .put(
.setTitle("RDAP Help") "/",
.setDescription(ImmutableList.of( RdapNoticeDescriptor.builder()
"domain/XXXX", .setTitle("RDAP Help")
"nameserver/XXXX", .setDescription(
"entity/XXXX", ImmutableList.of(
"domains?name=XXXX", "domain/XXXX",
"domains?nsLdhName=XXXX", "nameserver/XXXX",
"domains?nsIp=XXXX", "entity/XXXX",
"nameservers?name=XXXX", "domains?name=XXXX",
"nameservers?ip=XXXX", "domains?nsLdhName=XXXX",
"entities?fn=XXXX", "domains?nsIp=XXXX",
"entities?handle=XXXX", "nameservers?name=XXXX",
"help/XXXX")) "nameservers?ip=XXXX",
.setLinkValueSuffix("help/") "entities?fn=XXXX",
.setLinkHrefUrlString("https://github.com/google/nomulus/blob/master/docs/rdap.md") "entities?handle=XXXX",
.build()) "help/XXXX"))
.put("/tos", RdapNoticeDescriptor.builder() .setLinkValueSuffix("help/")
.setTitle("RDAP Terms of Service") .setLinkHrefUrlString(
.setDescription(rdapTos) "https://github.com/google/nomulus/blob/master/docs/rdap.md")
.setLinkValueSuffix("help/tos") .build())
.build()) .put(
"/tos",
RdapNoticeDescriptor.builder()
.setTitle("RDAP Terms of Service")
.setDescription(rdapTos)
.setLinkValueSuffix("help/tos")
.setLinkHrefUrlString(rdapTosStaticUrl)
.build())
.build(); .build();
} }

View file

@ -88,6 +88,7 @@ public class RegistryConfigSettings {
public String reservedTermsExportDisclaimer; public String reservedTermsExportDisclaimer;
public String whoisDisclaimer; public String whoisDisclaimer;
public String rdapTos; public String rdapTos;
public String rdapTosStaticUrl;
public String spec11EmailBodyTemplate; public String spec11EmailBodyTemplate;
} }

View file

@ -145,6 +145,10 @@ registryPolicy:
We reserve the right to modify this agreement at any time. We reserve the right to modify this agreement at any time.
# Link to static Web page with RDAP terms of service. Displayed in RDAP
# responses. If null, no static Web page link is generated.
rdapTosStaticUrl: null
# Body of the spec 11 email sent to registrars. # Body of the spec 11 email sent to registrars.
# Items in braces are to be replaced. # Items in braces are to be replaced.
spec11EmailBodyTemplate: | spec11EmailBodyTemplate: |