mirror of
https://github.com/google/nomulus.git
synced 2025-08-14 05:29:38 +02:00
Remove Ofy from RegistrarContact (#1680)
Also renamed the class to RegistrarPoc and deleted some unused methods.
This commit is contained in:
parent
9212316388
commit
bbc4c4bb86
52 changed files with 551 additions and 700 deletions
|
@ -31,7 +31,7 @@ import google.registry.model.domain.DomainBase;
|
||||||
import google.registry.model.domain.RegistryLock;
|
import google.registry.model.domain.RegistryLock;
|
||||||
import google.registry.model.eppcommon.StatusValue;
|
import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.tld.RegistryLockDao;
|
import google.registry.model.tld.RegistryLockDao;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.request.Action;
|
import google.registry.request.Action;
|
||||||
|
@ -296,8 +296,8 @@ public class RelockDomainAction implements Runnable {
|
||||||
|
|
||||||
ImmutableSet<String> registryLockEmailAddresses =
|
ImmutableSet<String> registryLockEmailAddresses =
|
||||||
registrar.getContacts().stream()
|
registrar.getContacts().stream()
|
||||||
.filter(RegistrarContact::isRegistryLockAllowed)
|
.filter(RegistrarPoc::isRegistryLockAllowed)
|
||||||
.map(RegistrarContact::getRegistryLockEmailAddress)
|
.map(RegistrarPoc::getRegistryLockEmailAddress)
|
||||||
.filter(Optional::isPresent)
|
.filter(Optional::isPresent)
|
||||||
.map(Optional::get)
|
.map(Optional::get)
|
||||||
.collect(toImmutableSet());
|
.collect(toImmutableSet());
|
||||||
|
|
|
@ -32,8 +32,8 @@ import com.google.common.net.MediaType;
|
||||||
import google.registry.config.RegistryConfig.Config;
|
import google.registry.config.RegistryConfig.Config;
|
||||||
import google.registry.flows.certs.CertificateChecker;
|
import google.registry.flows.certs.CertificateChecker;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.registrar.RegistrarContact.Type;
|
import google.registry.model.registrar.RegistrarPoc.Type;
|
||||||
import google.registry.request.Action;
|
import google.registry.request.Action;
|
||||||
import google.registry.request.Response;
|
import google.registry.request.Response;
|
||||||
import google.registry.request.auth.Auth;
|
import google.registry.request.auth.Auth;
|
||||||
|
@ -281,9 +281,9 @@ public class SendExpiringCertificateNotificationEmailAction implements Runnable
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
ImmutableSet<InternetAddress> getEmailAddresses(Registrar registrar, Type contactType) {
|
ImmutableSet<InternetAddress> getEmailAddresses(Registrar registrar, Type contactType) {
|
||||||
ImmutableSortedSet<RegistrarContact> contacts = registrar.getContactsOfType(contactType);
|
ImmutableSortedSet<RegistrarPoc> contacts = registrar.getContactsOfType(contactType);
|
||||||
ImmutableSet.Builder<InternetAddress> recipientEmails = new ImmutableSet.Builder<>();
|
ImmutableSet.Builder<InternetAddress> recipientEmails = new ImmutableSet.Builder<>();
|
||||||
for (RegistrarContact contact : contacts) {
|
for (RegistrarPoc contact : contacts) {
|
||||||
try {
|
try {
|
||||||
recipientEmails.add(new InternetAddress(contact.getEmailAddress()));
|
recipientEmails.add(new InternetAddress(contact.getEmailAddress()));
|
||||||
} catch (AddressException e) {
|
} catch (AddressException e) {
|
||||||
|
|
|
@ -32,7 +32,7 @@ import google.registry.config.RegistryConfig.Config;
|
||||||
import google.registry.groups.GroupsConnection;
|
import google.registry.groups.GroupsConnection;
|
||||||
import google.registry.groups.GroupsConnection.Role;
|
import google.registry.groups.GroupsConnection.Role;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.request.Action;
|
import google.registry.request.Action;
|
||||||
import google.registry.request.Response;
|
import google.registry.request.Response;
|
||||||
import google.registry.request.auth.Auth;
|
import google.registry.request.auth.Auth;
|
||||||
|
@ -47,7 +47,7 @@ import javax.annotation.Nullable;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action that syncs changes to {@link RegistrarContact} entities with Google Groups.
|
* Action that syncs changes to {@link RegistrarPoc} entities with Google Groups.
|
||||||
*
|
*
|
||||||
* <p>This uses the <a href="https://developers.google.com/admin-sdk/directory/">Directory API</a>.
|
* <p>This uses the <a href="https://developers.google.com/admin-sdk/directory/">Directory API</a>.
|
||||||
*/
|
*/
|
||||||
|
@ -99,7 +99,7 @@ public final class SyncGroupMembersAction implements Runnable {
|
||||||
* Returns the Google Groups email address for the given registrar ID and RegistrarContact.Type.
|
* Returns the Google Groups email address for the given registrar ID and RegistrarContact.Type.
|
||||||
*/
|
*/
|
||||||
public static String getGroupEmailAddressForContactType(
|
public static String getGroupEmailAddressForContactType(
|
||||||
String registrarId, RegistrarContact.Type type, String gSuiteDomainName) {
|
String registrarId, RegistrarPoc.Type type, String gSuiteDomainName) {
|
||||||
// Take the registrar's ID, make it lowercase, and remove all characters that aren't
|
// Take the registrar's ID, make it lowercase, and remove all characters that aren't
|
||||||
// alphanumeric, hyphens, or underscores.
|
// alphanumeric, hyphens, or underscores.
|
||||||
return String.format(
|
return String.format(
|
||||||
|
@ -171,18 +171,17 @@ public final class SyncGroupMembersAction implements Runnable {
|
||||||
private void syncRegistrarContacts(Registrar registrar) {
|
private void syncRegistrarContacts(Registrar registrar) {
|
||||||
String groupKey = "";
|
String groupKey = "";
|
||||||
try {
|
try {
|
||||||
Set<RegistrarContact> registrarContacts = registrar.getContacts();
|
Set<RegistrarPoc> registrarPocs = registrar.getContacts();
|
||||||
long totalAdded = 0;
|
long totalAdded = 0;
|
||||||
long totalRemoved = 0;
|
long totalRemoved = 0;
|
||||||
for (final RegistrarContact.Type type : RegistrarContact.Type.values()) {
|
for (final RegistrarPoc.Type type : RegistrarPoc.Type.values()) {
|
||||||
groupKey =
|
groupKey =
|
||||||
getGroupEmailAddressForContactType(registrar.getRegistrarId(), type, gSuiteDomainName);
|
getGroupEmailAddressForContactType(registrar.getRegistrarId(), type, gSuiteDomainName);
|
||||||
Set<String> currentMembers = groupsConnection.getMembersOfGroup(groupKey);
|
Set<String> currentMembers = groupsConnection.getMembersOfGroup(groupKey);
|
||||||
Set<String> desiredMembers =
|
Set<String> desiredMembers =
|
||||||
registrarContacts
|
registrarPocs.stream()
|
||||||
.stream()
|
|
||||||
.filter(contact -> contact.getTypes().contains(type))
|
.filter(contact -> contact.getTypes().contains(type))
|
||||||
.map(RegistrarContact::getEmailAddress)
|
.map(RegistrarPoc::getEmailAddress)
|
||||||
.collect(toImmutableSet());
|
.collect(toImmutableSet());
|
||||||
for (String email : Sets.difference(desiredMembers, currentMembers)) {
|
for (String email : Sets.difference(desiredMembers, currentMembers)) {
|
||||||
groupsConnection.addMemberToGroup(groupKey, email, Role.MEMBER);
|
groupsConnection.addMemberToGroup(groupKey, email, Role.MEMBER);
|
||||||
|
|
|
@ -17,13 +17,13 @@ package google.registry.export.sheet;
|
||||||
import static com.google.common.base.MoreObjects.firstNonNull;
|
import static com.google.common.base.MoreObjects.firstNonNull;
|
||||||
import static com.google.common.collect.ImmutableList.toImmutableList;
|
import static com.google.common.collect.ImmutableList.toImmutableList;
|
||||||
import static google.registry.model.common.Cursor.CursorType.SYNC_REGISTRAR_SHEET;
|
import static google.registry.model.common.Cursor.CursorType.SYNC_REGISTRAR_SHEET;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.ABUSE;
|
import static google.registry.model.registrar.RegistrarPoc.Type.ABUSE;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.ADMIN;
|
import static google.registry.model.registrar.RegistrarPoc.Type.ADMIN;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.BILLING;
|
import static google.registry.model.registrar.RegistrarPoc.Type.BILLING;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.LEGAL;
|
import static google.registry.model.registrar.RegistrarPoc.Type.LEGAL;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.MARKETING;
|
import static google.registry.model.registrar.RegistrarPoc.Type.MARKETING;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.TECH;
|
import static google.registry.model.registrar.RegistrarPoc.Type.TECH;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.WHOIS;
|
import static google.registry.model.registrar.RegistrarPoc.Type.WHOIS;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerUtil.transactIfJpaTm;
|
import static google.registry.persistence.transaction.TransactionManagerUtil.transactIfJpaTm;
|
||||||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||||
|
@ -36,7 +36,7 @@ import com.google.common.collect.Ordering;
|
||||||
import google.registry.model.common.Cursor;
|
import google.registry.model.common.Cursor;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.util.Clock;
|
import google.registry.util.Clock;
|
||||||
import google.registry.util.DateTimeUtils;
|
import google.registry.util.DateTimeUtils;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -92,7 +92,7 @@ class SyncRegistrarsSheet {
|
||||||
.map(
|
.map(
|
||||||
registrar -> {
|
registrar -> {
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<>();
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<>();
|
||||||
ImmutableSortedSet<RegistrarContact> contacts = registrar.getContacts();
|
ImmutableSortedSet<RegistrarPoc> contacts = registrar.getContacts();
|
||||||
RegistrarAddress address =
|
RegistrarAddress address =
|
||||||
firstNonNull(
|
firstNonNull(
|
||||||
registrar.getLocalizedAddress(),
|
registrar.getLocalizedAddress(),
|
||||||
|
@ -130,10 +130,10 @@ class SyncRegistrarsSheet {
|
||||||
builder.put("billingContacts", convertContacts(contacts, byType(BILLING)));
|
builder.put("billingContacts", convertContacts(contacts, byType(BILLING)));
|
||||||
builder.put(
|
builder.put(
|
||||||
"contactsMarkedAsWhoisAdmin",
|
"contactsMarkedAsWhoisAdmin",
|
||||||
convertContacts(contacts, RegistrarContact::getVisibleInWhoisAsAdmin));
|
convertContacts(contacts, RegistrarPoc::getVisibleInWhoisAsAdmin));
|
||||||
builder.put(
|
builder.put(
|
||||||
"contactsMarkedAsWhoisTech",
|
"contactsMarkedAsWhoisTech",
|
||||||
convertContacts(contacts, RegistrarContact::getVisibleInWhoisAsTech));
|
convertContacts(contacts, RegistrarPoc::getVisibleInWhoisAsTech));
|
||||||
builder.put("emailAddress", convert(registrar.getEmailAddress()));
|
builder.put("emailAddress", convert(registrar.getEmailAddress()));
|
||||||
builder.put("address.street", convert(address.getStreet()));
|
builder.put("address.street", convert(address.getStreet()));
|
||||||
builder.put("address.city", convert(address.getCity()));
|
builder.put("address.city", convert(address.getCity()));
|
||||||
|
@ -158,10 +158,10 @@ class SyncRegistrarsSheet {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String convertContacts(
|
private static String convertContacts(
|
||||||
Iterable<RegistrarContact> contacts, Predicate<RegistrarContact> filter) {
|
Iterable<RegistrarPoc> contacts, Predicate<RegistrarPoc> filter) {
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
for (RegistrarContact contact : contacts) {
|
for (RegistrarPoc contact : contacts) {
|
||||||
if (!filter.test(contact)) {
|
if (!filter.test(contact)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ class SyncRegistrarsSheet {
|
||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Predicate<RegistrarContact> byType(final RegistrarContact.Type type) {
|
private static Predicate<RegistrarPoc> byType(final RegistrarPoc.Type type) {
|
||||||
return contact -> contact.getTypes().contains(type);
|
return contact -> contact.getTypes().contains(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@ import google.registry.model.index.ForeignKeyIndex;
|
||||||
import google.registry.model.poll.PollMessage;
|
import google.registry.model.poll.PollMessage;
|
||||||
import google.registry.model.rde.RdeRevision;
|
import google.registry.model.rde.RdeRevision;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
|
||||||
import google.registry.model.replay.LastSqlTransaction;
|
import google.registry.model.replay.LastSqlTransaction;
|
||||||
import google.registry.model.replay.ReplayGap;
|
import google.registry.model.replay.ReplayGap;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
|
@ -75,7 +74,6 @@ public final class EntityClasses {
|
||||||
PollMessage.OneTime.class,
|
PollMessage.OneTime.class,
|
||||||
RdeRevision.class,
|
RdeRevision.class,
|
||||||
Registrar.class,
|
Registrar.class,
|
||||||
RegistrarContact.class,
|
|
||||||
Registry.class,
|
Registry.class,
|
||||||
ReplayGap.class,
|
ReplayGap.class,
|
||||||
ServerSecret.class);
|
ServerSecret.class);
|
||||||
|
|
|
@ -35,7 +35,7 @@ import google.registry.model.common.GaeUserIdConverter;
|
||||||
import google.registry.model.pricing.StaticPremiumListPricingEngine;
|
import google.registry.model.pricing.StaticPremiumListPricingEngine;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.Registry.TldState;
|
import google.registry.model.tld.Registry.TldState;
|
||||||
import google.registry.model.tld.Registry.TldType;
|
import google.registry.model.tld.Registry.TldType;
|
||||||
|
@ -127,8 +127,7 @@ public final class OteAccountBuilder {
|
||||||
private final Registry sunriseTld;
|
private final Registry sunriseTld;
|
||||||
private final Registry gaTld;
|
private final Registry gaTld;
|
||||||
private final Registry eapTld;
|
private final Registry eapTld;
|
||||||
private final ImmutableList.Builder<RegistrarContact> contactsBuilder =
|
private final ImmutableList.Builder<RegistrarPoc> contactsBuilder = new ImmutableList.Builder<>();
|
||||||
new ImmutableList.Builder<>();
|
|
||||||
|
|
||||||
private ImmutableList<Registrar> registrars;
|
private ImmutableList<Registrar> registrars;
|
||||||
private boolean replaceExisting = false;
|
private boolean replaceExisting = false;
|
||||||
|
@ -259,7 +258,7 @@ public final class OteAccountBuilder {
|
||||||
private void saveAllEntities() {
|
private void saveAllEntities() {
|
||||||
// use ImmutableObject instead of Registry so that the Key generation doesn't break
|
// use ImmutableObject instead of Registry so that the Key generation doesn't break
|
||||||
ImmutableList<Registry> registries = ImmutableList.of(sunriseTld, gaTld, eapTld);
|
ImmutableList<Registry> registries = ImmutableList.of(sunriseTld, gaTld, eapTld);
|
||||||
ImmutableList<RegistrarContact> contacts = contactsBuilder.build();
|
ImmutableList<RegistrarPoc> contacts = contactsBuilder.build();
|
||||||
|
|
||||||
tm().transact(
|
tm().transact(
|
||||||
() -> {
|
() -> {
|
||||||
|
@ -269,7 +268,7 @@ public final class OteAccountBuilder {
|
||||||
registries.stream()
|
registries.stream()
|
||||||
.map(registry -> Registry.createVKey(registry.getTldStr())),
|
.map(registry -> Registry.createVKey(registry.getTldStr())),
|
||||||
registrars.stream().map(Registrar::createVKey),
|
registrars.stream().map(Registrar::createVKey),
|
||||||
contacts.stream().map(RegistrarContact::createVKey))
|
contacts.stream().map(RegistrarPoc::createVKey))
|
||||||
.collect(toImmutableList());
|
.collect(toImmutableList());
|
||||||
ImmutableMap<VKey<? extends ImmutableObject>, ImmutableObject> existingObjects =
|
ImmutableMap<VKey<? extends ImmutableObject>, ImmutableObject> existingObjects =
|
||||||
tm().loadByKeysIfPresent(keys);
|
tm().loadByKeysIfPresent(keys);
|
||||||
|
@ -351,10 +350,10 @@ public final class OteAccountBuilder {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static RegistrarContact createRegistrarContact(
|
private static RegistrarPoc createRegistrarContact(
|
||||||
String email, String gaeUserId, Registrar registrar) {
|
String email, String gaeUserId, Registrar registrar) {
|
||||||
return new RegistrarContact.Builder()
|
return new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName(email)
|
.setName(email)
|
||||||
.setEmailAddress(email)
|
.setEmailAddress(email)
|
||||||
.setGaeUserId(gaeUserId)
|
.setGaeUserId(gaeUserId)
|
||||||
|
|
|
@ -217,11 +217,9 @@ public class Registrar extends ImmutableObject
|
||||||
immutableEnumSet(
|
immutableEnumSet(
|
||||||
Type.REAL, Type.PDT, Type.OTE, Type.EXTERNAL_MONITORING, Type.MONITORING, Type.INTERNAL);
|
Type.REAL, Type.PDT, Type.OTE, Type.EXTERNAL_MONITORING, Type.MONITORING, Type.INTERNAL);
|
||||||
|
|
||||||
/**
|
/** Compare two instances of {@link RegistrarPoc} by their email addresses lexicographically. */
|
||||||
* Compare two instances of {@link RegistrarContact} by their email addresses lexicographically.
|
private static final Comparator<RegistrarPoc> CONTACT_EMAIL_COMPARATOR =
|
||||||
*/
|
comparing(RegistrarPoc::getEmailAddress, String::compareTo);
|
||||||
private static final Comparator<RegistrarContact> CONTACT_EMAIL_COMPARATOR =
|
|
||||||
comparing(RegistrarContact::getEmailAddress, String::compareTo);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A caching {@link Supplier} of a registrarId to {@link Registrar} map.
|
* A caching {@link Supplier} of a registrarId to {@link Registrar} map.
|
||||||
|
@ -628,46 +626,43 @@ public class Registrar extends ImmutableObject
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of all {@link RegistrarContact} objects for this registrar sorted by their email
|
* Returns a list of all {@link RegistrarPoc} objects for this registrar sorted by their email
|
||||||
* address.
|
* address.
|
||||||
*/
|
*/
|
||||||
public ImmutableSortedSet<RegistrarContact> getContacts() {
|
public ImmutableSortedSet<RegistrarPoc> getContacts() {
|
||||||
return Streams.stream(getContactsIterable())
|
return Streams.stream(getContactsIterable())
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(toImmutableSortedSet(CONTACT_EMAIL_COMPARATOR));
|
.collect(toImmutableSortedSet(CONTACT_EMAIL_COMPARATOR));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of {@link RegistrarContact} objects of a given type for this registrar sorted by
|
* Returns a list of {@link RegistrarPoc} objects of a given type for this registrar sorted by
|
||||||
* their email address.
|
* their email address.
|
||||||
*/
|
*/
|
||||||
public ImmutableSortedSet<RegistrarContact> getContactsOfType(final RegistrarContact.Type type) {
|
public ImmutableSortedSet<RegistrarPoc> getContactsOfType(final RegistrarPoc.Type type) {
|
||||||
return Streams.stream(getContactsIterable())
|
return Streams.stream(getContactsIterable())
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.filter((@Nullable RegistrarContact contact) -> contact.getTypes().contains(type))
|
.filter((@Nullable RegistrarPoc contact) -> contact.getTypes().contains(type))
|
||||||
.collect(toImmutableSortedSet(CONTACT_EMAIL_COMPARATOR));
|
.collect(toImmutableSortedSet(CONTACT_EMAIL_COMPARATOR));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link RegistrarContact} that is the WHOIS abuse contact for this registrar, or
|
* Returns the {@link RegistrarPoc} that is the WHOIS abuse contact for this registrar, or empty
|
||||||
* empty if one does not exist.
|
* if one does not exist.
|
||||||
*/
|
*/
|
||||||
public Optional<RegistrarContact> getWhoisAbuseContact() {
|
public Optional<RegistrarPoc> getWhoisAbuseContact() {
|
||||||
return getContacts().stream()
|
return getContacts().stream().filter(RegistrarPoc::getVisibleInDomainWhoisAsAbuse).findFirst();
|
||||||
.filter(RegistrarContact::getVisibleInDomainWhoisAsAbuse)
|
|
||||||
.findFirst();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Iterable<RegistrarContact> getContactsIterable() {
|
private Iterable<RegistrarPoc> getContactsIterable() {
|
||||||
if (tm().isOfy()) {
|
if (tm().isOfy()) {
|
||||||
return auditedOfy().load().type(RegistrarContact.class).ancestor(Registrar.this);
|
return auditedOfy().load().type(RegistrarPoc.class).ancestor(Registrar.this);
|
||||||
} else {
|
} else {
|
||||||
return tm().transact(
|
return tm().transact(
|
||||||
() ->
|
() ->
|
||||||
jpaTm()
|
jpaTm()
|
||||||
.query(
|
.query(
|
||||||
"FROM RegistrarPoc WHERE registrarId = :registrarId",
|
"FROM RegistrarPoc WHERE registrarId = :registrarId", RegistrarPoc.class)
|
||||||
RegistrarContact.class)
|
|
||||||
.setParameter("registrarId", clientIdentifier)
|
.setParameter("registrarId", clientIdentifier)
|
||||||
.getResultStream()
|
.getResultStream()
|
||||||
.collect(toImmutableList()));
|
.collect(toImmutableList()));
|
||||||
|
|
|
@ -18,10 +18,7 @@ import static com.google.common.base.Preconditions.checkArgument;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static com.google.common.base.Strings.isNullOrEmpty;
|
import static com.google.common.base.Strings.isNullOrEmpty;
|
||||||
import static com.google.common.collect.ImmutableSet.toImmutableSet;
|
import static com.google.common.collect.ImmutableSet.toImmutableSet;
|
||||||
import static com.google.common.collect.Sets.difference;
|
|
||||||
import static com.google.common.io.BaseEncoding.base64;
|
import static com.google.common.io.BaseEncoding.base64;
|
||||||
import static google.registry.model.common.EntityGroupRoot.getCrossTldKey;
|
|
||||||
import static google.registry.model.ofy.ObjectifyService.auditedOfy;
|
|
||||||
import static google.registry.model.registrar.Registrar.checkValidEmail;
|
import static google.registry.model.registrar.Registrar.checkValidEmail;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.jpaTm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.jpaTm;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||||
|
@ -31,36 +28,26 @@ import static google.registry.util.PasswordUtils.hashPassword;
|
||||||
import static java.util.stream.Collectors.joining;
|
import static java.util.stream.Collectors.joining;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.base.Enums;
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.ImmutableSortedSet;
|
import com.google.common.collect.ImmutableSortedSet;
|
||||||
import com.google.common.collect.Streams;
|
|
||||||
import com.googlecode.objectify.Key;
|
|
||||||
import com.googlecode.objectify.annotation.Entity;
|
|
||||||
import com.googlecode.objectify.annotation.Id;
|
|
||||||
import com.googlecode.objectify.annotation.Ignore;
|
|
||||||
import com.googlecode.objectify.annotation.Index;
|
|
||||||
import com.googlecode.objectify.annotation.OnLoad;
|
|
||||||
import com.googlecode.objectify.annotation.Parent;
|
|
||||||
import google.registry.model.Buildable;
|
import google.registry.model.Buildable;
|
||||||
import google.registry.model.ImmutableObject;
|
import google.registry.model.ImmutableObject;
|
||||||
import google.registry.model.JsonMapBuilder;
|
import google.registry.model.JsonMapBuilder;
|
||||||
import google.registry.model.Jsonifiable;
|
import google.registry.model.Jsonifiable;
|
||||||
import google.registry.model.UnsafeSerializable;
|
import google.registry.model.UnsafeSerializable;
|
||||||
import google.registry.model.annotations.InCrossTld;
|
|
||||||
import google.registry.model.annotations.ReportedOn;
|
import google.registry.model.annotations.ReportedOn;
|
||||||
import google.registry.model.registrar.RegistrarContact.RegistrarPocId;
|
import google.registry.model.registrar.RegistrarPoc.RegistrarPocId;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
import javax.persistence.IdClass;
|
import javax.persistence.IdClass;
|
||||||
import javax.persistence.PostLoad;
|
import javax.persistence.Index;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Transient;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A contact for a Registrar. Note, equality, hashCode and comparable have been overridden to only
|
* A contact for a Registrar. Note, equality, hashCode and comparable have been overridden to only
|
||||||
|
@ -69,21 +56,12 @@ import javax.persistence.Transient;
|
||||||
* <p>IMPORTANT NOTE: Any time that you change, update, or delete RegistrarContact entities, you
|
* <p>IMPORTANT NOTE: Any time that you change, update, or delete RegistrarContact entities, you
|
||||||
* *MUST* also modify the persisted Registrar entity with {@link Registrar#contactsRequireSyncing}
|
* *MUST* also modify the persisted Registrar entity with {@link Registrar#contactsRequireSyncing}
|
||||||
* set to true.
|
* set to true.
|
||||||
*
|
|
||||||
* <p>TODO(b/177567432): Rename the class name to RegistrarPoc after database migration
|
|
||||||
*/
|
*/
|
||||||
@ReportedOn
|
@ReportedOn
|
||||||
@Entity
|
@Entity
|
||||||
@javax.persistence.Entity(name = "RegistrarPoc")
|
@Table(indexes = {@Index(columnList = "gaeUserId", name = "registrarpoc_gae_user_id_idx")})
|
||||||
@Table(
|
|
||||||
indexes = {
|
|
||||||
@javax.persistence.Index(columnList = "gaeUserId", name = "registrarpoc_gae_user_id_idx")
|
|
||||||
})
|
|
||||||
@IdClass(RegistrarPocId.class)
|
@IdClass(RegistrarPocId.class)
|
||||||
@InCrossTld
|
public class RegistrarPoc extends ImmutableObject implements Jsonifiable, UnsafeSerializable {
|
||||||
public class RegistrarContact extends ImmutableObject implements Jsonifiable, UnsafeSerializable {
|
|
||||||
|
|
||||||
@Parent @Transient Key<Registrar> parent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registrar contacts types for partner communication tracking.
|
* Registrar contacts types for partner communication tracking.
|
||||||
|
@ -122,9 +100,9 @@ public class RegistrarContact extends ImmutableObject implements Jsonifiable, Un
|
||||||
String name;
|
String name;
|
||||||
|
|
||||||
/** The email address of the contact. */
|
/** The email address of the contact. */
|
||||||
@Id @javax.persistence.Id String emailAddress;
|
@Id String emailAddress;
|
||||||
|
|
||||||
@Ignore @javax.persistence.Id String registrarId;
|
@Id String registrarId;
|
||||||
|
|
||||||
/** External email address of this contact used for registry lock confirmations. */
|
/** External email address of this contact used for registry lock confirmations. */
|
||||||
String registryLockEmailAddress;
|
String registryLockEmailAddress;
|
||||||
|
@ -148,7 +126,7 @@ public class RegistrarContact extends ImmutableObject implements Jsonifiable, Un
|
||||||
*
|
*
|
||||||
* @see com.google.appengine.api.users.User#getUserId()
|
* @see com.google.appengine.api.users.User#getUserId()
|
||||||
*/
|
*/
|
||||||
@Index String gaeUserId;
|
String gaeUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether this contact is publicly visible in WHOIS registrar query results as an Admin contact.
|
* Whether this contact is publicly visible in WHOIS registrar query results as an Admin contact.
|
||||||
|
@ -168,7 +146,7 @@ public class RegistrarContact extends ImmutableObject implements Jsonifiable, Un
|
||||||
boolean visibleInDomainWhoisAsAbuse = false;
|
boolean visibleInDomainWhoisAsAbuse = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not the contact is allowed to set their registry lock password through the registrar
|
* Whether the contact is allowed to set their registry lock password through the registrar
|
||||||
* console. This will be set to false on contact creation and when the user sets a password.
|
* console. This will be set to false on contact creation and when the user sets a password.
|
||||||
*/
|
*/
|
||||||
boolean allowedToSetRegistryLockPassword = false;
|
boolean allowedToSetRegistryLockPassword = false;
|
||||||
|
@ -182,16 +160,6 @@ public class RegistrarContact extends ImmutableObject implements Jsonifiable, Un
|
||||||
/** Randomly generated hash salt. */
|
/** Randomly generated hash salt. */
|
||||||
String registryLockPasswordSalt;
|
String registryLockPasswordSalt;
|
||||||
|
|
||||||
public static ImmutableSet<Type> typesFromCSV(String csv) {
|
|
||||||
return typesFromStrings(Arrays.asList(csv.split(",")));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ImmutableSet<Type> typesFromStrings(Iterable<String> typeNames) {
|
|
||||||
return Streams.stream(typeNames)
|
|
||||||
.map(Enums.stringConverter(Type.class))
|
|
||||||
.collect(toImmutableSet());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper to update the contacts associated with a Registrar. This requires querying for the
|
* Helper to update the contacts associated with a Registrar. This requires querying for the
|
||||||
* existing contacts, deleting existing contacts that are not part of the given {@code contacts}
|
* existing contacts, deleting existing contacts that are not part of the given {@code contacts}
|
||||||
|
@ -201,45 +169,23 @@ public class RegistrarContact extends ImmutableObject implements Jsonifiable, Un
|
||||||
* relevant Registrar entity with the {@link Registrar#contactsRequireSyncing} field set to true.
|
* relevant Registrar entity with the {@link Registrar#contactsRequireSyncing} field set to true.
|
||||||
*/
|
*/
|
||||||
public static void updateContacts(
|
public static void updateContacts(
|
||||||
final Registrar registrar, final ImmutableSet<RegistrarContact> contacts) {
|
final Registrar registrar, final ImmutableSet<RegistrarPoc> contacts) {
|
||||||
tm().transact(
|
tm().transact(
|
||||||
() -> {
|
() -> {
|
||||||
if (tm().isOfy()) {
|
ImmutableSet<String> emailAddressesToKeep =
|
||||||
ImmutableSet<Key<RegistrarContact>> existingKeys =
|
contacts.stream().map(RegistrarPoc::getEmailAddress).collect(toImmutableSet());
|
||||||
ImmutableSet.copyOf(
|
jpaTm()
|
||||||
auditedOfy()
|
.query(
|
||||||
.load()
|
"DELETE FROM RegistrarPoc WHERE registrarId = :registrarId AND "
|
||||||
.type(RegistrarContact.class)
|
+ "emailAddress NOT IN :emailAddressesToKeep")
|
||||||
.ancestor(registrar)
|
.setParameter("registrarId", registrar.getRegistrarId())
|
||||||
.keys());
|
.setParameter("emailAddressesToKeep", emailAddressesToKeep)
|
||||||
tm().delete(
|
.executeUpdate();
|
||||||
difference(
|
|
||||||
existingKeys,
|
|
||||||
contacts.stream().map(Key::create).collect(toImmutableSet()))
|
|
||||||
.stream()
|
|
||||||
.map(key -> VKey.createOfy(RegistrarContact.class, key))
|
|
||||||
.collect(toImmutableSet()));
|
|
||||||
} else {
|
|
||||||
ImmutableSet<String> emailAddressesToKeep =
|
|
||||||
contacts.stream()
|
|
||||||
.map(RegistrarContact::getEmailAddress)
|
|
||||||
.collect(toImmutableSet());
|
|
||||||
jpaTm()
|
|
||||||
.query(
|
|
||||||
"DELETE FROM RegistrarPoc WHERE registrarId = :registrarId AND "
|
|
||||||
+ "emailAddress NOT IN :emailAddressesToKeep")
|
|
||||||
.setParameter("registrarId", registrar.getRegistrarId())
|
|
||||||
.setParameter("emailAddressesToKeep", emailAddressesToKeep)
|
|
||||||
.executeUpdate();
|
|
||||||
}
|
|
||||||
tm().putAll(contacts);
|
tm().putAll(contacts);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public Key<Registrar> getParent() {
|
|
||||||
return parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -371,31 +317,11 @@ public class RegistrarContact extends ImmutableObject implements Jsonifiable, Un
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets Cloud SQL specific fields when the entity is loaded from Datastore. */
|
public VKey<RegistrarPoc> createVKey() {
|
||||||
@OnLoad
|
return VKey.createSql(RegistrarPoc.class, new RegistrarPocId(emailAddress, registrarId));
|
||||||
void onLoad() {
|
|
||||||
registrarId = parent.getName();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets Datastore specific fields when the entity is loaded from Cloud SQL. */
|
/** Class to represent the composite primary key for {@link RegistrarPoc} entity. */
|
||||||
@PostLoad
|
|
||||||
void postLoad() {
|
|
||||||
parent = Key.create(getCrossTldKey(), Registrar.class, registrarId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public VKey<RegistrarContact> createVKey() {
|
|
||||||
return createVKey(Key.create(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Creates a {@link VKey} instance from a {@link Key} instance. */
|
|
||||||
public static VKey<RegistrarContact> createVKey(Key<RegistrarContact> key) {
|
|
||||||
Key<Registrar> parent = key.getParent();
|
|
||||||
String registrarId = parent.getName();
|
|
||||||
String emailAddress = key.getName();
|
|
||||||
return VKey.create(RegistrarContact.class, new RegistrarPocId(emailAddress, registrarId), key);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Class to represent the composite primary key for {@link RegistrarContact} entity. */
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public static class RegistrarPocId extends ImmutableObject implements Serializable {
|
public static class RegistrarPocId extends ImmutableObject implements Serializable {
|
||||||
|
|
||||||
|
@ -404,6 +330,7 @@ public class RegistrarContact extends ImmutableObject implements Jsonifiable, Un
|
||||||
String registrarId;
|
String registrarId;
|
||||||
|
|
||||||
// Hibernate requires this default constructor.
|
// Hibernate requires this default constructor.
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private RegistrarPocId() {}
|
private RegistrarPocId() {}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
@ -413,27 +340,18 @@ public class RegistrarContact extends ImmutableObject implements Jsonifiable, Un
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A builder for constructing a {@link RegistrarContact}, since it is immutable. */
|
/** A builder for constructing a {@link RegistrarPoc}, since it is immutable. */
|
||||||
public static class Builder extends Buildable.Builder<RegistrarContact> {
|
public static class Builder extends Buildable.Builder<RegistrarPoc> {
|
||||||
public Builder() {}
|
public Builder() {}
|
||||||
|
|
||||||
private Builder(RegistrarContact instance) {
|
private Builder(RegistrarPoc instance) {
|
||||||
super(instance);
|
super(instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder setParent(Registrar parent) {
|
|
||||||
return this.setParent(Key.create(parent));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Builder setParent(Key<Registrar> parentKey) {
|
|
||||||
getInstance().parent = parentKey;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Build the registrar, nullifying empty fields. */
|
/** Build the registrar, nullifying empty fields. */
|
||||||
@Override
|
@Override
|
||||||
public RegistrarContact build() {
|
public RegistrarPoc build() {
|
||||||
checkNotNull(getInstance().parent, "Registrar parent cannot be null");
|
checkNotNull(getInstance().registrarId, "Registrar ID cannot be null");
|
||||||
checkValidEmail(getInstance().emailAddress);
|
checkValidEmail(getInstance().emailAddress);
|
||||||
// Check allowedToSetRegistryLockPassword here because if we want to allow the user to set
|
// Check allowedToSetRegistryLockPassword here because if we want to allow the user to set
|
||||||
// a registry lock password, we must also set up the correct registry lock email concurrently
|
// a registry lock password, we must also set up the correct registry lock email concurrently
|
||||||
|
@ -443,7 +361,6 @@ public class RegistrarContact extends ImmutableObject implements Jsonifiable, Un
|
||||||
!isNullOrEmpty(getInstance().registryLockEmailAddress),
|
!isNullOrEmpty(getInstance().registryLockEmailAddress),
|
||||||
"Registry lock email must not be null if allowing registry lock access");
|
"Registry lock email must not be null if allowing registry lock access");
|
||||||
}
|
}
|
||||||
getInstance().registrarId = getInstance().parent.getName();
|
|
||||||
return cloneEmptyToNull(super.build());
|
return cloneEmptyToNull(super.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -467,6 +384,16 @@ public class RegistrarContact extends ImmutableObject implements Jsonifiable, Un
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Builder setRegistrarId(String registrarId) {
|
||||||
|
getInstance().registrarId = registrarId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder setRegistrar(Registrar registrar) {
|
||||||
|
getInstance().registrarId = registrar.getRegistrarId();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Builder setFaxNumber(String faxNumber) {
|
public Builder setFaxNumber(String faxNumber) {
|
||||||
getInstance().faxNumber = faxNumber;
|
getInstance().faxNumber = faxNumber;
|
||||||
return this;
|
return this;
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
package google.registry.persistence.converter;
|
package google.registry.persistence.converter;
|
||||||
|
|
||||||
import google.registry.model.registrar.RegistrarContact.Type;
|
import google.registry.model.registrar.RegistrarPoc.Type;
|
||||||
import javax.persistence.AttributeConverter;
|
import javax.persistence.AttributeConverter;
|
||||||
import javax.persistence.Converter;
|
import javax.persistence.Converter;
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.host.HostResource;
|
import google.registry.model.host.HostResource;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.reporting.HistoryEntryDao;
|
import google.registry.model.reporting.HistoryEntryDao;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
|
@ -777,7 +777,7 @@ public class RdapJsonFormatter {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a JSON object for a {@link RegistrarContact}.
|
* Creates a JSON object for a {@link RegistrarPoc}.
|
||||||
*
|
*
|
||||||
* <p>Returns empty if this contact shouldn't be visible (doesn't have a role).
|
* <p>Returns empty if this contact shouldn't be visible (doesn't have a role).
|
||||||
*
|
*
|
||||||
|
@ -794,11 +794,10 @@ public class RdapJsonFormatter {
|
||||||
* <li>Registrar inside a Nameserver isn't required at all, and if given doesn't require any
|
* <li>Registrar inside a Nameserver isn't required at all, and if given doesn't require any
|
||||||
* contacts
|
* contacts
|
||||||
*
|
*
|
||||||
* @param registrarContact the registrar contact for which the JSON object should be created
|
* @param registrarPoc the registrar contact for which the JSON object should be created
|
||||||
*/
|
*/
|
||||||
static Optional<RdapContactEntity> makeRdapJsonForRegistrarContact(
|
static Optional<RdapContactEntity> makeRdapJsonForRegistrarContact(RegistrarPoc registrarPoc) {
|
||||||
RegistrarContact registrarContact) {
|
ImmutableList<RdapEntity.Role> roles = makeRdapRoleList(registrarPoc);
|
||||||
ImmutableList<RdapEntity.Role> roles = makeRdapRoleList(registrarContact);
|
|
||||||
if (roles.isEmpty()) {
|
if (roles.isEmpty()) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
@ -808,20 +807,20 @@ public class RdapJsonFormatter {
|
||||||
// Create the vCard.
|
// Create the vCard.
|
||||||
VcardArray.Builder vcardBuilder = VcardArray.builder();
|
VcardArray.Builder vcardBuilder = VcardArray.builder();
|
||||||
// MUST include FN member: RDAP Response Profile 3.2
|
// MUST include FN member: RDAP Response Profile 3.2
|
||||||
String name = registrarContact.getName();
|
String name = registrarPoc.getName();
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
vcardBuilder.add(Vcard.create("fn", "text", name));
|
vcardBuilder.add(Vcard.create("fn", "text", name));
|
||||||
}
|
}
|
||||||
// MUST include TEL and EMAIL members: RDAP Response Profile 2.4.5, 3.2
|
// MUST include TEL and EMAIL members: RDAP Response Profile 2.4.5, 3.2
|
||||||
String voicePhoneNumber = registrarContact.getPhoneNumber();
|
String voicePhoneNumber = registrarPoc.getPhoneNumber();
|
||||||
if (voicePhoneNumber != null) {
|
if (voicePhoneNumber != null) {
|
||||||
vcardBuilder.add(makePhoneEntry(PHONE_TYPE_VOICE, "tel:" + voicePhoneNumber));
|
vcardBuilder.add(makePhoneEntry(PHONE_TYPE_VOICE, "tel:" + voicePhoneNumber));
|
||||||
}
|
}
|
||||||
String faxPhoneNumber = registrarContact.getFaxNumber();
|
String faxPhoneNumber = registrarPoc.getFaxNumber();
|
||||||
if (faxPhoneNumber != null) {
|
if (faxPhoneNumber != null) {
|
||||||
vcardBuilder.add(makePhoneEntry(PHONE_TYPE_FAX, "tel:" + faxPhoneNumber));
|
vcardBuilder.add(makePhoneEntry(PHONE_TYPE_FAX, "tel:" + faxPhoneNumber));
|
||||||
}
|
}
|
||||||
String emailAddress = registrarContact.getEmailAddress();
|
String emailAddress = registrarPoc.getEmailAddress();
|
||||||
if (emailAddress != null) {
|
if (emailAddress != null) {
|
||||||
vcardBuilder.add(Vcard.create("email", "text", emailAddress));
|
vcardBuilder.add(Vcard.create("email", "text", emailAddress));
|
||||||
}
|
}
|
||||||
|
@ -857,16 +856,15 @@ public class RdapJsonFormatter {
|
||||||
*
|
*
|
||||||
* <p>3.2. For direct Registrar queries, we SHOULD have at least "admin" and "tech".
|
* <p>3.2. For direct Registrar queries, we SHOULD have at least "admin" and "tech".
|
||||||
*/
|
*/
|
||||||
private static ImmutableList<RdapEntity.Role> makeRdapRoleList(
|
private static ImmutableList<RdapEntity.Role> makeRdapRoleList(RegistrarPoc registrarPoc) {
|
||||||
RegistrarContact registrarContact) {
|
|
||||||
ImmutableList.Builder<RdapEntity.Role> rolesBuilder = new ImmutableList.Builder<>();
|
ImmutableList.Builder<RdapEntity.Role> rolesBuilder = new ImmutableList.Builder<>();
|
||||||
if (registrarContact.getVisibleInWhoisAsAdmin()) {
|
if (registrarPoc.getVisibleInWhoisAsAdmin()) {
|
||||||
rolesBuilder.add(RdapEntity.Role.ADMIN);
|
rolesBuilder.add(RdapEntity.Role.ADMIN);
|
||||||
}
|
}
|
||||||
if (registrarContact.getVisibleInWhoisAsTech()) {
|
if (registrarPoc.getVisibleInWhoisAsTech()) {
|
||||||
rolesBuilder.add(RdapEntity.Role.TECH);
|
rolesBuilder.add(RdapEntity.Role.TECH);
|
||||||
}
|
}
|
||||||
if (registrarContact.getVisibleInDomainWhoisAsAbuse()) {
|
if (registrarPoc.getVisibleInDomainWhoisAsAbuse()) {
|
||||||
rolesBuilder.add(RdapEntity.Role.ABUSE);
|
rolesBuilder.add(RdapEntity.Role.ABUSE);
|
||||||
}
|
}
|
||||||
return rolesBuilder.build();
|
return rolesBuilder.build();
|
||||||
|
|
|
@ -34,7 +34,7 @@ import google.registry.beam.spec11.ThreatMatch;
|
||||||
import google.registry.config.RegistryConfig.Config;
|
import google.registry.config.RegistryConfig.Config;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.reporting.spec11.soy.Spec11EmailSoyInfo;
|
import google.registry.reporting.spec11.soy.Spec11EmailSoyInfo;
|
||||||
import google.registry.util.EmailMessage;
|
import google.registry.util.EmailMessage;
|
||||||
import google.registry.util.SendEmailService;
|
import google.registry.util.SendEmailService;
|
||||||
|
@ -219,7 +219,7 @@ public class Spec11EmailUtils {
|
||||||
return new InternetAddress(
|
return new InternetAddress(
|
||||||
registrar
|
registrar
|
||||||
.getWhoisAbuseContact()
|
.getWhoisAbuseContact()
|
||||||
.map(RegistrarContact::getEmailAddress)
|
.map(RegistrarPoc::getEmailAddress)
|
||||||
.orElse(registrar.getEmailAddress()));
|
.orElse(registrar.getEmailAddress()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,26 +16,21 @@ package google.registry.request.auth;
|
||||||
|
|
||||||
import static com.google.common.base.MoreObjects.toStringHelper;
|
import static com.google.common.base.MoreObjects.toStringHelper;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static com.google.common.collect.ImmutableList.toImmutableList;
|
|
||||||
import static com.google.common.collect.Streams.stream;
|
|
||||||
import static google.registry.model.ofy.ObjectifyService.auditedOfy;
|
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.jpaTm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.jpaTm;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerUtil.transactIfJpaTm;
|
import static google.registry.persistence.transaction.TransactionManagerUtil.transactIfJpaTm;
|
||||||
|
|
||||||
import com.google.appengine.api.users.User;
|
import com.google.appengine.api.users.User;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.collect.ImmutableList;
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.ImmutableSetMultimap;
|
import com.google.common.collect.ImmutableSetMultimap;
|
||||||
import com.google.common.flogger.FluentLogger;
|
import com.google.common.flogger.FluentLogger;
|
||||||
import com.googlecode.objectify.Key;
|
|
||||||
import dagger.Lazy;
|
import dagger.Lazy;
|
||||||
import google.registry.config.RegistryConfig.Config;
|
import google.registry.config.RegistryConfig.Config;
|
||||||
import google.registry.groups.GroupsConnection;
|
import google.registry.groups.GroupsConnection;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.Registrar.State;
|
import google.registry.model.registrar.Registrar.State;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
@ -43,8 +38,8 @@ import javax.inject.Inject;
|
||||||
/**
|
/**
|
||||||
* Allows access only to {@link Registrar}s the current user has access to.
|
* Allows access only to {@link Registrar}s the current user has access to.
|
||||||
*
|
*
|
||||||
* <p>A user has OWNER role on a Registrar if there exists a {@link RegistrarContact} with that
|
* <p>A user has OWNER role on a Registrar if there exists a {@link RegistrarPoc} with that user's
|
||||||
* user's gaeId and the registrar as a parent.
|
* gaeId and the registrar as a parent.
|
||||||
*
|
*
|
||||||
* <p>An "admin" has in addition OWNER role on {@code #registryAdminClientId} and to all non-{@code
|
* <p>An "admin" has in addition OWNER role on {@code #registryAdminClientId} and to all non-{@code
|
||||||
* REAL} registrars (see {@link Registrar#getType}).
|
* REAL} registrars (see {@link Registrar#getType}).
|
||||||
|
@ -54,8 +49,8 @@ import javax.inject.Inject;
|
||||||
* <p>A user is an "admin" if they are a GAE-admin, or if their email is in the "Support" G Suite
|
* <p>A user is an "admin" if they are a GAE-admin, or if their email is in the "Support" G Suite
|
||||||
* group.
|
* group.
|
||||||
*
|
*
|
||||||
* <p>NOTE: to check whether the user is in the "Support" G Suite group, we need a connection to
|
* <p>NOTE: to check whether the user is in the "Support" G Suite group, we need a connection to G
|
||||||
* G Suite. This in turn requires we have valid JsonCredentials, which not all environments have set
|
* Suite. This in turn requires we have valid JsonCredentials, which not all environments have set
|
||||||
* up. This connection will be created lazily (only if needed).
|
* up. This connection will be created lazily (only if needed).
|
||||||
*
|
*
|
||||||
* <p>Specifically, we don't instantiate the connection if: (a) gSuiteSupportGroupEmailAddress isn't
|
* <p>Specifically, we don't instantiate the connection if: (a) gSuiteSupportGroupEmailAddress isn't
|
||||||
|
@ -319,34 +314,19 @@ public class AuthenticatedRegistrarAccessor {
|
||||||
logger.atInfo().log("Checking registrar contacts for user ID %s.", user.getUserId());
|
logger.atInfo().log("Checking registrar contacts for user ID %s.", user.getUserId());
|
||||||
|
|
||||||
// Find all registrars that have a registrar contact with this user's ID.
|
// Find all registrars that have a registrar contact with this user's ID.
|
||||||
if (tm().isOfy()) {
|
jpaTm()
|
||||||
ImmutableList<Key<Registrar>> accessibleClientIds =
|
.transact(
|
||||||
stream(
|
() ->
|
||||||
auditedOfy()
|
jpaTm()
|
||||||
.load()
|
.query(
|
||||||
.type(RegistrarContact.class)
|
"SELECT r FROM Registrar r INNER JOIN RegistrarPoc rp ON "
|
||||||
.filter("gaeUserId", user.getUserId()))
|
+ "r.clientIdentifier = rp.registrarId WHERE rp.gaeUserId = "
|
||||||
.map(RegistrarContact::getParent)
|
+ ":gaeUserId AND r.state != :state",
|
||||||
.collect(toImmutableList());
|
Registrar.class)
|
||||||
// Filter out disabled registrars (note that pending registrars still allow console login).
|
.setParameter("gaeUserId", user.getUserId())
|
||||||
auditedOfy().load().keys(accessibleClientIds).values().stream()
|
.setParameter("state", State.DISABLED)
|
||||||
.filter(registrar -> registrar.getState() != State.DISABLED)
|
.getResultStream()
|
||||||
.forEach(registrar -> builder.put(registrar.getRegistrarId(), Role.OWNER));
|
.forEach(registrar -> builder.put(registrar.getRegistrarId(), Role.OWNER)));
|
||||||
} else {
|
|
||||||
jpaTm()
|
|
||||||
.transact(
|
|
||||||
() ->
|
|
||||||
jpaTm()
|
|
||||||
.query(
|
|
||||||
"SELECT r FROM Registrar r INNER JOIN RegistrarPoc rp ON "
|
|
||||||
+ "r.clientIdentifier = rp.registrarId WHERE rp.gaeUserId = "
|
|
||||||
+ ":gaeUserId AND r.state != :state",
|
|
||||||
Registrar.class)
|
|
||||||
.setParameter("gaeUserId", user.getUserId())
|
|
||||||
.setParameter("state", State.DISABLED)
|
|
||||||
.getResultStream()
|
|
||||||
.forEach(registrar -> builder.put(registrar.getRegistrarId(), Role.OWNER)));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Admins have ADMIN access to all registrars, and also OWNER access to the registry registrar
|
// Admins have ADMIN access to all registrars, and also OWNER access to the registry registrar
|
||||||
// and all non-REAL or non-live registrars.
|
// and all non-REAL or non-live registrars.
|
||||||
|
|
|
@ -31,7 +31,7 @@ import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.model.common.GaeUserIdConverter;
|
import google.registry.model.common.GaeUserIdConverter;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.tools.params.OptionalPhoneNumberParameter;
|
import google.registry.tools.params.OptionalPhoneNumberParameter;
|
||||||
import google.registry.tools.params.PathParameter;
|
import google.registry.tools.params.PathParameter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -51,7 +51,7 @@ import javax.annotation.Nullable;
|
||||||
@Parameters(
|
@Parameters(
|
||||||
separators = " =",
|
separators = " =",
|
||||||
commandDescription = "Create/read/update/delete the various contact lists for a Registrar.")
|
commandDescription = "Create/read/update/delete the various contact lists for a Registrar.")
|
||||||
final class RegistrarContactCommand extends MutatingCommand {
|
final class RegistrarPocCommand extends MutatingCommand {
|
||||||
|
|
||||||
@Parameter(
|
@Parameter(
|
||||||
description = "Client identifier of the registrar account.",
|
description = "Client identifier of the registrar account.",
|
||||||
|
@ -155,8 +155,7 @@ final class RegistrarContactCommand extends MutatingCommand {
|
||||||
private static final ImmutableSet<Mode> MODES_REQUIRING_CONTACT_SYNC =
|
private static final ImmutableSet<Mode> MODES_REQUIRING_CONTACT_SYNC =
|
||||||
ImmutableSet.of(Mode.CREATE, Mode.UPDATE, Mode.DELETE);
|
ImmutableSet.of(Mode.CREATE, Mode.UPDATE, Mode.DELETE);
|
||||||
|
|
||||||
@Nullable
|
@Nullable private ImmutableSet<RegistrarPoc.Type> contactTypes;
|
||||||
private ImmutableSet<RegistrarContact.Type> contactTypes;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void init() throws Exception {
|
protected void init() throws Exception {
|
||||||
|
@ -179,17 +178,16 @@ final class RegistrarContactCommand extends MutatingCommand {
|
||||||
contactTypes = ImmutableSet.of();
|
contactTypes = ImmutableSet.of();
|
||||||
} else {
|
} else {
|
||||||
contactTypes =
|
contactTypes =
|
||||||
contactTypeNames
|
contactTypeNames.stream()
|
||||||
.stream()
|
.map(Enums.stringConverter(RegistrarPoc.Type.class))
|
||||||
.map(Enums.stringConverter(RegistrarContact.Type.class))
|
|
||||||
.collect(toImmutableSet());
|
.collect(toImmutableSet());
|
||||||
}
|
}
|
||||||
ImmutableSet<RegistrarContact> contacts = registrar.getContacts();
|
ImmutableSet<RegistrarPoc> contacts = registrar.getContacts();
|
||||||
Map<String, RegistrarContact> contactsMap = new LinkedHashMap<>();
|
Map<String, RegistrarPoc> contactsMap = new LinkedHashMap<>();
|
||||||
for (RegistrarContact rc : contacts) {
|
for (RegistrarPoc rc : contacts) {
|
||||||
contactsMap.put(rc.getEmailAddress(), rc);
|
contactsMap.put(rc.getEmailAddress(), rc);
|
||||||
}
|
}
|
||||||
RegistrarContact oldContact;
|
RegistrarPoc oldContact;
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case LIST:
|
case LIST:
|
||||||
listContacts(contacts);
|
listContacts(contacts);
|
||||||
|
@ -206,7 +204,7 @@ final class RegistrarContactCommand extends MutatingCommand {
|
||||||
contactsMap.get(checkNotNull(email, "--email is required when --mode=UPDATE")),
|
contactsMap.get(checkNotNull(email, "--email is required when --mode=UPDATE")),
|
||||||
"No contact with the given email: %s",
|
"No contact with the given email: %s",
|
||||||
email);
|
email);
|
||||||
RegistrarContact newContact = updateContact(oldContact, registrar);
|
RegistrarPoc newContact = updateContact(oldContact, registrar);
|
||||||
checkArgument(
|
checkArgument(
|
||||||
!oldContact.getVisibleInDomainWhoisAsAbuse()
|
!oldContact.getVisibleInDomainWhoisAsAbuse()
|
||||||
|| newContact.getVisibleInDomainWhoisAsAbuse(),
|
|| newContact.getVisibleInDomainWhoisAsAbuse(),
|
||||||
|
@ -236,19 +234,19 @@ final class RegistrarContactCommand extends MutatingCommand {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void listContacts(Set<RegistrarContact> contacts) throws IOException {
|
private void listContacts(Set<RegistrarPoc> contacts) throws IOException {
|
||||||
List<String> result = new ArrayList<>();
|
List<String> result = new ArrayList<>();
|
||||||
for (RegistrarContact c : contacts) {
|
for (RegistrarPoc c : contacts) {
|
||||||
result.add(c.toStringMultilinePlainText());
|
result.add(c.toStringMultilinePlainText());
|
||||||
}
|
}
|
||||||
Files.write(output, Joiner.on('\n').join(result).getBytes(UTF_8));
|
Files.write(output, Joiner.on('\n').join(result).getBytes(UTF_8));
|
||||||
}
|
}
|
||||||
|
|
||||||
private RegistrarContact createContact(Registrar registrar) {
|
private RegistrarPoc createContact(Registrar registrar) {
|
||||||
checkArgument(!isNullOrEmpty(name), "--name is required when --mode=CREATE");
|
checkArgument(!isNullOrEmpty(name), "--name is required when --mode=CREATE");
|
||||||
checkArgument(!isNullOrEmpty(email), "--email is required when --mode=CREATE");
|
checkArgument(!isNullOrEmpty(email), "--email is required when --mode=CREATE");
|
||||||
RegistrarContact.Builder builder = new RegistrarContact.Builder();
|
RegistrarPoc.Builder builder = new RegistrarPoc.Builder();
|
||||||
builder.setParent(registrar);
|
builder.setRegistrar(registrar);
|
||||||
builder.setName(name);
|
builder.setName(name);
|
||||||
builder.setEmailAddress(email);
|
builder.setEmailAddress(email);
|
||||||
if (!isNullOrEmpty(registryLockEmail)) {
|
if (!isNullOrEmpty(registryLockEmail)) {
|
||||||
|
@ -282,11 +280,11 @@ final class RegistrarContactCommand extends MutatingCommand {
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private RegistrarContact updateContact(RegistrarContact contact, Registrar registrar) {
|
private RegistrarPoc updateContact(RegistrarPoc contact, Registrar registrar) {
|
||||||
checkNotNull(registrar);
|
checkNotNull(registrar);
|
||||||
checkArgument(!isNullOrEmpty(email), "--email is required when --mode=UPDATE");
|
checkArgument(!isNullOrEmpty(email), "--email is required when --mode=UPDATE");
|
||||||
RegistrarContact.Builder builder =
|
RegistrarPoc.Builder builder =
|
||||||
contact.asBuilder().setEmailAddress(email).setParent(registrar);
|
contact.asBuilder().setEmailAddress(email).setRegistrar(registrar);
|
||||||
if (!isNullOrEmpty(name)) {
|
if (!isNullOrEmpty(name)) {
|
||||||
builder.setName(name);
|
builder.setName(name);
|
||||||
}
|
}
|
||||||
|
@ -327,12 +325,11 @@ final class RegistrarContactCommand extends MutatingCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void unsetOtherWhoisAbuseFlags(
|
private void unsetOtherWhoisAbuseFlags(
|
||||||
ImmutableSet<RegistrarContact> contacts, @Nullable String emailAddressNotToChange) {
|
ImmutableSet<RegistrarPoc> contacts, @Nullable String emailAddressNotToChange) {
|
||||||
for (RegistrarContact contact : contacts) {
|
for (RegistrarPoc contact : contacts) {
|
||||||
if (!contact.getEmailAddress().equals(emailAddressNotToChange)
|
if (!contact.getEmailAddress().equals(emailAddressNotToChange)
|
||||||
&& contact.getVisibleInDomainWhoisAsAbuse()) {
|
&& contact.getVisibleInDomainWhoisAsAbuse()) {
|
||||||
RegistrarContact newContact =
|
RegistrarPoc newContact = contact.asBuilder().setVisibleInDomainWhoisAsAbuse(false).build();
|
||||||
contact.asBuilder().setVisibleInDomainWhoisAsAbuse(false).build();
|
|
||||||
stageEntityChange(contact, newContact);
|
stageEntityChange(contact, newContact);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -97,7 +97,7 @@ public final class RegistryTool {
|
||||||
.put("login", LoginCommand.class)
|
.put("login", LoginCommand.class)
|
||||||
.put("logout", LogoutCommand.class)
|
.put("logout", LogoutCommand.class)
|
||||||
.put("pending_escrow", PendingEscrowCommand.class)
|
.put("pending_escrow", PendingEscrowCommand.class)
|
||||||
.put("registrar_contact", RegistrarContactCommand.class)
|
.put("registrar_poc", RegistrarPocCommand.class)
|
||||||
.put("renew_domain", RenewDomainCommand.class)
|
.put("renew_domain", RenewDomainCommand.class)
|
||||||
.put("resave_environment_entities", ResaveEnvironmentEntitiesCommand.class)
|
.put("resave_environment_entities", ResaveEnvironmentEntitiesCommand.class)
|
||||||
.put("save_sql_credential", SaveSqlCredentialCommand.class)
|
.put("save_sql_credential", SaveSqlCredentialCommand.class)
|
||||||
|
|
|
@ -23,14 +23,14 @@ import com.beust.jcommander.Parameters;
|
||||||
import com.googlecode.objectify.Key;
|
import com.googlecode.objectify.Key;
|
||||||
import google.registry.model.annotations.DeleteAfterMigration;
|
import google.registry.model.annotations.DeleteAfterMigration;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Command to re-save all environment entities to ensure that they have valid commit logs.
|
* Command to re-save all environment entities to ensure that they have valid commit logs.
|
||||||
*
|
*
|
||||||
* <p>The entities that are re-saved are those of type {@link Registry}, {@link Registrar}, and
|
* <p>The entities that are re-saved are those of type {@link Registry}, {@link Registrar}, and
|
||||||
* {@link RegistrarContact}.
|
* {@link RegistrarPoc}.
|
||||||
*/
|
*/
|
||||||
@Parameters(commandDescription = "Re-save all environment entities.")
|
@Parameters(commandDescription = "Re-save all environment entities.")
|
||||||
@DeleteAfterMigration
|
@DeleteAfterMigration
|
||||||
|
@ -42,7 +42,7 @@ final class ResaveEnvironmentEntitiesCommand implements CommandWithRemoteApi {
|
||||||
public void run() {
|
public void run() {
|
||||||
batchSave(Registry.class);
|
batchSave(Registry.class);
|
||||||
batchSave(Registrar.class);
|
batchSave(Registrar.class);
|
||||||
batchSave(RegistrarContact.class);
|
batchSave(RegistrarPoc.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <T> void batchSave(Class<T> clazz) {
|
private static <T> void batchSave(Class<T> clazz) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ import google.registry.config.RegistryConfig.Config;
|
||||||
import google.registry.groups.GroupsConnection;
|
import google.registry.groups.GroupsConnection;
|
||||||
import google.registry.groups.GroupsConnection.Role;
|
import google.registry.groups.GroupsConnection.Role;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.request.Action;
|
import google.registry.request.Action;
|
||||||
import google.registry.request.HttpException.BadRequestException;
|
import google.registry.request.HttpException.BadRequestException;
|
||||||
import google.registry.request.HttpException.InternalServerErrorException;
|
import google.registry.request.HttpException.InternalServerErrorException;
|
||||||
|
@ -64,7 +64,7 @@ public class CreateGroupsAction implements Runnable {
|
||||||
if (registrar == null) {
|
if (registrar == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<RegistrarContact.Type> types = asList(RegistrarContact.Type.values());
|
List<RegistrarPoc.Type> types = asList(RegistrarPoc.Type.values());
|
||||||
// Concurrently create the groups for each RegistrarContact.Type, collecting the results from
|
// Concurrently create the groups for each RegistrarContact.Type, collecting the results from
|
||||||
// each call (which are either an Exception if it failed, or absent() if it succeeded).
|
// each call (which are either an Exception if it failed, or absent() if it succeeded).
|
||||||
List<Optional<Exception>> results =
|
List<Optional<Exception>> results =
|
||||||
|
|
|
@ -28,7 +28,7 @@ import com.google.common.net.InternetDomainName;
|
||||||
import com.google.re2j.Pattern;
|
import com.google.re2j.Pattern;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.ui.forms.FormException;
|
import google.registry.ui.forms.FormException;
|
||||||
import google.registry.ui.forms.FormField;
|
import google.registry.ui.forms.FormField;
|
||||||
import google.registry.ui.forms.FormFieldException;
|
import google.registry.ui.forms.FormFieldException;
|
||||||
|
@ -217,10 +217,10 @@ public final class RegistrarFormFields {
|
||||||
public static final FormField<String, String> CONTACT_REGISTRY_LOCK_PASSWORD_FIELD =
|
public static final FormField<String, String> CONTACT_REGISTRY_LOCK_PASSWORD_FIELD =
|
||||||
FormFields.NAME.asBuilderNamed("registryLockPassword").build();
|
FormFields.NAME.asBuilderNamed("registryLockPassword").build();
|
||||||
|
|
||||||
public static final FormField<String, Set<RegistrarContact.Type>> CONTACT_TYPES =
|
public static final FormField<String, Set<RegistrarPoc.Type>> CONTACT_TYPES =
|
||||||
FormField.named("types")
|
FormField.named("types")
|
||||||
.uppercased()
|
.uppercased()
|
||||||
.asEnum(RegistrarContact.Type.class)
|
.asEnum(RegistrarPoc.Type.class)
|
||||||
.asSet(Splitter.on(',').omitEmptyStrings().trimResults())
|
.asSet(Splitter.on(',').omitEmptyStrings().trimResults())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
@ -348,8 +348,8 @@ public final class RegistrarFormFields {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImmutableList<RegistrarContact.Builder> getRegistrarContactBuilders(
|
public static ImmutableList<RegistrarPoc.Builder> getRegistrarContactBuilders(
|
||||||
ImmutableSet<RegistrarContact> existingContacts, @Nullable Map<String, ?> args) {
|
ImmutableSet<RegistrarPoc> existingContacts, @Nullable Map<String, ?> args) {
|
||||||
if (args == null) {
|
if (args == null) {
|
||||||
return ImmutableList.of();
|
return ImmutableList.of();
|
||||||
}
|
}
|
||||||
|
@ -357,7 +357,7 @@ public final class RegistrarFormFields {
|
||||||
if (!contactsAsMaps.isPresent()) {
|
if (!contactsAsMaps.isPresent()) {
|
||||||
return ImmutableList.of();
|
return ImmutableList.of();
|
||||||
}
|
}
|
||||||
ImmutableList.Builder<RegistrarContact.Builder> result = new ImmutableList.Builder<>();
|
ImmutableList.Builder<RegistrarPoc.Builder> result = new ImmutableList.Builder<>();
|
||||||
for (Map<String, ?> contactAsMap : contactsAsMaps.get()) {
|
for (Map<String, ?> contactAsMap : contactsAsMaps.get()) {
|
||||||
String emailAddress =
|
String emailAddress =
|
||||||
CONTACT_EMAIL_ADDRESS_FIELD
|
CONTACT_EMAIL_ADDRESS_FIELD
|
||||||
|
@ -365,20 +365,19 @@ public final class RegistrarFormFields {
|
||||||
.orElseThrow(
|
.orElseThrow(
|
||||||
() -> new IllegalArgumentException("Contacts from UI must have email addresses"));
|
() -> new IllegalArgumentException("Contacts from UI must have email addresses"));
|
||||||
// Start with a new builder if the contact didn't previously exist
|
// Start with a new builder if the contact didn't previously exist
|
||||||
RegistrarContact.Builder contactBuilder =
|
RegistrarPoc.Builder contactBuilder =
|
||||||
existingContacts.stream()
|
existingContacts.stream()
|
||||||
.filter(rc -> rc.getEmailAddress().equals(emailAddress))
|
.filter(rc -> rc.getEmailAddress().equals(emailAddress))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.map(RegistrarContact::asBuilder)
|
.map(RegistrarPoc::asBuilder)
|
||||||
.orElse(new RegistrarContact.Builder());
|
.orElse(new RegistrarPoc.Builder());
|
||||||
applyRegistrarContactArgs(contactBuilder, contactAsMap);
|
applyRegistrarContactArgs(contactBuilder, contactAsMap);
|
||||||
result.add(contactBuilder);
|
result.add(contactBuilder);
|
||||||
}
|
}
|
||||||
return result.build();
|
return result.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void applyRegistrarContactArgs(
|
private static void applyRegistrarContactArgs(RegistrarPoc.Builder builder, Map<String, ?> args) {
|
||||||
RegistrarContact.Builder builder, Map<String, ?> args) {
|
|
||||||
builder.setName(CONTACT_NAME_FIELD.extractUntyped(args).orElse(null));
|
builder.setName(CONTACT_NAME_FIELD.extractUntyped(args).orElse(null));
|
||||||
builder.setEmailAddress(CONTACT_EMAIL_ADDRESS_FIELD.extractUntyped(args).orElse(null));
|
builder.setEmailAddress(CONTACT_EMAIL_ADDRESS_FIELD.extractUntyped(args).orElse(null));
|
||||||
builder.setRegistryLockEmailAddress(
|
builder.setRegistryLockEmailAddress(
|
||||||
|
|
|
@ -32,7 +32,7 @@ import com.google.template.soy.tofu.SoyTofu;
|
||||||
import google.registry.config.RegistryEnvironment;
|
import google.registry.config.RegistryEnvironment;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.request.Action;
|
import google.registry.request.Action;
|
||||||
import google.registry.request.Action.Method;
|
import google.registry.request.Action.Method;
|
||||||
import google.registry.request.Parameter;
|
import google.registry.request.Parameter;
|
||||||
|
@ -227,9 +227,9 @@ public final class ConsoleRegistrarCreatorAction extends HtmlAction {
|
||||||
.setZip(optionalZip.orElse(null))
|
.setZip(optionalZip.orElse(null))
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
RegistrarContact contact =
|
RegistrarPoc contact =
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName(consoleUserEmail.get())
|
.setName(consoleUserEmail.get())
|
||||||
.setEmailAddress(consoleUserEmail.get())
|
.setEmailAddress(consoleUserEmail.get())
|
||||||
.setGaeUserId(gaeUserId)
|
.setGaeUserId(gaeUserId)
|
||||||
|
|
|
@ -42,8 +42,8 @@ import google.registry.export.sheet.SyncRegistrarsSheetAction;
|
||||||
import google.registry.flows.certs.CertificateChecker;
|
import google.registry.flows.certs.CertificateChecker;
|
||||||
import google.registry.flows.certs.CertificateChecker.InsecureCertificateException;
|
import google.registry.flows.certs.CertificateChecker.InsecureCertificateException;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.registrar.RegistrarContact.Type;
|
import google.registry.model.registrar.RegistrarPoc.Type;
|
||||||
import google.registry.request.Action;
|
import google.registry.request.Action;
|
||||||
import google.registry.request.Action.Service;
|
import google.registry.request.Action.Service;
|
||||||
import google.registry.request.HttpException.BadRequestException;
|
import google.registry.request.HttpException.BadRequestException;
|
||||||
|
@ -116,7 +116,7 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
|
|
||||||
@Inject RegistrarSettingsAction() {}
|
@Inject RegistrarSettingsAction() {}
|
||||||
|
|
||||||
private static boolean hasPhone(RegistrarContact contact) {
|
private static boolean hasPhone(RegistrarPoc contact) {
|
||||||
return contact.getPhoneNumber() != null;
|
return contact.getPhoneNumber() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,15 +202,15 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
|
|
||||||
abstract Registrar updatedRegistrar();
|
abstract Registrar updatedRegistrar();
|
||||||
|
|
||||||
abstract ImmutableSet<RegistrarContact> contacts();
|
abstract ImmutableSet<RegistrarPoc> contacts();
|
||||||
|
|
||||||
abstract ImmutableSet<RegistrarContact> updatedContacts();
|
abstract ImmutableSet<RegistrarPoc> updatedContacts();
|
||||||
|
|
||||||
static EmailInfo create(
|
static EmailInfo create(
|
||||||
Registrar registrar,
|
Registrar registrar,
|
||||||
Registrar updatedRegistrar,
|
Registrar updatedRegistrar,
|
||||||
ImmutableSet<RegistrarContact> contacts,
|
ImmutableSet<RegistrarPoc> contacts,
|
||||||
ImmutableSet<RegistrarContact> updatedContacts) {
|
ImmutableSet<RegistrarPoc> updatedContacts) {
|
||||||
return new AutoValue_RegistrarSettingsAction_EmailInfo(
|
return new AutoValue_RegistrarSettingsAction_EmailInfo(
|
||||||
registrar, updatedRegistrar, contacts, updatedContacts);
|
registrar, updatedRegistrar, contacts, updatedContacts);
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
|
|
||||||
// Keep the current contacts so we can later check that no required contact was
|
// Keep the current contacts so we can later check that no required contact was
|
||||||
// removed, email the changes to the contacts
|
// removed, email the changes to the contacts
|
||||||
ImmutableSet<RegistrarContact> contacts = registrar.getContacts();
|
ImmutableSet<RegistrarPoc> contacts = registrar.getContacts();
|
||||||
|
|
||||||
Registrar updatedRegistrar = registrar;
|
Registrar updatedRegistrar = registrar;
|
||||||
// Do OWNER only updates to the registrar from the request.
|
// Do OWNER only updates to the registrar from the request.
|
||||||
|
@ -273,7 +273,7 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
updatedRegistrar = checkAndUpdateAdminControlledFields(updatedRegistrar, args);
|
updatedRegistrar = checkAndUpdateAdminControlledFields(updatedRegistrar, args);
|
||||||
|
|
||||||
// read the contacts from the request.
|
// read the contacts from the request.
|
||||||
ImmutableSet<RegistrarContact> updatedContacts = readContacts(registrar, contacts, args);
|
ImmutableSet<RegistrarPoc> updatedContacts = readContacts(registrar, contacts, args);
|
||||||
|
|
||||||
// Save the updated contacts
|
// Save the updated contacts
|
||||||
if (!updatedContacts.equals(contacts)) {
|
if (!updatedContacts.equals(contacts)) {
|
||||||
|
@ -281,7 +281,7 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
throw new ForbiddenException("Only OWNERs can update the contacts");
|
throw new ForbiddenException("Only OWNERs can update the contacts");
|
||||||
}
|
}
|
||||||
checkContactRequirements(contacts, updatedContacts);
|
checkContactRequirements(contacts, updatedContacts);
|
||||||
RegistrarContact.updateContacts(updatedRegistrar, updatedContacts);
|
RegistrarPoc.updateContacts(updatedRegistrar, updatedContacts);
|
||||||
updatedRegistrar = updatedRegistrar.asBuilder().setContactsRequireSyncing(true).build();
|
updatedRegistrar = updatedRegistrar.asBuilder().setContactsRequireSyncing(true).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,10 +293,10 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, Object> expandRegistrarWithContacts(
|
private Map<String, Object> expandRegistrarWithContacts(
|
||||||
Iterable<RegistrarContact> contacts, Registrar registrar) {
|
Iterable<RegistrarPoc> contacts, Registrar registrar) {
|
||||||
ImmutableSet<Map<String, Object>> expandedContacts =
|
ImmutableSet<Map<String, Object>> expandedContacts =
|
||||||
Streams.stream(contacts)
|
Streams.stream(contacts)
|
||||||
.map(RegistrarContact::toDiffableFieldMap)
|
.map(RegistrarPoc::toDiffableFieldMap)
|
||||||
// Note: per the javadoc, toDiffableFieldMap includes sensitive data but we don't want
|
// Note: per the javadoc, toDiffableFieldMap includes sensitive data but we don't want
|
||||||
// to display it here
|
// to display it here
|
||||||
.peek(
|
.peek(
|
||||||
|
@ -463,10 +463,10 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Reads the contacts from the supplied args. */
|
/** Reads the contacts from the supplied args. */
|
||||||
public static ImmutableSet<RegistrarContact> readContacts(
|
public static ImmutableSet<RegistrarPoc> readContacts(
|
||||||
Registrar registrar, ImmutableSet<RegistrarContact> existingContacts, Map<String, ?> args) {
|
Registrar registrar, ImmutableSet<RegistrarPoc> existingContacts, Map<String, ?> args) {
|
||||||
return RegistrarFormFields.getRegistrarContactBuilders(existingContacts, args).stream()
|
return RegistrarFormFields.getRegistrarContactBuilders(existingContacts, args).stream()
|
||||||
.map(builder -> builder.setParent(registrar).build())
|
.map(builder -> builder.setRegistrar(registrar).build())
|
||||||
.collect(toImmutableSet());
|
.collect(toImmutableSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,11 +476,10 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
* @throws FormException if the checks fail.
|
* @throws FormException if the checks fail.
|
||||||
*/
|
*/
|
||||||
void checkContactRequirements(
|
void checkContactRequirements(
|
||||||
ImmutableSet<RegistrarContact> existingContacts,
|
ImmutableSet<RegistrarPoc> existingContacts, ImmutableSet<RegistrarPoc> updatedContacts) {
|
||||||
ImmutableSet<RegistrarContact> updatedContacts) {
|
|
||||||
// Check that no two contacts use the same email address.
|
// Check that no two contacts use the same email address.
|
||||||
Set<String> emails = new HashSet<>();
|
Set<String> emails = new HashSet<>();
|
||||||
for (RegistrarContact contact : updatedContacts) {
|
for (RegistrarPoc contact : updatedContacts) {
|
||||||
if (!emails.add(contact.getEmailAddress())) {
|
if (!emails.add(contact.getEmailAddress())) {
|
||||||
throw new ContactRequirementException(
|
throw new ContactRequirementException(
|
||||||
String.format(
|
String.format(
|
||||||
|
@ -489,14 +488,14 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Check that required contacts don't go away, once they are set.
|
// Check that required contacts don't go away, once they are set.
|
||||||
Multimap<Type, RegistrarContact> oldContactsByType = HashMultimap.create();
|
Multimap<Type, RegistrarPoc> oldContactsByType = HashMultimap.create();
|
||||||
for (RegistrarContact contact : existingContacts) {
|
for (RegistrarPoc contact : existingContacts) {
|
||||||
for (Type t : contact.getTypes()) {
|
for (Type t : contact.getTypes()) {
|
||||||
oldContactsByType.put(t, contact);
|
oldContactsByType.put(t, contact);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Multimap<Type, RegistrarContact> newContactsByType = HashMultimap.create();
|
Multimap<Type, RegistrarPoc> newContactsByType = HashMultimap.create();
|
||||||
for (RegistrarContact contact : updatedContacts) {
|
for (RegistrarPoc contact : updatedContacts) {
|
||||||
for (Type t : contact.getTypes()) {
|
for (Type t : contact.getTypes()) {
|
||||||
newContactsByType.put(t, contact);
|
newContactsByType.put(t, contact);
|
||||||
}
|
}
|
||||||
|
@ -507,7 +506,7 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ensurePhoneNumberNotRemovedForContactTypes(oldContactsByType, newContactsByType, Type.TECH);
|
ensurePhoneNumberNotRemovedForContactTypes(oldContactsByType, newContactsByType, Type.TECH);
|
||||||
Optional<RegistrarContact> domainWhoisAbuseContact =
|
Optional<RegistrarPoc> domainWhoisAbuseContact =
|
||||||
getDomainWhoisVisibleAbuseContact(updatedContacts);
|
getDomainWhoisVisibleAbuseContact(updatedContacts);
|
||||||
// If the new set has a domain WHOIS abuse contact, it must have a phone number.
|
// If the new set has a domain WHOIS abuse contact, it must have a phone number.
|
||||||
if (domainWhoisAbuseContact.isPresent()
|
if (domainWhoisAbuseContact.isPresent()
|
||||||
|
@ -525,13 +524,12 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void checkContactRegistryLockRequirements(
|
private static void checkContactRegistryLockRequirements(
|
||||||
ImmutableSet<RegistrarContact> existingContacts,
|
ImmutableSet<RegistrarPoc> existingContacts, ImmutableSet<RegistrarPoc> updatedContacts) {
|
||||||
ImmutableSet<RegistrarContact> updatedContacts) {
|
|
||||||
// Any contact(s) with new passwords must be allowed to set them
|
// Any contact(s) with new passwords must be allowed to set them
|
||||||
for (RegistrarContact updatedContact : updatedContacts) {
|
for (RegistrarPoc updatedContact : updatedContacts) {
|
||||||
if (updatedContact.isRegistryLockAllowed()
|
if (updatedContact.isRegistryLockAllowed()
|
||||||
|| updatedContact.isAllowedToSetRegistryLockPassword()) {
|
|| updatedContact.isAllowedToSetRegistryLockPassword()) {
|
||||||
RegistrarContact existingContact =
|
RegistrarPoc existingContact =
|
||||||
existingContacts.stream()
|
existingContacts.stream()
|
||||||
.filter(
|
.filter(
|
||||||
contact -> contact.getEmailAddress().equals(updatedContact.getEmailAddress()))
|
contact -> contact.getEmailAddress().equals(updatedContact.getEmailAddress()))
|
||||||
|
@ -564,10 +562,10 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
|
|
||||||
// Any previously-existing contacts with registry lock enabled cannot be deleted
|
// Any previously-existing contacts with registry lock enabled cannot be deleted
|
||||||
existingContacts.stream()
|
existingContacts.stream()
|
||||||
.filter(RegistrarContact::isRegistryLockAllowed)
|
.filter(RegistrarPoc::isRegistryLockAllowed)
|
||||||
.forEach(
|
.forEach(
|
||||||
contact -> {
|
contact -> {
|
||||||
Optional<RegistrarContact> updatedContactOptional =
|
Optional<RegistrarPoc> updatedContactOptional =
|
||||||
updatedContacts.stream()
|
updatedContacts.stream()
|
||||||
.filter(
|
.filter(
|
||||||
updatedContact ->
|
updatedContact ->
|
||||||
|
@ -593,8 +591,8 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
* one before.
|
* one before.
|
||||||
*/
|
*/
|
||||||
private static void ensurePhoneNumberNotRemovedForContactTypes(
|
private static void ensurePhoneNumberNotRemovedForContactTypes(
|
||||||
Multimap<Type, RegistrarContact> oldContactsByType,
|
Multimap<Type, RegistrarPoc> oldContactsByType,
|
||||||
Multimap<Type, RegistrarContact> newContactsByType,
|
Multimap<Type, RegistrarPoc> newContactsByType,
|
||||||
Type... types) {
|
Type... types) {
|
||||||
for (Type type : types) {
|
for (Type type : types) {
|
||||||
if (oldContactsByType.get(type).stream().anyMatch(RegistrarSettingsAction::hasPhone)
|
if (oldContactsByType.get(type).stream().anyMatch(RegistrarSettingsAction::hasPhone)
|
||||||
|
@ -615,9 +613,9 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
* WHOIS record. Therefore it is possible to return inside the loop once one such contact is
|
* WHOIS record. Therefore it is possible to return inside the loop once one such contact is
|
||||||
* found.
|
* found.
|
||||||
*/
|
*/
|
||||||
private static Optional<RegistrarContact> getDomainWhoisVisibleAbuseContact(
|
private static Optional<RegistrarPoc> getDomainWhoisVisibleAbuseContact(
|
||||||
Set<RegistrarContact> contacts) {
|
Set<RegistrarPoc> contacts) {
|
||||||
return contacts.stream().filter(RegistrarContact::getVisibleInDomainWhoisAsAbuse).findFirst();
|
return contacts.stream().filter(RegistrarPoc::getVisibleInDomainWhoisAsAbuse).findFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -626,7 +624,7 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
* contact addresses and enqueues a task to re-sync the registrar sheet.
|
* contact addresses and enqueues a task to re-sync the registrar sheet.
|
||||||
*/
|
*/
|
||||||
private void sendExternalUpdatesIfNecessary(EmailInfo emailInfo) {
|
private void sendExternalUpdatesIfNecessary(EmailInfo emailInfo) {
|
||||||
ImmutableSet<RegistrarContact> existingContacts = emailInfo.contacts();
|
ImmutableSet<RegistrarPoc> existingContacts = emailInfo.contacts();
|
||||||
if (!sendEmailUtils.hasRecipients() && existingContacts.isEmpty()) {
|
if (!sendEmailUtils.hasRecipients() && existingContacts.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -663,7 +661,7 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
DiffUtils.prettyPrintDiffedMap(diffs, null)),
|
DiffUtils.prettyPrintDiffedMap(diffs, null)),
|
||||||
existingContacts.stream()
|
existingContacts.stream()
|
||||||
.filter(c -> c.getTypes().contains(Type.ADMIN))
|
.filter(c -> c.getTypes().contains(Type.ADMIN))
|
||||||
.map(RegistrarContact::getEmailAddress)
|
.map(RegistrarPoc::getEmailAddress)
|
||||||
.collect(toImmutableList()));
|
.collect(toImmutableList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ import com.google.common.net.MediaType;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import google.registry.model.domain.RegistryLock;
|
import google.registry.model.domain.RegistryLock;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.tld.RegistryLockDao;
|
import google.registry.model.tld.RegistryLockDao;
|
||||||
import google.registry.request.Action;
|
import google.registry.request.Action;
|
||||||
import google.registry.request.Action.Method;
|
import google.registry.request.Action.Method;
|
||||||
|
@ -118,17 +118,15 @@ public final class RegistryLockGetAction implements JsonGetAction {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Optional<RegistrarContact> getContactMatchingLogin(User user, Registrar registrar) {
|
static Optional<RegistrarPoc> getContactMatchingLogin(User user, Registrar registrar) {
|
||||||
ImmutableList<RegistrarContact> matchingContacts =
|
ImmutableList<RegistrarPoc> matchingContacts =
|
||||||
registrar.getContacts().stream()
|
registrar.getContacts().stream()
|
||||||
.filter(contact -> contact.getGaeUserId() != null)
|
.filter(contact -> contact.getGaeUserId() != null)
|
||||||
.filter(contact -> Objects.equals(contact.getGaeUserId(), user.getUserId()))
|
.filter(contact -> Objects.equals(contact.getGaeUserId(), user.getUserId()))
|
||||||
.collect(toImmutableList());
|
.collect(toImmutableList());
|
||||||
if (matchingContacts.size() > 1) {
|
if (matchingContacts.size() > 1) {
|
||||||
ImmutableList<String> matchingEmails =
|
ImmutableList<String> matchingEmails =
|
||||||
matchingContacts.stream()
|
matchingContacts.stream().map(RegistrarPoc::getEmailAddress).collect(toImmutableList());
|
||||||
.map(RegistrarContact::getEmailAddress)
|
|
||||||
.collect(toImmutableList());
|
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
String.format(
|
String.format(
|
||||||
"User ID %s had multiple matching contacts with email addresses %s",
|
"User ID %s had multiple matching contacts with email addresses %s",
|
||||||
|
@ -157,15 +155,15 @@ public final class RegistryLockGetAction implements JsonGetAction {
|
||||||
Registrar registrar = getRegistrarAndVerifyLockAccess(registrarAccessor, registrarId, isAdmin);
|
Registrar registrar = getRegistrarAndVerifyLockAccess(registrarAccessor, registrarId, isAdmin);
|
||||||
User user = authResult.userAuthInfo().get().user();
|
User user = authResult.userAuthInfo().get().user();
|
||||||
|
|
||||||
Optional<RegistrarContact> contactOptional = getContactMatchingLogin(user, registrar);
|
Optional<RegistrarPoc> contactOptional = getContactMatchingLogin(user, registrar);
|
||||||
boolean isRegistryLockAllowed =
|
boolean isRegistryLockAllowed =
|
||||||
isAdmin || contactOptional.map(RegistrarContact::isRegistryLockAllowed).orElse(false);
|
isAdmin || contactOptional.map(RegistrarPoc::isRegistryLockAllowed).orElse(false);
|
||||||
// Use the contact's registry lock email if it's present, else use the login email (for admins)
|
// Use the contact's registry lock email if it's present, else use the login email (for admins)
|
||||||
String relevantEmail =
|
String relevantEmail =
|
||||||
isAdmin
|
isAdmin
|
||||||
? user.getEmail()
|
? user.getEmail()
|
||||||
// if the contact isn't present, we shouldn't display the email anyway so empty is fine
|
// if the contact isn't present, we shouldn't display the email anyway so empty is fine
|
||||||
: contactOptional.flatMap(RegistrarContact::getRegistryLockEmailAddress).orElse("");
|
: contactOptional.flatMap(RegistrarPoc::getRegistryLockEmailAddress).orElse("");
|
||||||
return ImmutableMap.of(
|
return ImmutableMap.of(
|
||||||
LOCK_ENABLED_FOR_CONTACT_PARAM,
|
LOCK_ENABLED_FOR_CONTACT_PARAM,
|
||||||
isRegistryLockAllowed,
|
isRegistryLockAllowed,
|
||||||
|
|
|
@ -33,7 +33,7 @@ import google.registry.config.RegistryConfig.Config;
|
||||||
import google.registry.flows.domain.DomainFlowUtils;
|
import google.registry.flows.domain.DomainFlowUtils;
|
||||||
import google.registry.model.domain.RegistryLock;
|
import google.registry.model.domain.RegistryLock;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.request.Action;
|
import google.registry.request.Action;
|
||||||
import google.registry.request.Action.Method;
|
import google.registry.request.Action.Method;
|
||||||
import google.registry.request.HttpException.ForbiddenException;
|
import google.registry.request.HttpException.ForbiddenException;
|
||||||
|
@ -192,7 +192,7 @@ public class RegistryLockPostAction implements Runnable, JsonActionRunner.JsonAc
|
||||||
// registry lock enabled, and that the user provided a correct password
|
// registry lock enabled, and that the user provided a correct password
|
||||||
Registrar registrar =
|
Registrar registrar =
|
||||||
getRegistrarAndVerifyLockAccess(registrarAccessor, postInput.registrarId, false);
|
getRegistrarAndVerifyLockAccess(registrarAccessor, postInput.registrarId, false);
|
||||||
RegistrarContact registrarContact =
|
RegistrarPoc registrarPoc =
|
||||||
getContactMatchingLogin(user, registrar)
|
getContactMatchingLogin(user, registrar)
|
||||||
.orElseThrow(
|
.orElseThrow(
|
||||||
() ->
|
() ->
|
||||||
|
@ -200,16 +200,16 @@ public class RegistryLockPostAction implements Runnable, JsonActionRunner.JsonAc
|
||||||
String.format(
|
String.format(
|
||||||
"Cannot match user %s to registrar contact", user.getUserId())));
|
"Cannot match user %s to registrar contact", user.getUserId())));
|
||||||
checkArgument(
|
checkArgument(
|
||||||
registrarContact.verifyRegistryLockPassword(postInput.password),
|
registrarPoc.verifyRegistryLockPassword(postInput.password),
|
||||||
"Incorrect registry lock password for contact");
|
"Incorrect registry lock password for contact");
|
||||||
return registrarContact
|
return registrarPoc
|
||||||
.getRegistryLockEmailAddress()
|
.getRegistryLockEmailAddress()
|
||||||
.orElseThrow(
|
.orElseThrow(
|
||||||
() ->
|
() ->
|
||||||
new IllegalStateException(
|
new IllegalStateException(
|
||||||
String.format(
|
String.format(
|
||||||
"Contact %s had no registry lock email address",
|
"Contact %s had no registry lock email address",
|
||||||
registrarContact.getEmailAddress())));
|
registrarPoc.getEmailAddress())));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Value class that represents the expected input body from the UI request. */
|
/** Value class that represents the expected input body from the UI request. */
|
||||||
|
|
|
@ -32,7 +32,7 @@ import google.registry.model.domain.DomainBase;
|
||||||
import google.registry.model.domain.GracePeriod;
|
import google.registry.model.domain.GracePeriod;
|
||||||
import google.registry.model.eppcommon.StatusValue;
|
import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.translators.EnumToAttributeAdapter.EppEnum;
|
import google.registry.model.translators.EnumToAttributeAdapter.EppEnum;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
@ -80,11 +80,9 @@ final class DomainWhoisResponse extends WhoisResponseImpl {
|
||||||
"Could not load registrar %s",
|
"Could not load registrar %s",
|
||||||
domain.getCurrentSponsorRegistrarId());
|
domain.getCurrentSponsorRegistrarId());
|
||||||
Registrar registrar = registrarOptional.get();
|
Registrar registrar = registrarOptional.get();
|
||||||
Optional<RegistrarContact> abuseContact =
|
Optional<RegistrarPoc> abuseContact =
|
||||||
registrar
|
registrar.getContacts().stream()
|
||||||
.getContacts()
|
.filter(RegistrarPoc::getVisibleInDomainWhoisAsAbuse)
|
||||||
.stream()
|
|
||||||
.filter(RegistrarContact::getVisibleInDomainWhoisAsAbuse)
|
|
||||||
.findFirst();
|
.findFirst();
|
||||||
return WhoisResponseResults.create(
|
return WhoisResponseResults.create(
|
||||||
new DomainEmitter()
|
new DomainEmitter()
|
||||||
|
@ -102,10 +100,10 @@ final class DomainWhoisResponse extends WhoisResponseImpl {
|
||||||
// is an abuse contact, we can get an email address from it.
|
// is an abuse contact, we can get an email address from it.
|
||||||
.emitField(
|
.emitField(
|
||||||
"Registrar Abuse Contact Email",
|
"Registrar Abuse Contact Email",
|
||||||
abuseContact.map(RegistrarContact::getEmailAddress).orElse(""))
|
abuseContact.map(RegistrarPoc::getEmailAddress).orElse(""))
|
||||||
.emitField(
|
.emitField(
|
||||||
"Registrar Abuse Contact Phone",
|
"Registrar Abuse Contact Phone",
|
||||||
abuseContact.map(RegistrarContact::getPhoneNumber).orElse(""))
|
abuseContact.map(RegistrarPoc::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)
|
||||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.whois;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
@ -44,7 +44,7 @@ class RegistrarWhoisResponse extends WhoisResponseImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WhoisResponseResults getResponse(boolean preferUnicode, String disclaimer) {
|
public WhoisResponseResults getResponse(boolean preferUnicode, String disclaimer) {
|
||||||
Set<RegistrarContact> contacts = registrar.getContacts();
|
Set<RegistrarPoc> contacts = registrar.getContacts();
|
||||||
String plaintext =
|
String plaintext =
|
||||||
new RegistrarEmitter()
|
new RegistrarEmitter()
|
||||||
.emitField("Registrar", registrar.getRegistrarName())
|
.emitField("Registrar", registrar.getRegistrarName())
|
||||||
|
@ -59,8 +59,8 @@ class RegistrarWhoisResponse extends WhoisResponseImpl {
|
||||||
registrar.getPhoneNumber(), registrar.getFaxNumber(), registrar.getEmailAddress())
|
registrar.getPhoneNumber(), registrar.getFaxNumber(), registrar.getEmailAddress())
|
||||||
.emitField("Registrar WHOIS Server", registrar.getWhoisServer())
|
.emitField("Registrar WHOIS Server", registrar.getWhoisServer())
|
||||||
.emitField("Registrar URL", registrar.getUrl())
|
.emitField("Registrar URL", registrar.getUrl())
|
||||||
.emitRegistrarContacts("Admin", contacts, AdminOrTech.ADMIN)
|
.emitRegistrarPocs("Admin", contacts, AdminOrTech.ADMIN)
|
||||||
.emitRegistrarContacts("Technical", contacts, AdminOrTech.TECH)
|
.emitRegistrarPocs("Technical", contacts, AdminOrTech.TECH)
|
||||||
.emitLastUpdated(getTimestamp())
|
.emitLastUpdated(getTimestamp())
|
||||||
.emitFooter(disclaimer)
|
.emitFooter(disclaimer)
|
||||||
.toString();
|
.toString();
|
||||||
|
@ -70,11 +70,9 @@ class RegistrarWhoisResponse extends WhoisResponseImpl {
|
||||||
/** An emitter with logic for registrars. */
|
/** An emitter with logic for registrars. */
|
||||||
static class RegistrarEmitter extends Emitter<RegistrarEmitter> {
|
static class RegistrarEmitter extends Emitter<RegistrarEmitter> {
|
||||||
/** Emits the registrar contact of the given type. */
|
/** Emits the registrar contact of the given type. */
|
||||||
RegistrarEmitter emitRegistrarContacts(
|
RegistrarEmitter emitRegistrarPocs(
|
||||||
String contactLabel,
|
String contactLabel, Iterable<RegistrarPoc> contacts, AdminOrTech type) {
|
||||||
Iterable<RegistrarContact> contacts,
|
for (RegistrarPoc contact : contacts) {
|
||||||
AdminOrTech type) {
|
|
||||||
for (RegistrarContact contact : contacts) {
|
|
||||||
if ((type == AdminOrTech.ADMIN && contact.getVisibleInWhoisAsAdmin())
|
if ((type == AdminOrTech.ADMIN && contact.getVisibleInWhoisAsAdmin())
|
||||||
|| (type == AdminOrTech.TECH && contact.getVisibleInWhoisAsTech())) {
|
|| (type == AdminOrTech.TECH && contact.getVisibleInWhoisAsTech())) {
|
||||||
emitField(contactLabel + " Contact", contact.getName())
|
emitField(contactLabel + " Contact", contact.getName())
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
<class>google.registry.model.poll.PollMessage$Autorenew</class>
|
<class>google.registry.model.poll.PollMessage$Autorenew</class>
|
||||||
<class>google.registry.model.rde.RdeRevision</class>
|
<class>google.registry.model.rde.RdeRevision</class>
|
||||||
<class>google.registry.model.registrar.Registrar</class>
|
<class>google.registry.model.registrar.Registrar</class>
|
||||||
<class>google.registry.model.registrar.RegistrarContact</class>
|
<class>google.registry.model.registrar.RegistrarPoc</class>
|
||||||
<class>google.registry.model.tld.label.PremiumList</class>
|
<class>google.registry.model.tld.label.PremiumList</class>
|
||||||
<class>google.registry.model.tld.label.PremiumList$PremiumEntry</class>
|
<class>google.registry.model.tld.label.PremiumList$PremiumEntry</class>
|
||||||
<class>google.registry.model.tld.label.ReservedList</class>
|
<class>google.registry.model.tld.label.ReservedList</class>
|
||||||
|
|
|
@ -35,8 +35,8 @@ import google.registry.batch.SendExpiringCertificateNotificationEmailAction.Regi
|
||||||
import google.registry.flows.certs.CertificateChecker;
|
import google.registry.flows.certs.CertificateChecker;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.registrar.RegistrarContact.Type;
|
import google.registry.model.registrar.RegistrarPoc.Type;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.testing.AppEngineExtension;
|
||||||
import google.registry.testing.DualDatabaseTest;
|
import google.registry.testing.DualDatabaseTest;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
|
@ -220,15 +220,15 @@ class SendExpiringCertificateNotificationEmailActionTest {
|
||||||
.asBuilder()
|
.asBuilder()
|
||||||
.setFailoverClientCertificate(cert.get(), clock.nowUtc())
|
.setFailoverClientCertificate(cert.get(), clock.nowUtc())
|
||||||
.build());
|
.build());
|
||||||
ImmutableList<RegistrarContact> contacts =
|
ImmutableList<RegistrarPoc> contacts =
|
||||||
ImmutableList.of(
|
ImmutableList.of(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Will Doe")
|
.setName("Will Doe")
|
||||||
.setEmailAddress("will@example-registrar.tld")
|
.setEmailAddress("will@example-registrar.tld")
|
||||||
.setPhoneNumber("+1.3105551213")
|
.setPhoneNumber("+1.3105551213")
|
||||||
.setFaxNumber("+1.3105551213")
|
.setFaxNumber("+1.3105551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInWhoisAsTech(false)
|
||||||
.build());
|
.build());
|
||||||
|
@ -510,51 +510,51 @@ class SendExpiringCertificateNotificationEmailActionTest {
|
||||||
@TestOfyAndSql
|
@TestOfyAndSql
|
||||||
void getEmailAddresses_success_returnsAListOfEmails() throws Exception {
|
void getEmailAddresses_success_returnsAListOfEmails() throws Exception {
|
||||||
Registrar registrar = persistResource(makeRegistrar1());
|
Registrar registrar = persistResource(makeRegistrar1());
|
||||||
ImmutableList<RegistrarContact> contacts =
|
ImmutableList<RegistrarPoc> contacts =
|
||||||
ImmutableList.of(
|
ImmutableList.of(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("jd@example-registrar.tld")
|
.setEmailAddress("jd@example-registrar.tld")
|
||||||
.setPhoneNumber("+1.3105551213")
|
.setPhoneNumber("+1.3105551213")
|
||||||
.setFaxNumber("+1.3105551213")
|
.setFaxNumber("+1.3105551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInWhoisAsTech(false)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Smith")
|
.setName("John Smith")
|
||||||
.setEmailAddress("js@example-registrar.tld")
|
.setEmailAddress("js@example-registrar.tld")
|
||||||
.setPhoneNumber("+1.1111111111")
|
.setPhoneNumber("+1.1111111111")
|
||||||
.setFaxNumber("+1.1111111111")
|
.setFaxNumber("+1.1111111111")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Will Doe")
|
.setName("Will Doe")
|
||||||
.setEmailAddress("will@example-registrar.tld")
|
.setEmailAddress("will@example-registrar.tld")
|
||||||
.setPhoneNumber("+1.3105551213")
|
.setPhoneNumber("+1.3105551213")
|
||||||
.setFaxNumber("+1.3105551213")
|
.setFaxNumber("+1.3105551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInWhoisAsTech(false)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Mike Doe")
|
.setName("Mike Doe")
|
||||||
.setEmailAddress("mike@example-registrar.tld")
|
.setEmailAddress("mike@example-registrar.tld")
|
||||||
.setPhoneNumber("+1.1111111111")
|
.setPhoneNumber("+1.1111111111")
|
||||||
.setFaxNumber("+1.1111111111")
|
.setFaxNumber("+1.1111111111")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John T")
|
.setName("John T")
|
||||||
.setEmailAddress("john@example-registrar.tld")
|
.setEmailAddress("john@example-registrar.tld")
|
||||||
.setPhoneNumber("+1.3105551215")
|
.setPhoneNumber("+1.3105551215")
|
||||||
.setFaxNumber("+1.3105551216")
|
.setFaxNumber("+1.3105551216")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInWhoisAsTech(true)
|
||||||
.build());
|
.build());
|
||||||
persistSimpleResources(contacts);
|
persistSimpleResources(contacts);
|
||||||
|
@ -710,20 +710,20 @@ class SendExpiringCertificateNotificationEmailActionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns persisted sample contacts with a customized contact email type. */
|
/** Returns persisted sample contacts with a customized contact email type. */
|
||||||
private ImmutableList<RegistrarContact> persistSampleContacts(
|
private ImmutableList<RegistrarPoc> persistSampleContacts(
|
||||||
Registrar registrar, RegistrarContact.Type emailType) {
|
Registrar registrar, RegistrarPoc.Type emailType) {
|
||||||
return persistSimpleResources(
|
return persistSimpleResources(
|
||||||
ImmutableList.of(
|
ImmutableList.of(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Will Doe")
|
.setName("Will Doe")
|
||||||
.setEmailAddress("will@example-registrar.tld")
|
.setEmailAddress("will@example-registrar.tld")
|
||||||
.setPhoneNumber("+1.0105551213")
|
.setPhoneNumber("+1.0105551213")
|
||||||
.setFaxNumber("+1.0105551213")
|
.setFaxNumber("+1.0105551213")
|
||||||
.setTypes(ImmutableSet.of(emailType))
|
.setTypes(ImmutableSet.of(emailType))
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Will Smith")
|
.setName("Will Smith")
|
||||||
.setEmailAddress("will@test-registrar.tld")
|
.setEmailAddress("will@test-registrar.tld")
|
||||||
.setPhoneNumber("+1.3105551213")
|
.setPhoneNumber("+1.3105551213")
|
||||||
|
|
|
@ -16,9 +16,9 @@ package google.registry.export;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static google.registry.export.SyncGroupMembersAction.getGroupEmailAddressForContactType;
|
import static google.registry.export.SyncGroupMembersAction.getGroupEmailAddressForContactType;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.ADMIN;
|
import static google.registry.model.registrar.RegistrarPoc.Type.ADMIN;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.MARKETING;
|
import static google.registry.model.registrar.RegistrarPoc.Type.MARKETING;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.TECH;
|
import static google.registry.model.registrar.RegistrarPoc.Type.TECH;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||||
import static google.registry.testing.DatabaseHelper.loadRegistrar;
|
import static google.registry.testing.DatabaseHelper.loadRegistrar;
|
||||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||||
|
@ -37,7 +37,7 @@ import com.google.common.collect.Iterables;
|
||||||
import google.registry.groups.DirectoryGroupsConnection;
|
import google.registry.groups.DirectoryGroupsConnection;
|
||||||
import google.registry.groups.GroupsConnection.Role;
|
import google.registry.groups.GroupsConnection.Role;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.request.Response;
|
import google.registry.request.Response;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.testing.AppEngineExtension;
|
||||||
import google.registry.testing.DualDatabaseTest;
|
import google.registry.testing.DualDatabaseTest;
|
||||||
|
@ -78,10 +78,9 @@ public class SyncGroupMembersActionTest {
|
||||||
|
|
||||||
@TestOfyAndSql
|
@TestOfyAndSql
|
||||||
void test_getGroupEmailAddressForContactType_convertsToLowercase() {
|
void test_getGroupEmailAddressForContactType_convertsToLowercase() {
|
||||||
assertThat(getGroupEmailAddressForContactType(
|
assertThat(
|
||||||
"SomeRegistrar",
|
getGroupEmailAddressForContactType(
|
||||||
RegistrarContact.Type.ADMIN,
|
"SomeRegistrar", RegistrarPoc.Type.ADMIN, "domain-registry.example"))
|
||||||
"domain-registry.example"))
|
|
||||||
.isEqualTo("someregistrar-primary-contacts@domain-registry.example");
|
.isEqualTo("someregistrar-primary-contacts@domain-registry.example");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,15 +155,15 @@ public class SyncGroupMembersActionTest {
|
||||||
when(connection.getMembersOfGroup("theregistrar-primary-contacts@domain-registry.example"))
|
when(connection.getMembersOfGroup("theregistrar-primary-contacts@domain-registry.example"))
|
||||||
.thenReturn(ImmutableSet.of());
|
.thenReturn(ImmutableSet.of());
|
||||||
persistResource(
|
persistResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(loadRegistrar("NewRegistrar"))
|
.setRegistrar(loadRegistrar("NewRegistrar"))
|
||||||
.setName("Binary Star")
|
.setName("Binary Star")
|
||||||
.setEmailAddress("binarystar@example.tld")
|
.setEmailAddress("binarystar@example.tld")
|
||||||
.setTypes(ImmutableSet.of(ADMIN, MARKETING))
|
.setTypes(ImmutableSet.of(ADMIN, MARKETING))
|
||||||
.build());
|
.build());
|
||||||
persistResource(
|
persistResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(loadRegistrar("TheRegistrar"))
|
.setRegistrar(loadRegistrar("TheRegistrar"))
|
||||||
.setName("Hexadecimal")
|
.setName("Hexadecimal")
|
||||||
.setEmailAddress("hexadecimal@snow.fall")
|
.setEmailAddress("hexadecimal@snow.fall")
|
||||||
.setTypes(ImmutableSet.of(TECH))
|
.setTypes(ImmutableSet.of(TECH))
|
||||||
|
|
|
@ -38,7 +38,7 @@ import google.registry.model.common.Cursor;
|
||||||
import google.registry.model.ofy.Ofy;
|
import google.registry.model.ofy.Ofy;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.testing.AppEngineExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.DualDatabaseTest;
|
import google.registry.testing.DualDatabaseTest;
|
||||||
|
@ -85,7 +85,7 @@ public class SyncRegistrarsSheetTest {
|
||||||
// We don't do this for ofy because ofy's loadAllOf() can't be called in a transaction but
|
// We don't do this for ofy because ofy's loadAllOf() can't be called in a transaction but
|
||||||
// _must_ be called in a transaction in JPA.
|
// _must_ be called in a transaction in JPA.
|
||||||
if (!tm().isOfy()) {
|
if (!tm().isOfy()) {
|
||||||
tm().transact(() -> tm().loadAllOf(RegistrarContact.class))
|
tm().transact(() -> tm().loadAllOf(RegistrarPoc.class))
|
||||||
.forEach(DatabaseHelper::deleteResource);
|
.forEach(DatabaseHelper::deleteResource);
|
||||||
}
|
}
|
||||||
Registrar.loadAll().forEach(DatabaseHelper::deleteResource);
|
Registrar.loadAll().forEach(DatabaseHelper::deleteResource);
|
||||||
|
@ -161,33 +161,34 @@ public class SyncRegistrarsSheetTest {
|
||||||
.setUrl("http://www.example.org/aaa_registrar")
|
.setUrl("http://www.example.org/aaa_registrar")
|
||||||
.setBillingAccountMap(ImmutableMap.of(USD, "USD1234", JPY, "JPY7890"))
|
.setBillingAccountMap(ImmutableMap.of(USD, "USD1234", JPY, "JPY7890"))
|
||||||
.build();
|
.build();
|
||||||
ImmutableList<RegistrarContact> contacts = ImmutableList.of(
|
ImmutableList<RegistrarPoc> contacts =
|
||||||
new RegistrarContact.Builder()
|
ImmutableList.of(
|
||||||
.setParent(registrar)
|
new RegistrarPoc.Builder()
|
||||||
.setName("Jane Doe")
|
.setRegistrar(registrar)
|
||||||
.setEmailAddress("contact@example.com")
|
.setName("Jane Doe")
|
||||||
.setPhoneNumber("+1.1234567890")
|
.setEmailAddress("contact@example.com")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN, RegistrarContact.Type.BILLING))
|
.setPhoneNumber("+1.1234567890")
|
||||||
.build(),
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN, RegistrarPoc.Type.BILLING))
|
||||||
new RegistrarContact.Builder()
|
.build(),
|
||||||
.setParent(registrar)
|
new RegistrarPoc.Builder()
|
||||||
.setName("John Doe")
|
.setRegistrar(registrar)
|
||||||
.setEmailAddress("john.doe@example.tld")
|
.setName("John Doe")
|
||||||
.setPhoneNumber("+1.1234567890")
|
.setEmailAddress("john.doe@example.tld")
|
||||||
.setFaxNumber("+1.1234567891")
|
.setPhoneNumber("+1.1234567890")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
|
.setFaxNumber("+1.1234567891")
|
||||||
// Purposely flip the internal/external admin/tech
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
// distinction to make sure we're not relying on it. Sigh.
|
// Purposely flip the internal/external admin/tech
|
||||||
.setVisibleInWhoisAsAdmin(false)
|
// distinction to make sure we're not relying on it. Sigh.
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInWhoisAsAdmin(false)
|
||||||
.setGaeUserId("light")
|
.setVisibleInWhoisAsTech(true)
|
||||||
.build(),
|
.setGaeUserId("light")
|
||||||
new RegistrarContact.Builder()
|
.build(),
|
||||||
.setParent(registrar)
|
new RegistrarPoc.Builder()
|
||||||
.setName("Jane Smith")
|
.setRegistrar(registrar)
|
||||||
.setEmailAddress("pride@example.net")
|
.setName("Jane Smith")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
|
.setEmailAddress("pride@example.net")
|
||||||
.build());
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
|
.build());
|
||||||
// Use registrar key for contacts' parent.
|
// Use registrar key for contacts' parent.
|
||||||
DateTime registrarCreationTime = persistResource(registrar).getCreationTime();
|
DateTime registrarCreationTime = persistResource(registrar).getCreationTime();
|
||||||
persistSimpleResources(contacts);
|
persistSimpleResources(contacts);
|
||||||
|
|
|
@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.Registry.TldState;
|
import google.registry.model.tld.Registry.TldState;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.testing.AppEngineExtension;
|
||||||
|
@ -93,9 +93,8 @@ public final class OteAccountBuilderTest {
|
||||||
|
|
||||||
private void assertContactExists(String registrarId, String email) {
|
private void assertContactExists(String registrarId, String email) {
|
||||||
Registrar registrar = Registrar.loadByRegistrarId(registrarId).get();
|
Registrar registrar = Registrar.loadByRegistrarId(registrarId).get();
|
||||||
assertThat(registrar.getContacts().stream().map(RegistrarContact::getEmailAddress))
|
assertThat(registrar.getContacts().stream().map(RegistrarPoc::getEmailAddress)).contains(email);
|
||||||
.contains(email);
|
RegistrarPoc contact =
|
||||||
RegistrarContact contact =
|
|
||||||
registrar.getContacts().stream()
|
registrar.getContacts().stream()
|
||||||
.filter(c -> email.equals(c.getEmailAddress()))
|
.filter(c -> email.equals(c.getEmailAddress()))
|
||||||
.findAny()
|
.findAny()
|
||||||
|
|
|
@ -34,7 +34,6 @@ import google.registry.model.index.ForeignKeyIndex.ForeignKeyHostIndex;
|
||||||
import google.registry.model.poll.PollMessage;
|
import google.registry.model.poll.PollMessage;
|
||||||
import google.registry.model.rde.RdeRevision;
|
import google.registry.model.rde.RdeRevision;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
|
||||||
import google.registry.model.replay.LastSqlTransaction;
|
import google.registry.model.replay.LastSqlTransaction;
|
||||||
import google.registry.model.replay.ReplayGap;
|
import google.registry.model.replay.ReplayGap;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
|
@ -70,7 +69,6 @@ public class ClassPathManagerTest {
|
||||||
assertThat(ClassPathManager.getClass("ReplayGap")).isEqualTo(ReplayGap.class);
|
assertThat(ClassPathManager.getClass("ReplayGap")).isEqualTo(ReplayGap.class);
|
||||||
assertThat(ClassPathManager.getClass("ContactResource")).isEqualTo(ContactResource.class);
|
assertThat(ClassPathManager.getClass("ContactResource")).isEqualTo(ContactResource.class);
|
||||||
assertThat(ClassPathManager.getClass("Cancellation")).isEqualTo(Cancellation.class);
|
assertThat(ClassPathManager.getClass("Cancellation")).isEqualTo(Cancellation.class);
|
||||||
assertThat(ClassPathManager.getClass("RegistrarContact")).isEqualTo(RegistrarContact.class);
|
|
||||||
assertThat(ClassPathManager.getClass("LastSqlTransaction")).isEqualTo(LastSqlTransaction.class);
|
assertThat(ClassPathManager.getClass("LastSqlTransaction")).isEqualTo(LastSqlTransaction.class);
|
||||||
assertThat(ClassPathManager.getClass("GaeUserIdConverter")).isEqualTo(GaeUserIdConverter.class);
|
assertThat(ClassPathManager.getClass("GaeUserIdConverter")).isEqualTo(GaeUserIdConverter.class);
|
||||||
assertThat(ClassPathManager.getClass("EppResourceIndexBucket"))
|
assertThat(ClassPathManager.getClass("EppResourceIndexBucket"))
|
||||||
|
@ -130,7 +128,6 @@ public class ClassPathManagerTest {
|
||||||
assertThat(ClassPathManager.getClassName(ReplayGap.class)).isEqualTo("ReplayGap");
|
assertThat(ClassPathManager.getClassName(ReplayGap.class)).isEqualTo("ReplayGap");
|
||||||
assertThat(ClassPathManager.getClassName(ContactResource.class)).isEqualTo("ContactResource");
|
assertThat(ClassPathManager.getClassName(ContactResource.class)).isEqualTo("ContactResource");
|
||||||
assertThat(ClassPathManager.getClassName(Cancellation.class)).isEqualTo("Cancellation");
|
assertThat(ClassPathManager.getClassName(Cancellation.class)).isEqualTo("Cancellation");
|
||||||
assertThat(ClassPathManager.getClassName(RegistrarContact.class)).isEqualTo("RegistrarContact");
|
|
||||||
assertThat(ClassPathManager.getClassName(LastSqlTransaction.class))
|
assertThat(ClassPathManager.getClassName(LastSqlTransaction.class))
|
||||||
.isEqualTo("LastSqlTransaction");
|
.isEqualTo("LastSqlTransaction");
|
||||||
assertThat(ClassPathManager.getClassName(GaeUserIdConverter.class))
|
assertThat(ClassPathManager.getClassName(GaeUserIdConverter.class))
|
||||||
|
|
|
@ -63,7 +63,7 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
class RegistrarTest extends EntityTestCase {
|
class RegistrarTest extends EntityTestCase {
|
||||||
|
|
||||||
private Registrar registrar;
|
private Registrar registrar;
|
||||||
private RegistrarContact abuseAdminContact;
|
private RegistrarPoc abuseAdminContact;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void setUp() {
|
void setUp() {
|
||||||
|
@ -127,27 +127,26 @@ class RegistrarTest extends EntityTestCase {
|
||||||
.build());
|
.build());
|
||||||
persistResource(registrar);
|
persistResource(registrar);
|
||||||
abuseAdminContact =
|
abuseAdminContact =
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Abused")
|
.setName("John Abused")
|
||||||
.setEmailAddress("johnabuse@example.com")
|
.setEmailAddress("johnabuse@example.com")
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInWhoisAsTech(false)
|
||||||
.setPhoneNumber("+1.2125551213")
|
.setPhoneNumber("+1.2125551213")
|
||||||
.setFaxNumber("+1.2125551213")
|
.setFaxNumber("+1.2125551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ABUSE, RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ABUSE, RegistrarPoc.Type.ADMIN))
|
||||||
.build();
|
.build();
|
||||||
persistSimpleResources(
|
persistSimpleResources(
|
||||||
ImmutableList.of(
|
ImmutableList.of(
|
||||||
abuseAdminContact,
|
abuseAdminContact,
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("johndoe@example.com")
|
.setEmailAddress("johndoe@example.com")
|
||||||
.setPhoneNumber("+1.2125551213")
|
.setPhoneNumber("+1.2125551213")
|
||||||
.setFaxNumber("+1.2125551213")
|
.setFaxNumber("+1.2125551213")
|
||||||
.setTypes(
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.LEGAL, RegistrarPoc.Type.MARKETING))
|
||||||
ImmutableSet.of(RegistrarContact.Type.LEGAL, RegistrarContact.Type.MARKETING))
|
|
||||||
.build()));
|
.build()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,50 +295,50 @@ class RegistrarTest extends EntityTestCase {
|
||||||
@TestOfyAndSql
|
@TestOfyAndSql
|
||||||
void testSuccess_emptyContactTypesAllowed() {
|
void testSuccess_emptyContactTypesAllowed() {
|
||||||
persistSimpleResource(
|
persistSimpleResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Abussy")
|
.setName("John Abussy")
|
||||||
.setEmailAddress("johnabussy@example.com")
|
.setEmailAddress("johnabussy@example.com")
|
||||||
.setPhoneNumber("+1.2125551213")
|
.setPhoneNumber("+1.2125551213")
|
||||||
.setFaxNumber("+1.2125551213")
|
.setFaxNumber("+1.2125551213")
|
||||||
// No setTypes(...)
|
// No setTypes(...)
|
||||||
.build());
|
.build());
|
||||||
for (RegistrarContact rc : registrar.getContacts()) {
|
for (RegistrarPoc rc : registrar.getContacts()) {
|
||||||
rc.toJsonMap();
|
rc.toJsonMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestOfyAndSql
|
@TestOfyAndSql
|
||||||
void testSuccess_getContactsByType() {
|
void testSuccess_getContactsByType() {
|
||||||
RegistrarContact newTechContact =
|
RegistrarPoc newTechContact =
|
||||||
persistSimpleResource(
|
persistSimpleResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Jake Tech")
|
.setName("Jake Tech")
|
||||||
.setEmailAddress("jaketech@example.com")
|
.setEmailAddress("jaketech@example.com")
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInWhoisAsTech(true)
|
||||||
.setPhoneNumber("+1.2125551213")
|
.setPhoneNumber("+1.2125551213")
|
||||||
.setFaxNumber("+1.2125551213")
|
.setFaxNumber("+1.2125551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
.build());
|
.build());
|
||||||
RegistrarContact newTechAbuseContact =
|
RegistrarPoc newTechAbuseContact =
|
||||||
persistSimpleResource(
|
persistSimpleResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Jim Tech-Abuse")
|
.setName("Jim Tech-Abuse")
|
||||||
.setEmailAddress("jimtechAbuse@example.com")
|
.setEmailAddress("jimtechAbuse@example.com")
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInWhoisAsTech(true)
|
||||||
.setPhoneNumber("+1.2125551213")
|
.setPhoneNumber("+1.2125551213")
|
||||||
.setFaxNumber("+1.2125551213")
|
.setFaxNumber("+1.2125551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH, RegistrarContact.Type.ABUSE))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH, RegistrarPoc.Type.ABUSE))
|
||||||
.build());
|
.build());
|
||||||
ImmutableSortedSet<RegistrarContact> techContacts =
|
ImmutableSortedSet<RegistrarPoc> techContacts =
|
||||||
registrar.getContactsOfType(RegistrarContact.Type.TECH);
|
registrar.getContactsOfType(RegistrarPoc.Type.TECH);
|
||||||
assertThat(techContacts).containsExactly(newTechContact, newTechAbuseContact).inOrder();
|
assertThat(techContacts).containsExactly(newTechContact, newTechAbuseContact).inOrder();
|
||||||
ImmutableSortedSet<RegistrarContact> abuseContacts =
|
ImmutableSortedSet<RegistrarPoc> abuseContacts =
|
||||||
registrar.getContactsOfType(RegistrarContact.Type.ABUSE);
|
registrar.getContactsOfType(RegistrarPoc.Type.ABUSE);
|
||||||
assertThat(abuseContacts).containsExactly(newTechAbuseContact, abuseAdminContact).inOrder();
|
assertThat(abuseContacts).containsExactly(newTechAbuseContact, abuseAdminContact).inOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import google.registry.model.billing.BillingEvent.OneTime;
|
||||||
import google.registry.model.common.ClassPathManager;
|
import google.registry.model.common.ClassPathManager;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
import google.registry.model.host.HostResource;
|
import google.registry.model.host.HostResource;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.testing.AppEngineExtension;
|
||||||
import google.registry.testing.TestObject;
|
import google.registry.testing.TestObject;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
@ -68,7 +68,7 @@ class VKeyTest {
|
||||||
IllegalArgumentException thrown =
|
IllegalArgumentException thrown =
|
||||||
assertThrows(
|
assertThrows(
|
||||||
IllegalArgumentException.class,
|
IllegalArgumentException.class,
|
||||||
() -> VKey.create(RegistrarContact.class, "fake@example.com"));
|
() -> VKey.create(RegistrarPoc.class, "fake@example.com"));
|
||||||
assertThat(thrown).hasMessageThat().contains("BackupGroupRoot");
|
assertThat(thrown).hasMessageThat().contains("BackupGroupRoot");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ import com.google.common.io.Resources;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.Registrar.State;
|
import google.registry.model.registrar.Registrar.State;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.persistence.HibernateSchemaExporter;
|
import google.registry.persistence.HibernateSchemaExporter;
|
||||||
import google.registry.persistence.NomulusPostgreSql;
|
import google.registry.persistence.NomulusPostgreSql;
|
||||||
import google.registry.persistence.PersistenceModule;
|
import google.registry.persistence.PersistenceModule;
|
||||||
|
@ -388,15 +388,15 @@ abstract class JpaTransactionManagerExtension implements BeforeEachCallback, Aft
|
||||||
* Public factory for first RegistrarContact to allow comparison against stored value in unit
|
* Public factory for first RegistrarContact to allow comparison against stored value in unit
|
||||||
* tests.
|
* tests.
|
||||||
*/
|
*/
|
||||||
public static RegistrarContact makeRegistrarContact1() {
|
public static RegistrarPoc makeRegistrarContact1() {
|
||||||
return new RegistrarContact.Builder()
|
return new RegistrarPoc.Builder()
|
||||||
.setParent(makeRegistrar1())
|
.setRegistrar(makeRegistrar1())
|
||||||
.setName("Jane Doe")
|
.setName("Jane Doe")
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInWhoisAsTech(false)
|
||||||
.setEmailAddress("janedoe@theregistrar.com")
|
.setEmailAddress("janedoe@theregistrar.com")
|
||||||
.setPhoneNumber("+1.1234567890")
|
.setPhoneNumber("+1.1234567890")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,25 +404,25 @@ abstract class JpaTransactionManagerExtension implements BeforeEachCallback, Aft
|
||||||
* Public factory for second RegistrarContact to allow comparison against stored value in unit
|
* Public factory for second RegistrarContact to allow comparison against stored value in unit
|
||||||
* tests.
|
* tests.
|
||||||
*/
|
*/
|
||||||
public static RegistrarContact makeRegistrarContact2() {
|
public static RegistrarPoc makeRegistrarContact2() {
|
||||||
return new RegistrarContact.Builder()
|
return new RegistrarPoc.Builder()
|
||||||
.setParent(makeRegistrar2())
|
.setRegistrar(makeRegistrar2())
|
||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("johndoe@theregistrar.com")
|
.setEmailAddress("johndoe@theregistrar.com")
|
||||||
.setPhoneNumber("+1.1234567890")
|
.setPhoneNumber("+1.1234567890")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.setGaeUserId(THE_REGISTRAR_GAE_USER_ID)
|
.setGaeUserId(THE_REGISTRAR_GAE_USER_ID)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RegistrarContact makeRegistrarContact3() {
|
public static RegistrarPoc makeRegistrarContact3() {
|
||||||
return new RegistrarContact.Builder()
|
return new RegistrarPoc.Builder()
|
||||||
.setParent(makeRegistrar2())
|
.setRegistrar(makeRegistrar2())
|
||||||
.setName("Marla Singer")
|
.setName("Marla Singer")
|
||||||
.setEmailAddress("Marla.Singer@crr.com")
|
.setEmailAddress("Marla.Singer@crr.com")
|
||||||
.setRegistryLockEmailAddress("Marla.Singer.RegistryLock@crr.com")
|
.setRegistryLockEmailAddress("Marla.Singer.RegistryLock@crr.com")
|
||||||
.setPhoneNumber("+1.2128675309")
|
.setPhoneNumber("+1.2128675309")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
.setGaeUserId(MARLA_SINGER_GAE_USER_ID)
|
.setGaeUserId(MARLA_SINGER_GAE_USER_ID)
|
||||||
.setAllowedToSetRegistryLockPassword(true)
|
.setAllowedToSetRegistryLockPassword(true)
|
||||||
.setRegistryLockPassword("hi")
|
.setRegistryLockPassword("hi")
|
||||||
|
|
|
@ -40,7 +40,7 @@ import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.host.HostResource;
|
import google.registry.model.host.HostResource;
|
||||||
import google.registry.model.ofy.Ofy;
|
import google.registry.model.ofy.Ofy;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.transfer.DomainTransferData;
|
import google.registry.model.transfer.DomainTransferData;
|
||||||
import google.registry.model.transfer.TransferStatus;
|
import google.registry.model.transfer.TransferStatus;
|
||||||
|
@ -260,43 +260,43 @@ class RdapJsonFormatterTest {
|
||||||
clock.nowUtc().minusMonths(3)));
|
clock.nowUtc().minusMonths(3)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static ImmutableList<RegistrarContact> makeMoreRegistrarContacts(Registrar registrar) {
|
static ImmutableList<RegistrarPoc> makeMoreRegistrarContacts(Registrar registrar) {
|
||||||
return ImmutableList.of(
|
return ImmutableList.of(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Baby Doe")
|
.setName("Baby Doe")
|
||||||
.setEmailAddress("babydoe@example.com")
|
.setEmailAddress("babydoe@example.com")
|
||||||
.setPhoneNumber("+1.2125551217")
|
.setPhoneNumber("+1.2125551217")
|
||||||
.setFaxNumber("+1.2125551218")
|
.setFaxNumber("+1.2125551218")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.setVisibleInWhoisAsAdmin(false)
|
.setVisibleInWhoisAsAdmin(false)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInWhoisAsTech(false)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("johndoe@example.com")
|
.setEmailAddress("johndoe@example.com")
|
||||||
.setFaxNumber("+1.2125551213")
|
.setFaxNumber("+1.2125551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.setVisibleInWhoisAsAdmin(false)
|
.setVisibleInWhoisAsAdmin(false)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInWhoisAsTech(true)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Jane Doe")
|
.setName("Jane Doe")
|
||||||
.setEmailAddress("janedoe@example.com")
|
.setEmailAddress("janedoe@example.com")
|
||||||
.setPhoneNumber("+1.2125551215")
|
.setPhoneNumber("+1.2125551215")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH, RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH, RegistrarPoc.Type.ADMIN))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInWhoisAsTech(false)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Play Doe")
|
.setName("Play Doe")
|
||||||
.setEmailAddress("playdoe@example.com")
|
.setEmailAddress("playdoe@example.com")
|
||||||
.setPhoneNumber("+1.2125551217")
|
.setPhoneNumber("+1.2125551217")
|
||||||
.setFaxNumber("+1.2125551218")
|
.setFaxNumber("+1.2125551218")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.BILLING))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.BILLING))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInWhoisAsTech(true)
|
||||||
.build());
|
.build());
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
package google.registry.schema.registrar;
|
package google.registry.schema.registrar;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.WHOIS;
|
import static google.registry.model.registrar.RegistrarPoc.Type.WHOIS;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.jpaTm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.jpaTm;
|
||||||
import static google.registry.testing.DatabaseHelper.insertInDb;
|
import static google.registry.testing.DatabaseHelper.insertInDb;
|
||||||
import static google.registry.testing.DatabaseHelper.loadByEntity;
|
import static google.registry.testing.DatabaseHelper.loadByEntity;
|
||||||
|
@ -23,7 +23,7 @@ import static google.registry.testing.SqlHelper.saveRegistrar;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.persistence.transaction.JpaTestExtensions;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationWithCoverageExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationWithCoverageExtension;
|
||||||
import google.registry.testing.DatastoreEntityExtension;
|
import google.registry.testing.DatastoreEntityExtension;
|
||||||
|
@ -33,8 +33,8 @@ import org.junit.jupiter.api.Order;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for persisting {@link RegistrarContact} entities. */
|
/** Unit tests for persisting {@link RegistrarPoc} entities. */
|
||||||
class RegistrarContactTest {
|
class RegistrarPocTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
@Order(value = 1)
|
@Order(value = 1)
|
||||||
|
@ -46,14 +46,14 @@ class RegistrarContactTest {
|
||||||
|
|
||||||
private Registrar testRegistrar;
|
private Registrar testRegistrar;
|
||||||
|
|
||||||
private RegistrarContact testRegistrarPoc;
|
private RegistrarPoc testRegistrarPoc;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void beforeEach() {
|
public void beforeEach() {
|
||||||
testRegistrar = saveRegistrar("registrarId");
|
testRegistrar = saveRegistrar("registrarId");
|
||||||
testRegistrarPoc =
|
testRegistrarPoc =
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(testRegistrar)
|
.setRegistrar(testRegistrar)
|
||||||
.setName("Judith Registrar")
|
.setName("Judith Registrar")
|
||||||
.setEmailAddress("judith.doe@example.com")
|
.setEmailAddress("judith.doe@example.com")
|
||||||
.setRegistryLockEmailAddress("judith.doe@external.com")
|
.setRegistryLockEmailAddress("judith.doe@external.com")
|
||||||
|
@ -75,7 +75,7 @@ class RegistrarContactTest {
|
||||||
@Test
|
@Test
|
||||||
void testSerializable_succeeds() {
|
void testSerializable_succeeds() {
|
||||||
insertInDb(testRegistrarPoc);
|
insertInDb(testRegistrarPoc);
|
||||||
RegistrarContact persisted = jpaTm().transact(() -> jpaTm().loadByEntity(testRegistrarPoc));
|
RegistrarPoc persisted = jpaTm().transact(() -> jpaTm().loadByEntity(testRegistrarPoc));
|
||||||
assertThat(SerializeUtils.serializeDeserialize(persisted)).isEqualTo(persisted);
|
assertThat(SerializeUtils.serializeDeserialize(persisted)).isEqualTo(persisted);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -49,7 +49,7 @@ import google.registry.model.ofy.ObjectifyService;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.Registrar.State;
|
import google.registry.model.registrar.Registrar.State;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.persistence.transaction.JpaTestExtensions;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationWithCoverageExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationWithCoverageExtension;
|
||||||
|
@ -326,15 +326,15 @@ public final class AppEngineExtension implements BeforeEachCallback, AfterEachCa
|
||||||
* Public factory for first RegistrarContact to allow comparison against stored value in unit
|
* Public factory for first RegistrarContact to allow comparison against stored value in unit
|
||||||
* tests.
|
* tests.
|
||||||
*/
|
*/
|
||||||
public static RegistrarContact makeRegistrarContact1() {
|
public static RegistrarPoc makeRegistrarContact1() {
|
||||||
return new RegistrarContact.Builder()
|
return new RegistrarPoc.Builder()
|
||||||
.setParent(makeRegistrar1())
|
.setRegistrar(makeRegistrar1())
|
||||||
.setName("Jane Doe")
|
.setName("Jane Doe")
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInWhoisAsTech(false)
|
||||||
.setEmailAddress("janedoe@theregistrar.com")
|
.setEmailAddress("janedoe@theregistrar.com")
|
||||||
.setPhoneNumber("+1.1234567890")
|
.setPhoneNumber("+1.1234567890")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,25 +342,25 @@ public final class AppEngineExtension implements BeforeEachCallback, AfterEachCa
|
||||||
* Public factory for second RegistrarContact to allow comparison against stored value in unit
|
* Public factory for second RegistrarContact to allow comparison against stored value in unit
|
||||||
* tests.
|
* tests.
|
||||||
*/
|
*/
|
||||||
public static RegistrarContact makeRegistrarContact2() {
|
public static RegistrarPoc makeRegistrarContact2() {
|
||||||
return new RegistrarContact.Builder()
|
return new RegistrarPoc.Builder()
|
||||||
.setParent(makeRegistrar2())
|
.setRegistrar(makeRegistrar2())
|
||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("johndoe@theregistrar.com")
|
.setEmailAddress("johndoe@theregistrar.com")
|
||||||
.setPhoneNumber("+1.1234567890")
|
.setPhoneNumber("+1.1234567890")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.setGaeUserId(THE_REGISTRAR_GAE_USER_ID)
|
.setGaeUserId(THE_REGISTRAR_GAE_USER_ID)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RegistrarContact makeRegistrarContact3() {
|
public static RegistrarPoc makeRegistrarContact3() {
|
||||||
return new RegistrarContact.Builder()
|
return new RegistrarPoc.Builder()
|
||||||
.setParent(makeRegistrar2())
|
.setRegistrar(makeRegistrar2())
|
||||||
.setName("Marla Singer")
|
.setName("Marla Singer")
|
||||||
.setEmailAddress("Marla.Singer@crr.com")
|
.setEmailAddress("Marla.Singer@crr.com")
|
||||||
.setRegistryLockEmailAddress("Marla.Singer.RegistryLock@crr.com")
|
.setRegistryLockEmailAddress("Marla.Singer.RegistryLock@crr.com")
|
||||||
.setPhoneNumber("+1.2128675309")
|
.setPhoneNumber("+1.2128675309")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
.setGaeUserId(MARLA_SINGER_GAE_USER_ID)
|
.setGaeUserId(MARLA_SINGER_GAE_USER_ID)
|
||||||
.setAllowedToSetRegistryLockPassword(true)
|
.setAllowedToSetRegistryLockPassword(true)
|
||||||
.setRegistryLockPassword("hi")
|
.setRegistryLockPassword("hi")
|
||||||
|
|
|
@ -37,7 +37,7 @@ import google.registry.model.eppcommon.Trid;
|
||||||
import google.registry.model.host.HostResource;
|
import google.registry.model.host.HostResource;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.util.Idn;
|
import google.registry.util.Idn;
|
||||||
|
@ -89,34 +89,34 @@ public final class FullFieldsTestEntityHelper {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImmutableList<RegistrarContact> makeRegistrarContacts(Registrar registrar) {
|
public static ImmutableList<RegistrarPoc> makeRegistrarContacts(Registrar registrar) {
|
||||||
return ImmutableList.of(
|
return ImmutableList.of(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("johndoe@example.com")
|
.setEmailAddress("johndoe@example.com")
|
||||||
.setPhoneNumber("+1.2125551213")
|
.setPhoneNumber("+1.2125551213")
|
||||||
.setFaxNumber("+1.2125551213")
|
.setFaxNumber("+1.2125551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
// Purposely flip the internal/external admin/tech
|
// Purposely flip the internal/external admin/tech
|
||||||
// distinction to make sure we're not relying on it. Sigh.
|
// distinction to make sure we're not relying on it. Sigh.
|
||||||
.setVisibleInWhoisAsAdmin(false)
|
.setVisibleInWhoisAsAdmin(false)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInWhoisAsTech(true)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Jane Doe")
|
.setName("Jane Doe")
|
||||||
.setEmailAddress("janedoe@example.com")
|
.setEmailAddress("janedoe@example.com")
|
||||||
.setPhoneNumber("+1.2125551215")
|
.setPhoneNumber("+1.2125551215")
|
||||||
.setFaxNumber("+1.2125551216")
|
.setFaxNumber("+1.2125551216")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
// Purposely flip the internal/external admin/tech
|
// Purposely flip the internal/external admin/tech
|
||||||
// distinction to make sure we're not relying on it. Sigh.
|
// distinction to make sure we're not relying on it. Sigh.
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInWhoisAsTech(false)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Jake Doe")
|
.setName("Jake Doe")
|
||||||
.setEmailAddress("jakedoe@example.com")
|
.setEmailAddress("jakedoe@example.com")
|
||||||
.setPhoneNumber("+1.2125551216")
|
.setPhoneNumber("+1.2125551216")
|
||||||
|
|
|
@ -15,10 +15,10 @@
|
||||||
package google.registry.tools;
|
package google.registry.tools;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.ABUSE;
|
import static google.registry.model.registrar.RegistrarPoc.Type.ABUSE;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.ADMIN;
|
import static google.registry.model.registrar.RegistrarPoc.Type.ADMIN;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.TECH;
|
import static google.registry.model.registrar.RegistrarPoc.Type.TECH;
|
||||||
import static google.registry.model.registrar.RegistrarContact.Type.WHOIS;
|
import static google.registry.model.registrar.RegistrarPoc.Type.WHOIS;
|
||||||
import static google.registry.testing.DatabaseHelper.loadRegistrar;
|
import static google.registry.testing.DatabaseHelper.loadRegistrar;
|
||||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||||
import static google.registry.testing.DatabaseHelper.persistSimpleResource;
|
import static google.registry.testing.DatabaseHelper.persistSimpleResource;
|
||||||
|
@ -30,14 +30,14 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
/** Unit tests for {@link RegistrarContactCommand}. */
|
/** Unit tests for {@link RegistrarPocCommand}. */
|
||||||
class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactCommand> {
|
class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
||||||
|
|
||||||
private String output;
|
private String output;
|
||||||
|
|
||||||
|
@ -49,11 +49,11 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
@Test
|
@Test
|
||||||
void testList() throws Exception {
|
void testList() throws Exception {
|
||||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||||
RegistrarContact.updateContacts(
|
RegistrarPoc.updateContacts(
|
||||||
registrar,
|
registrar,
|
||||||
ImmutableSet.of(
|
ImmutableSet.of(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("john.doe@example.com")
|
.setEmailAddress("john.doe@example.com")
|
||||||
.setTypes(ImmutableSet.of(ADMIN))
|
.setTypes(ImmutableSet.of(ADMIN))
|
||||||
|
@ -75,16 +75,17 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
@Test
|
@Test
|
||||||
void testUpdate() throws Exception {
|
void testUpdate() throws Exception {
|
||||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||||
ImmutableList<RegistrarContact> contacts = ImmutableList.of(
|
ImmutableList<RegistrarPoc> contacts =
|
||||||
new RegistrarContact.Builder()
|
ImmutableList.of(
|
||||||
.setParent(registrar)
|
new RegistrarPoc.Builder()
|
||||||
.setName("Judith Doe")
|
.setRegistrar(registrar)
|
||||||
.setEmailAddress("judith.doe@example.com")
|
.setName("Judith Doe")
|
||||||
.setTypes(ImmutableSet.of(WHOIS))
|
.setEmailAddress("judith.doe@example.com")
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setTypes(ImmutableSet.of(WHOIS))
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInDomainWhoisAsAbuse(false)
|
.setVisibleInWhoisAsTech(true)
|
||||||
.build());
|
.setVisibleInDomainWhoisAsAbuse(false)
|
||||||
|
.build());
|
||||||
persistSimpleResources(contacts);
|
persistSimpleResources(contacts);
|
||||||
runCommandForced(
|
runCommandForced(
|
||||||
"--mode=UPDATE",
|
"--mode=UPDATE",
|
||||||
|
@ -98,11 +99,11 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
"--visible_in_whois_as_tech=false",
|
"--visible_in_whois_as_tech=false",
|
||||||
"--visible_in_domain_whois_as_abuse=false",
|
"--visible_in_domain_whois_as_abuse=false",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
assertThat(registrarContact)
|
assertThat(registrarPoc)
|
||||||
.isEqualTo(
|
.isEqualTo(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Judith Registrar")
|
.setName("Judith Registrar")
|
||||||
.setEmailAddress("judith.doe@example.com")
|
.setEmailAddress("judith.doe@example.com")
|
||||||
.setRegistryLockEmailAddress("judith.doe@external.com")
|
.setRegistryLockEmailAddress("judith.doe@external.com")
|
||||||
|
@ -119,8 +120,8 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
void testUpdate_enableConsoleAccess() throws Exception {
|
void testUpdate_enableConsoleAccess() throws Exception {
|
||||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||||
persistSimpleResource(
|
persistSimpleResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Jane Doe")
|
.setName("Jane Doe")
|
||||||
.setEmailAddress("jane.doe@example.com")
|
.setEmailAddress("jane.doe@example.com")
|
||||||
.build());
|
.build());
|
||||||
|
@ -129,20 +130,20 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
"--email=jane.doe@example.com",
|
"--email=jane.doe@example.com",
|
||||||
"--allow_console_access=true",
|
"--allow_console_access=true",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
RegistrarContact registrarContact =
|
RegistrarPoc registrarPoc =
|
||||||
loadRegistrar("NewRegistrar").getContacts().stream()
|
loadRegistrar("NewRegistrar").getContacts().stream()
|
||||||
.filter(rc -> rc.getEmailAddress().equals("jane.doe@example.com"))
|
.filter(rc -> rc.getEmailAddress().equals("jane.doe@example.com"))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.get();
|
.get();
|
||||||
assertThat(registrarContact.getGaeUserId()).matches("-?[0-9]+");
|
assertThat(registrarPoc.getGaeUserId()).matches("-?[0-9]+");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testUpdate_disableConsoleAccess() throws Exception {
|
void testUpdate_disableConsoleAccess() throws Exception {
|
||||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||||
persistSimpleResource(
|
persistSimpleResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Judith Doe")
|
.setName("Judith Doe")
|
||||||
.setEmailAddress("judith.doe@example.com")
|
.setEmailAddress("judith.doe@example.com")
|
||||||
.setGaeUserId("11111")
|
.setGaeUserId("11111")
|
||||||
|
@ -152,23 +153,23 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
"--email=judith.doe@example.com",
|
"--email=judith.doe@example.com",
|
||||||
"--allow_console_access=false",
|
"--allow_console_access=false",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
assertThat(registrarContact.getGaeUserId()).isNull();
|
assertThat(registrarPoc.getGaeUserId()).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testUpdate_unsetOtherWhoisAbuseFlags() throws Exception {
|
void testUpdate_unsetOtherWhoisAbuseFlags() throws Exception {
|
||||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||||
persistSimpleResource(
|
persistSimpleResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("john.doe@example.com")
|
.setEmailAddress("john.doe@example.com")
|
||||||
.setGaeUserId("11111")
|
.setGaeUserId("11111")
|
||||||
.build());
|
.build());
|
||||||
persistSimpleResource(
|
persistSimpleResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Johnna Doe")
|
.setName("Johnna Doe")
|
||||||
.setEmailAddress("johnna.doe@example.com")
|
.setEmailAddress("johnna.doe@example.com")
|
||||||
.setGaeUserId("11112")
|
.setGaeUserId("11112")
|
||||||
|
@ -179,13 +180,13 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
"--email=john.doe@example.com",
|
"--email=john.doe@example.com",
|
||||||
"--visible_in_domain_whois_as_abuse=true",
|
"--visible_in_domain_whois_as_abuse=true",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
ImmutableList<RegistrarContact> registrarContacts =
|
ImmutableList<RegistrarPoc> registrarPocs =
|
||||||
loadRegistrar("NewRegistrar").getContacts().asList();
|
loadRegistrar("NewRegistrar").getContacts().asList();
|
||||||
for (RegistrarContact registrarContact : registrarContacts) {
|
for (RegistrarPoc registrarPoc : registrarPocs) {
|
||||||
if (registrarContact.getName().equals("John Doe")) {
|
if (registrarPoc.getName().equals("John Doe")) {
|
||||||
assertThat(registrarContact.getVisibleInDomainWhoisAsAbuse()).isTrue();
|
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse()).isTrue();
|
||||||
} else {
|
} else {
|
||||||
assertThat(registrarContact.getVisibleInDomainWhoisAsAbuse()).isFalse();
|
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse()).isFalse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -194,8 +195,8 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
void testUpdate_cannotUnsetOnlyWhoisAbuseContact() {
|
void testUpdate_cannotUnsetOnlyWhoisAbuseContact() {
|
||||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||||
persistSimpleResource(
|
persistSimpleResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("john.doe@example.com")
|
.setEmailAddress("john.doe@example.com")
|
||||||
.setGaeUserId("11111")
|
.setGaeUserId("11111")
|
||||||
|
@ -213,39 +214,40 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
assertThat(thrown)
|
assertThat(thrown)
|
||||||
.hasMessageThat()
|
.hasMessageThat()
|
||||||
.contains("Cannot clear visible_in_domain_whois_as_abuse flag");
|
.contains("Cannot clear visible_in_domain_whois_as_abuse flag");
|
||||||
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
assertThat(registrarContact.getVisibleInDomainWhoisAsAbuse()).isTrue();
|
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testUpdate_emptyCommandModifiesNothing() throws Exception {
|
void testUpdate_emptyCommandModifiesNothing() throws Exception {
|
||||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||||
RegistrarContact existingContact = persistSimpleResource(
|
RegistrarPoc existingContact =
|
||||||
new RegistrarContact.Builder()
|
persistSimpleResource(
|
||||||
.setParent(registrar)
|
new RegistrarPoc.Builder()
|
||||||
.setName("John Doe")
|
.setRegistrar(registrar)
|
||||||
.setEmailAddress("john.doe@example.com")
|
.setName("John Doe")
|
||||||
.setGaeUserId("11111")
|
.setEmailAddress("john.doe@example.com")
|
||||||
.setPhoneNumber("123-456-7890")
|
.setGaeUserId("11111")
|
||||||
.setFaxNumber("123-456-7890")
|
.setPhoneNumber("123-456-7890")
|
||||||
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
|
.setFaxNumber("123-456-7890")
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setVisibleInWhoisAsTech(true)
|
||||||
.build());
|
.setVisibleInDomainWhoisAsAbuse(true)
|
||||||
|
.build());
|
||||||
runCommandForced("--mode=UPDATE", "--email=john.doe@example.com", "NewRegistrar");
|
runCommandForced("--mode=UPDATE", "--email=john.doe@example.com", "NewRegistrar");
|
||||||
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
assertThat(registrarContact.getEmailAddress()).isEqualTo(existingContact.getEmailAddress());
|
assertThat(registrarPoc.getEmailAddress()).isEqualTo(existingContact.getEmailAddress());
|
||||||
assertThat(registrarContact.getName()).isEqualTo(existingContact.getName());
|
assertThat(registrarPoc.getName()).isEqualTo(existingContact.getName());
|
||||||
assertThat(registrarContact.getGaeUserId()).isEqualTo(existingContact.getGaeUserId());
|
assertThat(registrarPoc.getGaeUserId()).isEqualTo(existingContact.getGaeUserId());
|
||||||
assertThat(registrarContact.getPhoneNumber()).isEqualTo(existingContact.getPhoneNumber());
|
assertThat(registrarPoc.getPhoneNumber()).isEqualTo(existingContact.getPhoneNumber());
|
||||||
assertThat(registrarContact.getFaxNumber()).isEqualTo(existingContact.getFaxNumber());
|
assertThat(registrarPoc.getFaxNumber()).isEqualTo(existingContact.getFaxNumber());
|
||||||
assertThat(registrarContact.getTypes()).isEqualTo(existingContact.getTypes());
|
assertThat(registrarPoc.getTypes()).isEqualTo(existingContact.getTypes());
|
||||||
assertThat(registrarContact.getVisibleInWhoisAsAdmin())
|
assertThat(registrarPoc.getVisibleInWhoisAsAdmin())
|
||||||
.isEqualTo(existingContact.getVisibleInWhoisAsAdmin());
|
.isEqualTo(existingContact.getVisibleInWhoisAsAdmin());
|
||||||
assertThat(registrarContact.getVisibleInWhoisAsTech())
|
assertThat(registrarPoc.getVisibleInWhoisAsTech())
|
||||||
.isEqualTo(existingContact.getVisibleInWhoisAsTech());
|
.isEqualTo(existingContact.getVisibleInWhoisAsTech());
|
||||||
assertThat(registrarContact.getVisibleInDomainWhoisAsAbuse())
|
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse())
|
||||||
.isEqualTo(existingContact.getVisibleInDomainWhoisAsAbuse());
|
.isEqualTo(existingContact.getVisibleInDomainWhoisAsAbuse());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,8 +255,8 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
void testUpdate_listOfTypesWorks() throws Exception {
|
void testUpdate_listOfTypesWorks() throws Exception {
|
||||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||||
persistSimpleResource(
|
persistSimpleResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("john.doe@example.com")
|
.setEmailAddress("john.doe@example.com")
|
||||||
.setGaeUserId("11111")
|
.setGaeUserId("11111")
|
||||||
|
@ -270,16 +272,16 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
"--email=john.doe@example.com",
|
"--email=john.doe@example.com",
|
||||||
"--contact_type=ADMIN,TECH",
|
"--contact_type=ADMIN,TECH",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
assertThat(registrarContact.getTypes()).containsExactly(ADMIN, TECH);
|
assertThat(registrarPoc.getTypes()).containsExactly(ADMIN, TECH);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testUpdate_clearAllTypes() throws Exception {
|
void testUpdate_clearAllTypes() throws Exception {
|
||||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||||
persistSimpleResource(
|
persistSimpleResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("john.doe@example.com")
|
.setEmailAddress("john.doe@example.com")
|
||||||
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
|
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
|
||||||
|
@ -289,8 +291,8 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
"--email=john.doe@example.com",
|
"--email=john.doe@example.com",
|
||||||
"--contact_type=",
|
"--contact_type=",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
assertThat(registrarContact.getTypes()).isEmpty();
|
assertThat(registrarPoc.getTypes()).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -306,11 +308,11 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
"--visible_in_whois_as_tech=false",
|
"--visible_in_whois_as_tech=false",
|
||||||
"--visible_in_domain_whois_as_abuse=true",
|
"--visible_in_domain_whois_as_abuse=true",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
assertThat(registrarContact)
|
assertThat(registrarPoc)
|
||||||
.isEqualTo(
|
.isEqualTo(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Jim Doe")
|
.setName("Jim Doe")
|
||||||
.setEmailAddress("jim.doe@example.com")
|
.setEmailAddress("jim.doe@example.com")
|
||||||
.setRegistryLockEmailAddress("jim.doe@external.com")
|
.setRegistryLockEmailAddress("jim.doe@external.com")
|
||||||
|
@ -319,7 +321,7 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInWhoisAsTech(false)
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setVisibleInDomainWhoisAsAbuse(true)
|
||||||
.build());
|
.build());
|
||||||
assertThat(registrarContact.getGaeUserId()).isNull();
|
assertThat(registrarPoc.getGaeUserId()).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -334,8 +336,8 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testDelete_failsOnDomainWhoisAbuseContact() {
|
void testDelete_failsOnDomainWhoisAbuseContact() {
|
||||||
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(0);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(0);
|
||||||
putInDb(registrarContact.asBuilder().setVisibleInDomainWhoisAsAbuse(true).build());
|
putInDb(registrarPoc.asBuilder().setVisibleInDomainWhoisAsAbuse(true).build());
|
||||||
IllegalArgumentException thrown =
|
IllegalArgumentException thrown =
|
||||||
assertThrows(
|
assertThrows(
|
||||||
IllegalArgumentException.class,
|
IllegalArgumentException.class,
|
||||||
|
@ -355,16 +357,16 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
"--allow_console_access=true",
|
"--allow_console_access=true",
|
||||||
"--contact_type=ADMIN,ABUSE",
|
"--contact_type=ADMIN,ABUSE",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
assertThat(registrarContact.getGaeUserId()).matches("-?[0-9]+");
|
assertThat(registrarPoc.getGaeUserId()).matches("-?[0-9]+");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testCreate_withNoContactTypes() throws Exception {
|
void testCreate_withNoContactTypes() throws Exception {
|
||||||
runCommandForced(
|
runCommandForced(
|
||||||
"--mode=CREATE", "--name=Jim Doe", "--email=jim.doe@example.com", "NewRegistrar");
|
"--mode=CREATE", "--name=Jim Doe", "--email=jim.doe@example.com", "NewRegistrar");
|
||||||
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
assertThat(registrarContact.getTypes()).isEmpty();
|
assertThat(registrarPoc.getTypes()).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -387,27 +389,27 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
"--registry_lock_email=jim.doe.registry.lock@example.com",
|
"--registry_lock_email=jim.doe.registry.lock@example.com",
|
||||||
"--allowed_to_set_registry_lock_password=true",
|
"--allowed_to_set_registry_lock_password=true",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
assertThat(registrarContact.isAllowedToSetRegistryLockPassword()).isTrue();
|
assertThat(registrarPoc.isAllowedToSetRegistryLockPassword()).isTrue();
|
||||||
registrarContact.asBuilder().setRegistryLockPassword("foo");
|
registrarPoc.asBuilder().setRegistryLockPassword("foo");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testUpdate_setAllowedToSetRegistryLockPassword() throws Exception {
|
void testUpdate_setAllowedToSetRegistryLockPassword() throws Exception {
|
||||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||||
RegistrarContact registrarContact =
|
RegistrarPoc registrarPoc =
|
||||||
persistSimpleResource(
|
persistSimpleResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Jim Doe")
|
.setName("Jim Doe")
|
||||||
.setEmailAddress("jim.doe@example.com")
|
.setEmailAddress("jim.doe@example.com")
|
||||||
.build());
|
.build());
|
||||||
assertThat(registrarContact.isAllowedToSetRegistryLockPassword()).isFalse();
|
assertThat(registrarPoc.isAllowedToSetRegistryLockPassword()).isFalse();
|
||||||
|
|
||||||
// First, try (and fail) to set the password directly
|
// First, try (and fail) to set the password directly
|
||||||
assertThrows(
|
assertThrows(
|
||||||
IllegalArgumentException.class,
|
IllegalArgumentException.class,
|
||||||
() -> registrarContact.asBuilder().setRegistryLockPassword("foo"));
|
() -> registrarPoc.asBuilder().setRegistryLockPassword("foo"));
|
||||||
|
|
||||||
// Next, try (and fail) to allow registry lock without a registry lock email
|
// Next, try (and fail) to allow registry lock without a registry lock email
|
||||||
assertThat(
|
assertThat(
|
||||||
|
@ -429,7 +431,7 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
"--registry_lock_email=jim.doe.registry.lock@example.com",
|
"--registry_lock_email=jim.doe.registry.lock@example.com",
|
||||||
"--allowed_to_set_registry_lock_password=true",
|
"--allowed_to_set_registry_lock_password=true",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
RegistrarContact newContact = reloadResource(registrarContact);
|
RegistrarPoc newContact = reloadResource(registrarPoc);
|
||||||
assertThat(newContact.isAllowedToSetRegistryLockPassword()).isTrue();
|
assertThat(newContact.isAllowedToSetRegistryLockPassword()).isTrue();
|
||||||
// should be allowed to set the password now
|
// should be allowed to set the password now
|
||||||
newContact.asBuilder().setRegistryLockPassword("foo");
|
newContact.asBuilder().setRegistryLockPassword("foo");
|
||||||
|
@ -438,25 +440,25 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
|
||||||
@Test
|
@Test
|
||||||
void testUpdate_setAllowedToSetRegistryLockPassword_removesOldPassword() throws Exception {
|
void testUpdate_setAllowedToSetRegistryLockPassword_removesOldPassword() throws Exception {
|
||||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||||
RegistrarContact registrarContact =
|
RegistrarPoc registrarPoc =
|
||||||
persistSimpleResource(
|
persistSimpleResource(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Jim Doe")
|
.setName("Jim Doe")
|
||||||
.setEmailAddress("jim.doe@example.com")
|
.setEmailAddress("jim.doe@example.com")
|
||||||
.setRegistryLockEmailAddress("jim.doe.registry.lock@example.com")
|
.setRegistryLockEmailAddress("jim.doe.registry.lock@example.com")
|
||||||
.setAllowedToSetRegistryLockPassword(true)
|
.setAllowedToSetRegistryLockPassword(true)
|
||||||
.setRegistryLockPassword("hi")
|
.setRegistryLockPassword("hi")
|
||||||
.build());
|
.build());
|
||||||
assertThat(registrarContact.verifyRegistryLockPassword("hi")).isTrue();
|
assertThat(registrarPoc.verifyRegistryLockPassword("hi")).isTrue();
|
||||||
assertThat(registrarContact.verifyRegistryLockPassword("hello")).isFalse();
|
assertThat(registrarPoc.verifyRegistryLockPassword("hello")).isFalse();
|
||||||
runCommandForced(
|
runCommandForced(
|
||||||
"--mode=UPDATE",
|
"--mode=UPDATE",
|
||||||
"--email=jim.doe@example.com",
|
"--email=jim.doe@example.com",
|
||||||
"--allowed_to_set_registry_lock_password=true",
|
"--allowed_to_set_registry_lock_password=true",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
registrarContact = reloadResource(registrarContact);
|
registrarPoc = reloadResource(registrarPoc);
|
||||||
assertThat(registrarContact.verifyRegistryLockPassword("hi")).isFalse();
|
assertThat(registrarPoc.verifyRegistryLockPassword("hi")).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
|
@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.ImmutableSortedMap;
|
import com.google.common.collect.ImmutableSortedMap;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.Registry.TldState;
|
import google.registry.model.tld.Registry.TldState;
|
||||||
import google.registry.testing.DeterministicStringGenerator;
|
import google.registry.testing.DeterministicStringGenerator;
|
||||||
|
@ -109,13 +109,12 @@ class SetupOteCommandTest extends CommandTestCase<SetupOteCommand> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void verifyRegistrarContactCreation(String registrarName, String email) {
|
private void verifyRegistrarContactCreation(String registrarName, String email) {
|
||||||
ImmutableSet<RegistrarContact> registrarContacts =
|
ImmutableSet<RegistrarPoc> registrarPocs = loadRegistrar(registrarName).getContacts();
|
||||||
loadRegistrar(registrarName).getContacts();
|
assertThat(registrarPocs).hasSize(1);
|
||||||
assertThat(registrarContacts).hasSize(1);
|
RegistrarPoc registrarPoc = registrarPocs.stream().findAny().get();
|
||||||
RegistrarContact registrarContact = registrarContacts.stream().findAny().get();
|
assertThat(registrarPoc.getEmailAddress()).isEqualTo(email);
|
||||||
assertThat(registrarContact.getEmailAddress()).isEqualTo(email);
|
assertThat(registrarPoc.getName()).isEqualTo(email);
|
||||||
assertThat(registrarContact.getName()).isEqualTo(email);
|
assertThat(registrarPoc.getGaeUserId()).isNotNull();
|
||||||
assertThat(registrarContact.getGaeUserId()).isNotNull();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableSetMultimap;
|
||||||
import google.registry.config.RegistryEnvironment;
|
import google.registry.config.RegistryEnvironment;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.request.Action.Method;
|
import google.registry.request.Action.Method;
|
||||||
import google.registry.request.auth.AuthLevel;
|
import google.registry.request.auth.AuthLevel;
|
||||||
import google.registry.request.auth.AuthResult;
|
import google.registry.request.auth.AuthResult;
|
||||||
|
@ -218,8 +218,8 @@ final class ConsoleRegistrarCreatorActionTest {
|
||||||
|
|
||||||
assertThat(registrar.getContacts())
|
assertThat(registrar.getContacts())
|
||||||
.containsExactly(
|
.containsExactly(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setGaeUserId("-1509175207")
|
.setGaeUserId("-1509175207")
|
||||||
.setGaeUserId(convertEmailAddressToGaeUserId("myclientid@registry.example"))
|
.setGaeUserId(convertEmailAddressToGaeUserId("myclientid@registry.example"))
|
||||||
.setName("myclientid@registry.example")
|
.setName("myclientid@registry.example")
|
||||||
|
|
|
@ -23,8 +23,8 @@ import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.registrar.RegistrarContact.Type;
|
import google.registry.model.registrar.RegistrarPoc.Type;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.testing.AppEngineExtension;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -80,8 +80,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
|
||||||
action.handleJsonRequest(ImmutableMap.of("op", "update", "id", CLIENT_ID, "args", regMap));
|
action.handleJsonRequest(ImmutableMap.of("op", "update", "id", CLIENT_ID, "args", regMap));
|
||||||
assertThat(response).containsEntry("status", "SUCCESS");
|
assertThat(response).containsEntry("status", "SUCCESS");
|
||||||
|
|
||||||
RegistrarContact foundContact =
|
RegistrarPoc foundContact = Iterables.getOnlyElement(loadRegistrar(CLIENT_ID).getContacts());
|
||||||
Iterables.getOnlyElement(loadRegistrar(CLIENT_ID).getContacts());
|
|
||||||
assertThat(foundContact.getName()).isEqualTo(adminContact.get("name"));
|
assertThat(foundContact.getName()).isEqualTo(adminContact.get("name"));
|
||||||
assertThat(foundContact.getEmailAddress()).isEqualTo(adminContact.get("emailAddress"));
|
assertThat(foundContact.getEmailAddress()).isEqualTo(adminContact.get("emailAddress"));
|
||||||
assertThat(foundContact.getPhoneNumber()).isEqualTo(adminContact.get("phoneNumber"));
|
assertThat(foundContact.getPhoneNumber()).isEqualTo(adminContact.get("phoneNumber"));
|
||||||
|
@ -130,7 +129,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
|
||||||
void testPost_updateContacts_cannotRemoveWhoisAbuseContact_error() {
|
void testPost_updateContacts_cannotRemoveWhoisAbuseContact_error() {
|
||||||
// First make the contact's info visible in whois as abuse contact info.
|
// First make the contact's info visible in whois as abuse contact info.
|
||||||
Registrar registrar = loadRegistrar(CLIENT_ID);
|
Registrar registrar = loadRegistrar(CLIENT_ID);
|
||||||
RegistrarContact rc =
|
RegistrarPoc rc =
|
||||||
AppEngineExtension.makeRegistrarContact2()
|
AppEngineExtension.makeRegistrarContact2()
|
||||||
.asBuilder()
|
.asBuilder()
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setVisibleInDomainWhoisAsAbuse(true)
|
||||||
|
@ -157,7 +156,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
|
||||||
void testPost_updateContacts_whoisAbuseContactMustHavePhoneNumber_error() {
|
void testPost_updateContacts_whoisAbuseContactMustHavePhoneNumber_error() {
|
||||||
// First make the contact's info visible in whois as abuse contact info.
|
// First make the contact's info visible in whois as abuse contact info.
|
||||||
Registrar registrar = loadRegistrar(CLIENT_ID);
|
Registrar registrar = loadRegistrar(CLIENT_ID);
|
||||||
RegistrarContact rc =
|
RegistrarPoc rc =
|
||||||
AppEngineExtension.makeRegistrarContact2()
|
AppEngineExtension.makeRegistrarContact2()
|
||||||
.asBuilder()
|
.asBuilder()
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setVisibleInDomainWhoisAsAbuse(true)
|
||||||
|
@ -184,7 +183,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
|
||||||
void testSuccess_setRegistryLockPassword() {
|
void testSuccess_setRegistryLockPassword() {
|
||||||
addPasswordToContactTwo();
|
addPasswordToContactTwo();
|
||||||
String emailAddress = AppEngineExtension.makeRegistrarContact2().getEmailAddress();
|
String emailAddress = AppEngineExtension.makeRegistrarContact2().getEmailAddress();
|
||||||
RegistrarContact newContactWithPassword =
|
RegistrarPoc newContactWithPassword =
|
||||||
loadRegistrar(CLIENT_ID).getContacts().stream()
|
loadRegistrar(CLIENT_ID).getContacts().stream()
|
||||||
.filter(rc -> rc.getEmailAddress().equals(emailAddress))
|
.filter(rc -> rc.getEmailAddress().equals(emailAddress))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
|
@ -197,7 +196,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
|
||||||
void testSuccess_setRegistryLockPassword_notOverriddenLater() {
|
void testSuccess_setRegistryLockPassword_notOverriddenLater() {
|
||||||
addPasswordToContactTwo();
|
addPasswordToContactTwo();
|
||||||
String emailAddress = AppEngineExtension.makeRegistrarContact2().getEmailAddress();
|
String emailAddress = AppEngineExtension.makeRegistrarContact2().getEmailAddress();
|
||||||
RegistrarContact newContactWithPassword =
|
RegistrarPoc newContactWithPassword =
|
||||||
loadRegistrar(CLIENT_ID).getContacts().stream()
|
loadRegistrar(CLIENT_ID).getContacts().stream()
|
||||||
.filter(rc -> rc.getEmailAddress().equals(emailAddress))
|
.filter(rc -> rc.getEmailAddress().equals(emailAddress))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
|
@ -226,7 +225,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addPasswordToContactTwo() {
|
private void addPasswordToContactTwo() {
|
||||||
RegistrarContact contact =
|
RegistrarPoc contact =
|
||||||
persistResource(
|
persistResource(
|
||||||
AppEngineExtension.makeRegistrarContact2()
|
AppEngineExtension.makeRegistrarContact2()
|
||||||
.asBuilder()
|
.asBuilder()
|
||||||
|
@ -331,7 +330,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
|
||||||
addPasswordToContactTwo();
|
addPasswordToContactTwo();
|
||||||
Map<String, Object> reqJson = loadRegistrar(CLIENT_ID).toJsonMap();
|
Map<String, Object> reqJson = loadRegistrar(CLIENT_ID).toJsonMap();
|
||||||
String emailAddress = AppEngineExtension.makeRegistrarContact2().getEmailAddress();
|
String emailAddress = AppEngineExtension.makeRegistrarContact2().getEmailAddress();
|
||||||
RegistrarContact newContactWithPassword =
|
RegistrarPoc newContactWithPassword =
|
||||||
loadRegistrar(CLIENT_ID).getContacts().stream()
|
loadRegistrar(CLIENT_ID).getContacts().stream()
|
||||||
.filter(rc -> rc.getEmailAddress().equals(emailAddress))
|
.filter(rc -> rc.getEmailAddress().equals(emailAddress))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
|
|
|
@ -37,7 +37,7 @@ import com.google.common.collect.ImmutableSortedMap;
|
||||||
import com.google.common.truth.Truth;
|
import com.google.common.truth.Truth;
|
||||||
import google.registry.flows.certs.CertificateChecker;
|
import google.registry.flows.certs.CertificateChecker;
|
||||||
import google.registry.model.ofy.Ofy;
|
import google.registry.model.ofy.Ofy;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.request.JsonActionRunner;
|
import google.registry.request.JsonActionRunner;
|
||||||
import google.registry.request.JsonResponse;
|
import google.registry.request.JsonResponse;
|
||||||
import google.registry.request.ResponseImpl;
|
import google.registry.request.ResponseImpl;
|
||||||
|
@ -94,7 +94,7 @@ public abstract class RegistrarSettingsActionTestCase {
|
||||||
final RegistrarSettingsAction action = new RegistrarSettingsAction();
|
final RegistrarSettingsAction action = new RegistrarSettingsAction();
|
||||||
private final StringWriter writer = new StringWriter();
|
private final StringWriter writer = new StringWriter();
|
||||||
|
|
||||||
RegistrarContact techContact;
|
RegistrarPoc techContact;
|
||||||
|
|
||||||
CloudTasksHelper cloudTasksHelper = new CloudTasksHelper();
|
CloudTasksHelper cloudTasksHelper = new CloudTasksHelper();
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ public abstract class RegistrarSettingsActionTestCase {
|
||||||
// Add a technical contact to the registrar (in addition to the default admin contact created by
|
// Add a technical contact to the registrar (in addition to the default admin contact created by
|
||||||
// AppEngineExtension).
|
// AppEngineExtension).
|
||||||
techContact =
|
techContact =
|
||||||
getOnlyElement(loadRegistrar(CLIENT_ID).getContactsOfType(RegistrarContact.Type.TECH));
|
getOnlyElement(loadRegistrar(CLIENT_ID).getContactsOfType(RegistrarPoc.Type.TECH));
|
||||||
|
|
||||||
action.registrarAccessor = null;
|
action.registrarAccessor = null;
|
||||||
action.jsonActionRunner =
|
action.jsonActionRunner =
|
||||||
|
|
|
@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.ImmutableSetMultimap;
|
import com.google.common.collect.ImmutableSetMultimap;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import google.registry.model.domain.RegistryLock;
|
import google.registry.model.domain.RegistryLock;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.request.Action.Method;
|
import google.registry.request.Action.Method;
|
||||||
import google.registry.request.auth.AuthLevel;
|
import google.registry.request.auth.AuthLevel;
|
||||||
import google.registry.request.auth.AuthResult;
|
import google.registry.request.auth.AuthResult;
|
||||||
|
@ -70,7 +70,7 @@ final class RegistryLockGetActionTest {
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void beforeEach() {
|
void beforeEach() {
|
||||||
user = userFromRegistrarContact(AppEngineExtension.makeRegistrarContact3());
|
user = userFromRegistrarPoc(AppEngineExtension.makeRegistrarContact3());
|
||||||
fakeClock.setTo(DateTime.parse("2000-06-08T22:00:00.0Z"));
|
fakeClock.setTo(DateTime.parse("2000-06-08T22:00:00.0Z"));
|
||||||
authResult = AuthResult.create(AuthLevel.USER, UserAuthInfo.create(user, false));
|
authResult = AuthResult.create(AuthLevel.USER, UserAuthInfo.create(user, false));
|
||||||
accessor =
|
accessor =
|
||||||
|
@ -356,8 +356,7 @@ final class RegistryLockGetActionTest {
|
||||||
assertThat(response.getStatus()).isEqualTo(SC_FORBIDDEN);
|
assertThat(response.getStatus()).isEqualTo(SC_FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
static User userFromRegistrarContact(RegistrarContact registrarContact) {
|
static User userFromRegistrarPoc(RegistrarPoc registrarPoc) {
|
||||||
return new User(
|
return new User(registrarPoc.getEmailAddress(), "gmail.com", registrarPoc.getGaeUserId());
|
||||||
registrarContact.getEmailAddress(), "gmail.com", registrarContact.getGaeUserId());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ import static google.registry.testing.SqlHelper.getMostRecentRegistryLockByRepoI
|
||||||
import static google.registry.testing.SqlHelper.getRegistryLockByVerificationCode;
|
import static google.registry.testing.SqlHelper.getRegistryLockByVerificationCode;
|
||||||
import static google.registry.testing.SqlHelper.saveRegistryLock;
|
import static google.registry.testing.SqlHelper.saveRegistryLock;
|
||||||
import static google.registry.tools.LockOrUnlockDomainCommand.REGISTRY_LOCK_STATUSES;
|
import static google.registry.tools.LockOrUnlockDomainCommand.REGISTRY_LOCK_STATUSES;
|
||||||
import static google.registry.ui.server.registrar.RegistryLockGetActionTest.userFromRegistrarContact;
|
import static google.registry.ui.server.registrar.RegistryLockGetActionTest.userFromRegistrarPoc;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
@ -99,8 +99,8 @@ final class RegistryLockPostActionTest {
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void beforeEach() throws Exception {
|
void beforeEach() throws Exception {
|
||||||
userWithLockPermission = userFromRegistrarContact(AppEngineExtension.makeRegistrarContact3());
|
userWithLockPermission = userFromRegistrarPoc(AppEngineExtension.makeRegistrarContact3());
|
||||||
userWithoutPermission = userFromRegistrarContact(AppEngineExtension.makeRegistrarContact2());
|
userWithoutPermission = userFromRegistrarPoc(AppEngineExtension.makeRegistrarContact2());
|
||||||
createTld("tld");
|
createTld("tld");
|
||||||
domain = persistResource(newDomainBase("example.tld"));
|
domain = persistResource(newDomainBase("example.tld"));
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ final class RegistryLockPostActionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testFailure_notEnabledForRegistrarContact() {
|
void testFailure_notEnabledForRegistrarPoc() {
|
||||||
action =
|
action =
|
||||||
createAction(
|
createAction(
|
||||||
AuthResult.create(AuthLevel.USER, UserAuthInfo.create(userWithoutPermission, false)));
|
AuthResult.create(AuthLevel.USER, UserAuthInfo.create(userWithoutPermission, false)));
|
||||||
|
|
|
@ -34,7 +34,7 @@ import google.registry.model.domain.DomainBase;
|
||||||
import google.registry.model.domain.RegistryLock;
|
import google.registry.model.domain.RegistryLock;
|
||||||
import google.registry.model.ofy.OfyFilter;
|
import google.registry.model.ofy.OfyFilter;
|
||||||
import google.registry.model.registrar.Registrar.State;
|
import google.registry.model.registrar.Registrar.State;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.module.frontend.FrontendServlet;
|
import google.registry.module.frontend.FrontendServlet;
|
||||||
import google.registry.server.RegistryTestServer;
|
import google.registry.server.RegistryTestServer;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.testing.AppEngineExtension;
|
||||||
|
@ -181,7 +181,7 @@ class RegistrarConsoleScreenshotTest extends WebDriverTestCase {
|
||||||
|
|
||||||
server.runInAppEngineEnvironment(
|
server.runInAppEngineEnvironment(
|
||||||
() -> {
|
() -> {
|
||||||
RegistrarContact contact =
|
RegistrarPoc contact =
|
||||||
loadRegistrar("TheRegistrar").getContacts().stream()
|
loadRegistrar("TheRegistrar").getContacts().stream()
|
||||||
.filter(c -> c.getEmailAddress().equals("johndoe@theregistrar.com"))
|
.filter(c -> c.getEmailAddress().equals("johndoe@theregistrar.com"))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
|
|
|
@ -25,7 +25,7 @@ import com.googlecode.objectify.ObjectifyFilter;
|
||||||
import google.registry.model.ofy.OfyFilter;
|
import google.registry.model.ofy.OfyFilter;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.module.frontend.FrontendServlet;
|
import google.registry.module.frontend.FrontendServlet;
|
||||||
import google.registry.server.RegistryTestServer;
|
import google.registry.server.RegistryTestServer;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
@ -179,10 +179,10 @@ public class RegistrarConsoleWebTest extends WebDriverTestCase {
|
||||||
void testContactSettingsView() throws Throwable {
|
void testContactSettingsView() throws Throwable {
|
||||||
driver.get(server.getUrl("/registrar#contact-settings"));
|
driver.get(server.getUrl("/registrar#contact-settings"));
|
||||||
driver.waitForDisplayedElement(By.id("reg-app-btn-add"));
|
driver.waitForDisplayedElement(By.id("reg-app-btn-add"));
|
||||||
ImmutableList<RegistrarContact> contacts =
|
ImmutableList<RegistrarPoc> contacts =
|
||||||
server.runInAppEngineEnvironment(
|
server.runInAppEngineEnvironment(
|
||||||
() -> loadRegistrar("TheRegistrar").getContacts().asList());
|
() -> loadRegistrar("TheRegistrar").getContacts().asList());
|
||||||
for (RegistrarContact contact : contacts) {
|
for (RegistrarPoc contact : contacts) {
|
||||||
assertEltTextPresent(By.id("contacts[0].name"), contact.getName());
|
assertEltTextPresent(By.id("contacts[0].name"), contact.getName());
|
||||||
assertEltTextPresent(By.id("contacts[0].emailAddress"), contact.getEmailAddress());
|
assertEltTextPresent(By.id("contacts[0].emailAddress"), contact.getEmailAddress());
|
||||||
assertEltTextPresent(By.id("contacts[0].phoneNumber"), contact.getPhoneNumber());
|
assertEltTextPresent(By.id("contacts[0].phoneNumber"), contact.getPhoneNumber());
|
||||||
|
|
|
@ -35,7 +35,7 @@ import google.registry.model.domain.secdns.DelegationSignerData;
|
||||||
import google.registry.model.eppcommon.StatusValue;
|
import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.host.HostResource;
|
import google.registry.model.host.HostResource;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.testing.AppEngineExtension;
|
||||||
import google.registry.testing.DualDatabaseTest;
|
import google.registry.testing.DualDatabaseTest;
|
||||||
|
@ -55,7 +55,7 @@ class DomainWhoisResponseTest {
|
||||||
|
|
||||||
private HostResource hostResource1;
|
private HostResource hostResource1;
|
||||||
private HostResource hostResource2;
|
private HostResource hostResource2;
|
||||||
private RegistrarContact abuseContact;
|
private RegistrarPoc abuseContact;
|
||||||
private ContactResource adminContact;
|
private ContactResource adminContact;
|
||||||
private ContactResource registrant;
|
private ContactResource registrant;
|
||||||
private ContactResource techContact;
|
private ContactResource techContact;
|
||||||
|
@ -74,14 +74,15 @@ class DomainWhoisResponseTest {
|
||||||
.setIanaIdentifier(5555555L)
|
.setIanaIdentifier(5555555L)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
abuseContact = persistResource(
|
abuseContact =
|
||||||
new RegistrarContact.Builder()
|
persistResource(
|
||||||
.setParent(registrar)
|
new RegistrarPoc.Builder()
|
||||||
.setName("Jake Doe")
|
.setRegistrar(registrar)
|
||||||
.setEmailAddress("jakedoe@theregistrar.com")
|
.setName("Jake Doe")
|
||||||
.setPhoneNumber("+1.2125551216")
|
.setEmailAddress("jakedoe@theregistrar.com")
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setPhoneNumber("+1.2125551216")
|
||||||
.build());
|
.setVisibleInDomainWhoisAsAbuse(true)
|
||||||
|
.build());
|
||||||
|
|
||||||
createTld("tld");
|
createTld("tld");
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarContact;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.testing.AppEngineExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.whois.WhoisResponse.WhoisResponseResults;
|
import google.registry.whois.WhoisResponse.WhoisResponseResults;
|
||||||
|
@ -64,50 +64,50 @@ class RegistrarWhoisResponseTest {
|
||||||
.setUrl("http://my.fake.url")
|
.setUrl("http://my.fake.url")
|
||||||
.build();
|
.build();
|
||||||
// Use the registrar key for contacts' parent.
|
// Use the registrar key for contacts' parent.
|
||||||
ImmutableList<RegistrarContact> contacts =
|
ImmutableList<RegistrarPoc> contacts =
|
||||||
ImmutableList.of(
|
ImmutableList.of(
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Joe Registrar")
|
.setName("Joe Registrar")
|
||||||
.setEmailAddress("joeregistrar@example-registrar.tld")
|
.setEmailAddress("joeregistrar@example-registrar.tld")
|
||||||
.setPhoneNumber("+1.3105551213")
|
.setPhoneNumber("+1.3105551213")
|
||||||
.setFaxNumber("+1.3105551213")
|
.setFaxNumber("+1.3105551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInWhoisAsTech(false)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("johndoe@example-registrar.tld")
|
.setEmailAddress("johndoe@example-registrar.tld")
|
||||||
.setPhoneNumber("+1.1111111111")
|
.setPhoneNumber("+1.1111111111")
|
||||||
.setFaxNumber("+1.1111111111")
|
.setFaxNumber("+1.1111111111")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Jane Registrar")
|
.setName("Jane Registrar")
|
||||||
.setEmailAddress("janeregistrar@example-registrar.tld")
|
.setEmailAddress("janeregistrar@example-registrar.tld")
|
||||||
.setPhoneNumber("+1.3105551214")
|
.setPhoneNumber("+1.3105551214")
|
||||||
.setFaxNumber("+1.3105551213")
|
.setFaxNumber("+1.3105551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInWhoisAsAdmin(true)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Jane Doe")
|
.setName("Jane Doe")
|
||||||
.setEmailAddress("janedoe@example-registrar.tld")
|
.setEmailAddress("janedoe@example-registrar.tld")
|
||||||
.setPhoneNumber("+1.1111111112")
|
.setPhoneNumber("+1.1111111112")
|
||||||
.setFaxNumber("+1.1111111112")
|
.setFaxNumber("+1.1111111112")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarContact.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setParent(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Bonnie & Clyde")
|
.setName("Bonnie & Clyde")
|
||||||
.setEmailAddress("johngeek@example-registrar.tld")
|
.setEmailAddress("johngeek@example-registrar.tld")
|
||||||
.setPhoneNumber("+1.3105551215")
|
.setPhoneNumber("+1.3105551215")
|
||||||
.setFaxNumber("+1.3105551216")
|
.setFaxNumber("+1.3105551216")
|
||||||
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInWhoisAsTech(true)
|
||||||
.build());
|
.build());
|
||||||
persistResource(registrar);
|
persistResource(registrar);
|
||||||
|
|
|
@ -17,5 +17,4 @@ PollMessage
|
||||||
RdeRevision
|
RdeRevision
|
||||||
Recurring
|
Recurring
|
||||||
Registrar
|
Registrar
|
||||||
RegistrarContact
|
|
||||||
Registry
|
Registry
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
Cursor
|
Cursor
|
||||||
Registrar
|
Registrar
|
||||||
RegistrarContact
|
|
||||||
Registry
|
Registry
|
||||||
ServerSecret
|
ServerSecret
|
||||||
|
|
|
@ -13,5 +13,4 @@ OneTime
|
||||||
PollMessage
|
PollMessage
|
||||||
Recurring
|
Recurring
|
||||||
Registrar
|
Registrar
|
||||||
RegistrarContact
|
|
||||||
Registry
|
Registry
|
||||||
|
|
|
@ -590,31 +590,6 @@ class google.registry.model.registrar.RegistrarAddress {
|
||||||
java.lang.String zip;
|
java.lang.String zip;
|
||||||
java.util.List<java.lang.String> street;
|
java.util.List<java.lang.String> street;
|
||||||
}
|
}
|
||||||
class google.registry.model.registrar.RegistrarContact {
|
|
||||||
@Id java.lang.String emailAddress;
|
|
||||||
@Parent com.googlecode.objectify.Key<google.registry.model.registrar.Registrar> parent;
|
|
||||||
boolean allowedToSetRegistryLockPassword;
|
|
||||||
boolean visibleInDomainWhoisAsAbuse;
|
|
||||||
boolean visibleInWhoisAsAdmin;
|
|
||||||
boolean visibleInWhoisAsTech;
|
|
||||||
java.lang.String faxNumber;
|
|
||||||
java.lang.String gaeUserId;
|
|
||||||
java.lang.String name;
|
|
||||||
java.lang.String phoneNumber;
|
|
||||||
java.lang.String registryLockEmailAddress;
|
|
||||||
java.lang.String registryLockPasswordHash;
|
|
||||||
java.lang.String registryLockPasswordSalt;
|
|
||||||
java.util.Set<google.registry.model.registrar.RegistrarContact$Type> types;
|
|
||||||
}
|
|
||||||
enum google.registry.model.registrar.RegistrarContact$Type {
|
|
||||||
ABUSE;
|
|
||||||
ADMIN;
|
|
||||||
BILLING;
|
|
||||||
LEGAL;
|
|
||||||
MARKETING;
|
|
||||||
TECH;
|
|
||||||
WHOIS;
|
|
||||||
}
|
|
||||||
class google.registry.model.replay.LastSqlTransaction {
|
class google.registry.model.replay.LastSqlTransaction {
|
||||||
@Id long id;
|
@Id long id;
|
||||||
long transactionId;
|
long transactionId;
|
||||||
|
|
|
@ -11,9 +11,9 @@ emailAddress: the.registrar@example.com -> thase@the.registrar
|
||||||
url: http://my.fake.url -> http://my.new.url
|
url: http://my.fake.url -> http://my.new.url
|
||||||
contacts:
|
contacts:
|
||||||
ADDED:
|
ADDED:
|
||||||
{parent=Key<?>(EntityGroupRoot("cross-tld")/Registrar("TheRegistrar")), name=Extra Terrestrial, emailAddress=etphonehome@example.com, registrarId=TheRegistrar, registryLockEmailAddress=null, phoneNumber=+1.2345678901, faxNumber=null, types=[ADMIN, BILLING, TECH, WHOIS], gaeUserId=null, visibleInWhoisAsAdmin=true, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false}
|
{name=Extra Terrestrial, emailAddress=etphonehome@example.com, registrarId=TheRegistrar, registryLockEmailAddress=null, phoneNumber=+1.2345678901, faxNumber=null, types=[ADMIN, BILLING, TECH, WHOIS], gaeUserId=null, visibleInWhoisAsAdmin=true, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false}
|
||||||
REMOVED:
|
REMOVED:
|
||||||
{parent=Key<?>(EntityGroupRoot("cross-tld")/Registrar("TheRegistrar")), name=John Doe, emailAddress=johndoe@theregistrar.com, registrarId=TheRegistrar, registryLockEmailAddress=null, phoneNumber=+1.1234567890, faxNumber=null, types=[ADMIN], gaeUserId=31337, visibleInWhoisAsAdmin=false, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false}
|
{name=John Doe, emailAddress=johndoe@theregistrar.com, registrarId=TheRegistrar, registryLockEmailAddress=null, phoneNumber=+1.1234567890, faxNumber=null, types=[ADMIN], gaeUserId=31337, visibleInWhoisAsAdmin=false, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false}
|
||||||
FINAL CONTENTS:
|
FINAL CONTENTS:
|
||||||
{parent=Key<?>(EntityGroupRoot("cross-tld")/Registrar("TheRegistrar")), name=Extra Terrestrial, emailAddress=etphonehome@example.com, registrarId=TheRegistrar, registryLockEmailAddress=null, phoneNumber=+1.2345678901, faxNumber=null, types=[ADMIN, BILLING, TECH, WHOIS], gaeUserId=null, visibleInWhoisAsAdmin=true, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false},
|
{name=Extra Terrestrial, emailAddress=etphonehome@example.com, registrarId=TheRegistrar, registryLockEmailAddress=null, phoneNumber=+1.2345678901, faxNumber=null, types=[ADMIN, BILLING, TECH, WHOIS], gaeUserId=null, visibleInWhoisAsAdmin=true, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false},
|
||||||
{parent=Key<?>(EntityGroupRoot("cross-tld")/Registrar("TheRegistrar")), name=Marla Singer, emailAddress=Marla.Singer@crr.com, registrarId=TheRegistrar, registryLockEmailAddress=Marla.Singer.RegistryLock@crr.com, phoneNumber=+1.2128675309, faxNumber=null, types=[TECH], gaeUserId=12345, visibleInWhoisAsAdmin=false, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false}
|
{name=Marla Singer, emailAddress=Marla.Singer@crr.com, registrarId=TheRegistrar, registryLockEmailAddress=Marla.Singer.RegistryLock@crr.com, phoneNumber=+1.2128675309, faxNumber=null, types=[TECH], gaeUserId=12345, visibleInWhoisAsAdmin=false, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue