Don't allow setting reserved lists with conflicting auth codes

This is an error condition that will soon throw an exception when
attempting to register the domain name, so it's good to let the registry
operator know of the error when it is first introduced.

Unfortunately there's still a backdoor that allows duplicate labels
that's harder to protect against (that this commit doesn't cover): the
case where reserved lists are already applied to a TLD, then one of the
reserved lists is updated to add another auth code, which then conflicts
with one on a different reserved list.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149443007
This commit is contained in:
mcilwain 2017-03-07 11:28:41 -08:00 committed by Ben McIlwain
parent 5d4287a375
commit ce4f3c0d56
4 changed files with 74 additions and 12 deletions

View file

@ -606,7 +606,7 @@ public class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
@Test
public void testFailure_setNonExistentReservedLists() throws Exception {
thrown.expect(
IllegalStateException.class,
IllegalArgumentException.class,
"Could not find reserved list xn--q9jyb4c_ZZZ to add to the tld");
runCommandForced("--reserved_lists", "xn--q9jyb4c_ZZZ", "xn--q9jyb4c");
}