[Twisted-Python] Isolating ISFTPServer in Conch's SFTP
z3p at twistedmatrix.com
Sun Mar 21 13:21:17 EST 2004
On Sun, 2004-03-14 at 22:00, Andy Gayton wrote:
> I'm looking to create a filesystem backend for twisted that could be
> used by any filelike twisted application (sftp, webdav etc).
> I've got a proof of concept filesystem interface working - IFileSystem
> .. not the best of names ;), which I'm about to try and sftp into.
> ISFTPServer is a nice clean interface which it'd be easy to write an
> adapter for from my IFileSystem - but its implementation is bolted into
> FileTransferServer along with a bunch of protocol stuff ..
> I had been vaguely planning to break ISFTPServer's implementation out of
> FileTransferServer and move it into a realm avatar when I got this far
> so different users could have different filesystems but now that I get
> to looking at it - FileTransferServer is brought into existance when a
> sftp sybsystem is requested by the sftp client, which happens after
> authentication ..
> It's beginning to look like most of conch/ssh/session.py would need to
> move into an avatar - so the avatar for a given user could be asked for
> a shell, or a sftp subsystem and they would get the right shell/ sftp
> onto a filesystem for that user ..
Yes, this does need to happen. The code that creates shells, executes
files, and connects to file systems needs to be connected to ISSHUser,
not Session. Unfortunatly, I can't think of a way to do it that doesn't
seem ugly. Just adding methods like 'openShell(channel)' to ISSHUser
seems silly when there are many more possibilities of connections for a
Conch server. There should be a clever way to do this with Interfaces
and Adaptors, but I can't think of it.
> I was hoping that Paul, or someone else may have some thoughts in this
> area to guide me ..
The only thought I had was an LJ post
(http://z3p.livejournal.com/324865.html), but I'm having trouble turning
that idea into code. Maybe I can convince some Twisted folks at PyCon
to help me out ;)
(o_ z3p at twistedmatrix dot com
V_/_ AIM: Z3Penguin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20040321/94a033a4/attachment.pgp
More information about the Twisted-Python