Change reserved messages for domains w/ required allocation token (#455)

* Change reserved messages for domains w/ required allocation token

In domain check reasons for unavailable domains, we were previously saying that
domains were "Reserved" regardless of whether the domain was fully blocked or
reserved for an anchor tenant or other specific use (e.g. the .new Limited
Release Program). This commit changes the message for the latter situations to
be "Allocation token required", so that registrars have a hint that domain will
show as available if the correct allocation token is supplied to the domain
check command using the allocation token extension.
This commit is contained in:
Ben McIlwain 2020-01-23 14:48:36 -05:00 committed by GitHub
parent f5f5f1eee9
commit ae17b0fc6b
3 changed files with 25 additions and 10 deletions

View file

@ -38,10 +38,10 @@ public enum ReservationType {
ALLOWED_IN_SUNRISE("Reserved", 0),
/** The domain can only be registered by providing a specific token. */
RESERVED_FOR_SPECIFIC_USE("Reserved", 1),
RESERVED_FOR_SPECIFIC_USE("Allocation token required", 1),
/** The domain is for an anchor tenant and can only be registered using a specific token. */
RESERVED_FOR_ANCHOR_TENANT("Reserved", 2),
RESERVED_FOR_ANCHOR_TENANT("Allocation token required", 2),
/**
* The domain can only be registered during sunrise for defensive purposes, and will never

View file

@ -72,7 +72,10 @@ public class CheckApiActionTest {
.asBuilder()
.setReservedLists(
persistReservedList(
"example-reserved", "foo,FULLY_BLOCKED", "gold,RESERVED_FOR_SPECIFIC_USE"))
"example-reserved",
"foo,FULLY_BLOCKED",
"gold,RESERVED_FOR_SPECIFIC_USE",
"platinum,FULLY_BLOCKED"))
.build());
}
@ -258,7 +261,7 @@ public class CheckApiActionTest {
@Test
public void testSuccess_reserved_premium() {
assertThat(getCheckResponse("gold.example"))
assertThat(getCheckResponse("platinum.example"))
.containsExactly(
"tier", "premium",
"status", "success",
@ -268,6 +271,18 @@ public class CheckApiActionTest {
verifySuccessMetric(PREMIUM, RESERVED);
}
@Test
public void testSuccess_reservedForSpecificUse_premium() {
assertThat(getCheckResponse("gold.example"))
.containsExactly(
"tier", "premium",
"status", "success",
"available", false,
"reason", "Allocation token required");
verifySuccessMetric(PREMIUM, RESERVED);
}
private void verifySuccessMetric(Tier tier, Availability availability) {
verify(checkApiMetrics).incrementCheckApiRequest(metricCaptor.capture());
CheckApiMetric metric = metricCaptor.getValue();

View file

@ -141,7 +141,7 @@ public class DomainCheckFlowTest extends ResourceCheckFlowTestCase<DomainCheckFl
create(false, "example1.tld", "In use"),
create(false, "example2.tld", "The allocation token is invalid"),
create(false, "reserved.tld", "Reserved"),
create(false, "specificuse.tld", "Reserved"));
create(false, "specificuse.tld", "Allocation token required"));
}
@Test
@ -154,7 +154,7 @@ public class DomainCheckFlowTest extends ResourceCheckFlowTestCase<DomainCheckFl
create(false, "example1.tld", "In use"),
create(true, "example2.tld", null),
create(false, "reserved.tld", "Reserved"),
create(false, "specificuse.tld", "Reserved"));
create(false, "specificuse.tld", "Allocation token required"));
}
@Test
@ -171,7 +171,7 @@ public class DomainCheckFlowTest extends ResourceCheckFlowTestCase<DomainCheckFl
create(false, "example1.tld", "In use"),
create(false, "example2.tld", "Alloc token was already redeemed"),
create(false, "reserved.tld", "Reserved"),
create(false, "specificuse.tld", "Reserved"));
create(false, "specificuse.tld", "Allocation token required"));
}
@Test
@ -205,7 +205,7 @@ public class DomainCheckFlowTest extends ResourceCheckFlowTestCase<DomainCheckFl
create(false, "example1.tld", "In use"),
create(true, "example2.tld", null),
create(false, "reserved.tld", "Reserved"),
create(false, "specificuse.tld", "Reserved"));
create(false, "specificuse.tld", "Allocation token required"));
}
@Test
@ -260,7 +260,7 @@ public class DomainCheckFlowTest extends ResourceCheckFlowTestCase<DomainCheckFl
doCheckTest(
create(false, "collision.tld", "Cannot be delegated"),
create(false, "reserved.tld", "Reserved"),
create(false, "anchor.tld", "Reserved"),
create(false, "anchor.tld", "Allocation token required"),
create(false, "allowedinsunrise.tld", "Reserved"),
create(false, "premiumcollision.tld", "Cannot be delegated"));
}
@ -395,7 +395,7 @@ public class DomainCheckFlowTest extends ResourceCheckFlowTestCase<DomainCheckFl
@Test
public void testSuccess_anchorTenantReserved() throws Exception {
setEppInput("domain_check_anchor.xml");
doCheckTest(create(false, "anchor.tld", "Reserved"));
doCheckTest(create(false, "anchor.tld", "Allocation token required"));
}
@Test