From bc5e10532e11e384a47264fec26e8afe531654b6 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Tue, 19 Mar 2019 17:55:07 +0100 Subject: [PATCH] Use Argeo TP v2.1.23 --- dep/org.argeo.dep.cms.client/pom.xml | 9 +++++++++ org.argeo.core/.classpath | 1 - org.argeo.core/bnd.bnd | 2 +- org.argeo.core/build.properties | 4 +++- org.argeo.core/lib/.gitignore | 1 - .../src/org/argeo/ssh/AbstractSsh.java | 16 +++++++-------- org.argeo.core/src/org/argeo/ssh/Sftp.java | 2 +- .../src/org/argeo/sync/fs/SshSync.java | 20 +++++++++---------- pom.xml | 2 +- 9 files changed, 33 insertions(+), 24 deletions(-) delete mode 100644 org.argeo.core/lib/.gitignore diff --git a/dep/org.argeo.dep.cms.client/pom.xml b/dep/org.argeo.dep.cms.client/pom.xml index 5ac0d6f3e..083faa62c 100644 --- a/dep/org.argeo.dep.cms.client/pom.xml +++ b/dep/org.argeo.dep.cms.client/pom.xml @@ -63,6 +63,11 @@ org.slf4j.commons.logging + + org.argeo.tp.misc + org.freemarker + + org.argeo.tp.bouncycastle bcprov @@ -194,6 +199,10 @@ org.argeo.tp.apache org.apache.mina.core + + org.argeo.tp.apache + org.apache.tomcat.jni + org.argeo.tp.apache org.apache.sshd.core diff --git a/org.argeo.core/.classpath b/org.argeo.core/.classpath index a7acb8257..eca7bdba8 100644 --- a/org.argeo.core/.classpath +++ b/org.argeo.core/.classpath @@ -3,6 +3,5 @@ - diff --git a/org.argeo.core/bnd.bnd b/org.argeo.core/bnd.bnd index 3ae5c176e..8f0929c34 100644 --- a/org.argeo.core/bnd.bnd +++ b/org.argeo.core/bnd.bnd @@ -1 +1 @@ -Main-Class: org.argeo.sync.cli.Sync +#Main-Class: org.argeo.sync.cli.Sync diff --git a/org.argeo.core/build.properties b/org.argeo.core/build.properties index f3e2c2ccb..94dc2778d 100644 --- a/org.argeo.core/build.properties +++ b/org.argeo.core/build.properties @@ -5,4 +5,6 @@ bin.includes = META-INF/,\ additional.bundles = org.apache.sshd.common,\ org.slf4j.log4j12,\ org.slf4j.api,\ - org.apache.sshd.core + org.apache.sshd.core,\ + bcprov,\ + org.apache.tomcat.jni diff --git a/org.argeo.core/lib/.gitignore b/org.argeo.core/lib/.gitignore deleted file mode 100644 index 2142dc129..000000000 --- a/org.argeo.core/lib/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/tomcat-jni-*.jar diff --git a/org.argeo.core/src/org/argeo/ssh/AbstractSsh.java b/org.argeo.core/src/org/argeo/ssh/AbstractSsh.java index f42ae205c..ae1d6a0d4 100644 --- a/org.argeo.core/src/org/argeo/ssh/AbstractSsh.java +++ b/org.argeo.core/src/org/argeo/ssh/AbstractSsh.java @@ -14,7 +14,7 @@ import org.apache.sshd.client.SshClient; import org.apache.sshd.client.config.keys.ClientIdentityLoader; import org.apache.sshd.client.future.ConnectFuture; import org.apache.sshd.client.session.ClientSession; -import org.apache.sshd.client.subsystem.sftp.SftpFileSystemProvider; +import org.apache.sshd.client.subsystem.sftp.fs.SftpFileSystemProvider; import org.apache.sshd.common.config.keys.FilePasswordProvider; abstract class AbstractSsh { @@ -79,13 +79,13 @@ abstract class AbstractSsh { } void loadKey(String password, String keyPath) { - try { - KeyPair keyPair = ClientIdentityLoader.DEFAULT.loadClientIdentity(keyPath, - FilePasswordProvider.of(password)); - session.addPublicKeyIdentity(keyPair); - } catch (IOException | GeneralSecurityException e) { - throw new IllegalStateException(e); - } +// try { +// KeyPair keyPair = ClientIdentityLoader.DEFAULT.loadClientIdentity(keyPath, +// FilePasswordProvider.of(password)); +// session.addPublicKeyIdentity(keyPair); +// } catch (IOException | GeneralSecurityException e) { +// throw new IllegalStateException(e); +// } } void openSession(URI uri) { diff --git a/org.argeo.core/src/org/argeo/ssh/Sftp.java b/org.argeo.core/src/org/argeo/ssh/Sftp.java index 3ad3e9855..df4dd3a01 100644 --- a/org.argeo.core/src/org/argeo/ssh/Sftp.java +++ b/org.argeo.core/src/org/argeo/ssh/Sftp.java @@ -5,7 +5,7 @@ import java.net.URI; import java.nio.file.FileSystem; import java.nio.file.Path; -import org.apache.sshd.client.subsystem.sftp.SftpFileSystem; +import org.apache.sshd.client.subsystem.sftp.fs.SftpFileSystem; public class Sftp extends AbstractSsh { private URI uri; diff --git a/org.argeo.core/src/org/argeo/sync/fs/SshSync.java b/org.argeo.core/src/org/argeo/sync/fs/SshSync.java index 773f32d34..7fe6670c9 100644 --- a/org.argeo.core/src/org/argeo/sync/fs/SshSync.java +++ b/org.argeo.core/src/org/argeo/sync/fs/SshSync.java @@ -27,8 +27,8 @@ import org.apache.sshd.client.channel.ClientChannelEvent; import org.apache.sshd.client.config.keys.ClientIdentityLoader; import org.apache.sshd.client.future.ConnectFuture; import org.apache.sshd.client.session.ClientSession; -import org.apache.sshd.client.subsystem.sftp.SftpFileSystem; -import org.apache.sshd.client.subsystem.sftp.SftpFileSystemProvider; +import org.apache.sshd.client.subsystem.sftp.fs.SftpFileSystem; +import org.apache.sshd.client.subsystem.sftp.fs.SftpFileSystemProvider; import org.apache.sshd.common.config.keys.FilePasswordProvider; import org.apache.sshd.common.util.io.NoCloseInputStream; import org.apache.sshd.common.util.io.NoCloseOutputStream; @@ -40,7 +40,7 @@ public class SshSync { try (SshClient client = SshClient.setUpDefaultClient()) { client.start(); - boolean osAgent = false; + boolean osAgent = true; SshAgentFactory agentFactory = osAgent ? new UnixAgentFactory() : new LocalAgentFactory(); // SshAgentFactory agentFactory = new LocalAgentFactory(); client.setAgentFactory(agentFactory); @@ -55,15 +55,15 @@ public class SshSync { System.out.print(keyPath + ": "); Scanner s = new Scanner(System.in); String password = s.next(); - KeyPair keyPair = ClientIdentityLoader.DEFAULT.loadClientIdentity(keyPath, - FilePasswordProvider.of(password)); - sshAgent.addIdentity(keyPair, "NO COMMENT"); +// KeyPair keyPair = ClientIdentityLoader.DEFAULT.loadClientIdentity(keyPath, +// FilePasswordProvider.of(password)); +// sshAgent.addIdentity(keyPair, "NO COMMENT"); } - List> identities = sshAgent.getIdentities(); - for (Map.Entry entry : identities) { - System.out.println(entry.getValue() + " : " + entry.getKey()); - } +// List> identities = sshAgent.getIdentities(); +// for (Map.Entry entry : identities) { +// System.out.println(entry.getValue() + " : " + entry.getKey()); +// } ConnectFuture connectFuture = client.connect(login, host, port); connectFuture.await(); diff --git a/pom.xml b/pom.xml index 1c9976a63..6f82746d4 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 2.1.77-SNAPSHOT - 2.1.22 + 2.1.23 7 /srv/rpmfactory/argeo-osgi-2/el7 -- 2.30.2