mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
Allow creation of reserved domains using allocation tokens
Unlike anchor tenants, these domains can be registered for any number of years, but only during GA, as third parties cannot register domains pre-GA except through the anchor tenant program. Since this is new functionality, unlike creation of anchor tenants, there is no fallback provided to send codes through the domain authcode; they must be sent using the allocation token extension. And note that, like with anchor tenants, providing the domain-specific allocation token overrides any other reserved types that might apply to that domain. No changes are necessary to the domain application create flow because of the above restriction to GA. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=212310701
This commit is contained in:
parent
9c280f99b1
commit
1b3df82fb3
3 changed files with 35 additions and 5 deletions
|
@ -189,7 +189,8 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
"resdom,RESERVED_FOR_SPECIFIC_USE",
|
||||
"anchor,RESERVED_FOR_ANCHOR_TENANT",
|
||||
"test-and-validate,NAME_COLLISION",
|
||||
"badcrash,NAME_COLLISION"))
|
||||
"badcrash,NAME_COLLISION"),
|
||||
persistReservedList("global-list", "resdom,FULLY_BLOCKED"))
|
||||
.build());
|
||||
persistClaimsList(ImmutableMap.of("example-one", CLAIMS_KEY));
|
||||
}
|
||||
|
@ -1031,6 +1032,25 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
assertClaimsLordn();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_reservedDomain_viaAllocationTokenExtension() throws Exception {
|
||||
AllocationToken token =
|
||||
persistResource(
|
||||
new AllocationToken.Builder().setToken("abc123").setDomainName("resdom.tld").build());
|
||||
// Despite the domain being FULLY_BLOCKED, the non-superuser create succeeds the domain is also
|
||||
// RESERVED_FOR_SPECIFIC_USE and the correct allocation token is passed.
|
||||
setEppInput("domain_create_allocationtoken.xml", ImmutableMap.of("DOMAIN", "resdom.tld"));
|
||||
persistContactsAndHosts();
|
||||
runFlowAssertResponse(
|
||||
loadFile("domain_create_response.xml", ImmutableMap.of("DOMAIN", "resdom.tld")));
|
||||
assertSuccessfulCreate("tld", ImmutableSet.of());
|
||||
assertNoLordn();
|
||||
AllocationToken reloadedToken = ofy().load().entity(token).now();
|
||||
assertThat(reloadedToken.isRedeemed()).isTrue();
|
||||
assertThat(reloadedToken.getRedemptionHistoryEntry())
|
||||
.isEqualTo(Key.create(getHistoryEntries(reloadResourceByForeignKey()).get(0)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_superuserReserved() throws Exception {
|
||||
setEppInput("domain_create_reserved.xml");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue