mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Fix bug which allowed creation of hosts with superordinate domains in pending delete state.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=154716883
This commit is contained in:
parent
386d2bc6be
commit
11e7374c0f
7 changed files with 82 additions and 0 deletions
|
@ -30,7 +30,9 @@ import google.registry.flows.EppException.ObjectDoesNotExistException;
|
|||
import google.registry.flows.EppException.ParameterValuePolicyErrorException;
|
||||
import google.registry.flows.EppException.ParameterValueRangeErrorException;
|
||||
import google.registry.flows.EppException.ParameterValueSyntaxErrorException;
|
||||
import google.registry.flows.EppException.StatusProhibitsOperationException;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.util.Idn;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
|
@ -127,6 +129,24 @@ public class HostFlowUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/** Ensure that the superordinate domain is not in pending delete. */
|
||||
static void verifySuperordinateDomainNotInPendingDelete(
|
||||
DomainResource superordinateDomain) throws EppException {
|
||||
if ((superordinateDomain != null)
|
||||
&& superordinateDomain.getStatusValues().contains(StatusValue.PENDING_DELETE)) {
|
||||
throw new SuperordinateDomainInPendingDeleteException(
|
||||
superordinateDomain.getFullyQualifiedDomainName());
|
||||
}
|
||||
}
|
||||
|
||||
/** Superordinate domain for this hostname is in pending delete. */
|
||||
static class SuperordinateDomainInPendingDeleteException
|
||||
extends StatusProhibitsOperationException {
|
||||
public SuperordinateDomainInPendingDeleteException(String domainName) {
|
||||
super(domainName);
|
||||
}
|
||||
}
|
||||
|
||||
/** Host names are limited to 253 characters. */
|
||||
static class HostNameTooLongException extends ParameterValueRangeErrorException {
|
||||
public HostNameTooLongException() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue