Allow claims keys on domain creates during quiet periods (#453)

* Allow claims keys on domain creates during quiet periods

Since we're using TldState.QUIET_PERIOD for the .new LRP (in which only reserved
domains with allocation tokens may be registered), we also need to support
claims keys during this phase. Otherwise, domains that appear in MarksDB will
not be registrable during LRP, even if the correct claims key is provided.

This is based on an error report from a registrar, in which a correct-looking
domain create was failing with the error message "Declared launch extension
phase does not match the current registry phase".
This commit is contained in:
Ben McIlwain 2020-01-23 12:17:14 -05:00 committed by GitHub
parent 16b4d15292
commit 2a29ecc2a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 6 deletions

View file

@ -831,6 +831,36 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
assertClaimsLordn();
}
@Test
public void testSuccess_claimsNoticeInQuietPeriod() throws Exception {
allocationToken =
persistResource(
new AllocationToken.Builder()
.setDomainName("example-one.tld")
.setToken("abcDEF23456")
.setTokenType(SINGLE_USE)
.build());
persistResource(
Registry.get("tld")
.asBuilder()
.setTldStateTransitions(
ImmutableSortedMap.of(
START_OF_TIME,
PREDELEGATION,
DateTime.parse("1999-01-01T00:00:00Z"),
QUIET_PERIOD))
.setReservedLists(persistReservedList("res1", "example-one,RESERVED_FOR_SPECIFIC_USE"))
.build());
clock.setTo(DateTime.parse("2009-08-16T09:00:00.0Z"));
setEppInput("domain_create_allocationtoken_claims.xml");
persistContactsAndHosts();
runFlowAssertResponse(loadFile("domain_create_response_claims.xml"));
assertSuccessfulCreate("tld", ImmutableSet.of(RESERVED), allocationToken);
assertDnsTasksEnqueued("example-one.tld");
assertClaimsLordn();
assertAllocationTokenWasRedeemed("abcDEF23456");
}
@Test
public void testSuccess_noClaimsNotice_forClaimsListName_afterClaimsPeriodEnd() throws Exception {
persistClaimsList(ImmutableMap.of("example", CLAIMS_KEY));
@ -1047,7 +1077,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
.setReservedLists(
persistReservedList("anchor-with-claims", "example-one,RESERVED_FOR_ANCHOR_TENANT"))
.build());
setEppInput("domain_create_anchor_tenant_claims.xml");
setEppInput("domain_create_allocationtoken_claims.xml");
clock.setTo(DateTime.parse("2009-08-16T09:00:00.0Z"));
persistContactsAndHosts();
runFlowAssertResponse(loadFile("domain_create_response_claims.xml"));