Skip to content

Commit

Permalink
Revert "[KARAF-2789] Upgrade to SSHD 0.10.0"
Browse files Browse the repository at this point in the history
This reverts commit 898ef9d.
  • Loading branch information
jbonofre committed Feb 25, 2014
1 parent 12da0be commit 35564b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
<spring32.version>3.2.4.RELEASE</spring32.version>
<spring.security31.version>3.1.4.RELEASE</spring.security31.version>

<sshd.version>0.10.0</sshd.version>
<sshd.version>0.9.0</sshd.version>
<struts.bundle.version>1.3.10_1</struts.bundle.version>
<xbean.version>3.16</xbean.version>
<xerces.version>2.11.0</xerces.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@
import org.apache.sshd.agent.local.AgentServerProxy;
import org.apache.sshd.agent.local.ChannelAgentForwarding;
import org.apache.sshd.common.Channel;
import org.apache.sshd.common.FactoryManager;
import org.apache.sshd.common.NamedFactory;
import org.apache.sshd.common.Session;
import org.apache.sshd.common.session.ConnectionService;
import org.apache.sshd.server.session.ServerSession;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
Expand All @@ -65,8 +63,8 @@ public NamedFactory<Channel> getChannelForwardingFactory() {
return new ChannelAgentForwarding.Factory();
}

public SshAgent createClient(FactoryManager manager) throws IOException {
String proxyId = manager.getProperties().get(SshAgent.SSH_AUTHSOCKET_ENV_NAME);
public SshAgent createClient(Session session) throws IOException {
String proxyId = session.getFactoryManager().getProperties().get(SshAgent.SSH_AUTHSOCKET_ENV_NAME);
if (proxyId == null) {
throw new IllegalStateException("No " + SshAgent.SSH_AUTHSOCKET_ENV_NAME + " environment variable set");
}
Expand All @@ -81,12 +79,11 @@ public SshAgent createClient(FactoryManager manager) throws IOException {
throw new IllegalStateException("No ssh agent found");
}

public SshAgentServer createServer(ConnectionService service) throws IOException {
Session session = service.getSession();
public SshAgentServer createServer(Session session) throws IOException {
if (!(session instanceof ServerSession)) {
throw new IllegalStateException("The session used to create an agent server proxy must be a server session");
}
final AgentServerProxy proxy = new AgentServerProxy(service);
final AgentServerProxy proxy = new AgentServerProxy((ServerSession) session);
proxies.put(proxy.getId(), proxy);
return new SshAgentServer() {
public String getId() {
Expand Down

0 comments on commit 35564b9

Please sign in to comment.