So it seems that the two deps `jsch.agentproxy.jsch` and `jsch.agentproxy.sshj`
are actually just aggregators that include `jsch.agentproxy.core` and
jsch/sshj, respectively.
@psiniemi: Is there any reason not to simply depend on `jsch.agentproxy.core`
directly, since we import jsch/sshj in
We can depend on core directly, but ```jsch.agentproxy.jsch``` brings in
```com.jcraft.jsch.agentproxy.RemoteIdentityRepository``` which is the glue
between the agent and jsch and analogously ```jsch.agentproxy.sshj``` brings in
```com.jcraft.jsch.agentproxy.sshj.AuthAgent``` which is the glue
but jsch.agentproxy.jsch brings in
com.jcraft.jsch.agentproxy.RemoteIdentityRepository...
I noticed that - sorry, updated the JIRA issue but not this PR ;-) See
[SMX4-1728](https://issues.apache.org/jira/browse/SMX4-1728) and
[SMX4-1729](https://issues.apache.org/jira/browse/SMX4-1729)
---
[jclouds-pull-requests
#705](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/705/) UNSTABLE
Looks like there's a problem with this pull request
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38773936
[jclouds-java-7-pull-requests
#1175](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1175/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38774368
[jclouds-java-7-pull-requests
#1176](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1176/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38774365
[jclouds-java-7-pull-requests
#1177](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1177/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38775448
jclouds-pull-requests #707 UNSTABLE
Spurious [test
failure](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/org.apache.jclouds$jclouds-compute/707/testReport/junit/org.jclouds.compute.util/ConcurrentOpenSocketFinderTest/testChecksSocketsConcurrently/)
---
Reply to this email
@nacx: Created [JCLOUDS-516](https://issues.apache.org/jira/browse/JCLOUDS-516)
and am about to merge this...
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38777027
Finally! ;-) Committed to
[master](https://git-wip-us.apache.org/repos/asf?p=jclouds.git;a=commit;h=85a1a8c1dd3de5f107ddf8e66c22b2fb3410a4ba)
@nacx: Backport to 1.7.x? And many thanks for all your work, @psiniemi!
---
Reply to this email directly or view it on GitHub:
Closed #312.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312
Thanks @psiniemi!
Good to go @demobox! I'd like to have this also in 1.7.x. Will you backport it
too?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38777449
Will you backport it too?
I'll submit a PR just to check, yes...
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38778047
[jclouds » jclouds
#963](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/963/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
I think the whole authentication login with these ssh connections needs a
rethink at some point (hopefully not with this pull request though). The way I,
as a user, would like it to work is that I just pile on authentication methods
that have some hope of succeeding and then when connecting we
@@ -152,7 +163,7 @@ public void clear() {
}
@Override
- public Session create() throws Exception {
+ public synchronized Session create() throws Exception {
Have you experienced concurrency issues? In theory, the ssh client factory will
create independent clients, and each
@@ -63,9 +77,14 @@ public Factory(ProxyConfig proxyConfig,
BackoffLimitedRetryHandler backoffLimite
@Override
public SshClient create(HostAndPort socket, LoginCredentials
credentials) {
- SshClient client = new JschSshClient(proxyConfig,
@@ -63,9 +77,14 @@ public Factory(ProxyConfig proxyConfig,
BackoffLimitedRetryHandler backoffLimite
@Override
public SshClient create(HostAndPort socket, LoginCredentials
credentials) {
- SshClient client = new JschSshClient(proxyConfig,
@@ -156,6 +157,15 @@ public String getPrivateKey() {
}
/**
+* @return true if there is a private key attached that is not encrypted
+*/
+ public boolean hasUnencryptedPrivateKey() {
+ return getPrivateKey() != null
+ !getPrivateKey().isEmpty()
+
@@ -152,7 +163,7 @@ public void clear() {
}
@Override
- public Session create() throws Exception {
+ public synchronized Session create() throws Exception {
I'd say yes. There is no direct use case in jclouds where a client is
shared between multiple actors, so I'd just remove
[jclouds-pull-requests
#700](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/700/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38724118
Only the minor question about a possible case-insensitive check for the
encrypted header from me, otherwise +1 - looks good. @nacx: Any more
questions from you?
I guess we want want to backport this to 1.7.x? And we should probably create
an issue for this, just for housekeeping...
---
Reply
[jclouds » jclouds
#958](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/958/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
[jclouds-pull-requests
#703](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/703/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38746443
Only the minor question about a possible case-insensitive check for the
encrypted header from me
@demobox Reading [the spec of the Proc-Type
header](http://tools.ietf.org/html/rfc1421#section-4.6.1.1) it seems that the
possible values are fixed and uppercase, so I'm ok with the current check
Just seen that the comparison is now case-insensitive. A case-sensitive check,
as it was done before, seems more correct. Mind changing this last small bit?
I'll merge it afterwards.
---
Reply to this email directly or view it on GitHub:
[jclouds-java-7-pull-requests
#1173](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1173/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38747539
so I'm ok with the current check being case sensitive
Thanks for checking the spec, @nacx. Lazy me :-( Good to go on this one - just
the usual squash'n'rebase, and an issue number!
---
Reply to this email directly or view it on GitHub:
Case insensitive now.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38771519
[jclouds » jclouds
#944](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/944/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
[jclouds-pull-requests
#688](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/688/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38534192
Squashed the commits since they didn't add any information and got rid of the
last pesky checkstyle violation. Ended up being a missing newline at the end of
a file - just couldn't see that in the UI. Had to log into the jenkins server
and dig out the xml report to see that.
Anyway this single
[jclouds » jclouds
#945](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/945/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
[jclouds-java-7-pull-requests
#1159](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1159/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38539081
+return ConnectorFactory.getDefault().createConnector();
+ } catch (final AgentProxyException e) {
+return new Connector() {
+ @Override
+ public void query(Buffer buffer) throws AgentProxyException {
+ throw new
@@ -122,15 +127,21 @@ public Builder from(SessionConnection in) {
.connectTimeout(in.connectTimeout).sessionTimeout(in.sessionTimeout);
}
+ public Builder agentConnector(Connector agentConnector) {
+ this.agentConnector = agentConnector;
+
+ }
+ @Override
+ public boolean isAvailable() {
+ return false;
+ }
+ @Override
+ public String
@@ -136,10 +156,15 @@ public SSHClient create() throws Exception {
ssh.connect(hostAndPort.getHostText(),
hostAndPort.getPortOrDefault(22));
if (loginCredentials.getPassword() != null) {
ssh.authPassword(loginCredentials.getUser(),
loginCredentials.getPassword());
@@ -34,6 +34,12 @@
}
+ interface SshAgentAvailable {
+
+ boolean isSshAgentAvailable();
+
+ }
[minor] Remove blank lines and rename to something like `SshAgentFeatureFlag`
or `SshClientFeatures` or so?
---
Reply to this email directly or view it on GitHub:
@@ -156,6 +157,15 @@ public String getPrivateKey() {
}
/**
+* @return true if there is a private key attached that is not encrypted
+*/
+ public boolean hasUnencryptedPrivateKey() {
+ return getPrivateKey() != null
+ !getPrivateKey().isEmpty()
+
@@ -160,11 +171,14 @@ public Session create() throws Exception {
session.setTimeout(sessionTimeout);
if (loginCredentials.getPrivateKey() == null) {
session.setPassword(loginCredentials.getPassword());
- } else {
-
byte[] privateKey = loginCredentials.getPrivateKey().getBytes();
jsch.addIdentity(loginCredentials.getUser(), privateKey, null,
emptyPassPhrase);
+ } else {
Simply `} else if {`?
---
Reply to this email directly or view it on GitHub:
injector.injectMembers(client);// add logger
return client;
}
}
+ private static class AgentProvider implements ProviderConnector,
SshClient.SshAgentAvailable {
+
+ @Override
+ public Connector get() {
+ try {
+return
+ }
+ @Override
+ public boolean isAvailable() {
+ return false;
+ }
+ @Override
+ public String
@@ -58,9 +65,40 @@ public Factory(BackoffLimitedRetryHandler
backoffLimitedRetryHandler, Injector i
@Override
public SshClient create(HostAndPort socket, LoginCredentials
credentials) {
- SshClient client = new SshjSshClient(backoffLimitedRetryHandler,
socket,
+ public boolean isAvailable() {
+ return false;
+ }
+ @Override
+ public String getName() {
+ return agent-unavailable;
+ }
+};
+ }
+ }
+
+ @Override
Also thanks from me for the cleanup, @psiniemi! Just a curiosity question: why
do we actually need the connector wrapper class? Could we configure Guice to
try to inject the JSch connector _directly_, or do we need a new instance for
every connection? In that case, perhaps make it a factory
@@ -156,6 +157,15 @@ public String getPrivateKey() {
}
/**
+* @return true if there is a private key attached that is not encrypted
+*/
+ public boolean hasUnencryptedPrivateKey() {
+ return getPrivateKey() != null
+ !getPrivateKey().isEmpty()
+
[jclouds » jclouds
#946](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/946/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
[jclouds-pull-requests
#690](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/690/) UNSTABLE
Looks like there's a problem with this pull request
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38555608
[jclouds-java-7-pull-requests
#1161](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1161/)
FAILURE
Looks like there's a problem with this pull request
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38556586
[jclouds » jclouds
#947](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/947/) FAILURE
Looks like there's a problem with this pull request
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
[jclouds-pull-requests
#691](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/691/) FAILURE
Looks like there's a problem with this pull request
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38557724
[jclouds » jclouds
#948](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/948/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
byte[] privateKey = loginCredentials.getPrivateKey().getBytes();
jsch.addIdentity(loginCredentials.getUser(), privateKey, null,
emptyPassPhrase);
+ } else {
The checkArgument above makes the resulting else branch impossible to reach...
---
Reply to this email
[jclouds-pull-requests
#692](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/692/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38629249
[jclouds-java-7-pull-requests
#1162](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1162/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38629843
[jclouds » jclouds
#941](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/941/) FAILURE
Looks like there's a problem with this pull request
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
[jclouds-java-7-pull-requests
#1156](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1156/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38470229
[jclouds-pull-requests
#687](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/687/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38475747
[jclouds-java-7-pull-requests
#1157](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1157/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38476265
[jclouds » jclouds
#943](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/943/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
@@ -86,6 +86,16 @@
artifactIdjsch/artifactId
scopecompile/scope
/dependency
+dependency
+ groupIdcom.jcraft/groupId
+ artifactIdjsch.agentproxy.jsch/artifactId
+ version0.0.7/version
+/dependency
+dependency
+ groupIdcom.jcraft/groupId
@@ -128,23 +132,44 @@ public JschSshClient(ProxyConfig proxyConfig,
BackoffLimitedRetryHandler backoff
this.user = checkNotNull(loginCredentials,
loginCredentials).getUser();
this.host = checkNotNull(socket, socket).getHostText();
checkArgument(socket.getPort() 0, ssh
}
sessionConnection =
SessionConnection.builder().hostAndPort(HostAndPort.fromParts(host,
socket.getPort())).loginCredentials(
loginCredentials).proxy(checkNotNull(proxyConfig,
proxyConfig)).connectTimeout(timeout).sessionTimeout(timeout).build();
}
@@ -67,5 +70,19 @@ public SshClient create(HostAndPort socket,
LoginCredentials credentials) {
injector.injectMembers(client);// add logger
return client;
}
+
+ @Override
+ public boolean existsSshAgent() {
+ try {
Could do that (reuse
@@ -128,23 +132,44 @@ public JschSshClient(ProxyConfig proxyConfig,
BackoffLimitedRetryHandler backoff
this.user = checkNotNull(loginCredentials,
loginCredentials).getUser();
this.host = checkNotNull(socket, socket).getHostText();
checkArgument(socket.getPort() 0, ssh
+exception
+ conflictingDependencies
+dependency
+ groupIdcom.jcraft/groupId
+ artifactIdjsch.agentproxy.core/artifactId
+ version0.0.7/version
+/dependency
+
byte[] privateKey = loginCredentials.getPrivateKey().getBytes();
jsch.addIdentity(loginCredentials.getUser(), privateKey, null,
emptyPassPhrase);
+ } else {
+ Connector con = JschSshClient.getSSHAgentConnector();
Where should that code go? Interfaces in
Now there is duplicated code in the factories, but I guess they should be
totally independent anyways.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38266301
[jclouds-pull-requests
#677](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/677/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38268628
[jclouds-java-7-pull-requests
#1147](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1147/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38268926
[jclouds-pull-requests
#678](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/678/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38269362
[jclouds-java-7-pull-requests
#1148](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1148/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38269657
[jclouds » jclouds
#932](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/932/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
[jclouds-pull-requests
#679](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/679/) UNSTABLE
Looks like there's a problem with this pull request
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38273093
[jclouds-java-7-pull-requests
#1149](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1149/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38273580
jclouds-pull-requests #679 UNSTABLE
Not sure if these are [real test
failures](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/org.apache.jclouds.api$s3/679/testReport/junit/org.jclouds.s3.filters/RequestAuthorizeSignatureTest/testIdempotent/)
or not...they're certainly not our
[jclouds » jclouds
#933](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/933/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
Would be nice to get the jenkins conf you run to get these so I could test
these myself. Pure mvn clean install gives me no errors.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38277678
jclouds » jclouds #934 FAILURE
Another [GitHub
timeout](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/934/console)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38278954
[jclouds-pull-requests
#680](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/680/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38285366
[jclouds-java-7-pull-requests
#1150](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1150/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38285959
jclouds-pull-requests #680 SUCCESS
jclouds-java-7-pull-requests #1150 SUCCESS
Bingo ;-)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38286311
Sounds great :)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/312#issuecomment-38292692
@@ -31,7 +31,7 @@
interface Factory {
SshClient create(HostAndPort socket, LoginCredentials credentials);
-
+ boolean existsSshAgent();
`hasSshAgent`? Or is the SSH agent not really something the client _has_,
rather something it _talks to_?
---
Reply to this email
}
sessionConnection =
SessionConnection.builder().hostAndPort(HostAndPort.fromParts(host,
socket.getPort())).loginCredentials(
loginCredentials).proxy(checkNotNull(proxyConfig,
proxyConfig)).connectTimeout(timeout).sessionTimeout(timeout).build();
}
}
sessionConnection =
SessionConnection.builder().hostAndPort(HostAndPort.fromParts(host,
socket.getPort())).loginCredentials(
loginCredentials).proxy(checkNotNull(proxyConfig,
proxyConfig)).connectTimeout(timeout).sessionTimeout(timeout).build();
}
@@ -128,23 +132,44 @@ public JschSshClient(ProxyConfig proxyConfig,
BackoffLimitedRetryHandler backoff
this.user = checkNotNull(loginCredentials,
loginCredentials).getUser();
this.host = checkNotNull(socket, socket).getHostText();
checkArgument(socket.getPort() 0, ssh
}
sessionConnection =
SessionConnection.builder().hostAndPort(HostAndPort.fromParts(host,
socket.getPort())).loginCredentials(
loginCredentials).proxy(checkNotNull(proxyConfig,
proxyConfig)).connectTimeout(timeout).sessionTimeout(timeout).build();
}
}
sessionConnection =
SessionConnection.builder().hostAndPort(HostAndPort.fromParts(host,
socket.getPort())).loginCredentials(
loginCredentials).proxy(checkNotNull(proxyConfig,
proxyConfig)).connectTimeout(timeout).sessionTimeout(timeout).build();
}
+ !loginCredentials.getPrivateKey().isEmpty()
+ !loginCredentials.getPrivateKey().contains(Proc-Type:
4,ENCRYPTED);
+ }
+
+ static Connector getSSHAgentConnector() {
+ JSch.setConfig(PreferredAuthentications, publickey);
+ ConnectorFactory cf =
byte[] privateKey = loginCredentials.getPrivateKey().getBytes();
jsch.addIdentity(loginCredentials.getUser(), privateKey, null,
emptyPassPhrase);
+ } else {
+ Connector con = JschSshClient.getSSHAgentConnector();
If we go for an injectable factory/supplier
byte[] privateKey = loginCredentials.getPrivateKey().getBytes();
jsch.addIdentity(loginCredentials.getUser(), privateKey, null,
emptyPassPhrase);
+ } else {
+ Connector con = JschSshClient.getSSHAgentConnector();
+ if(con != null ){
[minor]
byte[] privateKey = loginCredentials.getPrivateKey().getBytes();
jsch.addIdentity(loginCredentials.getUser(), privateKey, null,
emptyPassPhrase);
+ } else {
+ Connector con = JschSshClient.getSSHAgentConnector();
+ if(con != null ){
+
@@ -67,5 +70,19 @@ public SshClient create(HostAndPort socket,
LoginCredentials credentials) {
injector.injectMembers(client);// add logger
return client;
}
+
+ @Override
+ public boolean existsSshAgent() {
+ try {
+
@@ -67,5 +70,19 @@ public SshClient create(HostAndPort socket,
LoginCredentials credentials) {
injector.injectMembers(client);// add logger
return client;
}
+
+ @Override
+ public boolean existsSshAgent() {
+ try {
Reuse
@@ -206,4 +217,13 @@ public String toString() {
sessionTimeout, sessionTimeout).toString();
}
+ private static ListAuthMethod getAuthMethods(AgentProxy agent) throws
Exception {
Narrow the list of exception types thrown here?
---
Reply to this email
OpenSSHKeyFile key = new OpenSSHKeyFile();
key.init(loginCredentials.getPrivateKey(), null);
ssh.authPublickey(loginCredentials.getUser(), key);
+ } else {
+ AgentProxy proxy= SshjSshClient.getSSHAgentProxy();
[minor] Space before `=`
---
Reply to
@@ -206,4 +217,13 @@ public String toString() {
sessionTimeout, sessionTimeout).toString();
}
+ private static ListAuthMethod getAuthMethods(AgentProxy agent) throws
Exception {
+ Identity[] identities = agent.getIdentities();
+ ListAuthMethod
1 - 100 of 132 matches
Mail list logo