mirror of
https://github.com/google/nomulus
synced 2026-09-20 06:54:43 +00:00
Add validation to ROID suffixes
I could've sworn we were already doing this, but apparently not? Anyway,
ROID suffixes have a number of requirements on them that weren't being
enforced, so this enforces them. All existing production data is compliant
with these requirements; the only existing bad data we have is in alpha and
sandbox.
ROID suffixes are now required to match the regex ^[A-Z0-9_]{1,8}$
See also https://tools.ietf.org/html/rfc5730
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173400001
This commit is contained in:
@@ -16,7 +16,6 @@ package google.registry.tools;
|
||||
|
||||
import static com.google.common.collect.Iterables.transform;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.model.registry.label.ReservedListTest.GET_NAME_FUNCTION;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.persistPremiumList;
|
||||
@@ -78,13 +77,13 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
||||
@Test
|
||||
public void testFailure_multipleArguments() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class, "Can't create more than one TLD at a time");
|
||||
runCommandForced("--roid_suffix=blah", "--dns_writers=VoidDnsWriter", "xn--q9jyb4c", "test");
|
||||
runCommandForced("--roid_suffix=BLAH", "--dns_writers=VoidDnsWriter", "xn--q9jyb4c", "test");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_multipleDuplicateArguments() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class, "Can't create more than one TLD at a time");
|
||||
runCommandForced("--roid_suffix=blah", "--dns_writers=VoidDnsWriter", "test", "test");
|
||||
runCommandForced("--roid_suffix=BLAH", "--dns_writers=VoidDnsWriter", "test", "test");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user