mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Decentralize how registry phase checks are done in flows
Very few flows actually check the phase. Push the checks down to the leaf flows so that we can remove the inherited code from ResourceFlow and replace it with utility methods. In the process, document and test two places that throw the exception but did not previously test it. This introduces a temporary hack in BaseDomainCreateFlow that does something specific for DomainApplicationCreateFlow. It will go away literally tomorrow when I flatten that flow. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=135480538
This commit is contained in:
parent
aaa84d6ec6
commit
a09d48a4a5
18 changed files with 166 additions and 129 deletions
|
@ -534,6 +534,8 @@ An EPP flow that deletes a domain.
|
|||
|
||||
### Errors
|
||||
|
||||
* 2002
|
||||
* Command is not allowed in the current registry phase.
|
||||
* 2201
|
||||
* The specified resource belongs to another client.
|
||||
* Only a tool can pass a metadata extension.
|
||||
|
@ -555,7 +557,6 @@ An EPP flow that creates a new domain resource.
|
|||
|
||||
* 2002
|
||||
* Service extension(s) must be declared at login.
|
||||
* Command is not allowed in the current registry phase.
|
||||
* Signed marks are not accepted in the current registry phase.
|
||||
* The current registry phase does not allow for general registrations.
|
||||
* 2003
|
||||
|
@ -625,6 +626,8 @@ This flow also supports the EPP fee extension and can return pricing information
|
|||
|
||||
### Errors
|
||||
|
||||
* 2002
|
||||
* Command is not allowed in the current registry phase.
|
||||
* 2004
|
||||
* Domain label is not allowed by IDN table.
|
||||
* Domain name is under tld which doesn't exist.
|
||||
|
@ -743,9 +746,9 @@ An EPP flow that creates a new application for a domain resource.
|
|||
### Errors
|
||||
|
||||
* 2002
|
||||
* Command is not allowed in the current registry phase.
|
||||
* A notice cannot be specified when using a signed mark.
|
||||
* Sunrise applications are disallowed during landrush.
|
||||
* Command is not allowed in the current registry phase.
|
||||
* 2003
|
||||
* Landrush applications are disallowed during sunrise.
|
||||
* Fees must be explicitly acknowledged when performing any operations on a premium name.
|
||||
|
@ -843,6 +846,8 @@ An EPP flow that checks whether strings are trademarked.
|
|||
|
||||
* 2002
|
||||
* Command is not allowed in the current registry phase.
|
||||
* Claims checks are not allowed during sunrise.
|
||||
* The claims period has ended.
|
||||
* 2004
|
||||
* Domain name is under tld which doesn't exist.
|
||||
* 2201
|
||||
|
|
|
@ -14,15 +14,10 @@
|
|||
|
||||
package google.registry.flows;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import google.registry.flows.EppException.CommandUseErrorException;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.eppinput.EppInput.ResourceCommandWrapper;
|
||||
import google.registry.model.eppinput.ResourceCommand;
|
||||
import google.registry.model.eppoutput.EppOutput;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.Registry.TldState;
|
||||
import google.registry.util.TypeUtils.TypeInstantiator;
|
||||
|
||||
/**
|
||||
|
@ -61,25 +56,6 @@ public abstract class ResourceFlow<R extends EppResource, C extends ResourceComm
|
|||
return runResourceFlow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the current action operating within the scope of a single TLD (i.e. an operation on
|
||||
* a domain) is allowed in the registry phase for the specified TLD that the resource is in.
|
||||
*/
|
||||
protected void checkRegistryStateForTld(String tld) throws BadCommandForRegistryPhaseException {
|
||||
if (!isSuperuser && getDisallowedTldStates().contains(Registry.get(tld).getTldState(now))) {
|
||||
throw new BadCommandForRegistryPhaseException();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the TLD states during which this command is disallowed. By default all commands can be run
|
||||
* in any state (except predelegation); Flow subclasses must override this method to disallow any
|
||||
* further states.
|
||||
*/
|
||||
protected ImmutableSet<TldState> getDisallowedTldStates() {
|
||||
return Sets.immutableEnumSet(TldState.PREDELEGATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies that the command is allowed on the target resource.
|
||||
*
|
||||
|
@ -93,11 +69,4 @@ public abstract class ResourceFlow<R extends EppResource, C extends ResourceComm
|
|||
* @throws EppException If something fails while manipulating the resource.
|
||||
*/
|
||||
protected abstract EppOutput runResourceFlow() throws EppException;
|
||||
|
||||
/** Command is not allowed in the current registry phase. */
|
||||
public static class BadCommandForRegistryPhaseException extends CommandUseErrorException {
|
||||
public BadCommandForRegistryPhaseException() {
|
||||
super("Command is not allowed in the current registry phase");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import static google.registry.flows.domain.DomainFlowUtils.verifyLaunchPhase;
|
|||
import static google.registry.flows.domain.DomainFlowUtils.verifyNotInPendingDelete;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.verifyNotReserved;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.verifyPremiumNameIsNotBlocked;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.verifyRegistryStateAllowsLaunchFlows;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.verifySignedMarks;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.verifyUnitIsYears;
|
||||
import static google.registry.model.EppResourceUtils.createDomainRoid;
|
||||
|
@ -184,7 +185,6 @@ public abstract class BaseDomainCreateFlow<R extends DomainBase, B extends Build
|
|||
checkAllowedAccessToTld(getAllowedTlds(), tld);
|
||||
Registry registry = Registry.get(tld);
|
||||
tldState = registry.getTldState(now);
|
||||
checkRegistryStateForTld(tld);
|
||||
// Now that the TLD has been verified, we can go ahead and initialize extraFlowLogic. The
|
||||
// initialization and matching commit are done at the topmost possible level in the flow
|
||||
// hierarchy, but the actual processing takes place only when needed in the children, e.g.
|
||||
|
@ -247,6 +247,11 @@ public abstract class BaseDomainCreateFlow<R extends DomainBase, B extends Build
|
|||
nullToEmpty(command.getNameserverFullyQualifiedHostNames());
|
||||
validateNameserversCountForTld(tld, fullyQualifiedHostNames.size());
|
||||
validateNameserversAllowedOnTld(tld, fullyQualifiedHostNames);
|
||||
// This check is a vile hack that will survive for only a day or so, as I work to flatten the
|
||||
// domain and application create flows. Without it, the ordering of checks fails lots of tests.
|
||||
if (!isSuperuser && this instanceof DomainApplicationCreateFlow) {
|
||||
verifyRegistryStateAllowsLaunchFlows(Registry.get(getTld()), now);
|
||||
}
|
||||
validateLaunchCreateExtension();
|
||||
// If a signed mark was provided, then it must match the desired domain label.
|
||||
// We do this after validating the launch create extension so that flows which don't allow any
|
||||
|
|
|
@ -18,18 +18,18 @@ import static google.registry.flows.ResourceFlowUtils.verifyTargetIdCount;
|
|||
import static google.registry.flows.domain.DomainFlowUtils.checkAllowedAccessToTld;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.validateDomainName;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.validateDomainNameWithIdnTables;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.verifyNotInPredelegation;
|
||||
import static google.registry.model.domain.launch.LaunchPhase.CLAIMS;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS;
|
||||
import static google.registry.util.DateTimeUtils.isAtOrAfter;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.common.net.InternetDomainName;
|
||||
import google.registry.config.ConfigModule.Config;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.EppException.CommandUseErrorException;
|
||||
import google.registry.flows.LoggedInFlow;
|
||||
import google.registry.flows.exceptions.BadCommandForRegistryPhaseException;
|
||||
import google.registry.model.domain.DomainCommand.Check;
|
||||
import google.registry.model.domain.launch.LaunchCheckExtension;
|
||||
import google.registry.model.domain.launch.LaunchCheckResponseExtension;
|
||||
|
@ -49,15 +49,14 @@ import javax.inject.Inject;
|
|||
* An EPP flow that checks whether strings are trademarked.
|
||||
*
|
||||
* @error {@link google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link google.registry.flows.exceptions.BadCommandForRegistryPhaseException}
|
||||
* @error {@link google.registry.flows.exceptions.TooManyResourceChecksException}
|
||||
* @error {@link DomainFlowUtils.BadCommandForRegistryPhaseException}
|
||||
* @error {@link DomainFlowUtils.TldDoesNotExistException}
|
||||
* @error {@link ClaimsCheckNotAllowedInSunrise}
|
||||
* @error {@link ClaimsPeriodEndedException}
|
||||
*/
|
||||
public final class ClaimsCheckFlow extends LoggedInFlow {
|
||||
|
||||
public static final ImmutableSet<TldState> DISALLOWED_TLD_STATES =
|
||||
Sets.immutableEnumSet(TldState.PREDELEGATION, TldState.SUNRISE);
|
||||
|
||||
@Inject ResourceCommand resourceCommand;
|
||||
@Inject @Config("maxChecks") int maxChecks;
|
||||
@Inject ClaimsCheckFlow() {}
|
||||
|
@ -81,9 +80,14 @@ public final class ClaimsCheckFlow extends LoggedInFlow {
|
|||
if (seenTlds.add(tld)) {
|
||||
checkAllowedAccessToTld(getAllowedTlds(), tld);
|
||||
Registry registry = Registry.get(tld);
|
||||
if ((!isSuperuser && DISALLOWED_TLD_STATES.contains(registry.getTldState(now)))
|
||||
|| isAtOrAfter(now, registry.getClaimsPeriodEnd())) {
|
||||
throw new BadCommandForRegistryPhaseException();
|
||||
if (!isSuperuser) {
|
||||
verifyNotInPredelegation(registry, now);
|
||||
if (registry.getTldState(now) == TldState.SUNRISE) {
|
||||
throw new ClaimsCheckNotAllowedInSunrise();
|
||||
}
|
||||
if (isAtOrAfter(now, registry.getClaimsPeriodEnd())) {
|
||||
throw new ClaimsPeriodEndedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
String claimKey = ClaimsListShard.get().getClaimKey(domainName.parts().get(0));
|
||||
|
@ -96,4 +100,18 @@ public final class ClaimsCheckFlow extends LoggedInFlow {
|
|||
null,
|
||||
ImmutableList.of(LaunchCheckResponseExtension.create(CLAIMS, launchChecksBuilder.build())));
|
||||
}
|
||||
|
||||
/** Claims checks are not allowed during sunrise. */
|
||||
static class ClaimsCheckNotAllowedInSunrise extends CommandUseErrorException {
|
||||
public ClaimsCheckNotAllowedInSunrise() {
|
||||
super("Claims checks are not allowed during sunrise");
|
||||
}
|
||||
}
|
||||
|
||||
/** The claims period has ended. */
|
||||
static class ClaimsPeriodEndedException extends CommandUseErrorException {
|
||||
public ClaimsPeriodEndedException() {
|
||||
super("The claims period has ended");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.flows.domain;
|
||||
|
||||
import static google.registry.flows.domain.DomainFlowUtils.DISALLOWED_TLD_STATES_FOR_LAUNCH_FLOWS;
|
||||
import static com.google.common.collect.Iterables.getOnlyElement;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.validateFeeChallenge;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS;
|
||||
import static google.registry.model.index.DomainApplicationIndex.loadActiveApplicationsByDomainName;
|
||||
|
@ -44,7 +44,6 @@ import google.registry.model.registry.Registry.TldState;
|
|||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.smd.AbstractSignedMark;
|
||||
import google.registry.model.smd.EncodedSignedMark;
|
||||
import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
|
@ -52,9 +51,7 @@ import javax.inject.Inject;
|
|||
*
|
||||
* @error {@link google.registry.flows.EppException.UnimplementedExtensionException}
|
||||
* @error {@link google.registry.flows.ResourceCreateFlow.ResourceAlreadyExistsException}
|
||||
* @error {@link google.registry.flows.ResourceFlow.BadCommandForRegistryPhaseException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
|
||||
* @error {@link google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link BaseDomainCreateFlow.AcceptedTooLongAgoException}
|
||||
* @error {@link BaseDomainCreateFlow.ClaimsPeriodEndedException}
|
||||
* @error {@link BaseDomainCreateFlow.ExpiredClaimException}
|
||||
|
@ -69,6 +66,7 @@ import javax.inject.Inject;
|
|||
* @error {@link DomainApplicationCreateFlow.NoticeCannotBeUsedWithSignedMarkException}
|
||||
* @error {@link DomainApplicationCreateFlow.SunriseApplicationDisallowedDuringLandrushException}
|
||||
* @error {@link DomainApplicationCreateFlow.UncontestedSunriseApplicationBlockedInLandrushException}
|
||||
* @error {@link DomainFlowUtils.BadCommandForRegistryPhaseException}
|
||||
* @error {@link DomainFlowUtils.BadDomainNameCharacterException}
|
||||
* @error {@link DomainFlowUtils.BadDomainNamePartsCountException}
|
||||
* @error {@link DomainFlowUtils.BadPeriodUnitException}
|
||||
|
@ -91,6 +89,7 @@ import javax.inject.Inject;
|
|||
* @error {@link DomainFlowUtils.NameserversNotAllowedException}
|
||||
* @error {@link DomainFlowUtils.NameserversNotSpecifiedException}
|
||||
* @error {@link DomainFlowUtils.NoMarksFoundMatchingDomainException}
|
||||
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link DomainFlowUtils.PremiumNameBlockedException}
|
||||
* @error {@link DomainFlowUtils.RegistrantNotAllowedException}
|
||||
* @error {@link DomainFlowUtils.SignedMarksMustBeEncodedException}
|
||||
|
@ -141,14 +140,13 @@ public class DomainApplicationCreateFlow extends BaseDomainCreateFlow<DomainAppl
|
|||
protected void verifyDomainCreateIsAllowed() throws EppException {
|
||||
validateFeeChallenge(
|
||||
targetId, getTld(), now, feeCreate, commandOperations.getTotalCost());
|
||||
if (tldState == TldState.LANDRUSH && !isSuperuser) {
|
||||
if (!isSuperuser && tldState == TldState.LANDRUSH) {
|
||||
// Prohibit creating a landrush application in LANDRUSH (but not in SUNRUSH) if there is
|
||||
// exactly one sunrise application for the same name.
|
||||
List<DomainApplication> applications = FluentIterable
|
||||
.from(loadActiveApplicationsByDomainName(targetId, now))
|
||||
.limit(2)
|
||||
.toList();
|
||||
if (applications.size() == 1 && applications.get(0).getPhase().equals(LaunchPhase.SUNRISE)) {
|
||||
ImmutableSet<DomainApplication> applications =
|
||||
loadActiveApplicationsByDomainName(targetId, now);
|
||||
if (applications.size() == 1
|
||||
&& getOnlyElement(applications).getPhase().equals(LaunchPhase.SUNRISE)) {
|
||||
throw new UncontestedSunriseApplicationBlockedInLandrushException();
|
||||
}
|
||||
}
|
||||
|
@ -179,11 +177,6 @@ public class DomainApplicationCreateFlow extends BaseDomainCreateFlow<DomainAppl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final ImmutableSet<TldState> getDisallowedTldStates() {
|
||||
return DISALLOWED_TLD_STATES_FOR_LAUNCH_FLOWS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final HistoryEntry.Type getHistoryEntryType() {
|
||||
return HistoryEntry.Type.DOMAIN_APPLICATION_CREATE;
|
||||
|
|
|
@ -20,10 +20,10 @@ import static google.registry.flows.ResourceFlowUtils.updateForeignKeyIndexDelet
|
|||
import static google.registry.flows.ResourceFlowUtils.verifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.DISALLOWED_TLD_STATES_FOR_LAUNCH_FLOWS;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.checkAllowedAccessToTld;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.verifyApplicationDomainMatchesTargetId;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.verifyLaunchPhase;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.verifyRegistryStateAllowsLaunchFlows;
|
||||
import static google.registry.model.EppResourceUtils.loadDomainApplication;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
|
@ -37,7 +37,6 @@ import google.registry.flows.FlowModule.ClientId;
|
|||
import google.registry.flows.FlowModule.TargetId;
|
||||
import google.registry.flows.LoggedInFlow;
|
||||
import google.registry.flows.TransactionalFlow;
|
||||
import google.registry.flows.exceptions.BadCommandForRegistryPhaseException;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
import google.registry.model.domain.launch.LaunchDeleteExtension;
|
||||
import google.registry.model.domain.launch.LaunchPhase;
|
||||
|
@ -55,11 +54,11 @@ import javax.inject.Inject;
|
|||
* @error {@link google.registry.flows.EppException.UnimplementedExtensionException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.exceptions.BadCommandForRegistryPhaseException}
|
||||
* @error {@link DomainApplicationDeleteFlow.SunriseApplicationCannotBeDeletedInLandrushException}
|
||||
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link DomainFlowUtils.ApplicationDomainNameMismatchException}
|
||||
* @error {@link DomainFlowUtils.BadCommandForRegistryPhaseException}
|
||||
* @error {@link DomainFlowUtils.LaunchPhaseMismatchException}
|
||||
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
||||
*/
|
||||
public final class DomainApplicationDeleteFlow extends LoggedInFlow implements TransactionalFlow {
|
||||
|
||||
|
@ -82,24 +81,18 @@ public final class DomainApplicationDeleteFlow extends LoggedInFlow implements T
|
|||
DomainApplication.class, applicationId, loadDomainApplication(applicationId, now));
|
||||
verifyApplicationDomainMatchesTargetId(existingApplication, targetId);
|
||||
verifyOptionalAuthInfoForResource(authInfo, existingApplication);
|
||||
if (!isSuperuser) {
|
||||
verifyResourceOwnership(clientId, existingApplication);
|
||||
}
|
||||
String tld = existingApplication.getTld();
|
||||
Registry registry = Registry.get(tld);
|
||||
if (!isSuperuser
|
||||
&& DISALLOWED_TLD_STATES_FOR_LAUNCH_FLOWS.contains(registry.getTldState(now))) {
|
||||
throw new BadCommandForRegistryPhaseException();
|
||||
}
|
||||
checkAllowedAccessToTld(getAllowedTlds(), tld);
|
||||
LaunchDeleteExtension launchDelete = eppInput.getSingleExtension(LaunchDeleteExtension.class);
|
||||
verifyLaunchPhase(tld, launchDelete, now);
|
||||
if (!isSuperuser) {
|
||||
verifyRegistryStateAllowsLaunchFlows(Registry.get(tld), now);
|
||||
verifyLaunchPhase(tld, eppInput.getSingleExtension(LaunchDeleteExtension.class), now);
|
||||
verifyResourceOwnership(clientId, existingApplication);
|
||||
// Don't allow deleting a sunrise application during landrush.
|
||||
if (existingApplication.getPhase().equals(LaunchPhase.SUNRISE)
|
||||
&& registry.getTldState(now).equals(TldState.LANDRUSH)
|
||||
&& !isSuperuser) {
|
||||
&& Registry.get(tld).getTldState(now).equals(TldState.LANDRUSH)) {
|
||||
throw new SunriseApplicationCannotBeDeletedInLandrushException();
|
||||
}
|
||||
}
|
||||
DomainApplication newApplication =
|
||||
prepareDeletedResourceAsBuilder(existingApplication, now).build();
|
||||
HistoryEntry historyEntry = historyBuilder
|
||||
|
|
|
@ -20,6 +20,7 @@ import static google.registry.flows.domain.DomainFlowUtils.getReservationType;
|
|||
import static google.registry.flows.domain.DomainFlowUtils.handleFeeRequest;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.validateDomainName;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.validateDomainNameWithIdnTables;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.verifyNotInPredelegation;
|
||||
import static google.registry.model.EppResourceUtils.checkResourcesExist;
|
||||
import static google.registry.model.domain.fee.Fee.FEE_CHECK_COMMAND_EXTENSIONS_IN_PREFERENCE_ORDER;
|
||||
import static google.registry.model.domain.fee.Fee.FEE_EXTENSION_URIS;
|
||||
|
@ -41,7 +42,6 @@ import google.registry.flows.EppException;
|
|||
import google.registry.flows.EppException.ParameterValuePolicyErrorException;
|
||||
import google.registry.flows.FlowModule.ClientId;
|
||||
import google.registry.flows.LoggedInFlow;
|
||||
import google.registry.flows.exceptions.BadCommandForRegistryPhaseException;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
import google.registry.model.domain.DomainCommand.Check;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
|
@ -68,11 +68,11 @@ import javax.inject.Inject;
|
|||
*
|
||||
* <p>This flow also supports the EPP fee extension and can return pricing information.
|
||||
*
|
||||
* @error {@link google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link google.registry.flows.exceptions.TooManyResourceChecksException}
|
||||
* @error {@link DomainFlowUtils.BadDomainNameCharacterException}
|
||||
* @error {@link DomainFlowUtils.BadDomainNamePartsCountException}
|
||||
* @error {@link DomainFlowUtils.BadPeriodUnitException}
|
||||
* @error {@link DomainFlowUtils.BadCommandForRegistryPhaseException}
|
||||
* @error {@link DomainFlowUtils.CurrencyUnitMismatchException}
|
||||
* @error {@link DomainFlowUtils.DashesInThirdAndFourthException}
|
||||
* @error {@link DomainFlowUtils.DomainLabelTooLongException}
|
||||
|
@ -81,11 +81,12 @@ import javax.inject.Inject;
|
|||
* @error {@link DomainFlowUtils.InvalidIdnDomainLabelException}
|
||||
* @error {@link DomainFlowUtils.InvalidPunycodeException}
|
||||
* @error {@link DomainFlowUtils.LeadingDashException}
|
||||
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link DomainFlowUtils.RestoresAreAlwaysForOneYearException}
|
||||
* @error {@link DomainFlowUtils.TldDoesNotExistException}
|
||||
* @error {@link DomainFlowUtils.TrailingDashException}
|
||||
* @error {@link DomainFlowUtils.UnknownFeeCommandException}
|
||||
* @error {@link DomainCheckFlow.OnlyCheckedNamesCanBeFeeCheckedException}
|
||||
* @error {@link OnlyCheckedNamesCanBeFeeCheckedException}
|
||||
*/
|
||||
public final class DomainCheckFlow extends LoggedInFlow {
|
||||
|
||||
|
@ -122,8 +123,8 @@ public final class DomainCheckFlow extends LoggedInFlow {
|
|||
String tld = domainName.parent().toString();
|
||||
if (seenTlds.add(tld)) {
|
||||
checkAllowedAccessToTld(getAllowedTlds(), tld);
|
||||
if (!isSuperuser && TldState.PREDELEGATION.equals(Registry.get(tld).getTldState(now))) {
|
||||
throw new BadCommandForRegistryPhaseException();
|
||||
if (!isSuperuser) {
|
||||
verifyNotInPredelegation(Registry.get(tld), now);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,6 @@ import javax.inject.Inject;
|
|||
* @error {@link google.registry.flows.LoggedInFlow.UndeclaredServiceExtensionException}
|
||||
* @error {@link google.registry.flows.ResourceCreateFlow.ResourceAlreadyExistsException}
|
||||
* @error {@link google.registry.flows.ResourceCreateOrMutateFlow.OnlyToolCanPassMetadataException}
|
||||
* @error {@link google.registry.flows.ResourceFlow.BadCommandForRegistryPhaseException}
|
||||
* @error {@link google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link BaseDomainCreateFlow.AcceptedTooLongAgoException}
|
||||
* @error {@link BaseDomainCreateFlow.ClaimsPeriodEndedException}
|
||||
|
|
|
@ -24,6 +24,7 @@ import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForR
|
|||
import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.checkAllowedAccessToTld;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.updateAutorenewRecurrenceEndTime;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.verifyNotInPredelegation;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS_WITH_ACTION_PENDING;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
|
@ -41,7 +42,6 @@ import google.registry.flows.FlowModule.ClientId;
|
|||
import google.registry.flows.FlowModule.TargetId;
|
||||
import google.registry.flows.LoggedInFlow;
|
||||
import google.registry.flows.TransactionalFlow;
|
||||
import google.registry.flows.exceptions.BadCommandForRegistryPhaseException;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
|
@ -64,7 +64,6 @@ import google.registry.model.poll.PendingActionNotificationResponse.DomainPendin
|
|||
import google.registry.model.poll.PollMessage;
|
||||
import google.registry.model.poll.PollMessage.OneTime;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.Registry.TldState;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import java.util.Set;
|
||||
import javax.annotation.Nullable;
|
||||
|
@ -80,6 +79,7 @@ import org.joda.time.DateTime;
|
|||
* @error {@link google.registry.flows.exceptions.OnlyToolCanPassMetadataException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceStatusProhibitsOperationException}
|
||||
* @error {@link DomainDeleteFlow.DomainToDeleteHasHostsException}
|
||||
* @error {@link DomainFlowUtils.BadCommandForRegistryPhaseException}
|
||||
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
||||
*/
|
||||
public final class DomainDeleteFlow extends LoggedInFlow implements TransactionalFlow {
|
||||
|
@ -162,9 +162,7 @@ public final class DomainDeleteFlow extends LoggedInFlow implements Transactiona
|
|||
verifyOptionalAuthInfoForResource(authInfo, existingDomain);
|
||||
if (!isSuperuser) {
|
||||
verifyResourceOwnership(clientId, existingDomain);
|
||||
if (TldState.PREDELEGATION.equals(registry.getTldState(now))) {
|
||||
throw new BadCommandForRegistryPhaseException();
|
||||
}
|
||||
verifyNotInPredelegation(registry, now);
|
||||
}
|
||||
checkAllowedAccessToTld(getAllowedTlds(), registry.getTld().toString());
|
||||
if (!existingDomain.getSubordinateHosts().isEmpty()) {
|
||||
|
|
|
@ -44,6 +44,7 @@ import com.google.common.net.InternetDomainName;
|
|||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.EppException.AuthorizationErrorException;
|
||||
import google.registry.flows.EppException.CommandUseErrorException;
|
||||
import google.registry.flows.EppException.ObjectDoesNotExistException;
|
||||
import google.registry.flows.EppException.ParameterValuePolicyErrorException;
|
||||
import google.registry.flows.EppException.ParameterValueRangeErrorException;
|
||||
|
@ -134,13 +135,6 @@ public class DomainFlowUtils {
|
|||
LaunchPhase.CLAIMS, TldState.GENERAL_AVAILABILITY,
|
||||
LaunchPhase.OPEN, TldState.GENERAL_AVAILABILITY);
|
||||
|
||||
/** Non-sunrise tld states. */
|
||||
public static final ImmutableSet<TldState> DISALLOWED_TLD_STATES_FOR_LAUNCH_FLOWS =
|
||||
Sets.immutableEnumSet(
|
||||
TldState.PREDELEGATION,
|
||||
TldState.QUIET_PERIOD,
|
||||
TldState.GENERAL_AVAILABILITY);
|
||||
|
||||
/** Reservation types that are allowed in sunrise by policy. */
|
||||
public static final ImmutableSet<ReservationType> TYPES_ALLOWED_FOR_CREATE_ONLY_IN_SUNRISE =
|
||||
Sets.immutableEnumSet(
|
||||
|
@ -148,6 +142,13 @@ public class DomainFlowUtils {
|
|||
ReservationType.NAME_COLLISION,
|
||||
ReservationType.MISTAKEN_PREMIUM);
|
||||
|
||||
/** Non-sunrise tld states. */
|
||||
private static final ImmutableSet<TldState> DISALLOWED_TLD_STATES_FOR_LAUNCH_FLOWS =
|
||||
Sets.immutableEnumSet(
|
||||
TldState.PREDELEGATION,
|
||||
TldState.QUIET_PERIOD,
|
||||
TldState.GENERAL_AVAILABILITY);
|
||||
|
||||
/** Strict validator for ascii lowercase letters, digits, and "-", allowing "." as a separator */
|
||||
private static final CharMatcher ALLOWED_CHARS =
|
||||
CharMatcher.inRange('a', 'z').or(CharMatcher.inRange('0', '9').or(CharMatcher.anyOf("-.")));
|
||||
|
@ -377,7 +378,6 @@ public class DomainFlowUtils {
|
|||
if (!Objects.equals(
|
||||
Registry.get(tld).getTldState(now),
|
||||
LAUNCH_PHASE_TO_TLD_STATE.get(launchExtension.getPhase()))) {
|
||||
// No launch operations are allowed during the quiet period or predelegation.
|
||||
throw new LaunchPhaseMismatchException();
|
||||
}
|
||||
}
|
||||
|
@ -826,7 +826,7 @@ public class DomainFlowUtils {
|
|||
}
|
||||
|
||||
/** If a domain or application has "clientUpdateProhibited" set, updates must clear it or fail. */
|
||||
public static void verifyClientUpdateNotProhibited(Update command, DomainBase existingResource)
|
||||
static void verifyClientUpdateNotProhibited(Update command, DomainBase existingResource)
|
||||
throws ResourceHasClientUpdateProhibitedException {
|
||||
if (existingResource.getStatusValues().contains(StatusValue.CLIENT_UPDATE_PROHIBITED)
|
||||
&& !command.getInnerRemove().getStatusValues()
|
||||
|
@ -835,6 +835,20 @@ public class DomainFlowUtils {
|
|||
}
|
||||
}
|
||||
|
||||
static void verifyRegistryStateAllowsLaunchFlows(Registry registry, DateTime now)
|
||||
throws BadCommandForRegistryPhaseException {
|
||||
if (DISALLOWED_TLD_STATES_FOR_LAUNCH_FLOWS.contains(registry.getTldState(now))) {
|
||||
throw new BadCommandForRegistryPhaseException();
|
||||
}
|
||||
}
|
||||
|
||||
static void verifyNotInPredelegation(Registry registry, DateTime now)
|
||||
throws BadCommandForRegistryPhaseException {
|
||||
if (registry.getTldState(now) == TldState.PREDELEGATION) {
|
||||
throw new BadCommandForRegistryPhaseException();
|
||||
}
|
||||
}
|
||||
|
||||
/** Encoded signed marks must use base64 encoding. */
|
||||
static class Base64RequiredForEncodedSignedMarksException
|
||||
extends ParameterValuePolicyErrorException {
|
||||
|
@ -1204,6 +1218,13 @@ public class DomainFlowUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/** Command is not allowed in the current registry phase. */
|
||||
public static class BadCommandForRegistryPhaseException extends CommandUseErrorException {
|
||||
public BadCommandForRegistryPhaseException() {
|
||||
super("Command is not allowed in the current registry phase");
|
||||
}
|
||||
}
|
||||
|
||||
/** The secDNS:all element must have value 'true' if present. */
|
||||
static class SecDnsAllUsageException extends ParameterValuePolicyErrorException {
|
||||
public SecDnsAllUsageException() {
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.flows.exceptions;
|
||||
|
||||
import google.registry.flows.EppException.CommandUseErrorException;
|
||||
|
||||
/** Command is not allowed in the current registry phase. */
|
||||
public class BadCommandForRegistryPhaseException extends CommandUseErrorException {
|
||||
public BadCommandForRegistryPhaseException() {
|
||||
super("Command is not allowed in the current registry phase");
|
||||
}
|
||||
}
|
|
@ -85,7 +85,7 @@ public class DomainApplicationIndex extends BackupGroupRoot {
|
|||
* Returns an iterable of all DomainApplications for the given fully qualified domain name that
|
||||
* do not have a deletion time before the supplied DateTime.
|
||||
*/
|
||||
public static Iterable<DomainApplication> loadActiveApplicationsByDomainName(
|
||||
public static ImmutableSet<DomainApplication> loadActiveApplicationsByDomainName(
|
||||
String fullyQualifiedDomainName, DateTime now) {
|
||||
DomainApplicationIndex index = load(fullyQualifiedDomainName);
|
||||
if (index == null) {
|
||||
|
|
|
@ -21,9 +21,11 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.domain.ClaimsCheckFlow.ClaimsCheckNotAllowedInSunrise;
|
||||
import google.registry.flows.domain.ClaimsCheckFlow.ClaimsPeriodEndedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadCommandForRegistryPhaseException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.TldDoesNotExistException;
|
||||
import google.registry.flows.exceptions.BadCommandForRegistryPhaseException;
|
||||
import google.registry.flows.exceptions.TooManyResourceChecksException;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
|
@ -136,7 +138,7 @@ public class ClaimsCheckFlowTest extends ResourceFlowTestCase<ClaimsCheckFlow, D
|
|||
createTld("tld", TldState.SUNRISE);
|
||||
persistResource(Registry.get("tld").asBuilder().build());
|
||||
setEppInput("domain_check_claims.xml");
|
||||
thrown.expect(BadCommandForRegistryPhaseException.class);
|
||||
thrown.expect(ClaimsCheckNotAllowedInSunrise.class);
|
||||
runFlow();
|
||||
}
|
||||
|
||||
|
@ -148,7 +150,7 @@ public class ClaimsCheckFlowTest extends ResourceFlowTestCase<ClaimsCheckFlow, D
|
|||
.setClaimsPeriodEnd(clock.nowUtc().minusMillis(1))
|
||||
.build());
|
||||
setEppInput("domain_check_claims_multiple_tlds.xml");
|
||||
thrown.expect(BadCommandForRegistryPhaseException.class);
|
||||
thrown.expect(ClaimsPeriodEndedException.class);
|
||||
runFlow();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@ import com.google.common.collect.ImmutableSortedMap;
|
|||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.EppException.UnimplementedExtensionException;
|
||||
import google.registry.flows.ResourceCreateFlow.ResourceAlreadyExistsException;
|
||||
import google.registry.flows.ResourceFlow.BadCommandForRegistryPhaseException;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
|
||||
import google.registry.flows.domain.BaseDomainCreateFlow.AcceptedTooLongAgoException;
|
||||
|
@ -59,6 +58,7 @@ import google.registry.flows.domain.DomainApplicationCreateFlow.LandrushApplicat
|
|||
import google.registry.flows.domain.DomainApplicationCreateFlow.NoticeCannotBeUsedWithSignedMarkException;
|
||||
import google.registry.flows.domain.DomainApplicationCreateFlow.SunriseApplicationDisallowedDuringLandrushException;
|
||||
import google.registry.flows.domain.DomainApplicationCreateFlow.UncontestedSunriseApplicationBlockedInLandrushException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadCommandForRegistryPhaseException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadDomainNameCharacterException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadDomainNamePartsCountException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadPeriodUnitException;
|
||||
|
|
|
@ -33,9 +33,9 @@ import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
|||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.domain.DomainApplicationDeleteFlow.SunriseApplicationCannotBeDeletedInLandrushException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.ApplicationDomainNameMismatchException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadCommandForRegistryPhaseException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.LaunchPhaseMismatchException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
|
||||
import google.registry.flows.exceptions.BadCommandForRegistryPhaseException;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
|
@ -264,6 +264,36 @@ public class DomainApplicationDeleteFlowTest
|
|||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_superuserQuietPeriod() throws Exception {
|
||||
createTld("tld", TldState.QUIET_PERIOD);
|
||||
persistResource(
|
||||
newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_delete_response.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_superuserPredelegation() throws Exception {
|
||||
createTld("tld", TldState.PREDELEGATION);
|
||||
persistResource(
|
||||
newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_delete_response.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_superuserGeneralAvailability() throws Exception {
|
||||
createTld("tld", TldState.GENERAL_AVAILABILITY);
|
||||
persistResource(
|
||||
newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_delete_response.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_applicationIdForDifferentDomain() throws Exception {
|
||||
thrown.expect(ApplicationDomainNameMismatchException.class);
|
||||
|
|
|
@ -31,6 +31,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import google.registry.flows.ResourceCheckFlowTestCase;
|
||||
import google.registry.flows.domain.DomainCheckFlow.OnlyCheckedNamesCanBeFeeCheckedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadCommandForRegistryPhaseException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadDomainNameCharacterException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadDomainNamePartsCountException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadPeriodUnitException;
|
||||
|
@ -347,6 +348,13 @@ public class DomainCheckFlowTest
|
|||
doFailingBadLabelTest("xn--k3hel9n7bxlu1e.tld", InvalidIdnDomainLabelException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_predelegation() throws Exception {
|
||||
createTld("tld", TldState.PREDELEGATION);
|
||||
thrown.expect(BadCommandForRegistryPhaseException.class);
|
||||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAvailExtension() throws Exception {
|
||||
persistActiveDomain("example1.tld");
|
||||
|
|
|
@ -53,7 +53,6 @@ import google.registry.flows.EppRequestSource;
|
|||
import google.registry.flows.LoggedInFlow.UndeclaredServiceExtensionException;
|
||||
import google.registry.flows.ResourceCreateFlow.ResourceAlreadyExistsException;
|
||||
import google.registry.flows.ResourceCreateOrMutateFlow.OnlyToolCanPassMetadataException;
|
||||
import google.registry.flows.ResourceFlow.BadCommandForRegistryPhaseException;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.domain.BaseDomainCreateFlow.AcceptedTooLongAgoException;
|
||||
import google.registry.flows.domain.BaseDomainCreateFlow.ClaimsPeriodEndedException;
|
||||
|
@ -963,7 +962,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
|
||||
@Test
|
||||
public void testFailure_predelegation() throws Exception {
|
||||
thrown.expect(BadCommandForRegistryPhaseException.class);
|
||||
thrown.expect(NoGeneralRegistrationsInCurrentPhaseException.class);
|
||||
createTld("tld", TldState.PREDELEGATION);
|
||||
persistContactsAndHosts();
|
||||
runFlow();
|
||||
|
|
|
@ -19,6 +19,7 @@ import static google.registry.flows.domain.DomainTransferFlowTestCase.persistWit
|
|||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.testing.DatastoreHelper.assertBillingEvents;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.createTlds;
|
||||
import static google.registry.testing.DatastoreHelper.getOnlyHistoryEntryOfType;
|
||||
import static google.registry.testing.DatastoreHelper.getOnlyPollMessage;
|
||||
|
@ -47,6 +48,7 @@ import google.registry.flows.ResourceFlowTestCase;
|
|||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.domain.DomainDeleteFlow.DomainToDeleteHasHostsException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadCommandForRegistryPhaseException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
|
||||
import google.registry.flows.exceptions.OnlyToolCanPassMetadataException;
|
||||
import google.registry.flows.exceptions.ResourceStatusProhibitsOperationException;
|
||||
|
@ -67,6 +69,7 @@ import google.registry.model.poll.PendingActionNotificationResponse;
|
|||
import google.registry.model.poll.PollMessage;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.Registry.TldState;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.transfer.TransferData;
|
||||
import google.registry.model.transfer.TransferResponse;
|
||||
|
@ -591,6 +594,23 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
assertOnlyBillingEventIsClosedAutorenew("TheRegistrar");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_predelegation() throws Exception {
|
||||
createTld("tld", TldState.PREDELEGATION);
|
||||
setupSuccessfulTest();
|
||||
thrown.expect(BadCommandForRegistryPhaseException.class);
|
||||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_superuserPredelegation() throws Exception {
|
||||
createTld("tld", TldState.PREDELEGATION);
|
||||
setupSuccessfulTest();
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_delete_response_pending.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue