Update Apache SSHD to 2.0

See release notes at [1].

Upgrade mina-core to 2.0.17 and also add new dependency sshd-mina.
Given that sshd-core was split to small libraries sshd-sftp code was
externalized.  As the consequence we can now remove exclusion of
FileSystemProvider service during fetching of sshd-core from Central.
Also adapt the package name of Command related classes.

[1] https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12342654&styleName=&projectId=12310849&Create=Create&atl_token=A5KQ-2QAV-T4JA-FDED%7Cf98d7b707f8df425b70a5596aff2a372f9525532%7Clout

Feature: Issue 9757
Change-Id: I756e15155592a0f1a781258e78a94a324f0068d8
This commit is contained in:
Paladox none 2018-09-07 14:56:25 +00:00 committed by David Ostrovsky
parent e171a310ae
commit 70490cdf85
19 changed files with 30 additions and 26 deletions

View File

@ -740,13 +740,10 @@ maven_jar(
sha1 = "d0c46320fbc07be3a24eb13a56cee4e3d38e0c75",
)
# TODO(davido): Remove exlusion of file system provider, when this issue is fixed:
# https://issues.apache.org/jira/browse/SSHD-736
maven_jar(
name = "sshd",
artifact = "org.apache.sshd:sshd-core:1.7.0",
exclude = ["META-INF/services/java.nio.file.spi.FileSystemProvider"],
sha1 = "2e8b14f6d841b098e46bf407b6fdccab4c19fa41",
artifact = "org.apache.sshd:sshd-core:2.0.0",
sha1 = "f4275079a2463cfd2bf1548a80e1683288a8e86b",
)
maven_jar(
@ -757,8 +754,14 @@ maven_jar(
maven_jar(
name = "mina-core",
artifact = "org.apache.mina:mina-core:2.0.16",
sha1 = "f720f17643eaa7b0fec07c1d7f6272972c02bba4",
artifact = "org.apache.mina:mina-core:2.0.17",
sha1 = "7e10ec974760436d931f3e58be507d1957bcc8db",
)
maven_jar(
name = "sshd-mina",
artifact = "org.apache.sshd:sshd-mina:2.0.0",
sha1 = "50f2669312494f6c1996d8bd0d266c1fca7be6f6",
)
maven_jar(

View File

@ -26,8 +26,8 @@ import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.Environment;
import org.apache.sshd.server.command.Command;
/** Command that executes some other command. */
public class AliasCommand extends BaseCommand {

View File

@ -17,7 +17,7 @@ package com.google.gerrit.sshd;
import com.google.gerrit.server.permissions.PermissionBackend;
import com.google.inject.Inject;
import com.google.inject.Provider;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.command.Command;
/** Resolves an alias to another command. */
public class AliasCommandProvider implements Provider<Command> {

View File

@ -54,9 +54,9 @@ import java.util.concurrent.Future;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.sshd.common.SshException;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.Environment;
import org.apache.sshd.server.ExitCallback;
import org.apache.sshd.server.command.Command;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.Option;

View File

@ -39,11 +39,11 @@ import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.CommandFactory;
import org.apache.sshd.server.Environment;
import org.apache.sshd.server.ExitCallback;
import org.apache.sshd.server.SessionAware;
import org.apache.sshd.server.command.Command;
import org.apache.sshd.server.command.CommandFactory;
import org.apache.sshd.server.session.ServerSession;
import org.eclipse.jgit.lib.Config;

View File

@ -16,7 +16,7 @@ package com.google.gerrit.sshd;
import com.google.gerrit.lifecycle.LifecycleModule;
import com.google.inject.binder.LinkedBindingBuilder;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.command.Command;
/** Module to register commands in the SSH daemon. */
public abstract class CommandModule extends LifecycleModule {

View File

@ -15,7 +15,7 @@
package com.google.gerrit.sshd;
import com.google.inject.Provider;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.command.Command;
final class CommandProvider {

View File

@ -17,7 +17,7 @@ package com.google.gerrit.sshd;
import com.google.auto.value.AutoAnnotation;
import com.google.inject.Key;
import java.lang.annotation.Annotation;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.command.Command;
/** Utilities to support {@link CommandName} construction. */
public class Commands {

View File

@ -31,8 +31,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.Environment;
import org.apache.sshd.server.command.Command;
import org.kohsuke.args4j.Argument;
/** Command that dispatches to a subcommand from its command table. */

View File

@ -24,7 +24,7 @@ import com.google.inject.TypeLiteral;
import java.lang.annotation.Annotation;
import java.util.List;
import java.util.concurrent.ConcurrentMap;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.command.Command;
/** Creates DispatchCommand using commands registered by {@link CommandModule}. */
public class DispatchCommandProvider implements Provider<DispatchCommand> {

View File

@ -30,10 +30,10 @@ import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import org.apache.sshd.common.Factory;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.Environment;
import org.apache.sshd.server.ExitCallback;
import org.apache.sshd.server.SessionAware;
import org.apache.sshd.server.command.Command;
import org.apache.sshd.server.session.ServerSession;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.util.SystemReader;

View File

@ -18,7 +18,7 @@ import com.google.common.base.Preconditions;
import com.google.gerrit.extensions.annotations.PluginName;
import com.google.inject.Inject;
import com.google.inject.binder.LinkedBindingBuilder;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.command.Command;
public abstract class PluginCommandModule extends CommandModule {
private CommandName command;

View File

@ -18,7 +18,7 @@ import com.google.common.base.Preconditions;
import com.google.gerrit.extensions.annotations.PluginName;
import com.google.inject.Inject;
import com.google.inject.binder.LinkedBindingBuilder;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.command.Command;
/**
* Binds one SSH command to the plugin name itself.

View File

@ -28,7 +28,7 @@ import com.google.inject.TypeLiteral;
import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.Map;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.command.Command;
class SshAutoRegisterModuleGenerator extends AbstractModule implements ModuleGenerator {
private final Map<String, Class<Command>> commands = new HashMap<>();

View File

@ -93,8 +93,6 @@ import org.apache.sshd.common.util.buffer.Buffer;
import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
import org.apache.sshd.common.util.net.SshdSocketAddress;
import org.apache.sshd.common.util.security.SecurityUtils;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.CommandFactory;
import org.apache.sshd.server.ServerBuilder;
import org.apache.sshd.server.SshServer;
import org.apache.sshd.server.auth.UserAuth;
@ -102,6 +100,8 @@ import org.apache.sshd.server.auth.gss.GSSAuthenticator;
import org.apache.sshd.server.auth.gss.UserAuthGSSFactory;
import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator;
import org.apache.sshd.server.auth.pubkey.UserAuthPublicKeyFactory;
import org.apache.sshd.server.command.Command;
import org.apache.sshd.server.command.CommandFactory;
import org.apache.sshd.server.forward.ForwardingFilter;
import org.apache.sshd.server.global.CancelTcpipForwardHandler;
import org.apache.sshd.server.global.KeepAliveHandler;

View File

@ -45,9 +45,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import org.apache.sshd.server.CommandFactory;
import org.apache.sshd.server.auth.gss.GSSAuthenticator;
import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator;
import org.apache.sshd.server.command.CommandFactory;
import org.eclipse.jgit.lib.Config;
/** Configures standard dependencies for {@link SshDaemon}. */

View File

@ -24,7 +24,7 @@ import com.google.inject.Inject;
import com.google.inject.Key;
import com.google.inject.Provider;
import com.google.inject.Singleton;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.command.Command;
@Singleton
class SshPluginStarterCallback implements StartPluginListener, ReloadPluginListener {

View File

@ -34,8 +34,8 @@ import java.net.SocketAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.Environment;
import org.apache.sshd.server.command.Command;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;

View File

@ -4,6 +4,7 @@ java_library(
visibility = ["//visibility:public"],
exports = [
":eddsa",
"@sshd-mina//jar",
"@sshd//jar",
],
runtime_deps = [":core"],