Rename ClaimsCheckFlow to DomainClaimsCheckFlow

This way it is consistent with the rest of our domain-related flows, which
consistently use the Domain* prefix. Note that claims checks are just a
special case of domain checks anyway, which run under DomainCheckFlow. This
will make dashboards looking at domain commands "just work" with a regexp of
Domain.*, without having to special-case in ClaimsCheck.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172608964
This commit is contained in:
mcilwain 2017-10-18 09:05:10 -07:00 committed by jianglai
parent 77ee3e3544
commit e62e1af863
5 changed files with 43 additions and 40 deletions

View file

@ -1,26 +1,5 @@
# Nomulus EPP Command API Documentation # Nomulus EPP Command API Documentation
## ClaimsCheckFlow
### Description
An EPP flow that checks whether strings are trademarked.
### Errors
* 2002
* Command is not allowed in the current registry phase.
* Claims checks are not allowed during sunrise.
* 2004
* Domain name is under tld which doesn't exist.
* 2201
* Registrar is not authorized to access this TLD.
* 2304
* The claims period for this TLD has ended.
* 2306
* Too many resource checks requested in one check command.
## ContactCheckFlow ## ContactCheckFlow
### Description ### Description
@ -504,6 +483,27 @@ information.
* By server policy, fee check names must be listed in the availability * By server policy, fee check names must be listed in the availability
check. check.
## DomainClaimsCheckFlow
### Description
An EPP flow that checks whether domain labels are trademarked.
### Errors
* 2002
* Command is not allowed in the current registry phase.
* Claims checks are not allowed during sunrise.
* 2004
* Domain name is under tld which doesn't exist.
* 2201
* Registrar is not authorized to access this TLD.
* 2304
* The claims period for this TLD has ended.
* 2306
* Too many resource checks requested in one check command.
## DomainCreateFlow ## DomainCreateFlow
### Description ### Description

View file

@ -30,13 +30,13 @@ import google.registry.flows.contact.ContactTransferRejectFlow;
import google.registry.flows.contact.ContactTransferRequestFlow; import google.registry.flows.contact.ContactTransferRequestFlow;
import google.registry.flows.contact.ContactUpdateFlow; import google.registry.flows.contact.ContactUpdateFlow;
import google.registry.flows.custom.CustomLogicModule; import google.registry.flows.custom.CustomLogicModule;
import google.registry.flows.domain.ClaimsCheckFlow;
import google.registry.flows.domain.DomainAllocateFlow; import google.registry.flows.domain.DomainAllocateFlow;
import google.registry.flows.domain.DomainApplicationCreateFlow; import google.registry.flows.domain.DomainApplicationCreateFlow;
import google.registry.flows.domain.DomainApplicationDeleteFlow; import google.registry.flows.domain.DomainApplicationDeleteFlow;
import google.registry.flows.domain.DomainApplicationInfoFlow; import google.registry.flows.domain.DomainApplicationInfoFlow;
import google.registry.flows.domain.DomainApplicationUpdateFlow; import google.registry.flows.domain.DomainApplicationUpdateFlow;
import google.registry.flows.domain.DomainCheckFlow; import google.registry.flows.domain.DomainCheckFlow;
import google.registry.flows.domain.DomainClaimsCheckFlow;
import google.registry.flows.domain.DomainCreateFlow; import google.registry.flows.domain.DomainCreateFlow;
import google.registry.flows.domain.DomainDeleteFlow; import google.registry.flows.domain.DomainDeleteFlow;
import google.registry.flows.domain.DomainInfoFlow; import google.registry.flows.domain.DomainInfoFlow;
@ -84,13 +84,13 @@ public interface FlowComponent {
ContactTransferRejectFlow contactTransferRejectFlow(); ContactTransferRejectFlow contactTransferRejectFlow();
ContactTransferRequestFlow contactTransferRequestFlow(); ContactTransferRequestFlow contactTransferRequestFlow();
ContactUpdateFlow contactUpdateFlow(); ContactUpdateFlow contactUpdateFlow();
ClaimsCheckFlow claimsCheckFlow();
DomainAllocateFlow domainAllocateFlow(); DomainAllocateFlow domainAllocateFlow();
DomainApplicationCreateFlow domainApplicationCreateFlow(); DomainApplicationCreateFlow domainApplicationCreateFlow();
DomainApplicationDeleteFlow domainApplicationDeleteFlow(); DomainApplicationDeleteFlow domainApplicationDeleteFlow();
DomainApplicationInfoFlow domainApplicationInfoFlow(); DomainApplicationInfoFlow domainApplicationInfoFlow();
DomainApplicationUpdateFlow domainApplicationUpdateFlow(); DomainApplicationUpdateFlow domainApplicationUpdateFlow();
DomainCheckFlow domainCheckFlow(); DomainCheckFlow domainCheckFlow();
DomainClaimsCheckFlow domainClaimsCheckFlow();
DomainCreateFlow domainCreateFlow(); DomainCreateFlow domainCreateFlow();
DomainDeleteFlow domainDeleteFlow(); DomainDeleteFlow domainDeleteFlow();
DomainInfoFlow domainInfoFlow(); DomainInfoFlow domainInfoFlow();
@ -138,13 +138,13 @@ public interface FlowComponent {
: clazz.equals(ContactTransferRejectFlow.class) ? flows.contactTransferRejectFlow() : clazz.equals(ContactTransferRejectFlow.class) ? flows.contactTransferRejectFlow()
: clazz.equals(ContactTransferRequestFlow.class) ? flows.contactTransferRequestFlow() : clazz.equals(ContactTransferRequestFlow.class) ? flows.contactTransferRequestFlow()
: clazz.equals(ContactUpdateFlow.class) ? flows.contactUpdateFlow() : clazz.equals(ContactUpdateFlow.class) ? flows.contactUpdateFlow()
: clazz.equals(ClaimsCheckFlow.class) ? flows.claimsCheckFlow()
: clazz.equals(DomainAllocateFlow.class) ? flows.domainAllocateFlow() : clazz.equals(DomainAllocateFlow.class) ? flows.domainAllocateFlow()
: clazz.equals(DomainApplicationCreateFlow.class) ? flows.domainApplicationCreateFlow() : clazz.equals(DomainApplicationCreateFlow.class) ? flows.domainApplicationCreateFlow()
: clazz.equals(DomainApplicationDeleteFlow.class) ? flows.domainApplicationDeleteFlow() : clazz.equals(DomainApplicationDeleteFlow.class) ? flows.domainApplicationDeleteFlow()
: clazz.equals(DomainApplicationInfoFlow.class) ? flows.domainApplicationInfoFlow() : clazz.equals(DomainApplicationInfoFlow.class) ? flows.domainApplicationInfoFlow()
: clazz.equals(DomainApplicationUpdateFlow.class) ? flows.domainApplicationUpdateFlow() : clazz.equals(DomainApplicationUpdateFlow.class) ? flows.domainApplicationUpdateFlow()
: clazz.equals(DomainCheckFlow.class) ? flows.domainCheckFlow() : clazz.equals(DomainCheckFlow.class) ? flows.domainCheckFlow()
: clazz.equals(DomainClaimsCheckFlow.class) ? flows.domainClaimsCheckFlow()
: clazz.equals(DomainCreateFlow.class) ? flows.domainCreateFlow() : clazz.equals(DomainCreateFlow.class) ? flows.domainCreateFlow()
: clazz.equals(DomainDeleteFlow.class) ? flows.domainDeleteFlow() : clazz.equals(DomainDeleteFlow.class) ? flows.domainDeleteFlow()
: clazz.equals(DomainInfoFlow.class) ? flows.domainInfoFlow() : clazz.equals(DomainInfoFlow.class) ? flows.domainInfoFlow()

View file

@ -53,17 +53,17 @@ import javax.inject.Inject;
import org.joda.time.DateTime; import org.joda.time.DateTime;
/** /**
* An EPP flow that checks whether strings are trademarked. * An EPP flow that checks whether domain labels are trademarked.
* *
* @error {@link google.registry.flows.exceptions.TooManyResourceChecksException} * @error {@link google.registry.flows.exceptions.TooManyResourceChecksException}
* @error {@link DomainFlowUtils.BadCommandForRegistryPhaseException} * @error {@link DomainFlowUtils.BadCommandForRegistryPhaseException}
* @error {@link DomainFlowUtils.ClaimsPeriodEndedException} * @error {@link DomainFlowUtils.ClaimsPeriodEndedException}
* @error {@link DomainFlowUtils.NotAuthorizedForTldException} * @error {@link DomainFlowUtils.NotAuthorizedForTldException}
* @error {@link DomainFlowUtils.TldDoesNotExistException} * @error {@link DomainFlowUtils.TldDoesNotExistException}
* @error {@link ClaimsCheckNotAllowedInSunrise} * @error {@link DomainClaimsCheckNotAllowedInSunrise}
*/ */
@ReportingSpec(ActivityReportField.DOMAIN_CHECK) // Claims check is a special domain check. @ReportingSpec(ActivityReportField.DOMAIN_CHECK) // Claims check is a special domain check.
public final class ClaimsCheckFlow implements Flow { public final class DomainClaimsCheckFlow implements Flow {
@Inject ExtensionManager extensionManager; @Inject ExtensionManager extensionManager;
@Inject ResourceCommand resourceCommand; @Inject ResourceCommand resourceCommand;
@ -72,7 +72,9 @@ public final class ClaimsCheckFlow implements Flow {
@Inject Clock clock; @Inject Clock clock;
@Inject @Config("maxChecks") int maxChecks; @Inject @Config("maxChecks") int maxChecks;
@Inject EppResponse.Builder responseBuilder; @Inject EppResponse.Builder responseBuilder;
@Inject ClaimsCheckFlow() {}
@Inject
DomainClaimsCheckFlow() {}
@Override @Override
public EppResponse run() throws EppException { public EppResponse run() throws EppException {
@ -95,7 +97,7 @@ public final class ClaimsCheckFlow implements Flow {
DateTime now = clock.nowUtc(); DateTime now = clock.nowUtc();
verifyNotInPredelegation(registry, now); verifyNotInPredelegation(registry, now);
if (registry.getTldState(now) == TldState.SUNRISE) { if (registry.getTldState(now) == TldState.SUNRISE) {
throw new ClaimsCheckNotAllowedInSunrise(); throw new DomainClaimsCheckNotAllowedInSunrise();
} }
verifyClaimsPeriodNotEnded(registry, now); verifyClaimsPeriodNotEnded(registry, now);
} }
@ -111,8 +113,8 @@ public final class ClaimsCheckFlow implements Flow {
} }
/** Claims checks are not allowed during sunrise. */ /** Claims checks are not allowed during sunrise. */
static class ClaimsCheckNotAllowedInSunrise extends CommandUseErrorException { static class DomainClaimsCheckNotAllowedInSunrise extends CommandUseErrorException {
public ClaimsCheckNotAllowedInSunrise() { public DomainClaimsCheckNotAllowedInSunrise() {
super("Claims checks are not allowed during sunrise"); super("Claims checks are not allowed during sunrise");
} }
} }

View file

@ -35,13 +35,13 @@ import google.registry.flows.contact.ContactTransferQueryFlow;
import google.registry.flows.contact.ContactTransferRejectFlow; import google.registry.flows.contact.ContactTransferRejectFlow;
import google.registry.flows.contact.ContactTransferRequestFlow; import google.registry.flows.contact.ContactTransferRequestFlow;
import google.registry.flows.contact.ContactUpdateFlow; import google.registry.flows.contact.ContactUpdateFlow;
import google.registry.flows.domain.ClaimsCheckFlow;
import google.registry.flows.domain.DomainAllocateFlow; import google.registry.flows.domain.DomainAllocateFlow;
import google.registry.flows.domain.DomainApplicationCreateFlow; import google.registry.flows.domain.DomainApplicationCreateFlow;
import google.registry.flows.domain.DomainApplicationDeleteFlow; import google.registry.flows.domain.DomainApplicationDeleteFlow;
import google.registry.flows.domain.DomainApplicationInfoFlow; import google.registry.flows.domain.DomainApplicationInfoFlow;
import google.registry.flows.domain.DomainApplicationUpdateFlow; import google.registry.flows.domain.DomainApplicationUpdateFlow;
import google.registry.flows.domain.DomainCheckFlow; import google.registry.flows.domain.DomainCheckFlow;
import google.registry.flows.domain.DomainClaimsCheckFlow;
import google.registry.flows.domain.DomainCreateFlow; import google.registry.flows.domain.DomainCreateFlow;
import google.registry.flows.domain.DomainDeleteFlow; import google.registry.flows.domain.DomainDeleteFlow;
import google.registry.flows.domain.DomainInfoFlow; import google.registry.flows.domain.DomainInfoFlow;
@ -191,7 +191,7 @@ public class FlowPicker {
} }
if (CheckType.CLAIMS.equals(extension.getCheckType()) if (CheckType.CLAIMS.equals(extension.getCheckType())
&& LaunchPhase.CLAIMS.equals(extension.getPhase())) { && LaunchPhase.CLAIMS.equals(extension.getPhase())) {
return ClaimsCheckFlow.class; return DomainClaimsCheckFlow.class;
} }
return null; return null;
}}; }};

View file

@ -22,7 +22,7 @@ import static google.registry.testing.DatastoreHelper.persistResource;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import google.registry.flows.ResourceFlowTestCase; import google.registry.flows.ResourceFlowTestCase;
import google.registry.flows.domain.ClaimsCheckFlow.ClaimsCheckNotAllowedInSunrise; import google.registry.flows.domain.DomainClaimsCheckFlow.DomainClaimsCheckNotAllowedInSunrise;
import google.registry.flows.domain.DomainFlowUtils.BadCommandForRegistryPhaseException; import google.registry.flows.domain.DomainFlowUtils.BadCommandForRegistryPhaseException;
import google.registry.flows.domain.DomainFlowUtils.ClaimsPeriodEndedException; import google.registry.flows.domain.DomainFlowUtils.ClaimsPeriodEndedException;
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException; import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
@ -34,10 +34,11 @@ import google.registry.model.registry.Registry.TldState;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
/** Unit tests for {@link ClaimsCheckFlow}. */ /** Unit tests for {@link DomainClaimsCheckFlow}. */
public class ClaimsCheckFlowTest extends ResourceFlowTestCase<ClaimsCheckFlow, DomainResource> { public class DomainClaimsCheckFlowTest
extends ResourceFlowTestCase<DomainClaimsCheckFlow, DomainResource> {
public ClaimsCheckFlowTest() { public DomainClaimsCheckFlowTest() {
setEppInput("domain_check_claims.xml"); setEppInput("domain_check_claims.xml");
} }
@ -132,8 +133,8 @@ public class ClaimsCheckFlowTest extends ResourceFlowTestCase<ClaimsCheckFlow, D
.setAllowedTlds(ImmutableSet.<String>of()) .setAllowedTlds(ImmutableSet.<String>of())
.build()); .build());
assertTransactionalFlow(false); assertTransactionalFlow(false);
assertNoHistory(); // Checks don't create a history event. assertNoHistory(); // Checks don't create a history event.
assertNoBillingEvents(); // Checks are always free. assertNoBillingEvents(); // Checks are always free.
runFlowAssertResponse( runFlowAssertResponse(
CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_check_claims_response.xml")); CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_check_claims_response.xml"));
} }
@ -152,7 +153,7 @@ public class ClaimsCheckFlowTest extends ResourceFlowTestCase<ClaimsCheckFlow, D
createTld("tld", TldState.SUNRISE); createTld("tld", TldState.SUNRISE);
persistResource(Registry.get("tld").asBuilder().build()); persistResource(Registry.get("tld").asBuilder().build());
setEppInput("domain_check_claims.xml"); setEppInput("domain_check_claims.xml");
thrown.expect(ClaimsCheckNotAllowedInSunrise.class); thrown.expect(DomainClaimsCheckNotAllowedInSunrise.class);
runFlow(); runFlow();
} }