diff options
author | James Moger <james.moger@gitblit.com> | 2015-05-21 19:24:22 -0600 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2015-05-21 19:24:22 -0600 |
commit | bcb1beeadeef4745dd204ea0626aa95433612c56 (patch) | |
tree | def6db66fb0d6c66d2745dbce66d00fcd58b150e /src/test/java/com/gitblit | |
parent | 9731bd4731729c29c2a7be208275131b4e69940e (diff) | |
parent | 5485da49b04bb139d28d42fe8f3d371915e79a3d (diff) | |
download | gitblit-bcb1beeadeef4745dd204ea0626aa95433612c56.tar.gz gitblit-bcb1beeadeef4745dd204ea0626aa95433612c56.zip |
Merged #247 "Add Kerberos5/GSS authentication to ssh"
Diffstat (limited to 'src/test/java/com/gitblit')
-rw-r--r-- | src/test/java/com/gitblit/tests/JschConfigTestSessionFactory.java | 1 | ||||
-rw-r--r-- | src/test/java/com/gitblit/tests/SshUnitTest.java | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/test/java/com/gitblit/tests/JschConfigTestSessionFactory.java b/src/test/java/com/gitblit/tests/JschConfigTestSessionFactory.java index 5d24b401..421f3366 100644 --- a/src/test/java/com/gitblit/tests/JschConfigTestSessionFactory.java +++ b/src/test/java/com/gitblit/tests/JschConfigTestSessionFactory.java @@ -21,6 +21,7 @@ public class JschConfigTestSessionFactory extends JschConfigSessionFactory { @Override
protected void configure(OpenSshConfig.Host host, Session session) {
session.setConfig("StrictHostKeyChecking", "no");
+ session.setConfig("PreferredAuthentications", "password");
}
@Override
diff --git a/src/test/java/com/gitblit/tests/SshUnitTest.java b/src/test/java/com/gitblit/tests/SshUnitTest.java index 43b51b74..3def700d 100644 --- a/src/test/java/com/gitblit/tests/SshUnitTest.java +++ b/src/test/java/com/gitblit/tests/SshUnitTest.java @@ -24,13 +24,18 @@ import java.net.SocketAddress; import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.PublicKey; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.sshd.ClientChannel; import org.apache.sshd.ClientSession; import org.apache.sshd.SshClient; import org.apache.sshd.client.ServerKeyVerifier; +import org.apache.sshd.common.NamedFactory; import org.apache.sshd.common.util.SecurityUtils; +import org.apache.sshd.client.UserAuth; +import org.apache.sshd.client.auth.UserAuthPublicKey; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -102,6 +107,9 @@ public abstract class SshUnitTest extends GitblitUnitTest { return true; } }); + List<NamedFactory<UserAuth>> userAuthFactories = new ArrayList<>(); + userAuthFactories.add(new UserAuthPublicKey.Factory()); + client.setUserAuthFactories(userAuthFactories); client.start(); return client; } |