-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Allow arbitrary sshOptions to be passed to ssh2 #119
Conversation
This allows for an arbitrary `sshOptions` to be passed in `Modem` options and be used when passed to the `ssh` constructor to get an agent from the `ssh2` library. Tests are added to be sure we're still respecting the `SSH_AUTH_SOCK` env var.
I think we need to keep |
Good point @bwateratmsft. Does bde24db address what you were thinking? |
Since d2f92b2, callers may be passing this option in and expect it to be used as the `agent` option for ssh2.
Yes, I think so. I guess I'd make the override happen in the other direction, i.e. only do |
@bwateratmsft is supporting a custom Definitely agree that the behavior needs to stay the same for |
That's true. In that case, I think it's fine as you have it. |
For the record, here's how I see this breaking down philosophically. On the one hand, we want to say that On the other hand, there's some interest that IMO it'd be entirely reasonable to change this so that I personally don't have a strong opinion one way or the other, just hoping this summary helps @apocas decide what is right here. |
I would like to maintain the common options outside the sshOptions, in order to maintain some standardization between the different protocols. Just like you said. I believe this is better than leaving a few options outside in order to avoid a major version bump. |
This is my opinion on the matter: https://www.youtube.com/watch?v=ussCHoQttyQ |
Yeah sure :) |
Here's a work-around I used to be able to pass arbitrary options to ssh2. In my case, I wanted to use the privateKey option without having to deploy ssh-agent:
Passing an explicit connection agent is not possible when the protocol is "ssh". docker-modem will generate its own agent on the fly, overriding one I pass. But if I pass protocol "http", that rule isn't triggered, and I can pass the ssh-based agent myself. The ssh agent passes its options through to ssh2. This side-steps the need to wait for a breaking-change major version bump for #120. |
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d6a6e90b142d6eeb4b0f3fe595987d5cce3d2d8f/types/docker-modem/index.d.ts#L34 shows that docker modems (which dockerode uses for new `Docker()` instances) now support passing through custom ssh options. Additional Info: apocas/docker-modem#119 (comment)
This allows for an arbitrary
sshOptions
to be passed inModem
options and be used when passed to thessh
constructor to get an agent from thessh2
library.Tests are added to be sure we're still respecting the
SSH_AUTH_SOCK
env var.