Permalink
Browse files

Delete all Limited Release Program (LRP) code

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 7b87ba41c74b70de990933f8a08e19e725becaae
Showing with 12 additions and 1,601 deletions.
  1. +0 −4 docs/flows.md
  2. +1 −8 java/google/registry/flows/domain/DomainApplicationCreateFlow.java
  3. +0 −13 java/google/registry/flows/domain/DomainCreateFlow.java
  4. +0 −21 java/google/registry/flows/domain/DomainFlowUtils.java
  5. +0 −27 java/google/registry/flows/domain/DomainPricingLogic.java
  6. +0 −2 java/google/registry/model/EntityClasses.java
  7. +0 −130 java/google/registry/model/domain/LrpTokenEntity.java
  8. +0 −27 java/google/registry/model/registry/Registry.java
  9. +2 −3 java/google/registry/tools/CreateAnchorTenantCommand.java
  10. +0 −202 java/google/registry/tools/CreateLrpTokensCommand.java
  11. +0 −12 java/google/registry/tools/CreateOrUpdateTldCommand.java
  12. +2 −1 java/google/registry/tools/GenerateAllocationTokensCommand.java
  13. +0 −79 java/google/registry/tools/GetLrpTokenCommand.java
  14. +0 −2 java/google/registry/tools/RegistryTool.java
  15. +0 −1 java/google/registry/tools/RegistryToolComponent.java
  16. +2 −0 java/google/registry/util/StringGenerator.java
  17. +0 −71 java/google/registry/util/TokenUtils.java
  18. +0 −1 javatests/google/registry/export/backup_kinds.txt
  19. +0 −1 javatests/google/registry/export/reporting_kinds.txt
  20. +0 −179 javatests/google/registry/flows/domain/DomainApplicationCreateFlowTest.java
  21. +0 −151 javatests/google/registry/flows/domain/DomainCreateFlowTest.java
  22. +0 −28 javatests/google/registry/flows/domain/testdata/domain_create_landrush_lrp.xml
  23. +0 −22 javatests/google/registry/flows/domain/testdata/domain_create_lrp.xml
  24. +0 −89 javatests/google/registry/model/domain/LrpTokenEntityTest.java
  25. +0 −10 javatests/google/registry/model/testdata/schema.txt
  26. +0 −335 javatests/google/registry/tools/CreateLrpTokensCommandTest.java
  27. +0 −44 javatests/google/registry/tools/CreateTldCommandTest.java
  28. +0 −90 javatests/google/registry/tools/GetLrpTokenCommandTest.java
  29. +0 −43 javatests/google/registry/tools/UpdateTldCommandTest.java
  30. +1 −1 javatests/google/registry/tools/server/testdata/domain_create_anchor_tenant.xml
  31. +1 −1 javatests/google/registry/tools/server/testdata/domain_create_anchor_tenant_fee_premium.xml
  32. +1 −1 javatests/google/registry/tools/server/testdata/domain_create_anchor_tenant_fee_standard.xml
  33. +1 −1 javatests/google/registry/tools/server/testdata/domain_create_anchor_tenant_multiple_word_reason.xml
  34. +1 −1 javatests/google/registry/tools/server/testdata/domain_create_anchor_tenant_no_reason.xml
View
@@ -296,8 +296,6 @@ An EPP flow that creates a new application for a domain resource.
* 2201
* Registrar is not authorized to access this TLD.
* Registrar must be active in order to create domains or applications.
* 2202
* Invalid limited registration period token.
* 2302
* Resource with this id already exists.
* This name has already been claimed by a sunrise applicant.
@@ -559,8 +557,6 @@ An EPP flow that creates a new domain resource.
* Only a tool can pass a metadata extension.
* Registrar is not authorized to access this TLD.
* Registrar must be active in order to create domains or applications.
* 2202
* Invalid limited registration period token.
* 2302
* Resource with this id already exists.
* 2303
@@ -23,7 +23,6 @@
import static google.registry.flows.domain.DomainFlowUtils.cloneAndLinkReferences;
import static google.registry.flows.domain.DomainFlowUtils.createFeeCreateResponse;
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.validateDomainName;
import static google.registry.flows.domain.DomainFlowUtils.validateDomainNameWithIdnTables;
@@ -128,7 +127,6 @@
* @error {@link DomainFlowUtils.FeesMismatchException}
* @error {@link DomainFlowUtils.FeesRequiredForPremiumNameException}
* @error {@link DomainFlowUtils.InvalidIdnDomainLabelException}
* @error {@link DomainFlowUtils.InvalidLrpTokenException}
* @error {@link DomainFlowUtils.InvalidPunycodeException}
* @error {@link DomainFlowUtils.InvalidTcnIdChecksumException}
* @error {@link DomainFlowUtils.InvalidTrademarkValidatorException}
@@ -277,12 +275,7 @@ public final EppResponse run() throws EppException {
historyEntry,
DomainApplicationIndex.createUpdatedInstance(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 =
flowCustomLogic.beforeSave(
DomainApplicationCreateFlowCustomLogic.BeforeSaveParameters.newBuilder()
@@ -23,7 +23,6 @@
import static google.registry.flows.domain.DomainFlowUtils.createFeeCreateResponse;
import static google.registry.flows.domain.DomainFlowUtils.getReservationTypes;
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.validateDomainAllowedOnCreateRestrictedTld;
import static google.registry.flows.domain.DomainFlowUtils.validateDomainName;
@@ -159,7 +158,6 @@
* @error {@link DomainFlowUtils.FeesRequiredDuringEarlyAccessProgramException}
* @error {@link DomainFlowUtils.FeesRequiredForPremiumNameException}
* @error {@link DomainFlowUtils.InvalidIdnDomainLabelException}
* @error {@link DomainFlowUtils.InvalidLrpTokenException}
* @error {@link DomainFlowUtils.InvalidPunycodeException}
* @error {@link DomainFlowUtils.InvalidTcnIdChecksumException}
* @error {@link DomainFlowUtils.InvalidTrademarkValidatorException}
@@ -371,15 +369,8 @@ public final EppResponse run() throws EppException {
newDomain,
ForeignKeyIndex.create(newDomain, newDomain.getDeletionTime()),
EppResourceIndex.create(Key.create(newDomain)));
allocationToken.ifPresent(
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);
EntityChanges entityChanges =
@@ -596,10 +587,6 @@ private Autorenew createAutorenewPollMessage(
.build();
}
private boolean isLrpCreate(Registry registry, boolean isAnchorTenant, DateTime now) {
return registry.getLrpPeriod().contains(now) && !isAnchorTenant;
}
private void enqueueTasks(
DomainResource newDomain, boolean hasSignedMarks, boolean hasClaimsNotice) {
if (newDomain.shouldPublishToDns()) {
@@ -22,7 +22,6 @@
import static com.google.common.collect.Sets.difference;
import static com.google.common.collect.Sets.intersection;
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.ofy.ObjectifyService.ofy;
import static google.registry.model.registry.Registries.findTldForName;
@@ -55,7 +54,6 @@
import google.registry.flows.EppException;
import google.registry.flows.EppException.AuthorizationErrorException;
import google.registry.flows.EppException.CommandUseErrorException;
import google.registry.flows.EppException.InvalidAuthorizationInformationErrorException;
import google.registry.flows.EppException.ObjectDoesNotExistException;
import google.registry.flows.EppException.ParameterValuePolicyErrorException;
import google.registry.flows.EppException.ParameterValueRangeErrorException;
@@ -80,7 +78,6 @@
import google.registry.model.domain.DomainCommand.Update;
import google.registry.model.domain.DomainResource;
import google.registry.model.domain.ForeignKeyedDesignatedContact;
import google.registry.model.domain.LrpTokenEntity;
import google.registry.model.domain.Period;
import google.registry.model.domain.fee.BaseFee.FeeType;
import google.registry.model.domain.fee.Credit;
@@ -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. */
static void verifyNoCodeMarks(LaunchCreateExtension launchCreate)
throws UnsupportedMarkTypeException {
@@ -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. */
static class UnsupportedMarkTypeException extends ParameterValuePolicyErrorException {
public UnsupportedMarkTypeException() {
@@ -14,13 +14,11 @@
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.getDomainFeeClass;
import static google.registry.pricing.PricingEngineProxy.getDomainRenewCost;
import com.google.common.net.InternetDomainName;
import com.googlecode.objectify.Key;
import google.registry.flows.EppException;
import google.registry.flows.FlowScope;
import google.registry.flows.custom.DomainPricingCustomLogic;
@@ -31,7 +29,6 @@
import google.registry.flows.custom.DomainPricingCustomLogic.TransferPriceParameters;
import google.registry.flows.custom.DomainPricingCustomLogic.UpdatePriceParameters;
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.FeeType;
import google.registry.model.domain.fee.Fee;
@@ -186,28 +183,4 @@ public FeesAndCredits getApplicationUpdatePrice(
public Optional<String> getFeeClass(String domainName, DateTime 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();
}
}
@@ -23,7 +23,6 @@
import google.registry.model.domain.DomainApplication;
import google.registry.model.domain.DomainBase;
import google.registry.model.domain.DomainResource;
import google.registry.model.domain.LrpTokenEntity;
import google.registry.model.domain.token.AllocationToken;
import google.registry.model.host.HostResource;
import google.registry.model.index.DomainApplicationIndex;
@@ -91,7 +90,6 @@
KmsSecret.class,
KmsSecretRevision.class,
Lock.class,
LrpTokenEntity.class,
PollMessage.class,
PollMessage.Autorenew.class,
PollMessage.OneTime.class,

This file was deleted.

Oops, something went wrong.
@@ -68,7 +68,6 @@
import org.joda.money.Money;
import org.joda.time.DateTime;
import org.joda.time.Duration;
import org.joda.time.Interval;
/** Persisted per-TLD configuration data. */
@ReportedOn
@@ -430,20 +429,6 @@ void setDefaultNumDnsPublishLocks() {
/** The end of the claims period (at or after this time, claims no longer applies). */
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). */
Set<String> allowedRegistrantContactIds;
@@ -646,12 +631,6 @@ public int getNumDnsPublishLocks() {
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
public Builder asBuilder() {
return new Builder(clone(this));
@@ -920,12 +899,6 @@ public Builder setAllowedFullyQualifiedHostNames(
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
public Registry build() {
final Registry instance = getInstance();
Oops, something went wrong.

0 comments on commit 7b87ba4

Please sign in to comment.