mirror of
https://github.com/google/nomulus.git
synced 2025-07-25 03:58:34 +02:00
Always display the registrar abuse contact fields in WHOIS
ICANN's Consistent Labeling & Display policy requires that these fields be present for all domains. We're currently tracking down the last of the data on our registrars so that we can display these, but if we don't have the data we should still at least be displaying the field names to make it more clear that we do support the field, we just don't have the data for this domain yet. The two fields in question are: Registrar Abuse Contact Email: Registrar Abuse Contact Phone: ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201730290
This commit is contained in:
parent
8245d2f1c4
commit
481790bc91
3 changed files with 82 additions and 6 deletions
|
@ -97,12 +97,12 @@ final class DomainWhoisResponse extends WhoisResponseImpl {
|
||||||
.emitField("Registrar IANA ID", Objects.toString(registrar.getIanaIdentifier(), ""))
|
.emitField("Registrar IANA ID", Objects.toString(registrar.getIanaIdentifier(), ""))
|
||||||
// Email address is a required field for registrar contacts. Therefore as long as there
|
// Email address is a required field for registrar contacts. Therefore as long as there
|
||||||
// is an abuse contact, we can get an email address from it.
|
// is an abuse contact, we can get an email address from it.
|
||||||
.emitFieldIfDefined(
|
.emitField(
|
||||||
"Registrar Abuse Contact Email",
|
"Registrar Abuse Contact Email",
|
||||||
abuseContact.map(RegistrarContact::getEmailAddress).orElse(null))
|
abuseContact.map(RegistrarContact::getEmailAddress).orElse(""))
|
||||||
.emitFieldIfDefined(
|
.emitField(
|
||||||
"Registrar Abuse Contact Phone",
|
"Registrar Abuse Contact Phone",
|
||||||
abuseContact.map(RegistrarContact::getPhoneNumber).orElse(null))
|
abuseContact.map(RegistrarContact::getPhoneNumber).orElse(""))
|
||||||
.emitStatusValues(domain.getStatusValues(), domain.getGracePeriods())
|
.emitStatusValues(domain.getStatusValues(), domain.getGracePeriods())
|
||||||
.emitContact("Registrant", Optional.of(domain.getRegistrant()), preferUnicode)
|
.emitContact("Registrant", Optional.of(domain.getRegistrant()), preferUnicode)
|
||||||
.emitContact("Admin", getContactReference(Type.ADMIN), preferUnicode)
|
.emitContact("Admin", getContactReference(Type.ADMIN), preferUnicode)
|
||||||
|
|
|
@ -58,8 +58,9 @@ public class DomainWhoisResponseTest {
|
||||||
|
|
||||||
HostResource hostResource1;
|
HostResource hostResource1;
|
||||||
HostResource hostResource2;
|
HostResource hostResource2;
|
||||||
ContactResource registrant;
|
RegistrarContact abuseContact;
|
||||||
ContactResource adminContact;
|
ContactResource adminContact;
|
||||||
|
ContactResource registrant;
|
||||||
ContactResource techContact;
|
ContactResource techContact;
|
||||||
DomainResource domainResource;
|
DomainResource domainResource;
|
||||||
|
|
||||||
|
@ -76,7 +77,7 @@ public class DomainWhoisResponseTest {
|
||||||
.setIanaIdentifier(5555555L)
|
.setIanaIdentifier(5555555L)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
persistResource(
|
abuseContact = persistResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarContact.Builder()
|
||||||
.setParent(registrar)
|
.setParent(registrar)
|
||||||
.setName("Jake Doe")
|
.setName("Jake Doe")
|
||||||
|
@ -263,6 +264,17 @@ public class DomainWhoisResponseTest {
|
||||||
.isEqualTo(WhoisResponseResults.create(loadFile("whois_domain.txt"), 1));
|
.isEqualTo(WhoisResponseResults.create(loadFile("whois_domain.txt"), 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getPlainTextOutputTest_registrarAbuseInfoMissing() {
|
||||||
|
persistResource(abuseContact.asBuilder().setVisibleInDomainWhoisAsAbuse(false).build());
|
||||||
|
DomainWhoisResponse domainWhoisResponse =
|
||||||
|
new DomainWhoisResponse(domainResource, false, clock.nowUtc());
|
||||||
|
assertThat(domainWhoisResponse.getResponse(false, "Footer"))
|
||||||
|
.isEqualTo(
|
||||||
|
WhoisResponseResults.create(
|
||||||
|
loadFile("whois_domain_registrar_abuse_info_missing.txt"), 1));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getPlainTextOutputTest_fullOutput() {
|
public void getPlainTextOutputTest_fullOutput() {
|
||||||
DomainWhoisResponse domainWhoisResponse =
|
DomainWhoisResponse domainWhoisResponse =
|
||||||
|
|
64
javatests/google/registry/whois/testdata/whois_domain_registrar_abuse_info_missing.txt
vendored
Normal file
64
javatests/google/registry/whois/testdata/whois_domain_registrar_abuse_info_missing.txt
vendored
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
Domain Name: example.tld
|
||||||
|
Registry Domain ID: 3-TLD
|
||||||
|
Registrar WHOIS Server: whois.nic.fakewhois.example
|
||||||
|
Registrar URL: http://my.fake.url
|
||||||
|
Updated Date: 2009-05-29T20:13:00Z
|
||||||
|
Creation Date: 2000-10-08T00:45:00Z
|
||||||
|
Registry Expiry Date: 2010-10-08T00:44:59Z
|
||||||
|
Registrar: New Registrar
|
||||||
|
Registrar IANA ID: 5555555
|
||||||
|
Registrar Abuse Contact Email:
|
||||||
|
Registrar Abuse Contact Phone:
|
||||||
|
Domain Status: addPeriod https://icann.org/epp#addPeriod
|
||||||
|
Domain Status: clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited
|
||||||
|
Domain Status: clientRenewProhibited https://icann.org/epp#clientRenewProhibited
|
||||||
|
Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
|
||||||
|
Domain Status: serverUpdateProhibited https://icann.org/epp#serverUpdateProhibited
|
||||||
|
Domain Status: transferPeriod https://icann.org/epp#transferPeriod
|
||||||
|
Registry Registrant ID: REDACTED FOR PRIVACY
|
||||||
|
Registrant Name: REDACTED FOR PRIVACY
|
||||||
|
Registrant Organization: Tom & Jerry Corp.
|
||||||
|
Registrant Street: REDACTED FOR PRIVACY
|
||||||
|
Registrant City: REDACTED FOR PRIVACY
|
||||||
|
Registrant State/Province: AP
|
||||||
|
Registrant Postal Code: REDACTED FOR PRIVACY
|
||||||
|
Registrant Country: EX
|
||||||
|
Registrant Phone: REDACTED FOR PRIVACY
|
||||||
|
Registrant Phone Ext: REDACTED FOR PRIVACY
|
||||||
|
Registrant Fax: REDACTED FOR PRIVACY
|
||||||
|
Registrant Fax Ext: REDACTED FOR PRIVACY
|
||||||
|
Registrant Email: REDACTED FOR PRIVACY
|
||||||
|
Registry Admin ID: REDACTED FOR PRIVACY
|
||||||
|
Admin Name: REDACTED FOR PRIVACY
|
||||||
|
Admin Organization: REDACTED FOR PRIVACY
|
||||||
|
Admin Street: REDACTED FOR PRIVACY
|
||||||
|
Admin City: REDACTED FOR PRIVACY
|
||||||
|
Admin State/Province: REDACTED FOR PRIVACY
|
||||||
|
Admin Postal Code: REDACTED FOR PRIVACY
|
||||||
|
Admin Country: REDACTED FOR PRIVACY
|
||||||
|
Admin Phone: REDACTED FOR PRIVACY
|
||||||
|
Admin Phone Ext: REDACTED FOR PRIVACY
|
||||||
|
Admin Fax: REDACTED FOR PRIVACY
|
||||||
|
Admin Email: REDACTED FOR PRIVACY
|
||||||
|
Registry Tech ID: REDACTED FOR PRIVACY
|
||||||
|
Tech Name: REDACTED FOR PRIVACY
|
||||||
|
Tech Organization: REDACTED FOR PRIVACY
|
||||||
|
Tech Street: REDACTED FOR PRIVACY
|
||||||
|
Tech City: REDACTED FOR PRIVACY
|
||||||
|
Tech State/Province: REDACTED FOR PRIVACY
|
||||||
|
Tech Postal Code: REDACTED FOR PRIVACY
|
||||||
|
Tech Country: REDACTED FOR PRIVACY
|
||||||
|
Tech Phone: REDACTED FOR PRIVACY
|
||||||
|
Tech Phone Ext: REDACTED FOR PRIVACY
|
||||||
|
Tech Fax: REDACTED FOR PRIVACY
|
||||||
|
Tech Fax Ext: REDACTED FOR PRIVACY
|
||||||
|
Tech Email: REDACTED FOR PRIVACY
|
||||||
|
Name Server: ns01.exampleregistrar.tld
|
||||||
|
Name Server: ns02.exampleregistrar.tld
|
||||||
|
DNSSEC: signedDelegation
|
||||||
|
URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
|
||||||
|
>>> Last update of WHOIS database: 2009-05-29T20:15:00Z <<<
|
||||||
|
|
||||||
|
For more information on Whois status codes, please visit https://icann.org/epp
|
||||||
|
|
||||||
|
Footer
|
Loading…
Add table
Add a link
Reference in a new issue