Rename various fields and classes after migration (#1784)

Also fixed a bug introduced in #1785 where identity checked were performed instead of equality. This resulted in two sets containing the same elements not being regarded as equal and subsequent DNS updated being unnecessarily enqueued.
This commit is contained in:
Lai Jiang 2022-09-21 11:49:22 -04:00 committed by GitHub
parent 341a6e84cf
commit ff38d8fc2c
107 changed files with 528 additions and 573 deletions

View file

@ -91,7 +91,7 @@ public class DeleteProberDataAction implements Runnable {
// Note: creationTime must be compared to a Java object (CreateAutoTimestamp) but deletionTime can // Note: creationTime must be compared to a Java object (CreateAutoTimestamp) but deletionTime can
// be compared directly to the SQL timestamp (it's a DateTime) // be compared directly to the SQL timestamp (it's a DateTime)
private static final String DOMAIN_QUERY_STRING = private static final String DOMAIN_QUERY_STRING =
"FROM Domain d WHERE d.tld IN :tlds AND d.fullyQualifiedDomainName NOT LIKE 'nic.%' AND" "FROM Domain d WHERE d.tld IN :tlds AND d.domainName NOT LIKE 'nic.%' AND"
+ " (d.subordinateHosts IS EMPTY OR d.subordinateHosts IS NULL) AND d.creationTime <" + " (d.subordinateHosts IS EMPTY OR d.subordinateHosts IS NULL) AND d.creationTime <"
+ " :creationTimeCutoff AND ((d.creationTime <= :nowAutoTimestamp AND d.deletionTime >" + " :creationTimeCutoff AND ((d.creationTime <= :nowAutoTimestamp AND d.deletionTime >"
+ " current_timestamp()) OR d.deletionTime < :nowMinusSoftDeleteDelay) ORDER BY d.repoId"; + " current_timestamp()) OR d.deletionTime < :nowMinusSoftDeleteDelay) ORDER BY d.repoId";
@ -220,7 +220,7 @@ public class DeleteProberDataAction implements Runnable {
private void hardDeleteDomainsAndHosts( private void hardDeleteDomainsAndHosts(
ImmutableList<String> domainRepoIds, ImmutableList<String> hostNames) { ImmutableList<String> domainRepoIds, ImmutableList<String> hostNames) {
jpaTm() jpaTm()
.query("DELETE FROM Host WHERE fullyQualifiedHostName IN :hostNames") .query("DELETE FROM Host WHERE hostName IN :hostNames")
.setParameter("hostNames", hostNames) .setParameter("hostNames", hostNames)
.executeUpdate(); .executeUpdate();
jpaTm() jpaTm()

View file

@ -301,7 +301,7 @@ public class RdePipeline implements Serializable {
.apply( .apply(
"Read all production Registrars", "Read all production Registrars",
RegistryJpaIO.read( RegistryJpaIO.read(
"SELECT clientIdentifier FROM Registrar WHERE type NOT IN (:types)", "SELECT registrarId FROM Registrar WHERE type NOT IN (:types)",
ImmutableMap.of("types", IGNORED_REGISTRAR_TYPES), ImmutableMap.of("types", IGNORED_REGISTRAR_TYPES),
String.class, String.class,
id -> VKey.createSql(Registrar.class, id))) id -> VKey.createSql(Registrar.class, id)))

View file

@ -75,8 +75,8 @@ public class SafeBrowsingTransforms {
private final String apiKey; private final String apiKey;
/** /**
* Maps a domain name's {@code fullyQualifiedDomainName} to its corresponding {@link * Maps a domain name's {@code domainName} to its corresponding {@link DomainNameInfo} to
* DomainNameInfo} to facilitate batching SafeBrowsing API requests. * facilitate batching SafeBrowsing API requests.
*/ */
private final Map<String, DomainNameInfo> domainNameInfoBuffer = private final Map<String, DomainNameInfo> domainNameInfoBuffer =
new LinkedHashMap<>(BATCH_SIZE); new LinkedHashMap<>(BATCH_SIZE);
@ -186,8 +186,8 @@ public class SafeBrowsingTransforms {
private JSONObject createRequestBody() throws JSONException { private JSONObject createRequestBody() throws JSONException {
// Accumulate all domain names to evaluate. // Accumulate all domain names to evaluate.
JSONArray threatArray = new JSONArray(); JSONArray threatArray = new JSONArray();
for (String fullyQualifiedDomainName : domainNameInfoBuffer.keySet()) { for (String domainName : domainNameInfoBuffer.keySet()) {
threatArray.put(new JSONObject().put("url", fullyQualifiedDomainName)); threatArray.put(new JSONObject().put("url", domainName));
} }
// Construct the JSON request body // Construct the JSON request body
return new JSONObject() return new JSONObject()

View file

@ -113,7 +113,7 @@ public class Spec11Pipeline implements Serializable {
Read<Object[], KV<String, String>> read = Read<Object[], KV<String, String>> read =
RegistryJpaIO.read( RegistryJpaIO.read(
"select d.repoId, r.emailAddress from Domain d join Registrar r on" "select d.repoId, r.emailAddress from Domain d join Registrar r on"
+ " d.currentSponsorClientId = r.clientIdentifier where r.type = 'REAL' and" + " d.currentSponsorClientId = r.registrarId where r.type = 'REAL' and"
+ " d.deletionTime > now()", + " d.deletionTime > now()",
false, false,
Spec11Pipeline::parseRow); Spec11Pipeline::parseRow);

View file

@ -25,23 +25,23 @@ import org.json.JSONObject;
public abstract class ThreatMatch implements Serializable { public abstract class ThreatMatch implements Serializable {
private static final String THREAT_TYPE_FIELD = "threatType"; private static final String THREAT_TYPE_FIELD = "threatType";
private static final String DOMAIN_NAME_FIELD = "fullyQualifiedDomainName"; private static final String DOMAIN_NAME_FIELD = "domainName";
/** Returns what kind of threat it is (malware, phishing etc.) */ /** Returns what kind of threat it is (malware, phishing etc.) */
public abstract String threatType(); public abstract String threatType();
/** Returns the fully qualified domain name [SLD].[TLD] of the matched threat. */ /** Returns the fully qualified domain name [SLD].[TLD] of the matched threat. */
public abstract String fullyQualifiedDomainName(); public abstract String domainName();
@VisibleForTesting @VisibleForTesting
static ThreatMatch create(String threatType, String fullyQualifiedDomainName) { static ThreatMatch create(String threatType, String domainName) {
return new AutoValue_ThreatMatch(threatType, fullyQualifiedDomainName); return new AutoValue_ThreatMatch(threatType, domainName);
} }
/** Returns a {@link JSONObject} representing a subset of this object's data. */ /** Returns a {@link JSONObject} representing a subset of this object's data. */
JSONObject toJSON() throws JSONException { JSONObject toJSON() throws JSONException {
return new JSONObject() return new JSONObject()
.put(THREAT_TYPE_FIELD, threatType()) .put(THREAT_TYPE_FIELD, threatType())
.put(DOMAIN_NAME_FIELD, fullyQualifiedDomainName()); .put(DOMAIN_NAME_FIELD, domainName());
} }
/** Parses a {@link JSONObject} and returns an equivalent {@link ThreatMatch}. */ /** Parses a {@link JSONObject} and returns an equivalent {@link ThreatMatch}. */

View file

@ -37,7 +37,7 @@ import google.registry.dns.writer.BaseDnsWriter;
import google.registry.dns.writer.DnsWriter; import google.registry.dns.writer.DnsWriter;
import google.registry.dns.writer.DnsWriterZone; import google.registry.dns.writer.DnsWriterZone;
import google.registry.model.domain.Domain; import google.registry.model.domain.Domain;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.model.tld.Registries; import google.registry.model.tld.Registries;
import google.registry.util.Clock; import google.registry.util.Clock;
@ -134,10 +134,10 @@ public class CloudDnsWriter extends BaseDnsWriter {
ImmutableSet.Builder<ResourceRecordSet> domainRecords = new ImmutableSet.Builder<>(); ImmutableSet.Builder<ResourceRecordSet> domainRecords = new ImmutableSet.Builder<>();
// Construct DS records (if any). // Construct DS records (if any).
Set<DelegationSignerData> dsData = domain.get().getDsData(); Set<DomainDsData> dsData = domain.get().getDsData();
if (!dsData.isEmpty()) { if (!dsData.isEmpty()) {
HashSet<String> dsRrData = new HashSet<>(); HashSet<String> dsRrData = new HashSet<>();
for (DelegationSignerData ds : dsData) { for (DomainDsData ds : dsData) {
dsRrData.add(ds.toRrData()); dsRrData.add(ds.toRrData());
} }

View file

@ -28,7 +28,7 @@ import google.registry.config.RegistryConfig.Config;
import google.registry.dns.writer.BaseDnsWriter; import google.registry.dns.writer.BaseDnsWriter;
import google.registry.dns.writer.DnsWriterZone; import google.registry.dns.writer.DnsWriterZone;
import google.registry.model.domain.Domain; import google.registry.model.domain.Domain;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.model.tld.Registries; import google.registry.model.tld.Registries;
import google.registry.util.Clock; import google.registry.util.Clock;
@ -185,7 +185,7 @@ public class DnsUpdateWriter extends BaseDnsWriter {
private RRset makeDelegationSignerSet(Domain domain) { private RRset makeDelegationSignerSet(Domain domain) {
RRset signerSet = new RRset(); RRset signerSet = new RRset();
for (DelegationSignerData signerData : domain.getDsData()) { for (DomainDsData signerData : domain.getDsData()) {
DSRecord dsRecord = DSRecord dsRecord =
new DSRecord( new DSRecord(
toAbsoluteName(domain.getDomainName()), toAbsoluteName(domain.getDomainName()),

View file

@ -91,10 +91,10 @@ public class ExportDomainListsAction implements Runnable {
// field that compares with the substituted value. // field that compares with the substituted value.
jpaTm() jpaTm()
.query( .query(
"SELECT fullyQualifiedDomainName FROM Domain " "SELECT domainName FROM Domain "
+ "WHERE tld = :tld " + "WHERE tld = :tld "
+ "AND deletionTime > :now " + "AND deletionTime > :now "
+ "ORDER by fullyQualifiedDomainName ASC", + "ORDER by domainName ASC",
String.class) String.class)
.setParameter("tld", tld) .setParameter("tld", tld)
.setParameter("now", clock.nowUtc()) .setParameter("now", clock.nowUtc())

View file

@ -114,7 +114,7 @@ class SyncRegistrarsSheet {
// and you'll need to remove deleted columns probably like a week after // and you'll need to remove deleted columns probably like a week after
// deployment. // deployment.
// //
builder.put("clientIdentifier", convert(registrar.getRegistrarId())); builder.put("registrarId", convert(registrar.getRegistrarId()));
builder.put("registrarName", convert(registrar.getRegistrarName())); builder.put("registrarName", convert(registrar.getRegistrarName()));
builder.put("state", convert(registrar.getState())); builder.put("state", convert(registrar.getState()));
builder.put("ianaIdentifier", convert(registrar.getIanaIdentifier())); builder.put("ianaIdentifier", convert(registrar.getIanaIdentifier()));

View file

@ -248,7 +248,7 @@ public final class DomainCreateFlow implements TransactionalFlow {
validateRegistrationPeriod(years); validateRegistrationPeriod(years);
verifyResourceDoesNotExist(Domain.class, targetId, now, registrarId); verifyResourceDoesNotExist(Domain.class, targetId, now, registrarId);
// Validate that this is actually a legal domain name on a TLD that the registrar has access to. // Validate that this is actually a legal domain name on a TLD that the registrar has access to.
InternetDomainName domainName = validateDomainName(command.getFullyQualifiedDomainName()); InternetDomainName domainName = validateDomainName(command.getDomainName());
String domainLabel = domainName.parts().get(0); String domainLabel = domainName.parts().get(0);
Registry registry = Registry.get(domainName.parent().toString()); Registry registry = Registry.get(domainName.parent().toString());
validateCreateCommandContactsAndNameservers(command, registry, domainName); validateCreateCommandContactsAndNameservers(command, registry, domainName);
@ -639,10 +639,7 @@ public final class DomainCreateFlow implements TransactionalFlow {
} }
private static PollMessage.OneTime createNameCollisionOneTimePollMessage( private static PollMessage.OneTime createNameCollisionOneTimePollMessage(
String fullyQualifiedDomainName, String domainName, HistoryEntry historyEntry, String registrarId, DateTime now) {
HistoryEntry historyEntry,
String registrarId,
DateTime now) {
return new PollMessage.OneTime.Builder() return new PollMessage.OneTime.Builder()
.setRegistrarId(registrarId) .setRegistrarId(registrarId)
.setEventTime(now) .setEventTime(now)
@ -650,7 +647,7 @@ public final class DomainCreateFlow implements TransactionalFlow {
.setResponseData( .setResponseData(
ImmutableList.of( ImmutableList.of(
DomainPendingActionNotificationResponse.create( DomainPendingActionNotificationResponse.create(
fullyQualifiedDomainName, true, historyEntry.getTrid(), now))) domainName, true, historyEntry.getTrid(), now)))
.setHistoryEntry(historyEntry) .setHistoryEntry(historyEntry)
.build(); .build();
} }

View file

@ -105,7 +105,7 @@ import google.registry.model.domain.launch.LaunchNotice;
import google.registry.model.domain.launch.LaunchNotice.InvalidChecksumException; import google.registry.model.domain.launch.LaunchNotice.InvalidChecksumException;
import google.registry.model.domain.launch.LaunchPhase; import google.registry.model.domain.launch.LaunchPhase;
import google.registry.model.domain.metadata.MetadataExtension; import google.registry.model.domain.metadata.MetadataExtension;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.domain.secdns.SecDnsCreateExtension; import google.registry.model.domain.secdns.SecDnsCreateExtension;
import google.registry.model.domain.secdns.SecDnsInfoExtension; import google.registry.model.domain.secdns.SecDnsInfoExtension;
import google.registry.model.domain.secdns.SecDnsUpdateExtension; import google.registry.model.domain.secdns.SecDnsUpdateExtension;
@ -316,14 +316,14 @@ public class DomainFlowUtils {
} }
/** Check that the DS data that will be set on a domain is valid. */ /** Check that the DS data that will be set on a domain is valid. */
static void validateDsData(Set<DelegationSignerData> dsData) throws EppException { static void validateDsData(Set<DomainDsData> dsData) throws EppException {
if (dsData != null) { if (dsData != null) {
if (dsData.size() > MAX_DS_RECORDS_PER_DOMAIN) { if (dsData.size() > MAX_DS_RECORDS_PER_DOMAIN) {
throw new TooManyDsRecordsException( throw new TooManyDsRecordsException(
String.format( String.format(
"A maximum of %s DS records are allowed per domain.", MAX_DS_RECORDS_PER_DOMAIN)); "A maximum of %s DS records are allowed per domain.", MAX_DS_RECORDS_PER_DOMAIN));
} }
ImmutableList<DelegationSignerData> invalidAlgorithms = ImmutableList<DomainDsData> invalidAlgorithms =
dsData.stream() dsData.stream()
.filter(ds -> !validateAlgorithm(ds.getAlgorithm())) .filter(ds -> !validateAlgorithm(ds.getAlgorithm()))
.collect(toImmutableList()); .collect(toImmutableList());
@ -333,7 +333,7 @@ public class DomainFlowUtils {
"Domain contains DS record(s) with an invalid algorithm wire value: %s", "Domain contains DS record(s) with an invalid algorithm wire value: %s",
invalidAlgorithms)); invalidAlgorithms));
} }
ImmutableList<DelegationSignerData> invalidDigestTypes = ImmutableList<DomainDsData> invalidDigestTypes =
dsData.stream() dsData.stream()
.filter(ds -> !DigestType.fromWireValue(ds.getDigestType()).isPresent()) .filter(ds -> !DigestType.fromWireValue(ds.getDigestType()).isPresent())
.collect(toImmutableList()); .collect(toImmutableList());
@ -343,7 +343,7 @@ public class DomainFlowUtils {
"Domain contains DS record(s) with an invalid digest type: %s", "Domain contains DS record(s) with an invalid digest type: %s",
invalidDigestTypes)); invalidDigestTypes));
} }
ImmutableList<DelegationSignerData> digestsWithInvalidDigestLength = ImmutableList<DomainDsData> digestsWithInvalidDigestLength =
dsData.stream() dsData.stream()
.filter( .filter(
ds -> ds ->
@ -920,16 +920,15 @@ public class DomainFlowUtils {
* and we are going to ignore it; clients who don't care about secDNS can just ignore it. * and we are going to ignore it; clients who don't care about secDNS can just ignore it.
*/ */
static void addSecDnsExtensionIfPresent( static void addSecDnsExtensionIfPresent(
ImmutableList.Builder<ResponseExtension> extensions, ImmutableList.Builder<ResponseExtension> extensions, ImmutableSet<DomainDsData> dsData) {
ImmutableSet<DelegationSignerData> dsData) {
if (!dsData.isEmpty()) { if (!dsData.isEmpty()) {
extensions.add(SecDnsInfoExtension.create(dsData)); extensions.add(SecDnsInfoExtension.create(dsData));
} }
} }
/** Update {@link DelegationSignerData} based on an update extension command. */ /** Update {@link DomainDsData} based on an update extension command. */
static ImmutableSet<DelegationSignerData> updateDsData( static ImmutableSet<DomainDsData> updateDsData(
ImmutableSet<DelegationSignerData> oldDsData, SecDnsUpdateExtension secDnsUpdate) ImmutableSet<DomainDsData> oldDsData, SecDnsUpdateExtension secDnsUpdate)
throws EppException { throws EppException {
// We don't support 'urgent' because we do everything as fast as we can anyways. // We don't support 'urgent' because we do everything as fast as we can anyways.
if (Boolean.TRUE.equals(secDnsUpdate.getUrgent())) { // We allow both false and null. if (Boolean.TRUE.equals(secDnsUpdate.getUrgent())) { // We allow both false and null.
@ -948,8 +947,8 @@ public class DomainFlowUtils {
if (remove != null && Boolean.FALSE.equals(remove.getAll())) { if (remove != null && Boolean.FALSE.equals(remove.getAll())) {
throw new SecDnsAllUsageException(); // Explicit all=false is meaningless. throw new SecDnsAllUsageException(); // Explicit all=false is meaningless.
} }
Set<DelegationSignerData> toAdd = (add == null) ? ImmutableSet.of() : add.getDsData(); Set<DomainDsData> toAdd = (add == null) ? ImmutableSet.of() : add.getDsData();
Set<DelegationSignerData> toRemove = Set<DomainDsData> toRemove =
(remove == null) (remove == null)
? ImmutableSet.of() ? ImmutableSet.of()
: (remove.getAll() == null) ? remove.getDsData() : oldDsData; : (remove.getAll() == null) ? remove.getDsData() : oldDsData;
@ -1001,9 +1000,9 @@ public class DomainFlowUtils {
validateRegistrantAllowedOnTld(tld, command.getRegistrantContactId()); validateRegistrantAllowedOnTld(tld, command.getRegistrantContactId());
validateNoDuplicateContacts(command.getContacts()); validateNoDuplicateContacts(command.getContacts());
validateRequiredContactsPresent(command.getRegistrant(), command.getContacts()); validateRequiredContactsPresent(command.getRegistrant(), command.getContacts());
ImmutableSet<String> fullyQualifiedHostNames = command.getNameserverFullyQualifiedHostNames(); ImmutableSet<String> hostNames = command.getNameserverHostNames();
validateNameserversCountForTld(tld, domainName, fullyQualifiedHostNames.size()); validateNameserversCountForTld(tld, domainName, hostNames.size());
validateNameserversAllowedOnTld(tld, fullyQualifiedHostNames); validateNameserversAllowedOnTld(tld, hostNames);
} }
/** Validate the secDNS extension, if present. */ /** Validate the secDNS extension, if present. */
@ -1542,11 +1541,11 @@ public class DomainFlowUtils {
/** Nameservers are not allow-listed for this TLD. */ /** Nameservers are not allow-listed for this TLD. */
public static class NameserversNotAllowedForTldException public static class NameserversNotAllowedForTldException
extends StatusProhibitsOperationException { extends StatusProhibitsOperationException {
public NameserversNotAllowedForTldException(Set<String> fullyQualifiedHostNames) { public NameserversNotAllowedForTldException(Set<String> hostNames) {
super( super(
String.format( String.format(
"Nameservers '%s' are not allow-listed for this TLD", "Nameservers '%s' are not allow-listed for this TLD",
Joiner.on(',').join(fullyQualifiedHostNames))); Joiner.on(',').join(hostNames)));
} }
} }

View file

@ -109,7 +109,7 @@ public final class DomainInfoFlow implements Flow {
// This is a policy decision that is left up to us by the rfcs. // This is a policy decision that is left up to us by the rfcs.
DomainInfoData.Builder infoBuilder = DomainInfoData.Builder infoBuilder =
DomainInfoData.newBuilder() DomainInfoData.newBuilder()
.setFullyQualifiedDomainName(domain.getDomainName()) .setDomainName(domain.getDomainName())
.setRepoId(domain.getRepoId()) .setRepoId(domain.getRepoId())
.setCurrentSponsorClientId(domain.getCurrentSponsorRegistrarId()) .setCurrentSponsorClientId(domain.getCurrentSponsorRegistrarId())
.setRegistrant( .setRegistrant(

View file

@ -218,7 +218,7 @@ public final class DomainTransferUtils {
TransferData transferData, TransferData transferData,
@Nullable DateTime extendedRegistrationExpirationTime) { @Nullable DateTime extendedRegistrationExpirationTime) {
return new DomainTransferResponse.Builder() return new DomainTransferResponse.Builder()
.setFullyQualifiedDomainName(targetId) .setDomainName(targetId)
.setGainingRegistrarId(transferData.getGainingRegistrarId()) .setGainingRegistrarId(transferData.getGainingRegistrarId())
.setLosingRegistrarId(transferData.getLosingRegistrarId()) .setLosingRegistrarId(transferData.getLosingRegistrarId())
.setPendingTransferExpirationTime(transferData.getPendingTransferExpirationTime()) .setPendingTransferExpirationTime(transferData.getPendingTransferExpirationTime())

View file

@ -74,7 +74,7 @@ import google.registry.model.domain.DomainCommand.Update.Change;
import google.registry.model.domain.DomainHistory; import google.registry.model.domain.DomainHistory;
import google.registry.model.domain.fee.FeeUpdateCommandExtension; import google.registry.model.domain.fee.FeeUpdateCommandExtension;
import google.registry.model.domain.metadata.MetadataExtension; import google.registry.model.domain.metadata.MetadataExtension;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.domain.secdns.SecDnsUpdateExtension; import google.registry.model.domain.secdns.SecDnsUpdateExtension;
import google.registry.model.domain.superuser.DomainUpdateSuperuserExtension; import google.registry.model.domain.superuser.DomainUpdateSuperuserExtension;
import google.registry.model.eppcommon.AuthInfo; import google.registry.model.eppcommon.AuthInfo;
@ -87,6 +87,7 @@ import google.registry.model.poll.PendingActionNotificationResponse.DomainPendin
import google.registry.model.poll.PollMessage; import google.registry.model.poll.PollMessage;
import google.registry.model.reporting.IcannReportingTypes.ActivityReportField; import google.registry.model.reporting.IcannReportingTypes.ActivityReportField;
import google.registry.model.tld.Registry; import google.registry.model.tld.Registry;
import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import javax.inject.Inject; import javax.inject.Inject;
import org.joda.time.DateTime; import org.joda.time.DateTime;
@ -181,8 +182,8 @@ public final class DomainUpdateFlow implements TransactionalFlow {
DomainHistory domainHistory = DomainHistory domainHistory =
historyBuilder.setType(DOMAIN_UPDATE).setDomain(newDomain).build(); historyBuilder.setType(DOMAIN_UPDATE).setDomain(newDomain).build();
validateNewState(newDomain); validateNewState(newDomain);
if (newDomain.getDsData() != existingDomain.getDsData() if (!Objects.equals(newDomain.getDsData(), existingDomain.getDsData())
|| newDomain.getNsHosts() != existingDomain.getNsHosts()) { || !Objects.equals(newDomain.getNsHosts(), existingDomain.getNsHosts())) {
dnsQueue.addDomainRefreshTask(targetId); dnsQueue.addDomainRefreshTask(targetId);
} }
ImmutableSet.Builder<ImmutableObject> entitiesToSave = new ImmutableSet.Builder<>(); ImmutableSet.Builder<ImmutableObject> entitiesToSave = new ImmutableSet.Builder<>();
@ -232,8 +233,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
validateContactsHaveTypes(add.getContacts()); validateContactsHaveTypes(add.getContacts());
validateContactsHaveTypes(remove.getContacts()); validateContactsHaveTypes(remove.getContacts());
validateRegistrantAllowedOnTld(tld, command.getInnerChange().getRegistrantContactId()); validateRegistrantAllowedOnTld(tld, command.getInnerChange().getRegistrantContactId());
validateNameserversAllowedOnTld( validateNameserversAllowedOnTld(tld, add.getNameserverHostNames());
tld, add.getNameserverFullyQualifiedHostNames());
} }
private Domain performUpdate(Update command, Domain domain, DateTime now) throws EppException { private Domain performUpdate(Update command, Domain domain, DateTime now) throws EppException {
@ -263,7 +263,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
secDnsUpdate.isPresent() secDnsUpdate.isPresent()
? updateDsData( ? updateDsData(
domain.getDsData().stream() domain.getDsData().stream()
.map(DelegationSignerData::cloneWithoutDomainRepoId) .map(DomainDsData::cloneWithoutDomainRepoId)
.collect(toImmutableSet()), .collect(toImmutableSet()),
secDnsUpdate.get()) secDnsUpdate.get())
: domain.getDsData()) : domain.getDsData())

View file

@ -175,11 +175,7 @@ public class AllocationTokenFlowUtils {
return Optional.empty(); return Optional.empty();
} }
AllocationToken tokenEntity = loadToken(extension.get().getAllocationToken()); AllocationToken tokenEntity = loadToken(extension.get().getAllocationToken());
validateToken( validateToken(InternetDomainName.from(command.getDomainName()), tokenEntity, registrarId, now);
InternetDomainName.from(command.getFullyQualifiedDomainName()),
tokenEntity,
registrarId,
now);
return Optional.of( return Optional.of(
tokenCustomLogic.validateToken(command, tokenEntity, registry, registrarId, now)); tokenCustomLogic.validateToken(command, tokenEntity, registry, registrarId, now));
} }

View file

@ -134,7 +134,7 @@ public final class HostCreateFlow implements TransactionalFlow {
superordinateDomain superordinateDomain
.get() .get()
.asBuilder() .asBuilder()
.addSubordinateHost(command.getFullyQualifiedHostName()) .addSubordinateHost(command.getHostName())
.build()); .build());
// Only update DNS if this is a subordinate host. External hosts have no glue to write, so // Only update DNS if this is a subordinate host. External hosts have no glue to write, so
// they are only written as NS records from the referencing domain. // they are only written as NS records from the referencing domain.

View file

@ -93,7 +93,7 @@ public final class HostInfoFlow implements Flow {
return responseBuilder return responseBuilder
.setResData( .setResData(
hostInfoDataBuilder hostInfoDataBuilder
.setFullyQualifiedHostName(host.getHostName()) .setHostName(host.getHostName())
.setRepoId(host.getRepoId()) .setRepoId(host.getRepoId())
.setStatusValues(statusValues.build()) .setStatusValues(statusValues.build())
.setInetAddresses(host.getInetAddresses()) .setInetAddresses(host.getInetAddresses())

View file

@ -129,7 +129,7 @@ public final class HostUpdateFlow implements TransactionalFlow {
extensionManager.validate(); extensionManager.validate();
Update command = (Update) resourceCommand; Update command = (Update) resourceCommand;
Change change = command.getInnerChange(); Change change = command.getInnerChange();
String suppliedNewHostName = change.getFullyQualifiedHostName(); String suppliedNewHostName = change.getHostName();
DateTime now = tm().getTransactionTime(); DateTime now = tm().getTransactionTime();
validateHostName(targetId); validateHostName(targetId);
Host existingHost = loadAndVerifyExistence(Host.class, targetId, now); Host existingHost = loadAndVerifyExistence(Host.class, targetId, now);
@ -260,7 +260,7 @@ public final class HostUpdateFlow implements TransactionalFlow {
dnsQueue.addHostRefreshTask(existingHost.getHostName()); dnsQueue.addHostRefreshTask(existingHost.getHostName());
} }
// In case of a rename, there are many updates we need to queue up. // In case of a rename, there are many updates we need to queue up.
if (((Update) resourceCommand).getInnerChange().getFullyQualifiedHostName() != null) { if (((Update) resourceCommand).getInnerChange().getHostName() != null) {
// If the renamed host is also subordinate, then we must enqueue an update to write the new // If the renamed host is also subordinate, then we must enqueue an update to write the new
// glue. // glue.
if (newHost.isSubordinate()) { if (newHost.isSubordinate()) {

View file

@ -140,10 +140,7 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable {
DateTime lastEppUpdateTime; DateTime lastEppUpdateTime;
/** Status values associated with this resource. */ /** Status values associated with this resource. */
@Ignore @Ignore Set<StatusValue> statuses;
@Column(name = "statuses")
// TODO(b/177567432): rename to "statuses" once we're off datastore.
Set<StatusValue> status;
public String getRepoId() { public String getRepoId() {
return repoId; return repoId;
@ -189,7 +186,7 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable {
} }
public final ImmutableSet<StatusValue> getStatusValues() { public final ImmutableSet<StatusValue> getStatusValues() {
return nullToEmptyImmutableCopy(status); return nullToEmptyImmutableCopy(statuses);
} }
public DateTime getDeletionTime() { public DateTime getDeletionTime() {
@ -307,7 +304,7 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable {
statusValue, statusValue,
resourceClass.getSimpleName()); resourceClass.getSimpleName());
} }
getInstance().status = statusValues; getInstance().statuses = statusValues;
return thisCastToDerived(); return thisCastToDerived();
} }

View file

@ -58,8 +58,8 @@ public final class ForeignKeyUtils {
RESOURCE_TYPE_TO_FK_PROPERTY = RESOURCE_TYPE_TO_FK_PROPERTY =
ImmutableMap.of( ImmutableMap.of(
Contact.class, "contactId", Contact.class, "contactId",
Domain.class, "fullyQualifiedDomainName", Domain.class, "domainName",
Host.class, "fullyQualifiedHostName"); Host.class, "hostName");
/** /**
* Loads a {@link VKey} to an {@link EppResource} from the database by foreign key. * Loads a {@link VKey} to an {@link EppResource} from the database by foreign key.

View file

@ -68,7 +68,7 @@ public class OteStats {
((DomainCommand.Create) ((DomainCommand.Create)
((ResourceCommandWrapper) eppInput.getCommandWrapper().getCommand()) ((ResourceCommandWrapper) eppInput.getCommandWrapper().getCommand())
.getResourceCommand()) .getResourceCommand())
.getFullyQualifiedDomainName() .getDomainName()
.startsWith(ACE_PREFIX); .startsWith(ACE_PREFIX);
private static final Predicate<EppInput> IS_SUBORDINATE = private static final Predicate<EppInput> IS_SUBORDINATE =

View file

@ -64,7 +64,7 @@ public final class ResourceTransferUtils {
DomainTransferData domainTransferData = (DomainTransferData) transferData; DomainTransferData domainTransferData = (DomainTransferData) transferData;
builder = builder =
new DomainTransferResponse.Builder() new DomainTransferResponse.Builder()
.setFullyQualifiedDomainName(eppResource.getForeignKey()) .setDomainName(eppResource.getForeignKey())
.setExtendedRegistrationExpirationTime( .setExtendedRegistrationExpirationTime(
ADD_EXDATE_STATUSES.contains(domainTransferData.getTransferStatus()) ADD_EXDATE_STATUSES.contains(domainTransferData.getTransferStatus())
? domainTransferData.getTransferredRegistrationExpirationTime() ? domainTransferData.getTransferredRegistrationExpirationTime()

View file

@ -24,7 +24,7 @@ import google.registry.model.domain.DomainBase;
import google.registry.model.domain.DomainHistory; import google.registry.model.domain.DomainHistory;
import google.registry.model.domain.GracePeriod; import google.registry.model.domain.GracePeriod;
import google.registry.model.domain.GracePeriod.GracePeriodHistory; import google.registry.model.domain.GracePeriod.GracePeriodHistory;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.domain.secdns.DomainDsDataHistory; import google.registry.model.domain.secdns.DomainDsDataHistory;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.model.reporting.DomainTransactionRecord; import google.registry.model.reporting.DomainTransactionRecord;
@ -67,12 +67,12 @@ public class BulkQueryEntities {
public static Domain assembleDomain( public static Domain assembleDomain(
DomainLite domainLite, DomainLite domainLite,
ImmutableSet<GracePeriod> gracePeriods, ImmutableSet<GracePeriod> gracePeriods,
ImmutableSet<DelegationSignerData> delegationSignerData, ImmutableSet<DomainDsData> domainDsData,
ImmutableSet<VKey<Host>> nsHosts) { ImmutableSet<VKey<Host>> nsHosts) {
Domain.Builder builder = new Domain.Builder(); Domain.Builder builder = new Domain.Builder();
builder.copyFrom(domainLite); builder.copyFrom(domainLite);
builder.setGracePeriods(gracePeriods); builder.setGracePeriods(gracePeriods);
builder.setDsData(delegationSignerData); builder.setDsData(domainDsData);
builder.setNameservers(nsHosts); builder.setNameservers(nsHosts);
// Restore the original update timestamp (this gets cleared when we set nameservers or DS data). // Restore the original update timestamp (this gets cleared when we set nameservers or DS data).
builder.setUpdateTimestamp(domainLite.getUpdateTimestamp()); builder.setUpdateTimestamp(domainLite.getUpdateTimestamp());
@ -99,9 +99,7 @@ public class BulkQueryEntities {
.map(GracePeriod::createFromHistory) .map(GracePeriod::createFromHistory)
.collect(toImmutableSet())) .collect(toImmutableSet()))
.setDsData( .setDsData(
dsDataHistories.stream() dsDataHistories.stream().map(DomainDsData::create).collect(toImmutableSet()))
.map(DelegationSignerData::create)
.collect(toImmutableSet()))
// Restore the original update timestamp (this gets cleared when we set nameservers or // Restore the original update timestamp (this gets cleared when we set nameservers or
// DS data). // DS data).
.setUpdateTimestamp(domainHistoryLite.domainBase.getUpdateTimestamp()) .setUpdateTimestamp(domainHistoryLite.domainBase.getUpdateTimestamp())

View file

@ -19,7 +19,7 @@ import google.registry.model.EppResource;
import google.registry.model.EppResource.ForeignKeyedEppResource; import google.registry.model.EppResource.ForeignKeyedEppResource;
import google.registry.model.annotations.ExternalMessagingName; import google.registry.model.annotations.ExternalMessagingName;
import google.registry.model.annotations.ReportedOn; import google.registry.model.annotations.ReportedOn;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.persistence.VKey; import google.registry.persistence.VKey;
import google.registry.persistence.WithStringVKey; import google.registry.persistence.WithStringVKey;
@ -116,15 +116,14 @@ public class Domain extends DomainBase implements ForeignKeyedEppResource {
} }
/** /**
* Returns the set of {@link DelegationSignerData} associated with the domain. * Returns the set of {@link DomainDsData} associated with the domain.
* *
* <p>This is the getter method specific for Hibernate to access the field, so it is set to * <p>This is the getter method specific for Hibernate to access the field, so it is set to
* private. The caller can use the public {@link #getDsData()} to get the DS data. * private. The caller can use the public {@link #getDsData()} to get the DS data.
* *
* <p>Note that we need to set `insertable = false, updatable = false` for @JoinColumn, otherwise * <p>Note that we need to set `insertable = false, updatable = false` for @JoinColumn, otherwise
* Hibernate would try to set the foreign key to null(through an UPDATE TABLE sql) instead of * Hibernate would try to set the foreign key to null(through an UPDATE TABLE sql) instead of
* deleting the whole entry from the table when the {@link DelegationSignerData} is removed from * deleting the whole entry from the table when the {@link DomainDsData} is removed from the set.
* the set.
*/ */
@Access(AccessType.PROPERTY) @Access(AccessType.PROPERTY)
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true)
@ -134,7 +133,7 @@ public class Domain extends DomainBase implements ForeignKeyedEppResource {
insertable = false, insertable = false,
updatable = false) updatable = false)
@SuppressWarnings("UnusedMethod") @SuppressWarnings("UnusedMethod")
private Set<DelegationSignerData> getInternalDelegationSignerData() { private Set<DomainDsData> getInternalDelegationSignerData() {
return dsData; return dsData;
} }

View file

@ -53,7 +53,7 @@ import google.registry.model.billing.BillingEvent;
import google.registry.model.contact.Contact; import google.registry.model.contact.Contact;
import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.launch.LaunchNotice;
import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.rgp.GracePeriodStatus;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.domain.token.AllocationToken; import google.registry.model.domain.token.AllocationToken;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.host.Host; import google.registry.model.host.Host;
@ -112,17 +112,14 @@ public class DomainBase extends EppResource
* Fully qualified domain name (puny-coded), which serves as the foreign key for this domain. * Fully qualified domain name (puny-coded), which serves as the foreign key for this domain.
* *
* <p>This is only unique in the sense that for any given lifetime specified as the time range * <p>This is only unique in the sense that for any given lifetime specified as the time range
* from (creationTime, deletionTime) there can only be one domain in Datastore with this name. * from (creationTime, deletionTime) there can only be one domain in the database with this name.
* However, there can be many domains with the same name and non-overlapping lifetimes. * However, there can be many domains with the same name and non-overlapping lifetimes.
* *
* @invariant fullyQualifiedDomainName == fullyQualifiedDomainName.toLowerCase(Locale.ENGLISH) * @invariant domainName == domainName.toLowerCase(Locale.ENGLISH)
*/ */
// TODO(b/177567432): Rename this to domainName when we are off Datastore @Index String domainName;
@Column(name = "domainName")
@Index
String fullyQualifiedDomainName;
/** The top level domain this is under, dernormalized from {@link #fullyQualifiedDomainName}. */ /** The top level domain this is under, dernormalized from {@link #domainName}. */
@Index String tld; @Index String tld;
/** References to hosts that are the nameservers for the domain. */ /** References to hosts that are the nameservers for the domain. */
@ -145,7 +142,7 @@ public class DomainBase extends EppResource
DomainAuthInfo authInfo; DomainAuthInfo authInfo;
/** Data used to construct DS records for this domain. */ /** Data used to construct DS records for this domain. */
@Ignore @Transient Set<DelegationSignerData> dsData; @Ignore @Transient Set<DomainDsData> dsData;
/** /**
* The claims notice supplied when this domain was created, if there was one. * The claims notice supplied when this domain was created, if there was one.
@ -340,14 +337,14 @@ public class DomainBase extends EppResource
@Override @Override
public String getForeignKey() { public String getForeignKey() {
return fullyQualifiedDomainName; return domainName;
} }
public String getDomainName() { public String getDomainName() {
return fullyQualifiedDomainName; return domainName;
} }
public ImmutableSet<DelegationSignerData> getDsData() { public ImmutableSet<DomainDsData> getDsData() {
return nullToEmptyImmutableCopy(dsData); return nullToEmptyImmutableCopy(dsData);
} }
@ -392,9 +389,9 @@ public class DomainBase extends EppResource
// Hibernate needs this in order to populate dsData but no one else should ever use it // Hibernate needs this in order to populate dsData but no one else should ever use it
@SuppressWarnings("UnusedMethod") @SuppressWarnings("UnusedMethod")
private void setInternalDelegationSignerData(Set<DelegationSignerData> dsData) { private void setInternalDelegationSignerData(Set<DomainDsData> dsData) {
if (this.dsData instanceof PersistentSet) { if (this.dsData instanceof PersistentSet) {
Set<DelegationSignerData> nonNullDsData = nullToEmpty(dsData); Set<DomainDsData> nonNullDsData = nullToEmpty(dsData);
this.dsData.retainAll(nonNullDsData); this.dsData.retainAll(nonNullDsData);
this.dsData.addAll(nonNullDsData); this.dsData.addAll(nonNullDsData);
} else { } else {
@ -728,9 +725,9 @@ public class DomainBase extends EppResource
// If there is no autorenew end time, set it to END_OF_TIME. // If there is no autorenew end time, set it to END_OF_TIME.
instance.autorenewEndTime = firstNonNull(getInstance().autorenewEndTime, END_OF_TIME); instance.autorenewEndTime = firstNonNull(getInstance().autorenewEndTime, END_OF_TIME);
checkArgumentNotNull(emptyToNull(instance.fullyQualifiedDomainName), "Missing domainName"); checkArgumentNotNull(emptyToNull(instance.domainName), "Missing domainName");
checkArgumentNotNull(instance.getRegistrant(), "Missing registrant"); checkArgumentNotNull(instance.getRegistrant(), "Missing registrant");
instance.tld = getTldFromDomainName(instance.fullyQualifiedDomainName); instance.tld = getTldFromDomainName(instance.domainName);
T newDomain = super.build(); T newDomain = super.build();
// Hibernate throws exception if gracePeriods or dsData is null because we enabled all // Hibernate throws exception if gracePeriods or dsData is null because we enabled all
@ -751,11 +748,11 @@ public class DomainBase extends EppResource
domainName.equals(canonicalizeHostname(domainName)), domainName.equals(canonicalizeHostname(domainName)),
"Domain name %s not in puny-coded, lower-case form", "Domain name %s not in puny-coded, lower-case form",
domainName); domainName);
getInstance().fullyQualifiedDomainName = domainName; getInstance().domainName = domainName;
return thisCastToDerived(); return thisCastToDerived();
} }
public B setDsData(ImmutableSet<DelegationSignerData> dsData) { public B setDsData(ImmutableSet<DomainDsData> dsData) {
getInstance().dsData = dsData; getInstance().dsData = dsData;
getInstance().resetUpdateTimestamp(); getInstance().resetUpdateTimestamp();
return thisCastToDerived(); return thisCastToDerived();

View file

@ -105,9 +105,9 @@ public class DomainCommand {
@XmlRootElement @XmlRootElement
@XmlType( @XmlType(
propOrder = { propOrder = {
"fullyQualifiedDomainName", "domainName",
"period", "period",
"nameserverFullyQualifiedHostNames", "nameserverHostNames",
"registrantContactId", "registrantContactId",
"foreignKeyedDesignatedContacts", "foreignKeyedDesignatedContacts",
"authInfo" "authInfo"
@ -117,12 +117,12 @@ public class DomainCommand {
/** Fully qualified domain name, which serves as a unique identifier for this domain. */ /** Fully qualified domain name, which serves as a unique identifier for this domain. */
@XmlElement(name = "name") @XmlElement(name = "name")
String fullyQualifiedDomainName; String domainName;
/** Fully qualified host names of the hosts that are the nameservers for the domain. */ /** Fully qualified host names of the hosts that are the nameservers for the domain. */
@XmlElementWrapper(name = "ns") @XmlElementWrapper(name = "ns")
@XmlElement(name = "hostObj") @XmlElement(name = "hostObj")
Set<String> nameserverFullyQualifiedHostNames; Set<String> nameserverHostNames;
/** Resolved keys to hosts that are the nameservers for the domain. */ /** Resolved keys to hosts that are the nameservers for the domain. */
@XmlTransient Set<VKey<Host>> nameservers; @XmlTransient Set<VKey<Host>> nameservers;
@ -144,15 +144,15 @@ public class DomainCommand {
@Override @Override
public String getTargetId() { public String getTargetId() {
return fullyQualifiedDomainName; return domainName;
} }
public String getFullyQualifiedDomainName() { public String getDomainName() {
return fullyQualifiedDomainName; return domainName;
} }
public ImmutableSet<String> getNameserverFullyQualifiedHostNames() { public ImmutableSet<String> getNameserverHostNames() {
return nullToEmptyImmutableCopy(nameserverFullyQualifiedHostNames); return nullToEmptyImmutableCopy(nameserverHostNames);
} }
public ImmutableSet<VKey<Host>> getNameservers() { public ImmutableSet<VKey<Host>> getNameservers() {
@ -172,7 +172,7 @@ public class DomainCommand {
@Override @Override
public Create cloneAndLinkReferences(DateTime now) throws InvalidReferencesException { public Create cloneAndLinkReferences(DateTime now) throws InvalidReferencesException {
Create clone = clone(this); Create clone = clone(this);
clone.nameservers = linkHosts(clone.nameserverFullyQualifiedHostNames, now); clone.nameservers = linkHosts(clone.nameserverHostNames, now);
if (registrantContactId == null) { if (registrantContactId == null) {
clone.contacts = linkContacts(clone.foreignKeyedDesignatedContacts, now); clone.contacts = linkContacts(clone.foreignKeyedDesignatedContacts, now);
} else { } else {
@ -205,7 +205,7 @@ public class DomainCommand {
/** The name of the domain to look up, and an attribute specifying the host lookup type. */ /** The name of the domain to look up, and an attribute specifying the host lookup type. */
@XmlElement(name = "name") @XmlElement(name = "name")
NameWithHosts fullyQualifiedDomainName; NameWithHosts domainName;
DomainAuthInfo authInfo; DomainAuthInfo authInfo;
@ -244,12 +244,12 @@ public class DomainCommand {
/** Get the enum that specifies the requested hosts (applies only to info flows). */ /** Get the enum that specifies the requested hosts (applies only to info flows). */
public HostsRequest getHostsRequest() { public HostsRequest getHostsRequest() {
// Null "hosts" is implicitly ALL. // Null "hosts" is implicitly ALL.
return MoreObjects.firstNonNull(fullyQualifiedDomainName.hosts, HostsRequest.ALL); return MoreObjects.firstNonNull(domainName.hosts, HostsRequest.ALL);
} }
@Override @Override
public String getTargetId() { public String getTargetId() {
return fullyQualifiedDomainName.name; return domainName.name;
} }
@Override @Override
@ -337,15 +337,12 @@ public class DomainCommand {
} }
/** The inner change type on a domain update command. */ /** The inner change type on a domain update command. */
@XmlType(propOrder = { @XmlType(propOrder = {"nameserverHostNames", "foreignKeyedDesignatedContacts", "statusValues"})
"nameserverFullyQualifiedHostNames",
"foreignKeyedDesignatedContacts",
"statusValues"})
public static class AddRemove extends ResourceUpdate.AddRemove { public static class AddRemove extends ResourceUpdate.AddRemove {
/** Fully qualified host names of the hosts that are the nameservers for the domain. */ /** Fully qualified host names of the hosts that are the nameservers for the domain. */
@XmlElementWrapper(name = "ns") @XmlElementWrapper(name = "ns")
@XmlElement(name = "hostObj") @XmlElement(name = "hostObj")
Set<String> nameserverFullyQualifiedHostNames; Set<String> nameserverHostNames;
/** Resolved keys to hosts that are the nameservers for the domain. */ /** Resolved keys to hosts that are the nameservers for the domain. */
@XmlTransient Set<VKey<Host>> nameservers; @XmlTransient Set<VKey<Host>> nameservers;
@ -358,8 +355,8 @@ public class DomainCommand {
@XmlTransient @XmlTransient
Set<DesignatedContact> contacts; Set<DesignatedContact> contacts;
public ImmutableSet<String> getNameserverFullyQualifiedHostNames() { public ImmutableSet<String> getNameserverHostNames() {
return nullSafeImmutableCopy(nameserverFullyQualifiedHostNames); return nullSafeImmutableCopy(nameserverHostNames);
} }
public ImmutableSet<VKey<Host>> getNameservers() { public ImmutableSet<VKey<Host>> getNameservers() {
@ -373,7 +370,7 @@ public class DomainCommand {
/** Creates a copy of this {@link AddRemove} with hard links to hosts and contacts. */ /** Creates a copy of this {@link AddRemove} with hard links to hosts and contacts. */
private AddRemove cloneAndLinkReferences(DateTime now) throws InvalidReferencesException { private AddRemove cloneAndLinkReferences(DateTime now) throws InvalidReferencesException {
AddRemove clone = clone(this); AddRemove clone = clone(this);
clone.nameservers = linkHosts(clone.nameserverFullyQualifiedHostNames, now); clone.nameservers = linkHosts(clone.nameserverHostNames, now);
clone.contacts = linkContacts(clone.foreignKeyedDesignatedContacts, now); clone.contacts = linkContacts(clone.foreignKeyedDesignatedContacts, now);
return clone; return clone;
} }
@ -412,13 +409,12 @@ public class DomainCommand {
} }
} }
private static Set<VKey<Host>> linkHosts(Set<String> fullyQualifiedHostNames, DateTime now) private static Set<VKey<Host>> linkHosts(Set<String> hostNames, DateTime now)
throws InvalidReferencesException { throws InvalidReferencesException {
if (fullyQualifiedHostNames == null) { if (hostNames == null) {
return null; return null;
} }
return ImmutableSet.copyOf( return ImmutableSet.copyOf(loadByForeignKeysCached(hostNames, Host.class, now).values());
loadByForeignKeysCached(fullyQualifiedHostNames, Host.class, now).values());
} }
private static Set<DesignatedContact> linkContacts( private static Set<DesignatedContact> linkContacts(

View file

@ -25,7 +25,7 @@ import google.registry.model.EppResource;
import google.registry.model.ImmutableObject; import google.registry.model.ImmutableObject;
import google.registry.model.domain.DomainHistory.DomainHistoryId; import google.registry.model.domain.DomainHistory.DomainHistoryId;
import google.registry.model.domain.GracePeriod.GracePeriodHistory; import google.registry.model.domain.GracePeriod.GracePeriodHistory;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.domain.secdns.DomainDsDataHistory; import google.registry.model.domain.secdns.DomainDsDataHistory;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.model.reporting.DomainTransactionRecord; import google.registry.model.reporting.DomainTransactionRecord;
@ -280,7 +280,7 @@ public class DomainHistory extends HistoryEntry {
.map(GracePeriod::createFromHistory) .map(GracePeriod::createFromHistory)
.collect(toImmutableSet()); .collect(toImmutableSet());
domainBase.dsData = domainBase.dsData =
dsDataHistories.stream().map(DelegationSignerData::create).collect(toImmutableSet()); dsDataHistories.stream().map(DomainDsData::create).collect(toImmutableSet());
// Normally Hibernate would see that the domain fields are all null and would fill // Normally Hibernate would see that the domain fields are all null and would fill
// domainBase with a null object. Unfortunately, the updateTimestamp is never null in SQL. // domainBase with a null object. Unfortunately, the updateTimestamp is never null in SQL.
if (domainBase.getDomainName() == null) { if (domainBase.getDomainName() == null) {

View file

@ -30,28 +30,30 @@ import org.joda.time.DateTime;
/** The {@link ResponseData} returned for an EPP info flow on a domain. */ /** The {@link ResponseData} returned for an EPP info flow on a domain. */
@XmlRootElement(name = "infData") @XmlRootElement(name = "infData")
@XmlType(propOrder = { @XmlType(
"fullyQualifiedDomainName", propOrder = {
"repoId", "domainName",
"statusValues", "repoId",
"registrant", "statusValues",
"contacts", "registrant",
"nameservers", "contacts",
"subordinateHosts", "nameservers",
"currentSponsorClientId", "subordinateHosts",
"creationClientId", "currentSponsorClientId",
"creationTime", "creationClientId",
"lastEppUpdateClientId", "creationTime",
"lastEppUpdateTime", "lastEppUpdateClientId",
"registrationExpirationTime", "lastEppUpdateTime",
"lastTransferTime", "registrationExpirationTime",
"authInfo"}) "lastTransferTime",
"authInfo"
})
@AutoValue @AutoValue
@CopyAnnotations @CopyAnnotations
public abstract class DomainInfoData implements ResponseData { public abstract class DomainInfoData implements ResponseData {
@XmlElement(name = "name") @XmlElement(name = "name")
abstract String getFullyQualifiedDomainName(); abstract String getDomainName();
@XmlElement(name = "roid") @XmlElement(name = "roid")
abstract String getRepoId(); abstract String getRepoId();
@ -110,7 +112,8 @@ public abstract class DomainInfoData implements ResponseData {
/** Builder for {@link DomainInfoData}. */ /** Builder for {@link DomainInfoData}. */
@AutoValue.Builder @AutoValue.Builder
public abstract static class Builder { public abstract static class Builder {
public abstract Builder setFullyQualifiedDomainName(String fullyQualifiedDomainName); public abstract Builder setDomainName(String domainName);
public abstract Builder setRepoId(String repoId); public abstract Builder setRepoId(String repoId);
public abstract Builder setStatusValues(@Nullable ImmutableSet<StatusValue> statusValues); public abstract Builder setStatusValues(@Nullable ImmutableSet<StatusValue> statusValues);
public abstract Builder setRegistrant(String registrant); public abstract Builder setRegistrant(String registrant);

View file

@ -17,7 +17,7 @@ package google.registry.model.domain.secdns;
import static google.registry.util.PreconditionsUtils.checkArgumentNotNull; import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
import google.registry.model.ImmutableObject; import google.registry.model.ImmutableObject;
import google.registry.model.domain.secdns.DelegationSignerData.DomainDsDataId; import google.registry.model.domain.secdns.DomainDsData.DomainDsDataId;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.Access; import javax.persistence.Access;
import javax.persistence.AccessType; import javax.persistence.AccessType;
@ -34,15 +34,14 @@ import javax.xml.bind.annotation.XmlType;
* *
* @see <a href="http://tools.ietf.org/html/rfc5910">RFC 5910</a> * @see <a href="http://tools.ietf.org/html/rfc5910">RFC 5910</a>
* @see <a href="http://tools.ietf.org/html/rfc4034">RFC 4034</a> * @see <a href="http://tools.ietf.org/html/rfc4034">RFC 4034</a>
* <p>TODO(b/177567432): Rename this class to DomainDsData.
*/ */
@XmlType(name = "dsData") @XmlType(name = "dsData")
@Entity @Entity
@IdClass(DomainDsDataId.class) @IdClass(DomainDsDataId.class)
@Table(indexes = @Index(columnList = "domainRepoId")) @Table(name = "DelegationSignerData", indexes = @Index(columnList = "domainRepoId"))
public class DelegationSignerData extends DomainDsDataBase { public class DomainDsData extends DomainDsDataBase {
private DelegationSignerData() {} private DomainDsData() {}
@Override @Override
@Id @Id
@ -79,21 +78,21 @@ public class DelegationSignerData extends DomainDsDataBase {
return super.getDigest(); return super.getDigest();
} }
public DelegationSignerData cloneWithDomainRepoId(String domainRepoId) { public DomainDsData cloneWithDomainRepoId(String domainRepoId) {
DelegationSignerData clone = clone(this); DomainDsData clone = clone(this);
clone.domainRepoId = checkArgumentNotNull(domainRepoId); clone.domainRepoId = checkArgumentNotNull(domainRepoId);
return clone; return clone;
} }
public DelegationSignerData cloneWithoutDomainRepoId() { public DomainDsData cloneWithoutDomainRepoId() {
DelegationSignerData clone = clone(this); DomainDsData clone = clone(this);
clone.domainRepoId = null; clone.domainRepoId = null;
return clone; return clone;
} }
public static DelegationSignerData create( public static DomainDsData create(
int keyTag, int algorithm, int digestType, byte[] digest, String domainRepoId) { int keyTag, int algorithm, int digestType, byte[] digest, String domainRepoId) {
DelegationSignerData instance = new DelegationSignerData(); DomainDsData instance = new DomainDsData();
instance.keyTag = keyTag; instance.keyTag = keyTag;
instance.algorithm = algorithm; instance.algorithm = algorithm;
instance.digestType = digestType; instance.digestType = digestType;
@ -102,17 +101,15 @@ public class DelegationSignerData extends DomainDsDataBase {
return instance; return instance;
} }
public static DelegationSignerData create( public static DomainDsData create(int keyTag, int algorithm, int digestType, byte[] digest) {
int keyTag, int algorithm, int digestType, byte[] digest) {
return create(keyTag, algorithm, digestType, digest, null); return create(keyTag, algorithm, digestType, digest, null);
} }
public static DelegationSignerData create( public static DomainDsData create(int keyTag, int algorithm, int digestType, String digestAsHex) {
int keyTag, int algorithm, int digestType, String digestAsHex) {
return create(keyTag, algorithm, digestType, DatatypeConverter.parseHexBinary(digestAsHex)); return create(keyTag, algorithm, digestType, DatatypeConverter.parseHexBinary(digestAsHex));
} }
public static DelegationSignerData create(DomainDsDataHistory history) { public static DomainDsData create(DomainDsDataHistory history) {
return create( return create(
history.keyTag, history.keyTag,
history.algorithm, history.algorithm,
@ -121,7 +118,7 @@ public class DelegationSignerData extends DomainDsDataBase {
history.domainRepoId); history.domainRepoId);
} }
/** Class to represent the composite primary key of {@link DelegationSignerData} entity. */ /** Class to represent the composite primary key of {@link DomainDsData} entity. */
static class DomainDsDataId extends ImmutableObject implements Serializable { static class DomainDsDataId extends ImmutableObject implements Serializable {
String domainRepoId; String domainRepoId;

View file

@ -26,7 +26,7 @@ import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.adapters.HexBinaryAdapter; import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/** Base class for {@link DelegationSignerData} and {@link DomainDsDataHistory}. */ /** Base class for {@link DomainDsData} and {@link DomainDsDataHistory}. */
@MappedSuperclass @MappedSuperclass
@Access(AccessType.FIELD) @Access(AccessType.FIELD)
public abstract class DomainDsDataBase extends ImmutableObject implements UnsafeSerializable { public abstract class DomainDsDataBase extends ImmutableObject implements UnsafeSerializable {

View file

@ -25,7 +25,7 @@ import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
/** Entity class to represent a historic {@link DelegationSignerData}. */ /** Entity class to represent a historic {@link DomainDsData}. */
@Entity @Entity
public class DomainDsDataHistory extends DomainDsDataBase implements UnsafeSerializable { public class DomainDsDataHistory extends DomainDsDataBase implements UnsafeSerializable {
@ -39,10 +39,9 @@ public class DomainDsDataHistory extends DomainDsDataBase implements UnsafeSeria
/** /**
* Creates a {@link DomainDsDataHistory} instance from given {@link #domainHistoryRevisionId} and * Creates a {@link DomainDsDataHistory} instance from given {@link #domainHistoryRevisionId} and
* {@link DelegationSignerData} instance. * {@link DomainDsData} instance.
*/ */
public static DomainDsDataHistory createFrom( public static DomainDsDataHistory createFrom(long domainHistoryRevisionId, DomainDsData dsData) {
long domainHistoryRevisionId, DelegationSignerData dsData) {
DomainDsDataHistory instance = new DomainDsDataHistory(); DomainDsDataHistory instance = new DomainDsDataHistory();
instance.domainHistoryRevisionId = domainHistoryRevisionId; instance.domainHistoryRevisionId = domainHistoryRevisionId;
instance.domainRepoId = dsData.domainRepoId; instance.domainRepoId = dsData.domainRepoId;

View file

@ -36,13 +36,13 @@ public class SecDnsCreateExtension extends ImmutableObject implements CommandExt
Long maxSigLife; Long maxSigLife;
/** Signatures for this domain. */ /** Signatures for this domain. */
Set<DelegationSignerData> dsData; Set<DomainDsData> dsData;
public Long getMaxSigLife() { public Long getMaxSigLife() {
return maxSigLife; return maxSigLife;
} }
public ImmutableSet<DelegationSignerData> getDsData() { public ImmutableSet<DomainDsData> getDsData() {
return nullSafeImmutableCopy(dsData); return nullSafeImmutableCopy(dsData);
} }
} }

View file

@ -24,9 +24,9 @@ import javax.xml.bind.annotation.XmlRootElement;
public class SecDnsInfoExtension extends ImmutableObject implements ResponseExtension { public class SecDnsInfoExtension extends ImmutableObject implements ResponseExtension {
/** Signatures for this domain. */ /** Signatures for this domain. */
ImmutableSet<DelegationSignerData> dsData; ImmutableSet<DomainDsData> dsData;
public static SecDnsInfoExtension create(ImmutableSet<DelegationSignerData> dsData) { public static SecDnsInfoExtension create(ImmutableSet<DomainDsData> dsData) {
SecDnsInfoExtension instance = new SecDnsInfoExtension(); SecDnsInfoExtension instance = new SecDnsInfoExtension();
instance.dsData = dsData; instance.dsData = dsData;
return instance; return instance;

View file

@ -70,9 +70,9 @@ public class SecDnsUpdateExtension extends ImmutableObject implements CommandExt
@XmlTransient @XmlTransient
abstract static class AddRemoveBase extends ImmutableObject { abstract static class AddRemoveBase extends ImmutableObject {
/** Delegations to add or remove. */ /** Delegations to add or remove. */
Set<DelegationSignerData> dsData; Set<DomainDsData> dsData;
public ImmutableSet<DelegationSignerData> getDsData() { public ImmutableSet<DomainDsData> getDsData() {
return nullToEmptyImmutableCopy(dsData); return nullToEmptyImmutableCopy(dsData);
} }
} }

View file

@ -35,7 +35,6 @@ import java.util.Set;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.persistence.Access; import javax.persistence.Access;
import javax.persistence.AccessType; import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Embeddable; import javax.persistence.Embeddable;
import javax.persistence.MappedSuperclass; import javax.persistence.MappedSuperclass;
import org.joda.time.DateTime; import org.joda.time.DateTime;
@ -64,10 +63,7 @@ public class HostBase extends EppResource {
* from (creationTime, deletionTime) there can only be one host in Datastore with this name. * from (creationTime, deletionTime) there can only be one host in Datastore with this name.
* However, there can be many hosts with the same name and non-overlapping lifetimes. * However, there can be many hosts with the same name and non-overlapping lifetimes.
*/ */
// TODO(b/177567432): Rename this to hostName when we are off Datastore @Index String hostName;
@Index
@Column(name = "hostName")
String fullyQualifiedHostName;
/** IP Addresses for this host. Can be null if this is an external host. */ /** IP Addresses for this host. Can be null if this is an external host. */
@Index Set<InetAddress> inetAddresses; @Index Set<InetAddress> inetAddresses;
@ -95,7 +91,7 @@ public class HostBase extends EppResource {
DateTime lastSuperordinateChange; DateTime lastSuperordinateChange;
public String getHostName() { public String getHostName() {
return fullyQualifiedHostName; return hostName;
} }
public VKey<Domain> getSuperordinateDomain() { public VKey<Domain> getSuperordinateDomain() {
@ -120,7 +116,7 @@ public class HostBase extends EppResource {
@Override @Override
public String getForeignKey() { public String getForeignKey() {
return fullyQualifiedHostName; return hostName;
} }
@Override @Override
@ -197,7 +193,7 @@ public class HostBase extends EppResource {
hostName.equals(canonicalizeHostname(hostName)), hostName.equals(canonicalizeHostname(hostName)),
"Host name %s not in puny-coded, lower-case form", "Host name %s not in puny-coded, lower-case form",
hostName); hostName);
getInstance().fullyQualifiedHostName = hostName; getInstance().hostName = hostName;
return thisCastToDerived(); return thisCastToDerived();
} }

View file

@ -36,7 +36,7 @@ public class HostCommand {
@XmlTransient @XmlTransient
abstract static class HostCreateOrChange extends AbstractSingleResourceCommand abstract static class HostCreateOrChange extends AbstractSingleResourceCommand
implements ResourceCreateOrChange<Host.Builder> { implements ResourceCreateOrChange<Host.Builder> {
public String getFullyQualifiedHostName() { public String getHostName() {
return getTargetId(); return getTargetId();
} }
} }

View file

@ -28,23 +28,25 @@ import org.joda.time.DateTime;
/** The {@link ResponseData} returned for an EPP info flow on a host. */ /** The {@link ResponseData} returned for an EPP info flow on a host. */
@XmlRootElement(name = "infData") @XmlRootElement(name = "infData")
@XmlType(propOrder = { @XmlType(
"fullyQualifiedHostName", propOrder = {
"repoId", "hostName",
"statusValues", "repoId",
"inetAddresses", "statusValues",
"currentSponsorClientId", "inetAddresses",
"creationClientId", "currentSponsorClientId",
"creationTime", "creationClientId",
"lastEppUpdateClientId", "creationTime",
"lastEppUpdateTime", "lastEppUpdateClientId",
"lastTransferTime" }) "lastEppUpdateTime",
"lastTransferTime"
})
@AutoValue @AutoValue
@CopyAnnotations @CopyAnnotations
public abstract class HostInfoData implements ResponseData { public abstract class HostInfoData implements ResponseData {
@XmlElement(name = "name") @XmlElement(name = "name")
abstract String getFullyQualifiedHostName(); abstract String getHostName();
@XmlElement(name = "roid") @XmlElement(name = "roid")
abstract String getRepoId(); abstract String getRepoId();
@ -79,7 +81,8 @@ public abstract class HostInfoData implements ResponseData {
/** Builder for {@link HostInfoData}. */ /** Builder for {@link HostInfoData}. */
@AutoValue.Builder @AutoValue.Builder
public abstract static class Builder { public abstract static class Builder {
public abstract Builder setFullyQualifiedHostName(String fullyQualifiedHostName); public abstract Builder setHostName(String hostName);
public abstract Builder setRepoId(String repoId); public abstract Builder setRepoId(String repoId);
public abstract Builder setStatusValues(ImmutableSet<StatusValue> statusValues); public abstract Builder setStatusValues(ImmutableSet<StatusValue> statusValues);
public abstract Builder setInetAddresses(ImmutableSet<InetAddress> inetAddresses); public abstract Builder setInetAddresses(ImmutableSet<InetAddress> inetAddresses);

View file

@ -91,10 +91,10 @@ public class PendingActionNotificationResponse extends ImmutableObject
} }
public static DomainPendingActionNotificationResponse create( public static DomainPendingActionNotificationResponse create(
String fullyQualifiedDomainName, boolean actionResult, Trid trid, DateTime processedDate) { String domainName, boolean actionResult, Trid trid, DateTime processedDate) {
return init( return init(
new DomainPendingActionNotificationResponse(), new DomainPendingActionNotificationResponse(),
fullyQualifiedDomainName, domainName,
actionResult, actionResult,
trid, trid,
processedDate); processedDate);
@ -140,13 +140,9 @@ public class PendingActionNotificationResponse extends ImmutableObject
} }
public static HostPendingActionNotificationResponse create( public static HostPendingActionNotificationResponse create(
String fullyQualifiedHostName, boolean actionResult, Trid trid, DateTime processedDate) { String hostName, boolean actionResult, Trid trid, DateTime processedDate) {
return init( return init(
new HostPendingActionNotificationResponse(), new HostPendingActionNotificationResponse(), hostName, actionResult, trid, processedDate);
fullyQualifiedHostName,
actionResult,
trid,
processedDate);
} }
} }
} }

View file

@ -386,7 +386,7 @@ public abstract class PollMessage extends ImmutableObject
TransferResponse transferResponse; TransferResponse transferResponse;
@Column(name = "transfer_response_domain_name") @Column(name = "transfer_response_domain_name")
String fullyQualifiedDomainName; String domainName;
@Column(name = "transfer_response_domain_expiration_time") @Column(name = "transfer_response_domain_expiration_time")
DateTime extendedRegistrationExpirationTime; DateTime extendedRegistrationExpirationTime;
@ -427,7 +427,7 @@ public abstract class PollMessage extends ImmutableObject
pendingActionNotificationResponse.getActionResult(), pendingActionNotificationResponse.getActionResult(),
pendingActionNotificationResponse.getTrid(), pendingActionNotificationResponse.getTrid(),
pendingActionNotificationResponse.processedDate); pendingActionNotificationResponse.processedDate);
} else if (fullyQualifiedDomainName != null) { } else if (domainName != null) {
pendingActionNotificationResponse = pendingActionNotificationResponse =
DomainPendingActionNotificationResponse.create( DomainPendingActionNotificationResponse.create(
pendingActionNotificationResponse.nameOrId.value, pendingActionNotificationResponse.nameOrId.value,
@ -457,10 +457,10 @@ public abstract class PollMessage extends ImmutableObject
.setPendingTransferExpirationTime( .setPendingTransferExpirationTime(
transferResponse.getPendingTransferExpirationTime()) transferResponse.getPendingTransferExpirationTime())
.build(); .build();
} else if (fullyQualifiedDomainName != null) { } else if (domainName != null) {
transferResponse = transferResponse =
new DomainTransferResponse.Builder() new DomainTransferResponse.Builder()
.setFullyQualifiedDomainName(fullyQualifiedDomainName) .setDomainName(domainName)
.setGainingRegistrarId(transferResponse.getGainingRegistrarId()) .setGainingRegistrarId(transferResponse.getGainingRegistrarId())
.setLosingRegistrarId(transferResponse.getLosingRegistrarId()) .setLosingRegistrarId(transferResponse.getLosingRegistrarId())
.setTransferStatus(transferResponse.getTransferStatus()) .setTransferStatus(transferResponse.getTransferStatus())
@ -486,7 +486,7 @@ public abstract class PollMessage extends ImmutableObject
OneTime instance = getInstance(); OneTime instance = getInstance();
// Note: In its current form, the code will basically just ignore everything but the first // Note: In its current form, the code will basically just ignore everything but the first
// PendingActionNotificationResponse and TransferResponse in responseData, and will override // PendingActionNotificationResponse and TransferResponse in responseData, and will override
// any identifier fields (e.g. contactId, fullyQualifiedDomainName) obtained from the // any identifier fields (e.g. contactId, domainName) obtained from the
// PendingActionNotificationResponse if a TransferResponse is found with different values // PendingActionNotificationResponse if a TransferResponse is found with different values
// for those fields. It is not clear what the constraints should be on this data or // for those fields. It is not clear what the constraints should be on this data or
// whether we should enforce them here, though historically we have not, so the current // whether we should enforce them here, though historically we have not, so the current
@ -507,8 +507,7 @@ public abstract class PollMessage extends ImmutableObject
instance.contactId = instance.pendingActionNotificationResponse.nameOrId.value; instance.contactId = instance.pendingActionNotificationResponse.nameOrId.value;
} else if (instance.pendingActionNotificationResponse } else if (instance.pendingActionNotificationResponse
instanceof DomainPendingActionNotificationResponse) { instanceof DomainPendingActionNotificationResponse) {
instance.fullyQualifiedDomainName = instance.domainName = instance.pendingActionNotificationResponse.nameOrId.value;
instance.pendingActionNotificationResponse.nameOrId.value;
} else if (instance.pendingActionNotificationResponse } else if (instance.pendingActionNotificationResponse
instanceof HostPendingActionNotificationResponse) { instanceof HostPendingActionNotificationResponse) {
instance.hostId = instance.pendingActionNotificationResponse.nameOrId.value; instance.hostId = instance.pendingActionNotificationResponse.nameOrId.value;
@ -527,7 +526,7 @@ public abstract class PollMessage extends ImmutableObject
instance.contactId = ((ContactTransferResponse) instance.transferResponse).getContactId(); instance.contactId = ((ContactTransferResponse) instance.transferResponse).getContactId();
} else if (instance.transferResponse instanceof DomainTransferResponse) { } else if (instance.transferResponse instanceof DomainTransferResponse) {
DomainTransferResponse response = (DomainTransferResponse) instance.transferResponse; DomainTransferResponse response = (DomainTransferResponse) instance.transferResponse;
instance.fullyQualifiedDomainName = response.getFullyQualifiedDomainName(); instance.domainName = response.getDomainName();
instance.extendedRegistrationExpirationTime = instance.extendedRegistrationExpirationTime =
response.getExtendedRegistrationExpirationTime(); response.getExtendedRegistrationExpirationTime();
} }

View file

@ -28,10 +28,10 @@ public interface PremiumPricingEngine {
/** /**
* Returns the prices for the given fully qualified domain name at the given time. * Returns the prices for the given fully qualified domain name at the given time.
* *
* <p>Note that the fullyQualifiedDomainName must only contain a single part left of the TLD, i.e. * <p>Note that the domainName must only contain a single part left of the TLD, i.e. subdomains
* subdomains are not allowed, but multi-part TLDs are. * are not allowed, but multi-part TLDs are.
*/ */
DomainPrices getDomainPrices(String fullyQualifiedDomainName, DateTime priceTime); DomainPrices getDomainPrices(String domainName, DateTime priceTime);
/** /**
* A class containing information on premium prices for a specific domain name. * A class containing information on premium prices for a specific domain name.

View file

@ -34,9 +34,9 @@ public final class StaticPremiumListPricingEngine implements PremiumPricingEngin
@Inject StaticPremiumListPricingEngine() {} @Inject StaticPremiumListPricingEngine() {}
@Override @Override
public DomainPrices getDomainPrices(String fullyQualifiedDomainName, DateTime priceTime) { public DomainPrices getDomainPrices(String domainName, DateTime priceTime) {
String tld = getTldFromDomainName(fullyQualifiedDomainName); String tld = getTldFromDomainName(domainName);
String label = InternetDomainName.from(fullyQualifiedDomainName).parts().get(0); String label = InternetDomainName.from(domainName).parts().get(0);
Registry registry = Registry.get(checkNotNull(tld, "tld")); Registry registry = Registry.get(checkNotNull(tld, "tld"));
Optional<Money> premiumPrice = Optional<Money> premiumPrice =
registry.getPremiumListName().flatMap(pl -> PremiumListDao.getPremiumPrice(pl, label)); registry.getPremiumListName().flatMap(pl -> PremiumListDao.getPremiumPrice(pl, label));

View file

@ -207,11 +207,10 @@ public class Registrar extends ImmutableObject
* Unique registrar client id. Must conform to "clIDType" as defined in RFC5730. * Unique registrar client id. Must conform to "clIDType" as defined in RFC5730.
* *
* @see <a href="http://tools.ietf.org/html/rfc5730#section-4.2">Shared Structure Schema</a> * @see <a href="http://tools.ietf.org/html/rfc5730#section-4.2">Shared Structure Schema</a>
* <p>TODO(b/177567432): Rename this field to registrarId.
*/ */
@Id @Id
@Column(name = "registrarId", nullable = false) @Column(nullable = false)
String clientIdentifier; String registrarId;
/** /**
* Registrar name. This is a distinct from the client identifier since there are no restrictions * Registrar name. This is a distinct from the client identifier since there are no restrictions
@ -270,9 +269,7 @@ public class Registrar extends ImmutableObject
String failoverClientCertificateHash; String failoverClientCertificateHash;
/** An allow list of netmasks (in CIDR notation) which the client is allowed to connect from. */ /** An allow list of netmasks (in CIDR notation) which the client is allowed to connect from. */
// TODO(b/177567432): Rename to ipAddressAllowList once Cloud SQL migration is complete. List<CidrAddressBlock> ipAddressAllowList;
@Column(name = "ip_address_allow_list")
List<CidrAddressBlock> ipAddressWhitelist;
/** A hashed password for EPP access. The hash is a base64 encoded SHA256 string. */ /** A hashed password for EPP access. The hash is a base64 encoded SHA256 string. */
String passwordHash; String passwordHash;
@ -408,7 +405,7 @@ public class Registrar extends ImmutableObject
boolean registryLockAllowed = false; boolean registryLockAllowed = false;
public String getRegistrarId() { public String getRegistrarId() {
return clientIdentifier; return registrarId;
} }
public DateTime getCreationTime() { public DateTime getCreationTime() {
@ -498,7 +495,7 @@ public class Registrar extends ImmutableObject
} }
public ImmutableList<CidrAddressBlock> getIpAddressAllowList() { public ImmutableList<CidrAddressBlock> getIpAddressAllowList() {
return nullToEmptyImmutableCopy(ipAddressWhitelist); return nullToEmptyImmutableCopy(ipAddressAllowList);
} }
public RegistrarAddress getLocalizedAddress() { public RegistrarAddress getLocalizedAddress() {
@ -587,7 +584,7 @@ public class Registrar extends ImmutableObject
() -> () ->
jpaTm() jpaTm()
.query("FROM RegistrarPoc WHERE registrarId = :registrarId", RegistrarPoc.class) .query("FROM RegistrarPoc WHERE registrarId = :registrarId", RegistrarPoc.class)
.setParameter("registrarId", clientIdentifier) .setParameter("registrarId", registrarId)
.getResultStream() .getResultStream()
.collect(toImmutableList())); .collect(toImmutableList()));
} }
@ -595,7 +592,7 @@ public class Registrar extends ImmutableObject
@Override @Override
public Map<String, Object> toJsonMap() { public Map<String, Object> toJsonMap() {
return new JsonMapBuilder() return new JsonMapBuilder()
.put("clientIdentifier", clientIdentifier) .put("registrarId", registrarId)
.put("ianaIdentifier", ianaIdentifier) .put("ianaIdentifier", ianaIdentifier)
.putString("creationTime", creationTime.getTimestamp()) .putString("creationTime", creationTime.getTimestamp())
.putString("lastUpdateTime", lastUpdateTime.getTimestamp()) .putString("lastUpdateTime", lastUpdateTime.getTimestamp())
@ -655,7 +652,7 @@ public class Registrar extends ImmutableObject
/** Creates a {@link VKey} for this instance. */ /** Creates a {@link VKey} for this instance. */
@Override @Override
public VKey<Registrar> createVKey() { public VKey<Registrar> createVKey() {
return createVKey(clientIdentifier); return createVKey(registrarId);
} }
/** Creates a {@link VKey} for the given {@code registrarId}. */ /** Creates a {@link VKey} for the given {@code registrarId}. */
@ -678,7 +675,7 @@ public class Registrar extends ImmutableObject
checkArgument( checkArgument(
Range.closed(3, 16).contains(registrarId.length()), Range.closed(3, 16).contains(registrarId.length()),
"Registrar ID must be 3-16 characters long."); "Registrar ID must be 3-16 characters long.");
getInstance().clientIdentifier = registrarId; getInstance().registrarId = registrarId;
return this; return this;
} }
@ -796,7 +793,7 @@ public class Registrar extends ImmutableObject
} }
public Builder setIpAddressAllowList(Iterable<CidrAddressBlock> ipAddressAllowList) { public Builder setIpAddressAllowList(Iterable<CidrAddressBlock> ipAddressAllowList) {
getInstance().ipAddressWhitelist = ImmutableList.copyOf(ipAddressAllowList); getInstance().ipAddressAllowList = ImmutableList.copyOf(ipAddressAllowList);
return this; return this;
} }

View file

@ -72,11 +72,9 @@ public class ClaimsList extends ImmutableObject {
* <p>Note that the value of this field is parsed from the claims list file(See this <a * <p>Note that the value of this field is parsed from the claims list file(See this <a
* href="https://tools.ietf.org/html/draft-lozano-tmch-func-spec-08#section-6.1">RFC</>), it is * href="https://tools.ietf.org/html/draft-lozano-tmch-func-spec-08#section-6.1">RFC</>), it is
* the DNL List creation datetime from the rfc. * the DNL List creation datetime from the rfc.
*
* <p>TODO(b/177567432): Rename this field to tmdbGenerationTime.
*/ */
@Column(name = "tmdb_generation_time", nullable = false) @Column(nullable = false)
DateTime creationTime; DateTime tmdbGenerationTime;
/** /**
* A map from labels to claims keys. * A map from labels to claims keys.
@ -143,7 +141,7 @@ public class ClaimsList extends ImmutableObject {
* creation datetime</a> * creation datetime</a>
*/ */
public DateTime getTmdbGenerationTime() { public DateTime getTmdbGenerationTime() {
return creationTime; return tmdbGenerationTime;
} }
/** Returns the creation time of this claims list. */ /** Returns the creation time of this claims list. */
@ -225,7 +223,7 @@ public class ClaimsList extends ImmutableObject {
public static ClaimsList create( public static ClaimsList create(
DateTime tmdbGenerationTime, ImmutableMap<String, String> labelsToKeys) { DateTime tmdbGenerationTime, ImmutableMap<String, String> labelsToKeys) {
ClaimsList instance = new ClaimsList(); ClaimsList instance = new ClaimsList();
instance.creationTime = checkNotNull(tmdbGenerationTime); instance.tmdbGenerationTime = checkNotNull(tmdbGenerationTime);
instance.labelsToKeys = checkNotNull(labelsToKeys); instance.labelsToKeys = checkNotNull(labelsToKeys);
return instance; return instance;
} }

View file

@ -33,22 +33,24 @@ public class TransferResponse extends BaseTransferObject implements ResponseData
/** An adapter to output the XML in response to a transfer command on a domain. */ /** An adapter to output the XML in response to a transfer command on a domain. */
@XmlRootElement(name = "trnData", namespace = "urn:ietf:params:xml:ns:domain-1.0") @XmlRootElement(name = "trnData", namespace = "urn:ietf:params:xml:ns:domain-1.0")
@XmlType(propOrder = { @XmlType(
"fullyQualifiedDomainName", propOrder = {
"transferStatus", "domainName",
"gainingClientId", "transferStatus",
"transferRequestTime", "gainingClientId",
"losingClientId", "transferRequestTime",
"pendingTransferExpirationTime", "losingClientId",
"extendedRegistrationExpirationTime"}, "pendingTransferExpirationTime",
namespace = "urn:ietf:params:xml:ns:domain-1.0") "extendedRegistrationExpirationTime"
},
namespace = "urn:ietf:params:xml:ns:domain-1.0")
public static class DomainTransferResponse extends TransferResponse { public static class DomainTransferResponse extends TransferResponse {
@XmlElement(name = "name") @XmlElement(name = "name")
String fullyQualifiedDomainName; String domainName;
public String getFullyQualifiedDomainName() { public String getDomainName() {
return fullyQualifiedDomainName; return domainName;
} }
/** /**
@ -65,8 +67,8 @@ public class TransferResponse extends BaseTransferObject implements ResponseData
/** Builder for {@link DomainTransferResponse}. */ /** Builder for {@link DomainTransferResponse}. */
public static class Builder public static class Builder
extends BaseTransferObject.Builder<DomainTransferResponse, Builder> { extends BaseTransferObject.Builder<DomainTransferResponse, Builder> {
public Builder setFullyQualifiedDomainName(String fullyQualifiedDomainName) { public Builder setDomainName(String domainName) {
getInstance().fullyQualifiedDomainName = fullyQualifiedDomainName; getInstance().domainName = domainName;
return this; return this;
} }

View file

@ -61,7 +61,7 @@ public interface JpaTransactionManager extends TransactionManager {
*/ */
<T> TypedQuery<T> query(String sqlString, Class<T> resultClass); <T> TypedQuery<T> query(String sqlString, Class<T> resultClass);
/** Creates a JPA SQU query for the given criteria query. */ /** Creates a JPA SQL query for the given criteria query. */
<T> TypedQuery<T> criteriaQuery(CriteriaQuery<T> criteriaQuery); <T> TypedQuery<T> criteriaQuery(CriteriaQuery<T> criteriaQuery);
/** /**

View file

@ -199,13 +199,12 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
final RdapSearchPattern partialStringQuery) { final RdapSearchPattern partialStringQuery) {
// We can't query for undeleted domains as part of the query itself; that would require an // We can't query for undeleted domains as part of the query itself; that would require an
// inequality query on deletion time, and we are already using inequality queries on // inequality query on deletion time, and we are already using inequality queries on
// fullyQualifiedDomainName. So we instead pick an arbitrary limit of // domainName. So we instead pick an arbitrary limit of RESULT_SET_SIZE_SCALING_FACTOR times the
// RESULT_SET_SIZE_SCALING_FACTOR times the result set size limit, fetch up to that many, and // result set size limit, fetch up to that many, and weed out all deleted domains. If there
// weed out all deleted domains. If there still isn't a full result set's worth of domains, we // still isn't a full result set's worth of domains, we give up and return just the ones we
// give up and return just the ones we found. Don't use queryItems, because it checks that the // found. Don't use queryItems, because it checks that the initial string is at least a certain
// initial string is at least a certain length, which we don't need in this case. Query the // length, which we don't need in this case. Query the domains directly, rather than the foreign
// domains directly, rather than the foreign keys, because then we have an index on TLD if we // keys, because then we have an index on TLD if we need it.
// need it.
int querySizeLimit = RESULT_SET_SIZE_SCALING_FACTOR * rdapResultSetMaxSize; int querySizeLimit = RESULT_SET_SIZE_SCALING_FACTOR * rdapResultSetMaxSize;
RdapResultSet<Domain> resultSet; RdapResultSet<Domain> resultSet;
if (tm().isOfy()) { if (tm().isOfy()) {
@ -213,10 +212,10 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
auditedOfy() auditedOfy()
.load() .load()
.type(Domain.class) .type(Domain.class)
.filter("fullyQualifiedDomainName <", partialStringQuery.getNextInitialString()) .filter("domainName <", partialStringQuery.getNextInitialString())
.filter("fullyQualifiedDomainName >=", partialStringQuery.getInitialString()); .filter("domainName >=", partialStringQuery.getInitialString());
if (cursorString.isPresent()) { if (cursorString.isPresent()) {
query = query.filter("fullyQualifiedDomainName >", cursorString.get()); query = query.filter("domainName >", cursorString.get());
} }
if (partialStringQuery.getSuffix() != null) { if (partialStringQuery.getSuffix() != null) {
query = query.filter("tld", partialStringQuery.getSuffix()); query = query.filter("tld", partialStringQuery.getSuffix());
@ -234,16 +233,14 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
CriteriaQueryBuilder<Domain> queryBuilder = CriteriaQueryBuilder<Domain> queryBuilder =
CriteriaQueryBuilder.create(replicaJpaTm(), Domain.class) CriteriaQueryBuilder.create(replicaJpaTm(), Domain.class)
.where( .where(
"fullyQualifiedDomainName", "domainName",
criteriaBuilder::like, criteriaBuilder::like,
String.format("%s%%", partialStringQuery.getInitialString())) String.format("%s%%", partialStringQuery.getInitialString()))
.orderByAsc("fullyQualifiedDomainName"); .orderByAsc("domainName");
if (cursorString.isPresent()) { if (cursorString.isPresent()) {
queryBuilder = queryBuilder =
queryBuilder.where( queryBuilder.where(
"fullyQualifiedDomainName", "domainName", criteriaBuilder::greaterThan, cursorString.get());
criteriaBuilder::greaterThan,
cursorString.get());
} }
if (partialStringQuery.getSuffix() != null) { if (partialStringQuery.getSuffix() != null) {
queryBuilder = queryBuilder =
@ -258,18 +255,18 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
/** Searches for domains by domain name with a TLD suffix. */ /** Searches for domains by domain name with a TLD suffix. */
private DomainSearchResponse searchByDomainNameByTld(String tld) { private DomainSearchResponse searchByDomainNameByTld(String tld) {
// Even though we are not searching on fullyQualifiedDomainName, we want the results to come // Even though we are not searching on domainName, we want the results to come back ordered by
// back ordered by name, so we are still in the same boat as // name, so we are still in the same boat as searchByDomainNameWithInitialString, unable to
// searchByDomainNameWithInitialString, unable to perform an inequality query on deletion time. // perform an inequality query on deletion time. Don't use queryItems, because it doesn't handle
// Don't use queryItems, because it doesn't handle pending deletes. // pending deletes.
int querySizeLimit = RESULT_SET_SIZE_SCALING_FACTOR * rdapResultSetMaxSize; int querySizeLimit = RESULT_SET_SIZE_SCALING_FACTOR * rdapResultSetMaxSize;
RdapResultSet<Domain> resultSet; RdapResultSet<Domain> resultSet;
if (tm().isOfy()) { if (tm().isOfy()) {
Query<Domain> query = auditedOfy().load().type(Domain.class).filter("tld", tld); Query<Domain> query = auditedOfy().load().type(Domain.class).filter("tld", tld);
if (cursorString.isPresent()) { if (cursorString.isPresent()) {
query = query.filter("fullyQualifiedDomainName >", cursorString.get()); query = query.filter("domainName >", cursorString.get());
} }
query = query.order("fullyQualifiedDomainName").limit(querySizeLimit); query = query.order("domainName").limit(querySizeLimit);
resultSet = getMatchingResources(query, true, querySizeLimit); resultSet = getMatchingResources(query, true, querySizeLimit);
} else { } else {
resultSet = resultSet =
@ -281,10 +278,10 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
Domain.class, Domain.class,
"tld", "tld",
tld, tld,
Optional.of("fullyQualifiedDomainName"), Optional.of("domainName"),
cursorString, cursorString,
DeletedItemHandling.INCLUDE) DeletedItemHandling.INCLUDE)
.orderByAsc("fullyQualifiedDomainName"); .orderByAsc("domainName");
return getMatchingResourcesSql(builder, true, querySizeLimit); return getMatchingResourcesSql(builder, true, querySizeLimit);
}); });
} }
@ -344,7 +341,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
Query<Host> query = Query<Host> query =
queryItems( queryItems(
Host.class, Host.class,
"fullyQualifiedHostName", "hostName",
partialStringQuery, partialStringQuery,
Optional.empty(), Optional.empty(),
DeletedItemHandling.EXCLUDE, DeletedItemHandling.EXCLUDE,
@ -362,7 +359,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
CriteriaQueryBuilder<Host> builder = CriteriaQueryBuilder<Host> builder =
queryItemsSql( queryItemsSql(
Host.class, Host.class,
"fullyQualifiedHostName", "hostName",
partialStringQuery, partialStringQuery,
Optional.empty(), Optional.empty(),
DeletedItemHandling.EXCLUDE); DeletedItemHandling.EXCLUDE);
@ -558,7 +555,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
// If we are not performing an inequality query, we can filter on the cursor in the query. // If we are not performing an inequality query, we can filter on the cursor in the query.
// Otherwise, we will need to filter the results afterward. // Otherwise, we will need to filter the results afterward.
} else if (cursorString.isPresent()) { } else if (cursorString.isPresent()) {
query = query.filter("fullyQualifiedDomainName >", cursorString.get()); query = query.filter("domainName >", cursorString.get());
} }
Stream<Domain> stream = Streams.stream(query).filter(this::isAuthorized); Stream<Domain> stream = Streams.stream(query).filter(this::isAuthorized);
if (cursorString.isPresent()) { if (cursorString.isPresent()) {
@ -574,7 +571,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
CriteriaQueryBuilder<Domain> queryBuilder = CriteriaQueryBuilder<Domain> queryBuilder =
CriteriaQueryBuilder.create(replicaJpaTm(), Domain.class) CriteriaQueryBuilder.create(replicaJpaTm(), Domain.class)
.whereFieldContains("nsHosts", hostKey) .whereFieldContains("nsHosts", hostKey)
.orderByAsc("fullyQualifiedDomainName"); .orderByAsc("domainName");
CriteriaBuilder criteriaBuilder = CriteriaBuilder criteriaBuilder =
replicaJpaTm().getEntityManager().getCriteriaBuilder(); replicaJpaTm().getEntityManager().getCriteriaBuilder();
if (!shouldIncludeDeleted()) { if (!shouldIncludeDeleted()) {
@ -585,9 +582,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
if (cursorString.isPresent()) { if (cursorString.isPresent()) {
queryBuilder = queryBuilder =
queryBuilder.where( queryBuilder.where(
"fullyQualifiedDomainName", "domainName", criteriaBuilder::greaterThan, cursorString.get());
criteriaBuilder::greaterThan,
cursorString.get());
} }
replicaJpaTm() replicaJpaTm()
.criteriaQuery(queryBuilder.build()) .criteriaQuery(queryBuilder.build())

View file

@ -223,7 +223,7 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase {
Query<Host> query = Query<Host> query =
queryItems( queryItems(
Host.class, Host.class,
"fullyQualifiedHostName", "hostName",
partialStringQuery, partialStringQuery,
cursorString, cursorString,
getDeletedItemHandling(), getDeletedItemHandling(),
@ -237,7 +237,7 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase {
CriteriaQueryBuilder<Host> queryBuilder = CriteriaQueryBuilder<Host> queryBuilder =
queryItemsSql( queryItemsSql(
Host.class, Host.class,
"fullyQualifiedHostName", "hostName",
partialStringQuery, partialStringQuery,
cursorString, cursorString,
getDeletedItemHandling()); getDeletedItemHandling());

View file

@ -25,7 +25,7 @@ import com.google.gson.Gson;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive; import com.google.gson.JsonPrimitive;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.rdap.AbstractJsonableObject.RestrictJsonNames; import google.registry.rdap.AbstractJsonableObject.RestrictJsonNames;
import google.registry.rdap.RdapDataStructures.Event; import google.registry.rdap.RdapDataStructures.Event;
import google.registry.rdap.RdapDataStructures.EventWithoutActor; import google.registry.rdap.RdapDataStructures.EventWithoutActor;
@ -444,7 +444,7 @@ final class RdapObjectClasses {
@JsonableElement @JsonableElement
abstract int digestType(); abstract int digestType();
static DsData create(DelegationSignerData dsData) { static DsData create(DomainDsData dsData) {
return new AutoValue_RdapObjectClasses_SecureDns_DsData( return new AutoValue_RdapObjectClasses_SecureDns_DsData(
dsData.getKeyTag(), dsData.getKeyTag(),
dsData.getAlgorithm(), dsData.getAlgorithm(),
@ -490,7 +490,7 @@ final class RdapObjectClasses {
abstract ImmutableList.Builder<DsData> dsDataBuilder(); abstract ImmutableList.Builder<DsData> dsDataBuilder();
Builder addDsData(DelegationSignerData dsData) { Builder addDsData(DomainDsData dsData) {
dsDataBuilder().add(DsData.create(dsData)); dsDataBuilder().add(DsData.create(dsData));
return this; return this;
} }

View file

@ -25,7 +25,7 @@ import google.registry.model.contact.Contact;
import google.registry.model.domain.DesignatedContact; import google.registry.model.domain.DesignatedContact;
import google.registry.model.domain.Domain; import google.registry.model.domain.Domain;
import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.rgp.GracePeriodStatus;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.rde.RdeMode; import google.registry.model.rde.RdeMode;
import google.registry.model.transfer.DomainTransferData; import google.registry.model.transfer.DomainTransferData;
@ -197,7 +197,7 @@ final class DomainToXjcConverter {
// completely useless. // completely useless.
if (!model.getDsData().isEmpty()) { if (!model.getDsData().isEmpty()) {
XjcSecdnsDsOrKeyType secdns = new XjcSecdnsDsOrKeyType(); XjcSecdnsDsOrKeyType secdns = new XjcSecdnsDsOrKeyType();
for (DelegationSignerData ds : model.getDsData()) { for (DomainDsData ds : model.getDsData()) {
secdns.getDsDatas().add(convertDelegationSignerData(ds)); secdns.getDsDatas().add(convertDelegationSignerData(ds));
} }
bean.setSecDNS(secdns); bean.setSecDNS(secdns);
@ -284,8 +284,8 @@ final class DomainToXjcConverter {
return bean; return bean;
} }
/** Converts {@link DelegationSignerData} to {@link XjcSecdnsDsDataType}. */ /** Converts {@link DomainDsData} to {@link XjcSecdnsDsDataType}. */
private static XjcSecdnsDsDataType convertDelegationSignerData(DelegationSignerData model) { private static XjcSecdnsDsDataType convertDelegationSignerData(DomainDsData model) {
XjcSecdnsDsDataType bean = new XjcSecdnsDsDataType(); XjcSecdnsDsDataType bean = new XjcSecdnsDsDataType();
bean.setKeyTag(model.getKeyTag()); bean.setKeyTag(model.getKeyTag());
bean.setAlg((short) model.getAlgorithm()); bean.setAlg((short) model.getAlgorithm());

View file

@ -15,7 +15,7 @@
-- Determine the number of domains each registrar sponsors per tld. -- Determine the number of domains each registrar sponsors per tld.
-- This is just the number of fullyQualifiedDomainNames under each -- This is just the number of domainNames under each
-- tld-registrar pair. -- tld-registrar pair.
SELECT SELECT

View file

@ -137,10 +137,7 @@ public class Spec11EmailUtils {
threatMatch -> threatMatch ->
tm() tm()
.createQueryComposer(Domain.class) .createQueryComposer(Domain.class)
.where( .where("domainName", Comparator.EQ, threatMatch.domainName())
"fullyQualifiedDomainName",
Comparator.EQ,
threatMatch.fullyQualifiedDomainName())
.stream() .stream()
.anyMatch(Domain::shouldPublishToDns)) .anyMatch(Domain::shouldPublishToDns))
.collect(toImmutableList()); .collect(toImmutableList());
@ -176,7 +173,7 @@ public class Spec11EmailUtils {
.map( .map(
threatMatch -> threatMatch ->
ImmutableMap.of( ImmutableMap.of(
"fullyQualifiedDomainName", threatMatch.fullyQualifiedDomainName(), "domainName", threatMatch.domainName(),
"threatType", threatMatch.threatType())) "threatType", threatMatch.threatType()))
.collect(toImmutableList()); .collect(toImmutableList());

View file

@ -316,7 +316,7 @@ public class AuthenticatedRegistrarAccessor {
jpaTm() jpaTm()
.query( .query(
"SELECT r FROM Registrar r INNER JOIN RegistrarPoc rp ON " "SELECT r FROM Registrar r INNER JOIN RegistrarPoc rp ON "
+ "r.clientIdentifier = rp.registrarId WHERE rp.gaeUserId = " + "r.registrarId = rp.registrarId WHERE rp.gaeUserId = "
+ ":gaeUserId AND r.state != :state", + ":gaeUserId AND r.state != :state",
Registrar.class) Registrar.class)
.setParameter("gaeUserId", user.getUserId()) .setParameter("gaeUserId", user.getUserId())

View file

@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableSortedSet;
import com.google.template.soy.data.SoyListData; import com.google.template.soy.data.SoyListData;
import com.google.template.soy.data.SoyMapData; import com.google.template.soy.data.SoyMapData;
import google.registry.model.domain.Domain; import google.registry.model.domain.Domain;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.tools.soy.DomainRenewSoyInfo; import google.registry.tools.soy.DomainRenewSoyInfo;
@ -232,7 +232,7 @@ final class UniformRapidSuspensionCommand extends MutatingEppToolCommand {
private ImmutableList<ImmutableMap<String, Object>> getExistingDsData(Domain domain) { private ImmutableList<ImmutableMap<String, Object>> getExistingDsData(Domain domain) {
ImmutableList.Builder<ImmutableMap<String, Object>> dsDataJsons = new ImmutableList.Builder(); ImmutableList.Builder<ImmutableMap<String, Object>> dsDataJsons = new ImmutableList.Builder();
HexBinaryAdapter hexBinaryAdapter = new HexBinaryAdapter(); HexBinaryAdapter hexBinaryAdapter = new HexBinaryAdapter();
for (DelegationSignerData dsData : domain.getDsData()) { for (DomainDsData dsData : domain.getDsData()) {
dsDataJsons.add( dsDataJsons.add(
ImmutableMap.of( ImmutableMap.of(
"keyTag", dsData.getKeyTag(), "keyTag", dsData.getKeyTag(),

View file

@ -30,7 +30,7 @@ import com.google.common.flogger.FluentLogger;
import google.registry.config.RegistryConfig.Config; import google.registry.config.RegistryConfig.Config;
import google.registry.gcs.GcsUtils; import google.registry.gcs.GcsUtils;
import google.registry.model.domain.Domain; import google.registry.model.domain.Domain;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.request.Action; import google.registry.request.Action;
import google.registry.request.HttpException.BadRequestException; import google.registry.request.HttpException.BadRequestException;
@ -241,7 +241,7 @@ public class GenerateZoneFilesAction implements Runnable, JsonActionRunner.JsonA
// Load the nameservers at the export time in case they've been renamed or deleted. // Load the nameservers at the export time in case they've been renamed or deleted.
loadAtPointInTime(nameserver, exportTime).getHostName())); loadAtPointInTime(nameserver, exportTime).getHostName()));
} }
for (DelegationSignerData dsData : domain.getDsData()) { for (DomainDsData dsData : domain.getDsData()) {
result.append( result.append(
String.format( String.format(
DS_FORMAT, DS_FORMAT,

View file

@ -69,7 +69,7 @@ public final class ListDomainsAction extends ListObjectsAction<Domain> {
@Override @Override
public ImmutableSet<String> getPrimaryKeyFields() { public ImmutableSet<String> getPrimaryKeyFields() {
return ImmutableSet.of("fullyQualifiedDomainName"); return ImmutableSet.of("domainName");
} }
@Override @Override

View file

@ -44,7 +44,7 @@ public final class ListHostsAction extends ListObjectsAction<Host> {
@Override @Override
public ImmutableSet<String> getPrimaryKeyFields() { public ImmutableSet<String> getPrimaryKeyFields() {
return ImmutableSet.of("fullyQualifiedHostName"); return ImmutableSet.of("hostName");
} }
@Override @Override

View file

@ -39,7 +39,7 @@ public final class ListRegistrarsAction extends ListObjectsAction<Registrar> {
@Override @Override
public ImmutableSet<String> getPrimaryKeyFields() { public ImmutableSet<String> getPrimaryKeyFields() {
return ImmutableSet.of("clientIdentifier"); return ImmutableSet.of("registrarId");
} }
@Override @Override
@ -51,7 +51,7 @@ public final class ListRegistrarsAction extends ListObjectsAction<Registrar> {
public ImmutableBiMap<String, String> getFieldAliases() { public ImmutableBiMap<String, String> getFieldAliases() {
return ImmutableBiMap.of( return ImmutableBiMap.of(
"billingId", "billingIdentifier", "billingId", "billingIdentifier",
"clientId", "clientIdentifier", "clientId", "registrarId",
"premiumNames", "blockPremiumNames"); "premiumNames", "blockPremiumNames");
} }

View file

@ -82,7 +82,7 @@ public class RefreshDnsForAllDomainsAction implements Runnable {
() -> () ->
jpaTm() jpaTm()
.query( .query(
"SELECT fullyQualifiedDomainName FROM Domain " "SELECT domainName FROM Domain "
+ "WHERE tld IN (:tlds) " + "WHERE tld IN (:tlds) "
+ "AND deletionTime > :now", + "AND deletionTime > :now",
String.class) String.class)

View file

@ -132,7 +132,7 @@ registry.json.Response.prototype.results;
/** /**
* @typedef {{ * @typedef {{
* allowedTlds: !Array<string>, * allowedTlds: !Array<string>,
* clientIdentifier: string, * registrarId: string,
* clientCertificate: string?, * clientCertificate: string?,
* clientCertificateHash: string?, * clientCertificateHash: string?,
* failoverClientCertificate: string?, * failoverClientCertificate: string?,

View file

@ -50,7 +50,7 @@
<class>google.registry.model.domain.DomainHistory</class> <class>google.registry.model.domain.DomainHistory</class>
<class>google.registry.model.domain.GracePeriod</class> <class>google.registry.model.domain.GracePeriod</class>
<class>google.registry.model.domain.GracePeriod$GracePeriodHistory</class> <class>google.registry.model.domain.GracePeriod$GracePeriodHistory</class>
<class>google.registry.model.domain.secdns.DelegationSignerData</class> <class>google.registry.model.domain.secdns.DomainDsData</class>
<class>google.registry.model.domain.secdns.DomainDsDataHistory</class> <class>google.registry.model.domain.secdns.DomainDsDataHistory</class>
<class>google.registry.model.domain.token.AllocationToken</class> <class>google.registry.model.domain.token.AllocationToken</class>
<class>google.registry.model.domain.token.PackagePromotion</class> <class>google.registry.model.domain.token.PackagePromotion</class>

View file

@ -26,7 +26,7 @@
-- query's performance and consider switching to using a native query. -- query's performance and consider switching to using a native query.
SELECT b, r FROM BillingEvent b SELECT b, r FROM BillingEvent b
JOIN Registrar r ON b.clientId = r.clientIdentifier JOIN Registrar r ON b.clientId = r.registrarId
JOIN Domain d ON b.domainRepoId = d.repoId JOIN Domain d ON b.domainRepoId = d.repoId
JOIN Tld t ON t.tldStr = d.tld JOIN Tld t ON t.tldStr = d.tld
LEFT JOIN BillingCancellation c ON b.id = c.refOneTime LEFT JOIN BillingCancellation c ON b.id = c.refOneTime

View file

@ -19,14 +19,14 @@
-- email address. -- email address.
SELECT SELECT
domain.fullyQualifiedDomainName AS domainName, domain.domainName AS domainName,
domain.__key__.name AS domainRepoId, domain.__key__.name AS domainRepoId,
registrar.clientId AS registrarId, registrar.clientId AS registrarId,
COALESCE(registrar.emailAddress, '') AS registrarEmailAddress COALESCE(registrar.emailAddress, '') AS registrarEmailAddress
FROM ( ( FROM ( (
SELECT SELECT
__key__, __key__,
fullyQualifiedDomainName, domainName,
currentSponsorClientId, currentSponsorClientId,
creationTime creationTime
FROM FROM

View file

@ -122,7 +122,7 @@
</tr> </tr>
{for $threat in $threats} {for $threat in $threats}
<tr> <tr>
<td>{$threat['fullyQualifiedDomainName']}</td> <td>{$threat['domainName']}</td>
<td>{$threat['threatType']}</td> <td>{$threat['threatType']}</td>
</tr> </tr>
{/for} {/for}

View file

@ -18,7 +18,7 @@
/** Registrar whois settings page for view and edit. */ /** Registrar whois settings page for view and edit. */
{template .settings} {template .settings}
{@param clientIdentifier: string} {@param registrarId: string}
{@param? ianaIdentifier: int} {@param? ianaIdentifier: int}
{@param? icannReferralEmail: string} {@param? icannReferralEmail: string}
{@param readonly: bool} {@param readonly: bool}
@ -40,8 +40,8 @@
<table> <table>
{call registry.soy.forms.inputFieldRowWithValue} {call registry.soy.forms.inputFieldRowWithValue}
{param label: 'Name' /} {param label: 'Name' /}
{param name: 'clientIdentifier' /} {param name: 'registrarId' /}
{param value: $clientIdentifier /} {param value: $registrarId /}
{param readonly: true /} {param readonly: true /}
{/call} {/call}
{call registry.soy.forms.inputFieldRowWithValue} {call registry.soy.forms.inputFieldRowWithValue}

View file

@ -33,7 +33,7 @@ import google.registry.model.domain.DomainAuthInfo;
import google.registry.model.domain.GracePeriod; import google.registry.model.domain.GracePeriod;
import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.launch.LaunchNotice;
import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.rgp.GracePeriodStatus;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.AuthInfo.PasswordAuth; import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.registrar.Registrar; import google.registry.model.registrar.Registrar;
@ -110,7 +110,7 @@ public class RegistryJpaReadTest {
Read<Object[], String> read = Read<Object[], String> read =
RegistryJpaIO.read( RegistryJpaIO.read(
"select d, r.emailAddress from Domain d join Registrar r on" "select d, r.emailAddress from Domain d join Registrar r on"
+ " d.currentSponsorClientId = r.clientIdentifier where r.type = :type" + " d.currentSponsorClientId = r.registrarId where r.type = :type"
+ " and d.deletionTime > now()", + " and d.deletionTime > now()",
ImmutableMap.of("type", Registrar.Type.REAL), ImmutableMap.of("type", Registrar.Type.REAL),
false, false,
@ -152,7 +152,7 @@ public class RegistryJpaReadTest {
Read<Domain, String> read = Read<Domain, String> read =
RegistryJpaIO.read( RegistryJpaIO.read(
"select d from Domain d join Registrar r on" "select d from Domain d join Registrar r on"
+ " d.currentSponsorClientId = r.clientIdentifier where r.type = :type" + " d.currentSponsorClientId = r.registrarId where r.type = :type"
+ " and d.deletionTime > now()", + " and d.deletionTime > now()",
ImmutableMap.of("type", Registrar.Type.REAL), ImmutableMap.of("type", Registrar.Type.REAL),
Domain.class, Domain.class,
@ -200,7 +200,7 @@ public class RegistryJpaReadTest {
.setPersistedCurrentSponsorRegistrarId(registrar.getRegistrarId()) .setPersistedCurrentSponsorRegistrarId(registrar.getRegistrarId())
.setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1)) .setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1))
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password"))) .setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password")))
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
.setLaunchNotice( .setLaunchNotice(
LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME)) LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME))
.setSmdId("smdid") .setSmdId("smdid")

View file

@ -355,7 +355,7 @@ class InvoicingPipelineTest {
.isEqualTo( .isEqualTo(
'\n' '\n'
+ "SELECT b, r FROM BillingEvent b\n" + "SELECT b, r FROM BillingEvent b\n"
+ "JOIN Registrar r ON b.clientId = r.clientIdentifier\n" + "JOIN Registrar r ON b.clientId = r.registrarId\n"
+ "JOIN Domain d ON b.domainRepoId = d.repoId\n" + "JOIN Domain d ON b.domainRepoId = d.repoId\n"
+ "JOIN Tld t ON t.tldStr = d.tld\n" + "JOIN Tld t ON t.tldStr = d.tld\n"
+ "LEFT JOIN BillingCancellation c ON b.id = c.refOneTime\n" + "LEFT JOIN BillingCancellation c ON b.id = c.refOneTime\n"

View file

@ -39,7 +39,7 @@ import com.google.common.net.InetAddresses;
import com.google.common.util.concurrent.RateLimiter; import com.google.common.util.concurrent.RateLimiter;
import google.registry.dns.writer.clouddns.CloudDnsWriter.ZoneStateException; import google.registry.dns.writer.clouddns.CloudDnsWriter.ZoneStateException;
import google.registry.model.domain.Domain; import google.registry.model.domain.Domain;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.persistence.VKey; import google.registry.persistence.VKey;
@ -267,7 +267,7 @@ public class CloudDnsWriterTest {
for (int i = 0; i < dsRecords; i++) { for (int i = 0; i < dsRecords; i++) {
dsRecordData.add( dsRecordData.add(
DelegationSignerData.create(i, 3, 1, base16().decode("1234567890ABCDEF")).toRrData()); DomainDsData.create(i, 3, 1, base16().decode("1234567890ABCDEF")).toRrData());
} }
recordSetBuilder.add( recordSetBuilder.add(
new ResourceRecordSet() new ResourceRecordSet()
@ -284,10 +284,10 @@ public class CloudDnsWriterTest {
/** Returns a domain to be persisted in Datastore. */ /** Returns a domain to be persisted in Datastore. */
private static Domain fakeDomain( private static Domain fakeDomain(
String domainName, ImmutableSet<Host> nameservers, int numDsRecords) { String domainName, ImmutableSet<Host> nameservers, int numDsRecords) {
ImmutableSet.Builder<DelegationSignerData> dsDataBuilder = new ImmutableSet.Builder<>(); ImmutableSet.Builder<DomainDsData> dsDataBuilder = new ImmutableSet.Builder<>();
for (int i = 0; i < numDsRecords; i++) { for (int i = 0; i < numDsRecords; i++) {
dsDataBuilder.add(DelegationSignerData.create(i, 3, 1, base16().decode("1234567890ABCDEF"))); dsDataBuilder.add(DomainDsData.create(i, 3, 1, base16().decode("1234567890ABCDEF")));
} }
ImmutableSet.Builder<VKey<Host>> hostRefBuilder = new ImmutableSet.Builder<>(); ImmutableSet.Builder<VKey<Host>> hostRefBuilder = new ImmutableSet.Builder<>();

View file

@ -36,7 +36,7 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.net.InetAddresses; import com.google.common.net.InetAddresses;
import google.registry.model.domain.Domain; import google.registry.model.domain.Domain;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.testing.AppEngineExtension; import google.registry.testing.AppEngineExtension;
@ -177,8 +177,7 @@ public class DnsUpdateWriterTest {
.asBuilder() .asBuilder()
.setNameservers(ImmutableSet.of(persistActiveHost("ns1.example.tld").createVKey())) .setNameservers(ImmutableSet.of(persistActiveHost("ns1.example.tld").createVKey()))
.setDsData( .setDsData(
ImmutableSet.of( ImmutableSet.of(DomainDsData.create(1, 3, 1, base16().decode("0123456789ABCDEF"))))
DelegationSignerData.create(1, 3, 1, base16().decode("0123456789ABCDEF"))))
.build(); .build();
persistResource(domain); persistResource(domain);

View file

@ -193,7 +193,7 @@ public class SyncRegistrarsSheetTest {
assertThat(rows).hasSize(2); assertThat(rows).hasSize(2);
ImmutableMap<String, String> row = rows.get(0); ImmutableMap<String, String> row = rows.get(0);
assertThat(row).containsEntry("clientIdentifier", "aaaregistrar"); assertThat(row).containsEntry("registrarId", "aaaregistrar");
assertThat(row).containsEntry("registrarName", "AAA Registrar Inc."); assertThat(row).containsEntry("registrarName", "AAA Registrar Inc.");
assertThat(row).containsEntry("state", "SUSPENDED"); assertThat(row).containsEntry("state", "SUSPENDED");
assertThat(row).containsEntry("ianaIdentifier", "8"); assertThat(row).containsEntry("ianaIdentifier", "8");
@ -288,7 +288,7 @@ public class SyncRegistrarsSheetTest {
assertThat(row).containsEntry("billingAccountMap", "{JPY=JPY7890, USD=USD1234}"); assertThat(row).containsEntry("billingAccountMap", "{JPY=JPY7890, USD=USD1234}");
row = rows.get(1); row = rows.get(1);
assertThat(row).containsEntry("clientIdentifier", "anotherregistrar"); assertThat(row).containsEntry("registrarId", "anotherregistrar");
assertThat(row).containsEntry("registrarName", "Another Registrar LLC"); assertThat(row).containsEntry("registrarName", "Another Registrar LLC");
assertThat(row).containsEntry("state", "ACTIVE"); assertThat(row).containsEntry("state", "ACTIVE");
assertThat(row).containsEntry("ianaIdentifier", "1"); assertThat(row).containsEntry("ianaIdentifier", "1");
@ -337,7 +337,7 @@ public class SyncRegistrarsSheetTest {
verify(sheetSynchronizer).synchronize(eq("foobar"), rowsCaptor.capture()); verify(sheetSynchronizer).synchronize(eq("foobar"), rowsCaptor.capture());
ImmutableMap<String, String> row = getOnlyElement(getOnlyElement(rowsCaptor.getAllValues())); ImmutableMap<String, String> row = getOnlyElement(getOnlyElement(rowsCaptor.getAllValues()));
assertThat(row).containsEntry("clientIdentifier", "SomeRegistrar"); assertThat(row).containsEntry("registrarId", "SomeRegistrar");
assertThat(row).containsEntry("registrarName", "Some Registrar"); assertThat(row).containsEntry("registrarName", "Some Registrar");
assertThat(row).containsEntry("state", "ACTIVE"); assertThat(row).containsEntry("state", "ACTIVE");
assertThat(row).containsEntry("ianaIdentifier", "8"); assertThat(row).containsEntry("ianaIdentifier", "8");

View file

@ -161,7 +161,7 @@ import google.registry.model.domain.fee.BaseFee.FeeType;
import google.registry.model.domain.fee.Fee; import google.registry.model.domain.fee.Fee;
import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.launch.LaunchNotice;
import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.rgp.GracePeriodStatus;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.domain.token.AllocationToken; import google.registry.model.domain.token.AllocationToken;
import google.registry.model.domain.token.AllocationToken.RegistrationBehavior; import google.registry.model.domain.token.AllocationToken.RegistrationBehavior;
import google.registry.model.domain.token.AllocationToken.TokenStatus; import google.registry.model.domain.token.AllocationToken.TokenStatus;
@ -860,7 +860,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
assertAboutDomains() assertAboutDomains()
.that(domain) .that(domain)
.hasExactlyDsData( .hasExactlyDsData(
DelegationSignerData.create( DomainDsData.create(
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3")) 12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))
.cloneWithDomainRepoId(domain.getRepoId())); .cloneWithDomainRepoId(domain.getRepoId()));
} }
@ -3159,15 +3159,14 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
@Test @Test
void testFailure_packageToken_registrationTooLong() throws Exception { void testFailure_packageToken_registrationTooLong() throws Exception {
AllocationToken token = persistResource(
persistResource( new AllocationToken.Builder()
new AllocationToken.Builder() .setToken("abc123")
.setToken("abc123") .setTokenType(PACKAGE)
.setTokenType(PACKAGE) .setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar")) .setAllowedTlds(ImmutableSet.of("tld"))
.setAllowedTlds(ImmutableSet.of("tld")) .setRenewalPriceBehavior(SPECIFIED)
.setRenewalPriceBehavior(SPECIFIED) .build());
.build());
persistContactsAndHosts(); persistContactsAndHosts();
setEppInput( setEppInput(
"domain_create_allocationtoken.xml", "domain_create_allocationtoken.xml",

View file

@ -64,7 +64,7 @@ import google.registry.model.domain.DomainAuthInfo;
import google.registry.model.domain.DomainHistory; import google.registry.model.domain.DomainHistory;
import google.registry.model.domain.GracePeriod; import google.registry.model.domain.GracePeriod;
import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.rgp.GracePeriodStatus;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.domain.token.AllocationToken; import google.registry.model.domain.token.AllocationToken;
import google.registry.model.domain.token.AllocationToken.TokenType; import google.registry.model.domain.token.AllocationToken.TokenType;
import google.registry.model.eppcommon.AuthInfo.PasswordAuth; import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
@ -335,8 +335,7 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Domain> {
.asBuilder() .asBuilder()
.setDsData( .setDsData(
ImmutableSet.of( ImmutableSet.of(
DelegationSignerData.create( DomainDsData.create(12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
.setNameservers(ImmutableSet.of(host1.createVKey(), host3.createVKey())) .setNameservers(ImmutableSet.of(host1.createVKey(), host3.createVKey()))
.build()); .build());
doSuccessfulTest("domain_info_response_dsdata.xml", false); doSuccessfulTest("domain_info_response_dsdata.xml", false);
@ -541,8 +540,7 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Domain> {
null)) null))
.setDsData( .setDsData(
ImmutableSet.of( ImmutableSet.of(
DelegationSignerData.create( DomainDsData.create(12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
.build()); .build());
doSuccessfulTest("domain_info_response_dsdata_addperiod.xml", false); doSuccessfulTest("domain_info_response_dsdata_addperiod.xml", false);
} }

View file

@ -170,7 +170,7 @@ class DomainTransferCancelFlowTest
.setResponseData( .setResponseData(
ImmutableList.of( ImmutableList.of(
new DomainTransferResponse.Builder() new DomainTransferResponse.Builder()
.setFullyQualifiedDomainName(getUniqueIdFromCommand()) .setDomainName(getUniqueIdFromCommand())
.setTransferStatus(TransferStatus.CLIENT_CANCELLED) .setTransferStatus(TransferStatus.CLIENT_CANCELLED)
.setTransferRequestTime(TRANSFER_REQUEST_TIME) .setTransferRequestTime(TRANSFER_REQUEST_TIME)
.setGainingRegistrarId("NewRegistrar") .setGainingRegistrarId("NewRegistrar")

View file

@ -97,7 +97,7 @@ import google.registry.model.domain.DesignatedContact;
import google.registry.model.domain.DesignatedContact.Type; import google.registry.model.domain.DesignatedContact.Type;
import google.registry.model.domain.Domain; import google.registry.model.domain.Domain;
import google.registry.model.domain.DomainHistory; import google.registry.model.domain.DomainHistory;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.eppcommon.Trid; import google.registry.model.eppcommon.Trid;
import google.registry.model.host.Host; import google.registry.model.host.Host;
@ -115,8 +115,8 @@ import org.junit.jupiter.api.Test;
/** Unit tests for {@link DomainUpdateFlow}. */ /** Unit tests for {@link DomainUpdateFlow}. */
class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain> { class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain> {
private static final DelegationSignerData SOME_DSDATA = private static final DomainDsData SOME_DSDATA =
DelegationSignerData.create( DomainDsData.create(
1, 1,
2, 2,
2, 2,
@ -148,7 +148,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
unusedContact = persistActiveContact("unused"); unusedContact = persistActiveContact("unused");
} }
private Domain persistDomainWithRegistrant() throws Exception { private void persistDomainWithRegistrant() throws Exception {
Host host = loadByForeignKey(Host.class, "ns1.example.foo", clock.nowUtc()).get(); Host host = loadByForeignKey(Host.class, "ns1.example.foo", clock.nowUtc()).get();
Domain domain = Domain domain =
persistResource( persistResource(
@ -170,7 +170,6 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
.setDomain(domain) .setDomain(domain)
.build()); .build());
clock.advanceOneMilli(); clock.advanceOneMilli();
return domain;
} }
private Domain persistDomain() throws Exception { private Domain persistDomain() throws Exception {
@ -467,17 +466,20 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
private void doSecDnsSuccessfulTest( private void doSecDnsSuccessfulTest(
String xmlFilename, String xmlFilename,
ImmutableSet<DelegationSignerData> originalDsData, ImmutableSet<DomainDsData> originalDsData,
ImmutableSet<DelegationSignerData> expectedDsData) ImmutableSet<DomainDsData> expectedDsData,
boolean dnsTaskEnqueued)
throws Exception { throws Exception {
doSecDnsSuccessfulTest(xmlFilename, originalDsData, expectedDsData, OTHER_DSDATA_TEMPLATE_MAP); doSecDnsSuccessfulTest(
xmlFilename, originalDsData, expectedDsData, OTHER_DSDATA_TEMPLATE_MAP, dnsTaskEnqueued);
} }
private void doSecDnsSuccessfulTest( private void doSecDnsSuccessfulTest(
String xmlFilename, String xmlFilename,
ImmutableSet<DelegationSignerData> originalDsData, ImmutableSet<DomainDsData> originalDsData,
ImmutableSet<DelegationSignerData> expectedDsData, ImmutableSet<DomainDsData> expectedDsData,
ImmutableMap<String, String> substitutions) ImmutableMap<String, String> substitutions,
boolean dnsTaskEnqueued)
throws Exception { throws Exception {
setEppInput(xmlFilename, substitutions); setEppInput(xmlFilename, substitutions);
persistResource( persistResource(
@ -495,7 +497,11 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
expectedDsData.stream() expectedDsData.stream()
.map(ds -> ds.cloneWithDomainRepoId(resource.getRepoId())) .map(ds -> ds.cloneWithDomainRepoId(resource.getRepoId()))
.collect(toImmutableSet())); .collect(toImmutableSet()));
assertDnsTasksEnqueued("example.tld"); if (dnsTaskEnqueued) {
assertDnsTasksEnqueued("example.tld");
} else {
assertNoDnsTasksEnqueued();
}
} }
@Test @Test
@ -504,7 +510,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
"domain_update_dsdata_add.xml", "domain_update_dsdata_add.xml",
null, null,
ImmutableSet.of( ImmutableSet.of(
DelegationSignerData.create( DomainDsData.create(
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))), 12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
ImmutableMap.of( ImmutableMap.of(
"KEY_TAG", "KEY_TAG",
@ -514,7 +520,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
"DIGEST_TYPE", "DIGEST_TYPE",
"1", "1",
"DIGEST", "DIGEST",
"A94A8FE5CCB19BA61C4C0873D391E987982FBBD3")); "A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"),
true);
} }
@Test @Test
@ -524,7 +531,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
ImmutableSet.of(SOME_DSDATA), ImmutableSet.of(SOME_DSDATA),
ImmutableSet.of( ImmutableSet.of(
SOME_DSDATA, SOME_DSDATA,
DelegationSignerData.create( DomainDsData.create(
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))), 12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
ImmutableMap.of( ImmutableMap.of(
"KEY_TAG", "KEY_TAG",
@ -534,7 +541,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
"DIGEST_TYPE", "DIGEST_TYPE",
"1", "1",
"DIGEST", "DIGEST",
"A94A8FE5CCB19BA61C4C0873D391E987982FBBD3")); "A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"),
true);
} }
@Test @Test
@ -551,7 +559,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
"DIGEST_TYPE", "DIGEST_TYPE",
"2", "2",
"DIGEST", "DIGEST",
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08")); "9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"),
false);
} }
@Test @Test
@ -561,7 +570,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
ImmutableSet.of(SOME_DSDATA), ImmutableSet.of(SOME_DSDATA),
ImmutableSet.of( ImmutableSet.of(
SOME_DSDATA, SOME_DSDATA,
DelegationSignerData.create( DomainDsData.create(
1, 1,
8, 8,
4, 4,
@ -576,10 +585,11 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
"DIGEST_TYPE", "DIGEST_TYPE",
"4", "4",
"DIGEST", "DIGEST",
"768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9")); "768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9"),
true);
} }
// Changing any of the four fields in DelegationSignerData should result in a new object // Changing any of the four fields in DomainDsData should result in a new object
@Test @Test
void testSuccess_secDnsAddOnlyChangeKeyTag() throws Exception { void testSuccess_secDnsAddOnlyChangeKeyTag() throws Exception {
doSecDnsSuccessfulTest( doSecDnsSuccessfulTest(
@ -587,7 +597,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
ImmutableSet.of(SOME_DSDATA), ImmutableSet.of(SOME_DSDATA),
ImmutableSet.of( ImmutableSet.of(
SOME_DSDATA, SOME_DSDATA,
DelegationSignerData.create( DomainDsData.create(
12346, 12346,
2, 2,
2, 2,
@ -601,7 +611,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
"DIGEST_TYPE", "DIGEST_TYPE",
"2", "2",
"DIGEST", "DIGEST",
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08")); "9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"),
true);
} }
@Test @Test
@ -611,7 +622,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
ImmutableSet.of(SOME_DSDATA), ImmutableSet.of(SOME_DSDATA),
ImmutableSet.of( ImmutableSet.of(
SOME_DSDATA, SOME_DSDATA,
DelegationSignerData.create( DomainDsData.create(
1, 1,
8, 8,
2, 2,
@ -625,7 +636,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
"DIGEST_TYPE", "DIGEST_TYPE",
"2", "2",
"DIGEST", "DIGEST",
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08")); "9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"),
true);
} }
@Test @Test
@ -635,7 +647,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
ImmutableSet.of(SOME_DSDATA), ImmutableSet.of(SOME_DSDATA),
ImmutableSet.of( ImmutableSet.of(
SOME_DSDATA, SOME_DSDATA,
DelegationSignerData.create( DomainDsData.create(
1, 1,
2, 2,
4, 4,
@ -650,7 +662,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
"DIGEST_TYPE", "DIGEST_TYPE",
"4", "4",
"DIGEST", "DIGEST",
"768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9")); "768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9"),
true);
} }
@Test @Test
@ -660,7 +673,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
ImmutableSet.of(SOME_DSDATA), ImmutableSet.of(SOME_DSDATA),
ImmutableSet.of( ImmutableSet.of(
SOME_DSDATA, SOME_DSDATA,
DelegationSignerData.create( DomainDsData.create(
1, 1,
2, 2,
2, 2,
@ -674,21 +687,22 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
"DIGEST_TYPE", "DIGEST_TYPE",
"2", "2",
"DIGEST", "DIGEST",
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08")); "9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"),
false);
} }
@Test @Test
void testSuccess_secDnsAddToMaxRecords() throws Exception { void testSuccess_secDnsAddToMaxRecords() throws Exception {
ImmutableSet.Builder<DelegationSignerData> builder = new ImmutableSet.Builder<>(); ImmutableSet.Builder<DomainDsData> builder = new ImmutableSet.Builder<>();
for (int i = 0; i < 7; ++i) { for (int i = 0; i < 7; ++i) {
builder.add( builder.add(
DelegationSignerData.create( DomainDsData.create(
i, i,
2, 2,
2, 2,
base16().decode("9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"))); base16().decode("9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08")));
} }
ImmutableSet<DelegationSignerData> commonDsData = builder.build(); ImmutableSet<DomainDsData> commonDsData = builder.build();
doSecDnsSuccessfulTest( doSecDnsSuccessfulTest(
"domain_update_dsdata_add.xml", "domain_update_dsdata_add.xml",
@ -697,11 +711,12 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
union( union(
commonDsData, commonDsData,
ImmutableSet.of( ImmutableSet.of(
DelegationSignerData.create( DomainDsData.create(
12346, 12346,
3, 3,
1, 1,
base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3")))))); base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))))),
true);
} }
@Test @Test
@ -710,9 +725,10 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
"domain_update_dsdata_rem.xml", "domain_update_dsdata_rem.xml",
ImmutableSet.of( ImmutableSet.of(
SOME_DSDATA, SOME_DSDATA,
DelegationSignerData.create( DomainDsData.create(
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))), 12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
ImmutableSet.of(SOME_DSDATA)); ImmutableSet.of(SOME_DSDATA),
true);
} }
@Test @Test
@ -722,9 +738,10 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
"domain_update_dsdata_rem_all.xml", "domain_update_dsdata_rem_all.xml",
ImmutableSet.of( ImmutableSet.of(
SOME_DSDATA, SOME_DSDATA,
DelegationSignerData.create( DomainDsData.create(
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))), 12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
ImmutableSet.of()); ImmutableSet.of(),
true);
} }
@Test @Test
@ -733,26 +750,27 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
"domain_update_dsdata_add_rem.xml", "domain_update_dsdata_add_rem.xml",
ImmutableSet.of( ImmutableSet.of(
SOME_DSDATA, SOME_DSDATA,
DelegationSignerData.create( DomainDsData.create(
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))), 12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
ImmutableSet.of( ImmutableSet.of(
SOME_DSDATA, SOME_DSDATA,
DelegationSignerData.create( DomainDsData.create(
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3")))); 12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
true);
} }
@Test @Test
void testSuccess_secDnsAddRemoveToMaxRecords() throws Exception { void testSuccess_secDnsAddRemoveToMaxRecords() throws Exception {
ImmutableSet.Builder<DelegationSignerData> builder = new ImmutableSet.Builder<>(); ImmutableSet.Builder<DomainDsData> builder = new ImmutableSet.Builder<>();
for (int i = 0; i < 7; ++i) { for (int i = 0; i < 7; ++i) {
builder.add( builder.add(
DelegationSignerData.create( DomainDsData.create(
i, i,
2, 2,
2, 2,
base16().decode("9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"))); base16().decode("9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08")));
} }
ImmutableSet<DelegationSignerData> commonDsData = builder.build(); ImmutableSet<DomainDsData> commonDsData = builder.build();
doSecDnsSuccessfulTest( doSecDnsSuccessfulTest(
"domain_update_dsdata_add_rem.xml", "domain_update_dsdata_add_rem.xml",
@ -760,7 +778,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
union( union(
commonDsData, commonDsData,
ImmutableSet.of( ImmutableSet.of(
DelegationSignerData.create( DomainDsData.create(
12345, 12345,
3, 3,
1, 1,
@ -769,11 +787,12 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
union( union(
commonDsData, commonDsData,
ImmutableSet.of( ImmutableSet.of(
DelegationSignerData.create( DomainDsData.create(
12346, 12346,
3, 3,
1, 1,
base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3")))))); base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))))),
true);
} }
@Test @Test
@ -783,19 +802,23 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
"domain_update_dsdata_add_rem_same.xml", "domain_update_dsdata_add_rem_same.xml",
ImmutableSet.of( ImmutableSet.of(
SOME_DSDATA, SOME_DSDATA,
DelegationSignerData.create( DomainDsData.create(
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))), 12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
ImmutableSet.of( ImmutableSet.of(
SOME_DSDATA, SOME_DSDATA,
DelegationSignerData.create( DomainDsData.create(
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3")))); 12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
false);
} }
@Test @Test
void testSuccess_secDnsRemoveAlreadyNotThere() throws Exception { void testSuccess_secDnsRemoveAlreadyNotThere() throws Exception {
// Removing a dsData that isn't there is a no-op. // Removing a dsData that isn't there is a no-op.
doSecDnsSuccessfulTest( doSecDnsSuccessfulTest(
"domain_update_dsdata_rem.xml", ImmutableSet.of(SOME_DSDATA), ImmutableSet.of(SOME_DSDATA)); "domain_update_dsdata_rem.xml",
ImmutableSet.of(SOME_DSDATA),
ImmutableSet.of(SOME_DSDATA),
false);
} }
void doServerStatusBillingTest(String xmlFilename, boolean isBillable) throws Exception { void doServerStatusBillingTest(String xmlFilename, boolean isBillable) throws Exception {
@ -934,7 +957,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
persistResource( persistResource(
DatabaseHelper.newDomain(getUniqueIdFromCommand()) DatabaseHelper.newDomain(getUniqueIdFromCommand())
.asBuilder() .asBuilder()
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
.build()); .build());
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow); EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
@ -948,8 +971,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
.asBuilder() .asBuilder()
.setDsData( .setDsData(
ImmutableSet.of( ImmutableSet.of(
DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}), DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2}),
DelegationSignerData.create(2, 2, 6, new byte[] {0, 1, 2}))) DomainDsData.create(2, 2, 6, new byte[] {0, 1, 2})))
.build()); .build());
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow); EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
assertThat(thrown).hasMessageThat().contains("digestType=3"); assertThat(thrown).hasMessageThat().contains("digestType=3");
@ -963,7 +986,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
persistResource( persistResource(
DatabaseHelper.newDomain(getUniqueIdFromCommand()) DatabaseHelper.newDomain(getUniqueIdFromCommand())
.asBuilder() .asBuilder()
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 1, new byte[] {0, 1, 2}))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 1, new byte[] {0, 1, 2})))
.build()); .build());
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow); EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
@ -980,8 +1003,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
.asBuilder() .asBuilder()
.setDsData( .setDsData(
ImmutableSet.of( ImmutableSet.of(
DelegationSignerData.create(1, 2, 1, new byte[] {0, 1, 2, 3, 4}), DomainDsData.create(1, 2, 1, new byte[] {0, 1, 2, 3, 4}),
DelegationSignerData.create(2, 2, 2, new byte[] {5, 6, 7}))) DomainDsData.create(2, 2, 2, new byte[] {5, 6, 7})))
.build()); .build());
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow); EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
assertThat(thrown).hasMessageThat().contains("0, 1, 2, 3, 4"); assertThat(thrown).hasMessageThat().contains("0, 1, 2, 3, 4");
@ -998,7 +1021,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
persistResource( persistResource(
DatabaseHelper.newDomain(getUniqueIdFromCommand()) DatabaseHelper.newDomain(getUniqueIdFromCommand())
.asBuilder() .asBuilder()
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 99, 2, new byte[] {0, 1, 2}))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 99, 2, new byte[] {0, 1, 2})))
.build()); .build());
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow); EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
@ -1012,8 +1035,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
.asBuilder() .asBuilder()
.setDsData( .setDsData(
ImmutableSet.of( ImmutableSet.of(
DelegationSignerData.create(1, 998, 2, new byte[] {0, 1, 2}), DomainDsData.create(1, 998, 2, new byte[] {0, 1, 2}),
DelegationSignerData.create(2, 99, 2, new byte[] {0, 1, 2}))) DomainDsData.create(2, 99, 2, new byte[] {0, 1, 2})))
.build()); .build());
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow); EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
assertThat(thrown).hasMessageThat().contains("algorithm=998"); assertThat(thrown).hasMessageThat().contains("algorithm=998");
@ -1023,9 +1046,9 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
@Test @Test
void testFailure_secDnsTooManyDsRecords() throws Exception { void testFailure_secDnsTooManyDsRecords() throws Exception {
ImmutableSet.Builder<DelegationSignerData> builder = new ImmutableSet.Builder<>(); ImmutableSet.Builder<DomainDsData> builder = new ImmutableSet.Builder<>();
for (int i = 0; i < 8; ++i) { for (int i = 0; i < 8; ++i) {
builder.add(DelegationSignerData.create(i, 2, 2, new byte[] {0, 1, 2})); builder.add(DomainDsData.create(i, 2, 2, new byte[] {0, 1, 2}));
} }
setEppInput("domain_update_dsdata_add.xml", OTHER_DSDATA_TEMPLATE_MAP); setEppInput("domain_update_dsdata_add.xml", OTHER_DSDATA_TEMPLATE_MAP);
@ -1724,7 +1747,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
} }
@Test @Test
void testDnsTaskIsNotTriggeredWhenNoDSChangeSubmitted() throws Exception { void testDnsTaskIsNotTriggeredWhenNoDSChangeSubmitted() {
setEppInput("domain_update_no_ds_change.xml"); setEppInput("domain_update_no_ds_change.xml");
assertNoDnsTasksEnqueued(); assertNoDnsTasksEnqueued();
} }

View file

@ -406,7 +406,7 @@ class AllocationTokenFlowUtilsTest {
private static DomainCommand.Create createCommand(String domainName) { private static DomainCommand.Create createCommand(String domainName) {
DomainCommand.Create command = mock(DomainCommand.Create.class); DomainCommand.Create command = mock(DomainCommand.Create.class);
when(command.getFullyQualifiedDomainName()).thenReturn(domainName); when(command.getDomainName()).thenReturn(domainName);
return command; return command;
} }

View file

@ -72,7 +72,7 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
.setResponseData( .setResponseData(
ImmutableList.of( ImmutableList.of(
new DomainTransferResponse.Builder() new DomainTransferResponse.Builder()
.setFullyQualifiedDomainName("test.example") .setDomainName("test.example")
.setTransferStatus(TransferStatus.SERVER_APPROVED) .setTransferStatus(TransferStatus.SERVER_APPROVED)
.setGainingRegistrarId(getRegistrarIdForFlow()) .setGainingRegistrarId(getRegistrarIdForFlow())
.setTransferRequestTime(clock.nowUtc().minusDays(5)) .setTransferRequestTime(clock.nowUtc().minusDays(5))

View file

@ -24,7 +24,7 @@ import google.registry.model.domain.DomainHistory;
import google.registry.model.domain.DomainHistory.DomainHistoryId; import google.registry.model.domain.DomainHistory.DomainHistoryId;
import google.registry.model.domain.GracePeriod; import google.registry.model.domain.GracePeriod;
import google.registry.model.domain.GracePeriod.GracePeriodHistory; import google.registry.model.domain.GracePeriod.GracePeriodHistory;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.domain.secdns.DomainDsDataHistory; import google.registry.model.domain.secdns.DomainDsDataHistory;
import google.registry.model.reporting.DomainTransactionRecord; import google.registry.model.reporting.DomainTransactionRecord;
import google.registry.persistence.VKey; import google.registry.persistence.VKey;
@ -46,7 +46,7 @@ public class BulkQueryHelper {
.filter(gracePeriod -> gracePeriod.getDomainRepoId().equals(domainRepoId)) .filter(gracePeriod -> gracePeriod.getDomainRepoId().equals(domainRepoId))
.collect(toImmutableSet()), .collect(toImmutableSet()),
jpaTm() jpaTm()
.loadAllOfStream(DelegationSignerData.class) .loadAllOfStream(DomainDsData.class)
.filter(dsData -> dsData.getDomainRepoId().equals(domainRepoId)) .filter(dsData -> dsData.getDomainRepoId().equals(domainRepoId))
.collect(toImmutableSet()), .collect(toImmutableSet()),
jpaTm() jpaTm()

View file

@ -31,7 +31,7 @@ import google.registry.model.domain.GracePeriod;
import google.registry.model.domain.Period; import google.registry.model.domain.Period;
import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.launch.LaunchNotice;
import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.rgp.GracePeriodStatus;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.AuthInfo.PasswordAuth; import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.eppcommon.Trid; import google.registry.model.eppcommon.Trid;
@ -160,7 +160,7 @@ public final class TestSetupHelper {
.setPersistedCurrentSponsorRegistrarId(REGISTRAR_ID) .setPersistedCurrentSponsorRegistrarId(REGISTRAR_ID)
.setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1)) .setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1))
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password"))) .setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password")))
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
.setLaunchNotice(LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME)) .setLaunchNotice(LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME))
.setSmdId("smdid") .setSmdId("smdid")
.addGracePeriod( .addGracePeriod(

View file

@ -43,7 +43,7 @@ import google.registry.model.contact.Contact;
import google.registry.model.domain.DesignatedContact.Type; import google.registry.model.domain.DesignatedContact.Type;
import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.launch.LaunchNotice;
import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.rgp.GracePeriodStatus;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.domain.token.AllocationToken; import google.registry.model.domain.token.AllocationToken;
import google.registry.model.domain.token.AllocationToken.TokenStatus; import google.registry.model.domain.token.AllocationToken.TokenStatus;
import google.registry.model.eppcommon.AuthInfo.PasswordAuth; import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
@ -122,7 +122,7 @@ public class DomainSqlTest {
.setPersistedCurrentSponsorRegistrarId("registrar3") .setPersistedCurrentSponsorRegistrarId("registrar3")
.setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1)) .setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1))
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password"))) .setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password")))
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
.setLaunchNotice( .setLaunchNotice(
LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME)) LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME))
.setSmdId("smdid") .setSmdId("smdid")
@ -346,12 +346,11 @@ public class DomainSqlTest {
@Test @Test
void testModifyDsData_addThenRemoveSuccessfully() { void testModifyDsData_addThenRemoveSuccessfully() {
persistDomain(); persistDomain();
DelegationSignerData extraDsData = DomainDsData extraDsData = DomainDsData.create(2, 2, 3, new byte[] {0, 1, 2}, "4-COM");
DelegationSignerData.create(2, 2, 3, new byte[] {0, 1, 2}, "4-COM"); ImmutableSet<DomainDsData> unionDsData =
ImmutableSet<DelegationSignerData> unionDsData =
Sets.union(domain.getDsData(), ImmutableSet.of(extraDsData)).immutableCopy(); Sets.union(domain.getDsData(), ImmutableSet.of(extraDsData)).immutableCopy();
// Add an extra DelegationSignerData to dsData set. // Add an extra DomainDsData to dsData set.
jpaTm() jpaTm()
.transact( .transact(
() -> { () -> {
@ -361,7 +360,7 @@ public class DomainSqlTest {
jpaTm().put(modified); jpaTm().put(modified);
}); });
// Verify that the persisted domain entity contains both DelegationSignerData records. // Verify that the persisted domain entity contains both DomainDsData records.
jpaTm() jpaTm()
.transact( .transact(
() -> { () -> {
@ -370,7 +369,7 @@ public class DomainSqlTest {
assertEqualDomainExcept(persisted, "dsData"); assertEqualDomainExcept(persisted, "dsData");
}); });
// Remove the extra DelegationSignerData record from dsData set. // Remove the extra DomainDsData record from dsData set.
jpaTm() jpaTm()
.transact( .transact(
() -> { () -> {
@ -604,8 +603,7 @@ public class DomainSqlTest {
persisted persisted
.asBuilder() .asBuilder()
.setDsData( .setDsData(
ImmutableSet.of( ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
.build(); .build();
updateInDb(domain); updateInDb(domain);
return jpaTm().getTransactionTime(); return jpaTm().getTransactionTime();

View file

@ -50,7 +50,7 @@ import google.registry.model.contact.Contact;
import google.registry.model.domain.DesignatedContact.Type; import google.registry.model.domain.DesignatedContact.Type;
import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.launch.LaunchNotice;
import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.rgp.GracePeriodStatus;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.AuthInfo.PasswordAuth; import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.eppcommon.Trid; import google.registry.model.eppcommon.Trid;
@ -189,8 +189,7 @@ public class DomainTest {
.setPersistedCurrentSponsorRegistrarId("NewRegistrar") .setPersistedCurrentSponsorRegistrarId("NewRegistrar")
.setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1)) .setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1))
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password"))) .setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password")))
.setDsData( .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
.setLaunchNotice( .setLaunchNotice(
LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME)) LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME))
.setTransferData( .setTransferData(
@ -292,7 +291,7 @@ public class DomainTest {
assertThat( assertThat(
DatabaseHelper.newDomain("example.com") DatabaseHelper.newDomain("example.com")
.asBuilder() .asBuilder()
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, (byte[]) null))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 1, 1, (byte[]) null)))
.build() .build()
.getDsData() .getDsData()
.asList() .asList()
@ -302,7 +301,7 @@ public class DomainTest {
assertThat( assertThat(
DatabaseHelper.newDomain("example.com") DatabaseHelper.newDomain("example.com")
.asBuilder() .asBuilder()
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[] {}))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 1, 1, new byte[] {})))
.build() .build()
.getDsData() .getDsData()
.asList() .asList()
@ -312,7 +311,7 @@ public class DomainTest {
assertThat( assertThat(
DatabaseHelper.newDomain("example.com") DatabaseHelper.newDomain("example.com")
.asBuilder() .asBuilder()
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[] {1}))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 1, 1, new byte[] {1})))
.build() .build()
.getDsData() .getDsData()
.asList() .asList()

View file

@ -34,7 +34,7 @@ import google.registry.model.domain.DomainHistory;
import google.registry.model.domain.GracePeriod; import google.registry.model.domain.GracePeriod;
import google.registry.model.domain.Period; import google.registry.model.domain.Period;
import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.rgp.GracePeriodStatus;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.Trid; import google.registry.model.eppcommon.Trid;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.model.reporting.DomainTransactionRecord; import google.registry.model.reporting.DomainTransactionRecord;
@ -116,7 +116,7 @@ public class DomainHistoryTest extends EntityTestCase {
newDomain("example.tld", "domainRepoId", contact) newDomain("example.tld", "domainRepoId", contact)
.asBuilder() .asBuilder()
.setNameservers(host.createVKey()) .setNameservers(host.createVKey())
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
.setDnsRefreshRequestTime(Optional.of(DateTime.parse("2020-03-09T16:40:00Z"))) .setDnsRefreshRequestTime(Optional.of(DateTime.parse("2020-03-09T16:40:00Z")))
.build(); .build();
insertInDb(domain); insertInDb(domain);

View file

@ -44,21 +44,25 @@ public class StatusValueAdapterTest {
void testMarshalling() throws Exception { void testMarshalling() throws Exception {
// Mangle the status value through marshalling by stuffing it in a host info response and then // Mangle the status value through marshalling by stuffing it in a host info response and then
// ripping it out of the marshalled xml. Use lenient marshalling so we can omit other fields. // ripping it out of the marshalled xml. Use lenient marshalling so we can omit other fields.
String marshalled = new String( String marshalled =
EppXmlTransformer.marshal( new String(
EppOutput.create(new EppResponse.Builder() EppXmlTransformer.marshal(
.setResData(HostInfoData.newBuilder() EppOutput.create(
.setCreationClientId("") new EppResponse.Builder()
.setCreationTime(START_OF_TIME) .setResData(
.setCurrentSponsorClientId("") HostInfoData.newBuilder()
.setFullyQualifiedHostName("") .setCreationClientId("")
.setInetAddresses(ImmutableSet.of()) .setCreationTime(START_OF_TIME)
.setRepoId("") .setCurrentSponsorClientId("")
.setStatusValues(ImmutableSet.of(StatusValue.CLIENT_UPDATE_PROHIBITED)) .setHostName("")
.build()) .setInetAddresses(ImmutableSet.of())
.build()), .setRepoId("")
ValidationMode.LENIENT), .setStatusValues(
UTF_8); ImmutableSet.of(StatusValue.CLIENT_UPDATE_PROHIBITED))
.build())
.build()),
ValidationMode.LENIENT),
UTF_8);
assertThat(marshalled).contains("<host:status s=\"clientUpdateProhibited\"/>"); assertThat(marshalled).contains("<host:status s=\"clientUpdateProhibited\"/>");
} }

View file

@ -43,7 +43,7 @@ import google.registry.model.domain.DomainAuthInfo;
import google.registry.model.domain.DomainHistory; import google.registry.model.domain.DomainHistory;
import google.registry.model.domain.GracePeriod; import google.registry.model.domain.GracePeriod;
import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.rgp.GracePeriodStatus;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.AuthInfo.PasswordAuth; import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.eppcommon.Trid; import google.registry.model.eppcommon.Trid;
@ -267,8 +267,7 @@ public class DomainToXjcConverterTest {
.setCreationTimeForTest(DateTime.parse("1900-01-01T00:00:00Z")) .setCreationTimeForTest(DateTime.parse("1900-01-01T00:00:00Z"))
.setPersistedCurrentSponsorRegistrarId("TheRegistrar") .setPersistedCurrentSponsorRegistrarId("TheRegistrar")
.setDsData( .setDsData(
ImmutableSet.of( ImmutableSet.of(DomainDsData.create(123, 200, 230, base16().decode("1234567890"))))
DelegationSignerData.create(123, 200, 230, base16().decode("1234567890"))))
.setDomainName(Idn.toASCII("love.みんな")) .setDomainName(Idn.toASCII("love.みんな"))
.setLastTransferTime(DateTime.parse("1910-01-01T00:00:00Z")) .setLastTransferTime(DateTime.parse("1910-01-01T00:00:00Z"))
.setLastEppUpdateRegistrarId("TheRegistrar") .setLastEppUpdateRegistrarId("TheRegistrar")

View file

@ -38,7 +38,7 @@ import google.registry.model.domain.DomainAuthInfo;
import google.registry.model.domain.DomainHistory; import google.registry.model.domain.DomainHistory;
import google.registry.model.domain.GracePeriod; import google.registry.model.domain.GracePeriod;
import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.rgp.GracePeriodStatus;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.AuthInfo.PasswordAuth; import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.eppcommon.Trid; import google.registry.model.eppcommon.Trid;
@ -112,8 +112,7 @@ final class RdeFixtures {
.setPersistedCurrentSponsorRegistrarId("TheRegistrar") .setPersistedCurrentSponsorRegistrarId("TheRegistrar")
.setCreationTimeForTest(clock.nowUtc()) .setCreationTimeForTest(clock.nowUtc())
.setDsData( .setDsData(
ImmutableSet.of( ImmutableSet.of(DomainDsData.create(123, 200, 230, base16().decode("1234567890"))))
DelegationSignerData.create(123, 200, 230, base16().decode("1234567890"))))
.setDomainName(Idn.toASCII("love." + tld)) .setDomainName(Idn.toASCII("love." + tld))
.setLastTransferTime(DateTime.parse("1990-01-01T00:00:00Z")) .setLastTransferTime(DateTime.parse("1990-01-01T00:00:00Z"))
.setLastEppUpdateRegistrarId("IntoTheTempest") .setLastEppUpdateRegistrarId("IntoTheTempest")

View file

@ -89,13 +89,13 @@ public class Spec11RegistrarThreatMatchesParserTest {
"threatType", "MALWARE", "threatType", "MALWARE",
"platformType", "ANY_PLATFORM", "platformType", "ANY_PLATFORM",
"threatEntryMetaData", "NONE", "threatEntryMetaData", "NONE",
"fullyQualifiedDomainName", "c.com"))); "domainName", "c.com")));
ThreatMatch objectWithoutExtraFields = ThreatMatch objectWithoutExtraFields =
ThreatMatch.fromJSON( ThreatMatch.fromJSON(
new JSONObject( new JSONObject(
ImmutableMap.of( ImmutableMap.of(
"threatType", "MALWARE", "threatType", "MALWARE",
"fullyQualifiedDomainName", "c.com"))); "domainName", "c.com")));
assertThat(objectWithExtraFields).isEqualTo(objectWithoutExtraFields); assertThat(objectWithExtraFields).isEqualTo(objectWithoutExtraFields);
} }
@ -113,7 +113,7 @@ public class Spec11RegistrarThreatMatchesParserTest {
new JSONObject( new JSONObject(
ImmutableMap.of( ImmutableMap.of(
"threatType", "MALWARE", "threatType", "MALWARE",
"fullyQualifiedDomainName", "a.com"))))); "domainName", "a.com")))));
} }
static RegistrarThreatMatches getMatchB() throws Exception { static RegistrarThreatMatches getMatchB() throws Exception {
@ -124,12 +124,12 @@ public class Spec11RegistrarThreatMatchesParserTest {
new JSONObject( new JSONObject(
ImmutableMap.of( ImmutableMap.of(
"threatType", "MALWARE", "threatType", "MALWARE",
"fullyQualifiedDomainName", "b.com"))), "domainName", "b.com"))),
ThreatMatch.fromJSON( ThreatMatch.fromJSON(
new JSONObject( new JSONObject(
ImmutableMap.of( ImmutableMap.of(
"threatType", "MALWARE", "threatType", "MALWARE",
"fullyQualifiedDomainName", "c.com"))))); "domainName", "c.com")))));
} }
private void setupFile(String fileWithContent, String fileDate) { private void setupFile(String fileWithContent, String fileDate) {

View file

@ -113,7 +113,6 @@ import java.util.Map;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Supplier; import java.util.function.Supplier;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -984,32 +983,12 @@ public final class DatabaseHelper {
return createRepoId(allocateId(), getContactAndHostRoidSuffix()); return createRepoId(allocateId(), getContactAndHostRoidSuffix());
} }
private static <R extends ImmutableObject> void saveResource(R resource) {
if (tm().isOfy()) {
Consumer<ImmutableObject> saver = tm()::put;
saver.accept(resource);
if (resource instanceof EppResource) {
EppResource eppResource = (EppResource) resource;
persistEppResourceExtras(eppResource, saver);
}
} else {
tm().put(resource);
}
}
private static <R extends EppResource> void persistEppResourceExtras(
R resource, Consumer<ImmutableObject> saver) {
assertWithMessage("Cannot persist an EppResource with a missing repoId in tests")
.that(resource.getRepoId())
.isNotEmpty();
}
/** Persists an object in the DB for tests. */ /** Persists an object in the DB for tests. */
public static <R extends ImmutableObject> R persistResource(final R resource) { public static <R extends ImmutableObject> R persistResource(final R resource) {
assertWithMessage("Attempting to persist a Builder is almost certainly an error in test code") assertWithMessage("Attempting to persist a Builder is almost certainly an error in test code")
.that(resource) .that(resource)
.isNotInstanceOf(Buildable.Builder.class); .isNotInstanceOf(Buildable.Builder.class);
tm().transact(() -> saveResource(resource)); tm().transact(() -> tm().put(resource));
maybeAdvanceClock(); maybeAdvanceClock();
// Force the session cache to be cleared so that when we read the resource back, we read from // Force the session cache to be cleared so that when we read the resource back, we read from
// Datastore and not from the session cache. This is needed to trigger Objectify's load process // Datastore and not from the session cache. This is needed to trigger Objectify's load process
@ -1026,11 +1005,8 @@ public final class DatabaseHelper {
.that(resource) .that(resource)
.isNotInstanceOf(Buildable.Builder.class); .isNotInstanceOf(Buildable.Builder.class);
} }
// Persist domains ten at a time, to avoid exceeding the entity group limit. tm().transact(() -> resources.forEach(e -> tm().put(e)));
for (final List<R> chunk : Iterables.partition(resources, 10)) { maybeAdvanceClock();
tm().transact(() -> chunk.forEach(DatabaseHelper::saveResource));
maybeAdvanceClock();
}
// Force the session to be cleared so that when we read it back, we read from Datastore // Force the session to be cleared so that when we read it back, we read from Datastore
// and not from the transaction's session cache. // and not from the transaction's session cache.
tm().clearSessionCache(); tm().clearSessionCache();

View file

@ -24,7 +24,7 @@ import com.google.common.truth.FailureMetadata;
import com.google.common.truth.SimpleSubjectBuilder; import com.google.common.truth.SimpleSubjectBuilder;
import google.registry.model.domain.Domain; import google.registry.model.domain.Domain;
import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.launch.LaunchNotice;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.AuthInfo; import google.registry.model.eppcommon.AuthInfo;
import google.registry.testing.TruthChainer.And; import google.registry.testing.TruthChainer.And;
import java.util.Set; import java.util.Set;
@ -40,16 +40,15 @@ public final class DomainSubject extends AbstractEppResourceSubject<Domain, Doma
this.actual = subject; this.actual = subject;
} }
public And<DomainSubject> hasFullyQualifiedDomainName(String fullyQualifiedDomainName) { public And<DomainSubject> hasDomainName(String domainName) {
return hasValue( return hasValue(domainName, actual.getDomainName(), "has domainName");
fullyQualifiedDomainName, actual.getDomainName(), "has fullyQualifiedDomainName");
} }
public And<DomainSubject> hasExactlyDsData(DelegationSignerData... dsData) { public And<DomainSubject> hasExactlyDsData(DomainDsData... dsData) {
return hasExactlyDsData(ImmutableSet.copyOf(dsData)); return hasExactlyDsData(ImmutableSet.copyOf(dsData));
} }
public And<DomainSubject> hasExactlyDsData(Set<DelegationSignerData> dsData) { public And<DomainSubject> hasExactlyDsData(Set<DomainDsData> dsData) {
return hasValue(dsData, actual.getDsData(), "has dsData"); return hasValue(dsData, actual.getDsData(), "has dsData");
} }

View file

@ -31,7 +31,7 @@ import google.registry.model.contact.PostalInfo;
import google.registry.model.domain.DesignatedContact; import google.registry.model.domain.DesignatedContact;
import google.registry.model.domain.Domain; import google.registry.model.domain.Domain;
import google.registry.model.domain.Period; import google.registry.model.domain.Period;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.eppcommon.Trid; import google.registry.model.eppcommon.Trid;
import google.registry.model.host.Host; import google.registry.model.host.Host;
@ -346,7 +346,7 @@ public final class FullFieldsTestEntityHelper {
StatusValue.CLIENT_RENEW_PROHIBITED, StatusValue.CLIENT_RENEW_PROHIBITED,
StatusValue.CLIENT_TRANSFER_PROHIBITED, StatusValue.CLIENT_TRANSFER_PROHIBITED,
StatusValue.SERVER_UPDATE_PROHIBITED)) StatusValue.SERVER_UPDATE_PROHIBITED))
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, "deadface"))); .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, "deadface")));
if (registrant != null) { if (registrant != null) {
builder.setRegistrant(registrant.createVKey()); builder.setRegistrant(registrant.createVKey());
} }

View file

@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.net.InetAddresses; import com.google.common.net.InetAddresses;
import google.registry.model.domain.Domain; import google.registry.model.domain.Domain;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.testing.DatabaseHelper; import google.registry.testing.DatabaseHelper;
@ -148,10 +148,8 @@ class GenerateDnsReportCommandTest extends CommandTestCase<GenerateDnsReportComm
.setNameservers(ImmutableSet.of(nameserver1.createVKey(), nameserver2.createVKey())) .setNameservers(ImmutableSet.of(nameserver1.createVKey(), nameserver2.createVKey()))
.setDsData( .setDsData(
ImmutableSet.of( ImmutableSet.of(
DelegationSignerData.create( DomainDsData.create(12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC")),
12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC")), DomainDsData.create(56789, 2, 4, base16().decode("69FD46E6C4A45C55D4AC"))))
DelegationSignerData.create(
56789, 2, 4, base16().decode("69FD46E6C4A45C55D4AC"))))
.build()); .build());
persistResource( persistResource(
DatabaseHelper.newDomain("foobar.xn--q9jyb4c") DatabaseHelper.newDomain("foobar.xn--q9jyb4c")

View file

@ -37,7 +37,7 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
void testSuccess() throws Exception { void testSuccess() throws Exception {
persistActiveDomain("example.tld"); persistActiveDomain("example.tld");
runCommand("example.tld"); runCommand("example.tld");
assertInStdout("fullyQualifiedDomainName=example.tld"); assertInStdout("domainName=example.tld");
assertInStdout("Contact=VKey<Contact>(sql:3-ROID"); assertInStdout("Contact=VKey<Contact>(sql:3-ROID");
assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE"); assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE");
} }
@ -46,7 +46,7 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
void testSuccess_expand() throws Exception { void testSuccess_expand() throws Exception {
persistActiveDomain("example.tld"); persistActiveDomain("example.tld");
runCommand("example.tld", "--expand"); runCommand("example.tld", "--expand");
assertInStdout("fullyQualifiedDomainName=example.tld"); assertInStdout("domainName=example.tld");
assertInStdout("sqlKey=3-ROID"); assertInStdout("sqlKey=3-ROID");
assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE"); assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE");
assertNotInStdout("LiveRef"); assertNotInStdout("LiveRef");
@ -57,7 +57,7 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
createTld("xn--q9jyb4c"); createTld("xn--q9jyb4c");
persistActiveDomain("xn--aualito-txac.xn--q9jyb4c"); persistActiveDomain("xn--aualito-txac.xn--q9jyb4c");
runCommand("çauçalito.みんな", "--expand"); runCommand("çauçalito.みんな", "--expand");
assertInStdout("fullyQualifiedDomainName=xn--aualito-txac.xn--q9jyb4c"); assertInStdout("domainName=xn--aualito-txac.xn--q9jyb4c");
assertInStdout("sqlKey=4-ROID"); assertInStdout("sqlKey=4-ROID");
} }
@ -66,10 +66,10 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
persistActiveDomain("example.tld"); persistActiveDomain("example.tld");
persistActiveDomain("example2.tld"); persistActiveDomain("example2.tld");
runCommand("example.tld", "example2.tld"); runCommand("example.tld", "example2.tld");
assertInStdout("fullyQualifiedDomainName=example.tld"); assertInStdout("domainName=example.tld");
assertInStdout("fullyQualifiedDomainName=example2.tld"); assertInStdout("domainName=example2.tld");
assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE"); assertInStdout("Websafe key: kind:Domain@sql:rO0ABXQABTItVExE");
assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTQtVExE"); assertInStdout("Websafe key: kind:Domain@sql:rO0ABXQABTQtVExE");
} }
@Test @Test
@ -112,7 +112,7 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
persistActiveDomain("example.tld"); persistActiveDomain("example.tld");
createTld("com"); createTld("com");
runCommand("example.com", "example.tld"); runCommand("example.com", "example.tld");
assertInStdout("fullyQualifiedDomainName=example.tld"); assertInStdout("domainName=example.tld");
assertInStdout("Domain 'example.com' does not exist or is deleted"); assertInStdout("Domain 'example.com' does not exist or is deleted");
} }
} }

View file

@ -41,16 +41,16 @@ class GetHostCommandTest extends CommandTestCase<GetHostCommand> {
void testSuccess() throws Exception { void testSuccess() throws Exception {
persistActiveHost("ns1.example.tld"); persistActiveHost("ns1.example.tld");
runCommand("ns1.example.tld"); runCommand("ns1.example.tld");
assertInStdout("fullyQualifiedHostName=ns1.example.tld"); assertInStdout("hostName=ns1.example.tld");
assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjItUk9JRA"); assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjItUk9JRA");
} }
@Test @Test
void testSuccess_expand() throws Exception { void testSuccess_expand() throws Exception {
persistActiveHost("ns1.example.tld"); persistActiveHost("ns1.example.tld");
runCommand("ns1.example.tld", "--expand"); runCommand("ns1.example.tld", "--expand");
assertInStdout("fullyQualifiedHostName=ns1.example.tld"); assertInStdout("hostName=ns1.example.tld");
assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjItUk9JRA"); assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjItUk9JRA");
assertNotInStdout("LiveRef"); assertNotInStdout("LiveRef");
} }
@ -59,10 +59,10 @@ class GetHostCommandTest extends CommandTestCase<GetHostCommand> {
persistActiveHost("ns1.example.tld"); persistActiveHost("ns1.example.tld");
persistActiveHost("ns2.example.tld"); persistActiveHost("ns2.example.tld");
runCommand("ns1.example.tld", "ns2.example.tld"); runCommand("ns1.example.tld", "ns2.example.tld");
assertInStdout("fullyQualifiedHostName=ns1.example.tld"); assertInStdout("hostName=ns1.example.tld");
assertInStdout("fullyQualifiedHostName=ns2.example.tld"); assertInStdout("hostName=ns2.example.tld");
assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjItUk9JRA"); assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjItUk9JRA");
assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjMtUk9JRA"); assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjMtUk9JRA");
} }
@Test @Test
@ -71,8 +71,8 @@ class GetHostCommandTest extends CommandTestCase<GetHostCommand> {
createTld("tld2"); createTld("tld2");
persistActiveHost("ns1.example.tld2"); persistActiveHost("ns1.example.tld2");
runCommand("ns1.example.tld", "ns1.example.tld2"); runCommand("ns1.example.tld", "ns1.example.tld2");
assertInStdout("fullyQualifiedHostName=ns1.example.tld"); assertInStdout("hostName=ns1.example.tld");
assertInStdout("fullyQualifiedHostName=ns1.example.tld2"); assertInStdout("hostName=ns1.example.tld2");
} }
@Test @Test
@ -100,7 +100,7 @@ class GetHostCommandTest extends CommandTestCase<GetHostCommand> {
void testSuccess_externalHost() throws Exception { void testSuccess_externalHost() throws Exception {
persistActiveHost("ns1.example.foo"); persistActiveHost("ns1.example.foo");
runCommand("ns1.example.foo"); runCommand("ns1.example.foo");
assertInStdout("fullyQualifiedHostName=ns1.example.foo"); assertInStdout("hostName=ns1.example.foo");
} }
@Test @Test

View file

@ -25,7 +25,7 @@ import com.beust.jcommander.ParameterException;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import google.registry.model.domain.Domain; import google.registry.model.domain.Domain;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.persistence.VKey; import google.registry.persistence.VKey;
@ -44,7 +44,7 @@ class UniformRapidSuspensionCommandTest
private Host urs1; private Host urs1;
private Host urs2; private Host urs2;
private Domain defaultDomain; private Domain defaultDomain;
private ImmutableSet<DelegationSignerData> defaultDsData; private ImmutableSet<DomainDsData> defaultDsData;
@BeforeEach @BeforeEach
void beforeEach() { void beforeEach() {
@ -58,12 +58,12 @@ class UniformRapidSuspensionCommandTest
defaultDomain = DatabaseHelper.newDomain("evil.tld"); defaultDomain = DatabaseHelper.newDomain("evil.tld");
defaultDsData = defaultDsData =
ImmutableSet.of( ImmutableSet.of(
DelegationSignerData.create(1, 2, 3, new HexBinaryAdapter().unmarshal("dead")), DomainDsData.create(1, 2, 3, new HexBinaryAdapter().unmarshal("dead")),
DelegationSignerData.create(4, 5, 6, new HexBinaryAdapter().unmarshal("beef"))); DomainDsData.create(4, 5, 6, new HexBinaryAdapter().unmarshal("beef")));
} }
private void persistDomainWithHosts( private void persistDomainWithHosts(
Domain domain, ImmutableSet<DelegationSignerData> dsData, Host... hosts) { Domain domain, ImmutableSet<DomainDsData> dsData, Host... hosts) {
ImmutableSet.Builder<VKey<Host>> hostRefs = new ImmutableSet.Builder<>(); ImmutableSet.Builder<VKey<Host>> hostRefs = new ImmutableSet.Builder<>();
for (Host host : hosts) { for (Host host : hosts) {
hostRefs.add(host.createVKey()); hostRefs.add(host.createVKey());

View file

@ -354,7 +354,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
@Test @Test
void testSuccess_setAllowedNameserversOverwrites() throws Exception { void testSuccess_setAllowedNameserversOverwrites() throws Exception {
persistResource( persistResource(
Registry.get("xn--q9jyb4c").asBuilder() Registry.get("xn--q9jyb4c")
.asBuilder()
.setAllowedFullyQualifiedHostNames( .setAllowedFullyQualifiedHostNames(
ImmutableSet.of("ns1.example.tld", "ns2.example.tld")) ImmutableSet.of("ns1.example.tld", "ns2.example.tld"))
.build()); .build());
@ -366,7 +367,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
@Test @Test
void testSuccess_addAllowedNameservers() throws Exception { void testSuccess_addAllowedNameservers() throws Exception {
persistResource( persistResource(
Registry.get("xn--q9jyb4c").asBuilder() Registry.get("xn--q9jyb4c")
.asBuilder()
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns1.example.com")) .setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns1.example.com"))
.build()); .build());
runCommandForced("--add_allowed_nameservers=ns2.example.com", "xn--q9jyb4c"); runCommandForced("--add_allowed_nameservers=ns2.example.com", "xn--q9jyb4c");
@ -377,7 +379,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
@Test @Test
void testSuccess_removeAllAllowedNameservers() throws Exception { void testSuccess_removeAllAllowedNameservers() throws Exception {
persistResource( persistResource(
Registry.get("xn--q9jyb4c").asBuilder() Registry.get("xn--q9jyb4c")
.asBuilder()
.setAllowedFullyQualifiedHostNames( .setAllowedFullyQualifiedHostNames(
ImmutableSet.of("ns1.example.com", "ns2.example.com")) ImmutableSet.of("ns1.example.com", "ns2.example.com"))
.build()); .build());
@ -388,7 +391,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
@Test @Test
void testSuccess_removeSomeAllowedNameservers() throws Exception { void testSuccess_removeSomeAllowedNameservers() throws Exception {
persistResource( persistResource(
Registry.get("xn--q9jyb4c").asBuilder() Registry.get("xn--q9jyb4c")
.asBuilder()
.setAllowedFullyQualifiedHostNames( .setAllowedFullyQualifiedHostNames(
ImmutableSet.of("ns1.example.com", "ns2.example.com")) ImmutableSet.of("ns1.example.com", "ns2.example.com"))
.build()); .build());
@ -782,7 +786,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
@Test @Test
void testFailure_cantAddDuplicateAllowedNameservers() { void testFailure_cantAddDuplicateAllowedNameservers() {
persistResource( persistResource(
Registry.get("xn--q9jyb4c").asBuilder() Registry.get("xn--q9jyb4c")
.asBuilder()
.setAllowedFullyQualifiedHostNames( .setAllowedFullyQualifiedHostNames(
ImmutableSet.of("ns1.example.com", "ns2.example.com")) ImmutableSet.of("ns1.example.com", "ns2.example.com"))
.build()); .build());
@ -796,9 +801,9 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
@Test @Test
void testFailure_cantRemoveAllowedNameserverThatIsntPresent() { void testFailure_cantRemoveAllowedNameserverThatIsntPresent() {
persistResource( persistResource(
Registry.get("xn--q9jyb4c").asBuilder() Registry.get("xn--q9jyb4c")
.setAllowedFullyQualifiedHostNames( .asBuilder()
ImmutableSet.of("ns1.example.com")) .setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns1.example.com"))
.build()); .build());
IllegalArgumentException thrown = IllegalArgumentException thrown =
assertThrows( assertThrows(

View file

@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import google.registry.gcs.GcsUtils; import google.registry.gcs.GcsUtils;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.persistence.VKey; import google.registry.persistence.VKey;
@ -82,7 +82,7 @@ class GenerateZoneFilesActionTest {
DatabaseHelper.newDomain("ns-and-ds.tld") DatabaseHelper.newDomain("ns-and-ds.tld")
.asBuilder() .asBuilder()
.addNameservers(nameservers) .addNameservers(nameservers)
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
.build()); .build());
persistResource( persistResource(
DatabaseHelper.newDomain("ns-only.tld").asBuilder().addNameservers(nameservers).build()); DatabaseHelper.newDomain("ns-only.tld").asBuilder().addNameservers(nameservers).build());
@ -110,7 +110,7 @@ class GenerateZoneFilesActionTest {
persistResource( persistResource(
DatabaseHelper.newDomain("ds-only.tld") DatabaseHelper.newDomain("ds-only.tld")
.asBuilder() .asBuilder()
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
.build()); .build());
persistActiveContact("ignored_contact"); persistActiveContact("ignored_contact");
persistActiveHost("ignored.host.tld"); // No ips. persistActiveHost("ignored.host.tld"); // No ips.
@ -120,7 +120,7 @@ class GenerateZoneFilesActionTest {
DatabaseHelper.newDomain("ignored.com") DatabaseHelper.newDomain("ignored.com")
.asBuilder() .asBuilder()
.addNameservers(nameservers) .addNameservers(nameservers)
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
.build()); .build());
GenerateZoneFilesAction action = new GenerateZoneFilesAction(); GenerateZoneFilesAction action = new GenerateZoneFilesAction();

View file

@ -142,17 +142,17 @@ class ListDomainsActionTest extends ListActionTestCase {
@Test @Test
void testRun_twoLinesWithIdOnlyExplicitHeader() { void testRun_twoLinesWithIdOnlyExplicitHeader() {
action.tlds = ImmutableSet.of("foo"); action.tlds = ImmutableSet.of("foo");
persistActiveDomain("example1.foo", DateTime.parse("2010-03-04T16:00:00Z")); persistActiveDomain("test1.foo", DateTime.parse("2010-03-04T16:00:00Z"));
persistActiveDomain("example2.foo", DateTime.parse("2011-03-04T16:00:00Z")); persistActiveDomain("test2.foo", DateTime.parse("2011-03-04T16:00:00Z"));
testRunSuccess( testRunSuccess(
action, action,
Optional.empty(), Optional.empty(),
Optional.of(true), Optional.of(true),
Optional.empty(), Optional.empty(),
"^fullyQualifiedDomainName$", "^domainName$",
"^-+\\s*$", "^-+\\s*$",
"^example1.foo\\s*$", "^test1.foo\\s*$",
"^example2.foo\\s*$"); "^test2.foo\\s*$");
} }
@Test @Test
@ -165,7 +165,7 @@ class ListDomainsActionTest extends ListActionTestCase {
Optional.of("repoId"), Optional.of("repoId"),
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
"^fullyQualifiedDomainName\\s+repoId\\s*$", "^domainName\\s+repoId\\s*$",
"^-+\\s+-+\\s*$", "^-+\\s+-+\\s*$",
"^example1.foo\\s+2-FOO\\s*$", "^example1.foo\\s+2-FOO\\s*$",
"^example3.foo\\s+4-FOO\\s*$"); "^example3.foo\\s+4-FOO\\s*$");
@ -195,7 +195,7 @@ class ListDomainsActionTest extends ListActionTestCase {
Optional.of("repoId"), Optional.of("repoId"),
Optional.of(true), Optional.of(true),
Optional.empty(), Optional.empty(),
"^fullyQualifiedDomainName\\s+repoId\\s*$", "^domainName\\s+repoId\\s*$",
"^-+\\s+-+\\s*$", "^-+\\s+-+\\s*$",
"^example1.foo\\s+2-FOO\\s*$", "^example1.foo\\s+2-FOO\\s*$",
"^example3.foo\\s+4-FOO\\s*$"); "^example3.foo\\s+4-FOO\\s*$");
@ -211,7 +211,7 @@ class ListDomainsActionTest extends ListActionTestCase {
Optional.of("*"), Optional.of("*"),
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
"^fullyQualifiedDomainName\\s+.*repoId", "^domainName\\s+.*repoId",
"^-+\\s+-+", "^-+\\s+-+",
"^example1.foo\\s+.*2-FOO", "^example1.foo\\s+.*2-FOO",
"^example3.foo\\s+.*4-FOO"); "^example3.foo\\s+.*4-FOO");
@ -227,7 +227,7 @@ class ListDomainsActionTest extends ListActionTestCase {
Optional.of("*,repoId"), Optional.of("*,repoId"),
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
"^fullyQualifiedDomainName\\s+.*repoId", "^domainName\\s+.*repoId",
"^-+\\s+-+", "^-+\\s+-+",
"^example1.foo\\s+.*2-FOO", "^example1.foo\\s+.*2-FOO",
"^example3.foo\\s+.*4-FOO"); "^example3.foo\\s+.*4-FOO");

View file

@ -53,7 +53,7 @@ class ListHostsActionTest extends ListActionTestCase {
Optional.of("repoId"), Optional.of("repoId"),
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
"^fullyQualifiedHostName\\s+repoId\\s*$", "^hostName\\s+repoId\\s*$",
"^-+\\s+-+\\s*$", "^-+\\s+-+\\s*$",
"^example1.foo\\s+3-ROID\\s*$", "^example1.foo\\s+3-ROID\\s*$",
"^example2.foo\\s+2-ROID\\s*$"); "^example2.foo\\s+2-ROID\\s*$");
@ -68,7 +68,7 @@ class ListHostsActionTest extends ListActionTestCase {
Optional.of("*"), Optional.of("*"),
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
"^fullyQualifiedHostName\\s+.*repoId", "^hostName\\s+.*repoId",
"^-+\\s+-+", "^-+\\s+-+",
"^example1.foo\\s+.*2", "^example1.foo\\s+.*2",
"^example2.foo\\s+.*1"); "^example2.foo\\s+.*1");
@ -83,7 +83,7 @@ class ListHostsActionTest extends ListActionTestCase {
Optional.of("*,repoId"), Optional.of("*,repoId"),
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
"^fullyQualifiedHostName\\s+.*repoId", "^hostName\\s+.*repoId",
"^-+\\s+-+", "^-+\\s+-+",
"^example1.foo\\s+.*2", "^example1.foo\\s+.*2",
"^example2.foo\\s+.*1"); "^example2.foo\\s+.*1");

View file

@ -145,7 +145,7 @@ public class RegistrarConsoleWebTest extends WebDriverTestCase {
driver.setFormFieldsById( driver.setFormFieldsById(
new ImmutableMap.Builder<String, String>() new ImmutableMap.Builder<String, String>()
.put("emailAddress", "test1@example.com") .put("emailAddress", "test1@example.com")
.put("clientIdentifier", "ignored") .put("registrarId", "ignored")
.put("whoisServer", "foo.bar.baz") .put("whoisServer", "foo.bar.baz")
.put("url", "blah.blar") .put("url", "blah.blar")
.put("phoneNumber", "+1.2125650000") .put("phoneNumber", "+1.2125650000")

View file

@ -31,7 +31,7 @@ import google.registry.model.domain.DesignatedContact;
import google.registry.model.domain.Domain; import google.registry.model.domain.Domain;
import google.registry.model.domain.GracePeriod; import google.registry.model.domain.GracePeriod;
import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.rgp.GracePeriodStatus;
import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.domain.secdns.DomainDsData;
import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.StatusValue;
import google.registry.model.host.Host; import google.registry.model.host.Host;
import google.registry.model.registrar.Registrar; import google.registry.model.registrar.Registrar;
@ -268,7 +268,7 @@ class DomainWhoisResponseTest {
DesignatedContact.create(DesignatedContact.Type.ADMIN, adminResourceKey), DesignatedContact.create(DesignatedContact.Type.ADMIN, adminResourceKey),
DesignatedContact.create(DesignatedContact.Type.TECH, techResourceKey))) DesignatedContact.create(DesignatedContact.Type.TECH, techResourceKey)))
.setNameservers(ImmutableSet.of(host1VKey, host2VKey)) .setNameservers(ImmutableSet.of(host1VKey, host2VKey))
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, "deadface"))) .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, "deadface")))
.setGracePeriods( .setGracePeriods(
ImmutableSet.of( ImmutableSet.of(
GracePeriod.create( GracePeriod.create(

View file

@ -1,4 +1,4 @@
Map from registrar email / name to detected domain name threats: Map from registrar email / name to detected domain name threats:
{"threatMatches":[{"threatType":"UNWANTED_SOFTWARE","fullyQualifiedDomainName":"anti-anti-anti-virus.dev"}],"registrarClientId":"cool-registrar","registrarEmailAddress":"cool@aid.net"} {"threatMatches":[{"threatType":"UNWANTED_SOFTWARE","domainName":"anti-anti-anti-virus.dev"}],"registrarClientId":"cool-registrar","registrarEmailAddress":"cool@aid.net"}
{"threatMatches":[{"threatType":"MALWARE","fullyQualifiedDomainName":"111.com"},{"threatType":"POTENTIALLY_HARMFUL_APPLICATION","fullyQualifiedDomainName":"bitcoin.bank"}],"registrarClientId":"hello-registrar","registrarEmailAddress":"email@hello.net"} {"threatMatches":[{"threatType":"MALWARE","domainName":"111.com"},{"threatType":"POTENTIALLY_HARMFUL_APPLICATION","domainName":"bitcoin.bank"}],"registrarClientId":"hello-registrar","registrarEmailAddress":"email@hello.net"}
{"threatMatches":[{"threatType":"THREAT_TYPE_UNSPECIFIED","fullyQualifiedDomainName":"no-eamil.com"},{"threatType":"SOCIAL_ENGINEERING","fullyQualifiedDomainName":"party-night.net"}],"registrarClientId":"kitty-registrar","registrarEmailAddress":"contact@kit.ty"} {"threatMatches":[{"threatType":"THREAT_TYPE_UNSPECIFIED","domainName":"no-eamil.com"},{"threatType":"SOCIAL_ENGINEERING","domainName":"party-night.net"}],"registrarClientId":"kitty-registrar","registrarEmailAddress":"contact@kit.ty"}

View file

@ -49,7 +49,7 @@ class google.registry.model.domain.Domain {
google.registry.persistence.VKey<google.registry.model.poll.PollMessage$OneTime> deletePollMessage; google.registry.persistence.VKey<google.registry.model.poll.PollMessage$OneTime> deletePollMessage;
java.lang.String creationClientId; java.lang.String creationClientId;
java.lang.String currentSponsorClientId; java.lang.String currentSponsorClientId;
java.lang.String fullyQualifiedDomainName; java.lang.String domainName;
java.lang.String idnTableName; java.lang.String idnTableName;
java.lang.String lastEppUpdateClientId; java.lang.String lastEppUpdateClientId;
java.lang.String smdId; java.lang.String smdId;
@ -72,7 +72,7 @@ class google.registry.model.domain.DomainBase {
google.registry.persistence.VKey<google.registry.model.poll.PollMessage$OneTime> deletePollMessage; google.registry.persistence.VKey<google.registry.model.poll.PollMessage$OneTime> deletePollMessage;
java.lang.String creationClientId; java.lang.String creationClientId;
java.lang.String currentSponsorClientId; java.lang.String currentSponsorClientId;
java.lang.String fullyQualifiedDomainName; java.lang.String domainName;
java.lang.String idnTableName; java.lang.String idnTableName;
java.lang.String lastEppUpdateClientId; java.lang.String lastEppUpdateClientId;
java.lang.String smdId; java.lang.String smdId;
@ -104,7 +104,7 @@ class google.registry.model.host.Host {
google.registry.persistence.VKey<google.registry.model.domain.Domain> superordinateDomain; google.registry.persistence.VKey<google.registry.model.domain.Domain> superordinateDomain;
java.lang.String creationClientId; java.lang.String creationClientId;
java.lang.String currentSponsorClientId; java.lang.String currentSponsorClientId;
java.lang.String fullyQualifiedHostName; java.lang.String hostName;
java.lang.String lastEppUpdateClientId; java.lang.String lastEppUpdateClientId;
java.util.Set<java.net.InetAddress> inetAddresses; java.util.Set<java.net.InetAddress> inetAddresses;
org.joda.time.DateTime deletionTime; org.joda.time.DateTime deletionTime;
@ -117,7 +117,7 @@ class google.registry.model.host.HostBase {
google.registry.persistence.VKey<google.registry.model.domain.Domain> superordinateDomain; google.registry.persistence.VKey<google.registry.model.domain.Domain> superordinateDomain;
java.lang.String creationClientId; java.lang.String creationClientId;
java.lang.String currentSponsorClientId; java.lang.String currentSponsorClientId;
java.lang.String fullyQualifiedHostName; java.lang.String hostName;
java.lang.String lastEppUpdateClientId; java.lang.String lastEppUpdateClientId;
java.util.Set<java.net.InetAddress> inetAddresses; java.util.Set<java.net.InetAddress> inetAddresses;
org.joda.time.DateTime deletionTime; org.joda.time.DateTime deletionTime;

View file

@ -15,7 +15,7 @@
-- Determine the number of domains each registrar sponsors per tld. -- Determine the number of domains each registrar sponsors per tld.
-- This is just the number of fullyQualifiedDomainNames under each -- This is just the number of domainNames under each
-- tld-registrar pair. -- tld-registrar pair.
SELECT SELECT

Some files were not shown because too many files have changed in this diff Show more