From 3a3f112454dc3e52cfea9f6bceeaf0aaf2a38761 Mon Sep 17 00:00:00 2001 From: nickfelt Date: Wed, 20 Apr 2016 15:26:08 -0700 Subject: [PATCH] Whitelist credit creations commands for gTech See bug for context. This way gTech can create credits in the future without our intervention. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=120382506 --- .../domain/registry/tools/CreateCreditBalanceCommand.java | 3 ++- java/com/google/domain/registry/tools/CreateCreditCommand.java | 3 ++- java/com/google/domain/registry/tools/GtechTool.java | 2 ++ java/com/google/domain/registry/tools/RegistryTool.java | 2 -- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/java/com/google/domain/registry/tools/CreateCreditBalanceCommand.java b/java/com/google/domain/registry/tools/CreateCreditBalanceCommand.java index 041ec957b..6b7a7c86e 100644 --- a/java/com/google/domain/registry/tools/CreateCreditBalanceCommand.java +++ b/java/com/google/domain/registry/tools/CreateCreditBalanceCommand.java @@ -20,6 +20,7 @@ import static com.google.domain.registry.model.ofy.ObjectifyService.ofy; import com.google.domain.registry.model.billing.RegistrarCredit; import com.google.domain.registry.model.billing.RegistrarCreditBalance; import com.google.domain.registry.model.registrar.Registrar; +import com.google.domain.registry.tools.Command.GtechCommand; import com.google.domain.registry.util.SystemClock; import com.beust.jcommander.Parameter; @@ -30,7 +31,7 @@ import org.joda.time.DateTime; /** Command for creating a new balance for a registrar credit. */ @Parameters(separators = " =", commandDescription = "Create a new registrar credit balance") -final class CreateCreditBalanceCommand extends MutatingCommand { +final class CreateCreditBalanceCommand extends MutatingCommand implements GtechCommand { @Parameter( names = "--registrar", diff --git a/java/com/google/domain/registry/tools/CreateCreditCommand.java b/java/com/google/domain/registry/tools/CreateCreditCommand.java index f62b5f95d..b5396dfd3 100644 --- a/java/com/google/domain/registry/tools/CreateCreditCommand.java +++ b/java/com/google/domain/registry/tools/CreateCreditCommand.java @@ -21,6 +21,7 @@ import com.google.domain.registry.model.billing.RegistrarCredit; import com.google.domain.registry.model.billing.RegistrarCredit.CreditType; import com.google.domain.registry.model.billing.RegistrarCreditBalance; import com.google.domain.registry.model.registrar.Registrar; +import com.google.domain.registry.tools.Command.GtechCommand; import com.beust.jcommander.Parameter; import com.beust.jcommander.Parameters; @@ -32,7 +33,7 @@ import javax.annotation.Nullable; /** Command for creating a registrar credit object with an initial balance. */ @Parameters(separators = " =", commandDescription = "Create a new registrar credit") -final class CreateCreditCommand extends MutatingCommand { +final class CreateCreditCommand extends MutatingCommand implements GtechCommand { @Parameter( names = "--registrar", diff --git a/java/com/google/domain/registry/tools/GtechTool.java b/java/com/google/domain/registry/tools/GtechTool.java index 8cb1fc755..ead5b7797 100644 --- a/java/com/google/domain/registry/tools/GtechTool.java +++ b/java/com/google/domain/registry/tools/GtechTool.java @@ -34,6 +34,8 @@ public final class GtechTool { .put("convert_idn", ConvertIdnCommand.class) .put("create_anchor_tenant", CreateAnchorTenantCommand.class) .put("create_contact", CreateContactCommand.class) + .put("create_credit", CreateCreditCommand.class) + .put("create_credit_balance", CreateCreditBalanceCommand.class) .put("create_registrar_groups", CreateRegistrarGroupsCommand.class) .put("create_registrar", CreateRegistrarCommand.class) .put("create_sandbox_tld", CreateSandboxTldCommand.class) diff --git a/java/com/google/domain/registry/tools/RegistryTool.java b/java/com/google/domain/registry/tools/RegistryTool.java index d8a41df3a..f93de494c 100644 --- a/java/com/google/domain/registry/tools/RegistryTool.java +++ b/java/com/google/domain/registry/tools/RegistryTool.java @@ -35,8 +35,6 @@ public final class RegistryTool { .put("allocate_domain", AllocateDomainCommand.class) .put("check_snapshot", CheckSnapshotCommand.class) .put("create_auction_credits", CreateAuctionCreditsCommand.class) - .put("create_credit", CreateCreditCommand.class) - .put("create_credit_balance", CreateCreditBalanceCommand.class) .put("create_premium_list", CreatePremiumListCommand.class) .put("create_reserved_list", CreateReservedListCommand.class) .put("create_tld", CreateTldCommand.class)