mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Make host flows only accept canonicalized host names as input
This now throws errors when a non-lower-cased, non-puny-coded, or non-canonicalized host name is passed in as an input parameter. The approach we'll take is to first notify registrars which hosts we'll be renaming, then issue EPP host update commands to effect those renames as superuser, then push this code live to production. This fixes #38 on GitHub. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=138441130
This commit is contained in:
parent
cbe76e8615
commit
9aa2f3b96e
12 changed files with 215 additions and 8 deletions
|
@ -32,6 +32,9 @@ import google.registry.flows.ResourceFlowTestCase;
|
|||
import google.registry.flows.exceptions.ResourceAlreadyExistsException;
|
||||
import google.registry.flows.host.HostCreateFlow.SubordinateHostMustHaveIpException;
|
||||
import google.registry.flows.host.HostCreateFlow.UnexpectedExternalHostIpException;
|
||||
import google.registry.flows.host.HostFlowUtils.HostNameNotLowerCaseException;
|
||||
import google.registry.flows.host.HostFlowUtils.HostNameNotNormalizedException;
|
||||
import google.registry.flows.host.HostFlowUtils.HostNameNotPunyCodedException;
|
||||
import google.registry.flows.host.HostFlowUtils.HostNameTooLongException;
|
||||
import google.registry.flows.host.HostFlowUtils.HostNameTooShallowException;
|
||||
import google.registry.flows.host.HostFlowUtils.InvalidHostNameException;
|
||||
|
@ -169,6 +172,27 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonLowerCaseHostname() throws Exception {
|
||||
setEppHostCreateInput("ns1.EXAMPLE.tld", null);
|
||||
thrown.expect(HostNameNotLowerCaseException.class);
|
||||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonPunyCodedHostname() throws Exception {
|
||||
setEppHostCreateInput("ns1.çauçalito.みんな", null);
|
||||
thrown.expect(HostNameNotPunyCodedException.class, "expected ns1.xn--aualito-txac.xn--q9jyb4c");
|
||||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonCanonicalHostname() throws Exception {
|
||||
setEppHostCreateInput("ns1.example.tld.", null);
|
||||
thrown.expect(HostNameNotNormalizedException.class);
|
||||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_longHostName() throws Exception {
|
||||
setEppHostCreateInputWithIps("a" + Strings.repeat(".labelpart", 25) + ".tld");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue