diff --git a/java/google/registry/config/BUILD b/java/google/registry/config/BUILD index 84be2d164..7ec170a29 100644 --- a/java/google/registry/config/BUILD +++ b/java/google/registry/config/BUILD @@ -13,6 +13,7 @@ java_library( "//java/com/google/common/collect", "//java/com/google/common/net", "//third_party/java/appengine:appengine-api", + "//third_party/java/auto:auto_value", "//third_party/java/dagger", "//third_party/java/joda_money", "//third_party/java/joda_time", diff --git a/java/google/registry/config/ConfigModule.java b/java/google/registry/config/ConfigModule.java index fe3cafa4b..6e32b6d6e 100644 --- a/java/google/registry/config/ConfigModule.java +++ b/java/google/registry/config/ConfigModule.java @@ -26,6 +26,7 @@ import java.net.URI; import java.net.URL; import javax.annotation.Nullable; import javax.inject.Qualifier; +import javax.inject.Singleton; import org.joda.money.CurrencyUnit; import org.joda.time.DateTimeConstants; import org.joda.time.Duration; @@ -921,4 +922,89 @@ public final class ConfigModule { // TODO(b/32875427): This will be moved into configuration in a text file in a future refactor. return "google.registry.flows.custom.CustomLogicFactory"; } + + /** + * Returns the help path for the RDAP terms of service. + * + *

Make sure that this path is equal to the key of the entry in the RDAP help map containing + * the terms of service. The ICANN operational profile requires that the TOS be included in all + * responses, and this string is used to find the TOS in the help map. + */ + @Provides + @Config("rdapTosPath") + public static String provideRdapTosPath() { + return "/tos"; + } + + /** + * Returns the help text to be used by RDAP. + * + *

Make sure that the map entry for the terms of service use the same key as specified in + * rdapTosPath above. + */ + @Singleton + @Provides + @Config("rdapHelpMap") + public static ImmutableMap provideRdapHelpMap() { + return new ImmutableMap.Builder() + .put("/", RdapNoticeDescriptor.builder() + .setTitle("RDAP Help") + .setDescription(ImmutableList.of( + "RDAP Help Topics (use /help/topic 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/topic for information)", + "syntax", + "tos (Terms of Service)")) + .setLinkValueSuffix("help/index") + .build()) + .put("/syntax", RdapNoticeDescriptor.builder() + .setTitle("RDAP Command Syntax") + .setDescription(ImmutableList.of( + "domain/XXXX", + "nameserver/XXXX", + "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")) + .setLinkValueSuffix("help/syntax") + .build()) + .put("/tos", RdapNoticeDescriptor.builder() + .setTitle("RDAP Terms of Service") + .setDescription(ImmutableList.of( + "By querying our Domain Database, you are agreeing to comply with these terms so" + + " please read them carefully.", + "Any information provided is 'as is' without any guarantee of accuracy.", + "Please do not misuse the Domain Database. It is intended solely for" + + " query-based access.", + "Don't use the Domain Database to allow, enable, or otherwise support the" + + " transmission of mass unsolicited, commercial advertising or" + + " solicitations.", + "Don't access our Domain Database through the use of high volume, automated" + + " electronic processes that send queries or data to the systems of any" + + " ICANN-accredited registrar.", + "You may only use the information contained in the Domain Database for lawful" + + " purposes.", + "Do not compile, repackage, disseminate, or otherwise use the information" + + " contained in the Domain Database in its entirety, or in any substantial" + + " portion, without our prior written permission.", + "We may retain certain details about queries to our Domain Database for the" + + " purposes of detecting and preventing misuse.", + "We reserve the right to restrict or deny your access to the database if we" + + " suspect that you have failed to comply with these terms.", + "We reserve the right to modify this agreement at any time.")) + .setLinkValueSuffix("help/tos") + .build()) + .build(); + } } diff --git a/java/google/registry/config/RdapNoticeDescriptor.java b/java/google/registry/config/RdapNoticeDescriptor.java new file mode 100644 index 000000000..acfe63564 --- /dev/null +++ b/java/google/registry/config/RdapNoticeDescriptor.java @@ -0,0 +1,50 @@ +// Copyright 2016 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.config; + +import com.google.auto.value.AutoValue; +import com.google.common.collect.ImmutableList; +import javax.annotation.Nullable; + + /** + * AutoValue class describing an RDAP Notice object. + * + *

This is used for injecting RDAP help pages. + */ + @AutoValue + public abstract class RdapNoticeDescriptor { + public static Builder builder() { + return new AutoValue_RdapNoticeDescriptor.Builder(); + } + + @Nullable public abstract String getTitle(); + public abstract ImmutableList getDescription(); + @Nullable public abstract String getTypeString(); + @Nullable public abstract String getLinkValueSuffix(); + @Nullable public abstract String getLinkHrefUrlString(); + + /** Builder class for {@link RdapNoticeDescriptor}. */ + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setTitle(@Nullable String title); + public abstract Builder setDescription(Iterable description); + public abstract Builder setTypeString(@Nullable String typeString); + public abstract Builder setLinkValueSuffix(@Nullable String linkValueSuffix); + public abstract Builder setLinkHrefUrlString(@Nullable String linkHrefUrlString); + + public abstract RdapNoticeDescriptor build(); + } + } + diff --git a/java/google/registry/rdap/RdapActionBase.java b/java/google/registry/rdap/RdapActionBase.java index 78bdd341c..d4973d736 100644 --- a/java/google/registry/rdap/RdapActionBase.java +++ b/java/google/registry/rdap/RdapActionBase.java @@ -68,6 +68,7 @@ public abstract class RdapActionBase implements Runnable { @Inject Response response; @Inject @RequestMethod Action.Method requestMethod; @Inject @RequestPath String requestPath; + @Inject RdapJsonFormatter rdapJsonFormatter; @Inject @Config("rdapLinkBase") String rdapLinkBase; @Inject @Config("rdapWhoisServer") @Nullable String rdapWhoisServer; @@ -130,7 +131,7 @@ public abstract class RdapActionBase implements Runnable { try { if (requestMethod != Action.Method.HEAD) { response.setPayload( - JSONValue.toJSONString(RdapJsonFormatter.makeError(status, title, description))); + JSONValue.toJSONString(rdapJsonFormatter.makeError(status, title, description))); } response.setContentType(RESPONSE_MEDIA_TYPE); } catch (Exception ex) { diff --git a/java/google/registry/rdap/RdapDomainAction.java b/java/google/registry/rdap/RdapDomainAction.java index 7e19ffe93..7d5621896 100644 --- a/java/google/registry/rdap/RdapDomainAction.java +++ b/java/google/registry/rdap/RdapDomainAction.java @@ -59,7 +59,7 @@ public class RdapDomainAction extends RdapActionBase { if (domainResource == null) { throw new NotFoundException(pathSearchString + " not found"); } - return RdapJsonFormatter.makeRdapJsonForDomain( + return rdapJsonFormatter.makeRdapJsonForDomain( domainResource, true, rdapLinkBase, rdapWhoisServer, now, OutputDataType.FULL); } } diff --git a/java/google/registry/rdap/RdapDomainSearchAction.java b/java/google/registry/rdap/RdapDomainSearchAction.java index fb8912c38..f90d8aa29 100644 --- a/java/google/registry/rdap/RdapDomainSearchAction.java +++ b/java/google/registry/rdap/RdapDomainSearchAction.java @@ -126,7 +126,7 @@ public class RdapDomainSearchAction extends RdapActionBase { } ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); builder.put("domainSearchResults", results.jsonList()); - RdapJsonFormatter.addTopLevelEntries( + rdapJsonFormatter.addTopLevelEntries( builder, BoilerplateType.DOMAIN, results.isTruncated() @@ -296,7 +296,7 @@ public class RdapDomainSearchAction extends RdapActionBase { ImmutableList.Builder> jsonBuilder = new ImmutableList.Builder<>(); for (DomainResource domain : domains) { jsonBuilder.add( - RdapJsonFormatter.makeRdapJsonForDomain( + rdapJsonFormatter.makeRdapJsonForDomain( domain, false, rdapLinkBase, rdapWhoisServer, now, outputDataType)); } return RdapSearchResults.create(jsonBuilder.build(), isTruncated); diff --git a/java/google/registry/rdap/RdapEntityAction.java b/java/google/registry/rdap/RdapEntityAction.java index 22b7d52a3..e53d50509 100644 --- a/java/google/registry/rdap/RdapEntityAction.java +++ b/java/google/registry/rdap/RdapEntityAction.java @@ -79,7 +79,7 @@ public class RdapEntityAction extends RdapActionBase { // As per Andy Newton on the regext mailing list, contacts by themselves have no role, since // they are global, and might have different roles for different domains. if ((contactResource != null) && now.isBefore(contactResource.getDeletionTime())) { - return RdapJsonFormatter.makeRdapJsonForContact( + return rdapJsonFormatter.makeRdapJsonForContact( contactResource, true, Optional.absent(), @@ -95,7 +95,7 @@ public class RdapEntityAction extends RdapActionBase { Registrar registrar = Iterables.getOnlyElement( Registrar.loadByIanaIdentifierRange(ianaIdentifier, ianaIdentifier + 1, 1), null); if ((registrar != null) && registrar.isActiveAndPubliclyVisible()) { - return RdapJsonFormatter.makeRdapJsonForRegistrar( + return rdapJsonFormatter.makeRdapJsonForRegistrar( registrar, true, rdapLinkBase, rdapWhoisServer, now, OutputDataType.FULL); } } catch (NumberFormatException e) { diff --git a/java/google/registry/rdap/RdapEntitySearchAction.java b/java/google/registry/rdap/RdapEntitySearchAction.java index 7afcb2277..e2d452754 100644 --- a/java/google/registry/rdap/RdapEntitySearchAction.java +++ b/java/google/registry/rdap/RdapEntitySearchAction.java @@ -101,7 +101,7 @@ public class RdapEntitySearchAction extends RdapActionBase { } ImmutableMap.Builder jsonBuilder = new ImmutableMap.Builder<>(); jsonBuilder.put("entitySearchResults", results.jsonList()); - RdapJsonFormatter.addTopLevelEntries( + rdapJsonFormatter.addTopLevelEntries( jsonBuilder, BoilerplateType.ENTITY, results.isTruncated() @@ -243,7 +243,7 @@ public class RdapEntitySearchAction extends RdapActionBase { } // As per Andy Newton on the regext mailing list, contacts by themselves have no role, since // they are global, and might have different roles for different domains. - jsonOutputList.add(RdapJsonFormatter.makeRdapJsonForContact( + jsonOutputList.add(rdapJsonFormatter.makeRdapJsonForContact( contact, false, Optional.absent(), @@ -257,7 +257,7 @@ public class RdapEntitySearchAction extends RdapActionBase { if (jsonOutputList.size() >= rdapResultSetMaxSize) { return RdapSearchResults.create(ImmutableList.copyOf(jsonOutputList), true); } - jsonOutputList.add(RdapJsonFormatter.makeRdapJsonForRegistrar( + jsonOutputList.add(rdapJsonFormatter.makeRdapJsonForRegistrar( registrar, false, rdapLinkBase, rdapWhoisServer, now, outputDataType)); } } diff --git a/java/google/registry/rdap/RdapHelpAction.java b/java/google/registry/rdap/RdapHelpAction.java index 536e693ea..09833554c 100644 --- a/java/google/registry/rdap/RdapHelpAction.java +++ b/java/google/registry/rdap/RdapHelpAction.java @@ -20,10 +20,7 @@ import static google.registry.request.Action.Method.HEAD; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import google.registry.rdap.RdapJsonFormatter.BoilerplateType; -import google.registry.rdap.RdapJsonFormatter.MakeRdapJsonNoticeParameters; import google.registry.request.Action; -import google.registry.request.HttpException.InternalServerErrorException; -import google.registry.request.HttpException.NotFoundException; import google.registry.util.Clock; import javax.inject.Inject; @@ -35,85 +32,6 @@ public class RdapHelpAction extends RdapActionBase { public static final String PATH = "/rdap/help"; - /** - * Path for the terms of service. The terms of service are also used to create the required - * boilerplate notice, so we make it a publicly visible that we can use elsewhere to reference it. - */ - public static final String TERMS_OF_SERVICE_PATH = "/tos"; - - /** - * Map from a relative path underneath the RDAP root path to the appropriate - * {@link MakeRdapJsonNoticeParameters} object. - */ - private static final ImmutableMap HELP_MAP = - ImmutableMap.of( - "/", - MakeRdapJsonNoticeParameters.builder() - .title("RDAP Help") - .description(ImmutableList.of( - "RDAP Help Topics (use /help/topic for information)", - "syntax", - "tos (Terms of Service)")) - .linkValueSuffix("help/") - .linkHrefUrlString("https://www.registry.google/about/rdap/index.html") - .build(), - "/index", - MakeRdapJsonNoticeParameters.builder() - .title("RDAP Help") - .description(ImmutableList.of( - "RDAP Help Topics (use /help/topic for information)", - "syntax", - "tos (Terms of Service)")) - .linkValueSuffix("help/index") - .linkHrefUrlString("https://www.registry.google/about/rdap/index.html") - .build(), - "/syntax", - MakeRdapJsonNoticeParameters.builder() - .title("RDAP Command Syntax") - .description(ImmutableList.of( - "domain/XXXX", - "nameserver/XXXX", - "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")) - .linkValueSuffix("help/syntax") - .linkHrefUrlString("https://www.registry.google/about/rdap/syntax.html") - .build(), - TERMS_OF_SERVICE_PATH, - MakeRdapJsonNoticeParameters.builder() - .title("RDAP Terms of Service") - .description(ImmutableList.of( - "By querying our Domain Database, you are agreeing to comply with these terms so" - + " please read them carefully.", - "Any information provided is 'as is' without any guarantee of accuracy.", - "Please do not misuse the Domain Database. It is intended solely for" - + " query-based access.", - "Don't use the Domain Database to allow, enable, or otherwise support the" - + " transmission of mass unsolicited, commercial advertising or" - + " solicitations.", - "Don't access our Domain Database through the use of high volume, automated" - + " electronic processes that send queries or data to the systems of" - + " Charleston Road Registry or any ICANN-accredited registrar.", - "You may only use the information contained in the Domain Database for lawful" - + " purposes.", - "Do not compile, repackage, disseminate, or otherwise use the information" - + " contained in the Domain Database in its entirety, or in any substantial" - + " portion, without our prior written permission.", - "We may retain certain details about queries to our Domain Database for the" - + " purposes of detecting and preventing misuse.", - "We reserve the right to restrict or deny your access to the database if we" - + " suspect that you have failed to comply with these terms.", - "We reserve the right to modify this agreement at any time.")) - .linkValueSuffix("help/tos") - .linkHrefUrlString("https://www.registry.google/about/rdap/tos.html") - .build()); - @Inject Clock clock; @Inject RdapHelpAction() {} @@ -133,28 +51,12 @@ public class RdapHelpAction extends RdapActionBase { // We rely on addTopLevelEntries to notice if we are sending the TOS notice, and not add a // duplicate boilerplate entry. ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); - RdapJsonFormatter.addTopLevelEntries( + rdapJsonFormatter.addTopLevelEntries( builder, BoilerplateType.OTHER, - ImmutableList.of(getJsonHelpNotice(pathSearchString, rdapLinkBase)), + ImmutableList.of(rdapJsonFormatter.getJsonHelpNotice(pathSearchString, rdapLinkBase)), ImmutableList.>of(), rdapLinkBase); return builder.build(); } - - static ImmutableMap getJsonHelpNotice( - String pathSearchString, String rdapLinkBase) { - if (pathSearchString.isEmpty()) { - pathSearchString = "/"; - } - if (!HELP_MAP.containsKey(pathSearchString)) { - throw new NotFoundException("no help found for " + pathSearchString); - } - try { - return RdapJsonFormatter.makeRdapJsonNotice( - HELP_MAP.get(pathSearchString), rdapLinkBase); - } catch (Exception e) { - throw new InternalServerErrorException("unable to read help for " + pathSearchString); - } - } } diff --git a/java/google/registry/rdap/RdapJsonFormatter.java b/java/google/registry/rdap/RdapJsonFormatter.java index 191ad8dd7..bb1a10aa3 100644 --- a/java/google/registry/rdap/RdapJsonFormatter.java +++ b/java/google/registry/rdap/RdapJsonFormatter.java @@ -18,7 +18,6 @@ import static com.google.common.base.Strings.nullToEmpty; import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.util.DomainNameUtils.ACE_PREFIX; -import com.google.auto.value.AutoValue; import com.google.common.base.Function; import com.google.common.base.Functions; import com.google.common.base.Optional; @@ -30,6 +29,8 @@ import com.google.common.collect.Maps; import com.google.common.collect.Ordering; import com.google.common.net.InetAddresses; import com.googlecode.objectify.Key; +import google.registry.config.ConfigModule.Config; +import google.registry.config.RdapNoticeDescriptor; import google.registry.model.EppResource; import google.registry.model.contact.ContactPhoneNumber; import google.registry.model.contact.ContactResource; @@ -44,6 +45,9 @@ import google.registry.model.registrar.Registrar; import google.registry.model.registrar.RegistrarAddress; import google.registry.model.registrar.RegistrarContact; import google.registry.model.reporting.HistoryEntry; +import google.registry.request.HttpException.InternalServerErrorException; +import google.registry.request.HttpException.NotFoundException; +import google.registry.util.FormattingLogger; import google.registry.util.Idn; import java.net.Inet4Address; import java.net.Inet6Address; @@ -53,6 +57,8 @@ import java.util.List; import java.util.Locale; import java.util.Map; import javax.annotation.Nullable; +import javax.inject.Inject; +import javax.inject.Singleton; import org.joda.time.DateTime; /** @@ -66,8 +72,15 @@ import org.joda.time.DateTime; * @see * RFC 7483: JSON Responses for the Registration Data Access Protocol (RDAP) */ +@Singleton public class RdapJsonFormatter { + @Inject @Config("rdapTosPath") String rdapTosPath; + @Inject @Config("rdapHelpMap") ImmutableMap rdapHelpMap; + @Inject RdapJsonFormatter() {} + + private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass(); + /** * What type of data to generate. Summary data includes only information about the object itself, * while full data includes associated items (e.g. for domains, full data includes the hosts, @@ -277,6 +290,26 @@ public class RdapJsonFormatter { return designatedContact.getType(); }}); + ImmutableMap getJsonTosNotice(String rdapLinkBase) { + return getJsonHelpNotice(rdapTosPath, rdapLinkBase); + } + + ImmutableMap getJsonHelpNotice( + String pathSearchString, String rdapLinkBase) { + if (pathSearchString.isEmpty()) { + pathSearchString = "/"; + } + if (!rdapHelpMap.containsKey(pathSearchString)) { + throw new NotFoundException("no help found for " + pathSearchString); + } + try { + return RdapJsonFormatter.makeRdapJsonNotice(rdapHelpMap.get(pathSearchString), rdapLinkBase); + } catch (Exception e) { + logger.warningfmt(e, "Error reading RDAP help file: %s", pathSearchString); + throw new InternalServerErrorException("unable to read help for " + pathSearchString); + } + } + /** * Adds the required top-level boilerplate. RFC 7483 specifies that the top-level object should * include an entry indicating the conformance level. The ICANN RDAP Profile document (dated 3 @@ -292,7 +325,7 @@ public class RdapJsonFormatter { * @param remarks a list of remarks to be inserted before the boilerplate notices. * @param rdapLinkBase the base for link URLs */ - static void addTopLevelEntries( + void addTopLevelEntries( ImmutableMap.Builder jsonBuilder, BoilerplateType boilerplateType, List> notices, @@ -301,8 +334,7 @@ public class RdapJsonFormatter { jsonBuilder.put("rdapConformance", CONFORMANCE_LIST); ImmutableList.Builder> noticesBuilder = new ImmutableList.Builder<>(); - ImmutableMap tosNotice = - RdapHelpAction.getJsonHelpNotice(RdapHelpAction.TERMS_OF_SERVICE_PATH, rdapLinkBase); + ImmutableMap tosNotice = getJsonTosNotice(rdapLinkBase); boolean tosNoticeFound = false; if (!notices.isEmpty()) { noticesBuilder.addAll(notices); @@ -337,31 +369,6 @@ public class RdapJsonFormatter { } } - /** AutoValue class to build parameters to {@link #makeRdapJsonNotice}. */ - @AutoValue - abstract static class MakeRdapJsonNoticeParameters { - static Builder builder() { - return new AutoValue_RdapJsonFormatter_MakeRdapJsonNoticeParameters.Builder(); - } - - @Nullable abstract String title(); - abstract ImmutableList description(); - @Nullable abstract String typeString(); - @Nullable abstract String linkValueSuffix(); - @Nullable abstract String linkHrefUrlString(); - - @AutoValue.Builder - abstract static class Builder { - abstract Builder title(@Nullable String title); - abstract Builder description(Iterable description); - abstract Builder typeString(@Nullable String typeString); - abstract Builder linkValueSuffix(@Nullable String linkValueSuffix); - abstract Builder linkHrefUrlString(@Nullable String linkHrefUrlString); - - abstract MakeRdapJsonNoticeParameters build(); - } - } - /** * Creates a JSON object containing a notice or remark object, as defined by RFC 7483 ยง 4.3. * The object should then be inserted into a notices or remarks array. The builder fields are: @@ -391,22 +398,22 @@ public class RdapJsonFormatter { * RFC 7483: JSON Responses for the Registration Data Access Protocol (RDAP) */ static ImmutableMap makeRdapJsonNotice( - MakeRdapJsonNoticeParameters parameters, @Nullable String linkBase) { + RdapNoticeDescriptor parameters, @Nullable String linkBase) { ImmutableMap.Builder jsonBuilder = new ImmutableMap.Builder<>(); - if (parameters.title() != null) { - jsonBuilder.put("title", parameters.title()); + if (parameters.getTitle() != null) { + jsonBuilder.put("title", parameters.getTitle()); } ImmutableList.Builder descriptionBuilder = new ImmutableList.Builder<>(); - for (String line : parameters.description()) { + for (String line : parameters.getDescription()) { descriptionBuilder.add(nullToEmpty(line)); } jsonBuilder.put("description", descriptionBuilder.build()); - if (parameters.typeString() != null) { - jsonBuilder.put("typeString", parameters.typeString()); + if (parameters.getTypeString() != null) { + jsonBuilder.put("typeString", parameters.getTypeString()); } String linkValueString = - nullToEmpty(linkBase) + nullToEmpty(parameters.linkValueSuffix()); - if (parameters.linkHrefUrlString() == null) { + nullToEmpty(linkBase) + nullToEmpty(parameters.getLinkValueSuffix()); + if (parameters.getLinkHrefUrlString() == null) { jsonBuilder.put("links", ImmutableList.of(ImmutableMap.of( "value", linkValueString, "rel", "self", @@ -414,7 +421,7 @@ public class RdapJsonFormatter { "type", "application/rdap+json"))); } else { URI htmlBaseURI = URI.create(nullToEmpty(linkBase)); - URI htmlUri = htmlBaseURI.resolve(parameters.linkHrefUrlString()); + URI htmlUri = htmlBaseURI.resolve(parameters.getLinkHrefUrlString()); jsonBuilder.put("links", ImmutableList.of(ImmutableMap.of( "value", linkValueString, "rel", "alternate", @@ -435,7 +442,7 @@ public class RdapJsonFormatter { * @param now the as-date * @param outputDataType whether to generate full or summary data */ - static ImmutableMap makeRdapJsonForDomain( + ImmutableMap makeRdapJsonForDomain( DomainResource domainResource, boolean isTopLevel, @Nullable String linkBase, @@ -529,7 +536,7 @@ public class RdapJsonFormatter { * @param now the as-date * @param outputDataType whether to generate full or summary data */ - static ImmutableMap makeRdapJsonForHost( + ImmutableMap makeRdapJsonForHost( HostResource hostResource, boolean isTopLevel, @Nullable String linkBase, @@ -612,7 +619,7 @@ public class RdapJsonFormatter { * @param now the as-date * @param outputDataType whether to generate full or summary data */ - static ImmutableMap makeRdapJsonForContact( + ImmutableMap makeRdapJsonForContact( ContactResource contactResource, boolean isTopLevel, Optional contactType, @@ -701,7 +708,7 @@ public class RdapJsonFormatter { * @param now the as-date * @param outputDataType whether to generate full or summary data */ - static ImmutableMap makeRdapJsonForRegistrar( + ImmutableMap makeRdapJsonForRegistrar( Registrar registrar, boolean isTopLevel, @Nullable String linkBase, @@ -1044,8 +1051,7 @@ public class RdapJsonFormatter { * @see * RFC 7483: JSON Responses for the Registration Data Access Protocol (RDAP) */ - static ImmutableMap makeError( - int status, String title, String description) { + ImmutableMap makeError(int status, String title, String description) { return ImmutableMap.of( "rdapConformance", CONFORMANCE_LIST, "lang", "en", diff --git a/java/google/registry/rdap/RdapNameserverAction.java b/java/google/registry/rdap/RdapNameserverAction.java index edd8ccb3f..06345398c 100644 --- a/java/google/registry/rdap/RdapNameserverAction.java +++ b/java/google/registry/rdap/RdapNameserverAction.java @@ -59,7 +59,7 @@ public class RdapNameserverAction extends RdapActionBase { if (hostResource == null) { throw new NotFoundException(pathSearchString + " not found"); } - return RdapJsonFormatter.makeRdapJsonForHost( + return rdapJsonFormatter.makeRdapJsonForHost( hostResource, true, rdapLinkBase, rdapWhoisServer, now, OutputDataType.FULL); } } diff --git a/java/google/registry/rdap/RdapNameserverSearchAction.java b/java/google/registry/rdap/RdapNameserverSearchAction.java index 61477a921..35da3af1f 100644 --- a/java/google/registry/rdap/RdapNameserverSearchAction.java +++ b/java/google/registry/rdap/RdapNameserverSearchAction.java @@ -105,7 +105,7 @@ public class RdapNameserverSearchAction extends RdapActionBase { } ImmutableMap.Builder jsonBuilder = new ImmutableMap.Builder<>(); jsonBuilder.put("nameserverSearchResults", results.jsonList()); - RdapJsonFormatter.addTopLevelEntries( + rdapJsonFormatter.addTopLevelEntries( jsonBuilder, BoilerplateType.NAMESERVER, results.isTruncated() @@ -127,7 +127,7 @@ public class RdapNameserverSearchAction extends RdapActionBase { } return RdapSearchResults.create( ImmutableList.of( - RdapJsonFormatter.makeRdapJsonForHost( + rdapJsonFormatter.makeRdapJsonForHost( hostResource, false, rdapLinkBase, rdapWhoisServer, now, OutputDataType.FULL))); // Handle queries with a wildcard, but no suffix. There are no pending deletes for hosts, so we // can call queryUndeleted. @@ -186,7 +186,7 @@ public class RdapNameserverSearchAction extends RdapActionBase { new ImmutableList.Builder<>(); for (HostResource host : Iterables.limit(hosts, rdapResultSetMaxSize)) { jsonListBuilder.add( - RdapJsonFormatter.makeRdapJsonForHost( + rdapJsonFormatter.makeRdapJsonForHost( host, false, rdapLinkBase, rdapWhoisServer, now, outputDataType)); } ImmutableList> jsonList = jsonListBuilder.build(); diff --git a/javatests/google/registry/rdap/BUILD b/javatests/google/registry/rdap/BUILD index fd9ad92df..edf2991a2 100644 --- a/javatests/google/registry/rdap/BUILD +++ b/javatests/google/registry/rdap/BUILD @@ -16,6 +16,7 @@ java_library( "//java/com/google/common/collect", "//java/com/google/common/io", "//java/com/google/common/net", + "//java/google/registry/config", "//java/google/registry/model", "//java/google/registry/rdap", "//java/google/registry/request", diff --git a/javatests/google/registry/rdap/RdapActionBaseTest.java b/javatests/google/registry/rdap/RdapActionBaseTest.java index 579f79c4e..605594d72 100644 --- a/javatests/google/registry/rdap/RdapActionBaseTest.java +++ b/javatests/google/registry/rdap/RdapActionBaseTest.java @@ -80,12 +80,12 @@ public class RdapActionBaseTest { } ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); builder.put("key", "value"); - RdapJsonFormatter.addTopLevelEntries( + rdapJsonFormatter.addTopLevelEntries( builder, BoilerplateType.OTHER, ImmutableList.>of(), ImmutableList.>of(), - "http://myserver.google.com/"); + "http://myserver.example.com/"); return builder.build(); } } @@ -98,12 +98,13 @@ public class RdapActionBaseTest { inject.setStaticField(Ofy.class, "clock", clock); action = new RdapTestAction(); action.response = response; + action.rdapJsonFormatter = RdapTestHelper.getTestRdapJsonFormatter(); } private Object generateActualJson(String domainName) { action.requestPath = RdapTestAction.PATH + domainName; action.requestMethod = GET; - action.rdapLinkBase = "http://myserver.google.com/"; + action.rdapLinkBase = "http://myserver.example.com/"; action.run(); return JSONValue.parse(response.getPayload()); } @@ -111,7 +112,7 @@ public class RdapActionBaseTest { private String generateHeadPayload(String domainName) { action.requestPath = RdapTestAction.PATH + domainName; action.requestMethod = HEAD; - action.rdapLinkBase = "http://myserver.google.com/"; + action.rdapLinkBase = "http://myserver.example.com/"; action.run(); return response.getPayload(); } diff --git a/javatests/google/registry/rdap/RdapDomainActionTest.java b/javatests/google/registry/rdap/RdapDomainActionTest.java index a1bf85c5f..8b16af9b0 100644 --- a/javatests/google/registry/rdap/RdapDomainActionTest.java +++ b/javatests/google/registry/rdap/RdapDomainActionTest.java @@ -123,6 +123,7 @@ public class RdapDomainActionTest { action = new RdapDomainAction(); action.clock = clock; action.response = response; + action.rdapJsonFormatter = RdapTestHelper.getTestRdapJsonFormatter(); action.rdapLinkBase = "https://example.com/rdap/"; action.rdapWhoisServer = null; diff --git a/javatests/google/registry/rdap/RdapDomainSearchActionTest.java b/javatests/google/registry/rdap/RdapDomainSearchActionTest.java index 2c8905d4c..03cb05447 100644 --- a/javatests/google/registry/rdap/RdapDomainSearchActionTest.java +++ b/javatests/google/registry/rdap/RdapDomainSearchActionTest.java @@ -301,6 +301,7 @@ public class RdapDomainSearchActionTest { action.clock = clock; action.response = response; + action.rdapJsonFormatter = RdapTestHelper.getTestRdapJsonFormatter(); action.rdapLinkBase = "https://example.com/rdap/"; action.rdapWhoisServer = null; } @@ -552,7 +553,7 @@ public class RdapDomainSearchActionTest { } persistResources(domainsBuilder.build()); } - + private Object readMultiDomainFile( String fileName, String domainName1, @@ -988,7 +989,7 @@ public class RdapDomainSearchActionTest { .isEqualTo(generateExpectedJson("No domains found", null, null, "rdap_error_404.json")); assertThat(response.getStatus()).isEqualTo(404); } - + @Test public void testAddressMatch_nontruncatedResultsSet() throws Exception { createManyDomainsAndHosts(4, 1, 2); diff --git a/javatests/google/registry/rdap/RdapEntityActionTest.java b/javatests/google/registry/rdap/RdapEntityActionTest.java index d4b08a4cb..63767c612 100644 --- a/javatests/google/registry/rdap/RdapEntityActionTest.java +++ b/javatests/google/registry/rdap/RdapEntityActionTest.java @@ -144,6 +144,7 @@ public class RdapEntityActionTest { action = new RdapEntityAction(); action.clock = clock; action.response = response; + action.rdapJsonFormatter = RdapTestHelper.getTestRdapJsonFormatter(); action.rdapLinkBase = "https://example.com/rdap/"; action.rdapWhoisServer = null; } diff --git a/javatests/google/registry/rdap/RdapEntitySearchActionTest.java b/javatests/google/registry/rdap/RdapEntitySearchActionTest.java index 1b40f7048..0783187d7 100644 --- a/javatests/google/registry/rdap/RdapEntitySearchActionTest.java +++ b/javatests/google/registry/rdap/RdapEntitySearchActionTest.java @@ -124,6 +124,7 @@ public class RdapEntitySearchActionTest { action.clock = clock; action.requestPath = RdapEntitySearchAction.PATH; action.response = response; + action.rdapJsonFormatter = RdapTestHelper.getTestRdapJsonFormatter(); action.rdapResultSetMaxSize = 4; action.rdapLinkBase = "https://example.com/rdap/"; action.rdapWhoisServer = null; @@ -444,7 +445,7 @@ public class RdapEntitySearchActionTest { generateActualJsonWithHandle("3test*"); assertThat(response.getStatus()).isEqualTo(404); } - + @Test public void testHandleMatch_truncatedEntities() throws Exception { createManyContactsAndRegistrars(300, 0); diff --git a/javatests/google/registry/rdap/RdapHelpActionTest.java b/javatests/google/registry/rdap/RdapHelpActionTest.java index b97d7e7f0..0b25fc097 100644 --- a/javatests/google/registry/rdap/RdapHelpActionTest.java +++ b/javatests/google/registry/rdap/RdapHelpActionTest.java @@ -49,6 +49,7 @@ public class RdapHelpActionTest { action = new RdapHelpAction(); action.clock = clock; action.response = response; + action.rdapJsonFormatter = RdapTestHelper.getTestRdapJsonFormatter(); action.rdapLinkBase = "https://example.tld/rdap/"; action.rdapWhoisServer = null; } diff --git a/javatests/google/registry/rdap/RdapJsonFormatterTest.java b/javatests/google/registry/rdap/RdapJsonFormatterTest.java index bc3084291..ddcca66dc 100644 --- a/javatests/google/registry/rdap/RdapJsonFormatterTest.java +++ b/javatests/google/registry/rdap/RdapJsonFormatterTest.java @@ -30,6 +30,7 @@ import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import google.registry.config.RdapNoticeDescriptor; import google.registry.model.contact.ContactResource; import google.registry.model.domain.DesignatedContact; import google.registry.model.domain.DomainResource; @@ -40,7 +41,6 @@ import google.registry.model.registrar.Registrar; import google.registry.model.registrar.RegistrarContact; import google.registry.model.registry.Registry.TldState; import google.registry.model.reporting.HistoryEntry; -import google.registry.rdap.RdapJsonFormatter.MakeRdapJsonNoticeParameters; import google.registry.rdap.RdapJsonFormatter.OutputDataType; import google.registry.testing.AppEngineRule; import google.registry.testing.FakeClock; @@ -65,6 +65,8 @@ public class RdapJsonFormatterTest { private final FakeClock clock = new FakeClock(DateTime.parse("1999-01-01T00:00:00Z")); + private RdapJsonFormatter rdapJsonFormatter; + private Registrar registrar; private DomainResource domainResourceFull; private DomainResource domainResourceNoNameservers; @@ -76,8 +78,8 @@ public class RdapJsonFormatterTest { private ContactResource contactResourceAdmin; private ContactResource contactResourceTech; - private static final String LINK_BASE = "http://myserver.google.com/"; - private static final String LINK_BASE_NO_TRAILING_SLASH = "http://myserver.google.com"; + private static final String LINK_BASE = "http://myserver.example.com/"; + private static final String LINK_BASE_NO_TRAILING_SLASH = "http://myserver.example.com"; // Do not set a port43 whois server, as per Gustavo Lozano. private static final String WHOIS_SERVER = null; @@ -85,6 +87,8 @@ public class RdapJsonFormatterTest { public void setUp() throws Exception { inject.setStaticField(Ofy.class, "clock", clock); + rdapJsonFormatter = RdapTestHelper.getTestRdapJsonFormatter(); + // Create the registrar in 1999, then update it in 2000. clock.setTo(DateTime.parse("1999-01-01T00:00:00Z")); createTld("xn--q9jyb4c", TldState.GENERAL_AVAILABILITY); @@ -204,42 +208,42 @@ public class RdapJsonFormatterTest { @Test public void testRegistrar() throws Exception { - assertThat(RdapJsonFormatter.makeRdapJsonForRegistrar( + assertThat(rdapJsonFormatter.makeRdapJsonForRegistrar( registrar, false, LINK_BASE, WHOIS_SERVER, clock.nowUtc(), OutputDataType.FULL)) .isEqualTo(loadJson("rdapjson_registrar.json")); } @Test public void testRegistrar_summary() throws Exception { - assertThat(RdapJsonFormatter.makeRdapJsonForRegistrar( + assertThat(rdapJsonFormatter.makeRdapJsonForRegistrar( registrar, false, LINK_BASE, WHOIS_SERVER, clock.nowUtc(), OutputDataType.SUMMARY)) .isEqualTo(loadJson("rdapjson_registrar_summary.json")); } @Test public void testHost_ipv4() throws Exception { - assertThat(RdapJsonFormatter.makeRdapJsonForHost( + assertThat(rdapJsonFormatter.makeRdapJsonForHost( hostResourceIpv4, false, LINK_BASE, WHOIS_SERVER, clock.nowUtc(), OutputDataType.FULL)) .isEqualTo(loadJson("rdapjson_host_ipv4.json")); } @Test public void testHost_ipv6() throws Exception { - assertThat(RdapJsonFormatter.makeRdapJsonForHost( + assertThat(rdapJsonFormatter.makeRdapJsonForHost( hostResourceIpv6, false, LINK_BASE, WHOIS_SERVER, clock.nowUtc(), OutputDataType.FULL)) .isEqualTo(loadJson("rdapjson_host_ipv6.json")); } @Test public void testHost_both() throws Exception { - assertThat(RdapJsonFormatter.makeRdapJsonForHost( + assertThat(rdapJsonFormatter.makeRdapJsonForHost( hostResourceBoth, false, LINK_BASE, WHOIS_SERVER, clock.nowUtc(), OutputDataType.FULL)) .isEqualTo(loadJson("rdapjson_host_both.json")); } @Test public void testHost_both_summary() throws Exception { - assertThat(RdapJsonFormatter.makeRdapJsonForHost( + assertThat(rdapJsonFormatter.makeRdapJsonForHost( hostResourceBoth, false, LINK_BASE, @@ -251,7 +255,7 @@ public class RdapJsonFormatterTest { @Test public void testHost_noAddresses() throws Exception { - assertThat(RdapJsonFormatter.makeRdapJsonForHost( + assertThat(rdapJsonFormatter.makeRdapJsonForHost( hostResourceNoAddresses, false, LINK_BASE, @@ -264,7 +268,7 @@ public class RdapJsonFormatterTest { @Test public void testRegistrant() throws Exception { assertThat( - RdapJsonFormatter.makeRdapJsonForContact( + rdapJsonFormatter.makeRdapJsonForContact( contactResourceRegistrant, false, Optional.of(DesignatedContact.Type.REGISTRANT), @@ -278,7 +282,7 @@ public class RdapJsonFormatterTest { @Test public void testRegistrant_summary() throws Exception { assertThat( - RdapJsonFormatter.makeRdapJsonForContact( + rdapJsonFormatter.makeRdapJsonForContact( contactResourceRegistrant, false, Optional.of(DesignatedContact.Type.REGISTRANT), @@ -292,7 +296,7 @@ public class RdapJsonFormatterTest { @Test public void testRegistrant_baseHasNoTrailingSlash() throws Exception { assertThat( - RdapJsonFormatter.makeRdapJsonForContact( + rdapJsonFormatter.makeRdapJsonForContact( contactResourceRegistrant, false, Optional.of(DesignatedContact.Type.REGISTRANT), @@ -306,7 +310,7 @@ public class RdapJsonFormatterTest { @Test public void testRegistrant_noBase() throws Exception { assertThat( - RdapJsonFormatter.makeRdapJsonForContact( + rdapJsonFormatter.makeRdapJsonForContact( contactResourceRegistrant, false, Optional.of(DesignatedContact.Type.REGISTRANT), @@ -320,7 +324,7 @@ public class RdapJsonFormatterTest { @Test public void testAdmin() throws Exception { assertThat( - RdapJsonFormatter.makeRdapJsonForContact( + rdapJsonFormatter.makeRdapJsonForContact( contactResourceAdmin, false, Optional.of(DesignatedContact.Type.ADMIN), @@ -334,7 +338,7 @@ public class RdapJsonFormatterTest { @Test public void testTech() throws Exception { assertThat( - RdapJsonFormatter.makeRdapJsonForContact( + rdapJsonFormatter.makeRdapJsonForContact( contactResourceTech, false, Optional.of(DesignatedContact.Type.TECH), @@ -348,7 +352,7 @@ public class RdapJsonFormatterTest { @Test public void testRolelessContact() throws Exception { assertThat( - RdapJsonFormatter.makeRdapJsonForContact( + rdapJsonFormatter.makeRdapJsonForContact( contactResourceTech, false, Optional.absent(), @@ -361,7 +365,7 @@ public class RdapJsonFormatterTest { @Test public void testDomain_full() throws Exception { - assertThat(RdapJsonFormatter.makeRdapJsonForDomain( + assertThat(rdapJsonFormatter.makeRdapJsonForDomain( domainResourceFull, false, LINK_BASE, @@ -373,7 +377,7 @@ public class RdapJsonFormatterTest { @Test public void testDomain_summary() throws Exception { - assertThat(RdapJsonFormatter.makeRdapJsonForDomain( + assertThat(rdapJsonFormatter.makeRdapJsonForDomain( domainResourceFull, false, LINK_BASE, @@ -385,7 +389,7 @@ public class RdapJsonFormatterTest { @Test public void testDomain_noNameservers() throws Exception { - assertThat(RdapJsonFormatter.makeRdapJsonForDomain( + assertThat(rdapJsonFormatter.makeRdapJsonForDomain( domainResourceNoNameservers, false, LINK_BASE, @@ -398,7 +402,7 @@ public class RdapJsonFormatterTest { @Test public void testError() throws Exception { assertThat( - RdapJsonFormatter + rdapJsonFormatter .makeError(SC_BAD_REQUEST, "Invalid Domain Name", "Not a valid domain name")) .isEqualTo(loadJson("rdapjson_error.json")); } @@ -406,14 +410,14 @@ public class RdapJsonFormatterTest { @Test public void testHelp_absoluteHtmlUrl() throws Exception { assertThat(RdapJsonFormatter.makeRdapJsonNotice( - MakeRdapJsonNoticeParameters.builder() - .title("RDAP Help") - .description(ImmutableList.of( + RdapNoticeDescriptor.builder() + .setTitle("RDAP Help") + .setDescription(ImmutableList.of( "RDAP Help Topics (use /help/topic for information)", "syntax", "tos (Terms of Service)")) - .linkValueSuffix("help/index") - .linkHrefUrlString(LINK_BASE + "about/rdap/index.html") + .setLinkValueSuffix("help/index") + .setLinkHrefUrlString(LINK_BASE + "about/rdap/index.html") .build(), LINK_BASE)) .isEqualTo(loadJson("rdapjson_notice_alternate_link.json")); @@ -422,14 +426,14 @@ public class RdapJsonFormatterTest { @Test public void testHelp_relativeHtmlUrlWithStartingSlash() throws Exception { assertThat(RdapJsonFormatter.makeRdapJsonNotice( - MakeRdapJsonNoticeParameters.builder() - .title("RDAP Help") - .description(ImmutableList.of( + RdapNoticeDescriptor.builder() + .setTitle("RDAP Help") + .setDescription(ImmutableList.of( "RDAP Help Topics (use /help/topic for information)", "syntax", "tos (Terms of Service)")) - .linkValueSuffix("help/index") - .linkHrefUrlString("/about/rdap/index.html") + .setLinkValueSuffix("help/index") + .setLinkHrefUrlString("/about/rdap/index.html") .build(), LINK_BASE)) .isEqualTo(loadJson("rdapjson_notice_alternate_link.json")); @@ -438,14 +442,14 @@ public class RdapJsonFormatterTest { @Test public void testHelp_relativeHtmlUrlWithoutStartingSlash() throws Exception { assertThat(RdapJsonFormatter.makeRdapJsonNotice( - MakeRdapJsonNoticeParameters.builder() - .title("RDAP Help") - .description(ImmutableList.of( + RdapNoticeDescriptor.builder() + .setTitle("RDAP Help") + .setDescription(ImmutableList.of( "RDAP Help Topics (use /help/topic for information)", "syntax", "tos (Terms of Service)")) - .linkValueSuffix("help/index") - .linkHrefUrlString("about/rdap/index.html") + .setLinkValueSuffix("help/index") + .setLinkHrefUrlString("about/rdap/index.html") .build(), LINK_BASE)) .isEqualTo(loadJson("rdapjson_notice_alternate_link.json")); @@ -454,13 +458,13 @@ public class RdapJsonFormatterTest { @Test public void testHelp_noHtmlUrl() throws Exception { assertThat(RdapJsonFormatter.makeRdapJsonNotice( - MakeRdapJsonNoticeParameters.builder() - .title("RDAP Help") - .description(ImmutableList.of( + RdapNoticeDescriptor.builder() + .setTitle("RDAP Help") + .setDescription(ImmutableList.of( "RDAP Help Topics (use /help/topic for information)", "syntax", "tos (Terms of Service)")) - .linkValueSuffix("help/index") + .setLinkValueSuffix("help/index") .build(), LINK_BASE)) .isEqualTo(loadJson("rdapjson_notice_self_link.json")); @@ -470,7 +474,7 @@ public class RdapJsonFormatterTest { public void testTopLevel() throws Exception { ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); builder.put("key", "value"); - RdapJsonFormatter.addTopLevelEntries( + rdapJsonFormatter.addTopLevelEntries( builder, RdapJsonFormatter.BoilerplateType.OTHER, ImmutableList.>of(), @@ -483,10 +487,10 @@ public class RdapJsonFormatterTest { public void testTopLevel_withTermsOfService() throws Exception { ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); builder.put("key", "value"); - RdapJsonFormatter.addTopLevelEntries( + rdapJsonFormatter.addTopLevelEntries( builder, RdapJsonFormatter.BoilerplateType.OTHER, - ImmutableList.of(RdapHelpAction.getJsonHelpNotice("/tos", LINK_BASE)), + ImmutableList.of(rdapJsonFormatter.getJsonHelpNotice("/tos", LINK_BASE)), ImmutableList.>of(), LINK_BASE); assertThat(builder.build()).isEqualTo(loadJson("rdapjson_toplevel.json")); @@ -496,7 +500,7 @@ public class RdapJsonFormatterTest { public void testTopLevel_domain() throws Exception { ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); builder.put("key", "value"); - RdapJsonFormatter.addTopLevelEntries( + rdapJsonFormatter.addTopLevelEntries( builder, RdapJsonFormatter.BoilerplateType.DOMAIN, ImmutableList.>of(), @@ -509,10 +513,10 @@ public class RdapJsonFormatterTest { public void testTopLevel_domainWithTermsOfService() throws Exception { ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); builder.put("key", "value"); - RdapJsonFormatter.addTopLevelEntries( + rdapJsonFormatter.addTopLevelEntries( builder, RdapJsonFormatter.BoilerplateType.DOMAIN, - ImmutableList.of(RdapHelpAction.getJsonHelpNotice("/tos", LINK_BASE)), + ImmutableList.of(rdapJsonFormatter.getJsonHelpNotice("/tos", LINK_BASE)), ImmutableList.>of(), LINK_BASE); assertThat(builder.build()).isEqualTo(loadJson("rdapjson_toplevel_domain.json")); diff --git a/javatests/google/registry/rdap/RdapNameserverActionTest.java b/javatests/google/registry/rdap/RdapNameserverActionTest.java index 0abccb9df..73aa4c7c7 100644 --- a/javatests/google/registry/rdap/RdapNameserverActionTest.java +++ b/javatests/google/registry/rdap/RdapNameserverActionTest.java @@ -75,6 +75,7 @@ public class RdapNameserverActionTest { action.clock = clock; action.response = response; action.requestPath = RdapNameserverAction.PATH.concat(input); + action.rdapJsonFormatter = RdapTestHelper.getTestRdapJsonFormatter(); action.rdapLinkBase = "https://example.tld/rdap/"; action.rdapWhoisServer = null; return action; diff --git a/javatests/google/registry/rdap/RdapNameserverSearchActionTest.java b/javatests/google/registry/rdap/RdapNameserverSearchActionTest.java index d280a1fb9..7523488f1 100644 --- a/javatests/google/registry/rdap/RdapNameserverSearchActionTest.java +++ b/javatests/google/registry/rdap/RdapNameserverSearchActionTest.java @@ -132,6 +132,7 @@ public class RdapNameserverSearchActionTest { action.clock = clock; action.requestPath = RdapNameserverSearchAction.PATH; action.response = response; + action.rdapJsonFormatter = RdapTestHelper.getTestRdapJsonFormatter(); action.rdapResultSetMaxSize = 4; action.rdapLinkBase = "https://example.tld/rdap/"; action.rdapWhoisServer = null; @@ -140,7 +141,7 @@ public class RdapNameserverSearchActionTest { } private Object generateExpectedJson(String expectedOutputFile) { - return generateExpectedJson(null, null, null, null, null, expectedOutputFile); + return generateExpectedJson(null, null, null, null, null, expectedOutputFile); } private Object generateExpectedJson(String name, String expectedOutputFile) { @@ -207,7 +208,7 @@ public class RdapNameserverSearchActionTest { .setSubordinateHosts(subordinateHostsBuilder.build()) .build()); } - + @Test public void testInvalidPath_rejected() throws Exception { action.requestPath = RdapDomainSearchAction.PATH + "/path"; @@ -354,7 +355,7 @@ public class RdapNameserverSearchActionTest { generateActualJsonWithName("dog*"); assertThat(response.getStatus()).isEqualTo(404); } - + @Test public void testNameMatch_nontruncatedResultSet() throws Exception { createManyHosts(4); diff --git a/javatests/google/registry/rdap/RdapTestHelper.java b/javatests/google/registry/rdap/RdapTestHelper.java index 8056906a5..38a4e7dae 100644 --- a/javatests/google/registry/rdap/RdapTestHelper.java +++ b/javatests/google/registry/rdap/RdapTestHelper.java @@ -16,6 +16,7 @@ package google.registry.rdap; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import google.registry.config.RdapNoticeDescriptor; public class RdapTestHelper { @@ -35,8 +36,8 @@ public class RdapTestHelper { + " transmission of mass unsolicited, commercial advertising or" + " solicitations.", "Don't access our Domain Database through the use of high volume, automated" - + " electronic processes that send queries or data to the systems of" - + " Charleston Road Registry or any ICANN-accredited registrar.", + + " electronic processes that send queries or data to the systems of any" + + " ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful" + " purposes.", "Do not compile, repackage, disseminate, or otherwise use the information" @@ -51,7 +52,7 @@ public class RdapTestHelper { ImmutableMap.of( "value", linkBase + "help/tos", "rel", "alternate", - "href", "https://www.registry.google/about/rdap/tos.html", + "href", "https://www.registry.tld/about/rdap/tos.html", "type", "text/html"))))); } @@ -99,5 +100,75 @@ public class RdapTestHelper { "href", "https://www.icann.org/wicf", "type", "text/html"))))); } -} + static RdapJsonFormatter getTestRdapJsonFormatter() { + RdapJsonFormatter rdapJsonFormatter = new RdapJsonFormatter(); + rdapJsonFormatter.rdapTosPath = "/tos"; + rdapJsonFormatter.rdapHelpMap = ImmutableMap.of( + "/", + RdapNoticeDescriptor.builder() + .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( + "domain/XXXX", + "nameserver/XXXX", + "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")) + .setLinkValueSuffix("help/syntax") + .setLinkHrefUrlString("https://www.registry.tld/about/rdap/syntax.html") + .build(), + "/tos", + RdapNoticeDescriptor.builder() + .setTitle("RDAP Terms of Service") + .setDescription(ImmutableList.of( + "By querying our Domain Database, you are agreeing to comply with these terms so" + + " please read them carefully.", + "Any information provided is 'as is' without any guarantee of accuracy.", + "Please do not misuse the Domain Database. It is intended solely for" + + " query-based access.", + "Don't use the Domain Database to allow, enable, or otherwise support the" + + " transmission of mass unsolicited, commercial advertising or" + + " solicitations.", + "Don't access our Domain Database through the use of high volume, automated" + + " electronic processes that send queries or data to the systems of any" + + " ICANN-accredited registrar.", + "You may only use the information contained in the Domain Database for lawful" + + " purposes.", + "Do not compile, repackage, disseminate, or otherwise use the information" + + " contained in the Domain Database in its entirety, or in any substantial" + + " portion, without our prior written permission.", + "We may retain certain details about queries to our Domain Database for the" + + " purposes of detecting and preventing misuse.", + "We reserve the right to restrict or deny your access to the database if we" + + " suspect that you have failed to comply with these terms.", + "We reserve the right to modify this agreement at any time.")) + .setLinkValueSuffix("help/tos") + .setLinkHrefUrlString("https://www.registry.tld/about/rdap/tos.html") + .build()); + return rdapJsonFormatter; + } +} diff --git a/javatests/google/registry/rdap/testdata/rdap_help_index.json b/javatests/google/registry/rdap/testdata/rdap_help_index.json index 4940cf883..b809acfa6 100644 --- a/javatests/google/registry/rdap/testdata/rdap_help_index.json +++ b/javatests/google/registry/rdap/testdata/rdap_help_index.json @@ -14,9 +14,9 @@ [ { "value" : "https://example.tld/rdap/help/%NAME%", - "rel" : "alternate", - "type" : "text/html", - "href" : "https://www.registry.google/about/rdap/index.html" + "rel" : "self", + "type" : "application/rdap+json", + "href" : "https://example.tld/rdap/help/%NAME%" } ] }, @@ -28,7 +28,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -40,7 +40,7 @@ { "value" : "https://example.tld/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_help_tos.json b/javatests/google/registry/rdap/testdata/rdap_help_tos.json index 74b0e7133..14f27853f 100644 --- a/javatests/google/registry/rdap/testdata/rdap_help_tos.json +++ b/javatests/google/registry/rdap/testdata/rdap_help_tos.json @@ -10,7 +10,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -22,7 +22,7 @@ { "value" : "https://example.tld/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_multiple_contacts.json b/javatests/google/registry/rdap/testdata/rdap_multiple_contacts.json index 12343c0b4..f30f4cb92 100644 --- a/javatests/google/registry/rdap/testdata/rdap_multiple_contacts.json +++ b/javatests/google/registry/rdap/testdata/rdap_multiple_contacts.json @@ -112,7 +112,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -124,7 +124,7 @@ { "value" : "https://example.com/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_multiple_contacts2.json b/javatests/google/registry/rdap/testdata/rdap_multiple_contacts2.json index e1fd79fab..5a43bbc28 100644 --- a/javatests/google/registry/rdap/testdata/rdap_multiple_contacts2.json +++ b/javatests/google/registry/rdap/testdata/rdap_multiple_contacts2.json @@ -105,7 +105,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -117,7 +117,7 @@ { "value" : "https://example.com/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_multiple_domains.json b/javatests/google/registry/rdap/testdata/rdap_multiple_domains.json index 4c1375fd3..4065df2d0 100644 --- a/javatests/google/registry/rdap/testdata/rdap_multiple_domains.json +++ b/javatests/google/registry/rdap/testdata/rdap_multiple_domains.json @@ -70,7 +70,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -82,7 +82,7 @@ { "value" : "https://example.com/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_multiple_hosts.json b/javatests/google/registry/rdap/testdata/rdap_multiple_hosts.json index 120e1d138..96d98a07b 100644 --- a/javatests/google/registry/rdap/testdata/rdap_multiple_hosts.json +++ b/javatests/google/registry/rdap/testdata/rdap_multiple_hosts.json @@ -70,7 +70,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -82,7 +82,7 @@ { "value" : "https://example.tld/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_nontruncated_contacts.json b/javatests/google/registry/rdap/testdata/rdap_nontruncated_contacts.json index 7addc2d91..94ed3c529 100644 --- a/javatests/google/registry/rdap/testdata/rdap_nontruncated_contacts.json +++ b/javatests/google/registry/rdap/testdata/rdap_nontruncated_contacts.json @@ -197,7 +197,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -209,7 +209,7 @@ { "value" : "https://example.com/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_nontruncated_domains.json b/javatests/google/registry/rdap/testdata/rdap_nontruncated_domains.json index 743251fb5..f5b2fe8b7 100644 --- a/javatests/google/registry/rdap/testdata/rdap_nontruncated_domains.json +++ b/javatests/google/registry/rdap/testdata/rdap_nontruncated_domains.json @@ -126,7 +126,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -138,7 +138,7 @@ { "value" : "https://example.com/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_nontruncated_hosts.json b/javatests/google/registry/rdap/testdata/rdap_nontruncated_hosts.json index 98496105b..ded648b0b 100644 --- a/javatests/google/registry/rdap/testdata/rdap_nontruncated_hosts.json +++ b/javatests/google/registry/rdap/testdata/rdap_nontruncated_hosts.json @@ -125,7 +125,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -137,7 +137,7 @@ { "value" : "https://example.tld/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_nontruncated_registrars.json b/javatests/google/registry/rdap/testdata/rdap_nontruncated_registrars.json index 36ff5173f..198290ad3 100644 --- a/javatests/google/registry/rdap/testdata/rdap_nontruncated_registrars.json +++ b/javatests/google/registry/rdap/testdata/rdap_nontruncated_registrars.json @@ -225,7 +225,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -237,7 +237,7 @@ { "value" : "https://example.com/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_truncated_contacts.json b/javatests/google/registry/rdap/testdata/rdap_truncated_contacts.json index 12d55edd1..fa9b377c8 100644 --- a/javatests/google/registry/rdap/testdata/rdap_truncated_contacts.json +++ b/javatests/google/registry/rdap/testdata/rdap_truncated_contacts.json @@ -205,7 +205,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -217,7 +217,7 @@ { "value" : "https://example.com/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_truncated_domains.json b/javatests/google/registry/rdap/testdata/rdap_truncated_domains.json index 77138cd34..e689f7faf 100644 --- a/javatests/google/registry/rdap/testdata/rdap_truncated_domains.json +++ b/javatests/google/registry/rdap/testdata/rdap_truncated_domains.json @@ -134,7 +134,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -146,7 +146,7 @@ { "value" : "https://example.com/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_truncated_hosts.json b/javatests/google/registry/rdap/testdata/rdap_truncated_hosts.json index a0c6388aa..4adf52381 100644 --- a/javatests/google/registry/rdap/testdata/rdap_truncated_hosts.json +++ b/javatests/google/registry/rdap/testdata/rdap_truncated_hosts.json @@ -133,7 +133,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -145,7 +145,7 @@ { "value" : "https://example.tld/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_truncated_mixed_entities.json b/javatests/google/registry/rdap/testdata/rdap_truncated_mixed_entities.json index 7535c757c..a03790e32 100644 --- a/javatests/google/registry/rdap/testdata/rdap_truncated_mixed_entities.json +++ b/javatests/google/registry/rdap/testdata/rdap_truncated_mixed_entities.json @@ -212,7 +212,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -224,7 +224,7 @@ { "value" : "https://example.com/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdap_truncated_registrars.json b/javatests/google/registry/rdap/testdata/rdap_truncated_registrars.json index 2c018760b..63d2eb6e8 100644 --- a/javatests/google/registry/rdap/testdata/rdap_truncated_registrars.json +++ b/javatests/google/registry/rdap/testdata/rdap_truncated_registrars.json @@ -233,7 +233,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -245,7 +245,7 @@ { "value" : "https://example.com/rdap/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdapjson_admincontact.json b/javatests/google/registry/rdap/testdata/rdapjson_admincontact.json index 3fd2e80ba..aaeaf3e41 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_admincontact.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_admincontact.json @@ -6,9 +6,9 @@ "links" : [ { - "value" : "http://myserver.google.com/entity/4-ROID", + "value" : "http://myserver.example.com/entity/4-ROID", "rel" : "self", - "href" : "http://myserver.google.com/entity/4-ROID", + "href" : "http://myserver.example.com/entity/4-ROID", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_domain_full.json b/javatests/google/registry/rdap/testdata/rdapjson_domain_full.json index 65565876e..ddf80f936 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_domain_full.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_domain_full.json @@ -13,9 +13,9 @@ "links" : [ { - "value" : "http://myserver.google.com/domain/cat.xn--q9jyb4c", + "value" : "http://myserver.example.com/domain/cat.xn--q9jyb4c", "rel" : "self", - "href" : "http://myserver.google.com/domain/cat.xn--q9jyb4c", + "href" : "http://myserver.example.com/domain/cat.xn--q9jyb4c", "type" : "application/rdap+json" } ], @@ -49,9 +49,9 @@ "links" : [ { - "value" : "http://myserver.google.com/nameserver/ns1.cat.xn--q9jyb4c", + "value" : "http://myserver.example.com/nameserver/ns1.cat.xn--q9jyb4c", "rel" : "self", - "href" : "http://myserver.google.com/nameserver/ns1.cat.xn--q9jyb4c", + "href" : "http://myserver.example.com/nameserver/ns1.cat.xn--q9jyb4c", "type" : "application/rdap+json" } ], @@ -80,9 +80,9 @@ "links" : [ { - "value" : "http://myserver.google.com/nameserver/ns2.cat.xn--q9jyb4c", + "value" : "http://myserver.example.com/nameserver/ns2.cat.xn--q9jyb4c", "rel" : "self", - "href" : "http://myserver.google.com/nameserver/ns2.cat.xn--q9jyb4c", + "href" : "http://myserver.example.com/nameserver/ns2.cat.xn--q9jyb4c", "type" : "application/rdap+json" } ], @@ -113,9 +113,9 @@ "links" : [ { - "value" : "http://myserver.google.com/entity/4-ROID", + "value" : "http://myserver.example.com/entity/4-ROID", "rel" : "self", - "href" : "http://myserver.google.com/entity/4-ROID", + "href" : "http://myserver.example.com/entity/4-ROID", "type" : "application/rdap+json" } ], @@ -162,9 +162,9 @@ "links" : [ { - "value" : "http://myserver.google.com/entity/6-ROID", + "value" : "http://myserver.example.com/entity/6-ROID", "rel" : "self", - "href" : "http://myserver.google.com/entity/6-ROID", + "href" : "http://myserver.example.com/entity/6-ROID", "type" : "application/rdap+json" } ], @@ -211,9 +211,9 @@ "links" : [ { - "value" : "http://myserver.google.com/entity/2-ROID", + "value" : "http://myserver.example.com/entity/2-ROID", "rel" : "self", - "href" : "http://myserver.google.com/entity/2-ROID", + "href" : "http://myserver.example.com/entity/2-ROID", "type" : "application/rdap+json" } ], 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 f7e931009..8b19d4088 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_domain_no_nameservers.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_domain_no_nameservers.json @@ -14,9 +14,9 @@ "links" : [ { - "value" : "http://myserver.google.com/domain/fish.xn--q9jyb4c", + "value" : "http://myserver.example.com/domain/fish.xn--q9jyb4c", "rel" : "self", - "href" : "http://myserver.google.com/domain/fish.xn--q9jyb4c", + "href" : "http://myserver.example.com/domain/fish.xn--q9jyb4c", "type" : "application/rdap+json" } ], @@ -49,9 +49,9 @@ "links" : [ { - "value" : "http://myserver.google.com/entity/4-ROID", + "value" : "http://myserver.example.com/entity/4-ROID", "rel" : "self", - "href" : "http://myserver.google.com/entity/4-ROID", + "href" : "http://myserver.example.com/entity/4-ROID", "type" : "application/rdap+json" } ], @@ -98,9 +98,9 @@ "links" : [ { - "value" : "http://myserver.google.com/entity/6-ROID", + "value" : "http://myserver.example.com/entity/6-ROID", "rel" : "self", - "href" : "http://myserver.google.com/entity/6-ROID", + "href" : "http://myserver.example.com/entity/6-ROID", "type" : "application/rdap+json" } ], @@ -147,9 +147,9 @@ "links" : [ { - "value" : "http://myserver.google.com/entity/2-ROID", + "value" : "http://myserver.example.com/entity/2-ROID", "rel" : "self", - "href" : "http://myserver.google.com/entity/2-ROID", + "href" : "http://myserver.example.com/entity/2-ROID", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_domain_summary.json b/javatests/google/registry/rdap/testdata/rdapjson_domain_summary.json index 299994fca..41de7a167 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_domain_summary.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_domain_summary.json @@ -13,9 +13,9 @@ "links" : [ { - "value" : "http://myserver.google.com/domain/cat.xn--q9jyb4c", + "value" : "http://myserver.example.com/domain/cat.xn--q9jyb4c", "rel" : "self", - "href" : "http://myserver.google.com/domain/cat.xn--q9jyb4c", + "href" : "http://myserver.example.com/domain/cat.xn--q9jyb4c", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_host_both.json b/javatests/google/registry/rdap/testdata/rdapjson_host_both.json index 9ef23559a..b764e53b3 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_host_both.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_host_both.json @@ -7,9 +7,9 @@ "links" : [ { - "value" : "http://myserver.google.com/nameserver/ns3.cat.xn--q9jyb4c", + "value" : "http://myserver.example.com/nameserver/ns3.cat.xn--q9jyb4c", "rel" : "self", - "href" : "http://myserver.google.com/nameserver/ns3.cat.xn--q9jyb4c", + "href" : "http://myserver.example.com/nameserver/ns3.cat.xn--q9jyb4c", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_host_both_summary.json b/javatests/google/registry/rdap/testdata/rdapjson_host_both_summary.json index d25e68b68..6f8e37520 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_host_both_summary.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_host_both_summary.json @@ -7,9 +7,9 @@ "links" : [ { - "value" : "http://myserver.google.com/nameserver/ns3.cat.xn--q9jyb4c", + "value" : "http://myserver.example.com/nameserver/ns3.cat.xn--q9jyb4c", "rel" : "self", - "href" : "http://myserver.google.com/nameserver/ns3.cat.xn--q9jyb4c", + "href" : "http://myserver.example.com/nameserver/ns3.cat.xn--q9jyb4c", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_host_ipv4.json b/javatests/google/registry/rdap/testdata/rdapjson_host_ipv4.json index a14294268..6720baf47 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_host_ipv4.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_host_ipv4.json @@ -7,9 +7,9 @@ "links" : [ { - "value" : "http://myserver.google.com/nameserver/ns1.cat.xn--q9jyb4c", + "value" : "http://myserver.example.com/nameserver/ns1.cat.xn--q9jyb4c", "rel" : "self", - "href" : "http://myserver.google.com/nameserver/ns1.cat.xn--q9jyb4c", + "href" : "http://myserver.example.com/nameserver/ns1.cat.xn--q9jyb4c", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_host_ipv6.json b/javatests/google/registry/rdap/testdata/rdapjson_host_ipv6.json index cbf84741b..62ac2628a 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_host_ipv6.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_host_ipv6.json @@ -7,9 +7,9 @@ "links" : [ { - "value" : "http://myserver.google.com/nameserver/ns2.cat.xn--q9jyb4c", + "value" : "http://myserver.example.com/nameserver/ns2.cat.xn--q9jyb4c", "rel" : "self", - "href" : "http://myserver.google.com/nameserver/ns2.cat.xn--q9jyb4c", + "href" : "http://myserver.example.com/nameserver/ns2.cat.xn--q9jyb4c", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_host_no_addresses.json b/javatests/google/registry/rdap/testdata/rdapjson_host_no_addresses.json index 936fe4eeb..84e3b5e3d 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_host_no_addresses.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_host_no_addresses.json @@ -7,9 +7,9 @@ "links" : [ { - "value" : "http://myserver.google.com/nameserver/ns4.cat.xn--q9jyb4c", + "value" : "http://myserver.example.com/nameserver/ns4.cat.xn--q9jyb4c", "rel" : "self", - "href" : "http://myserver.google.com/nameserver/ns4.cat.xn--q9jyb4c", + "href" : "http://myserver.example.com/nameserver/ns4.cat.xn--q9jyb4c", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_notice_alternate_link.json b/javatests/google/registry/rdap/testdata/rdapjson_notice_alternate_link.json index 22e056f77..d287e4a02 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_notice_alternate_link.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_notice_alternate_link.json @@ -9,10 +9,10 @@ "links" : [ { - "value" : "http://myserver.google.com/help/index", + "value" : "http://myserver.example.com/help/index", "rel" : "alternate", "type" : "text/html", - "href" : "http://myserver.google.com/about/rdap/index.html" + "href" : "http://myserver.example.com/about/rdap/index.html" } ] } diff --git a/javatests/google/registry/rdap/testdata/rdapjson_notice_self_link.json b/javatests/google/registry/rdap/testdata/rdapjson_notice_self_link.json index eae8c34e5..3bd98e11f 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_notice_self_link.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_notice_self_link.json @@ -9,10 +9,10 @@ "links" : [ { - "value" : "http://myserver.google.com/help/index", + "value" : "http://myserver.example.com/help/index", "rel" : "self", "type" : "application/rdap+json", - "href" : "http://myserver.google.com/help/index", + "href" : "http://myserver.example.com/help/index", } ] } diff --git a/javatests/google/registry/rdap/testdata/rdapjson_registrant.json b/javatests/google/registry/rdap/testdata/rdapjson_registrant.json index 99537647d..e978f35f8 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_registrant.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_registrant.json @@ -6,9 +6,9 @@ "links" : [ { - "value" : "http://myserver.google.com/entity/2-ROID", + "value" : "http://myserver.example.com/entity/2-ROID", "rel" : "self", - "href" : "http://myserver.google.com/entity/2-ROID", + "href" : "http://myserver.example.com/entity/2-ROID", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_registrant_summary.json b/javatests/google/registry/rdap/testdata/rdapjson_registrant_summary.json index 2717738b0..2f8b2cc9d 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_registrant_summary.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_registrant_summary.json @@ -6,9 +6,9 @@ "links" : [ { - "value" : "http://myserver.google.com/entity/2-ROID", + "value" : "http://myserver.example.com/entity/2-ROID", "rel" : "self", - "href" : "http://myserver.google.com/entity/2-ROID", + "href" : "http://myserver.example.com/entity/2-ROID", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_registrar.json b/javatests/google/registry/rdap/testdata/rdapjson_registrar.json index 002eb7e81..c44b8c6f9 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_registrar.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_registrar.json @@ -6,9 +6,9 @@ "links" : [ { - "value" : "http://myserver.google.com/entity/1", + "value" : "http://myserver.example.com/entity/1", "rel" : "self", - "href" : "http://myserver.google.com/entity/1", + "href" : "http://myserver.example.com/entity/1", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_registrar_summary.json b/javatests/google/registry/rdap/testdata/rdapjson_registrar_summary.json index d31586a07..c6013675b 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_registrar_summary.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_registrar_summary.json @@ -6,9 +6,9 @@ "links" : [ { - "value" : "http://myserver.google.com/entity/1", + "value" : "http://myserver.example.com/entity/1", "rel" : "self", - "href" : "http://myserver.google.com/entity/1", + "href" : "http://myserver.example.com/entity/1", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_rolelesscontact.json b/javatests/google/registry/rdap/testdata/rdapjson_rolelesscontact.json index 989b1f3b8..5d61685f5 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_rolelesscontact.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_rolelesscontact.json @@ -5,9 +5,9 @@ "links" : [ { - "value" : "http://myserver.google.com/entity/6-ROID", + "value" : "http://myserver.example.com/entity/6-ROID", "rel" : "self", - "href" : "http://myserver.google.com/entity/6-ROID", + "href" : "http://myserver.example.com/entity/6-ROID", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_techcontact.json b/javatests/google/registry/rdap/testdata/rdapjson_techcontact.json index c18887c6f..c59964868 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_techcontact.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_techcontact.json @@ -6,9 +6,9 @@ "links" : [ { - "value" : "http://myserver.google.com/entity/6-ROID", + "value" : "http://myserver.example.com/entity/6-ROID", "rel" : "self", - "href" : "http://myserver.google.com/entity/6-ROID", + "href" : "http://myserver.example.com/entity/6-ROID", "type" : "application/rdap+json" } ], diff --git a/javatests/google/registry/rdap/testdata/rdapjson_toplevel.json b/javatests/google/registry/rdap/testdata/rdapjson_toplevel.json index 6b1a71517..176a1bdc1 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_toplevel.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_toplevel.json @@ -14,7 +14,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -24,9 +24,9 @@ "links" : [ { - "value" : "http://myserver.google.com/help/tos", + "value" : "http://myserver.example.com/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ] diff --git a/javatests/google/registry/rdap/testdata/rdapjson_toplevel_domain.json b/javatests/google/registry/rdap/testdata/rdapjson_toplevel_domain.json index ffceea619..b2c9aa659 100644 --- a/javatests/google/registry/rdap/testdata/rdapjson_toplevel_domain.json +++ b/javatests/google/registry/rdap/testdata/rdapjson_toplevel_domain.json @@ -14,7 +14,7 @@ "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations.", - "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of Charleston Road Registry or any ICANN-accredited registrar.", + "Don't access our Domain Database through the use of high volume, automated electronic processes that send queries or data to the systems of any ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful purposes.", "Do not compile, repackage, disseminate, or otherwise use the information contained in the Domain Database in its entirety, or in any substantial portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the purposes of detecting and preventing misuse.", @@ -24,9 +24,9 @@ "links" : [ { - "value" : "http://myserver.google.com/help/tos", + "value" : "http://myserver.example.com/help/tos", "rel" : "alternate", - "href" : "https://www.registry.google/about/rdap/tos.html", + "href" : "https://www.registry.tld/about/rdap/tos.html", "type" : "text/html" } ]