Skip to content

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

Merged
Xuanwo merged 7 commits intoapache:mainfrom
silver-ymz:sftp
May 1, 2023
Merged

feat(services/sftp): Add read/write/stat support for sftp#2186
Xuanwo merged 7 commits intoapache:mainfrom
silver-ymz:sftp

Conversation

@silver-ymz
Copy link
Copy Markdown
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.

Comment thread core/Cargo.toml
Copy link
Copy Markdown
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
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.

2 participants