-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
[Request] Remove dependency of Renci.SshNet.Async #59
Comments
Can you make a PR for this, upgrading SSH.NET to the latest, as well as including the fixes you mentioned? It would be highly appreciated. Thanks. |
I'll get onto that tomorrow for you. I won't be certain the way I used IAsyncEnumerable is the correct way though. I'll see if I can run the in project tests to ensure I test all target frameworks as well. |
So with the stuff I said above regarding I did this change as a part of #56 |
Thanks, if you are done with this, please close this ticket. |
Yep this one is all sorted. Thanks for accepting all those PRs so quickly |
The nuget package Renci.SshNet.Async appears rather out of date. On its own it has a dependency of SSH.NET v2016.1.0 which indicates that it has a vulnerability with moderate severity. There is an issue created 12 months ago which asked to bump the dependency but nothing came of it. Consdering FluentStorage.SFTP uses later versions (see below) It appears that the package just needs csporj text edit and no other major changes.
This isn't as much of an issue for FluentStorage.SFTP as it currently has a dependency of
SSH.NET (>= 2020.0.2)
across all target platforms. So by default people using FluentStorage.SFTP do not have this problem to worry about.However if you attempt to manually update SSH.NET to 2023.0.0 or even 2023.0.1 you will get an error while attempting to call
ListDirectories
I don't know if this is due to SSH.NET having targets of .NET 6 and higher (and also .NET framework, and other things) while Renci.SshNet.Async package only has
netstandard1.3;net40;uap10.0
.Playing around locally if I remove
using Renci.SshNet.Async
from SshNetSftpBlobStorage I get 2 errors. Both are calls toclient.ListDirectoryAsync(
which are here and here.It looks like the people working on SSH.NET took on a dependency of
Microsoft.Bcl.AsyncInterfaces
to allow IAsyncEnumerable on frameworks that don't support it (here). I don't know how that would work here but it looks similar as this project also targetsnetstandard2.0
and up.As for code changes, I have never used IAsyncEnumerable but I hacked this together which hopefully is a starting off point for someone who knows how to use this better.
I first changed
to
and then later on
to
(note: this doesn't use
options.BrowseFilter
, nor does it really make any use ofoptions.MaxResults.Value
).With this I am able to push SSH.NET to 2023.0.1 in my test project which is a .NET MAUI app targeting .NET 8). My test project only ever calls
ListAsync
and neverGetBlobsAsync
so I don't know if that first half of the code even works correctly. I just know that it compiles and works for my use case here.The text was updated successfully, but these errors were encountered: