Skip to content
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

SSH timeout added #50

Merged
merged 6 commits into from
Mar 9, 2018
Merged

SSH timeout added #50

merged 6 commits into from
Mar 9, 2018

Conversation

ddcprg
Copy link
Contributor

@ddcprg ddcprg commented Mar 7, 2018

Fixes #49

I'll be running functional tests today, please take a look in the meantime

@ddcprg ddcprg self-assigned this Mar 7, 2018
@ddcprg ddcprg requested a review from a team March 7, 2018 09:00
Copy link
Contributor

@patduin patduin left a comment

Choose a reason for hiding this comment

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

looks good, needs a changelog change, minor version bump(?)


private @NotBlank @TunnelRoute String route;
private @Min(1) @Max(65535) int port = DEFAULT_PORT;
private String localhost = DEFAULT_LOCALHOST;
private @NotBlank String privateKeys;
private @NotBlank String knownHosts;
private @Min(0) int timeout = DEFAULT_TIMEOUT_MILLIS;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should either name this timeoutMillis to be clear what unit it is or we introduce two values here - one which is a TimeUnit and the other being the value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even if the docs say the units is millis?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I guess it's fine as long as its clearly documented.

@@ -49,6 +50,15 @@ public void typical() {
assertThat(violations.size(), is(0));
}

@Test
public void infiniteTimeout() {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should document in the README that setting it to zero means no timeout.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will document

@@ -148,4 +158,13 @@ public void blankPrivateKey() {
assertThat(violations.size(), is(1));
}

@Test
public void negativeTunnel() {
Copy link
Contributor

Choose a reason for hiding this comment

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

negativeTimeout

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, typo.. will rename

}

public SessionFactorySupplier(int sshPort, String knownHosts, List<String> identityKeys, int sshTimeout) {
Preconditions.checkArgument(0 <= sshPort && sshPort <= 65535, "Invalid SSH port number " + sshPort);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have this check both here and in the TunnelHandler but we only have the timeout check here and not in the TunnelHandler ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm improving the code, the old version does not check... the constructor is public

Copy link
Contributor

Choose a reason for hiding this comment

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

OK

@ddcprg
Copy link
Contributor Author

ddcprg commented Mar 7, 2018

This just got uglier but it works. Please take a look again and I'll try to do a release tomorrow.

@coveralls
Copy link

coveralls commented Mar 7, 2018

Coverage Status

Coverage decreased (-0.03%) to 68.77% when pulling 6696453 on issue-49 into 20d009b on master.

@ddcprg ddcprg merged commit 0833fd5 into master Mar 9, 2018
@ddcprg ddcprg deleted the issue-49 branch March 9, 2018 10:34
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.

4 participants