diff --git a/java/google/registry/config/ConfigModule.java b/java/google/registry/config/ConfigModule.java
index b5cd8c4f7..3258d96f1 100644
--- a/java/google/registry/config/ConfigModule.java
+++ b/java/google/registry/config/ConfigModule.java
@@ -28,7 +28,26 @@ import org.joda.money.CurrencyUnit;
import org.joda.time.DateTimeConstants;
import org.joda.time.Duration;
-/** Dagger module for injecting configuration settings. */
+/**
+ * Configuration example for the Domain Registry codebase.
+ *
+ *
The Domain Registry codebase contains many classes that inject configurable settings. This is
+ * the centralized class that is used by default to configure them all, in hard-coded type-safe
+ * Java code.
+ *
+ *
This class does not represent the total configuration of the Domain Registry service. It's
+ * only meant for settings that need to be configured once. Settings which may
+ * be subject to change in the future, should instead be retrieved from Datastore. The
+ * {@link google.registry.model.registry.Registry Registry} class is one such example of this.
+ *
+ *
Customization
+ *
+ * It is recommended that users do not modify this file within a forked repository. It is
+ * preferable to modify these settings by swapping out this module with a separate copied version
+ * in the user's repository. For this to work, other files need to be copied too, such as
+ * {@link google.registry.module.backend.BackendComponent BackendComponent}. This allows modules to
+ * be substituted at the {@code @Component} level.
+ */
@Module
public final class ConfigModule {
@@ -563,4 +582,27 @@ public final class ConfigModule {
return "tzcyzvm3mn7zkdnx";
}
}
+
+ /**
+ * Disclaimer displayed at the end of WHOIS query results.
+ *
+ * @see google.registry.whois.WhoisResponse
+ */
+ @Provides
+ @Config("whoisDisclaimer")
+ public static String provideWhoisDisclaimer() {
+ return "WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for\n"
+ + "query-based, informational purposes. By querying our WHOIS database, you are\n"
+ + "agreeing to comply with these terms\n"
+ + "(http://www.registry.google/about/whois-disclaimer.html) so please read them\n"
+ + "carefully. Any information provided is \"as is\" without any guarantee of\n"
+ + "accuracy. You may not use such information to (a) allow, enable, or otherwise\n"
+ + "support the transmission of mass unsolicited, commercial advertising or\n"
+ + "solicitations; (b) enable high volume, automated, electronic processes that\n"
+ + "access the systems of CRR or any ICANN-Accredited Registrar, except as\n"
+ + "reasonably necessary to register domain names or modify existing registrations;\n"
+ + "or (c) engage in or support unlawful behavior. CRR reserves the right to\n"
+ + "restrict or deny your access to the Whois database, and may modify these terms\n"
+ + "at any time.\n";
+ }
}
diff --git a/java/google/registry/config/RegistryConfig.java b/java/google/registry/config/RegistryConfig.java
index 6c4dca20d..f2db197fc 100644
--- a/java/google/registry/config/RegistryConfig.java
+++ b/java/google/registry/config/RegistryConfig.java
@@ -243,4 +243,6 @@ public interface RegistryConfig {
* the logs from filling up with unnecessarily failures.
*/
public Duration getAsyncFlowFailureBackoff();
+
+ // XXX: Please consider using ConfigModule instead of adding new methods to this file.
}
diff --git a/java/google/registry/tools/WhoisQueryCommand.java b/java/google/registry/tools/WhoisQueryCommand.java
index bfc2fac86..4ce0e8fc9 100644
--- a/java/google/registry/tools/WhoisQueryCommand.java
+++ b/java/google/registry/tools/WhoisQueryCommand.java
@@ -20,8 +20,6 @@ import com.google.common.base.Joiner;
import google.registry.tools.Command.GtechCommand;
import google.registry.tools.Command.RemoteApiCommand;
import google.registry.whois.Whois;
-import google.registry.whois.WhoisException;
-import google.registry.whois.WhoisResponse;
import java.util.List;
import javax.inject.Inject;
@@ -44,12 +42,6 @@ final class WhoisQueryCommand implements RemoteApiCommand, GtechCommand {
@Override
public void run() {
- WhoisResponse response;
- try {
- response = whois.lookup(Joiner.on(' ').join(mainParameters));
- } catch (WhoisException e) {
- response = e;
- }
- System.out.println(response.getPlainTextOutput(unicode));
+ System.out.println(whois.lookup(Joiner.on(' ').join(mainParameters), unicode));
}
}
diff --git a/java/google/registry/whois/BUILD b/java/google/registry/whois/BUILD
index a71efd5d4..4ee051528 100644
--- a/java/google/registry/whois/BUILD
+++ b/java/google/registry/whois/BUILD
@@ -8,7 +8,6 @@ licenses(["notice"]) # Apache 2.0
java_library(
name = "whois",
srcs = glob(["*.java"]),
- resources = ["disclaimer.txt"],
visibility = ["//visibility:public"],
deps = [
"//java/com/google/common/annotations",
diff --git a/java/google/registry/whois/DomainWhoisResponse.java b/java/google/registry/whois/DomainWhoisResponse.java
index e71ef1f04..7b2c9434b 100644
--- a/java/google/registry/whois/DomainWhoisResponse.java
+++ b/java/google/registry/whois/DomainWhoisResponse.java
@@ -61,39 +61,41 @@ final class DomainWhoisResponse extends WhoisResponseImpl {
}
@Override
- public String getPlainTextOutput(final boolean preferUnicode) {
+ public String getPlainTextOutput(final boolean preferUnicode, String disclaimer) {
Registrar registrar = getRegistrar(domain.getCurrentSponsorClientId());
return new DomainEmitter()
- .emitField("Domain Name",
- maybeFormatHostname(domain.getFullyQualifiedDomainName(), preferUnicode))
- .emitField("Domain ID", domain.getRepoId())
- .emitField("WHOIS Server", registrar.getWhoisServer())
- .emitField("Referral URL", registrar.getReferralUrl())
- .emitField("Updated Date", getFormattedString(domain.getLastEppUpdateTime()))
- .emitField("Creation Date", getFormattedString(domain.getCreationTime()))
- .emitField("Registry Expiry Date",
- getFormattedString(domain.getRegistrationExpirationTime()))
- .emitField("Sponsoring Registrar", registrar.getRegistrarName())
- .emitField("Sponsoring Registrar IANA ID",
- registrar.getIanaIdentifier() == null ? null : registrar.getIanaIdentifier().toString())
- .emitStatusValues(domain.getStatusValues(), domain.getGracePeriods())
- .emitContact("Registrant", domain.getRegistrant(), preferUnicode)
- .emitContact("Admin", getContactReference(Type.ADMIN), preferUnicode)
- .emitContact("Tech", getContactReference(Type.TECH), preferUnicode)
- .emitContact("Billing", getContactReference(Type.BILLING), preferUnicode)
- .emitSet(
- "Name Server",
- domain.loadNameserverFullyQualifiedHostNames(),
- new Function() {
- @Override
- public String apply(String hostName) {
- return maybeFormatHostname(hostName, preferUnicode);
- }})
- .emitField("DNSSEC", isNullOrEmpty(domain.getDsData()) ? "unsigned" : "signedDelegation")
- .emitLastUpdated(getTimestamp())
- .emitAwipMessage()
- .emitFooter()
- .toString();
+ .emitField(
+ "Domain Name", maybeFormatHostname(domain.getFullyQualifiedDomainName(), preferUnicode))
+ .emitField("Domain ID", domain.getRepoId())
+ .emitField("WHOIS Server", registrar.getWhoisServer())
+ .emitField("Referral URL", registrar.getReferralUrl())
+ .emitField("Updated Date", getFormattedString(domain.getLastEppUpdateTime()))
+ .emitField("Creation Date", getFormattedString(domain.getCreationTime()))
+ .emitField(
+ "Registry Expiry Date", getFormattedString(domain.getRegistrationExpirationTime()))
+ .emitField("Sponsoring Registrar", registrar.getRegistrarName())
+ .emitField(
+ "Sponsoring Registrar IANA ID",
+ registrar.getIanaIdentifier() == null ? null : registrar.getIanaIdentifier().toString())
+ .emitStatusValues(domain.getStatusValues(), domain.getGracePeriods())
+ .emitContact("Registrant", domain.getRegistrant(), preferUnicode)
+ .emitContact("Admin", getContactReference(Type.ADMIN), preferUnicode)
+ .emitContact("Tech", getContactReference(Type.TECH), preferUnicode)
+ .emitContact("Billing", getContactReference(Type.BILLING), preferUnicode)
+ .emitSet(
+ "Name Server",
+ domain.loadNameserverFullyQualifiedHostNames(),
+ new Function() {
+ @Override
+ public String apply(String hostName) {
+ return maybeFormatHostname(hostName, preferUnicode);
+ }
+ })
+ .emitField("DNSSEC", isNullOrEmpty(domain.getDsData()) ? "unsigned" : "signedDelegation")
+ .emitLastUpdated(getTimestamp())
+ .emitAwipMessage()
+ .emitFooter(disclaimer)
+ .toString();
}
/** Returns the contact of the given type, or null if it does not exist. */
diff --git a/java/google/registry/whois/NameserverWhoisResponse.java b/java/google/registry/whois/NameserverWhoisResponse.java
index 3246783cc..25b306bc0 100644
--- a/java/google/registry/whois/NameserverWhoisResponse.java
+++ b/java/google/registry/whois/NameserverWhoisResponse.java
@@ -42,7 +42,7 @@ final class NameserverWhoisResponse extends WhoisResponseImpl {
}
@Override
- public String getPlainTextOutput(boolean preferUnicode) {
+ public String getPlainTextOutput(boolean preferUnicode, String disclaimer) {
BasicEmitter emitter = new BasicEmitter();
for (int i = 0; i < hosts.size(); i++) {
HostResource host = hosts.get(i);
@@ -63,6 +63,6 @@ final class NameserverWhoisResponse extends WhoisResponseImpl {
emitter.emitNewline();
}
}
- return emitter.emitLastUpdated(getTimestamp()).emitFooter().toString();
+ return emitter.emitLastUpdated(getTimestamp()).emitFooter(disclaimer).toString();
}
}
diff --git a/java/google/registry/whois/RegistrarWhoisResponse.java b/java/google/registry/whois/RegistrarWhoisResponse.java
index 78af9bcea..6cb726c0d 100644
--- a/java/google/registry/whois/RegistrarWhoisResponse.java
+++ b/java/google/registry/whois/RegistrarWhoisResponse.java
@@ -43,29 +43,29 @@ class RegistrarWhoisResponse extends WhoisResponseImpl {
}
@Override
- public String getPlainTextOutput(boolean preferUnicode) {
+ public String getPlainTextOutput(boolean preferUnicode, String disclaimer) {
Set contacts = registrar.getContacts();
return new RegistrarEmitter()
.emitField("Registrar Name", registrar.getRegistrarName())
- .emitAddress(null, chooseByUnicodePreference(
- preferUnicode,
- registrar.getLocalizedAddress(),
- registrar.getInternationalizedAddress()))
+ .emitAddress(
+ null,
+ chooseByUnicodePreference(
+ preferUnicode,
+ registrar.getLocalizedAddress(),
+ registrar.getInternationalizedAddress()))
.emitPhonesAndEmail(
- registrar.getPhoneNumber(),
- registrar.getFaxNumber(),
- registrar.getEmailAddress())
+ registrar.getPhoneNumber(), registrar.getFaxNumber(), registrar.getEmailAddress())
.emitField("WHOIS Server", registrar.getWhoisServer())
.emitField("Referral URL", registrar.getReferralUrl())
.emitRegistrarContacts("Admin", contacts, AdminOrTech.ADMIN)
- .emitRegistrarContacts("Technical", contacts, AdminOrTech.TECH)
+ .emitRegistrarContacts("Technical", contacts, AdminOrTech.TECH)
.emitLastUpdated(getTimestamp())
- .emitFooter()
+ .emitFooter(disclaimer)
.toString();
}
/** An emitter with logic for registrars. */
- class RegistrarEmitter extends Emitter {
+ static class RegistrarEmitter extends Emitter {
/** Emits the registrar contact of the given type. */
RegistrarEmitter emitRegistrarContacts(
String contactLabel,
diff --git a/java/google/registry/whois/Whois.java b/java/google/registry/whois/Whois.java
index 702341f22..abfaff187 100644
--- a/java/google/registry/whois/Whois.java
+++ b/java/google/registry/whois/Whois.java
@@ -14,6 +14,7 @@
package google.registry.whois;
+import google.registry.config.ConfigModule.Config;
import google.registry.util.Clock;
import java.io.IOException;
import java.io.StringReader;
@@ -24,23 +25,24 @@ import org.joda.time.DateTime;
public final class Whois {
private final Clock clock;
+ private final String disclaimer;
@Inject
- public Whois(Clock clock) {
+ public Whois(Clock clock, @Config("whoisDisclaimer") String disclaimer) {
this.clock = clock;
+ this.disclaimer = disclaimer;
}
- /**
- * Performs a WHOIS lookup on a plaintext query string.
- *
- * @throws WhoisException if the record is not found or the query is invalid
- */
- public WhoisResponse lookup(String query) throws WhoisException {
+ /** Performs a WHOIS lookup on a plaintext query string. */
+ public String lookup(String query, boolean preferUnicode) {
DateTime now = clock.nowUtc();
try {
return new WhoisReader(new StringReader(query), now)
.readCommand()
- .executeQuery(now);
+ .executeQuery(now)
+ .getPlainTextOutput(preferUnicode, disclaimer);
+ } catch (WhoisException e) {
+ return e.getPlainTextOutput(preferUnicode, disclaimer);
} catch (IOException e) {
throw new RuntimeException(e);
}
diff --git a/java/google/registry/whois/WhoisException.java b/java/google/registry/whois/WhoisException.java
index 4127ce615..c42705ce5 100644
--- a/java/google/registry/whois/WhoisException.java
+++ b/java/google/registry/whois/WhoisException.java
@@ -60,11 +60,11 @@ public final class WhoisException extends Exception implements WhoisResponse {
}
@Override
- public String getPlainTextOutput(boolean preferUnicode) {
+ public String getPlainTextOutput(boolean preferUnicode, String disclaimer) {
return new WhoisResponseImpl.BasicEmitter()
.emitRawLine(getMessage())
.emitLastUpdated(getTimestamp())
- .emitFooter()
+ .emitFooter(disclaimer)
.toString();
}
}
diff --git a/java/google/registry/whois/WhoisHttpServer.java b/java/google/registry/whois/WhoisHttpServer.java
index 15ff69900..18b97f70d 100644
--- a/java/google/registry/whois/WhoisHttpServer.java
+++ b/java/google/registry/whois/WhoisHttpServer.java
@@ -130,6 +130,7 @@ public final class WhoisHttpServer implements Runnable {
@Inject Clock clock;
@Inject Response response;
+ @Inject @Config("whoisDisclaimer") String disclaimer;
@Inject @Config("whoisHttpExpires") Duration expires;
@Inject @RequestPath String requestPath;
@Inject WhoisHttpServer() {}
@@ -159,7 +160,7 @@ public final class WhoisHttpServer implements Runnable {
response.setHeader(ACCESS_CONTROL_ALLOW_ORIGIN, CORS_ALLOW_ORIGIN);
response.setHeader(X_CONTENT_TYPE_OPTIONS, X_CONTENT_NO_SNIFF);
response.setContentType(PLAIN_TEXT_UTF_8);
- response.setPayload(whoisResponse.getPlainTextOutput(true));
+ response.setPayload(whoisResponse.getPlainTextOutput(true, disclaimer));
}
/** Removes {@code %xx} escape codes from request path components. */
diff --git a/java/google/registry/whois/WhoisResponse.java b/java/google/registry/whois/WhoisResponse.java
index fd593716f..b30253efe 100644
--- a/java/google/registry/whois/WhoisResponse.java
+++ b/java/google/registry/whois/WhoisResponse.java
@@ -22,13 +22,14 @@ public interface WhoisResponse {
/**
* Returns a plain text WHOIS response.
*
- * @param preferUnicode if {@code false} will cause the output to be converted to ASCII
- * whenever possible; for example, converting IDN hostname labels to punycode. However
- * certain things (like a domain registrant name with accent marks) will be returned
- * "as is". If the WHOIS client has told us they're able to receive UTF-8 (such as with
- * HTTP) then this field should be set to {@code true}.
+ * @param preferUnicode if {@code false} will cause the output to be converted to ASCII whenever
+ * possible; for example, converting IDN hostname labels to punycode. However certain things
+ * (like a domain registrant name with accent marks) will be returned "as is". If the WHOIS
+ * client has told us they're able to receive UTF-8 (such as with HTTP) then this field should
+ * be set to {@code true}.
+ * @param disclaimer text to show at bottom of output
*/
- String getPlainTextOutput(boolean preferUnicode);
+ String getPlainTextOutput(boolean preferUnicode, String disclaimer);
/**
* Returns the time at which this response was created.
diff --git a/java/google/registry/whois/WhoisResponseImpl.java b/java/google/registry/whois/WhoisResponseImpl.java
index 05180e40d..2f15c96bd 100644
--- a/java/google/registry/whois/WhoisResponseImpl.java
+++ b/java/google/registry/whois/WhoisResponseImpl.java
@@ -17,7 +17,6 @@ package google.registry.whois;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Strings.isNullOrEmpty;
import static com.google.common.html.HtmlEscapers.htmlEscaper;
-import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
@@ -26,13 +25,10 @@ import com.google.common.base.Supplier;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.Iterables;
import com.google.common.collect.Ordering;
-import com.google.common.io.Resources;
import google.registry.model.eppcommon.Address;
import google.registry.model.registrar.Registrar;
import google.registry.util.Idn;
import google.registry.xml.UtcDateTimeAdapter;
-import java.io.IOException;
-import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
@@ -42,9 +38,6 @@ import org.joda.time.DateTime;
/** Base class for responses to WHOIS queries. */
abstract class WhoisResponseImpl implements WhoisResponse {
- /** Legal disclaimer that is appended to all WHOIS responses. */
- private static final String DISCLAIMER = load("disclaimer.txt");
-
/** Field name for ICANN problem reporting URL appended to all WHOIS responses. */
private static final String ICANN_REPORTING_URL_FIELD =
"URL of the ICANN WHOIS Data Problem Reporting System";
@@ -166,9 +159,9 @@ abstract class WhoisResponseImpl implements WhoisResponse {
}
/** Returns raw text that should be appended to the end of ALL WHOIS responses. */
- E emitFooter() {
+ E emitFooter(String disclaimer) {
emitField(ICANN_REPORTING_URL_FIELD, ICANN_REPORTING_URL);
- stringBuilder.append("\r\n").append(DISCLAIMER).append("\r\n");
+ stringBuilder.append("\r\n").append(disclaimer).append("\r\n");
return thisCastToDerived();
}
@@ -199,16 +192,6 @@ abstract class WhoisResponseImpl implements WhoisResponse {
/** An emitter that needs no special logic. */
static class BasicEmitter extends Emitter {}
- /** Slurps UTF-8 file from jar, relative to this source file. */
- private static String load(String relativeFilename) {
- URL resource = Resources.getResource(WhoisResponseImpl.class, relativeFilename);
- try {
- return Resources.toString(resource, UTF_8).replaceAll("\r?\n", "\r\n").trim();
- } catch (IOException e) {
- throw new RuntimeException("Failed to slurp: " + relativeFilename, e);
- }
- }
-
/** Returns the registrar for this client id, or an empty registrar with null values. */
static Registrar getRegistrar(@Nullable String clientId) {
return Optional
diff --git a/java/google/registry/whois/WhoisServer.java b/java/google/registry/whois/WhoisServer.java
index a021d1fa0..e4cd46850 100644
--- a/java/google/registry/whois/WhoisServer.java
+++ b/java/google/registry/whois/WhoisServer.java
@@ -18,6 +18,7 @@ import static google.registry.request.Action.Method.POST;
import static javax.servlet.http.HttpServletResponse.SC_OK;
import com.google.common.net.MediaType;
+import google.registry.config.ConfigModule.Config;
import google.registry.request.Action;
import google.registry.request.Response;
import google.registry.util.Clock;
@@ -57,6 +58,9 @@ public class WhoisServer implements Runnable {
@Inject Clock clock;
@Inject Reader input;
@Inject Response response;
+ @Inject
+ @Config("whoisDisclaimer")
+ String disclaimer;
@Inject WhoisServer() {}
@Override
@@ -64,12 +68,13 @@ public class WhoisServer implements Runnable {
String responseText;
DateTime now = clock.nowUtc();
try {
- responseText = new WhoisReader(input, now)
- .readCommand()
- .executeQuery(now)
- .getPlainTextOutput(PREFER_UNICODE);
+ responseText =
+ new WhoisReader(input, now)
+ .readCommand()
+ .executeQuery(now)
+ .getPlainTextOutput(PREFER_UNICODE, disclaimer);
} catch (WhoisException e) {
- responseText = e.getPlainTextOutput(PREFER_UNICODE);
+ responseText = e.getPlainTextOutput(PREFER_UNICODE, disclaimer);
} catch (Throwable t) {
logger.severe(t, "WHOIS request crashed");
responseText = "Internal Server Error";
diff --git a/java/google/registry/whois/disclaimer.txt b/java/google/registry/whois/disclaimer.txt
deleted file mode 100644
index fe32678f3..000000000
--- a/java/google/registry/whois/disclaimer.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
diff --git a/javatests/google/registry/whois/DomainWhoisResponseTest.java b/javatests/google/registry/whois/DomainWhoisResponseTest.java
index 440d5731f..6dca60e17 100644
--- a/javatests/google/registry/whois/DomainWhoisResponseTest.java
+++ b/javatests/google/registry/whois/DomainWhoisResponseTest.java
@@ -239,7 +239,7 @@ public class DomainWhoisResponseTest {
public void getPlainTextOutputTest() {
DomainWhoisResponse domainWhoisResponse =
new DomainWhoisResponse(domainResource, clock.nowUtc());
- assertThat(domainWhoisResponse.getPlainTextOutput(false))
+ assertThat(domainWhoisResponse.getPlainTextOutput(false, "Doodle Disclaimer"))
.isEqualTo(loadWhoisTestFile("whois_domain.txt"));
}
@@ -248,6 +248,7 @@ public class DomainWhoisResponseTest {
DomainWhoisResponse domainWhoisResponse = new DomainWhoisResponse(
domainResource.asBuilder().setStatusValues(null).build(),
clock.nowUtc());
- assertThat(domainWhoisResponse.getPlainTextOutput(false)).contains("Domain Status: ok");
+ assertThat(domainWhoisResponse.getPlainTextOutput(false, "Doodle Disclaimer"))
+ .contains("Domain Status: ok");
}
}
diff --git a/javatests/google/registry/whois/NameserverWhoisResponseTest.java b/javatests/google/registry/whois/NameserverWhoisResponseTest.java
index 6e114e4a7..ce2637b61 100644
--- a/javatests/google/registry/whois/NameserverWhoisResponseTest.java
+++ b/javatests/google/registry/whois/NameserverWhoisResponseTest.java
@@ -81,7 +81,7 @@ public class NameserverWhoisResponseTest {
public void getTextOutputTest() {
NameserverWhoisResponse nameserverWhoisResponse =
new NameserverWhoisResponse(hostResource1, clock.nowUtc());
- assertThat(nameserverWhoisResponse.getPlainTextOutput(false))
+ assertThat(nameserverWhoisResponse.getPlainTextOutput(false, "Doodle Disclaimer"))
.isEqualTo(loadWhoisTestFile("whois_nameserver.txt"));
}
@@ -89,7 +89,7 @@ public class NameserverWhoisResponseTest {
public void getMultipleNameserversResponse() {
NameserverWhoisResponse nameserverWhoisResponse =
new NameserverWhoisResponse(ImmutableList.of(hostResource1, hostResource2), clock.nowUtc());
- assertThat(nameserverWhoisResponse.getPlainTextOutput(false))
+ assertThat(nameserverWhoisResponse.getPlainTextOutput(false, "Doodle Disclaimer"))
.isEqualTo(loadWhoisTestFile("whois_multiple_nameservers.txt"));
}
}
diff --git a/javatests/google/registry/whois/RegistrarWhoisResponseTest.java b/javatests/google/registry/whois/RegistrarWhoisResponseTest.java
index 756342ead..86d79f95e 100644
--- a/javatests/google/registry/whois/RegistrarWhoisResponseTest.java
+++ b/javatests/google/registry/whois/RegistrarWhoisResponseTest.java
@@ -113,7 +113,7 @@ public class RegistrarWhoisResponseTest {
RegistrarWhoisResponse registrarWhoisResponse =
new RegistrarWhoisResponse(registrar, clock.nowUtc());
- assertThat(registrarWhoisResponse.getPlainTextOutput(false))
+ assertThat(registrarWhoisResponse.getPlainTextOutput(false, "Doodle Disclaimer"))
.isEqualTo(loadWhoisTestFile("whois_registrar.txt"));
}
@@ -129,6 +129,6 @@ public class RegistrarWhoisResponseTest {
RegistrarWhoisResponse registrarWhoisResponse =
new RegistrarWhoisResponse(registrar, clock.nowUtc());
// Just make sure this doesn't NPE.
- registrarWhoisResponse.getPlainTextOutput(false);
+ registrarWhoisResponse.getPlainTextOutput(false, "Doodle Disclaimer");
}
}
diff --git a/javatests/google/registry/whois/WhoisHttpServerTest.java b/javatests/google/registry/whois/WhoisHttpServerTest.java
index a0e8f967d..22f1f596a 100644
--- a/javatests/google/registry/whois/WhoisHttpServerTest.java
+++ b/javatests/google/registry/whois/WhoisHttpServerTest.java
@@ -70,6 +70,7 @@ public class WhoisHttpServerTest {
result.expires = Duration.standardHours(1);
result.requestPath = WhoisHttpServer.PATH + pathInfo;
result.response = response;
+ result.disclaimer = "Doodle Disclaimer";
return result;
}
diff --git a/javatests/google/registry/whois/WhoisServerTest.java b/javatests/google/registry/whois/WhoisServerTest.java
index 5d101f66b..14c5e2af5 100644
--- a/javatests/google/registry/whois/WhoisServerTest.java
+++ b/javatests/google/registry/whois/WhoisServerTest.java
@@ -66,6 +66,7 @@ public class WhoisServerTest {
result.clock = clock;
result.input = new StringReader(input);
result.response = response;
+ result.disclaimer = "Doodle Disclaimer";
return result;
}
diff --git a/javatests/google/registry/whois/testdata/whois_domain.txt b/javatests/google/registry/whois/testdata/whois_domain.txt
index 9a35d8fbc..51195f5e8 100644
--- a/javatests/google/registry/whois/testdata/whois_domain.txt
+++ b/javatests/google/registry/whois/testdata/whois_domain.txt
@@ -61,16 +61,4 @@ For more information on Whois status codes, please visit https://icann.org/epp
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_multiple_nameservers.txt b/javatests/google/registry/whois/testdata/whois_multiple_nameservers.txt
index f00dab693..65676ecff 100644
--- a/javatests/google/registry/whois/testdata/whois_multiple_nameservers.txt
+++ b/javatests/google/registry/whois/testdata/whois_multiple_nameservers.txt
@@ -15,16 +15,4 @@ Referral URL: http://www.referral.example/path
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_nameserver.txt b/javatests/google/registry/whois/testdata/whois_nameserver.txt
index 45d8b2d63..1799a66c3 100644
--- a/javatests/google/registry/whois/testdata/whois_nameserver.txt
+++ b/javatests/google/registry/whois/testdata/whois_nameserver.txt
@@ -8,16 +8,4 @@ Referral URL: http://www.referral.example/path
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_registrar.txt b/javatests/google/registry/whois/testdata/whois_registrar.txt
index 1120c4eac..1561be6f6 100644
--- a/javatests/google/registry/whois/testdata/whois_registrar.txt
+++ b/javatests/google/registry/whois/testdata/whois_registrar.txt
@@ -25,16 +25,4 @@ Email: johngeek@example-registrar.tld
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_server_domain.txt b/javatests/google/registry/whois/testdata/whois_server_domain.txt
index 418e58c18..ae228c3ff 100644
--- a/javatests/google/registry/whois/testdata/whois_server_domain.txt
+++ b/javatests/google/registry/whois/testdata/whois_server_domain.txt
@@ -59,16 +59,4 @@ For more information on Whois status codes, please visit https://icann.org/epp
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_server_domain_not_found.txt b/javatests/google/registry/whois/testdata/whois_server_domain_not_found.txt
index ab0b2041f..7762455ac 100644
--- a/javatests/google/registry/whois/testdata/whois_server_domain_not_found.txt
+++ b/javatests/google/registry/whois/testdata/whois_server_domain_not_found.txt
@@ -3,16 +3,4 @@ Domain not found.
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_server_idn_punycode.txt b/javatests/google/registry/whois/testdata/whois_server_idn_punycode.txt
index d97c11858..d11cf409e 100644
--- a/javatests/google/registry/whois/testdata/whois_server_idn_punycode.txt
+++ b/javatests/google/registry/whois/testdata/whois_server_idn_punycode.txt
@@ -59,16 +59,4 @@ For more information on Whois status codes, please visit https://icann.org/epp
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_server_idn_utf8.txt b/javatests/google/registry/whois/testdata/whois_server_idn_utf8.txt
index 58788de74..c47609ddc 100644
--- a/javatests/google/registry/whois/testdata/whois_server_idn_utf8.txt
+++ b/javatests/google/registry/whois/testdata/whois_server_idn_utf8.txt
@@ -59,16 +59,4 @@ For more information on Whois status codes, please visit https://icann.org/epp
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_server_ip_not_found.txt b/javatests/google/registry/whois/testdata/whois_server_ip_not_found.txt
index 7644300b6..66a41514f 100644
--- a/javatests/google/registry/whois/testdata/whois_server_ip_not_found.txt
+++ b/javatests/google/registry/whois/testdata/whois_server_ip_not_found.txt
@@ -3,16 +3,4 @@ No nameservers found.
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_server_malformed_path.txt b/javatests/google/registry/whois/testdata/whois_server_malformed_path.txt
index 06090a46d..6194cd016 100644
--- a/javatests/google/registry/whois/testdata/whois_server_malformed_path.txt
+++ b/javatests/google/registry/whois/testdata/whois_server_malformed_path.txt
@@ -3,16 +3,4 @@ Malformed path query.
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_server_nameserver.txt b/javatests/google/registry/whois/testdata/whois_server_nameserver.txt
index 59c242f7d..27987406a 100644
--- a/javatests/google/registry/whois/testdata/whois_server_nameserver.txt
+++ b/javatests/google/registry/whois/testdata/whois_server_nameserver.txt
@@ -7,16 +7,4 @@ Referral URL: http://www.referral.example/path
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_server_nameserver_not_found.txt b/javatests/google/registry/whois/testdata/whois_server_nameserver_not_found.txt
index 6f5f61cbc..19a13d9e2 100644
--- a/javatests/google/registry/whois/testdata/whois_server_nameserver_not_found.txt
+++ b/javatests/google/registry/whois/testdata/whois_server_nameserver_not_found.txt
@@ -3,16 +3,4 @@ Nameserver not found.
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_server_no_command.txt b/javatests/google/registry/whois/testdata/whois_server_no_command.txt
index 31c8e7a91..fd4e209e8 100644
--- a/javatests/google/registry/whois/testdata/whois_server_no_command.txt
+++ b/javatests/google/registry/whois/testdata/whois_server_no_command.txt
@@ -3,16 +3,4 @@ No WHOIS command specified.
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_server_registrar.txt b/javatests/google/registry/whois/testdata/whois_server_registrar.txt
index 87387dc6e..bfaeec1dd 100644
--- a/javatests/google/registry/whois/testdata/whois_server_registrar.txt
+++ b/javatests/google/registry/whois/testdata/whois_server_registrar.txt
@@ -21,16 +21,4 @@ Email: johndoe@example.com
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer
diff --git a/javatests/google/registry/whois/testdata/whois_server_registrar_not_found.txt b/javatests/google/registry/whois/testdata/whois_server_registrar_not_found.txt
index 8e3b153f5..1c51c0552 100644
--- a/javatests/google/registry/whois/testdata/whois_server_registrar_not_found.txt
+++ b/javatests/google/registry/whois/testdata/whois_server_registrar_not_found.txt
@@ -3,16 +3,4 @@ No registrar found.
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
-WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for
-query-based, informational purposes. By querying our WHOIS database, you are
-agreeing to comply with these terms
-(http://www.registry.google/about/whois-disclaimer.html) so please read them
-carefully. Any information provided is "as is" without any guarantee of
-accuracy. You may not use such information to (a) allow, enable, or otherwise
-support the transmission of mass unsolicited, commercial advertising or
-solicitations; (b) enable high volume, automated, electronic processes that
-access the systems of CRR or any ICANN-Accredited Registrar, except as
-reasonably necessary to register domain names or modify existing registrations;
-or (c) engage in or support unlawful behavior. CRR reserves the right to
-restrict or deny your access to the Whois database, and may modify these terms
-at any time.
+Doodle Disclaimer