mirror of
https://github.com/google/nomulus.git
synced 2025-06-28 23:33:36 +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
|
@ -105,7 +105,8 @@ public final class DomainCheckFlow implements Flow {
|
|||
* unavailable.
|
||||
*/
|
||||
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 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.index.DomainApplicationIndex.loadActiveApplicationsByDomainName;
|
||||
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.util.DateTimeUtils.END_OF_TIME;
|
||||
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.ExtensionManager.UndeclaredServiceExtensionException}
|
||||
* @error {@link DomainCreateFlow.DomainHasOpenApplicationsException}
|
||||
* @error {@link DomainCreateFlow.MustHaveSignedMarksInCurrentPhaseException}
|
||||
* @error {@link DomainCreateFlow.NoGeneralRegistrationsInCurrentPhaseException}
|
||||
* @error {@link DomainFlowTmchUtils.NoMarksFoundMatchingDomainException}
|
||||
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link DomainFlowUtils.AcceptedTooLongAgoException}
|
||||
* @error {@link DomainFlowUtils.BadDomainNameCharacterException}
|
||||
|
@ -251,7 +255,7 @@ public class DomainCreateFlow implements TransactionalFlow {
|
|||
}
|
||||
verifyPremiumNameIsNotBlocked(targetId, now, clientId);
|
||||
verifyNoOpenApplications(now);
|
||||
verifyIsGaOrIsSpecialCase(tldState, isAnchorTenant);
|
||||
verifyIsGaOrIsSpecialCase(tldState, isAnchorTenant, hasSignedMarks);
|
||||
if (hasSignedMarks) {
|
||||
// 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.
|
||||
|
@ -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)
|
||||
throws NoGeneralRegistrationsInCurrentPhaseException {
|
||||
if (!isAnchorTenant && tldState != TldState.GENERAL_AVAILABILITY) {
|
||||
throw new NoGeneralRegistrationsInCurrentPhaseException();
|
||||
/**
|
||||
* Prohibit registrations unless QLP, General Availability or Start Date Sunrise.
|
||||
*
|
||||
* <p>During Start-Date Sunrise, we need a signed mark for registrations.
|
||||
*
|
||||
* <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. */
|
||||
|
@ -516,4 +546,11 @@ public class DomainCreateFlow implements TransactionalFlow {
|
|||
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. */
|
||||
private static final ImmutableMap<LaunchPhase, TldState> LAUNCH_PHASE_TO_TLD_STATE =
|
||||
ImmutableMap.of(
|
||||
LaunchPhase.SUNRISE, TldState.SUNRISE,
|
||||
LaunchPhase.SUNRUSH, TldState.SUNRUSH,
|
||||
LaunchPhase.LANDRUSH, TldState.LANDRUSH,
|
||||
LaunchPhase.CLAIMS, TldState.GENERAL_AVAILABILITY,
|
||||
LaunchPhase.OPEN, TldState.GENERAL_AVAILABILITY);
|
||||
new ImmutableMap.Builder<LaunchPhase, TldState>()
|
||||
.put(LaunchPhase.SUNRISE, TldState.SUNRISE)
|
||||
.put(LaunchPhase.SUNRUSH, TldState.SUNRUSH)
|
||||
.put(LaunchPhase.LANDRUSH, TldState.LANDRUSH)
|
||||
.put(LaunchPhase.CLAIMS, 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. */
|
||||
public static final ImmutableSet<ReservationType> TYPES_ALLOWED_FOR_CREATE_ONLY_IN_SUNRISE =
|
||||
|
@ -146,6 +148,7 @@ public class DomainFlowUtils {
|
|||
Sets.immutableEnumSet(
|
||||
TldState.PREDELEGATION,
|
||||
TldState.QUIET_PERIOD,
|
||||
TldState.START_DATE_SUNRISE,
|
||||
TldState.GENERAL_AVAILABILITY);
|
||||
|
||||
/** Strict validator for ascii lowercase letters, digits, and "-", allowing "." as a separator */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue