Add FlowMetadata (containing isSuperuser) to custom flow logic

This also bypasses signed mark validation during domain creation if
the flow is being executed as superuser.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145435268
This commit is contained in:
Justin Graham 2017-01-24 10:25:28 -08:00 committed by Ben McIlwain
parent d5160213e5
commit f3388326d6
21 changed files with 213 additions and 74 deletions

View file

@ -0,0 +1,38 @@
// Copyright 2016 The Nomulus Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package google.registry.flows;
import com.google.auto.value.AutoValue;
import google.registry.model.ImmutableObject;
/** Object to hold metadata specific to a particular execution of a flow. */
@AutoValue
public abstract class FlowMetadata extends ImmutableObject {
public abstract boolean isSuperuser();
public static Builder newBuilder() {
return new AutoValue_FlowMetadata.Builder();
}
/** Builder for {@link FlowMetadata} */
@AutoValue.Builder
public abstract static class Builder {
public abstract Builder setSuperuser(boolean isSuperuser);
public abstract FlowMetadata build();
}
}

View file

@ -259,6 +259,11 @@ public class FlowModule {
.setResultFromCode(Result.Code.SUCCESS); // Default to success.
}
@Provides
static FlowMetadata provideFlowMetadata(@Superuser boolean isSuperuser) {
return FlowMetadata.newBuilder().setSuperuser(isSuperuser).build();
}
/** Wrapper class to carry an {@link EppException} to the calling code. */
static class EppExceptionInProviderException extends RuntimeException {
EppExceptionInProviderException(EppException exception) {

View file

@ -14,6 +14,7 @@
package google.registry.flows.custom;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.model.eppinput.EppInput;
@ -25,10 +26,13 @@ public abstract class BaseFlowCustomLogic {
private final EppInput eppInput;
private final SessionMetadata sessionMetadata;
private final FlowMetadata flowMetadata;
protected BaseFlowCustomLogic(EppInput eppInput, SessionMetadata sessionMetadata) {
protected BaseFlowCustomLogic(
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
this.eppInput = eppInput;
this.sessionMetadata = sessionMetadata;
this.flowMetadata = flowMetadata;
}
protected EppInput getEppInput() {
@ -38,4 +42,8 @@ public abstract class BaseFlowCustomLogic {
protected SessionMetadata getSessionMetadata() {
return sessionMetadata;
}
protected FlowMetadata getFlowMetadata() {
return flowMetadata;
}
}

View file

@ -15,6 +15,7 @@
package google.registry.flows.custom;
import google.registry.config.RegistryConfig.ConfigModule;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.model.eppinput.EppInput;
@ -32,42 +33,42 @@ import google.registry.model.eppinput.EppInput;
public class CustomLogicFactory {
public DomainApplicationCreateFlowCustomLogic forDomainApplicationCreateFlow(
EppInput eppInput, SessionMetadata sessionMetadata) {
return new DomainApplicationCreateFlowCustomLogic(eppInput, sessionMetadata);
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
return new DomainApplicationCreateFlowCustomLogic(eppInput, sessionMetadata, flowMetadata);
}
public DomainCreateFlowCustomLogic forDomainCreateFlow(
EppInput eppInput, SessionMetadata sessionMetadata) {
return new DomainCreateFlowCustomLogic(eppInput, sessionMetadata);
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
return new DomainCreateFlowCustomLogic(eppInput, sessionMetadata, flowMetadata);
}
public DomainCheckFlowCustomLogic forDomainCheckFlow(
EppInput eppInput, SessionMetadata sessionMetadata) {
return new DomainCheckFlowCustomLogic(eppInput, sessionMetadata);
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
return new DomainCheckFlowCustomLogic(eppInput, sessionMetadata, flowMetadata);
}
public DomainInfoFlowCustomLogic forDomainInfoFlow(
EppInput eppInput, SessionMetadata sessionMetadata) {
return new DomainInfoFlowCustomLogic(eppInput, sessionMetadata);
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
return new DomainInfoFlowCustomLogic(eppInput, sessionMetadata, flowMetadata);
}
public DomainUpdateFlowCustomLogic forDomainUpdateFlow(
EppInput eppInput, SessionMetadata sessionMetadata) {
return new DomainUpdateFlowCustomLogic(eppInput, sessionMetadata);
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
return new DomainUpdateFlowCustomLogic(eppInput, sessionMetadata, flowMetadata);
}
public DomainRenewFlowCustomLogic forDomainRenewFlow(
EppInput eppInput, SessionMetadata sessionMetadata) {
return new DomainRenewFlowCustomLogic(eppInput, sessionMetadata);
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
return new DomainRenewFlowCustomLogic(eppInput, sessionMetadata, flowMetadata);
}
public DomainDeleteFlowCustomLogic forDomainDeleteFlow(
EppInput eppInput, SessionMetadata sessionMetadata) {
return new DomainDeleteFlowCustomLogic(eppInput, sessionMetadata);
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
return new DomainDeleteFlowCustomLogic(eppInput, sessionMetadata, flowMetadata);
}
public DomainPricingCustomLogic forDomainPricing(
EppInput eppInput, SessionMetadata sessionMetadata) {
return new DomainPricingCustomLogic(eppInput, sessionMetadata);
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
return new DomainPricingCustomLogic(eppInput, sessionMetadata, flowMetadata);
}
}

View file

@ -16,6 +16,7 @@ package google.registry.flows.custom;
import dagger.Module;
import dagger.Provides;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.model.eppinput.EppInput;
@ -25,49 +26,73 @@ public class CustomLogicModule {
@Provides
static DomainApplicationCreateFlowCustomLogic provideDomainApplicationCreateFlowCustomLogic(
CustomLogicFactory factory, EppInput eppInput, SessionMetadata sessionMetadata) {
return factory.forDomainApplicationCreateFlow(eppInput, sessionMetadata);
CustomLogicFactory factory,
EppInput eppInput,
SessionMetadata sessionMetadata,
FlowMetadata flowMetadata) {
return factory.forDomainApplicationCreateFlow(eppInput, sessionMetadata, flowMetadata);
}
@Provides
static DomainCreateFlowCustomLogic provideDomainCreateFlowCustomLogic(
CustomLogicFactory factory, EppInput eppInput, SessionMetadata sessionMetadata) {
return factory.forDomainCreateFlow(eppInput, sessionMetadata);
CustomLogicFactory factory,
EppInput eppInput,
SessionMetadata sessionMetadata,
FlowMetadata flowMetadata) {
return factory.forDomainCreateFlow(eppInput, sessionMetadata, flowMetadata);
}
@Provides
static DomainCheckFlowCustomLogic provideDomainCheckFlowCustomLogic(
CustomLogicFactory factory, EppInput eppInput, SessionMetadata sessionMetadata) {
return factory.forDomainCheckFlow(eppInput, sessionMetadata);
CustomLogicFactory factory,
EppInput eppInput,
SessionMetadata sessionMetadata,
FlowMetadata flowMetadata) {
return factory.forDomainCheckFlow(eppInput, sessionMetadata, flowMetadata);
}
@Provides
static DomainInfoFlowCustomLogic provideDomainInfoFlowCustomLogic(
CustomLogicFactory factory, EppInput eppInput, SessionMetadata sessionMetadata) {
return factory.forDomainInfoFlow(eppInput, sessionMetadata);
CustomLogicFactory factory,
EppInput eppInput,
SessionMetadata sessionMetadata,
FlowMetadata flowMetadata) {
return factory.forDomainInfoFlow(eppInput, sessionMetadata, flowMetadata);
}
@Provides
static DomainUpdateFlowCustomLogic provideDomainUpdateFlowCustomLogic(
CustomLogicFactory factory, EppInput eppInput, SessionMetadata sessionMetadata) {
return factory.forDomainUpdateFlow(eppInput, sessionMetadata);
CustomLogicFactory factory,
EppInput eppInput,
SessionMetadata sessionMetadata,
FlowMetadata flowMetadata) {
return factory.forDomainUpdateFlow(eppInput, sessionMetadata, flowMetadata);
}
@Provides
static DomainRenewFlowCustomLogic provideDomainRenewFlowCustomLogic(
CustomLogicFactory factory, EppInput eppInput, SessionMetadata sessionMetadata) {
return factory.forDomainRenewFlow(eppInput, sessionMetadata);
CustomLogicFactory factory,
EppInput eppInput,
SessionMetadata sessionMetadata,
FlowMetadata flowMetadata) {
return factory.forDomainRenewFlow(eppInput, sessionMetadata, flowMetadata);
}
@Provides
static DomainDeleteFlowCustomLogic provideDomainDeleteFlowCustomLogic(
CustomLogicFactory factory, EppInput eppInput, SessionMetadata sessionMetadata) {
return factory.forDomainDeleteFlow(eppInput, sessionMetadata);
CustomLogicFactory factory,
EppInput eppInput,
SessionMetadata sessionMetadata,
FlowMetadata flowMetadata) {
return factory.forDomainDeleteFlow(eppInput, sessionMetadata, flowMetadata);
}
@Provides
static DomainPricingCustomLogic provideDomainPricingCustomLogic(
CustomLogicFactory factory, EppInput eppInput, SessionMetadata sessionMetadata) {
return factory.forDomainPricing(eppInput, sessionMetadata);
CustomLogicFactory factory,
EppInput eppInput,
SessionMetadata sessionMetadata,
FlowMetadata flowMetadata) {
return factory.forDomainPricing(eppInput, sessionMetadata, flowMetadata);
}
}

View file

@ -18,6 +18,7 @@ import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
import com.google.common.net.InternetDomainName;
import google.registry.flows.EppException;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.flows.domain.DomainApplicationCreateFlow;
import google.registry.model.ImmutableObject;
@ -35,8 +36,8 @@ import google.registry.model.reporting.HistoryEntry;
public class DomainApplicationCreateFlowCustomLogic extends BaseFlowCustomLogic {
protected DomainApplicationCreateFlowCustomLogic(
EppInput eppInput, SessionMetadata sessionMetadata) {
super(eppInput, sessionMetadata);
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
super(eppInput, sessionMetadata, flowMetadata);
}
/** A hook that runs before any validation. This is useful to e.g. add allowable extensions. */

View file

@ -19,6 +19,7 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.net.InternetDomainName;
import google.registry.flows.EppException;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.flows.domain.DomainCheckFlow;
import google.registry.model.ImmutableObject;
@ -34,13 +35,12 @@ import org.joda.time.DateTime;
*/
public class DomainCheckFlowCustomLogic extends BaseFlowCustomLogic {
protected DomainCheckFlowCustomLogic(EppInput eppInput, SessionMetadata sessionMetadata) {
super(eppInput, sessionMetadata);
protected DomainCheckFlowCustomLogic(
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
super(eppInput, sessionMetadata, flowMetadata);
}
/**
* A hook that runs before any validation. This is useful to e.g. add allowable extensions.
*/
/** A hook that runs before any validation. This is useful to e.g. add allowable extensions. */
@SuppressWarnings("unused")
public void beforeValidation() throws EppException {
// Do nothing.

View file

@ -19,6 +19,7 @@ import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import com.google.common.net.InternetDomainName;
import google.registry.flows.EppException;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.flows.domain.DomainCreateFlow;
import google.registry.model.ImmutableObject;
@ -35,8 +36,9 @@ import google.registry.model.reporting.HistoryEntry;
*/
public class DomainCreateFlowCustomLogic extends BaseFlowCustomLogic {
protected DomainCreateFlowCustomLogic(EppInput eppInput, SessionMetadata sessionMetadata) {
super(eppInput, sessionMetadata);
protected DomainCreateFlowCustomLogic(
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
super(eppInput, sessionMetadata, flowMetadata);
}
/** A hook that runs before any validation. This is useful to e.g. add allowable extensions. */

View file

@ -17,6 +17,7 @@ package google.registry.flows.custom;
import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
import google.registry.flows.EppException;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.flows.domain.DomainDeleteFlow;
import google.registry.model.ImmutableObject;
@ -33,8 +34,9 @@ import google.registry.model.reporting.HistoryEntry;
*/
public class DomainDeleteFlowCustomLogic extends BaseFlowCustomLogic {
protected DomainDeleteFlowCustomLogic(EppInput eppInput, SessionMetadata sessionMetadata) {
super(eppInput, sessionMetadata);
protected DomainDeleteFlowCustomLogic(
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
super(eppInput, sessionMetadata, flowMetadata);
}
/** A hook that runs before any validation. This is useful to e.g. add allowable extensions. */
@ -65,10 +67,9 @@ public class DomainDeleteFlowCustomLogic extends BaseFlowCustomLogic {
/**
* A hook that runs before the response is returned.
*
* <p>This takes the {@link Result.Code} and {@link ResponseExtension}s as input and returns
* them, potentially with modifications.
* <p>This takes the {@link Result.Code} and {@link ResponseExtension}s as input and returns them,
* potentially with modifications.
*/
@SuppressWarnings("unused")
public BeforeResponseReturnData beforeResponse(BeforeResponseParameters parameters)
throws EppException {
@ -114,7 +115,6 @@ public class DomainDeleteFlowCustomLogic extends BaseFlowCustomLogic {
public abstract HistoryEntry historyEntry();
public abstract EntityChanges entityChanges();
public static Builder newBuilder() {

View file

@ -17,6 +17,7 @@ package google.registry.flows.custom;
import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
import google.registry.flows.EppException;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.flows.domain.DomainInfoFlow;
import google.registry.model.ImmutableObject;
@ -31,8 +32,9 @@ import google.registry.model.eppoutput.EppResponse.ResponseExtension;
*/
public class DomainInfoFlowCustomLogic extends BaseFlowCustomLogic {
protected DomainInfoFlowCustomLogic(EppInput eppInput, SessionMetadata sessionMetadata) {
super(eppInput, sessionMetadata);
protected DomainInfoFlowCustomLogic(
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
super(eppInput, sessionMetadata, flowMetadata);
}
/** A hook that runs before any validation. This is useful to e.g. add allowable extensions. */

View file

@ -17,6 +17,7 @@ package google.registry.flows.custom;
import com.google.auto.value.AutoValue;
import com.google.common.net.InternetDomainName;
import google.registry.flows.EppException;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.flows.domain.DomainPricingLogic;
import google.registry.flows.domain.FeesAndCredits;
@ -33,8 +34,9 @@ import org.joda.time.DateTime;
*/
public class DomainPricingCustomLogic extends BaseFlowCustomLogic {
protected DomainPricingCustomLogic(EppInput eppInput, SessionMetadata sessionMetadata) {
super(eppInput, sessionMetadata);
protected DomainPricingCustomLogic(
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
super(eppInput, sessionMetadata, flowMetadata);
}
/** A hook that customizes the application update price. */

View file

@ -17,6 +17,7 @@ package google.registry.flows.custom;
import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
import google.registry.flows.EppException;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.flows.domain.DomainRenewFlow;
import google.registry.model.ImmutableObject;
@ -34,8 +35,9 @@ import org.joda.time.DateTime;
*/
public class DomainRenewFlowCustomLogic extends BaseFlowCustomLogic {
protected DomainRenewFlowCustomLogic(EppInput eppInput, SessionMetadata sessionMetadata) {
super(eppInput, sessionMetadata);
protected DomainRenewFlowCustomLogic(
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
super(eppInput, sessionMetadata, flowMetadata);
}
/** A hook that runs before any validation. This is useful to e.g. add allowable extensions. */

View file

@ -16,6 +16,7 @@ package google.registry.flows.custom;
import com.google.auto.value.AutoValue;
import google.registry.flows.EppException;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.flows.domain.DomainUpdateFlow;
import google.registry.model.ImmutableObject;
@ -30,8 +31,9 @@ import google.registry.model.reporting.HistoryEntry;
*/
public class DomainUpdateFlowCustomLogic extends BaseFlowCustomLogic {
protected DomainUpdateFlowCustomLogic(EppInput eppInput, SessionMetadata sessionMetadata) {
super(eppInput, sessionMetadata);
protected DomainUpdateFlowCustomLogic(
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
super(eppInput, sessionMetadata, flowMetadata);
}
/** A hook that runs before any validation. This is useful to e.g. add allowable extensions. */
@ -95,7 +97,6 @@ public class DomainUpdateFlowCustomLogic extends BaseFlowCustomLogic {
public abstract HistoryEntry historyEntry();
public abstract EntityChanges entityChanges();
public static Builder newBuilder() {

View file

@ -201,6 +201,7 @@ public class DomainCreateFlow implements TransactionalFlow {
validateLaunchCreateNotice(launchCreate.getNotice(), domainLabel, isSuperuser, now);
}
boolean isSunriseCreate = hasSignedMarks && SUNRISE_STATES.contains(tldState);
String signedMarkId = null;
// Superusers can create reserved domains, force creations on domains that require a claims
// notice without specifying a claims key, ignore the registry phase, and override blocks on
// registering premium domains.
@ -221,12 +222,12 @@ public class DomainCreateFlow implements TransactionalFlow {
verifyPremiumNameIsNotBlocked(targetId, now, clientId);
verifyNoOpenApplications(now);
verifyIsGaOrIsSpecialCase(tldState, isAnchorTenant);
}
String signedMarkId = hasSignedMarks
signedMarkId = 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.
? tmchUtils.verifySignedMarks(launchCreate.getSignedMarks(), domainLabel, now).getId()
: null;
}
customLogic.afterValidation(
DomainCreateFlowCustomLogic.AfterValidationParameters.newBuilder()
.setDomainName(domainName)

View file

@ -308,6 +308,11 @@ public abstract class FlowTestCase<F extends Flow> extends ShardableTestCase {
return runFlow(CommitMode.LIVE, UserPrivileges.NORMAL);
}
/** Shortcut to call {@link #runFlow(CommitMode, UserPrivileges)} as super user and live run. */
public EppOutput runFlowAsSuperuser() throws Exception {
return runFlow(CommitMode.LIVE, UserPrivileges.SUPERUSER);
}
/** Run a flow, marshal the result to EPP, and assert that the output is as expected. */
public EppOutput runFlowAssertResponse(
CommitMode commitMode, UserPrivileges userPrivileges, String xml, String... ignoredPaths)

View file

@ -14,6 +14,7 @@
package google.registry.flows.custom;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.model.eppinput.EppInput;
@ -22,13 +23,13 @@ public class TestCustomLogicFactory extends CustomLogicFactory {
@Override
public DomainCreateFlowCustomLogic forDomainCreateFlow(
EppInput eppInput, SessionMetadata sessionMetadata) {
return new TestDomainCreateFlowCustomLogic(eppInput, sessionMetadata);
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
return new TestDomainCreateFlowCustomLogic(eppInput, sessionMetadata, flowMetadata);
}
@Override
public DomainPricingCustomLogic forDomainPricing(
EppInput eppInput, SessionMetadata sessionMetadata) {
return new TestDomainPricingCustomLogic(eppInput, sessionMetadata);
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
return new TestDomainPricingCustomLogic(eppInput, sessionMetadata, flowMetadata);
}
}

View file

@ -17,6 +17,7 @@ package google.registry.flows.custom;
import static google.registry.model.ofy.ObjectifyService.ofy;
import google.registry.flows.EppException;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.model.eppinput.EppInput;
import google.registry.model.poll.PollMessage;
@ -24,8 +25,9 @@ import google.registry.model.poll.PollMessage;
/** A class to customize {@link DomainCreateFlowCustomLogic} for testing. */
public class TestDomainCreateFlowCustomLogic extends DomainCreateFlowCustomLogic {
protected TestDomainCreateFlowCustomLogic(EppInput eppInput, SessionMetadata sessionMetadata) {
super(eppInput, sessionMetadata);
protected TestDomainCreateFlowCustomLogic(
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
super(eppInput, sessionMetadata, flowMetadata);
}
@Override

View file

@ -14,8 +14,8 @@
package google.registry.flows.custom;
import google.registry.flows.EppException;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.flows.domain.DomainPricingLogic;
import google.registry.flows.domain.FeesAndCredits;
@ -32,8 +32,9 @@ public class TestDomainPricingCustomLogic extends DomainPricingCustomLogic {
private static final BigDecimal ONE_HUNDRED_BUCKS = Money.of(CurrencyUnit.USD, 100).getAmount();
protected TestDomainPricingCustomLogic(EppInput eppInput, SessionMetadata sessionMetadata) {
super(eppInput, sessionMetadata);
protected TestDomainPricingCustomLogic(
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
super(eppInput, sessionMetadata, flowMetadata);
}
@Override

View file

@ -213,11 +213,6 @@ public class DomainAllocateFlowTest
}
}
private void runFlowAsSuperuser() throws Exception {
assertTransactionalFlow(true);
runFlow(CommitMode.LIVE, UserPrivileges.SUPERUSER);
}
@Test
public void testSuccess() throws Exception {
setupDomainApplication("tld", TldState.QUIET_PERIOD);

View file

@ -436,6 +436,18 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
assertNoLordn("0000001761376042759136-65535", null);
}
@Test
public void testSuccess_generalAvailability_ignoresEncodedSignedMarkMismatch() throws Exception {
createTld("tld", TldState.GENERAL_AVAILABILITY);
clock.setTo(DateTime.parse("2014-09-09T09:09:09Z"));
setEppInput("domain_create_registration_encoded_signed_mark_mismatched_label.xml");
eppRequestSource = EppRequestSource.TOOL; // Only tools can pass in metadata.
persistContactsAndHosts();
runFlowAsSuperuser();
assertSuccessfulCreate("tld", true);
assertNoLordn();
}
@Test
public void testSuccess_fee_v06() throws Exception {
setEppInput("domain_create_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));

File diff suppressed because one or more lines are too long