diff --git a/lib/BUILD b/lib/BUILD
index a6864fa36..7720696b3 100644
--- a/lib/BUILD
+++ b/lib/BUILD
@@ -35,6 +35,7 @@ java_library(
visibility = [
"//org.eclipse.jgit.ssh.apache:__pkg__",
"//org.eclipse.jgit.ssh.apache.test:__pkg__",
+ "//org.eclipse.jgit.ssh.jsch.test:__pkg__",
],
exports = ["@eddsa//jar"],
)
@@ -145,7 +146,9 @@ java_library(
name = "jsch",
visibility = [
"//org.eclipse.jgit:__pkg__",
- "//org.eclipse.jgit.test:__pkg__",
+ "//org.eclipse.jgit.junit.ssh:__pkg__",
+ "//org.eclipse.jgit.ssh.jsch:__pkg__",
+ "//org.eclipse.jgit.ssh.jsch.test:__pkg__",
],
exports = ["@jsch//jar"],
)
@@ -184,6 +187,7 @@ java_library(
name = "jzlib",
visibility = [
"//org.eclipse.jgit:__pkg__",
+ "//org.eclipse.jgit.ssh.jsch:__pkg__",
"//org.eclipse.jgit.test:__pkg__",
],
exports = ["@jzlib//jar"],
diff --git a/org.eclipse.jgit.junit.ssh/.classpath b/org.eclipse.jgit.junit.ssh/.classpath
index eca7bdba8..110168ffa 100644
--- a/org.eclipse.jgit.junit.ssh/.classpath
+++ b/org.eclipse.jgit.junit.ssh/.classpath
@@ -3,5 +3,6 @@
Eclipse Distribution License - v 1.0 Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors. All rights reserved. Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE.
+ + + + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/feature.properties b/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/feature.properties new file mode 100644 index 000000000..dc79b3230 --- /dev/null +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/feature.properties @@ -0,0 +1,176 @@ +############################################################################### +# Copyright (c) 2020 Matthias SohnNovember 22, 2017
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, + INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY + THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED + BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS + GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY + APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED + BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS + AGREEMENT AND THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE + AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT + USE THE CONTENT.
++ Unless otherwise indicated, all Content made available by the Eclipse + Foundation is provided to you under the terms and conditions of the + Eclipse Public License Version 2.0 ("EPL"). A copy of the + EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-2.0. + For purposes of the EPL, "Program" will mean the Content. +
+Content includes, but is not limited to, source code, object + code, documentation and other files maintained in the Eclipse + Foundation source code repository ("Repository") in software + modules ("Modules") and made available as downloadable + archives ("Downloads").
+The terms and conditions governing Plug-ins and Fragments should + be contained in files named "about.html" + ("Abouts"). The terms and conditions governing Features and + Included Features should be contained in files named + "license.html" ("Feature Licenses"). Abouts and + Feature Licenses may be located in any directory of a Download or + Module including, but not limited to the following locations:
+Note: if a Feature made available by the Eclipse Foundation is + installed using the Provisioning Technology (as defined below), you + must agree to a license ("Feature Update License") during + the installation process. If the Feature contains Included Features, + the Feature Update License should either provide you with the terms + and conditions governing the Included Features or inform you where you + can locate them. Feature Update Licenses may be found in the + "license" property of files named + "feature.properties" found within a Feature. Such Abouts, + Feature Licenses, and Feature Update Licenses contain the terms and + conditions (or references to such terms and conditions) that govern + your use of the associated Content in that directory.
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY + REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND + CONDITIONS. SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT + ARE NOT LIMITED TO):
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND + CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, + or Feature Update License is provided, please contact the Eclipse + Foundation to determine what terms and conditions govern that + particular Content.
++ The Eclipse Foundation makes available provisioning software, examples + of which include, but are not limited to, p2 and the Eclipse Update + Manager ("Provisioning Technology") for the purpose of + allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This + capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about + packaging Installable Software is available at http://eclipse.org/equinox/p2/repository_packaging.html + ("Specification"). +
+You may use Provisioning Technology to allow other parties to + install Installable Software. You shall be responsible for enabling + the applicable license agreements relating to the Installable Software + to be presented to, and accepted by, the users of the Provisioning + Technology in accordance with the Specification. By using Provisioning + Technology in such a manner and making it available in accordance with + the Specification, you further acknowledge your agreement to, and the + acquisition of all necessary rights to permit the following:
+Content may contain encryption software. The country in which + you are currently may have restrictions on the import, possession, and + use, and/or re-export to another country, of encryption software. + BEFORE using any encryption software, please check the country's laws, + regulations and policies concerning the import, possession, or use, + and re-export of encryption software, to see if this is permitted.
++ Java and all Java-based trademarks are trademarks of + Oracle Corporation in the United States, other countries, or both. +
+ + \ No newline at end of file diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/pom.xml new file mode 100644 index 000000000..19905b625 --- /dev/null +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/pom.xml @@ -0,0 +1,44 @@ + + + +Eclipse Distribution License - v 1.0
+ +Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors.
+ +All rights reserved.
+Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: +
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE.
+ +SHA-1 UbcCheck - MIT
+ +Copyright (c) 2017:
+Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.
+ + + + diff --git a/org.eclipse.jgit.ssh.jsch.test/build.properties b/org.eclipse.jgit.ssh.jsch.test/build.properties new file mode 100644 index 000000000..9ffa0caf7 --- /dev/null +++ b/org.eclipse.jgit.ssh.jsch.test/build.properties @@ -0,0 +1,5 @@ +source.. = tst/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties diff --git a/org.eclipse.jgit.ssh.jsch.test/plugin.properties b/org.eclipse.jgit.ssh.jsch.test/plugin.properties new file mode 100644 index 000000000..463fd4ab3 --- /dev/null +++ b/org.eclipse.jgit.ssh.jsch.test/plugin.properties @@ -0,0 +1,2 @@ +Bundle-Name=JGit Tests for SSH with JSch +Bundle-Vendor=Eclipse JGit diff --git a/org.eclipse.jgit.ssh.jsch.test/pom.xml b/org.eclipse.jgit.ssh.jsch.test/pom.xml new file mode 100644 index 000000000..92b4176da --- /dev/null +++ b/org.eclipse.jgit.ssh.jsch.test/pom.xml @@ -0,0 +1,118 @@ + + + +Eclipse Distribution License - v 1.0
+ +Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors.
+ +All rights reserved.
+Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: +
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE.
+ +SHA-1 UbcCheck - MIT
+ +Copyright (c) 2017:
+Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.
+ + + + diff --git a/org.eclipse.jgit.ssh.jsch/build.properties b/org.eclipse.jgit.ssh.jsch/build.properties new file mode 100644 index 000000000..8148271ef --- /dev/null +++ b/org.eclipse.jgit.ssh.jsch/build.properties @@ -0,0 +1,7 @@ +source.. = src/,\ + resources/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + about.html diff --git a/org.eclipse.jgit.ssh.jsch/plugin.properties b/org.eclipse.jgit.ssh.jsch/plugin.properties new file mode 100644 index 000000000..126709b96 --- /dev/null +++ b/org.eclipse.jgit.ssh.jsch/plugin.properties @@ -0,0 +1,2 @@ +Bundle-Name=JGit SSH support based on JSch +Bundle-Vendor=Eclipse JGit diff --git a/org.eclipse.jgit.ssh.jsch/pom.xml b/org.eclipse.jgit.ssh.jsch/pom.xml new file mode 100644 index 000000000..142ea28b1 --- /dev/null +++ b/org.eclipse.jgit.ssh.jsch/pom.xml @@ -0,0 +1,218 @@ + + + +
* This parser makes the critical options available to
* {@link org.eclipse.jgit.transport.SshSessionFactory} via
- * {@link org.eclipse.jgit.transport.OpenSshConfig.Host} objects returned by
- * {@link #lookup(String)}, and implements a fully conforming
+ * {@link org.eclipse.jgit.transport.OpenSshConfig.Host} objects returned
+ * by {@link #lookup(String)}, and implements a fully conforming
* {@link com.jcraft.jsch.ConfigRepository} providing
* {@link com.jcraft.jsch.ConfigRepository.Config}s via
* {@link #getConfig(String)}.
diff --git a/org.eclipse.jgit.test/.classpath b/org.eclipse.jgit.test/.classpath
index 7cc18cca3..c99a7b0d3 100644
--- a/org.eclipse.jgit.test/.classpath
+++ b/org.eclipse.jgit.test/.classpath
@@ -1,22 +1,21 @@
- * This is the default implementation used by JGit and provides most of the
- * compatibility necessary to match OpenSSH, a popular implementation of SSH
- * used by C Git.
- *
- * If user interactivity is required by SSH (e.g. to obtain a password), the
- * connection will immediately fail.
- *
- * @since 5.7
- */
-public class DefaultSshSessionFactory extends JschConfigSessionFactory {
- /** {@inheritDoc} */
- @Override
- protected void configure(OpenSshConfig.Host hc, Session session) {
- // No additional configuration required.
- }
-}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshSessionFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshSessionFactory.java
index e6d204242..ef845f4dc 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshSessionFactory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshSessionFactory.java
@@ -43,11 +43,12 @@ public abstract class SshSessionFactory {
}
return null;
}
+
/**
* Get the currently configured JVM-wide factory.
*
- * A factory is always available. By default the factory will read from the
- * user's $HOME/.ssh
.
- * $HOME/.ssh
and assume OpenSSH compatibility.
+ * By default the factory will read from the user's $HOME/.ssh
+ * and assume OpenSSH compatibility.
*
* @return factory the current factory for this JVM.
*/
@@ -60,7 +61,7 @@ public abstract class SshSessionFactory {
*
* @param newFactory
* factory for future sessions to be created through. If null the
- * default factory will be restored.s
+ * default factory will be restored.
*/
public static void setInstance(SshSessionFactory newFactory) {
if (newFactory != null) {
@@ -109,6 +110,15 @@ public abstract class SshSessionFactory {
CredentialsProvider credentialsProvider, FS fs, int tms)
throws TransportException;
+ /**
+ * The name of the type of session factory.
+ *
+ * @return the name of the type of session factory.
+ *
+ * @since 5.8
+ */
+ public abstract String getType();
+
/**
* Close (or recycle) a session to a host.
*
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java
index 947c4c322..b9cb2484d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java
@@ -50,6 +50,8 @@ import org.eclipse.jgit.util.io.StreamCopyThread;
* enumeration, save file modification and hook execution.
*/
public class TransportGitSsh extends SshTransport implements PackTransport {
+ private static final String EXT = "ext"; //$NON-NLS-1$
+
static final TransportProtocol PROTO_SSH = new TransportProtocol() {
private final String[] schemeNames = { "ssh", "ssh+git", "git+ssh" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -127,6 +129,11 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
throws TransportException {
return new ExtSession();
}
+
+ @Override
+ public String getType() {
+ return EXT;
+ }
});
}
}
diff --git a/pom.xml b/pom.xml
index eddb040a5..a0f6d7732 100644
--- a/pom.xml
+++ b/pom.xml
@@ -992,6 +992,7 @@