mirror of
https://github.com/google/nomulus
synced 2026-07-19 06:22:33 +00:00
Refactor AppEngineConnection
AppEngineConnection can now connect to all services and not just the tools. The default is still the tools. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=218734983
This commit is contained in:
@@ -28,6 +28,7 @@ import com.beust.jcommander.Parameters;
|
||||
import com.beust.jcommander.ParametersDelegate;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Iterables;
|
||||
import google.registry.config.RegistryConfig;
|
||||
import google.registry.model.ofy.ObjectifyService;
|
||||
import google.registry.tools.params.ParameterFactory;
|
||||
import java.security.Security;
|
||||
@@ -53,11 +54,6 @@ final class RegistryCli implements AutoCloseable, CommandRunner {
|
||||
description = "Returns all command names.")
|
||||
private boolean showAllCommands;
|
||||
|
||||
// Do not make this final - compile-time constant inlining may interfere with JCommander.
|
||||
@ParametersDelegate
|
||||
private AppEngineConnectionFlags appEngineConnectionFlags =
|
||||
new AppEngineConnectionFlags();
|
||||
|
||||
|
||||
// Do not make this final - compile-time constant inlining may interfere with JCommander.
|
||||
@ParametersDelegate
|
||||
@@ -84,7 +80,6 @@ final class RegistryCli implements AutoCloseable, CommandRunner {
|
||||
Security.addProvider(new BouncyCastleProvider());
|
||||
|
||||
component = DaggerRegistryToolComponent.builder()
|
||||
.flagsModule(new AppEngineConnectionFlags.FlagsModule(appEngineConnectionFlags))
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -197,7 +192,7 @@ final class RegistryCli implements AutoCloseable, CommandRunner {
|
||||
RemoteApiOptions options = new RemoteApiOptions();
|
||||
options.server(
|
||||
getConnection().getServer().getHost(), getConnection().getServer().getPort());
|
||||
if (getConnection().isLocalhost()) {
|
||||
if (RegistryConfig.areServersLocal()) {
|
||||
// Use dev credentials for localhost.
|
||||
options.useDevelopmentServerCredential();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user