mirror of
https://github.com/google/nomulus
synced 2026-08-02 05:16:08 +00:00
Enforce abuse WHOIS contact for REAL registrars when adding TLDs
We do not enforce this for non-REAL registrars or in any environment other than UNITTEST or PRODUCTION. This is similar but separate to [] since we can add allowed TLDs in either location. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=239510275
This commit is contained in:
@@ -561,6 +561,16 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable
|
||||
.collect(toImmutableSortedSet(CONTACT_EMAIL_COMPARATOR));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link RegistrarContact} that is the WHOIS abuse contact for this registrar, or
|
||||
* empty if one does not exist.
|
||||
*/
|
||||
public Optional<RegistrarContact> getWhoisAbuseContact() {
|
||||
return getContacts().stream()
|
||||
.filter(RegistrarContact::getVisibleInDomainWhoisAsAbuse)
|
||||
.findFirst();
|
||||
}
|
||||
|
||||
private Iterable<RegistrarContact> getContactsIterable() {
|
||||
return ofy().load().type(RegistrarContact.class).ancestor(Registrar.this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user