Skip to content

Commit

Permalink
Delete all Limited Release Program (LRP) code
Browse files Browse the repository at this point in the history
We never used it and don't have any plans to use it going forward. All
conceivable parts of its functionality that we might use going forward have
already been subsumed into allocation tokens, which are a simpler way of
handling the same use case that are also standards-compliant.

Also gets rid of the hideous ANCHOR_ prefix on anchor tenant EPP authcodes
that was only ever necessary because of overloading the authcode for
anchor tenant creation. Going forward it'll be based on allocation tokens,
so there's no risk of conflicts.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209418194
  • Loading branch information
CydeWeys authored and jianglai committed Aug 20, 2018
1 parent f7bc17f commit 7b87ba4
Show file tree
Hide file tree
Showing 34 changed files with 12 additions and 1,601 deletions.
4 changes: 0 additions & 4 deletions docs/flows.md
Expand Up @@ -296,8 +296,6 @@ An EPP flow that creates a new application for a domain resource.
* 2201 * 2201
* Registrar is not authorized to access this TLD. * Registrar is not authorized to access this TLD.
* Registrar must be active in order to create domains or applications. * Registrar must be active in order to create domains or applications.
* 2202
* Invalid limited registration period token.
* 2302 * 2302
* Resource with this id already exists. * Resource with this id already exists.
* This name has already been claimed by a sunrise applicant. * This name has already been claimed by a sunrise applicant.
Expand Down Expand Up @@ -559,8 +557,6 @@ An EPP flow that creates a new domain resource.
* Only a tool can pass a metadata extension. * Only a tool can pass a metadata extension.
* Registrar is not authorized to access this TLD. * Registrar is not authorized to access this TLD.
* Registrar must be active in order to create domains or applications. * Registrar must be active in order to create domains or applications.
* 2202
* Invalid limited registration period token.
* 2302 * 2302
* Resource with this id already exists. * Resource with this id already exists.
* 2303 * 2303
Expand Down
Expand Up @@ -23,7 +23,6 @@
import static google.registry.flows.domain.DomainFlowUtils.cloneAndLinkReferences; import static google.registry.flows.domain.DomainFlowUtils.cloneAndLinkReferences;
import static google.registry.flows.domain.DomainFlowUtils.createFeeCreateResponse; import static google.registry.flows.domain.DomainFlowUtils.createFeeCreateResponse;
import static google.registry.flows.domain.DomainFlowUtils.isAnchorTenant; import static google.registry.flows.domain.DomainFlowUtils.isAnchorTenant;
import static google.registry.flows.domain.DomainFlowUtils.prepareMarkedLrpTokenEntity;
import static google.registry.flows.domain.DomainFlowUtils.validateCreateCommandContactsAndNameservers; import static google.registry.flows.domain.DomainFlowUtils.validateCreateCommandContactsAndNameservers;
import static google.registry.flows.domain.DomainFlowUtils.validateDomainName; import static google.registry.flows.domain.DomainFlowUtils.validateDomainName;
import static google.registry.flows.domain.DomainFlowUtils.validateDomainNameWithIdnTables; import static google.registry.flows.domain.DomainFlowUtils.validateDomainNameWithIdnTables;
Expand Down Expand Up @@ -128,7 +127,6 @@
* @error {@link DomainFlowUtils.FeesMismatchException} * @error {@link DomainFlowUtils.FeesMismatchException}
* @error {@link DomainFlowUtils.FeesRequiredForPremiumNameException} * @error {@link DomainFlowUtils.FeesRequiredForPremiumNameException}
* @error {@link DomainFlowUtils.InvalidIdnDomainLabelException} * @error {@link DomainFlowUtils.InvalidIdnDomainLabelException}
* @error {@link DomainFlowUtils.InvalidLrpTokenException}
* @error {@link DomainFlowUtils.InvalidPunycodeException} * @error {@link DomainFlowUtils.InvalidPunycodeException}
* @error {@link DomainFlowUtils.InvalidTcnIdChecksumException} * @error {@link DomainFlowUtils.InvalidTcnIdChecksumException}
* @error {@link DomainFlowUtils.InvalidTrademarkValidatorException} * @error {@link DomainFlowUtils.InvalidTrademarkValidatorException}
Expand Down Expand Up @@ -277,12 +275,7 @@ public final EppResponse run() throws EppException {
historyEntry, historyEntry,
DomainApplicationIndex.createUpdatedInstance(newApplication), DomainApplicationIndex.createUpdatedInstance(newApplication),
EppResourceIndex.create(Key.create(newApplication))); EppResourceIndex.create(Key.create(newApplication)));
// Anchor tenant registrations override LRP, and landrush applications can skip it.
// If a token is passed in outside of an LRP phase, it is simply ignored (i.e. never redeemed).
if (registry.getLrpPeriod().contains(now) && !isAnchorTenant) {
entitiesToSave.add(
prepareMarkedLrpTokenEntity(authInfo.getPw().getValue(), domainName, historyEntry));
}
EntityChanges entityChanges = EntityChanges entityChanges =
flowCustomLogic.beforeSave( flowCustomLogic.beforeSave(
DomainApplicationCreateFlowCustomLogic.BeforeSaveParameters.newBuilder() DomainApplicationCreateFlowCustomLogic.BeforeSaveParameters.newBuilder()
Expand Down
13 changes: 0 additions & 13 deletions java/google/registry/flows/domain/DomainCreateFlow.java
Expand Up @@ -23,7 +23,6 @@
import static google.registry.flows.domain.DomainFlowUtils.createFeeCreateResponse; import static google.registry.flows.domain.DomainFlowUtils.createFeeCreateResponse;
import static google.registry.flows.domain.DomainFlowUtils.getReservationTypes; import static google.registry.flows.domain.DomainFlowUtils.getReservationTypes;
import static google.registry.flows.domain.DomainFlowUtils.isAnchorTenant; import static google.registry.flows.domain.DomainFlowUtils.isAnchorTenant;
import static google.registry.flows.domain.DomainFlowUtils.prepareMarkedLrpTokenEntity;
import static google.registry.flows.domain.DomainFlowUtils.validateCreateCommandContactsAndNameservers; import static google.registry.flows.domain.DomainFlowUtils.validateCreateCommandContactsAndNameservers;
import static google.registry.flows.domain.DomainFlowUtils.validateDomainAllowedOnCreateRestrictedTld; import static google.registry.flows.domain.DomainFlowUtils.validateDomainAllowedOnCreateRestrictedTld;
import static google.registry.flows.domain.DomainFlowUtils.validateDomainName; import static google.registry.flows.domain.DomainFlowUtils.validateDomainName;
Expand Down Expand Up @@ -159,7 +158,6 @@
* @error {@link DomainFlowUtils.FeesRequiredDuringEarlyAccessProgramException} * @error {@link DomainFlowUtils.FeesRequiredDuringEarlyAccessProgramException}
* @error {@link DomainFlowUtils.FeesRequiredForPremiumNameException} * @error {@link DomainFlowUtils.FeesRequiredForPremiumNameException}
* @error {@link DomainFlowUtils.InvalidIdnDomainLabelException} * @error {@link DomainFlowUtils.InvalidIdnDomainLabelException}
* @error {@link DomainFlowUtils.InvalidLrpTokenException}
* @error {@link DomainFlowUtils.InvalidPunycodeException} * @error {@link DomainFlowUtils.InvalidPunycodeException}
* @error {@link DomainFlowUtils.InvalidTcnIdChecksumException} * @error {@link DomainFlowUtils.InvalidTcnIdChecksumException}
* @error {@link DomainFlowUtils.InvalidTrademarkValidatorException} * @error {@link DomainFlowUtils.InvalidTrademarkValidatorException}
Expand Down Expand Up @@ -371,15 +369,8 @@ public final EppResponse run() throws EppException {
newDomain, newDomain,
ForeignKeyIndex.create(newDomain, newDomain.getDeletionTime()), ForeignKeyIndex.create(newDomain, newDomain.getDeletionTime()),
EppResourceIndex.create(Key.create(newDomain))); EppResourceIndex.create(Key.create(newDomain)));

allocationToken.ifPresent( allocationToken.ifPresent(
t -> entitiesToSave.add(allocationTokenFlowUtils.redeemToken(t, Key.create(historyEntry)))); t -> entitiesToSave.add(allocationTokenFlowUtils.redeemToken(t, Key.create(historyEntry))));
// Anchor tenant registrations override LRP, and landrush applications can skip it.
// If a token is passed in outside of an LRP phase, it is simply ignored (i.e. never redeemed).
if (isLrpCreate(registry, isAnchorTenant, now)) {
entitiesToSave.add(
prepareMarkedLrpTokenEntity(authInfo.getPw().getValue(), domainName, historyEntry));
}
enqueueTasks(newDomain, hasSignedMarks, hasClaimsNotice); enqueueTasks(newDomain, hasSignedMarks, hasClaimsNotice);


EntityChanges entityChanges = EntityChanges entityChanges =
Expand Down Expand Up @@ -596,10 +587,6 @@ private static PollMessage.OneTime createNameCollisionOneTimePollMessage(
.build(); .build();
} }


private boolean isLrpCreate(Registry registry, boolean isAnchorTenant, DateTime now) {
return registry.getLrpPeriod().contains(now) && !isAnchorTenant;
}

private void enqueueTasks( private void enqueueTasks(
DomainResource newDomain, boolean hasSignedMarks, boolean hasClaimsNotice) { DomainResource newDomain, boolean hasSignedMarks, boolean hasClaimsNotice) {
if (newDomain.shouldPublishToDns()) { if (newDomain.shouldPublishToDns()) {
Expand Down
21 changes: 0 additions & 21 deletions java/google/registry/flows/domain/DomainFlowUtils.java
Expand Up @@ -22,7 +22,6 @@
import static com.google.common.collect.Sets.difference; import static com.google.common.collect.Sets.difference;
import static com.google.common.collect.Sets.intersection; import static com.google.common.collect.Sets.intersection;
import static com.google.common.collect.Sets.union; import static com.google.common.collect.Sets.union;
import static google.registry.flows.domain.DomainPricingLogic.getMatchingLrpToken;
import static google.registry.model.domain.DomainResource.MAX_REGISTRATION_YEARS; import static google.registry.model.domain.DomainResource.MAX_REGISTRATION_YEARS;
import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.model.ofy.ObjectifyService.ofy;
import static google.registry.model.registry.Registries.findTldForName; import static google.registry.model.registry.Registries.findTldForName;
Expand Down Expand Up @@ -55,7 +54,6 @@
import google.registry.flows.EppException; import google.registry.flows.EppException;
import google.registry.flows.EppException.AuthorizationErrorException; import google.registry.flows.EppException.AuthorizationErrorException;
import google.registry.flows.EppException.CommandUseErrorException; import google.registry.flows.EppException.CommandUseErrorException;
import google.registry.flows.EppException.InvalidAuthorizationInformationErrorException;
import google.registry.flows.EppException.ObjectDoesNotExistException; import google.registry.flows.EppException.ObjectDoesNotExistException;
import google.registry.flows.EppException.ParameterValuePolicyErrorException; import google.registry.flows.EppException.ParameterValuePolicyErrorException;
import google.registry.flows.EppException.ParameterValueRangeErrorException; import google.registry.flows.EppException.ParameterValueRangeErrorException;
Expand All @@ -80,7 +78,6 @@
import google.registry.model.domain.DomainCommand.Update; import google.registry.model.domain.DomainCommand.Update;
import google.registry.model.domain.DomainResource; import google.registry.model.domain.DomainResource;
import google.registry.model.domain.ForeignKeyedDesignatedContact; import google.registry.model.domain.ForeignKeyedDesignatedContact;
import google.registry.model.domain.LrpTokenEntity;
import google.registry.model.domain.Period; import google.registry.model.domain.Period;
import google.registry.model.domain.fee.BaseFee.FeeType; import google.registry.model.domain.fee.BaseFee.FeeType;
import google.registry.model.domain.fee.Credit; import google.registry.model.domain.fee.Credit;
Expand Down Expand Up @@ -992,17 +989,6 @@ static void verifyClaimsNoticeIfAndOnlyIfNeeded(
} }
} }


/** Create a {@link LrpTokenEntity} object that records this LRP registration. */
static LrpTokenEntity prepareMarkedLrpTokenEntity(
String lrpTokenString, InternetDomainName domainName, HistoryEntry historyEntry)
throws InvalidLrpTokenException {
Optional<LrpTokenEntity> lrpToken = getMatchingLrpToken(lrpTokenString, domainName);
if (!lrpToken.isPresent()) {
throw new InvalidLrpTokenException();
}
return lrpToken.get().asBuilder().setRedemptionHistoryEntry(Key.create(historyEntry)).build();
}

/** Check that there are no code marks, which is a type of mark we don't support. */ /** Check that there are no code marks, which is a type of mark we don't support. */
static void verifyNoCodeMarks(LaunchCreateExtension launchCreate) static void verifyNoCodeMarks(LaunchCreateExtension launchCreate)
throws UnsupportedMarkTypeException { throws UnsupportedMarkTypeException {
Expand Down Expand Up @@ -1587,13 +1573,6 @@ public UnexpectedClaimsNoticeException(String domainName) {
} }
} }


/** Invalid limited registration period token. */
static class InvalidLrpTokenException extends InvalidAuthorizationInformationErrorException {
public InvalidLrpTokenException() {
super("Invalid limited registration period token");
}
}

/** Only encoded signed marks are supported. */ /** Only encoded signed marks are supported. */
static class UnsupportedMarkTypeException extends ParameterValuePolicyErrorException { static class UnsupportedMarkTypeException extends ParameterValuePolicyErrorException {
public UnsupportedMarkTypeException() { public UnsupportedMarkTypeException() {
Expand Down
27 changes: 0 additions & 27 deletions java/google/registry/flows/domain/DomainPricingLogic.java
Expand Up @@ -14,13 +14,11 @@


package google.registry.flows.domain; package google.registry.flows.domain;


import static google.registry.model.ofy.ObjectifyService.ofy;
import static google.registry.pricing.PricingEngineProxy.getDomainCreateCost; import static google.registry.pricing.PricingEngineProxy.getDomainCreateCost;
import static google.registry.pricing.PricingEngineProxy.getDomainFeeClass; import static google.registry.pricing.PricingEngineProxy.getDomainFeeClass;
import static google.registry.pricing.PricingEngineProxy.getDomainRenewCost; import static google.registry.pricing.PricingEngineProxy.getDomainRenewCost;


import com.google.common.net.InternetDomainName; import com.google.common.net.InternetDomainName;
import com.googlecode.objectify.Key;
import google.registry.flows.EppException; import google.registry.flows.EppException;
import google.registry.flows.FlowScope; import google.registry.flows.FlowScope;
import google.registry.flows.custom.DomainPricingCustomLogic; import google.registry.flows.custom.DomainPricingCustomLogic;
Expand All @@ -31,7 +29,6 @@
import google.registry.flows.custom.DomainPricingCustomLogic.TransferPriceParameters; import google.registry.flows.custom.DomainPricingCustomLogic.TransferPriceParameters;
import google.registry.flows.custom.DomainPricingCustomLogic.UpdatePriceParameters; import google.registry.flows.custom.DomainPricingCustomLogic.UpdatePriceParameters;
import google.registry.model.domain.DomainApplication; import google.registry.model.domain.DomainApplication;
import google.registry.model.domain.LrpTokenEntity;
import google.registry.model.domain.fee.BaseFee; import google.registry.model.domain.fee.BaseFee;
import google.registry.model.domain.fee.BaseFee.FeeType; import google.registry.model.domain.fee.BaseFee.FeeType;
import google.registry.model.domain.fee.Fee; import google.registry.model.domain.fee.Fee;
Expand Down Expand Up @@ -186,28 +183,4 @@ public FeesAndCredits getApplicationUpdatePrice(
public Optional<String> getFeeClass(String domainName, DateTime date) { public Optional<String> getFeeClass(String domainName, DateTime date) {
return getDomainFeeClass(domainName, date); return getDomainFeeClass(domainName, date);
} }

/**
* Checks whether an LRP token String maps to a valid {@link LrpTokenEntity} for the domain name's
* TLD, and return that entity (wrapped in an {@link Optional}) if one exists.
*
* <p>This method has no knowledge of whether or not an auth code (interpreted here as an LRP
* token) has already been checked against the reserved list for QLP (anchor tenant), as auth
* codes are used for both types of registrations.
*/
public static Optional<LrpTokenEntity> getMatchingLrpToken(
String lrpToken, InternetDomainName domainName) {
// Note that until the actual per-TLD logic is built out, what's being done here is a basic
// domain-name-to-assignee match.
if (!lrpToken.isEmpty()) {
LrpTokenEntity token = ofy().load().key(Key.create(LrpTokenEntity.class, lrpToken)).now();
if (token != null
&& token.getAssignee().equalsIgnoreCase(domainName.toString())
&& token.getRedemptionHistoryEntry() == null
&& token.getValidTlds().contains(domainName.parent().toString())) {
return Optional.of(token);
}
}
return Optional.empty();
}
} }
2 changes: 0 additions & 2 deletions java/google/registry/model/EntityClasses.java
Expand Up @@ -23,7 +23,6 @@
import google.registry.model.domain.DomainApplication; import google.registry.model.domain.DomainApplication;
import google.registry.model.domain.DomainBase; import google.registry.model.domain.DomainBase;
import google.registry.model.domain.DomainResource; import google.registry.model.domain.DomainResource;
import google.registry.model.domain.LrpTokenEntity;
import google.registry.model.domain.token.AllocationToken; import google.registry.model.domain.token.AllocationToken;
import google.registry.model.host.HostResource; import google.registry.model.host.HostResource;
import google.registry.model.index.DomainApplicationIndex; import google.registry.model.index.DomainApplicationIndex;
Expand Down Expand Up @@ -91,7 +90,6 @@ public final class EntityClasses {
KmsSecret.class, KmsSecret.class,
KmsSecretRevision.class, KmsSecretRevision.class,
Lock.class, Lock.class,
LrpTokenEntity.class,
PollMessage.class, PollMessage.class,
PollMessage.Autorenew.class, PollMessage.Autorenew.class,
PollMessage.OneTime.class, PollMessage.OneTime.class,
Expand Down
130 changes: 0 additions & 130 deletions java/google/registry/model/domain/LrpTokenEntity.java

This file was deleted.

27 changes: 0 additions & 27 deletions java/google/registry/model/registry/Registry.java
Expand Up @@ -68,7 +68,6 @@
import org.joda.money.Money; import org.joda.money.Money;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.Duration; import org.joda.time.Duration;
import org.joda.time.Interval;


/** Persisted per-TLD configuration data. */ /** Persisted per-TLD configuration data. */
@ReportedOn @ReportedOn
Expand Down Expand Up @@ -430,20 +429,6 @@ public ImmutableSet<Key<ReservedList>> getReservedLists() {
/** The end of the claims period (at or after this time, claims no longer applies). */ /** The end of the claims period (at or after this time, claims no longer applies). */
DateTime claimsPeriodEnd = END_OF_TIME; DateTime claimsPeriodEnd = END_OF_TIME;


/**
* The (inclusive) start {@link DateTime} of LRP. This (and lrpPeriodEnd) exist for serialization
* purposes, though everything else that interacts with the LRP period should use getLrpPeriod()
* and setLrpPeriod(), which uses an {@link Interval}.
*/
DateTime lrpPeriodStart;

/**
* The (exclusive) end {@link DateTime} of LRP. This (and lrpPeriodStart) exist for serialization
* purposes, though everything else that interacts with the LRP period should use getLrpPeriod()
* and setLrpPeriod(), which uses an {@link Interval}.
*/
DateTime lrpPeriodEnd;

/** A whitelist of clients allowed to be used on domains on this TLD (ignored if empty). */ /** A whitelist of clients allowed to be used on domains on this TLD (ignored if empty). */
Set<String> allowedRegistrantContactIds; Set<String> allowedRegistrantContactIds;


Expand Down Expand Up @@ -646,12 +631,6 @@ public ImmutableSet<String> getAllowedFullyQualifiedHostNames() {
return nullToEmptyImmutableCopy(allowedFullyQualifiedHostNames); return nullToEmptyImmutableCopy(allowedFullyQualifiedHostNames);
} }


public Interval getLrpPeriod() {
return (lrpPeriodStart == null && lrpPeriodEnd == null)
? new Interval(START_OF_TIME, Duration.ZERO) // An empty duration.
: new Interval(lrpPeriodStart, lrpPeriodEnd);
}

@Override @Override
public Builder asBuilder() { public Builder asBuilder() {
return new Builder(clone(this)); return new Builder(clone(this));
Expand Down Expand Up @@ -920,12 +899,6 @@ public Builder setAllowedFullyQualifiedHostNames(
return this; return this;
} }


public Builder setLrpPeriod(@Nullable Interval lrpPeriod) {
getInstance().lrpPeriodStart = (lrpPeriod == null ? null : lrpPeriod.getStart());
getInstance().lrpPeriodEnd = (lrpPeriod == null ? null : lrpPeriod.getEnd());
return this;
}

@Override @Override
public Registry build() { public Registry build() {
final Registry instance = getInstance(); final Registry instance = getInstance();
Expand Down

0 comments on commit 7b87ba4

Please sign in to comment.