mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Add the START_DATE_SUNRISE phase
The START_DATE_SUNRISE phase allows registration of domains only with a signed mark. In all other respects - it is identical to the GENERAL_AVAILABILITY phase. Note that Anchor Tenants bypass all checks, and are hence able to register domains without a signed mark. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=185534793
This commit is contained in:
parent
bba975a991
commit
b0cbc0f60d
17 changed files with 484 additions and 13 deletions
|
@ -516,8 +516,10 @@ An EPP flow that creates a new domain resource.
|
||||||
|
|
||||||
* 2002
|
* 2002
|
||||||
* Service extension(s) must be declared at login.
|
* Service extension(s) must be declared at login.
|
||||||
|
* The current registry phase allows registrations only with signed marks.
|
||||||
* The current registry phase does not allow for general registrations.
|
* The current registry phase does not allow for general registrations.
|
||||||
* 2003
|
* 2003
|
||||||
|
* The provided mark does not match the desired domain label.
|
||||||
* Fees must be explicitly acknowledged when creating domains during the
|
* Fees must be explicitly acknowledged when creating domains during the
|
||||||
Early Access Program.
|
Early Access Program.
|
||||||
* Fees must be explicitly acknowledged when performing any operations on a
|
* Fees must be explicitly acknowledged when performing any operations on a
|
||||||
|
|
|
@ -105,7 +105,8 @@ public final class DomainCheckFlow implements Flow {
|
||||||
* unavailable.
|
* unavailable.
|
||||||
*/
|
*/
|
||||||
private static final ImmutableSet<TldState> PENDING_ALLOCATION_TLD_STATES =
|
private static final ImmutableSet<TldState> PENDING_ALLOCATION_TLD_STATES =
|
||||||
Sets.immutableEnumSet(TldState.GENERAL_AVAILABILITY, TldState.QUIET_PERIOD);
|
Sets.immutableEnumSet(
|
||||||
|
TldState.GENERAL_AVAILABILITY, TldState.START_DATE_SUNRISE, TldState.QUIET_PERIOD);
|
||||||
|
|
||||||
@Inject ResourceCommand resourceCommand;
|
@Inject ResourceCommand resourceCommand;
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
|
|
|
@ -42,6 +42,8 @@ import static google.registry.model.eppcommon.StatusValue.SERVER_TRANSFER_PROHIB
|
||||||
import static google.registry.model.eppcommon.StatusValue.SERVER_UPDATE_PROHIBITED;
|
import static google.registry.model.eppcommon.StatusValue.SERVER_UPDATE_PROHIBITED;
|
||||||
import static google.registry.model.index.DomainApplicationIndex.loadActiveApplicationsByDomainName;
|
import static google.registry.model.index.DomainApplicationIndex.loadActiveApplicationsByDomainName;
|
||||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||||
|
import static google.registry.model.registry.Registry.TldState.GENERAL_AVAILABILITY;
|
||||||
|
import static google.registry.model.registry.Registry.TldState.START_DATE_SUNRISE;
|
||||||
import static google.registry.model.registry.label.ReservedList.matchesAnchorTenantReservation;
|
import static google.registry.model.registry.label.ReservedList.matchesAnchorTenantReservation;
|
||||||
import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
||||||
import static google.registry.util.DateTimeUtils.leapSafeAddYears;
|
import static google.registry.util.DateTimeUtils.leapSafeAddYears;
|
||||||
|
@ -119,7 +121,9 @@ import org.joda.time.Duration;
|
||||||
* @error {@link google.registry.flows.EppException.UnimplementedExtensionException}
|
* @error {@link google.registry.flows.EppException.UnimplementedExtensionException}
|
||||||
* @error {@link google.registry.flows.ExtensionManager.UndeclaredServiceExtensionException}
|
* @error {@link google.registry.flows.ExtensionManager.UndeclaredServiceExtensionException}
|
||||||
* @error {@link DomainCreateFlow.DomainHasOpenApplicationsException}
|
* @error {@link DomainCreateFlow.DomainHasOpenApplicationsException}
|
||||||
|
* @error {@link DomainCreateFlow.MustHaveSignedMarksInCurrentPhaseException}
|
||||||
* @error {@link DomainCreateFlow.NoGeneralRegistrationsInCurrentPhaseException}
|
* @error {@link DomainCreateFlow.NoGeneralRegistrationsInCurrentPhaseException}
|
||||||
|
* @error {@link DomainFlowTmchUtils.NoMarksFoundMatchingDomainException}
|
||||||
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
||||||
* @error {@link DomainFlowUtils.AcceptedTooLongAgoException}
|
* @error {@link DomainFlowUtils.AcceptedTooLongAgoException}
|
||||||
* @error {@link DomainFlowUtils.BadDomainNameCharacterException}
|
* @error {@link DomainFlowUtils.BadDomainNameCharacterException}
|
||||||
|
@ -251,7 +255,7 @@ public class DomainCreateFlow implements TransactionalFlow {
|
||||||
}
|
}
|
||||||
verifyPremiumNameIsNotBlocked(targetId, now, clientId);
|
verifyPremiumNameIsNotBlocked(targetId, now, clientId);
|
||||||
verifyNoOpenApplications(now);
|
verifyNoOpenApplications(now);
|
||||||
verifyIsGaOrIsSpecialCase(tldState, isAnchorTenant);
|
verifyIsGaOrIsSpecialCase(tldState, isAnchorTenant, hasSignedMarks);
|
||||||
if (hasSignedMarks) {
|
if (hasSignedMarks) {
|
||||||
// If a signed mark was provided, then it must match the desired domain label. Get the mark
|
// If a signed mark was provided, then it must match the desired domain label. Get the mark
|
||||||
// at this point so that we can verify it before the "after validation" extension point.
|
// at this point so that we can verify it before the "after validation" extension point.
|
||||||
|
@ -375,12 +379,38 @@ public class DomainCreateFlow implements TransactionalFlow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Prohibit registrations for non-QLP and non-superuser outside of General Availability. **/
|
/**
|
||||||
private void verifyIsGaOrIsSpecialCase(TldState tldState, boolean isAnchorTenant)
|
* Prohibit registrations unless QLP, General Availability or Start Date Sunrise.
|
||||||
throws NoGeneralRegistrationsInCurrentPhaseException {
|
*
|
||||||
if (!isAnchorTenant && tldState != TldState.GENERAL_AVAILABILITY) {
|
* <p>During Start-Date Sunrise, we need a signed mark for registrations.
|
||||||
throw new NoGeneralRegistrationsInCurrentPhaseException();
|
*
|
||||||
|
* <p>Note that "superuser" status isn't tested here - this should only be called for
|
||||||
|
* non-superusers.
|
||||||
|
*/
|
||||||
|
private void verifyIsGaOrIsSpecialCase(
|
||||||
|
TldState tldState, boolean isAnchorTenant, boolean hasSignedMarks)
|
||||||
|
throws NoGeneralRegistrationsInCurrentPhaseException,
|
||||||
|
MustHaveSignedMarksInCurrentPhaseException {
|
||||||
|
// Anchor Tenant overrides any other consideration to allow registration.
|
||||||
|
if (isAnchorTenant) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We allow general registration during GA.
|
||||||
|
if (GENERAL_AVAILABILITY.equals(tldState)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// During START_DATE_SUNRISE, only allow registration with a signed marks.
|
||||||
|
if (START_DATE_SUNRISE.equals(tldState)) {
|
||||||
|
if (!hasSignedMarks) {
|
||||||
|
throw new MustHaveSignedMarksInCurrentPhaseException();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// All other phases do not allow registration
|
||||||
|
throw new NoGeneralRegistrationsInCurrentPhaseException();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Verifies and returns the allocation token if one is specified, otherwise does nothing. */
|
/** Verifies and returns the allocation token if one is specified, otherwise does nothing. */
|
||||||
|
@ -516,4 +546,11 @@ public class DomainCreateFlow implements TransactionalFlow {
|
||||||
super("The current registry phase does not allow for general registrations");
|
super("The current registry phase does not allow for general registrations");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** The current registry phase allows registrations only with signed marks. */
|
||||||
|
static class MustHaveSignedMarksInCurrentPhaseException extends CommandUseErrorException {
|
||||||
|
public MustHaveSignedMarksInCurrentPhaseException() {
|
||||||
|
super("The current registry phase requires a signed mark for registrations");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,12 +127,14 @@ public class DomainFlowUtils {
|
||||||
|
|
||||||
/** Map from launch phases to the equivalent tld states. */
|
/** Map from launch phases to the equivalent tld states. */
|
||||||
private static final ImmutableMap<LaunchPhase, TldState> LAUNCH_PHASE_TO_TLD_STATE =
|
private static final ImmutableMap<LaunchPhase, TldState> LAUNCH_PHASE_TO_TLD_STATE =
|
||||||
ImmutableMap.of(
|
new ImmutableMap.Builder<LaunchPhase, TldState>()
|
||||||
LaunchPhase.SUNRISE, TldState.SUNRISE,
|
.put(LaunchPhase.SUNRISE, TldState.SUNRISE)
|
||||||
LaunchPhase.SUNRUSH, TldState.SUNRUSH,
|
.put(LaunchPhase.SUNRUSH, TldState.SUNRUSH)
|
||||||
LaunchPhase.LANDRUSH, TldState.LANDRUSH,
|
.put(LaunchPhase.LANDRUSH, TldState.LANDRUSH)
|
||||||
LaunchPhase.CLAIMS, TldState.GENERAL_AVAILABILITY,
|
.put(LaunchPhase.CLAIMS, TldState.GENERAL_AVAILABILITY)
|
||||||
LaunchPhase.OPEN, TldState.GENERAL_AVAILABILITY);
|
.put(LaunchPhase.START_DATE_SUNRISE, TldState.START_DATE_SUNRISE)
|
||||||
|
.put(LaunchPhase.OPEN, TldState.GENERAL_AVAILABILITY)
|
||||||
|
.build();
|
||||||
|
|
||||||
/** Reservation types that are allowed in sunrise by policy. */
|
/** Reservation types that are allowed in sunrise by policy. */
|
||||||
public static final ImmutableSet<ReservationType> TYPES_ALLOWED_FOR_CREATE_ONLY_IN_SUNRISE =
|
public static final ImmutableSet<ReservationType> TYPES_ALLOWED_FOR_CREATE_ONLY_IN_SUNRISE =
|
||||||
|
@ -146,6 +148,7 @@ public class DomainFlowUtils {
|
||||||
Sets.immutableEnumSet(
|
Sets.immutableEnumSet(
|
||||||
TldState.PREDELEGATION,
|
TldState.PREDELEGATION,
|
||||||
TldState.QUIET_PERIOD,
|
TldState.QUIET_PERIOD,
|
||||||
|
TldState.START_DATE_SUNRISE,
|
||||||
TldState.GENERAL_AVAILABILITY);
|
TldState.GENERAL_AVAILABILITY);
|
||||||
|
|
||||||
/** Strict validator for ascii lowercase letters, digits, and "-", allowing "." as a separator */
|
/** Strict validator for ascii lowercase letters, digits, and "-", allowing "." as a separator */
|
||||||
|
|
|
@ -32,6 +32,25 @@ import javax.xml.bind.annotation.XmlValue;
|
||||||
*
|
*
|
||||||
* <p>The launch phase refers to the various stages that a TLD goes through before entering general
|
* <p>The launch phase refers to the various stages that a TLD goes through before entering general
|
||||||
* availability. The various phases are described below (in order that they usually occur).
|
* availability. The various phases are described below (in order that they usually occur).
|
||||||
|
*
|
||||||
|
* <p>Each phase is connected to the TldState in which it can be used (see DomainFlowUtils). Sending
|
||||||
|
* an EPP with the wrong launch phase for the current TldState will result in an error. However, we
|
||||||
|
* don't actually check the launch phase *exists*.
|
||||||
|
*
|
||||||
|
* <p>We usually check for the information *inside* a launch phase (e.g. the signed mark for the
|
||||||
|
* domain) and return an error if that is missing - which would also check that the phase exists.
|
||||||
|
* But if we bypass the need for that information (e.g., an Anchor Tenant doesn't need a signed
|
||||||
|
* mark), then we never actually test the phase exists.
|
||||||
|
*
|
||||||
|
* <p>This means an Anchor Tenant has some weird peculiarities: It doesn't need to specify the
|
||||||
|
* phase. It *can* specify the phase, but not give any of the phase's information (e.g. - signed
|
||||||
|
* marks), in which case we accept even a wrong phase. But if it *does* give a signed mark as well -
|
||||||
|
* we will return an error if it's the wrong phase (or if the marks are invalid) even though we
|
||||||
|
* didn't require them.
|
||||||
|
*
|
||||||
|
* <p>This is OK (?) because the Anchor Tenants field is set internally and manually.. The person
|
||||||
|
* who sets it is the one that needs to make sure the domain isn't a trademark and that the fields
|
||||||
|
* are correct.
|
||||||
*/
|
*/
|
||||||
@Embed
|
@Embed
|
||||||
public class LaunchPhase extends ImmutableObject {
|
public class LaunchPhase extends ImmutableObject {
|
||||||
|
@ -57,6 +76,12 @@ public class LaunchPhase extends ImmutableObject {
|
||||||
*/
|
*/
|
||||||
public static final LaunchPhase CLAIMS = create("claims", null);
|
public static final LaunchPhase CLAIMS = create("claims", null);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An alternative launch phase which allows only trademark owners to create domains. It is used
|
||||||
|
* instead of the previous phases.
|
||||||
|
*/
|
||||||
|
public static final LaunchPhase START_DATE_SUNRISE = create("sunrise", "start-date");
|
||||||
|
|
||||||
/** A post-launch phase that is also referred to as "steady state". */
|
/** A post-launch phase that is also referred to as "steady state". */
|
||||||
public static final LaunchPhase OPEN = create("open", null);
|
public static final LaunchPhase OPEN = create("open", null);
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,12 @@ public class Registry extends ImmutableObject implements Buildable {
|
||||||
*/
|
*/
|
||||||
LANDRUSH,
|
LANDRUSH,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The state in which only trademark holders can submit a "create" request. It is identical to
|
||||||
|
* {@link #GENERAL_AVAILABILITY} in all other respects.
|
||||||
|
*/
|
||||||
|
START_DATE_SUNRISE,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A state in which no domain operations are permitted. Generally used after sunrise or landrush
|
* A state in which no domain operations are permitted. Generally used after sunrise or landrush
|
||||||
* to allocate uncontended applications and send contended applications to auction. This state
|
* to allocate uncontended applications and send contended applications to auction. This state
|
||||||
|
|
|
@ -1083,4 +1083,95 @@ public class EppLifecycleDomainTest extends EppTestCase {
|
||||||
|
|
||||||
assertCommandAndResponse("logout.xml", "logout_response.xml");
|
assertCommandAndResponse("logout.xml", "logout_response.xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test a full launch of start-date sunrise.
|
||||||
|
*
|
||||||
|
* We show that we can't create during pre-delegation, can only create with an encoded mark during
|
||||||
|
* start-date sunrise - which we can then delete "as normal" (no need for a signed mark or
|
||||||
|
* anything for delete), and then use "regular" create during general-availability.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDomainCreation_startDateSunriseFull() throws Exception {
|
||||||
|
// The signed mark is valid between 2013 and 2017
|
||||||
|
DateTime sunriseDate = DateTime.parse("2014-09-08T09:09:09Z");
|
||||||
|
DateTime gaDate = sunriseDate.plusDays(30);
|
||||||
|
createTld(
|
||||||
|
"example",
|
||||||
|
ImmutableSortedMap.of(
|
||||||
|
START_OF_TIME, TldState.PREDELEGATION,
|
||||||
|
sunriseDate, TldState.START_DATE_SUNRISE,
|
||||||
|
gaDate, TldState.GENERAL_AVAILABILITY));
|
||||||
|
|
||||||
|
assertCommandAndResponse("login_valid.xml", "login_response.xml", sunriseDate.minusDays(3));
|
||||||
|
|
||||||
|
createContactsAndHosts();
|
||||||
|
|
||||||
|
// During pre-delegation, any create should fail both with and without mark
|
||||||
|
assertCommandAndResponse(
|
||||||
|
"domain_create_start_date_sunrise_encoded_mark.xml",
|
||||||
|
ImmutableMap.of(),
|
||||||
|
"response_error.xml",
|
||||||
|
ImmutableMap.of(
|
||||||
|
"MSG", "Declared launch extension phase does not match the current registry phase",
|
||||||
|
"CODE", "2306"),
|
||||||
|
sunriseDate.minusDays(2));
|
||||||
|
|
||||||
|
assertCommandAndResponse(
|
||||||
|
"domain_create_wildcard.xml",
|
||||||
|
ImmutableMap.of("HOSTNAME", "general.example"),
|
||||||
|
"response_error.xml",
|
||||||
|
ImmutableMap.of(
|
||||||
|
"MSG", "The current registry phase does not allow for general registrations",
|
||||||
|
"CODE", "2002"),
|
||||||
|
sunriseDate.minusDays(1));
|
||||||
|
|
||||||
|
// During start-date sunrise, create with mark will succeed but without will fail.
|
||||||
|
// We also test we can delete without a mark.
|
||||||
|
assertCommandAndResponse(
|
||||||
|
"domain_create_start_date_sunrise_encoded_mark.xml",
|
||||||
|
ImmutableMap.of(),
|
||||||
|
"domain_create_response.xml",
|
||||||
|
ImmutableMap.of(
|
||||||
|
"NAME", "test-validate.example",
|
||||||
|
"CRDATE", "2014-09-09T09:09:09Z",
|
||||||
|
"EXDATE", "2015-09-09T09:09:09Z"),
|
||||||
|
sunriseDate.plusDays(1));
|
||||||
|
|
||||||
|
assertCommandAndResponse(
|
||||||
|
"domain_delete.xml", ImmutableMap.of("NAME", "test-validate.example"),
|
||||||
|
"generic_success_response.xml", ImmutableMap.of(),
|
||||||
|
sunriseDate.plusDays(1).plusMinutes(1));
|
||||||
|
|
||||||
|
assertCommandAndResponse(
|
||||||
|
"domain_create_wildcard.xml",
|
||||||
|
ImmutableMap.of("HOSTNAME", "general.example"),
|
||||||
|
"response_error.xml",
|
||||||
|
ImmutableMap.of(
|
||||||
|
"MSG", "The current registry phase requires a signed mark for registrations",
|
||||||
|
"CODE", "2002"),
|
||||||
|
sunriseDate.plusDays(2));
|
||||||
|
|
||||||
|
// During general availability, sunrise creates will fail but regular creates succeed
|
||||||
|
assertCommandAndResponse(
|
||||||
|
"domain_create_start_date_sunrise_encoded_mark.xml",
|
||||||
|
ImmutableMap.of(),
|
||||||
|
"response_error.xml",
|
||||||
|
ImmutableMap.of(
|
||||||
|
"MSG", "Declared launch extension phase does not match the current registry phase",
|
||||||
|
"CODE", "2306"),
|
||||||
|
gaDate.plusDays(1));
|
||||||
|
|
||||||
|
assertCommandAndResponse(
|
||||||
|
"domain_create_wildcard.xml",
|
||||||
|
ImmutableMap.of("HOSTNAME", "general.example"),
|
||||||
|
"domain_create_response.xml",
|
||||||
|
ImmutableMap.of(
|
||||||
|
"NAME", "general.example",
|
||||||
|
"CRDATE", "2014-10-10T09:09:09Z",
|
||||||
|
"EXDATE", "2016-10-10T09:09:09Z"),
|
||||||
|
gaDate.plusDays(2));
|
||||||
|
|
||||||
|
assertCommandAndResponse("logout.xml", "logout_response.xml");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1192,6 +1192,15 @@ public class DomainApplicationCreateFlowTest
|
||||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFailure_startDateSunrise() throws Exception {
|
||||||
|
createTld("tld", TldState.START_DATE_SUNRISE);
|
||||||
|
persistContactsAndHosts();
|
||||||
|
clock.advanceOneMilli();
|
||||||
|
EppException thrown = expectThrows(BadCommandForRegistryPhaseException.class, this::runFlow);
|
||||||
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFailure_wrongDeclaredPhase() throws Exception {
|
public void testFailure_wrongDeclaredPhase() throws Exception {
|
||||||
setEppInput("domain_create_landrush_signed_mark.xml");
|
setEppInput("domain_create_landrush_signed_mark.xml");
|
||||||
|
@ -1242,6 +1251,14 @@ public class DomainApplicationCreateFlowTest
|
||||||
runSuperuserFlow("domain_create_sunrush_response.xml");
|
runSuperuserFlow("domain_create_sunrush_response.xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSuccess_superuserStartDateSunrise() throws Exception {
|
||||||
|
createTld("tld", TldState.START_DATE_SUNRISE);
|
||||||
|
persistContactsAndHosts();
|
||||||
|
clock.advanceOneMilli();
|
||||||
|
runSuperuserFlow("domain_create_sunrush_response.xml");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSuccess_superuserWrongDeclaredPhase() throws Exception {
|
public void testSuccess_superuserWrongDeclaredPhase() throws Exception {
|
||||||
setEppInput("domain_create_landrush_signed_mark.xml");
|
setEppInput("domain_create_landrush_signed_mark.xml");
|
||||||
|
|
|
@ -282,6 +282,14 @@ public class DomainApplicationDeleteFlowTest
|
||||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFailure_startDateSunrise() throws Exception {
|
||||||
|
createTld("tld", TldState.START_DATE_SUNRISE);
|
||||||
|
persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
|
||||||
|
EppException thrown = expectThrows(BadCommandForRegistryPhaseException.class, this::runFlow);
|
||||||
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSuccess_superuserQuietPeriod() throws Exception {
|
public void testSuccess_superuserQuietPeriod() throws Exception {
|
||||||
createTld("tld", TldState.QUIET_PERIOD);
|
createTld("tld", TldState.QUIET_PERIOD);
|
||||||
|
@ -309,6 +317,15 @@ public class DomainApplicationDeleteFlowTest
|
||||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("domain_delete_response.xml"));
|
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("domain_delete_response.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSuccess_superuserStartDateSunrise() throws Exception {
|
||||||
|
createTld("tld", TldState.START_DATE_SUNRISE);
|
||||||
|
persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
|
||||||
|
clock.advanceOneMilli();
|
||||||
|
runFlowAssertResponse(
|
||||||
|
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("domain_delete_response.xml"));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFailure_applicationIdForDifferentDomain() throws Exception {
|
public void testFailure_applicationIdForDifferentDomain() throws Exception {
|
||||||
persistResource(newDomainApplication("invalid.tld").asBuilder().setRepoId("1-TLD").build());
|
persistResource(newDomainApplication("invalid.tld").asBuilder().setRepoId("1-TLD").build());
|
||||||
|
|
|
@ -65,7 +65,9 @@ import google.registry.flows.EppRequestSource;
|
||||||
import google.registry.flows.ExtensionManager.UndeclaredServiceExtensionException;
|
import google.registry.flows.ExtensionManager.UndeclaredServiceExtensionException;
|
||||||
import google.registry.flows.ResourceFlowTestCase;
|
import google.registry.flows.ResourceFlowTestCase;
|
||||||
import google.registry.flows.domain.DomainCreateFlow.DomainHasOpenApplicationsException;
|
import google.registry.flows.domain.DomainCreateFlow.DomainHasOpenApplicationsException;
|
||||||
|
import google.registry.flows.domain.DomainCreateFlow.MustHaveSignedMarksInCurrentPhaseException;
|
||||||
import google.registry.flows.domain.DomainCreateFlow.NoGeneralRegistrationsInCurrentPhaseException;
|
import google.registry.flows.domain.DomainCreateFlow.NoGeneralRegistrationsInCurrentPhaseException;
|
||||||
|
import google.registry.flows.domain.DomainFlowTmchUtils.NoMarksFoundMatchingDomainException;
|
||||||
import google.registry.flows.domain.DomainFlowUtils.AcceptedTooLongAgoException;
|
import google.registry.flows.domain.DomainFlowUtils.AcceptedTooLongAgoException;
|
||||||
import google.registry.flows.domain.DomainFlowUtils.BadDomainNameCharacterException;
|
import google.registry.flows.domain.DomainFlowUtils.BadDomainNameCharacterException;
|
||||||
import google.registry.flows.domain.DomainFlowUtils.BadDomainNamePartsCountException;
|
import google.registry.flows.domain.DomainFlowUtils.BadDomainNamePartsCountException;
|
||||||
|
@ -1258,6 +1260,15 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFailure_startDateSunrise_missingLaunchExtension() throws Exception {
|
||||||
|
createTld("tld", TldState.START_DATE_SUNRISE);
|
||||||
|
persistContactsAndHosts();
|
||||||
|
EppException thrown =
|
||||||
|
expectThrows(MustHaveSignedMarksInCurrentPhaseException.class, this::runFlow);
|
||||||
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFailure_quietPeriod() throws Exception {
|
public void testFailure_quietPeriod() throws Exception {
|
||||||
createTld("tld", TldState.QUIET_PERIOD);
|
createTld("tld", TldState.QUIET_PERIOD);
|
||||||
|
@ -1281,6 +1292,13 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
doSuccessfulTest("tld", "domain_create_response.xml", UserPrivileges.SUPERUSER);
|
doSuccessfulTest("tld", "domain_create_response.xml", UserPrivileges.SUPERUSER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSuccess_superuserStartDateSunrise_isSuperuser() throws Exception {
|
||||||
|
createTld("tld", TldState.START_DATE_SUNRISE);
|
||||||
|
persistContactsAndHosts();
|
||||||
|
doSuccessfulTest("tld", "domain_create_response.xml", UserPrivileges.SUPERUSER);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSuccess_superuserQuietPeriod() throws Exception {
|
public void testSuccess_superuserQuietPeriod() throws Exception {
|
||||||
createTld("tld", TldState.QUIET_PERIOD);
|
createTld("tld", TldState.QUIET_PERIOD);
|
||||||
|
@ -1710,6 +1728,68 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
assertClaimsLordn();
|
assertClaimsLordn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFailure_startDateSunriseRegistration_missingSignedMark() throws Exception {
|
||||||
|
createTld("tld", TldState.START_DATE_SUNRISE);
|
||||||
|
setEppInput("domain_create_registration_start_date_sunrise.xml");
|
||||||
|
persistContactsAndHosts();
|
||||||
|
EppException thrown =
|
||||||
|
expectThrows(MustHaveSignedMarksInCurrentPhaseException.class, this::runFlow);
|
||||||
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSuccess_superuserStartDateSunriseRegistration_isSuperuser() throws Exception {
|
||||||
|
createTld("tld", TldState.START_DATE_SUNRISE);
|
||||||
|
setEppInput("domain_create_registration_start_date_sunrise.xml");
|
||||||
|
persistContactsAndHosts();
|
||||||
|
doSuccessfulTest("tld", "domain_create_response.xml", UserPrivileges.SUPERUSER);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSuccess_qlpRegistrationSunriseRegistration() throws Exception {
|
||||||
|
createTld("tld", TldState.START_DATE_SUNRISE);
|
||||||
|
setEppInput("domain_create_registration_qlp_start_date_sunrise.xml");
|
||||||
|
eppRequestSource = EppRequestSource.TOOL; // Only tools can pass in metadata.
|
||||||
|
persistContactsAndHosts();
|
||||||
|
runFlowAssertResponse(loadFile("domain_create_response.xml"));
|
||||||
|
assertSuccessfulCreate("tld", true);
|
||||||
|
assertNoLordn();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSuccess_startDateSunriseRegistration_withEncodedSignedMark() throws Exception {
|
||||||
|
createTld("tld", TldState.START_DATE_SUNRISE);
|
||||||
|
clock.setTo(DateTime.parse("2014-09-09T09:09:09Z"));
|
||||||
|
setEppInput("domain_create_registration_start_date_sunrise_encoded_signed_mark.xml");
|
||||||
|
persistContactsAndHosts();
|
||||||
|
runFlowAssertResponse(loadFile("domain_create_response_encoded_signed_mark_name.xml"));
|
||||||
|
assertSuccessfulCreate("tld", false);
|
||||||
|
assertNoLordn("0000001761376042759136-65535", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFail_startDateSunriseRegistration_wrongEncodedSignedMark() throws Exception {
|
||||||
|
createTld("tld", TldState.START_DATE_SUNRISE);
|
||||||
|
clock.setTo(DateTime.parse("2014-09-09T09:09:09Z"));
|
||||||
|
setEppInput("domain_create_registration_start_date_sunrise_wrong_encoded_signed_mark.xml");
|
||||||
|
persistContactsAndHosts();
|
||||||
|
EppException thrown =
|
||||||
|
expectThrows(NoMarksFoundMatchingDomainException.class, this::runFlow);
|
||||||
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFailure_startDateSunriseRegistration_withClaimsNotice() throws Exception {
|
||||||
|
createTld("tld", TldState.START_DATE_SUNRISE);
|
||||||
|
clock.setTo(DateTime.parse("2009-08-16T09:00:00.0Z"));
|
||||||
|
setEppInput("domain_create_registration_start_date_sunrise_claims_notice.xml");
|
||||||
|
persistContactsAndHosts();
|
||||||
|
EppException thrown =
|
||||||
|
expectThrows(MustHaveSignedMarksInCurrentPhaseException.class, this::runFlow);
|
||||||
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFailure_sunrushRegistration() throws Exception {
|
public void testFailure_sunrushRegistration() throws Exception {
|
||||||
createTld("tld", TldState.SUNRUSH);
|
createTld("tld", TldState.SUNRUSH);
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||||
|
<command>
|
||||||
|
<create>
|
||||||
|
<domain:create
|
||||||
|
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||||
|
<domain:name>example.tld</domain:name>
|
||||||
|
<domain:period unit="y">2</domain:period>
|
||||||
|
<domain:ns>
|
||||||
|
<domain:hostObj>ns1.example.net</domain:hostObj>
|
||||||
|
<domain:hostObj>ns2.example.net</domain:hostObj>
|
||||||
|
</domain:ns>
|
||||||
|
<domain:registrant>jd1234</domain:registrant>
|
||||||
|
<domain:contact type="admin">sh8013</domain:contact>
|
||||||
|
<domain:contact type="tech">sh8013</domain:contact>
|
||||||
|
<domain:authInfo>
|
||||||
|
<domain:pw>2fooBAR</domain:pw>
|
||||||
|
</domain:authInfo>
|
||||||
|
</domain:create>
|
||||||
|
</create>
|
||||||
|
<extension>
|
||||||
|
<launch:create xmlns:launch="urn:ietf:params:xml:ns:launch-1.0" type="registration">
|
||||||
|
<launch:phase name="start-date">sunrise</launch:phase>
|
||||||
|
</launch:create>
|
||||||
|
<metadata:metadata xmlns:metadata="urn:google:params:xml:ns:metadata-1.0">
|
||||||
|
<metadata:requestedByRegistrar>true</metadata:requestedByRegistrar>
|
||||||
|
<metadata:anchorTenant>true</metadata:anchorTenant>
|
||||||
|
</metadata:metadata>
|
||||||
|
</extension>
|
||||||
|
<clTRID>ABC-12345</clTRID>
|
||||||
|
</command>
|
||||||
|
</epp>
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||||
|
<command>
|
||||||
|
<create>
|
||||||
|
<domain:create
|
||||||
|
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||||
|
<domain:name>example.tld</domain:name>
|
||||||
|
<domain:period unit="y">2</domain:period>
|
||||||
|
<domain:ns>
|
||||||
|
<domain:hostObj>ns1.example.net</domain:hostObj>
|
||||||
|
<domain:hostObj>ns2.example.net</domain:hostObj>
|
||||||
|
</domain:ns>
|
||||||
|
<domain:registrant>jd1234</domain:registrant>
|
||||||
|
<domain:contact type="admin">sh8013</domain:contact>
|
||||||
|
<domain:contact type="tech">sh8013</domain:contact>
|
||||||
|
<domain:authInfo>
|
||||||
|
<domain:pw>2fooBAR</domain:pw>
|
||||||
|
</domain:authInfo>
|
||||||
|
</domain:create>
|
||||||
|
</create>
|
||||||
|
<extension>
|
||||||
|
<launch:create
|
||||||
|
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0"
|
||||||
|
type="registration">
|
||||||
|
<launch:phase name="start-date">sunrise</launch:phase>
|
||||||
|
</launch:create>
|
||||||
|
</extension>
|
||||||
|
<clTRID>ABC-12345</clTRID>
|
||||||
|
</command>
|
||||||
|
</epp>
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||||
|
<command>
|
||||||
|
<create>
|
||||||
|
<domain:create
|
||||||
|
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||||
|
<domain:name>example-one.tld</domain:name>
|
||||||
|
<domain:period unit="y">2</domain:period>
|
||||||
|
<domain:ns>
|
||||||
|
<domain:hostObj>ns1.example.net</domain:hostObj>
|
||||||
|
<domain:hostObj>ns2.example.net</domain:hostObj>
|
||||||
|
</domain:ns>
|
||||||
|
<domain:registrant>jd1234</domain:registrant>
|
||||||
|
<domain:contact type="admin">sh8013</domain:contact>
|
||||||
|
<domain:contact type="tech">sh8013</domain:contact>
|
||||||
|
<domain:authInfo>
|
||||||
|
<domain:pw>2fooBAR</domain:pw>
|
||||||
|
</domain:authInfo>
|
||||||
|
</domain:create>
|
||||||
|
</create>
|
||||||
|
<extension>
|
||||||
|
<launch:create xmlns:launch="urn:ietf:params:xml:ns:launch-1.0" type="registration">
|
||||||
|
<launch:phase name="start-date">sunrise</launch:phase>
|
||||||
|
<launch:notice>
|
||||||
|
<launch:noticeID>370d0b7c9223372036854775807</launch:noticeID>
|
||||||
|
<launch:notAfter>2010-08-16T09:00:00.0Z</launch:notAfter>
|
||||||
|
<launch:acceptedDate>2009-08-16T09:00:00.0Z</launch:acceptedDate>
|
||||||
|
</launch:notice>
|
||||||
|
</launch:create>
|
||||||
|
</extension>
|
||||||
|
<clTRID>ABC-12345</clTRID>
|
||||||
|
</command>
|
||||||
|
</epp>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
34
javatests/google/registry/flows/testdata/domain_create_start_date_sunrise_encoded_mark.xml
vendored
Normal file
34
javatests/google/registry/flows/testdata/domain_create_start_date_sunrise_encoded_mark.xml
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -718,6 +718,7 @@ enum google.registry.model.registry.Registry$TldState {
|
||||||
PDT;
|
PDT;
|
||||||
PREDELEGATION;
|
PREDELEGATION;
|
||||||
QUIET_PERIOD;
|
QUIET_PERIOD;
|
||||||
|
START_DATE_SUNRISE;
|
||||||
SUNRISE;
|
SUNRISE;
|
||||||
SUNRUSH;
|
SUNRUSH;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue