mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
Allow using empty string to remove all whitelisted IPs
Currently, you have to set "--ip_whitelist=null", which is unintuitive. This adds the option to just give an empty string: "--ip_whitelist=" ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=227550896
This commit is contained in:
parent
2e7d71b238
commit
566f60d495
2 changed files with 20 additions and 3 deletions
|
@ -134,7 +134,7 @@ public class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarC
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_clearIpWhitelist() throws Exception {
|
||||
public void testSuccess_clearIpWhitelist_useNull() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("NewRegistrar")
|
||||
.asBuilder()
|
||||
|
@ -148,6 +148,21 @@ public class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarC
|
|||
assertThat(loadRegistrar("NewRegistrar").getIpAddressWhitelist()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_clearIpWhitelist_useEmpty() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("NewRegistrar")
|
||||
.asBuilder()
|
||||
.setIpAddressWhitelist(
|
||||
ImmutableList.of(
|
||||
CidrAddressBlock.create("192.168.1.1"),
|
||||
CidrAddressBlock.create("192.168.0.2/16")))
|
||||
.build());
|
||||
assertThat(loadRegistrar("NewRegistrar").getIpAddressWhitelist()).isNotEmpty();
|
||||
runCommand("--ip_whitelist=", "--force", "NewRegistrar");
|
||||
assertThat(loadRegistrar("NewRegistrar").getIpAddressWhitelist()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_certFile() throws Exception {
|
||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue