Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to change the sftp server's initial root path #3128

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

boucaud
Copy link

@boucaud boucaud commented Sep 11, 2019

When using the sftp server to download files from a specific folder, girder users have to navigate through various subdirectories before finding the content they wish to download (typically /user/username/Private/folder).

We would like to add an option to simplify this process, and directly expose to users the contents of the folder they are intended to download from.

These proposed changes add a configurable path parameter to the sftp server, that would let plugin developpers change the server's root if they wish. It is probably not the best way to do this, which is why we would like feedback on this.

@zachmullen
Copy link
Member

This is an interesting idea. If the plan is to use this in a plugin context, is it possible to do via extension rather than modification of the existing class? Or put another way, is there a way to slightly tweak the base class to make this specific extension straightforward, without having to encode the concept of rootPath or :girderUser in the base class?

@boucaud
Copy link
Author

boucaud commented Sep 12, 2019

Hi, I think we're going to try and do this via a plugin. I will keep this updated should any issues arise. Thanks.

@boucaud
Copy link
Author

boucaud commented Sep 16, 2019

After consideration, it is impossible right now to extend _SftpServerAdapter without also changing _SFTPRequestHandler's setup method and SftpServer's constructor, which leads to a bit of duplication.

It would be useful to change SftpServer and _SftpRequestHandler so that they can take optional classes in their constructors (and thus allow us to use a modified _SftpServerAdapter without reimplementing the other classes).

@zachmullen, would it be ok ?

@zachmullen
Copy link
Member

Sounds great!

girder/api/sftp.py Outdated Show resolved Hide resolved
@boucaud
Copy link
Author

boucaud commented Sep 18, 2019

Does the _processPath change seem fine as well ?

@boucaud boucaud changed the title RFC: Add an option to change the sftp server's initial root path Add an option to change the sftp server's initial root path Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants