diff --git a/docs/flows.md b/docs/flows.md index d1f4e14e6..296a34912 100644 --- a/docs/flows.md +++ b/docs/flows.md @@ -641,6 +641,8 @@ An EPP flow that creates a new domain resource. * 2201 * Only a tool can pass a metadata extension. * Registrar is not authorized to access this TLD. +* 2202 + * Invalid limited registration period token. * 2302 * Resource with this id already exists. * 2303 diff --git a/java/google/registry/flows/domain/DomainCreateFlow.java b/java/google/registry/flows/domain/DomainCreateFlow.java index db0de9fe5..6b7fd80c7 100644 --- a/java/google/registry/flows/domain/DomainCreateFlow.java +++ b/java/google/registry/flows/domain/DomainCreateFlow.java @@ -118,6 +118,7 @@ import org.joda.time.DateTime; * @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} @@ -267,6 +268,7 @@ public class DomainCreateFlow extends LoggedInFlow implements TransactionalFlow ForeignKeyIndex.create(newDomain, newDomain.getDeletionTime()), EppResourceIndex.create(Key.create(newDomain))); // 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 (hasLrpToken(registry, isAnchorTenant)) { // TODO(b/32059212): This is a bug: empty tokens should still fail. Preserving to fix in a // separate targeted change. diff --git a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java index 990f98d6b..2037f0e2c 100644 --- a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java @@ -75,6 +75,7 @@ import google.registry.flows.domain.DomainFlowUtils.ExpiredClaimException; import google.registry.flows.domain.DomainFlowUtils.FeesMismatchException; import google.registry.flows.domain.DomainFlowUtils.FeesRequiredForPremiumNameException; import google.registry.flows.domain.DomainFlowUtils.InvalidIdnDomainLabelException; +import google.registry.flows.domain.DomainFlowUtils.InvalidLrpTokenException; import google.registry.flows.domain.DomainFlowUtils.InvalidPunycodeException; import google.registry.flows.domain.DomainFlowUtils.InvalidTcnIdChecksumException; import google.registry.flows.domain.DomainFlowUtils.InvalidTrademarkValidatorException; @@ -126,6 +127,7 @@ import org.joda.money.CurrencyUnit; import org.joda.money.Money; import org.joda.time.DateTime; import org.joda.time.Duration; +import org.joda.time.Interval; import org.junit.Before; import org.junit.Test; @@ -359,6 +361,57 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase + + + + example.tld + 2 + + ns1.example.net + ns2.example.net + + jd1234 + sh8013 + sh8013 + + lrptokentest + + + + ABC-12345 + +