mirror of
https://github.com/google/nomulus.git
synced 2025-04-29 19:47:51 +02:00
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:
parent
341a6e84cf
commit
ff38d8fc2c
107 changed files with 528 additions and 573 deletions
|
@ -91,7 +91,7 @@ public class DeleteProberDataAction implements Runnable {
|
|||
// Note: creationTime must be compared to a Java object (CreateAutoTimestamp) but deletionTime can
|
||||
// be compared directly to the SQL timestamp (it's a DateTime)
|
||||
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 <"
|
||||
+ " :creationTimeCutoff AND ((d.creationTime <= :nowAutoTimestamp AND d.deletionTime >"
|
||||
+ " current_timestamp()) OR d.deletionTime < :nowMinusSoftDeleteDelay) ORDER BY d.repoId";
|
||||
|
@ -220,7 +220,7 @@ public class DeleteProberDataAction implements Runnable {
|
|||
private void hardDeleteDomainsAndHosts(
|
||||
ImmutableList<String> domainRepoIds, ImmutableList<String> hostNames) {
|
||||
jpaTm()
|
||||
.query("DELETE FROM Host WHERE fullyQualifiedHostName IN :hostNames")
|
||||
.query("DELETE FROM Host WHERE hostName IN :hostNames")
|
||||
.setParameter("hostNames", hostNames)
|
||||
.executeUpdate();
|
||||
jpaTm()
|
||||
|
|
|
@ -301,7 +301,7 @@ public class RdePipeline implements Serializable {
|
|||
.apply(
|
||||
"Read all production Registrars",
|
||||
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),
|
||||
String.class,
|
||||
id -> VKey.createSql(Registrar.class, id)))
|
||||
|
|
|
@ -75,8 +75,8 @@ public class SafeBrowsingTransforms {
|
|||
private final String apiKey;
|
||||
|
||||
/**
|
||||
* Maps a domain name's {@code fullyQualifiedDomainName} to its corresponding {@link
|
||||
* DomainNameInfo} to facilitate batching SafeBrowsing API requests.
|
||||
* Maps a domain name's {@code domainName} to its corresponding {@link DomainNameInfo} to
|
||||
* facilitate batching SafeBrowsing API requests.
|
||||
*/
|
||||
private final Map<String, DomainNameInfo> domainNameInfoBuffer =
|
||||
new LinkedHashMap<>(BATCH_SIZE);
|
||||
|
@ -186,8 +186,8 @@ public class SafeBrowsingTransforms {
|
|||
private JSONObject createRequestBody() throws JSONException {
|
||||
// Accumulate all domain names to evaluate.
|
||||
JSONArray threatArray = new JSONArray();
|
||||
for (String fullyQualifiedDomainName : domainNameInfoBuffer.keySet()) {
|
||||
threatArray.put(new JSONObject().put("url", fullyQualifiedDomainName));
|
||||
for (String domainName : domainNameInfoBuffer.keySet()) {
|
||||
threatArray.put(new JSONObject().put("url", domainName));
|
||||
}
|
||||
// Construct the JSON request body
|
||||
return new JSONObject()
|
||||
|
|
|
@ -113,7 +113,7 @@ public class Spec11Pipeline implements Serializable {
|
|||
Read<Object[], KV<String, String>> read =
|
||||
RegistryJpaIO.read(
|
||||
"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()",
|
||||
false,
|
||||
Spec11Pipeline::parseRow);
|
||||
|
|
|
@ -25,23 +25,23 @@ import org.json.JSONObject;
|
|||
public abstract class ThreatMatch implements Serializable {
|
||||
|
||||
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.) */
|
||||
public abstract String threatType();
|
||||
/** Returns the fully qualified domain name [SLD].[TLD] of the matched threat. */
|
||||
public abstract String fullyQualifiedDomainName();
|
||||
public abstract String domainName();
|
||||
|
||||
@VisibleForTesting
|
||||
static ThreatMatch create(String threatType, String fullyQualifiedDomainName) {
|
||||
return new AutoValue_ThreatMatch(threatType, fullyQualifiedDomainName);
|
||||
static ThreatMatch create(String threatType, String domainName) {
|
||||
return new AutoValue_ThreatMatch(threatType, domainName);
|
||||
}
|
||||
|
||||
/** Returns a {@link JSONObject} representing a subset of this object's data. */
|
||||
JSONObject toJSON() throws JSONException {
|
||||
return new JSONObject()
|
||||
.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}. */
|
||||
|
|
|
@ -37,7 +37,7 @@ import google.registry.dns.writer.BaseDnsWriter;
|
|||
import google.registry.dns.writer.DnsWriter;
|
||||
import google.registry.dns.writer.DnsWriterZone;
|
||||
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.tld.Registries;
|
||||
import google.registry.util.Clock;
|
||||
|
@ -134,10 +134,10 @@ public class CloudDnsWriter extends BaseDnsWriter {
|
|||
ImmutableSet.Builder<ResourceRecordSet> domainRecords = new ImmutableSet.Builder<>();
|
||||
|
||||
// Construct DS records (if any).
|
||||
Set<DelegationSignerData> dsData = domain.get().getDsData();
|
||||
Set<DomainDsData> dsData = domain.get().getDsData();
|
||||
if (!dsData.isEmpty()) {
|
||||
HashSet<String> dsRrData = new HashSet<>();
|
||||
for (DelegationSignerData ds : dsData) {
|
||||
for (DomainDsData ds : dsData) {
|
||||
dsRrData.add(ds.toRrData());
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import google.registry.config.RegistryConfig.Config;
|
|||
import google.registry.dns.writer.BaseDnsWriter;
|
||||
import google.registry.dns.writer.DnsWriterZone;
|
||||
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.tld.Registries;
|
||||
import google.registry.util.Clock;
|
||||
|
@ -185,7 +185,7 @@ public class DnsUpdateWriter extends BaseDnsWriter {
|
|||
|
||||
private RRset makeDelegationSignerSet(Domain domain) {
|
||||
RRset signerSet = new RRset();
|
||||
for (DelegationSignerData signerData : domain.getDsData()) {
|
||||
for (DomainDsData signerData : domain.getDsData()) {
|
||||
DSRecord dsRecord =
|
||||
new DSRecord(
|
||||
toAbsoluteName(domain.getDomainName()),
|
||||
|
|
|
@ -91,10 +91,10 @@ public class ExportDomainListsAction implements Runnable {
|
|||
// field that compares with the substituted value.
|
||||
jpaTm()
|
||||
.query(
|
||||
"SELECT fullyQualifiedDomainName FROM Domain "
|
||||
"SELECT domainName FROM Domain "
|
||||
+ "WHERE tld = :tld "
|
||||
+ "AND deletionTime > :now "
|
||||
+ "ORDER by fullyQualifiedDomainName ASC",
|
||||
+ "ORDER by domainName ASC",
|
||||
String.class)
|
||||
.setParameter("tld", tld)
|
||||
.setParameter("now", clock.nowUtc())
|
||||
|
|
|
@ -114,7 +114,7 @@ class SyncRegistrarsSheet {
|
|||
// and you'll need to remove deleted columns probably like a week after
|
||||
// deployment.
|
||||
//
|
||||
builder.put("clientIdentifier", convert(registrar.getRegistrarId()));
|
||||
builder.put("registrarId", convert(registrar.getRegistrarId()));
|
||||
builder.put("registrarName", convert(registrar.getRegistrarName()));
|
||||
builder.put("state", convert(registrar.getState()));
|
||||
builder.put("ianaIdentifier", convert(registrar.getIanaIdentifier()));
|
||||
|
|
|
@ -248,7 +248,7 @@ public final class DomainCreateFlow implements TransactionalFlow {
|
|||
validateRegistrationPeriod(years);
|
||||
verifyResourceDoesNotExist(Domain.class, targetId, now, registrarId);
|
||||
// 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);
|
||||
Registry registry = Registry.get(domainName.parent().toString());
|
||||
validateCreateCommandContactsAndNameservers(command, registry, domainName);
|
||||
|
@ -639,10 +639,7 @@ public final class DomainCreateFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private static PollMessage.OneTime createNameCollisionOneTimePollMessage(
|
||||
String fullyQualifiedDomainName,
|
||||
HistoryEntry historyEntry,
|
||||
String registrarId,
|
||||
DateTime now) {
|
||||
String domainName, HistoryEntry historyEntry, String registrarId, DateTime now) {
|
||||
return new PollMessage.OneTime.Builder()
|
||||
.setRegistrarId(registrarId)
|
||||
.setEventTime(now)
|
||||
|
@ -650,7 +647,7 @@ public final class DomainCreateFlow implements TransactionalFlow {
|
|||
.setResponseData(
|
||||
ImmutableList.of(
|
||||
DomainPendingActionNotificationResponse.create(
|
||||
fullyQualifiedDomainName, true, historyEntry.getTrid(), now)))
|
||||
domainName, true, historyEntry.getTrid(), now)))
|
||||
.setHistoryEntry(historyEntry)
|
||||
.build();
|
||||
}
|
||||
|
|
|
@ -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.LaunchPhase;
|
||||
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.SecDnsInfoExtension;
|
||||
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. */
|
||||
static void validateDsData(Set<DelegationSignerData> dsData) throws EppException {
|
||||
static void validateDsData(Set<DomainDsData> dsData) throws EppException {
|
||||
if (dsData != null) {
|
||||
if (dsData.size() > MAX_DS_RECORDS_PER_DOMAIN) {
|
||||
throw new TooManyDsRecordsException(
|
||||
String.format(
|
||||
"A maximum of %s DS records are allowed per domain.", MAX_DS_RECORDS_PER_DOMAIN));
|
||||
}
|
||||
ImmutableList<DelegationSignerData> invalidAlgorithms =
|
||||
ImmutableList<DomainDsData> invalidAlgorithms =
|
||||
dsData.stream()
|
||||
.filter(ds -> !validateAlgorithm(ds.getAlgorithm()))
|
||||
.collect(toImmutableList());
|
||||
|
@ -333,7 +333,7 @@ public class DomainFlowUtils {
|
|||
"Domain contains DS record(s) with an invalid algorithm wire value: %s",
|
||||
invalidAlgorithms));
|
||||
}
|
||||
ImmutableList<DelegationSignerData> invalidDigestTypes =
|
||||
ImmutableList<DomainDsData> invalidDigestTypes =
|
||||
dsData.stream()
|
||||
.filter(ds -> !DigestType.fromWireValue(ds.getDigestType()).isPresent())
|
||||
.collect(toImmutableList());
|
||||
|
@ -343,7 +343,7 @@ public class DomainFlowUtils {
|
|||
"Domain contains DS record(s) with an invalid digest type: %s",
|
||||
invalidDigestTypes));
|
||||
}
|
||||
ImmutableList<DelegationSignerData> digestsWithInvalidDigestLength =
|
||||
ImmutableList<DomainDsData> digestsWithInvalidDigestLength =
|
||||
dsData.stream()
|
||||
.filter(
|
||||
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.
|
||||
*/
|
||||
static void addSecDnsExtensionIfPresent(
|
||||
ImmutableList.Builder<ResponseExtension> extensions,
|
||||
ImmutableSet<DelegationSignerData> dsData) {
|
||||
ImmutableList.Builder<ResponseExtension> extensions, ImmutableSet<DomainDsData> dsData) {
|
||||
if (!dsData.isEmpty()) {
|
||||
extensions.add(SecDnsInfoExtension.create(dsData));
|
||||
}
|
||||
}
|
||||
|
||||
/** Update {@link DelegationSignerData} based on an update extension command. */
|
||||
static ImmutableSet<DelegationSignerData> updateDsData(
|
||||
ImmutableSet<DelegationSignerData> oldDsData, SecDnsUpdateExtension secDnsUpdate)
|
||||
/** Update {@link DomainDsData} based on an update extension command. */
|
||||
static ImmutableSet<DomainDsData> updateDsData(
|
||||
ImmutableSet<DomainDsData> oldDsData, SecDnsUpdateExtension secDnsUpdate)
|
||||
throws EppException {
|
||||
// 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.
|
||||
|
@ -948,8 +947,8 @@ public class DomainFlowUtils {
|
|||
if (remove != null && Boolean.FALSE.equals(remove.getAll())) {
|
||||
throw new SecDnsAllUsageException(); // Explicit all=false is meaningless.
|
||||
}
|
||||
Set<DelegationSignerData> toAdd = (add == null) ? ImmutableSet.of() : add.getDsData();
|
||||
Set<DelegationSignerData> toRemove =
|
||||
Set<DomainDsData> toAdd = (add == null) ? ImmutableSet.of() : add.getDsData();
|
||||
Set<DomainDsData> toRemove =
|
||||
(remove == null)
|
||||
? ImmutableSet.of()
|
||||
: (remove.getAll() == null) ? remove.getDsData() : oldDsData;
|
||||
|
@ -1001,9 +1000,9 @@ public class DomainFlowUtils {
|
|||
validateRegistrantAllowedOnTld(tld, command.getRegistrantContactId());
|
||||
validateNoDuplicateContacts(command.getContacts());
|
||||
validateRequiredContactsPresent(command.getRegistrant(), command.getContacts());
|
||||
ImmutableSet<String> fullyQualifiedHostNames = command.getNameserverFullyQualifiedHostNames();
|
||||
validateNameserversCountForTld(tld, domainName, fullyQualifiedHostNames.size());
|
||||
validateNameserversAllowedOnTld(tld, fullyQualifiedHostNames);
|
||||
ImmutableSet<String> hostNames = command.getNameserverHostNames();
|
||||
validateNameserversCountForTld(tld, domainName, hostNames.size());
|
||||
validateNameserversAllowedOnTld(tld, hostNames);
|
||||
}
|
||||
|
||||
/** Validate the secDNS extension, if present. */
|
||||
|
@ -1542,11 +1541,11 @@ public class DomainFlowUtils {
|
|||
/** Nameservers are not allow-listed for this TLD. */
|
||||
public static class NameserversNotAllowedForTldException
|
||||
extends StatusProhibitsOperationException {
|
||||
public NameserversNotAllowedForTldException(Set<String> fullyQualifiedHostNames) {
|
||||
public NameserversNotAllowedForTldException(Set<String> hostNames) {
|
||||
super(
|
||||
String.format(
|
||||
"Nameservers '%s' are not allow-listed for this TLD",
|
||||
Joiner.on(',').join(fullyQualifiedHostNames)));
|
||||
Joiner.on(',').join(hostNames)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ public final class DomainInfoFlow implements Flow {
|
|||
// This is a policy decision that is left up to us by the rfcs.
|
||||
DomainInfoData.Builder infoBuilder =
|
||||
DomainInfoData.newBuilder()
|
||||
.setFullyQualifiedDomainName(domain.getDomainName())
|
||||
.setDomainName(domain.getDomainName())
|
||||
.setRepoId(domain.getRepoId())
|
||||
.setCurrentSponsorClientId(domain.getCurrentSponsorRegistrarId())
|
||||
.setRegistrant(
|
||||
|
|
|
@ -218,7 +218,7 @@ public final class DomainTransferUtils {
|
|||
TransferData transferData,
|
||||
@Nullable DateTime extendedRegistrationExpirationTime) {
|
||||
return new DomainTransferResponse.Builder()
|
||||
.setFullyQualifiedDomainName(targetId)
|
||||
.setDomainName(targetId)
|
||||
.setGainingRegistrarId(transferData.getGainingRegistrarId())
|
||||
.setLosingRegistrarId(transferData.getLosingRegistrarId())
|
||||
.setPendingTransferExpirationTime(transferData.getPendingTransferExpirationTime())
|
||||
|
|
|
@ -74,7 +74,7 @@ import google.registry.model.domain.DomainCommand.Update.Change;
|
|||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.fee.FeeUpdateCommandExtension;
|
||||
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.superuser.DomainUpdateSuperuserExtension;
|
||||
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.reporting.IcannReportingTypes.ActivityReportField;
|
||||
import google.registry.model.tld.Registry;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import javax.inject.Inject;
|
||||
import org.joda.time.DateTime;
|
||||
|
@ -181,8 +182,8 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
DomainHistory domainHistory =
|
||||
historyBuilder.setType(DOMAIN_UPDATE).setDomain(newDomain).build();
|
||||
validateNewState(newDomain);
|
||||
if (newDomain.getDsData() != existingDomain.getDsData()
|
||||
|| newDomain.getNsHosts() != existingDomain.getNsHosts()) {
|
||||
if (!Objects.equals(newDomain.getDsData(), existingDomain.getDsData())
|
||||
|| !Objects.equals(newDomain.getNsHosts(), existingDomain.getNsHosts())) {
|
||||
dnsQueue.addDomainRefreshTask(targetId);
|
||||
}
|
||||
ImmutableSet.Builder<ImmutableObject> entitiesToSave = new ImmutableSet.Builder<>();
|
||||
|
@ -232,8 +233,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
validateContactsHaveTypes(add.getContacts());
|
||||
validateContactsHaveTypes(remove.getContacts());
|
||||
validateRegistrantAllowedOnTld(tld, command.getInnerChange().getRegistrantContactId());
|
||||
validateNameserversAllowedOnTld(
|
||||
tld, add.getNameserverFullyQualifiedHostNames());
|
||||
validateNameserversAllowedOnTld(tld, add.getNameserverHostNames());
|
||||
}
|
||||
|
||||
private Domain performUpdate(Update command, Domain domain, DateTime now) throws EppException {
|
||||
|
@ -263,7 +263,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
secDnsUpdate.isPresent()
|
||||
? updateDsData(
|
||||
domain.getDsData().stream()
|
||||
.map(DelegationSignerData::cloneWithoutDomainRepoId)
|
||||
.map(DomainDsData::cloneWithoutDomainRepoId)
|
||||
.collect(toImmutableSet()),
|
||||
secDnsUpdate.get())
|
||||
: domain.getDsData())
|
||||
|
|
|
@ -175,11 +175,7 @@ public class AllocationTokenFlowUtils {
|
|||
return Optional.empty();
|
||||
}
|
||||
AllocationToken tokenEntity = loadToken(extension.get().getAllocationToken());
|
||||
validateToken(
|
||||
InternetDomainName.from(command.getFullyQualifiedDomainName()),
|
||||
tokenEntity,
|
||||
registrarId,
|
||||
now);
|
||||
validateToken(InternetDomainName.from(command.getDomainName()), tokenEntity, registrarId, now);
|
||||
return Optional.of(
|
||||
tokenCustomLogic.validateToken(command, tokenEntity, registry, registrarId, now));
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ public final class HostCreateFlow implements TransactionalFlow {
|
|||
superordinateDomain
|
||||
.get()
|
||||
.asBuilder()
|
||||
.addSubordinateHost(command.getFullyQualifiedHostName())
|
||||
.addSubordinateHost(command.getHostName())
|
||||
.build());
|
||||
// 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.
|
||||
|
|
|
@ -93,7 +93,7 @@ public final class HostInfoFlow implements Flow {
|
|||
return responseBuilder
|
||||
.setResData(
|
||||
hostInfoDataBuilder
|
||||
.setFullyQualifiedHostName(host.getHostName())
|
||||
.setHostName(host.getHostName())
|
||||
.setRepoId(host.getRepoId())
|
||||
.setStatusValues(statusValues.build())
|
||||
.setInetAddresses(host.getInetAddresses())
|
||||
|
|
|
@ -129,7 +129,7 @@ public final class HostUpdateFlow implements TransactionalFlow {
|
|||
extensionManager.validate();
|
||||
Update command = (Update) resourceCommand;
|
||||
Change change = command.getInnerChange();
|
||||
String suppliedNewHostName = change.getFullyQualifiedHostName();
|
||||
String suppliedNewHostName = change.getHostName();
|
||||
DateTime now = tm().getTransactionTime();
|
||||
validateHostName(targetId);
|
||||
Host existingHost = loadAndVerifyExistence(Host.class, targetId, now);
|
||||
|
@ -260,7 +260,7 @@ public final class HostUpdateFlow implements TransactionalFlow {
|
|||
dnsQueue.addHostRefreshTask(existingHost.getHostName());
|
||||
}
|
||||
// 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
|
||||
// glue.
|
||||
if (newHost.isSubordinate()) {
|
||||
|
|
|
@ -140,10 +140,7 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable {
|
|||
DateTime lastEppUpdateTime;
|
||||
|
||||
/** Status values associated with this resource. */
|
||||
@Ignore
|
||||
@Column(name = "statuses")
|
||||
// TODO(b/177567432): rename to "statuses" once we're off datastore.
|
||||
Set<StatusValue> status;
|
||||
@Ignore Set<StatusValue> statuses;
|
||||
|
||||
public String getRepoId() {
|
||||
return repoId;
|
||||
|
@ -189,7 +186,7 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable {
|
|||
}
|
||||
|
||||
public final ImmutableSet<StatusValue> getStatusValues() {
|
||||
return nullToEmptyImmutableCopy(status);
|
||||
return nullToEmptyImmutableCopy(statuses);
|
||||
}
|
||||
|
||||
public DateTime getDeletionTime() {
|
||||
|
@ -307,7 +304,7 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable {
|
|||
statusValue,
|
||||
resourceClass.getSimpleName());
|
||||
}
|
||||
getInstance().status = statusValues;
|
||||
getInstance().statuses = statusValues;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
|
||||
|
|
|
@ -58,8 +58,8 @@ public final class ForeignKeyUtils {
|
|||
RESOURCE_TYPE_TO_FK_PROPERTY =
|
||||
ImmutableMap.of(
|
||||
Contact.class, "contactId",
|
||||
Domain.class, "fullyQualifiedDomainName",
|
||||
Host.class, "fullyQualifiedHostName");
|
||||
Domain.class, "domainName",
|
||||
Host.class, "hostName");
|
||||
|
||||
/**
|
||||
* Loads a {@link VKey} to an {@link EppResource} from the database by foreign key.
|
||||
|
|
|
@ -68,7 +68,7 @@ public class OteStats {
|
|||
((DomainCommand.Create)
|
||||
((ResourceCommandWrapper) eppInput.getCommandWrapper().getCommand())
|
||||
.getResourceCommand())
|
||||
.getFullyQualifiedDomainName()
|
||||
.getDomainName()
|
||||
.startsWith(ACE_PREFIX);
|
||||
|
||||
private static final Predicate<EppInput> IS_SUBORDINATE =
|
||||
|
|
|
@ -64,7 +64,7 @@ public final class ResourceTransferUtils {
|
|||
DomainTransferData domainTransferData = (DomainTransferData) transferData;
|
||||
builder =
|
||||
new DomainTransferResponse.Builder()
|
||||
.setFullyQualifiedDomainName(eppResource.getForeignKey())
|
||||
.setDomainName(eppResource.getForeignKey())
|
||||
.setExtendedRegistrationExpirationTime(
|
||||
ADD_EXDATE_STATUSES.contains(domainTransferData.getTransferStatus())
|
||||
? domainTransferData.getTransferredRegistrationExpirationTime()
|
||||
|
|
|
@ -24,7 +24,7 @@ import google.registry.model.domain.DomainBase;
|
|||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
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.host.Host;
|
||||
import google.registry.model.reporting.DomainTransactionRecord;
|
||||
|
@ -67,12 +67,12 @@ public class BulkQueryEntities {
|
|||
public static Domain assembleDomain(
|
||||
DomainLite domainLite,
|
||||
ImmutableSet<GracePeriod> gracePeriods,
|
||||
ImmutableSet<DelegationSignerData> delegationSignerData,
|
||||
ImmutableSet<DomainDsData> domainDsData,
|
||||
ImmutableSet<VKey<Host>> nsHosts) {
|
||||
Domain.Builder builder = new Domain.Builder();
|
||||
builder.copyFrom(domainLite);
|
||||
builder.setGracePeriods(gracePeriods);
|
||||
builder.setDsData(delegationSignerData);
|
||||
builder.setDsData(domainDsData);
|
||||
builder.setNameservers(nsHosts);
|
||||
// Restore the original update timestamp (this gets cleared when we set nameservers or DS data).
|
||||
builder.setUpdateTimestamp(domainLite.getUpdateTimestamp());
|
||||
|
@ -99,9 +99,7 @@ public class BulkQueryEntities {
|
|||
.map(GracePeriod::createFromHistory)
|
||||
.collect(toImmutableSet()))
|
||||
.setDsData(
|
||||
dsDataHistories.stream()
|
||||
.map(DelegationSignerData::create)
|
||||
.collect(toImmutableSet()))
|
||||
dsDataHistories.stream().map(DomainDsData::create).collect(toImmutableSet()))
|
||||
// Restore the original update timestamp (this gets cleared when we set nameservers or
|
||||
// DS data).
|
||||
.setUpdateTimestamp(domainHistoryLite.domainBase.getUpdateTimestamp())
|
||||
|
|
|
@ -19,7 +19,7 @@ import google.registry.model.EppResource;
|
|||
import google.registry.model.EppResource.ForeignKeyedEppResource;
|
||||
import google.registry.model.annotations.ExternalMessagingName;
|
||||
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.persistence.VKey;
|
||||
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
|
||||
* 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
|
||||
* 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
|
||||
* the set.
|
||||
* deleting the whole entry from the table when the {@link DomainDsData} is removed from the set.
|
||||
*/
|
||||
@Access(AccessType.PROPERTY)
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true)
|
||||
|
@ -134,7 +133,7 @@ public class Domain extends DomainBase implements ForeignKeyedEppResource {
|
|||
insertable = false,
|
||||
updatable = false)
|
||||
@SuppressWarnings("UnusedMethod")
|
||||
private Set<DelegationSignerData> getInternalDelegationSignerData() {
|
||||
private Set<DomainDsData> getInternalDelegationSignerData() {
|
||||
return dsData;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ import google.registry.model.billing.BillingEvent;
|
|||
import google.registry.model.contact.Contact;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
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.eppcommon.StatusValue;
|
||||
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.
|
||||
*
|
||||
* <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.
|
||||
*
|
||||
* @invariant fullyQualifiedDomainName == fullyQualifiedDomainName.toLowerCase(Locale.ENGLISH)
|
||||
* @invariant domainName == domainName.toLowerCase(Locale.ENGLISH)
|
||||
*/
|
||||
// TODO(b/177567432): Rename this to domainName when we are off Datastore
|
||||
@Column(name = "domainName")
|
||||
@Index
|
||||
String fullyQualifiedDomainName;
|
||||
@Index String domainName;
|
||||
|
||||
/** 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;
|
||||
|
||||
/** References to hosts that are the nameservers for the domain. */
|
||||
|
@ -145,7 +142,7 @@ public class DomainBase extends EppResource
|
|||
DomainAuthInfo authInfo;
|
||||
|
||||
/** 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.
|
||||
|
@ -340,14 +337,14 @@ public class DomainBase extends EppResource
|
|||
|
||||
@Override
|
||||
public String getForeignKey() {
|
||||
return fullyQualifiedDomainName;
|
||||
return domainName;
|
||||
}
|
||||
|
||||
public String getDomainName() {
|
||||
return fullyQualifiedDomainName;
|
||||
return domainName;
|
||||
}
|
||||
|
||||
public ImmutableSet<DelegationSignerData> getDsData() {
|
||||
public ImmutableSet<DomainDsData> getDsData() {
|
||||
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
|
||||
@SuppressWarnings("UnusedMethod")
|
||||
private void setInternalDelegationSignerData(Set<DelegationSignerData> dsData) {
|
||||
private void setInternalDelegationSignerData(Set<DomainDsData> dsData) {
|
||||
if (this.dsData instanceof PersistentSet) {
|
||||
Set<DelegationSignerData> nonNullDsData = nullToEmpty(dsData);
|
||||
Set<DomainDsData> nonNullDsData = nullToEmpty(dsData);
|
||||
this.dsData.retainAll(nonNullDsData);
|
||||
this.dsData.addAll(nonNullDsData);
|
||||
} else {
|
||||
|
@ -728,9 +725,9 @@ public class DomainBase extends EppResource
|
|||
// If there is no autorenew end time, set it to 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");
|
||||
instance.tld = getTldFromDomainName(instance.fullyQualifiedDomainName);
|
||||
instance.tld = getTldFromDomainName(instance.domainName);
|
||||
|
||||
T newDomain = super.build();
|
||||
// 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)),
|
||||
"Domain name %s not in puny-coded, lower-case form",
|
||||
domainName);
|
||||
getInstance().fullyQualifiedDomainName = domainName;
|
||||
getInstance().domainName = domainName;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
|
||||
public B setDsData(ImmutableSet<DelegationSignerData> dsData) {
|
||||
public B setDsData(ImmutableSet<DomainDsData> dsData) {
|
||||
getInstance().dsData = dsData;
|
||||
getInstance().resetUpdateTimestamp();
|
||||
return thisCastToDerived();
|
||||
|
|
|
@ -105,9 +105,9 @@ public class DomainCommand {
|
|||
@XmlRootElement
|
||||
@XmlType(
|
||||
propOrder = {
|
||||
"fullyQualifiedDomainName",
|
||||
"domainName",
|
||||
"period",
|
||||
"nameserverFullyQualifiedHostNames",
|
||||
"nameserverHostNames",
|
||||
"registrantContactId",
|
||||
"foreignKeyedDesignatedContacts",
|
||||
"authInfo"
|
||||
|
@ -117,12 +117,12 @@ public class DomainCommand {
|
|||
|
||||
/** Fully qualified domain name, which serves as a unique identifier for this domain. */
|
||||
@XmlElement(name = "name")
|
||||
String fullyQualifiedDomainName;
|
||||
String domainName;
|
||||
|
||||
/** Fully qualified host names of the hosts that are the nameservers for the domain. */
|
||||
@XmlElementWrapper(name = "ns")
|
||||
@XmlElement(name = "hostObj")
|
||||
Set<String> nameserverFullyQualifiedHostNames;
|
||||
Set<String> nameserverHostNames;
|
||||
|
||||
/** Resolved keys to hosts that are the nameservers for the domain. */
|
||||
@XmlTransient Set<VKey<Host>> nameservers;
|
||||
|
@ -144,15 +144,15 @@ public class DomainCommand {
|
|||
|
||||
@Override
|
||||
public String getTargetId() {
|
||||
return fullyQualifiedDomainName;
|
||||
return domainName;
|
||||
}
|
||||
|
||||
public String getFullyQualifiedDomainName() {
|
||||
return fullyQualifiedDomainName;
|
||||
public String getDomainName() {
|
||||
return domainName;
|
||||
}
|
||||
|
||||
public ImmutableSet<String> getNameserverFullyQualifiedHostNames() {
|
||||
return nullToEmptyImmutableCopy(nameserverFullyQualifiedHostNames);
|
||||
public ImmutableSet<String> getNameserverHostNames() {
|
||||
return nullToEmptyImmutableCopy(nameserverHostNames);
|
||||
}
|
||||
|
||||
public ImmutableSet<VKey<Host>> getNameservers() {
|
||||
|
@ -172,7 +172,7 @@ public class DomainCommand {
|
|||
@Override
|
||||
public Create cloneAndLinkReferences(DateTime now) throws InvalidReferencesException {
|
||||
Create clone = clone(this);
|
||||
clone.nameservers = linkHosts(clone.nameserverFullyQualifiedHostNames, now);
|
||||
clone.nameservers = linkHosts(clone.nameserverHostNames, now);
|
||||
if (registrantContactId == null) {
|
||||
clone.contacts = linkContacts(clone.foreignKeyedDesignatedContacts, now);
|
||||
} else {
|
||||
|
@ -205,7 +205,7 @@ public class DomainCommand {
|
|||
|
||||
/** The name of the domain to look up, and an attribute specifying the host lookup type. */
|
||||
@XmlElement(name = "name")
|
||||
NameWithHosts fullyQualifiedDomainName;
|
||||
NameWithHosts domainName;
|
||||
|
||||
DomainAuthInfo authInfo;
|
||||
|
||||
|
@ -244,12 +244,12 @@ public class DomainCommand {
|
|||
/** Get the enum that specifies the requested hosts (applies only to info flows). */
|
||||
public HostsRequest getHostsRequest() {
|
||||
// Null "hosts" is implicitly ALL.
|
||||
return MoreObjects.firstNonNull(fullyQualifiedDomainName.hosts, HostsRequest.ALL);
|
||||
return MoreObjects.firstNonNull(domainName.hosts, HostsRequest.ALL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTargetId() {
|
||||
return fullyQualifiedDomainName.name;
|
||||
return domainName.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -337,15 +337,12 @@ public class DomainCommand {
|
|||
}
|
||||
|
||||
/** The inner change type on a domain update command. */
|
||||
@XmlType(propOrder = {
|
||||
"nameserverFullyQualifiedHostNames",
|
||||
"foreignKeyedDesignatedContacts",
|
||||
"statusValues"})
|
||||
@XmlType(propOrder = {"nameserverHostNames", "foreignKeyedDesignatedContacts", "statusValues"})
|
||||
public static class AddRemove extends ResourceUpdate.AddRemove {
|
||||
/** Fully qualified host names of the hosts that are the nameservers for the domain. */
|
||||
@XmlElementWrapper(name = "ns")
|
||||
@XmlElement(name = "hostObj")
|
||||
Set<String> nameserverFullyQualifiedHostNames;
|
||||
Set<String> nameserverHostNames;
|
||||
|
||||
/** Resolved keys to hosts that are the nameservers for the domain. */
|
||||
@XmlTransient Set<VKey<Host>> nameservers;
|
||||
|
@ -358,8 +355,8 @@ public class DomainCommand {
|
|||
@XmlTransient
|
||||
Set<DesignatedContact> contacts;
|
||||
|
||||
public ImmutableSet<String> getNameserverFullyQualifiedHostNames() {
|
||||
return nullSafeImmutableCopy(nameserverFullyQualifiedHostNames);
|
||||
public ImmutableSet<String> getNameserverHostNames() {
|
||||
return nullSafeImmutableCopy(nameserverHostNames);
|
||||
}
|
||||
|
||||
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. */
|
||||
private AddRemove cloneAndLinkReferences(DateTime now) throws InvalidReferencesException {
|
||||
AddRemove clone = clone(this);
|
||||
clone.nameservers = linkHosts(clone.nameserverFullyQualifiedHostNames, now);
|
||||
clone.nameservers = linkHosts(clone.nameserverHostNames, now);
|
||||
clone.contacts = linkContacts(clone.foreignKeyedDesignatedContacts, now);
|
||||
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 {
|
||||
if (fullyQualifiedHostNames == null) {
|
||||
if (hostNames == null) {
|
||||
return null;
|
||||
}
|
||||
return ImmutableSet.copyOf(
|
||||
loadByForeignKeysCached(fullyQualifiedHostNames, Host.class, now).values());
|
||||
return ImmutableSet.copyOf(loadByForeignKeysCached(hostNames, Host.class, now).values());
|
||||
}
|
||||
|
||||
private static Set<DesignatedContact> linkContacts(
|
||||
|
|
|
@ -25,7 +25,7 @@ import google.registry.model.EppResource;
|
|||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
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.host.Host;
|
||||
import google.registry.model.reporting.DomainTransactionRecord;
|
||||
|
@ -280,7 +280,7 @@ public class DomainHistory extends HistoryEntry {
|
|||
.map(GracePeriod::createFromHistory)
|
||||
.collect(toImmutableSet());
|
||||
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
|
||||
// domainBase with a null object. Unfortunately, the updateTimestamp is never null in SQL.
|
||||
if (domainBase.getDomainName() == null) {
|
||||
|
|
|
@ -30,28 +30,30 @@ import org.joda.time.DateTime;
|
|||
|
||||
/** The {@link ResponseData} returned for an EPP info flow on a domain. */
|
||||
@XmlRootElement(name = "infData")
|
||||
@XmlType(propOrder = {
|
||||
"fullyQualifiedDomainName",
|
||||
"repoId",
|
||||
"statusValues",
|
||||
"registrant",
|
||||
"contacts",
|
||||
"nameservers",
|
||||
"subordinateHosts",
|
||||
"currentSponsorClientId",
|
||||
"creationClientId",
|
||||
"creationTime",
|
||||
"lastEppUpdateClientId",
|
||||
"lastEppUpdateTime",
|
||||
"registrationExpirationTime",
|
||||
"lastTransferTime",
|
||||
"authInfo"})
|
||||
@XmlType(
|
||||
propOrder = {
|
||||
"domainName",
|
||||
"repoId",
|
||||
"statusValues",
|
||||
"registrant",
|
||||
"contacts",
|
||||
"nameservers",
|
||||
"subordinateHosts",
|
||||
"currentSponsorClientId",
|
||||
"creationClientId",
|
||||
"creationTime",
|
||||
"lastEppUpdateClientId",
|
||||
"lastEppUpdateTime",
|
||||
"registrationExpirationTime",
|
||||
"lastTransferTime",
|
||||
"authInfo"
|
||||
})
|
||||
@AutoValue
|
||||
@CopyAnnotations
|
||||
public abstract class DomainInfoData implements ResponseData {
|
||||
|
||||
@XmlElement(name = "name")
|
||||
abstract String getFullyQualifiedDomainName();
|
||||
abstract String getDomainName();
|
||||
|
||||
@XmlElement(name = "roid")
|
||||
abstract String getRepoId();
|
||||
|
@ -110,7 +112,8 @@ public abstract class DomainInfoData implements ResponseData {
|
|||
/** Builder for {@link DomainInfoData}. */
|
||||
@AutoValue.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 setStatusValues(@Nullable ImmutableSet<StatusValue> statusValues);
|
||||
public abstract Builder setRegistrant(String registrant);
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.model.domain.secdns;
|
|||
import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
|
||||
|
||||
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 javax.persistence.Access;
|
||||
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/rfc4034">RFC 4034</a>
|
||||
* <p>TODO(b/177567432): Rename this class to DomainDsData.
|
||||
*/
|
||||
@XmlType(name = "dsData")
|
||||
@Entity
|
||||
@IdClass(DomainDsDataId.class)
|
||||
@Table(indexes = @Index(columnList = "domainRepoId"))
|
||||
public class DelegationSignerData extends DomainDsDataBase {
|
||||
@Table(name = "DelegationSignerData", indexes = @Index(columnList = "domainRepoId"))
|
||||
public class DomainDsData extends DomainDsDataBase {
|
||||
|
||||
private DelegationSignerData() {}
|
||||
private DomainDsData() {}
|
||||
|
||||
@Override
|
||||
@Id
|
||||
|
@ -79,21 +78,21 @@ public class DelegationSignerData extends DomainDsDataBase {
|
|||
return super.getDigest();
|
||||
}
|
||||
|
||||
public DelegationSignerData cloneWithDomainRepoId(String domainRepoId) {
|
||||
DelegationSignerData clone = clone(this);
|
||||
public DomainDsData cloneWithDomainRepoId(String domainRepoId) {
|
||||
DomainDsData clone = clone(this);
|
||||
clone.domainRepoId = checkArgumentNotNull(domainRepoId);
|
||||
return clone;
|
||||
}
|
||||
|
||||
public DelegationSignerData cloneWithoutDomainRepoId() {
|
||||
DelegationSignerData clone = clone(this);
|
||||
public DomainDsData cloneWithoutDomainRepoId() {
|
||||
DomainDsData clone = clone(this);
|
||||
clone.domainRepoId = null;
|
||||
return clone;
|
||||
}
|
||||
|
||||
public static DelegationSignerData create(
|
||||
public static DomainDsData create(
|
||||
int keyTag, int algorithm, int digestType, byte[] digest, String domainRepoId) {
|
||||
DelegationSignerData instance = new DelegationSignerData();
|
||||
DomainDsData instance = new DomainDsData();
|
||||
instance.keyTag = keyTag;
|
||||
instance.algorithm = algorithm;
|
||||
instance.digestType = digestType;
|
||||
|
@ -102,17 +101,15 @@ public class DelegationSignerData extends DomainDsDataBase {
|
|||
return instance;
|
||||
}
|
||||
|
||||
public static DelegationSignerData create(
|
||||
int keyTag, int algorithm, int digestType, byte[] digest) {
|
||||
public static DomainDsData create(int keyTag, int algorithm, int digestType, byte[] digest) {
|
||||
return create(keyTag, algorithm, digestType, digest, null);
|
||||
}
|
||||
|
||||
public static DelegationSignerData create(
|
||||
int keyTag, int algorithm, int digestType, String digestAsHex) {
|
||||
public static DomainDsData create(int keyTag, int algorithm, int digestType, String digestAsHex) {
|
||||
return create(keyTag, algorithm, digestType, DatatypeConverter.parseHexBinary(digestAsHex));
|
||||
}
|
||||
|
||||
public static DelegationSignerData create(DomainDsDataHistory history) {
|
||||
public static DomainDsData create(DomainDsDataHistory history) {
|
||||
return create(
|
||||
history.keyTag,
|
||||
history.algorithm,
|
||||
|
@ -121,7 +118,7 @@ public class DelegationSignerData extends DomainDsDataBase {
|
|||
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 {
|
||||
|
||||
String domainRepoId;
|
|
@ -26,7 +26,7 @@ import javax.xml.bind.annotation.XmlTransient;
|
|||
import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
|
||||
/** Base class for {@link DelegationSignerData} and {@link DomainDsDataHistory}. */
|
||||
/** Base class for {@link DomainDsData} and {@link DomainDsDataHistory}. */
|
||||
@MappedSuperclass
|
||||
@Access(AccessType.FIELD)
|
||||
public abstract class DomainDsDataBase extends ImmutableObject implements UnsafeSerializable {
|
||||
|
|
|
@ -25,7 +25,7 @@ import javax.persistence.Column;
|
|||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
|
||||
/** Entity class to represent a historic {@link DelegationSignerData}. */
|
||||
/** Entity class to represent a historic {@link DomainDsData}. */
|
||||
@Entity
|
||||
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
|
||||
* {@link DelegationSignerData} instance.
|
||||
* {@link DomainDsData} instance.
|
||||
*/
|
||||
public static DomainDsDataHistory createFrom(
|
||||
long domainHistoryRevisionId, DelegationSignerData dsData) {
|
||||
public static DomainDsDataHistory createFrom(long domainHistoryRevisionId, DomainDsData dsData) {
|
||||
DomainDsDataHistory instance = new DomainDsDataHistory();
|
||||
instance.domainHistoryRevisionId = domainHistoryRevisionId;
|
||||
instance.domainRepoId = dsData.domainRepoId;
|
||||
|
|
|
@ -36,13 +36,13 @@ public class SecDnsCreateExtension extends ImmutableObject implements CommandExt
|
|||
Long maxSigLife;
|
||||
|
||||
/** Signatures for this domain. */
|
||||
Set<DelegationSignerData> dsData;
|
||||
Set<DomainDsData> dsData;
|
||||
|
||||
public Long getMaxSigLife() {
|
||||
return maxSigLife;
|
||||
}
|
||||
|
||||
public ImmutableSet<DelegationSignerData> getDsData() {
|
||||
public ImmutableSet<DomainDsData> getDsData() {
|
||||
return nullSafeImmutableCopy(dsData);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,9 +24,9 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
public class SecDnsInfoExtension extends ImmutableObject implements ResponseExtension {
|
||||
|
||||
/** 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();
|
||||
instance.dsData = dsData;
|
||||
return instance;
|
||||
|
|
|
@ -70,9 +70,9 @@ public class SecDnsUpdateExtension extends ImmutableObject implements CommandExt
|
|||
@XmlTransient
|
||||
abstract static class AddRemoveBase extends ImmutableObject {
|
||||
/** Delegations to add or remove. */
|
||||
Set<DelegationSignerData> dsData;
|
||||
Set<DomainDsData> dsData;
|
||||
|
||||
public ImmutableSet<DelegationSignerData> getDsData() {
|
||||
public ImmutableSet<DomainDsData> getDsData() {
|
||||
return nullToEmptyImmutableCopy(dsData);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ import java.util.Set;
|
|||
import javax.annotation.Nullable;
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
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.
|
||||
* 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
|
||||
@Column(name = "hostName")
|
||||
String fullyQualifiedHostName;
|
||||
@Index String hostName;
|
||||
|
||||
/** IP Addresses for this host. Can be null if this is an external host. */
|
||||
@Index Set<InetAddress> inetAddresses;
|
||||
|
@ -95,7 +91,7 @@ public class HostBase extends EppResource {
|
|||
DateTime lastSuperordinateChange;
|
||||
|
||||
public String getHostName() {
|
||||
return fullyQualifiedHostName;
|
||||
return hostName;
|
||||
}
|
||||
|
||||
public VKey<Domain> getSuperordinateDomain() {
|
||||
|
@ -120,7 +116,7 @@ public class HostBase extends EppResource {
|
|||
|
||||
@Override
|
||||
public String getForeignKey() {
|
||||
return fullyQualifiedHostName;
|
||||
return hostName;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -197,7 +193,7 @@ public class HostBase extends EppResource {
|
|||
hostName.equals(canonicalizeHostname(hostName)),
|
||||
"Host name %s not in puny-coded, lower-case form",
|
||||
hostName);
|
||||
getInstance().fullyQualifiedHostName = hostName;
|
||||
getInstance().hostName = hostName;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class HostCommand {
|
|||
@XmlTransient
|
||||
abstract static class HostCreateOrChange extends AbstractSingleResourceCommand
|
||||
implements ResourceCreateOrChange<Host.Builder> {
|
||||
public String getFullyQualifiedHostName() {
|
||||
public String getHostName() {
|
||||
return getTargetId();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,23 +28,25 @@ import org.joda.time.DateTime;
|
|||
|
||||
/** The {@link ResponseData} returned for an EPP info flow on a host. */
|
||||
@XmlRootElement(name = "infData")
|
||||
@XmlType(propOrder = {
|
||||
"fullyQualifiedHostName",
|
||||
"repoId",
|
||||
"statusValues",
|
||||
"inetAddresses",
|
||||
"currentSponsorClientId",
|
||||
"creationClientId",
|
||||
"creationTime",
|
||||
"lastEppUpdateClientId",
|
||||
"lastEppUpdateTime",
|
||||
"lastTransferTime" })
|
||||
@XmlType(
|
||||
propOrder = {
|
||||
"hostName",
|
||||
"repoId",
|
||||
"statusValues",
|
||||
"inetAddresses",
|
||||
"currentSponsorClientId",
|
||||
"creationClientId",
|
||||
"creationTime",
|
||||
"lastEppUpdateClientId",
|
||||
"lastEppUpdateTime",
|
||||
"lastTransferTime"
|
||||
})
|
||||
@AutoValue
|
||||
@CopyAnnotations
|
||||
public abstract class HostInfoData implements ResponseData {
|
||||
|
||||
@XmlElement(name = "name")
|
||||
abstract String getFullyQualifiedHostName();
|
||||
abstract String getHostName();
|
||||
|
||||
@XmlElement(name = "roid")
|
||||
abstract String getRepoId();
|
||||
|
@ -79,7 +81,8 @@ public abstract class HostInfoData implements ResponseData {
|
|||
/** Builder for {@link HostInfoData}. */
|
||||
@AutoValue.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 setStatusValues(ImmutableSet<StatusValue> statusValues);
|
||||
public abstract Builder setInetAddresses(ImmutableSet<InetAddress> inetAddresses);
|
||||
|
|
|
@ -91,10 +91,10 @@ public class PendingActionNotificationResponse extends ImmutableObject
|
|||
}
|
||||
|
||||
public static DomainPendingActionNotificationResponse create(
|
||||
String fullyQualifiedDomainName, boolean actionResult, Trid trid, DateTime processedDate) {
|
||||
String domainName, boolean actionResult, Trid trid, DateTime processedDate) {
|
||||
return init(
|
||||
new DomainPendingActionNotificationResponse(),
|
||||
fullyQualifiedDomainName,
|
||||
domainName,
|
||||
actionResult,
|
||||
trid,
|
||||
processedDate);
|
||||
|
@ -140,13 +140,9 @@ public class PendingActionNotificationResponse extends ImmutableObject
|
|||
}
|
||||
|
||||
public static HostPendingActionNotificationResponse create(
|
||||
String fullyQualifiedHostName, boolean actionResult, Trid trid, DateTime processedDate) {
|
||||
String hostName, boolean actionResult, Trid trid, DateTime processedDate) {
|
||||
return init(
|
||||
new HostPendingActionNotificationResponse(),
|
||||
fullyQualifiedHostName,
|
||||
actionResult,
|
||||
trid,
|
||||
processedDate);
|
||||
new HostPendingActionNotificationResponse(), hostName, actionResult, trid, processedDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -386,7 +386,7 @@ public abstract class PollMessage extends ImmutableObject
|
|||
TransferResponse transferResponse;
|
||||
|
||||
@Column(name = "transfer_response_domain_name")
|
||||
String fullyQualifiedDomainName;
|
||||
String domainName;
|
||||
|
||||
@Column(name = "transfer_response_domain_expiration_time")
|
||||
DateTime extendedRegistrationExpirationTime;
|
||||
|
@ -427,7 +427,7 @@ public abstract class PollMessage extends ImmutableObject
|
|||
pendingActionNotificationResponse.getActionResult(),
|
||||
pendingActionNotificationResponse.getTrid(),
|
||||
pendingActionNotificationResponse.processedDate);
|
||||
} else if (fullyQualifiedDomainName != null) {
|
||||
} else if (domainName != null) {
|
||||
pendingActionNotificationResponse =
|
||||
DomainPendingActionNotificationResponse.create(
|
||||
pendingActionNotificationResponse.nameOrId.value,
|
||||
|
@ -457,10 +457,10 @@ public abstract class PollMessage extends ImmutableObject
|
|||
.setPendingTransferExpirationTime(
|
||||
transferResponse.getPendingTransferExpirationTime())
|
||||
.build();
|
||||
} else if (fullyQualifiedDomainName != null) {
|
||||
} else if (domainName != null) {
|
||||
transferResponse =
|
||||
new DomainTransferResponse.Builder()
|
||||
.setFullyQualifiedDomainName(fullyQualifiedDomainName)
|
||||
.setDomainName(domainName)
|
||||
.setGainingRegistrarId(transferResponse.getGainingRegistrarId())
|
||||
.setLosingRegistrarId(transferResponse.getLosingRegistrarId())
|
||||
.setTransferStatus(transferResponse.getTransferStatus())
|
||||
|
@ -486,7 +486,7 @@ public abstract class PollMessage extends ImmutableObject
|
|||
OneTime instance = getInstance();
|
||||
// Note: In its current form, the code will basically just ignore everything but the first
|
||||
// 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
|
||||
// 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
|
||||
|
@ -507,8 +507,7 @@ public abstract class PollMessage extends ImmutableObject
|
|||
instance.contactId = instance.pendingActionNotificationResponse.nameOrId.value;
|
||||
} else if (instance.pendingActionNotificationResponse
|
||||
instanceof DomainPendingActionNotificationResponse) {
|
||||
instance.fullyQualifiedDomainName =
|
||||
instance.pendingActionNotificationResponse.nameOrId.value;
|
||||
instance.domainName = instance.pendingActionNotificationResponse.nameOrId.value;
|
||||
} else if (instance.pendingActionNotificationResponse
|
||||
instanceof HostPendingActionNotificationResponse) {
|
||||
instance.hostId = instance.pendingActionNotificationResponse.nameOrId.value;
|
||||
|
@ -527,7 +526,7 @@ public abstract class PollMessage extends ImmutableObject
|
|||
instance.contactId = ((ContactTransferResponse) instance.transferResponse).getContactId();
|
||||
} else if (instance.transferResponse instanceof DomainTransferResponse) {
|
||||
DomainTransferResponse response = (DomainTransferResponse) instance.transferResponse;
|
||||
instance.fullyQualifiedDomainName = response.getFullyQualifiedDomainName();
|
||||
instance.domainName = response.getDomainName();
|
||||
instance.extendedRegistrationExpirationTime =
|
||||
response.getExtendedRegistrationExpirationTime();
|
||||
}
|
||||
|
|
|
@ -28,10 +28,10 @@ public interface PremiumPricingEngine {
|
|||
/**
|
||||
* 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.
|
||||
* subdomains are not allowed, but multi-part TLDs are.
|
||||
* <p>Note that the domainName must only contain a single part left of the TLD, i.e. subdomains
|
||||
* 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.
|
||||
|
|
|
@ -34,9 +34,9 @@ public final class StaticPremiumListPricingEngine implements PremiumPricingEngin
|
|||
@Inject StaticPremiumListPricingEngine() {}
|
||||
|
||||
@Override
|
||||
public DomainPrices getDomainPrices(String fullyQualifiedDomainName, DateTime priceTime) {
|
||||
String tld = getTldFromDomainName(fullyQualifiedDomainName);
|
||||
String label = InternetDomainName.from(fullyQualifiedDomainName).parts().get(0);
|
||||
public DomainPrices getDomainPrices(String domainName, DateTime priceTime) {
|
||||
String tld = getTldFromDomainName(domainName);
|
||||
String label = InternetDomainName.from(domainName).parts().get(0);
|
||||
Registry registry = Registry.get(checkNotNull(tld, "tld"));
|
||||
Optional<Money> premiumPrice =
|
||||
registry.getPremiumListName().flatMap(pl -> PremiumListDao.getPremiumPrice(pl, label));
|
||||
|
|
|
@ -207,11 +207,10 @@ public class Registrar extends ImmutableObject
|
|||
* 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>
|
||||
* <p>TODO(b/177567432): Rename this field to registrarId.
|
||||
*/
|
||||
@Id
|
||||
@Column(name = "registrarId", nullable = false)
|
||||
String clientIdentifier;
|
||||
@Column(nullable = false)
|
||||
String registrarId;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/** 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.
|
||||
@Column(name = "ip_address_allow_list")
|
||||
List<CidrAddressBlock> ipAddressWhitelist;
|
||||
List<CidrAddressBlock> ipAddressAllowList;
|
||||
|
||||
/** A hashed password for EPP access. The hash is a base64 encoded SHA256 string. */
|
||||
String passwordHash;
|
||||
|
@ -408,7 +405,7 @@ public class Registrar extends ImmutableObject
|
|||
boolean registryLockAllowed = false;
|
||||
|
||||
public String getRegistrarId() {
|
||||
return clientIdentifier;
|
||||
return registrarId;
|
||||
}
|
||||
|
||||
public DateTime getCreationTime() {
|
||||
|
@ -498,7 +495,7 @@ public class Registrar extends ImmutableObject
|
|||
}
|
||||
|
||||
public ImmutableList<CidrAddressBlock> getIpAddressAllowList() {
|
||||
return nullToEmptyImmutableCopy(ipAddressWhitelist);
|
||||
return nullToEmptyImmutableCopy(ipAddressAllowList);
|
||||
}
|
||||
|
||||
public RegistrarAddress getLocalizedAddress() {
|
||||
|
@ -587,7 +584,7 @@ public class Registrar extends ImmutableObject
|
|||
() ->
|
||||
jpaTm()
|
||||
.query("FROM RegistrarPoc WHERE registrarId = :registrarId", RegistrarPoc.class)
|
||||
.setParameter("registrarId", clientIdentifier)
|
||||
.setParameter("registrarId", registrarId)
|
||||
.getResultStream()
|
||||
.collect(toImmutableList()));
|
||||
}
|
||||
|
@ -595,7 +592,7 @@ public class Registrar extends ImmutableObject
|
|||
@Override
|
||||
public Map<String, Object> toJsonMap() {
|
||||
return new JsonMapBuilder()
|
||||
.put("clientIdentifier", clientIdentifier)
|
||||
.put("registrarId", registrarId)
|
||||
.put("ianaIdentifier", ianaIdentifier)
|
||||
.putString("creationTime", creationTime.getTimestamp())
|
||||
.putString("lastUpdateTime", lastUpdateTime.getTimestamp())
|
||||
|
@ -655,7 +652,7 @@ public class Registrar extends ImmutableObject
|
|||
/** Creates a {@link VKey} for this instance. */
|
||||
@Override
|
||||
public VKey<Registrar> createVKey() {
|
||||
return createVKey(clientIdentifier);
|
||||
return createVKey(registrarId);
|
||||
}
|
||||
|
||||
/** Creates a {@link VKey} for the given {@code registrarId}. */
|
||||
|
@ -678,7 +675,7 @@ public class Registrar extends ImmutableObject
|
|||
checkArgument(
|
||||
Range.closed(3, 16).contains(registrarId.length()),
|
||||
"Registrar ID must be 3-16 characters long.");
|
||||
getInstance().clientIdentifier = registrarId;
|
||||
getInstance().registrarId = registrarId;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -796,7 +793,7 @@ public class Registrar extends ImmutableObject
|
|||
}
|
||||
|
||||
public Builder setIpAddressAllowList(Iterable<CidrAddressBlock> ipAddressAllowList) {
|
||||
getInstance().ipAddressWhitelist = ImmutableList.copyOf(ipAddressAllowList);
|
||||
getInstance().ipAddressAllowList = ImmutableList.copyOf(ipAddressAllowList);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
* 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.
|
||||
*
|
||||
* <p>TODO(b/177567432): Rename this field to tmdbGenerationTime.
|
||||
*/
|
||||
@Column(name = "tmdb_generation_time", nullable = false)
|
||||
DateTime creationTime;
|
||||
@Column(nullable = false)
|
||||
DateTime tmdbGenerationTime;
|
||||
|
||||
/**
|
||||
* A map from labels to claims keys.
|
||||
|
@ -143,7 +141,7 @@ public class ClaimsList extends ImmutableObject {
|
|||
* creation datetime</a>
|
||||
*/
|
||||
public DateTime getTmdbGenerationTime() {
|
||||
return creationTime;
|
||||
return tmdbGenerationTime;
|
||||
}
|
||||
|
||||
/** Returns the creation time of this claims list. */
|
||||
|
@ -225,7 +223,7 @@ public class ClaimsList extends ImmutableObject {
|
|||
public static ClaimsList create(
|
||||
DateTime tmdbGenerationTime, ImmutableMap<String, String> labelsToKeys) {
|
||||
ClaimsList instance = new ClaimsList();
|
||||
instance.creationTime = checkNotNull(tmdbGenerationTime);
|
||||
instance.tmdbGenerationTime = checkNotNull(tmdbGenerationTime);
|
||||
instance.labelsToKeys = checkNotNull(labelsToKeys);
|
||||
return instance;
|
||||
}
|
||||
|
|
|
@ -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. */
|
||||
@XmlRootElement(name = "trnData", namespace = "urn:ietf:params:xml:ns:domain-1.0")
|
||||
@XmlType(propOrder = {
|
||||
"fullyQualifiedDomainName",
|
||||
"transferStatus",
|
||||
"gainingClientId",
|
||||
"transferRequestTime",
|
||||
"losingClientId",
|
||||
"pendingTransferExpirationTime",
|
||||
"extendedRegistrationExpirationTime"},
|
||||
namespace = "urn:ietf:params:xml:ns:domain-1.0")
|
||||
@XmlType(
|
||||
propOrder = {
|
||||
"domainName",
|
||||
"transferStatus",
|
||||
"gainingClientId",
|
||||
"transferRequestTime",
|
||||
"losingClientId",
|
||||
"pendingTransferExpirationTime",
|
||||
"extendedRegistrationExpirationTime"
|
||||
},
|
||||
namespace = "urn:ietf:params:xml:ns:domain-1.0")
|
||||
public static class DomainTransferResponse extends TransferResponse {
|
||||
|
||||
@XmlElement(name = "name")
|
||||
String fullyQualifiedDomainName;
|
||||
String domainName;
|
||||
|
||||
public String getFullyQualifiedDomainName() {
|
||||
return fullyQualifiedDomainName;
|
||||
public String getDomainName() {
|
||||
return domainName;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,8 +67,8 @@ public class TransferResponse extends BaseTransferObject implements ResponseData
|
|||
/** Builder for {@link DomainTransferResponse}. */
|
||||
public static class Builder
|
||||
extends BaseTransferObject.Builder<DomainTransferResponse, Builder> {
|
||||
public Builder setFullyQualifiedDomainName(String fullyQualifiedDomainName) {
|
||||
getInstance().fullyQualifiedDomainName = fullyQualifiedDomainName;
|
||||
public Builder setDomainName(String domainName) {
|
||||
getInstance().domainName = domainName;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public interface JpaTransactionManager extends TransactionManager {
|
|||
*/
|
||||
<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);
|
||||
|
||||
/**
|
||||
|
|
|
@ -199,13 +199,12 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
final RdapSearchPattern partialStringQuery) {
|
||||
// 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
|
||||
// fullyQualifiedDomainName. So we instead pick an arbitrary limit of
|
||||
// RESULT_SET_SIZE_SCALING_FACTOR times the result set size limit, fetch up to that many, and
|
||||
// weed out all deleted domains. If there still isn't a full result set's worth of domains, we
|
||||
// give up and return just the ones we found. Don't use queryItems, because it checks that the
|
||||
// initial string is at least a certain length, which we don't need in this case. Query the
|
||||
// domains directly, rather than the foreign keys, because then we have an index on TLD if we
|
||||
// need it.
|
||||
// domainName. So we instead pick an arbitrary limit of RESULT_SET_SIZE_SCALING_FACTOR times the
|
||||
// result set size limit, fetch up to that many, and weed out all deleted domains. If there
|
||||
// still isn't a full result set's worth of domains, we give up and return just the ones we
|
||||
// found. Don't use queryItems, because it checks that the initial string is at least a certain
|
||||
// length, which we don't need in this case. Query the domains directly, rather than the foreign
|
||||
// keys, because then we have an index on TLD if we need it.
|
||||
int querySizeLimit = RESULT_SET_SIZE_SCALING_FACTOR * rdapResultSetMaxSize;
|
||||
RdapResultSet<Domain> resultSet;
|
||||
if (tm().isOfy()) {
|
||||
|
@ -213,10 +212,10 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
auditedOfy()
|
||||
.load()
|
||||
.type(Domain.class)
|
||||
.filter("fullyQualifiedDomainName <", partialStringQuery.getNextInitialString())
|
||||
.filter("fullyQualifiedDomainName >=", partialStringQuery.getInitialString());
|
||||
.filter("domainName <", partialStringQuery.getNextInitialString())
|
||||
.filter("domainName >=", partialStringQuery.getInitialString());
|
||||
if (cursorString.isPresent()) {
|
||||
query = query.filter("fullyQualifiedDomainName >", cursorString.get());
|
||||
query = query.filter("domainName >", cursorString.get());
|
||||
}
|
||||
if (partialStringQuery.getSuffix() != null) {
|
||||
query = query.filter("tld", partialStringQuery.getSuffix());
|
||||
|
@ -234,16 +233,14 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
CriteriaQueryBuilder<Domain> queryBuilder =
|
||||
CriteriaQueryBuilder.create(replicaJpaTm(), Domain.class)
|
||||
.where(
|
||||
"fullyQualifiedDomainName",
|
||||
"domainName",
|
||||
criteriaBuilder::like,
|
||||
String.format("%s%%", partialStringQuery.getInitialString()))
|
||||
.orderByAsc("fullyQualifiedDomainName");
|
||||
.orderByAsc("domainName");
|
||||
if (cursorString.isPresent()) {
|
||||
queryBuilder =
|
||||
queryBuilder.where(
|
||||
"fullyQualifiedDomainName",
|
||||
criteriaBuilder::greaterThan,
|
||||
cursorString.get());
|
||||
"domainName", criteriaBuilder::greaterThan, cursorString.get());
|
||||
}
|
||||
if (partialStringQuery.getSuffix() != null) {
|
||||
queryBuilder =
|
||||
|
@ -258,18 +255,18 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
|
||||
/** Searches for domains by domain name with a TLD suffix. */
|
||||
private DomainSearchResponse searchByDomainNameByTld(String tld) {
|
||||
// Even though we are not searching on fullyQualifiedDomainName, we want the results to come
|
||||
// back ordered by name, so we are still in the same boat as
|
||||
// searchByDomainNameWithInitialString, unable to perform an inequality query on deletion time.
|
||||
// Don't use queryItems, because it doesn't handle pending deletes.
|
||||
// Even though we are not searching on domainName, we want the results to come back ordered by
|
||||
// name, so we are still in the same boat as searchByDomainNameWithInitialString, unable to
|
||||
// perform an inequality query on deletion time. Don't use queryItems, because it doesn't handle
|
||||
// pending deletes.
|
||||
int querySizeLimit = RESULT_SET_SIZE_SCALING_FACTOR * rdapResultSetMaxSize;
|
||||
RdapResultSet<Domain> resultSet;
|
||||
if (tm().isOfy()) {
|
||||
Query<Domain> query = auditedOfy().load().type(Domain.class).filter("tld", tld);
|
||||
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);
|
||||
} else {
|
||||
resultSet =
|
||||
|
@ -281,10 +278,10 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
Domain.class,
|
||||
"tld",
|
||||
tld,
|
||||
Optional.of("fullyQualifiedDomainName"),
|
||||
Optional.of("domainName"),
|
||||
cursorString,
|
||||
DeletedItemHandling.INCLUDE)
|
||||
.orderByAsc("fullyQualifiedDomainName");
|
||||
.orderByAsc("domainName");
|
||||
return getMatchingResourcesSql(builder, true, querySizeLimit);
|
||||
});
|
||||
}
|
||||
|
@ -344,7 +341,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
Query<Host> query =
|
||||
queryItems(
|
||||
Host.class,
|
||||
"fullyQualifiedHostName",
|
||||
"hostName",
|
||||
partialStringQuery,
|
||||
Optional.empty(),
|
||||
DeletedItemHandling.EXCLUDE,
|
||||
|
@ -362,7 +359,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
CriteriaQueryBuilder<Host> builder =
|
||||
queryItemsSql(
|
||||
Host.class,
|
||||
"fullyQualifiedHostName",
|
||||
"hostName",
|
||||
partialStringQuery,
|
||||
Optional.empty(),
|
||||
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.
|
||||
// Otherwise, we will need to filter the results afterward.
|
||||
} 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);
|
||||
if (cursorString.isPresent()) {
|
||||
|
@ -574,7 +571,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
CriteriaQueryBuilder<Domain> queryBuilder =
|
||||
CriteriaQueryBuilder.create(replicaJpaTm(), Domain.class)
|
||||
.whereFieldContains("nsHosts", hostKey)
|
||||
.orderByAsc("fullyQualifiedDomainName");
|
||||
.orderByAsc("domainName");
|
||||
CriteriaBuilder criteriaBuilder =
|
||||
replicaJpaTm().getEntityManager().getCriteriaBuilder();
|
||||
if (!shouldIncludeDeleted()) {
|
||||
|
@ -585,9 +582,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
if (cursorString.isPresent()) {
|
||||
queryBuilder =
|
||||
queryBuilder.where(
|
||||
"fullyQualifiedDomainName",
|
||||
criteriaBuilder::greaterThan,
|
||||
cursorString.get());
|
||||
"domainName", criteriaBuilder::greaterThan, cursorString.get());
|
||||
}
|
||||
replicaJpaTm()
|
||||
.criteriaQuery(queryBuilder.build())
|
||||
|
|
|
@ -223,7 +223,7 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase {
|
|||
Query<Host> query =
|
||||
queryItems(
|
||||
Host.class,
|
||||
"fullyQualifiedHostName",
|
||||
"hostName",
|
||||
partialStringQuery,
|
||||
cursorString,
|
||||
getDeletedItemHandling(),
|
||||
|
@ -237,7 +237,7 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase {
|
|||
CriteriaQueryBuilder<Host> queryBuilder =
|
||||
queryItemsSql(
|
||||
Host.class,
|
||||
"fullyQualifiedHostName",
|
||||
"hostName",
|
||||
partialStringQuery,
|
||||
cursorString,
|
||||
getDeletedItemHandling());
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.google.gson.Gson;
|
|||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
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.RdapDataStructures.Event;
|
||||
import google.registry.rdap.RdapDataStructures.EventWithoutActor;
|
||||
|
@ -444,7 +444,7 @@ final class RdapObjectClasses {
|
|||
@JsonableElement
|
||||
abstract int digestType();
|
||||
|
||||
static DsData create(DelegationSignerData dsData) {
|
||||
static DsData create(DomainDsData dsData) {
|
||||
return new AutoValue_RdapObjectClasses_SecureDns_DsData(
|
||||
dsData.getKeyTag(),
|
||||
dsData.getAlgorithm(),
|
||||
|
@ -490,7 +490,7 @@ final class RdapObjectClasses {
|
|||
|
||||
abstract ImmutableList.Builder<DsData> dsDataBuilder();
|
||||
|
||||
Builder addDsData(DelegationSignerData dsData) {
|
||||
Builder addDsData(DomainDsData dsData) {
|
||||
dsDataBuilder().add(DsData.create(dsData));
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ import google.registry.model.contact.Contact;
|
|||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.Domain;
|
||||
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.rde.RdeMode;
|
||||
import google.registry.model.transfer.DomainTransferData;
|
||||
|
@ -197,7 +197,7 @@ final class DomainToXjcConverter {
|
|||
// completely useless.
|
||||
if (!model.getDsData().isEmpty()) {
|
||||
XjcSecdnsDsOrKeyType secdns = new XjcSecdnsDsOrKeyType();
|
||||
for (DelegationSignerData ds : model.getDsData()) {
|
||||
for (DomainDsData ds : model.getDsData()) {
|
||||
secdns.getDsDatas().add(convertDelegationSignerData(ds));
|
||||
}
|
||||
bean.setSecDNS(secdns);
|
||||
|
@ -284,8 +284,8 @@ final class DomainToXjcConverter {
|
|||
return bean;
|
||||
}
|
||||
|
||||
/** Converts {@link DelegationSignerData} to {@link XjcSecdnsDsDataType}. */
|
||||
private static XjcSecdnsDsDataType convertDelegationSignerData(DelegationSignerData model) {
|
||||
/** Converts {@link DomainDsData} to {@link XjcSecdnsDsDataType}. */
|
||||
private static XjcSecdnsDsDataType convertDelegationSignerData(DomainDsData model) {
|
||||
XjcSecdnsDsDataType bean = new XjcSecdnsDsDataType();
|
||||
bean.setKeyTag(model.getKeyTag());
|
||||
bean.setAlg((short) model.getAlgorithm());
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
-- 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.
|
||||
|
||||
SELECT
|
||||
|
|
|
@ -137,10 +137,7 @@ public class Spec11EmailUtils {
|
|||
threatMatch ->
|
||||
tm()
|
||||
.createQueryComposer(Domain.class)
|
||||
.where(
|
||||
"fullyQualifiedDomainName",
|
||||
Comparator.EQ,
|
||||
threatMatch.fullyQualifiedDomainName())
|
||||
.where("domainName", Comparator.EQ, threatMatch.domainName())
|
||||
.stream()
|
||||
.anyMatch(Domain::shouldPublishToDns))
|
||||
.collect(toImmutableList());
|
||||
|
@ -176,7 +173,7 @@ public class Spec11EmailUtils {
|
|||
.map(
|
||||
threatMatch ->
|
||||
ImmutableMap.of(
|
||||
"fullyQualifiedDomainName", threatMatch.fullyQualifiedDomainName(),
|
||||
"domainName", threatMatch.domainName(),
|
||||
"threatType", threatMatch.threatType()))
|
||||
.collect(toImmutableList());
|
||||
|
||||
|
|
|
@ -316,7 +316,7 @@ public class AuthenticatedRegistrarAccessor {
|
|||
jpaTm()
|
||||
.query(
|
||||
"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",
|
||||
Registrar.class)
|
||||
.setParameter("gaeUserId", user.getUserId())
|
||||
|
|
|
@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableSortedSet;
|
|||
import com.google.template.soy.data.SoyListData;
|
||||
import com.google.template.soy.data.SoyMapData;
|
||||
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.host.Host;
|
||||
import google.registry.tools.soy.DomainRenewSoyInfo;
|
||||
|
@ -232,7 +232,7 @@ final class UniformRapidSuspensionCommand extends MutatingEppToolCommand {
|
|||
private ImmutableList<ImmutableMap<String, Object>> getExistingDsData(Domain domain) {
|
||||
ImmutableList.Builder<ImmutableMap<String, Object>> dsDataJsons = new ImmutableList.Builder();
|
||||
HexBinaryAdapter hexBinaryAdapter = new HexBinaryAdapter();
|
||||
for (DelegationSignerData dsData : domain.getDsData()) {
|
||||
for (DomainDsData dsData : domain.getDsData()) {
|
||||
dsDataJsons.add(
|
||||
ImmutableMap.of(
|
||||
"keyTag", dsData.getKeyTag(),
|
||||
|
|
|
@ -30,7 +30,7 @@ import com.google.common.flogger.FluentLogger;
|
|||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.gcs.GcsUtils;
|
||||
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.request.Action;
|
||||
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.
|
||||
loadAtPointInTime(nameserver, exportTime).getHostName()));
|
||||
}
|
||||
for (DelegationSignerData dsData : domain.getDsData()) {
|
||||
for (DomainDsData dsData : domain.getDsData()) {
|
||||
result.append(
|
||||
String.format(
|
||||
DS_FORMAT,
|
||||
|
|
|
@ -69,7 +69,7 @@ public final class ListDomainsAction extends ListObjectsAction<Domain> {
|
|||
|
||||
@Override
|
||||
public ImmutableSet<String> getPrimaryKeyFields() {
|
||||
return ImmutableSet.of("fullyQualifiedDomainName");
|
||||
return ImmutableSet.of("domainName");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -44,7 +44,7 @@ public final class ListHostsAction extends ListObjectsAction<Host> {
|
|||
|
||||
@Override
|
||||
public ImmutableSet<String> getPrimaryKeyFields() {
|
||||
return ImmutableSet.of("fullyQualifiedHostName");
|
||||
return ImmutableSet.of("hostName");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,7 +39,7 @@ public final class ListRegistrarsAction extends ListObjectsAction<Registrar> {
|
|||
|
||||
@Override
|
||||
public ImmutableSet<String> getPrimaryKeyFields() {
|
||||
return ImmutableSet.of("clientIdentifier");
|
||||
return ImmutableSet.of("registrarId");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,7 +51,7 @@ public final class ListRegistrarsAction extends ListObjectsAction<Registrar> {
|
|||
public ImmutableBiMap<String, String> getFieldAliases() {
|
||||
return ImmutableBiMap.of(
|
||||
"billingId", "billingIdentifier",
|
||||
"clientId", "clientIdentifier",
|
||||
"clientId", "registrarId",
|
||||
"premiumNames", "blockPremiumNames");
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ public class RefreshDnsForAllDomainsAction implements Runnable {
|
|||
() ->
|
||||
jpaTm()
|
||||
.query(
|
||||
"SELECT fullyQualifiedDomainName FROM Domain "
|
||||
"SELECT domainName FROM Domain "
|
||||
+ "WHERE tld IN (:tlds) "
|
||||
+ "AND deletionTime > :now",
|
||||
String.class)
|
||||
|
|
|
@ -132,7 +132,7 @@ registry.json.Response.prototype.results;
|
|||
/**
|
||||
* @typedef {{
|
||||
* allowedTlds: !Array<string>,
|
||||
* clientIdentifier: string,
|
||||
* registrarId: string,
|
||||
* clientCertificate: string?,
|
||||
* clientCertificateHash: string?,
|
||||
* failoverClientCertificate: string?,
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<class>google.registry.model.domain.DomainHistory</class>
|
||||
<class>google.registry.model.domain.GracePeriod</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.token.AllocationToken</class>
|
||||
<class>google.registry.model.domain.token.PackagePromotion</class>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
-- query's performance and consider switching to using a native query.
|
||||
|
||||
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 Tld t ON t.tldStr = d.tld
|
||||
LEFT JOIN BillingCancellation c ON b.id = c.refOneTime
|
||||
|
|
|
@ -19,14 +19,14 @@
|
|||
-- email address.
|
||||
|
||||
SELECT
|
||||
domain.fullyQualifiedDomainName AS domainName,
|
||||
domain.domainName AS domainName,
|
||||
domain.__key__.name AS domainRepoId,
|
||||
registrar.clientId AS registrarId,
|
||||
COALESCE(registrar.emailAddress, '') AS registrarEmailAddress
|
||||
FROM ( (
|
||||
SELECT
|
||||
__key__,
|
||||
fullyQualifiedDomainName,
|
||||
domainName,
|
||||
currentSponsorClientId,
|
||||
creationTime
|
||||
FROM
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
</tr>
|
||||
{for $threat in $threats}
|
||||
<tr>
|
||||
<td>{$threat['fullyQualifiedDomainName']}</td>
|
||||
<td>{$threat['domainName']}</td>
|
||||
<td>{$threat['threatType']}</td>
|
||||
</tr>
|
||||
{/for}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
/** Registrar whois settings page for view and edit. */
|
||||
{template .settings}
|
||||
{@param clientIdentifier: string}
|
||||
{@param registrarId: string}
|
||||
{@param? ianaIdentifier: int}
|
||||
{@param? icannReferralEmail: string}
|
||||
{@param readonly: bool}
|
||||
|
@ -40,8 +40,8 @@
|
|||
<table>
|
||||
{call registry.soy.forms.inputFieldRowWithValue}
|
||||
{param label: 'Name' /}
|
||||
{param name: 'clientIdentifier' /}
|
||||
{param value: $clientIdentifier /}
|
||||
{param name: 'registrarId' /}
|
||||
{param value: $registrarId /}
|
||||
{param readonly: true /}
|
||||
{/call}
|
||||
{call registry.soy.forms.inputFieldRowWithValue}
|
||||
|
|
|
@ -33,7 +33,7 @@ import google.registry.model.domain.DomainAuthInfo;
|
|||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
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.StatusValue;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
|
@ -110,7 +110,7 @@ public class RegistryJpaReadTest {
|
|||
Read<Object[], String> read =
|
||||
RegistryJpaIO.read(
|
||||
"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()",
|
||||
ImmutableMap.of("type", Registrar.Type.REAL),
|
||||
false,
|
||||
|
@ -152,7 +152,7 @@ public class RegistryJpaReadTest {
|
|||
Read<Domain, String> read =
|
||||
RegistryJpaIO.read(
|
||||
"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()",
|
||||
ImmutableMap.of("type", Registrar.Type.REAL),
|
||||
Domain.class,
|
||||
|
@ -200,7 +200,7 @@ public class RegistryJpaReadTest {
|
|||
.setPersistedCurrentSponsorRegistrarId(registrar.getRegistrarId())
|
||||
.setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1))
|
||||
.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))
|
||||
.setSmdId("smdid")
|
||||
|
|
|
@ -355,7 +355,7 @@ class InvoicingPipelineTest {
|
|||
.isEqualTo(
|
||||
'\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 Tld t ON t.tldStr = d.tld\n"
|
||||
+ "LEFT JOIN BillingCancellation c ON b.id = c.refOneTime\n"
|
||||
|
|
|
@ -39,7 +39,7 @@ import com.google.common.net.InetAddresses;
|
|||
import com.google.common.util.concurrent.RateLimiter;
|
||||
import google.registry.dns.writer.clouddns.CloudDnsWriter.ZoneStateException;
|
||||
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.host.Host;
|
||||
import google.registry.persistence.VKey;
|
||||
|
@ -267,7 +267,7 @@ public class CloudDnsWriterTest {
|
|||
|
||||
for (int i = 0; i < dsRecords; i++) {
|
||||
dsRecordData.add(
|
||||
DelegationSignerData.create(i, 3, 1, base16().decode("1234567890ABCDEF")).toRrData());
|
||||
DomainDsData.create(i, 3, 1, base16().decode("1234567890ABCDEF")).toRrData());
|
||||
}
|
||||
recordSetBuilder.add(
|
||||
new ResourceRecordSet()
|
||||
|
@ -284,10 +284,10 @@ public class CloudDnsWriterTest {
|
|||
/** Returns a domain to be persisted in Datastore. */
|
||||
private static Domain fakeDomain(
|
||||
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++) {
|
||||
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<>();
|
||||
|
|
|
@ -36,7 +36,7 @@ import com.google.common.collect.ImmutableList;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.net.InetAddresses;
|
||||
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.host.Host;
|
||||
import google.registry.testing.AppEngineExtension;
|
||||
|
@ -177,8 +177,7 @@ public class DnsUpdateWriterTest {
|
|||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(persistActiveHost("ns1.example.tld").createVKey()))
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(1, 3, 1, base16().decode("0123456789ABCDEF"))))
|
||||
ImmutableSet.of(DomainDsData.create(1, 3, 1, base16().decode("0123456789ABCDEF"))))
|
||||
.build();
|
||||
persistResource(domain);
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ public class SyncRegistrarsSheetTest {
|
|||
assertThat(rows).hasSize(2);
|
||||
|
||||
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("state", "SUSPENDED");
|
||||
assertThat(row).containsEntry("ianaIdentifier", "8");
|
||||
|
@ -288,7 +288,7 @@ public class SyncRegistrarsSheetTest {
|
|||
assertThat(row).containsEntry("billingAccountMap", "{JPY=JPY7890, USD=USD1234}");
|
||||
|
||||
row = rows.get(1);
|
||||
assertThat(row).containsEntry("clientIdentifier", "anotherregistrar");
|
||||
assertThat(row).containsEntry("registrarId", "anotherregistrar");
|
||||
assertThat(row).containsEntry("registrarName", "Another Registrar LLC");
|
||||
assertThat(row).containsEntry("state", "ACTIVE");
|
||||
assertThat(row).containsEntry("ianaIdentifier", "1");
|
||||
|
@ -337,7 +337,7 @@ public class SyncRegistrarsSheetTest {
|
|||
|
||||
verify(sheetSynchronizer).synchronize(eq("foobar"), rowsCaptor.capture());
|
||||
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("state", "ACTIVE");
|
||||
assertThat(row).containsEntry("ianaIdentifier", "8");
|
||||
|
|
|
@ -161,7 +161,7 @@ import google.registry.model.domain.fee.BaseFee.FeeType;
|
|||
import google.registry.model.domain.fee.Fee;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
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.RegistrationBehavior;
|
||||
import google.registry.model.domain.token.AllocationToken.TokenStatus;
|
||||
|
@ -860,7 +860,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
|||
assertAboutDomains()
|
||||
.that(domain)
|
||||
.hasExactlyDsData(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))
|
||||
.cloneWithDomainRepoId(domain.getRepoId()));
|
||||
}
|
||||
|
@ -3159,15 +3159,14 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
|||
|
||||
@Test
|
||||
void testFailure_packageToken_registrationTooLong() throws Exception {
|
||||
AllocationToken token =
|
||||
persistResource(
|
||||
new AllocationToken.Builder()
|
||||
.setToken("abc123")
|
||||
.setTokenType(PACKAGE)
|
||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||
.setAllowedTlds(ImmutableSet.of("tld"))
|
||||
.setRenewalPriceBehavior(SPECIFIED)
|
||||
.build());
|
||||
persistResource(
|
||||
new AllocationToken.Builder()
|
||||
.setToken("abc123")
|
||||
.setTokenType(PACKAGE)
|
||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||
.setAllowedTlds(ImmutableSet.of("tld"))
|
||||
.setRenewalPriceBehavior(SPECIFIED)
|
||||
.build());
|
||||
persistContactsAndHosts();
|
||||
setEppInput(
|
||||
"domain_create_allocationtoken.xml",
|
||||
|
|
|
@ -64,7 +64,7 @@ import google.registry.model.domain.DomainAuthInfo;
|
|||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
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.TokenType;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
|
@ -335,8 +335,7 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Domain> {
|
|||
.asBuilder()
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
|
||||
DomainDsData.create(12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
|
||||
.setNameservers(ImmutableSet.of(host1.createVKey(), host3.createVKey()))
|
||||
.build());
|
||||
doSuccessfulTest("domain_info_response_dsdata.xml", false);
|
||||
|
@ -541,8 +540,7 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Domain> {
|
|||
null))
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
|
||||
DomainDsData.create(12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
|
||||
.build());
|
||||
doSuccessfulTest("domain_info_response_dsdata_addperiod.xml", false);
|
||||
}
|
||||
|
|
|
@ -170,7 +170,7 @@ class DomainTransferCancelFlowTest
|
|||
.setResponseData(
|
||||
ImmutableList.of(
|
||||
new DomainTransferResponse.Builder()
|
||||
.setFullyQualifiedDomainName(getUniqueIdFromCommand())
|
||||
.setDomainName(getUniqueIdFromCommand())
|
||||
.setTransferStatus(TransferStatus.CLIENT_CANCELLED)
|
||||
.setTransferRequestTime(TRANSFER_REQUEST_TIME)
|
||||
.setGainingRegistrarId("NewRegistrar")
|
||||
|
|
|
@ -97,7 +97,7 @@ import google.registry.model.domain.DesignatedContact;
|
|||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.Domain;
|
||||
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.Trid;
|
||||
import google.registry.model.host.Host;
|
||||
|
@ -115,8 +115,8 @@ import org.junit.jupiter.api.Test;
|
|||
/** Unit tests for {@link DomainUpdateFlow}. */
|
||||
class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain> {
|
||||
|
||||
private static final DelegationSignerData SOME_DSDATA =
|
||||
DelegationSignerData.create(
|
||||
private static final DomainDsData SOME_DSDATA =
|
||||
DomainDsData.create(
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
|
@ -148,7 +148,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
unusedContact = persistActiveContact("unused");
|
||||
}
|
||||
|
||||
private Domain persistDomainWithRegistrant() throws Exception {
|
||||
private void persistDomainWithRegistrant() throws Exception {
|
||||
Host host = loadByForeignKey(Host.class, "ns1.example.foo", clock.nowUtc()).get();
|
||||
Domain domain =
|
||||
persistResource(
|
||||
|
@ -170,7 +170,6 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
.setDomain(domain)
|
||||
.build());
|
||||
clock.advanceOneMilli();
|
||||
return domain;
|
||||
}
|
||||
|
||||
private Domain persistDomain() throws Exception {
|
||||
|
@ -467,17 +466,20 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
|
||||
private void doSecDnsSuccessfulTest(
|
||||
String xmlFilename,
|
||||
ImmutableSet<DelegationSignerData> originalDsData,
|
||||
ImmutableSet<DelegationSignerData> expectedDsData)
|
||||
ImmutableSet<DomainDsData> originalDsData,
|
||||
ImmutableSet<DomainDsData> expectedDsData,
|
||||
boolean dnsTaskEnqueued)
|
||||
throws Exception {
|
||||
doSecDnsSuccessfulTest(xmlFilename, originalDsData, expectedDsData, OTHER_DSDATA_TEMPLATE_MAP);
|
||||
doSecDnsSuccessfulTest(
|
||||
xmlFilename, originalDsData, expectedDsData, OTHER_DSDATA_TEMPLATE_MAP, dnsTaskEnqueued);
|
||||
}
|
||||
|
||||
private void doSecDnsSuccessfulTest(
|
||||
String xmlFilename,
|
||||
ImmutableSet<DelegationSignerData> originalDsData,
|
||||
ImmutableSet<DelegationSignerData> expectedDsData,
|
||||
ImmutableMap<String, String> substitutions)
|
||||
ImmutableSet<DomainDsData> originalDsData,
|
||||
ImmutableSet<DomainDsData> expectedDsData,
|
||||
ImmutableMap<String, String> substitutions,
|
||||
boolean dnsTaskEnqueued)
|
||||
throws Exception {
|
||||
setEppInput(xmlFilename, substitutions);
|
||||
persistResource(
|
||||
|
@ -495,7 +497,11 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
expectedDsData.stream()
|
||||
.map(ds -> ds.cloneWithDomainRepoId(resource.getRepoId()))
|
||||
.collect(toImmutableSet()));
|
||||
assertDnsTasksEnqueued("example.tld");
|
||||
if (dnsTaskEnqueued) {
|
||||
assertDnsTasksEnqueued("example.tld");
|
||||
} else {
|
||||
assertNoDnsTasksEnqueued();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -504,7 +510,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
"domain_update_dsdata_add.xml",
|
||||
null,
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
ImmutableMap.of(
|
||||
"KEY_TAG",
|
||||
|
@ -514,7 +520,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
"DIGEST_TYPE",
|
||||
"1",
|
||||
"DIGEST",
|
||||
"A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"));
|
||||
"A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -524,7 +531,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
ImmutableSet.of(SOME_DSDATA),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
ImmutableMap.of(
|
||||
"KEY_TAG",
|
||||
|
@ -534,7 +541,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
"DIGEST_TYPE",
|
||||
"1",
|
||||
"DIGEST",
|
||||
"A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"));
|
||||
"A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -551,7 +559,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
"DIGEST_TYPE",
|
||||
"2",
|
||||
"DIGEST",
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"));
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"),
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -561,7 +570,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
ImmutableSet.of(SOME_DSDATA),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
1,
|
||||
8,
|
||||
4,
|
||||
|
@ -576,10 +585,11 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
"DIGEST_TYPE",
|
||||
"4",
|
||||
"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
|
||||
void testSuccess_secDnsAddOnlyChangeKeyTag() throws Exception {
|
||||
doSecDnsSuccessfulTest(
|
||||
|
@ -587,7 +597,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
ImmutableSet.of(SOME_DSDATA),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346,
|
||||
2,
|
||||
2,
|
||||
|
@ -601,7 +611,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
"DIGEST_TYPE",
|
||||
"2",
|
||||
"DIGEST",
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"));
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -611,7 +622,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
ImmutableSet.of(SOME_DSDATA),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
1,
|
||||
8,
|
||||
2,
|
||||
|
@ -625,7 +636,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
"DIGEST_TYPE",
|
||||
"2",
|
||||
"DIGEST",
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"));
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -635,7 +647,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
ImmutableSet.of(SOME_DSDATA),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
1,
|
||||
2,
|
||||
4,
|
||||
|
@ -650,7 +662,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
"DIGEST_TYPE",
|
||||
"4",
|
||||
"DIGEST",
|
||||
"768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9"));
|
||||
"768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9"),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -660,7 +673,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
ImmutableSet.of(SOME_DSDATA),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
|
@ -674,21 +687,22 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
"DIGEST_TYPE",
|
||||
"2",
|
||||
"DIGEST",
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"));
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"),
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
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) {
|
||||
builder.add(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
i,
|
||||
2,
|
||||
2,
|
||||
base16().decode("9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08")));
|
||||
}
|
||||
ImmutableSet<DelegationSignerData> commonDsData = builder.build();
|
||||
ImmutableSet<DomainDsData> commonDsData = builder.build();
|
||||
|
||||
doSecDnsSuccessfulTest(
|
||||
"domain_update_dsdata_add.xml",
|
||||
|
@ -697,11 +711,12 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
union(
|
||||
commonDsData,
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346,
|
||||
3,
|
||||
1,
|
||||
base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))))));
|
||||
base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))))),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -710,9 +725,10 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
"domain_update_dsdata_rem.xml",
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
ImmutableSet.of(SOME_DSDATA));
|
||||
ImmutableSet.of(SOME_DSDATA),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -722,9 +738,10 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
"domain_update_dsdata_rem_all.xml",
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
ImmutableSet.of());
|
||||
ImmutableSet.of(),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -733,26 +750,27 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
"domain_update_dsdata_add_rem.xml",
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))));
|
||||
DomainDsData.create(
|
||||
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
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) {
|
||||
builder.add(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
i,
|
||||
2,
|
||||
2,
|
||||
base16().decode("9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08")));
|
||||
}
|
||||
ImmutableSet<DelegationSignerData> commonDsData = builder.build();
|
||||
ImmutableSet<DomainDsData> commonDsData = builder.build();
|
||||
|
||||
doSecDnsSuccessfulTest(
|
||||
"domain_update_dsdata_add_rem.xml",
|
||||
|
@ -760,7 +778,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
union(
|
||||
commonDsData,
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12345,
|
||||
3,
|
||||
1,
|
||||
|
@ -769,11 +787,12 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
union(
|
||||
commonDsData,
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346,
|
||||
3,
|
||||
1,
|
||||
base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))))));
|
||||
base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))))),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -783,19 +802,23 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
"domain_update_dsdata_add_rem_same.xml",
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))));
|
||||
DomainDsData.create(
|
||||
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_secDnsRemoveAlreadyNotThere() throws Exception {
|
||||
// Removing a dsData that isn't there is a no-op.
|
||||
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 {
|
||||
|
@ -934,7 +957,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
persistResource(
|
||||
DatabaseHelper.newDomain(getUniqueIdFromCommand())
|
||||
.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());
|
||||
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
|
@ -948,8 +971,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
.asBuilder()
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}),
|
||||
DelegationSignerData.create(2, 2, 6, new byte[] {0, 1, 2})))
|
||||
DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2}),
|
||||
DomainDsData.create(2, 2, 6, new byte[] {0, 1, 2})))
|
||||
.build());
|
||||
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
|
||||
assertThat(thrown).hasMessageThat().contains("digestType=3");
|
||||
|
@ -963,7 +986,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
persistResource(
|
||||
DatabaseHelper.newDomain(getUniqueIdFromCommand())
|
||||
.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());
|
||||
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
|
@ -980,8 +1003,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
.asBuilder()
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(1, 2, 1, new byte[] {0, 1, 2, 3, 4}),
|
||||
DelegationSignerData.create(2, 2, 2, new byte[] {5, 6, 7})))
|
||||
DomainDsData.create(1, 2, 1, new byte[] {0, 1, 2, 3, 4}),
|
||||
DomainDsData.create(2, 2, 2, new byte[] {5, 6, 7})))
|
||||
.build());
|
||||
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
|
||||
assertThat(thrown).hasMessageThat().contains("0, 1, 2, 3, 4");
|
||||
|
@ -998,7 +1021,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
persistResource(
|
||||
DatabaseHelper.newDomain(getUniqueIdFromCommand())
|
||||
.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());
|
||||
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
|
@ -1012,8 +1035,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
.asBuilder()
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(1, 998, 2, new byte[] {0, 1, 2}),
|
||||
DelegationSignerData.create(2, 99, 2, new byte[] {0, 1, 2})))
|
||||
DomainDsData.create(1, 998, 2, new byte[] {0, 1, 2}),
|
||||
DomainDsData.create(2, 99, 2, new byte[] {0, 1, 2})))
|
||||
.build());
|
||||
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
|
||||
assertThat(thrown).hasMessageThat().contains("algorithm=998");
|
||||
|
@ -1023,9 +1046,9 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
|
||||
@Test
|
||||
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) {
|
||||
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);
|
||||
|
@ -1724,7 +1747,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
|||
}
|
||||
|
||||
@Test
|
||||
void testDnsTaskIsNotTriggeredWhenNoDSChangeSubmitted() throws Exception {
|
||||
void testDnsTaskIsNotTriggeredWhenNoDSChangeSubmitted() {
|
||||
setEppInput("domain_update_no_ds_change.xml");
|
||||
assertNoDnsTasksEnqueued();
|
||||
}
|
||||
|
|
|
@ -406,7 +406,7 @@ class AllocationTokenFlowUtilsTest {
|
|||
|
||||
private static DomainCommand.Create createCommand(String domainName) {
|
||||
DomainCommand.Create command = mock(DomainCommand.Create.class);
|
||||
when(command.getFullyQualifiedDomainName()).thenReturn(domainName);
|
||||
when(command.getDomainName()).thenReturn(domainName);
|
||||
return command;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
|||
.setResponseData(
|
||||
ImmutableList.of(
|
||||
new DomainTransferResponse.Builder()
|
||||
.setFullyQualifiedDomainName("test.example")
|
||||
.setDomainName("test.example")
|
||||
.setTransferStatus(TransferStatus.SERVER_APPROVED)
|
||||
.setGainingRegistrarId(getRegistrarIdForFlow())
|
||||
.setTransferRequestTime(clock.nowUtc().minusDays(5))
|
||||
|
|
|
@ -24,7 +24,7 @@ import google.registry.model.domain.DomainHistory;
|
|||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
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.reporting.DomainTransactionRecord;
|
||||
import google.registry.persistence.VKey;
|
||||
|
@ -46,7 +46,7 @@ public class BulkQueryHelper {
|
|||
.filter(gracePeriod -> gracePeriod.getDomainRepoId().equals(domainRepoId))
|
||||
.collect(toImmutableSet()),
|
||||
jpaTm()
|
||||
.loadAllOfStream(DelegationSignerData.class)
|
||||
.loadAllOfStream(DomainDsData.class)
|
||||
.filter(dsData -> dsData.getDomainRepoId().equals(domainRepoId))
|
||||
.collect(toImmutableSet()),
|
||||
jpaTm()
|
||||
|
|
|
@ -31,7 +31,7 @@ import google.registry.model.domain.GracePeriod;
|
|||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
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.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
|
@ -160,7 +160,7 @@ public final class TestSetupHelper {
|
|||
.setPersistedCurrentSponsorRegistrarId(REGISTRAR_ID)
|
||||
.setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1))
|
||||
.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))
|
||||
.setSmdId("smdid")
|
||||
.addGracePeriod(
|
||||
|
|
|
@ -43,7 +43,7 @@ import google.registry.model.contact.Contact;
|
|||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
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.TokenStatus;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
|
@ -122,7 +122,7 @@ public class DomainSqlTest {
|
|||
.setPersistedCurrentSponsorRegistrarId("registrar3")
|
||||
.setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1))
|
||||
.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))
|
||||
.setSmdId("smdid")
|
||||
|
@ -346,12 +346,11 @@ public class DomainSqlTest {
|
|||
@Test
|
||||
void testModifyDsData_addThenRemoveSuccessfully() {
|
||||
persistDomain();
|
||||
DelegationSignerData extraDsData =
|
||||
DelegationSignerData.create(2, 2, 3, new byte[] {0, 1, 2}, "4-COM");
|
||||
ImmutableSet<DelegationSignerData> unionDsData =
|
||||
DomainDsData extraDsData = DomainDsData.create(2, 2, 3, new byte[] {0, 1, 2}, "4-COM");
|
||||
ImmutableSet<DomainDsData> unionDsData =
|
||||
Sets.union(domain.getDsData(), ImmutableSet.of(extraDsData)).immutableCopy();
|
||||
|
||||
// Add an extra DelegationSignerData to dsData set.
|
||||
// Add an extra DomainDsData to dsData set.
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
|
@ -361,7 +360,7 @@ public class DomainSqlTest {
|
|||
jpaTm().put(modified);
|
||||
});
|
||||
|
||||
// Verify that the persisted domain entity contains both DelegationSignerData records.
|
||||
// Verify that the persisted domain entity contains both DomainDsData records.
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
|
@ -370,7 +369,7 @@ public class DomainSqlTest {
|
|||
assertEqualDomainExcept(persisted, "dsData");
|
||||
});
|
||||
|
||||
// Remove the extra DelegationSignerData record from dsData set.
|
||||
// Remove the extra DomainDsData record from dsData set.
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
|
@ -604,8 +603,7 @@ public class DomainSqlTest {
|
|||
persisted
|
||||
.asBuilder()
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.build();
|
||||
updateInDb(domain);
|
||||
return jpaTm().getTransactionTime();
|
||||
|
|
|
@ -50,7 +50,7 @@ import google.registry.model.contact.Contact;
|
|||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
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.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
|
@ -189,8 +189,7 @@ public class DomainTest {
|
|||
.setPersistedCurrentSponsorRegistrarId("NewRegistrar")
|
||||
.setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1))
|
||||
.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))
|
||||
.setTransferData(
|
||||
|
@ -292,7 +291,7 @@ public class DomainTest {
|
|||
assertThat(
|
||||
DatabaseHelper.newDomain("example.com")
|
||||
.asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, (byte[]) null)))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 1, 1, (byte[]) null)))
|
||||
.build()
|
||||
.getDsData()
|
||||
.asList()
|
||||
|
@ -302,7 +301,7 @@ public class DomainTest {
|
|||
assertThat(
|
||||
DatabaseHelper.newDomain("example.com")
|
||||
.asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[] {})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 1, 1, new byte[] {})))
|
||||
.build()
|
||||
.getDsData()
|
||||
.asList()
|
||||
|
@ -312,7 +311,7 @@ public class DomainTest {
|
|||
assertThat(
|
||||
DatabaseHelper.newDomain("example.com")
|
||||
.asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[] {1})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 1, 1, new byte[] {1})))
|
||||
.build()
|
||||
.getDsData()
|
||||
.asList()
|
||||
|
|
|
@ -34,7 +34,7 @@ import google.registry.model.domain.DomainHistory;
|
|||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.Period;
|
||||
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.host.Host;
|
||||
import google.registry.model.reporting.DomainTransactionRecord;
|
||||
|
@ -116,7 +116,7 @@ public class DomainHistoryTest extends EntityTestCase {
|
|||
newDomain("example.tld", "domainRepoId", contact)
|
||||
.asBuilder()
|
||||
.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")))
|
||||
.build();
|
||||
insertInDb(domain);
|
||||
|
|
|
@ -44,21 +44,25 @@ public class StatusValueAdapterTest {
|
|||
void testMarshalling() throws Exception {
|
||||
// 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.
|
||||
String marshalled = new String(
|
||||
EppXmlTransformer.marshal(
|
||||
EppOutput.create(new EppResponse.Builder()
|
||||
.setResData(HostInfoData.newBuilder()
|
||||
.setCreationClientId("")
|
||||
.setCreationTime(START_OF_TIME)
|
||||
.setCurrentSponsorClientId("")
|
||||
.setFullyQualifiedHostName("")
|
||||
.setInetAddresses(ImmutableSet.of())
|
||||
.setRepoId("")
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.CLIENT_UPDATE_PROHIBITED))
|
||||
.build())
|
||||
.build()),
|
||||
ValidationMode.LENIENT),
|
||||
UTF_8);
|
||||
String marshalled =
|
||||
new String(
|
||||
EppXmlTransformer.marshal(
|
||||
EppOutput.create(
|
||||
new EppResponse.Builder()
|
||||
.setResData(
|
||||
HostInfoData.newBuilder()
|
||||
.setCreationClientId("")
|
||||
.setCreationTime(START_OF_TIME)
|
||||
.setCurrentSponsorClientId("")
|
||||
.setHostName("")
|
||||
.setInetAddresses(ImmutableSet.of())
|
||||
.setRepoId("")
|
||||
.setStatusValues(
|
||||
ImmutableSet.of(StatusValue.CLIENT_UPDATE_PROHIBITED))
|
||||
.build())
|
||||
.build()),
|
||||
ValidationMode.LENIENT),
|
||||
UTF_8);
|
||||
assertThat(marshalled).contains("<host:status s=\"clientUpdateProhibited\"/>");
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ import google.registry.model.domain.DomainAuthInfo;
|
|||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
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.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
|
@ -267,8 +267,7 @@ public class DomainToXjcConverterTest {
|
|||
.setCreationTimeForTest(DateTime.parse("1900-01-01T00:00:00Z"))
|
||||
.setPersistedCurrentSponsorRegistrarId("TheRegistrar")
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(123, 200, 230, base16().decode("1234567890"))))
|
||||
ImmutableSet.of(DomainDsData.create(123, 200, 230, base16().decode("1234567890"))))
|
||||
.setDomainName(Idn.toASCII("love.みんな"))
|
||||
.setLastTransferTime(DateTime.parse("1910-01-01T00:00:00Z"))
|
||||
.setLastEppUpdateRegistrarId("TheRegistrar")
|
||||
|
|
|
@ -38,7 +38,7 @@ import google.registry.model.domain.DomainAuthInfo;
|
|||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
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.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
|
@ -112,8 +112,7 @@ final class RdeFixtures {
|
|||
.setPersistedCurrentSponsorRegistrarId("TheRegistrar")
|
||||
.setCreationTimeForTest(clock.nowUtc())
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(123, 200, 230, base16().decode("1234567890"))))
|
||||
ImmutableSet.of(DomainDsData.create(123, 200, 230, base16().decode("1234567890"))))
|
||||
.setDomainName(Idn.toASCII("love." + tld))
|
||||
.setLastTransferTime(DateTime.parse("1990-01-01T00:00:00Z"))
|
||||
.setLastEppUpdateRegistrarId("IntoTheTempest")
|
||||
|
|
|
@ -89,13 +89,13 @@ public class Spec11RegistrarThreatMatchesParserTest {
|
|||
"threatType", "MALWARE",
|
||||
"platformType", "ANY_PLATFORM",
|
||||
"threatEntryMetaData", "NONE",
|
||||
"fullyQualifiedDomainName", "c.com")));
|
||||
"domainName", "c.com")));
|
||||
ThreatMatch objectWithoutExtraFields =
|
||||
ThreatMatch.fromJSON(
|
||||
new JSONObject(
|
||||
ImmutableMap.of(
|
||||
"threatType", "MALWARE",
|
||||
"fullyQualifiedDomainName", "c.com")));
|
||||
"domainName", "c.com")));
|
||||
|
||||
assertThat(objectWithExtraFields).isEqualTo(objectWithoutExtraFields);
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ public class Spec11RegistrarThreatMatchesParserTest {
|
|||
new JSONObject(
|
||||
ImmutableMap.of(
|
||||
"threatType", "MALWARE",
|
||||
"fullyQualifiedDomainName", "a.com")))));
|
||||
"domainName", "a.com")))));
|
||||
}
|
||||
|
||||
static RegistrarThreatMatches getMatchB() throws Exception {
|
||||
|
@ -124,12 +124,12 @@ public class Spec11RegistrarThreatMatchesParserTest {
|
|||
new JSONObject(
|
||||
ImmutableMap.of(
|
||||
"threatType", "MALWARE",
|
||||
"fullyQualifiedDomainName", "b.com"))),
|
||||
"domainName", "b.com"))),
|
||||
ThreatMatch.fromJSON(
|
||||
new JSONObject(
|
||||
ImmutableMap.of(
|
||||
"threatType", "MALWARE",
|
||||
"fullyQualifiedDomainName", "c.com")))));
|
||||
"domainName", "c.com")))));
|
||||
}
|
||||
|
||||
private void setupFile(String fileWithContent, String fileDate) {
|
||||
|
|
|
@ -113,7 +113,6 @@ import java.util.Map;
|
|||
import java.util.NoSuchElementException;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import javax.annotation.Nullable;
|
||||
|
@ -984,32 +983,12 @@ public final class DatabaseHelper {
|
|||
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. */
|
||||
public static <R extends ImmutableObject> R persistResource(final R resource) {
|
||||
assertWithMessage("Attempting to persist a Builder is almost certainly an error in test code")
|
||||
.that(resource)
|
||||
.isNotInstanceOf(Buildable.Builder.class);
|
||||
tm().transact(() -> saveResource(resource));
|
||||
tm().transact(() -> tm().put(resource));
|
||||
maybeAdvanceClock();
|
||||
// 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
|
||||
|
@ -1026,11 +1005,8 @@ public final class DatabaseHelper {
|
|||
.that(resource)
|
||||
.isNotInstanceOf(Buildable.Builder.class);
|
||||
}
|
||||
// Persist domains ten at a time, to avoid exceeding the entity group limit.
|
||||
for (final List<R> chunk : Iterables.partition(resources, 10)) {
|
||||
tm().transact(() -> chunk.forEach(DatabaseHelper::saveResource));
|
||||
maybeAdvanceClock();
|
||||
}
|
||||
tm().transact(() -> resources.forEach(e -> tm().put(e)));
|
||||
maybeAdvanceClock();
|
||||
// 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.
|
||||
tm().clearSessionCache();
|
||||
|
|
|
@ -24,7 +24,7 @@ import com.google.common.truth.FailureMetadata;
|
|||
import com.google.common.truth.SimpleSubjectBuilder;
|
||||
import google.registry.model.domain.Domain;
|
||||
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.testing.TruthChainer.And;
|
||||
import java.util.Set;
|
||||
|
@ -40,16 +40,15 @@ public final class DomainSubject extends AbstractEppResourceSubject<Domain, Doma
|
|||
this.actual = subject;
|
||||
}
|
||||
|
||||
public And<DomainSubject> hasFullyQualifiedDomainName(String fullyQualifiedDomainName) {
|
||||
return hasValue(
|
||||
fullyQualifiedDomainName, actual.getDomainName(), "has fullyQualifiedDomainName");
|
||||
public And<DomainSubject> hasDomainName(String domainName) {
|
||||
return hasValue(domainName, actual.getDomainName(), "has domainName");
|
||||
}
|
||||
|
||||
public And<DomainSubject> hasExactlyDsData(DelegationSignerData... dsData) {
|
||||
public And<DomainSubject> hasExactlyDsData(DomainDsData... 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");
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import google.registry.model.contact.PostalInfo;
|
|||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.Domain;
|
||||
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.Trid;
|
||||
import google.registry.model.host.Host;
|
||||
|
@ -346,7 +346,7 @@ public final class FullFieldsTestEntityHelper {
|
|||
StatusValue.CLIENT_RENEW_PROHIBITED,
|
||||
StatusValue.CLIENT_TRANSFER_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) {
|
||||
builder.setRegistrant(registrant.createVKey());
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.google.common.collect.Lists;
|
||||
import com.google.common.net.InetAddresses;
|
||||
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.host.Host;
|
||||
import google.registry.testing.DatabaseHelper;
|
||||
|
@ -148,10 +148,8 @@ class GenerateDnsReportCommandTest extends CommandTestCase<GenerateDnsReportComm
|
|||
.setNameservers(ImmutableSet.of(nameserver1.createVKey(), nameserver2.createVKey()))
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC")),
|
||||
DelegationSignerData.create(
|
||||
56789, 2, 4, base16().decode("69FD46E6C4A45C55D4AC"))))
|
||||
DomainDsData.create(12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC")),
|
||||
DomainDsData.create(56789, 2, 4, base16().decode("69FD46E6C4A45C55D4AC"))))
|
||||
.build());
|
||||
persistResource(
|
||||
DatabaseHelper.newDomain("foobar.xn--q9jyb4c")
|
||||
|
|
|
@ -37,7 +37,7 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
|
|||
void testSuccess() throws Exception {
|
||||
persistActiveDomain("example.tld");
|
||||
runCommand("example.tld");
|
||||
assertInStdout("fullyQualifiedDomainName=example.tld");
|
||||
assertInStdout("domainName=example.tld");
|
||||
assertInStdout("Contact=VKey<Contact>(sql:3-ROID");
|
||||
assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE");
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
|
|||
void testSuccess_expand() throws Exception {
|
||||
persistActiveDomain("example.tld");
|
||||
runCommand("example.tld", "--expand");
|
||||
assertInStdout("fullyQualifiedDomainName=example.tld");
|
||||
assertInStdout("domainName=example.tld");
|
||||
assertInStdout("sqlKey=3-ROID");
|
||||
assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE");
|
||||
assertNotInStdout("LiveRef");
|
||||
|
@ -57,7 +57,7 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
|
|||
createTld("xn--q9jyb4c");
|
||||
persistActiveDomain("xn--aualito-txac.xn--q9jyb4c");
|
||||
runCommand("çauçalito.みんな", "--expand");
|
||||
assertInStdout("fullyQualifiedDomainName=xn--aualito-txac.xn--q9jyb4c");
|
||||
assertInStdout("domainName=xn--aualito-txac.xn--q9jyb4c");
|
||||
assertInStdout("sqlKey=4-ROID");
|
||||
}
|
||||
|
||||
|
@ -66,10 +66,10 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
|
|||
persistActiveDomain("example.tld");
|
||||
persistActiveDomain("example2.tld");
|
||||
runCommand("example.tld", "example2.tld");
|
||||
assertInStdout("fullyQualifiedDomainName=example.tld");
|
||||
assertInStdout("fullyQualifiedDomainName=example2.tld");
|
||||
assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE");
|
||||
assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTQtVExE");
|
||||
assertInStdout("domainName=example.tld");
|
||||
assertInStdout("domainName=example2.tld");
|
||||
assertInStdout("Websafe key: kind:Domain@sql:rO0ABXQABTItVExE");
|
||||
assertInStdout("Websafe key: kind:Domain@sql:rO0ABXQABTQtVExE");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -112,7 +112,7 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
|
|||
persistActiveDomain("example.tld");
|
||||
createTld("com");
|
||||
runCommand("example.com", "example.tld");
|
||||
assertInStdout("fullyQualifiedDomainName=example.tld");
|
||||
assertInStdout("domainName=example.tld");
|
||||
assertInStdout("Domain 'example.com' does not exist or is deleted");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,16 +41,16 @@ class GetHostCommandTest extends CommandTestCase<GetHostCommand> {
|
|||
void testSuccess() throws Exception {
|
||||
persistActiveHost("ns1.example.tld");
|
||||
runCommand("ns1.example.tld");
|
||||
assertInStdout("fullyQualifiedHostName=ns1.example.tld");
|
||||
assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjItUk9JRA");
|
||||
assertInStdout("hostName=ns1.example.tld");
|
||||
assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjItUk9JRA");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_expand() throws Exception {
|
||||
persistActiveHost("ns1.example.tld");
|
||||
runCommand("ns1.example.tld", "--expand");
|
||||
assertInStdout("fullyQualifiedHostName=ns1.example.tld");
|
||||
assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjItUk9JRA");
|
||||
assertInStdout("hostName=ns1.example.tld");
|
||||
assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjItUk9JRA");
|
||||
assertNotInStdout("LiveRef");
|
||||
}
|
||||
|
||||
|
@ -59,10 +59,10 @@ class GetHostCommandTest extends CommandTestCase<GetHostCommand> {
|
|||
persistActiveHost("ns1.example.tld");
|
||||
persistActiveHost("ns2.example.tld");
|
||||
runCommand("ns1.example.tld", "ns2.example.tld");
|
||||
assertInStdout("fullyQualifiedHostName=ns1.example.tld");
|
||||
assertInStdout("fullyQualifiedHostName=ns2.example.tld");
|
||||
assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjItUk9JRA");
|
||||
assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjMtUk9JRA");
|
||||
assertInStdout("hostName=ns1.example.tld");
|
||||
assertInStdout("hostName=ns2.example.tld");
|
||||
assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjItUk9JRA");
|
||||
assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjMtUk9JRA");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -71,8 +71,8 @@ class GetHostCommandTest extends CommandTestCase<GetHostCommand> {
|
|||
createTld("tld2");
|
||||
persistActiveHost("ns1.example.tld2");
|
||||
runCommand("ns1.example.tld", "ns1.example.tld2");
|
||||
assertInStdout("fullyQualifiedHostName=ns1.example.tld");
|
||||
assertInStdout("fullyQualifiedHostName=ns1.example.tld2");
|
||||
assertInStdout("hostName=ns1.example.tld");
|
||||
assertInStdout("hostName=ns1.example.tld2");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -100,7 +100,7 @@ class GetHostCommandTest extends CommandTestCase<GetHostCommand> {
|
|||
void testSuccess_externalHost() throws Exception {
|
||||
persistActiveHost("ns1.example.foo");
|
||||
runCommand("ns1.example.foo");
|
||||
assertInStdout("fullyQualifiedHostName=ns1.example.foo");
|
||||
assertInStdout("hostName=ns1.example.foo");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.beust.jcommander.ParameterException;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
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.host.Host;
|
||||
import google.registry.persistence.VKey;
|
||||
|
@ -44,7 +44,7 @@ class UniformRapidSuspensionCommandTest
|
|||
private Host urs1;
|
||||
private Host urs2;
|
||||
private Domain defaultDomain;
|
||||
private ImmutableSet<DelegationSignerData> defaultDsData;
|
||||
private ImmutableSet<DomainDsData> defaultDsData;
|
||||
|
||||
@BeforeEach
|
||||
void beforeEach() {
|
||||
|
@ -58,12 +58,12 @@ class UniformRapidSuspensionCommandTest
|
|||
defaultDomain = DatabaseHelper.newDomain("evil.tld");
|
||||
defaultDsData =
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(1, 2, 3, new HexBinaryAdapter().unmarshal("dead")),
|
||||
DelegationSignerData.create(4, 5, 6, new HexBinaryAdapter().unmarshal("beef")));
|
||||
DomainDsData.create(1, 2, 3, new HexBinaryAdapter().unmarshal("dead")),
|
||||
DomainDsData.create(4, 5, 6, new HexBinaryAdapter().unmarshal("beef")));
|
||||
}
|
||||
|
||||
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<>();
|
||||
for (Host host : hosts) {
|
||||
hostRefs.add(host.createVKey());
|
||||
|
|
|
@ -354,7 +354,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
|||
@Test
|
||||
void testSuccess_setAllowedNameserversOverwrites() throws Exception {
|
||||
persistResource(
|
||||
Registry.get("xn--q9jyb4c").asBuilder()
|
||||
Registry.get("xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(
|
||||
ImmutableSet.of("ns1.example.tld", "ns2.example.tld"))
|
||||
.build());
|
||||
|
@ -366,7 +367,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
|||
@Test
|
||||
void testSuccess_addAllowedNameservers() throws Exception {
|
||||
persistResource(
|
||||
Registry.get("xn--q9jyb4c").asBuilder()
|
||||
Registry.get("xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns1.example.com"))
|
||||
.build());
|
||||
runCommandForced("--add_allowed_nameservers=ns2.example.com", "xn--q9jyb4c");
|
||||
|
@ -377,7 +379,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
|||
@Test
|
||||
void testSuccess_removeAllAllowedNameservers() throws Exception {
|
||||
persistResource(
|
||||
Registry.get("xn--q9jyb4c").asBuilder()
|
||||
Registry.get("xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(
|
||||
ImmutableSet.of("ns1.example.com", "ns2.example.com"))
|
||||
.build());
|
||||
|
@ -388,7 +391,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
|||
@Test
|
||||
void testSuccess_removeSomeAllowedNameservers() throws Exception {
|
||||
persistResource(
|
||||
Registry.get("xn--q9jyb4c").asBuilder()
|
||||
Registry.get("xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(
|
||||
ImmutableSet.of("ns1.example.com", "ns2.example.com"))
|
||||
.build());
|
||||
|
@ -782,7 +786,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
|||
@Test
|
||||
void testFailure_cantAddDuplicateAllowedNameservers() {
|
||||
persistResource(
|
||||
Registry.get("xn--q9jyb4c").asBuilder()
|
||||
Registry.get("xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(
|
||||
ImmutableSet.of("ns1.example.com", "ns2.example.com"))
|
||||
.build());
|
||||
|
@ -796,9 +801,9 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
|||
@Test
|
||||
void testFailure_cantRemoveAllowedNameserverThatIsntPresent() {
|
||||
persistResource(
|
||||
Registry.get("xn--q9jyb4c").asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(
|
||||
ImmutableSet.of("ns1.example.com"))
|
||||
Registry.get("xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns1.example.com"))
|
||||
.build());
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableList;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
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.host.Host;
|
||||
import google.registry.persistence.VKey;
|
||||
|
@ -82,7 +82,7 @@ class GenerateZoneFilesActionTest {
|
|||
DatabaseHelper.newDomain("ns-and-ds.tld")
|
||||
.asBuilder()
|
||||
.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());
|
||||
persistResource(
|
||||
DatabaseHelper.newDomain("ns-only.tld").asBuilder().addNameservers(nameservers).build());
|
||||
|
@ -110,7 +110,7 @@ class GenerateZoneFilesActionTest {
|
|||
persistResource(
|
||||
DatabaseHelper.newDomain("ds-only.tld")
|
||||
.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());
|
||||
persistActiveContact("ignored_contact");
|
||||
persistActiveHost("ignored.host.tld"); // No ips.
|
||||
|
@ -120,7 +120,7 @@ class GenerateZoneFilesActionTest {
|
|||
DatabaseHelper.newDomain("ignored.com")
|
||||
.asBuilder()
|
||||
.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());
|
||||
|
||||
GenerateZoneFilesAction action = new GenerateZoneFilesAction();
|
||||
|
|
|
@ -142,17 +142,17 @@ class ListDomainsActionTest extends ListActionTestCase {
|
|||
@Test
|
||||
void testRun_twoLinesWithIdOnlyExplicitHeader() {
|
||||
action.tlds = ImmutableSet.of("foo");
|
||||
persistActiveDomain("example1.foo", DateTime.parse("2010-03-04T16:00:00Z"));
|
||||
persistActiveDomain("example2.foo", DateTime.parse("2011-03-04T16:00:00Z"));
|
||||
persistActiveDomain("test1.foo", DateTime.parse("2010-03-04T16:00:00Z"));
|
||||
persistActiveDomain("test2.foo", DateTime.parse("2011-03-04T16:00:00Z"));
|
||||
testRunSuccess(
|
||||
action,
|
||||
Optional.empty(),
|
||||
Optional.of(true),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedDomainName$",
|
||||
"^domainName$",
|
||||
"^-+\\s*$",
|
||||
"^example1.foo\\s*$",
|
||||
"^example2.foo\\s*$");
|
||||
"^test1.foo\\s*$",
|
||||
"^test2.foo\\s*$");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -165,7 +165,7 @@ class ListDomainsActionTest extends ListActionTestCase {
|
|||
Optional.of("repoId"),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedDomainName\\s+repoId\\s*$",
|
||||
"^domainName\\s+repoId\\s*$",
|
||||
"^-+\\s+-+\\s*$",
|
||||
"^example1.foo\\s+2-FOO\\s*$",
|
||||
"^example3.foo\\s+4-FOO\\s*$");
|
||||
|
@ -195,7 +195,7 @@ class ListDomainsActionTest extends ListActionTestCase {
|
|||
Optional.of("repoId"),
|
||||
Optional.of(true),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedDomainName\\s+repoId\\s*$",
|
||||
"^domainName\\s+repoId\\s*$",
|
||||
"^-+\\s+-+\\s*$",
|
||||
"^example1.foo\\s+2-FOO\\s*$",
|
||||
"^example3.foo\\s+4-FOO\\s*$");
|
||||
|
@ -211,7 +211,7 @@ class ListDomainsActionTest extends ListActionTestCase {
|
|||
Optional.of("*"),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedDomainName\\s+.*repoId",
|
||||
"^domainName\\s+.*repoId",
|
||||
"^-+\\s+-+",
|
||||
"^example1.foo\\s+.*2-FOO",
|
||||
"^example3.foo\\s+.*4-FOO");
|
||||
|
@ -227,7 +227,7 @@ class ListDomainsActionTest extends ListActionTestCase {
|
|||
Optional.of("*,repoId"),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedDomainName\\s+.*repoId",
|
||||
"^domainName\\s+.*repoId",
|
||||
"^-+\\s+-+",
|
||||
"^example1.foo\\s+.*2-FOO",
|
||||
"^example3.foo\\s+.*4-FOO");
|
||||
|
|
|
@ -53,7 +53,7 @@ class ListHostsActionTest extends ListActionTestCase {
|
|||
Optional.of("repoId"),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedHostName\\s+repoId\\s*$",
|
||||
"^hostName\\s+repoId\\s*$",
|
||||
"^-+\\s+-+\\s*$",
|
||||
"^example1.foo\\s+3-ROID\\s*$",
|
||||
"^example2.foo\\s+2-ROID\\s*$");
|
||||
|
@ -68,7 +68,7 @@ class ListHostsActionTest extends ListActionTestCase {
|
|||
Optional.of("*"),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedHostName\\s+.*repoId",
|
||||
"^hostName\\s+.*repoId",
|
||||
"^-+\\s+-+",
|
||||
"^example1.foo\\s+.*2",
|
||||
"^example2.foo\\s+.*1");
|
||||
|
@ -83,7 +83,7 @@ class ListHostsActionTest extends ListActionTestCase {
|
|||
Optional.of("*,repoId"),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedHostName\\s+.*repoId",
|
||||
"^hostName\\s+.*repoId",
|
||||
"^-+\\s+-+",
|
||||
"^example1.foo\\s+.*2",
|
||||
"^example2.foo\\s+.*1");
|
||||
|
|
|
@ -145,7 +145,7 @@ public class RegistrarConsoleWebTest extends WebDriverTestCase {
|
|||
driver.setFormFieldsById(
|
||||
new ImmutableMap.Builder<String, String>()
|
||||
.put("emailAddress", "test1@example.com")
|
||||
.put("clientIdentifier", "ignored")
|
||||
.put("registrarId", "ignored")
|
||||
.put("whoisServer", "foo.bar.baz")
|
||||
.put("url", "blah.blar")
|
||||
.put("phoneNumber", "+1.2125650000")
|
||||
|
|
|
@ -31,7 +31,7 @@ import google.registry.model.domain.DesignatedContact;
|
|||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
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.host.Host;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
|
@ -268,7 +268,7 @@ class DomainWhoisResponseTest {
|
|||
DesignatedContact.create(DesignatedContact.Type.ADMIN, adminResourceKey),
|
||||
DesignatedContact.create(DesignatedContact.Type.TECH, techResourceKey)))
|
||||
.setNameservers(ImmutableSet.of(host1VKey, host2VKey))
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, "deadface")))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, "deadface")))
|
||||
.setGracePeriods(
|
||||
ImmutableSet.of(
|
||||
GracePeriod.create(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
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":"MALWARE","fullyQualifiedDomainName":"111.com"},{"threatType":"POTENTIALLY_HARMFUL_APPLICATION","fullyQualifiedDomainName":"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":"UNWANTED_SOFTWARE","domainName":"anti-anti-anti-virus.dev"}],"registrarClientId":"cool-registrar","registrarEmailAddress":"cool@aid.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","domainName":"no-eamil.com"},{"threatType":"SOCIAL_ENGINEERING","domainName":"party-night.net"}],"registrarClientId":"kitty-registrar","registrarEmailAddress":"contact@kit.ty"}
|
|
@ -49,7 +49,7 @@ class google.registry.model.domain.Domain {
|
|||
google.registry.persistence.VKey<google.registry.model.poll.PollMessage$OneTime> deletePollMessage;
|
||||
java.lang.String creationClientId;
|
||||
java.lang.String currentSponsorClientId;
|
||||
java.lang.String fullyQualifiedDomainName;
|
||||
java.lang.String domainName;
|
||||
java.lang.String idnTableName;
|
||||
java.lang.String lastEppUpdateClientId;
|
||||
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;
|
||||
java.lang.String creationClientId;
|
||||
java.lang.String currentSponsorClientId;
|
||||
java.lang.String fullyQualifiedDomainName;
|
||||
java.lang.String domainName;
|
||||
java.lang.String idnTableName;
|
||||
java.lang.String lastEppUpdateClientId;
|
||||
java.lang.String smdId;
|
||||
|
@ -104,7 +104,7 @@ class google.registry.model.host.Host {
|
|||
google.registry.persistence.VKey<google.registry.model.domain.Domain> superordinateDomain;
|
||||
java.lang.String creationClientId;
|
||||
java.lang.String currentSponsorClientId;
|
||||
java.lang.String fullyQualifiedHostName;
|
||||
java.lang.String hostName;
|
||||
java.lang.String lastEppUpdateClientId;
|
||||
java.util.Set<java.net.InetAddress> inetAddresses;
|
||||
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;
|
||||
java.lang.String creationClientId;
|
||||
java.lang.String currentSponsorClientId;
|
||||
java.lang.String fullyQualifiedHostName;
|
||||
java.lang.String hostName;
|
||||
java.lang.String lastEppUpdateClientId;
|
||||
java.util.Set<java.net.InetAddress> inetAddresses;
|
||||
org.joda.time.DateTime deletionTime;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
-- 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.
|
||||
|
||||
SELECT
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue