Skip to content
New issue

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

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

Already on GitHub? # to your account

feat(services/sftp): Add read/write/stat support for sftp #2186

Merged
merged 7 commits into from
May 1, 2023
Merged

feat(services/sftp): Add read/write/stat support for sftp #2186

merged 7 commits into from
May 1, 2023

Conversation

silver-ymz
Copy link
Member

Impl #708

This PR adds support for the sftp backend using the openssh-sftp-client library.

Misc

In the Connection struct, the sftp connection is stored while hiding the session and channel used to create the connection. However, the Channel definition requires the 'sess lifetime in its type annotation, while Session does not. To address this, the OwningHandle is used to ensure that Channel has ownership of Session to pass the lifetime check. A similar situation exists for SftpReader.

Tests

All tests have passed except for test_list_rich_dir, which seems to be an upstream issue. The problem is that it misses some files when listing a folder with many files, and an issue has been opened for it at openssh-rust/openssh-sftp-client#62.

Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bravo!

@Xuanwo Xuanwo merged commit f12b05c into apache:main May 1, 2023
@silver-ymz silver-ymz deleted the sftp branch May 1, 2023 10:35
@Xuanwo Xuanwo mentioned this pull request May 6, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants