mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Default to admin registrar in check_domain commands
The vast majority of the time this is the registrar client ID you want, so there's no reason to require specifying it everything each time. These are read-only commands anyway, so the potential negative effects are minimal. See the existing lock/unlock_domain commands for existing occurrences of this behavior. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=211857712
This commit is contained in:
parent
72bfd43e00
commit
22e1d905b6
5 changed files with 52 additions and 8 deletions
|
@ -18,9 +18,11 @@ import com.beust.jcommander.Parameter;
|
|||
import com.beust.jcommander.Parameters;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.template.soy.data.SoyMapData;
|
||||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.tools.soy.DomainCheckSoyInfo;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
|
||||
/** A command to execute a domain check EPP command (including cost of a 1 year create). */
|
||||
@Parameters(separators = " =", commandDescription = "Check domain availability")
|
||||
|
@ -28,8 +30,8 @@ final class CheckDomainCommand extends NonMutatingEppToolCommand {
|
|||
|
||||
@Parameter(
|
||||
names = {"-c", "--client"},
|
||||
description = "Client identifier of the registrar to execute the command as",
|
||||
required = true)
|
||||
description =
|
||||
"Client ID of the registrar to execute the command as, otherwise the registry registrar")
|
||||
String clientId;
|
||||
|
||||
@Parameter(
|
||||
|
@ -37,8 +39,17 @@ final class CheckDomainCommand extends NonMutatingEppToolCommand {
|
|||
required = true)
|
||||
private List<String> mainParameters;
|
||||
|
||||
@Inject
|
||||
@Config("registryAdminClientId")
|
||||
String registryAdminClientId;
|
||||
|
||||
@Override
|
||||
void initEppToolCommand() {
|
||||
// Default clientId to the registry registrar account if otherwise unspecified.
|
||||
if (clientId == null) {
|
||||
clientId = registryAdminClientId;
|
||||
}
|
||||
|
||||
Multimap<String, String> domainNameMap = validateAndGroupDomainNamesByTld(mainParameters);
|
||||
for (Collection<String> values : domainNameMap.asMap().values()) {
|
||||
setSoyTemplate(DomainCheckSoyInfo.getInstance(), DomainCheckSoyInfo.DOMAINCHECK);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue