1
0
mirror of https://github.com/google/nomulus synced 2026-02-10 23:10:39 +00:00

Fix WHOIS formatting to match format from RA

Our whois format was flagged as wrong in the .meet PDT. Although
we had followed the AWIP samples from ICANN, the definitive list
of field names is from Specification 4 of our contract, available at
https://newgtlds.icann.org/sites/default/files/agreements/agreement-approved-09jan14-en.htm
and indeed our fields are incorrect. (The remaining formatting issues
are ambiguous but the PDT testers' interpretation is probably correct.)

Since the footer format is now somewhat more complicated, I also denormalized
the disclaimer field into all of the testdata files. (I spent some time
debugging an extra newline between the content and the disclaimer, and
it would have been far clearer to solve if the files had been this way.)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120338930
This commit is contained in:
cgoldfeder
2016-04-20 08:23:16 -07:00
committed by Justine Tunney
parent c99711c7e3
commit 4e6c8ec6fe
21 changed files with 347 additions and 113 deletions

View File

@@ -49,11 +49,11 @@ final class DomainWhoisResponse extends WhoisResponseImpl {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
/** Prefix for status value URLs. */
private static final String ICANN_STATUS_URL_PREFIX = "https://www.icann.org/epp#";
private static final String ICANN_STATUS_URL_PREFIX = "https://icann.org/epp#";
/** Message required to be appended to all domain WHOIS responses. */
private static final String ICANN_AWIP_INFO_MESSAGE =
"For more information on Whois status codes, please visit https://icann.org/epp";
"For more information on Whois status codes, please visit https://icann.org/epp\r\n";
/** Domain which was the target of this WHOIS command. */
private final DomainResource domain;
@@ -70,14 +70,14 @@ final class DomainWhoisResponse extends WhoisResponseImpl {
return new DomainEmitter()
.emitField("Domain Name",
maybeFormatHostname(domain.getFullyQualifiedDomainName(), preferUnicode))
.emitField("Registry Domain ID", domain.getRepoId())
.emitField("Registrar WHOIS Server", registrar.getWhoisServer())
.emitField("Registrar URL", registrar.getReferralUrl())
.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("Registrar Registration Expiration Date",
.emitField("Registry Expiry Date",
getFormattedString(domain.getRegistrationExpirationTime()))
.emitField("Registrar", registrar.getRegistrarName())
.emitField("Sponsoring Registrar", registrar.getRegistrarName())
.emitField("Sponsoring Registrar IANA ID",
registrar.getIanaIdentifier() == null ? null : registrar.getIanaIdentifier().toString())
.emitStatusValues(domain.getStatusValues(), domain.getGracePeriods())
@@ -94,8 +94,9 @@ final class DomainWhoisResponse extends WhoisResponseImpl {
return maybeFormatHostname(host.getFullyQualifiedHostName(), preferUnicode);
}})
.emitField("DNSSEC", isNullOrEmpty(domain.getDsData()) ? "unsigned" : "signedDelegation")
.emitLastUpdated(getTimestamp())
.emitAwipMessage()
.emitFooter(getTimestamp())
.emitFooter()
.toString();
}
@@ -138,7 +139,7 @@ final class DomainWhoisResponse extends WhoisResponseImpl {
domain.getFullyQualifiedDomainName(), contact.getLinked());
return this;
}
emitField("Registry " + contactType, "ID", contactResource.getContactId());
emitField(contactType, "ID", contactResource.getContactId());
PostalInfo postalInfo = chooseByUnicodePreference(
preferUnicode,
contactResource.getLocalizedPostalInfo(),