-
-
Notifications
You must be signed in to change notification settings - Fork 361
feat: rust-native ssh support #2081
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
base: main
Are you sure you want to change the base?
Conversation
The `russh` feature shouldn't require `async-std`, but that feature was gating the whole async subsystem, so this moves things around a little.
9a88795
to
6b91e82
Compare
This is just WOW! I am truly amazed by this being tackled as a contribution, and hope to have some time to take a look at the code soon.Also thanks so much for the detailed PR notes, I found them very helpful to get a first understanding on what's planned and how. First of all, I agree that it might be best to get this to work as proof-of-concept, but also think that this means it has to be wired up with Regarding |
Super happy to help.
It's available in
I think the solution would be to have
Nice, yeah I'd be happy to do that... if you can provide some guidance and I can try to tackle that. |
Thanks for elaborating.
It's generally fine to adjust the API to be more suitable. The reason it is what it is is merely that the requirements allows for it, and it was easiest to do it that way. Having just one argument there would probably shift the complexity elsewhere in the code, but it might still be preferable if mostly Besides that, I don't know if anything can be done about the cargo-deny error, pulling in a 'broken' dependency without mitigation doesn't seem great. Maybe there is a Cargo feature to toggle it off?
it looks like in order to use this transport, the caller would have to pass in a custom one to the |
Indeed, though in this case it seems a bit challenging to remove this required split. In fact, it looks like it might come from the blocking implementation due to the
AFAICT, there's no feature for turning-on/off Does this cargo-deny error prevent this PR from being merged? If so, I might try to contribute that feature to russh.
The issue I see with integrating it with It looks like russh has another crate that supports parsing Also, for supporting this in enum SshVariant {
Program(ProgramKind),
Native,
} The upside is that it wouldn't require "inventing" a protocol making this a bit more idiomatic. The downside is that it would no longer be per-remote (AFAICT), but per-repo. WDYT? |
Yes, that's correct, and I remember it as helpful when implementing the 'first read, then write' semantics.
That's great to see, it really does look like it will be fixed soon enough to not be in the way of a merge here.
Maybe I could also imagine to ignore the error per
Probably out of ignorance I thought that having possibly hacky PoC behaviour would suffice, all tuned to allow manual testing on the command-line. This could be trying all keys available to the agent, or setting an identity through an environment variable.
Ultimately, if the implementation should be more than niche with the potential to replace calling out to the
That's a great idea and I love being (then) able to set this using the git configuration. Doing so would probably only be temporary anyway as I'd imagine this transport to then be an optional replacement for the current |
This is a very basic implementation of a rust-native SSH transport (#1246). I've got as far as a successful
handshake
method call.The approach used is:
russh
and declare a new feature to enable itTransport
traitfutures_io
AsyncRead/Write
traits to Tokio'sAsyncRead/Write
(this was pretty involved, maybe there's a simpler way)The PR lacks the following:
Option
struct for now and let people add options as they need themHandler
implementation, things like detecting disconnects or channel failures of some kind