aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit.ssh/src
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2020-03-12 19:38:57 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2020-03-22 00:37:05 +0100
commitfd3778b935c1de9fd3ae7068d71c46974741dcce (patch)
treefa4d64170f437b61a6146e5c7a60db50901b5bb9 /org.eclipse.jgit.junit.ssh/src
parent7d3b6308fc2e44e8ae462d56fb2f1aa61012fb35 (diff)
downloadjgit-fd3778b935c1de9fd3ae7068d71c46974741dcce.tar.gz
jgit-fd3778b935c1de9fd3ae7068d71c46974741dcce.zip
Update to org.apache.sshd 2.4.0
Change target platforms to Orbit I20200319180910 and regenerate them. Change package imports to [2.4.0,2.5.0); adapt code to upstream API changes. Maven build: update version in root pom. Bazel build: update version & hash in WORKSPACE file. Proxy functionality verified manually using 3proxy (HTTP & SOCKS, with basic authentication) and ssh -vvv -D7020 localhost (SOCKS, no authentication). Bug: 561078 Change-Id: I582f6b98055b013c006f2c749890fe6db801cbaa Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.junit.ssh/src')
-rw-r--r--org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java b/org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java
index ac4e9927d9..883ff0b8b5 100644
--- a/org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java
+++ b/org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java
@@ -23,7 +23,6 @@ import java.util.Collections;
import java.util.List;
import java.util.Locale;
-import org.apache.sshd.common.NamedFactory;
import org.apache.sshd.common.NamedResource;
import org.apache.sshd.common.PropertyResolverUtils;
import org.apache.sshd.common.SshConstants;
@@ -40,14 +39,15 @@ import org.apache.sshd.server.ServerAuthenticationManager;
import org.apache.sshd.server.ServerFactoryManager;
import org.apache.sshd.server.SshServer;
import org.apache.sshd.server.auth.UserAuth;
+import org.apache.sshd.server.auth.UserAuthFactory;
import org.apache.sshd.server.auth.gss.GSSAuthenticator;
import org.apache.sshd.server.auth.gss.UserAuthGSS;
import org.apache.sshd.server.auth.gss.UserAuthGSSFactory;
import org.apache.sshd.server.auth.keyboard.DefaultKeyboardInteractiveAuthenticator;
import org.apache.sshd.server.command.AbstractCommandSupport;
-import org.apache.sshd.server.command.Command;
import org.apache.sshd.server.session.ServerSession;
import org.apache.sshd.server.shell.UnknownCommand;
+import org.apache.sshd.server.subsystem.SubsystemFactory;
import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory;
import org.eclipse.jgit.annotations.NonNull;
import org.eclipse.jgit.lib.Repository;
@@ -117,14 +117,14 @@ public class SshTestGitServer {
configureAuthentication();
- List<NamedFactory<Command>> subsystems = configureSubsystems();
+ List<SubsystemFactory> subsystems = configureSubsystems();
if (!subsystems.isEmpty()) {
server.setSubsystemFactories(subsystems);
}
configureShell();
- server.setCommandFactory(command -> {
+ server.setCommandFactory((channel, command) -> {
if (command.startsWith(RemoteConfig.DEFAULT_UPLOAD_PACK)) {
return new GitUploadPackCommand(command, executorService);
} else if (command.startsWith(RemoteConfig.DEFAULT_RECEIVE_PACK)) {
@@ -155,11 +155,12 @@ public class SshTestGitServer {
}
}
- private List<NamedFactory<UserAuth>> getAuthFactories() {
- List<NamedFactory<UserAuth>> authentications = new ArrayList<>();
+ private List<UserAuthFactory> getAuthFactories() {
+ List<UserAuthFactory> authentications = new ArrayList<>();
authentications.add(new UserAuthGSSFactory() {
@Override
- public UserAuth create() {
+ public UserAuth createUserAuth(ServerSession session)
+ throws IOException {
return new FakeUserAuthGSS();
}
});
@@ -208,7 +209,7 @@ public class SshTestGitServer {
* @return A possibly empty collection of subsystems.
*/
@NonNull
- protected List<NamedFactory<Command>> configureSubsystems() {
+ protected List<SubsystemFactory> configureSubsystems() {
// SFTP.
server.setFileSystemFactory(new VirtualFileSystemFactory() {