diff options
author | Fabrice Bacchella <fbacchella@spamcop.net> | 2015-05-04 11:52:12 +0200 |
---|---|---|
committer | Fabrice Bacchella <fbacchella@spamcop.net> | 2015-05-04 11:52:12 +0200 |
commit | 5485da49b04bb139d28d42fe8f3d371915e79a3d (patch) | |
tree | a6dd1b6c41b87c2b0553b654d4183d1a3bfb7f6c /src/test | |
parent | 2fdefced2aeecc7c12f3de50f89c1590a6a088fc (diff) | |
download | gitblit-5485da49b04bb139d28d42fe8f3d371915e79a3d.tar.gz gitblit-5485da49b04bb139d28d42fe8f3d371915e79a3d.zip |
Adding Kerberos5/GSS authentication to ssh
Adding the possibility to define authentication method order for ssh
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/config/test-gitblit.properties | 2 | ||||
-rw-r--r-- | src/test/java/com/gitblit/tests/JschConfigTestSessionFactory.java | 1 | ||||
-rw-r--r-- | src/test/java/com/gitblit/tests/SshUnitTest.java | 8 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/test/config/test-gitblit.properties b/src/test/config/test-gitblit.properties index 78e9ab95..398047c1 100644 --- a/src/test/config/test-gitblit.properties +++ b/src/test/config/test-gitblit.properties @@ -9,6 +9,8 @@ git.enableGitServlet = true git.daemonPort = 8300 git.sshPort = 29418 git.sshKeysManager = com.gitblit.transport.ssh.MemoryKeyManager +git.sshWithKrb5 = true +git.sshAuthenticatorsOrder = password, publickey,gssapi-with-mic,invalid groovy.scriptsFolder = src/main/distrib/data/groovy groovy.preReceiveScripts = blockpush groovy.postReceiveScripts = sendmail 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; } |