[Twisted-Python] potential connectSSH workflow

glyph at divmod.com glyph at divmod.com
Thu Jul 26 16:13:51 EDT 2007

On 05:49 pm, paulswartz at gmail.com wrote:
>I've written up a potential workflow for connectSSH, a simplified way
>of using Twisted Conch.  It's available at
>http://z3p.jot.com/WikiHome/SummerOfCode2007/connectSSH.  If those who
>are interested could take a look, I'd love some feedback.

Thanks a lot!  Here are my initial impressions:

The bundle of crud that lives in ~/.ssh should be represented as an 
object.  connectSSH should really be a method on that object, so that 
things like host key verification can happen as normal and expected. 
This is especially true because that object can have references to other 
objects, such as the (Deferred-returning) UI for authorizing or denying 
an unexpected host key.  That object could also be more easily tested 
because the reactor could be an attribute of it rather than a global 
import.  Unfortunately there's a lot of code in Twisted that doesn't do 
this yet, but we should be building better use of that singleton.  See 

(On a tangent, this is similar to the fact that in the next-generation 
HTTP API, there should be a "browser" object for indirecting the 
reactor, but also for persisting cookies, HTTP authorization headers, 
and the like.  A free function for doing a connectSSH is lame for many 
of the same reasons that getPage() is lame.)

This also looks like an excellent use-case for endpoints.  Please see 
this ticket:
and see if you have any feedback there.

What do you think?

More information about the Twisted-Python mailing list