Skip to content

Conversation

benesch
Copy link
Contributor

@benesch benesch commented Jun 2, 2023

It may be important to have the SSH server perform DNS resolution, as the client often does not use the same DNS server as the server.

We ran into this issue at @MaterializeInc, where we use openssh to set up SSH tunnels via bastion hosts. Our customers often want to establish a tunnel to connect to a host whose name is not resolvable on the client side of the tunnel.

@jonhoo
Copy link
Collaborator

jonhoo commented Jun 2, 2023

This change is Reviewable

@codecov-commenter
Copy link

codecov-commenter commented Jun 3, 2023

Codecov Report

Merging #120 (34404a2) into master (a471aa2) will decrease coverage by 0.16%.
The diff coverage is 44.44%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
Impacted Files Coverage Δ
src/port_forwarding.rs 54.54% <44.44%> (-0.46%) ⬇️

@benesch
Copy link
Contributor Author

benesch commented Jun 3, 2023

Thanks for the review, @NobodyXu. Sorry for the terse PR description last night; filed in a rush. Added some more context to the description now.

@NobodyXu
Copy link
Member

NobodyXu commented Jun 3, 2023

@benesch Please run cargo fmt locally and fix the format.
Thanks!

It may be important to have the SSH server perform DNS resolution, as
the client often does not use the same DNS server as the server.
@benesch
Copy link
Contributor Author

benesch commented Jun 3, 2023

Whoops, sorry about that! Done.

@NobodyXu NobodyXu merged commit 3319a81 into openssh-rust:master Jun 3, 2023
Comment on lines +109 to +111
pub fn new<'a, S>(host: S, port: u16) -> Socket<'a>
where
S: Into<Cow<'a, str>>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This changes the public api, and so would end up requiring a major version bump. Would you mind making this a separate constructor instead?

cc @NobodyXu we have to be a little careful about these kinds of changes. Maybe we should add a CI step that invokes https://github.com/obi1kenobi/cargo-semver-checks or https://github.com/Enselic/cargo-public-api to catch these things automatically (at least in most cases).

Copy link
Member

Choose a reason for hiding this comment

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

This changes the public api, and so would end up requiring a major version bump. Would you mind making this a separate constructor instead?

Sure, but with #131 we probably need a breaking change anyway.

cc @NobodyXu we have to be a little careful about these kinds of changes. Maybe we should add a CI step that invokes https://github.com/obi1kenobi/cargo-semver-checks or https://github.com/Enselic/cargo-public-api to catch these things automatically (at least in most cases).

Yeah, we definitely need semver-checking in CI.

Choose a reason for hiding this comment

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

I'm sorry to chime in, I saw the stream and think there's common mistake regarding SemVer and the zero major version you might not be aware of (and I learned recently as well). :-)

My comment is just for info, choose whatever version you want. I just want to give some hint.

This changes the public api, and so would end up requiring a major version bump.

Technically, there's no need to bump the major version, because 1.0.0 hasn't been released yet. Therefore, everything so far is "initial development".

The following is cited from SemVer spec:

Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

Copy link
Collaborator

@jonhoo jonhoo Aug 14, 2023

Choose a reason for hiding this comment

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

@stephan-cr in Rust, when the leftmost version number component is a 0, then the next digit over is effectively considered the major version. That's what I was referring to bumping. Updating x in 0.x has the same effect and implications as bumping x in x.0, and so it is still considered (and referred to) as a major version bump.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a user here, so discount my opinion appropriately, but strong preference from me for a semver-breaking release with just the new API, rather than a backcompatible release that includes both APIs! The existing API is, AFAICT, not possible to use correctly with remote port forwarding, and so forcing users into the new API seems worth the breakage to me.

(Earlier discussion on this: #120 (comment))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants