Refactor the way of binding ssh commands
If a command should only be used on a server in master mode, but not
slave mode, it should be bound in both MasterCommandModule and
SlaveCommandModule, we have to remember to add it separately on each
of the commands list, the maintenance work is tedious.
Refactor the way of binding ssh commands. Add a field 'runsWith' to
CommandMetaData to mark a given ssh command to run on MASTER mode or
MASTER_OR_SLAVE mode. Remove SlaveCommandModule and MasterCommandModule,
and use only DefaultCommandModule.
This reverts commit 84bcead690.
Change-Id: Ia4908267b135be04ff9c8a9470a243a6c8d665a8
This commit is contained in:
committed by
David Pursehouse
parent
da48b9de23
commit
ae479c7fda
@@ -31,7 +31,6 @@ import com.google.gerrit.server.plugins.ReloadPluginListener;
|
||||
import com.google.gerrit.server.plugins.StartPluginListener;
|
||||
import com.google.gerrit.server.ssh.SshInfo;
|
||||
import com.google.gerrit.server.util.RequestScopePropagator;
|
||||
import com.google.gerrit.sshd.commands.DefaultCommandModule;
|
||||
import com.google.gerrit.sshd.commands.QueryShell;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.internal.UniqueAnnotations;
|
||||
@@ -84,8 +83,6 @@ public class SshModule extends LifecycleModule {
|
||||
bind(GSSAuthenticator.class).to(GerritGSSAuthenticator.class);
|
||||
bind(PublickeyAuthenticator.class).to(DatabasePubKeyAuth.class);
|
||||
|
||||
install(new DefaultCommandModule());
|
||||
|
||||
bind(ModuleGenerator.class).to(SshAutoRegisterModuleGenerator.class);
|
||||
bind(SshPluginStarterCallback.class);
|
||||
bind(StartPluginListener.class)
|
||||
|
||||
Reference in New Issue
Block a user