Skip to content

Commit

Permalink
[chore] Remove deps on SSH credentials implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
Dohbedoh committed Aug 5, 2024
1 parent a2ddfba commit 6e48666
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator;
import com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticatorFactory;
import com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPassword;
import com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator;
import com.cloudbees.plugins.credentials.CredentialsScope;
import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials;
import com.trilead.ssh2.Connection;
Expand Down Expand Up @@ -83,8 +82,8 @@ public void tearDown() {
public void dontTestKeyboardInteractive() throws Exception {
connection = new Connection("localhost");
connection.connect(new NoVerifier());
com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator instance =
new com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator(connection, new BasicSSHUserPassword(CredentialsScope.SYSTEM,
TrileadSSHPasswordAuthenticator instance =
new TrileadSSHPasswordAuthenticator(connection, new BasicSSHUserPassword(CredentialsScope.SYSTEM,
null, "....", // <---- put your username here
"....", // <---- put your password here
null));
Expand All @@ -105,7 +104,7 @@ public void testPassword() throws Exception {
int port = (Integer)invoke(sshd, "getPort", null, null);
connection = new Connection("localhost", port);
connection.connect(new NoVerifier());
com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator instance =
TrileadSSHPasswordAuthenticator instance =
new TrileadSSHPasswordAuthenticator(connection, user);
assertThat(instance.getAuthenticationMode(), is(SSHAuthenticator.Mode.AFTER_CONNECT));
assertThat(instance.canAuthenticate(), is(true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator;
import com.cloudbees.jenkins.plugins.sshcredentials.SSHUserPrivateKey;
import com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator;
import com.cloudbees.plugins.credentials.CredentialsDescriptor;
import com.cloudbees.plugins.credentials.CredentialsScope;
import com.cloudbees.plugins.credentials.common.StandardUsernameCredentials;
Expand Down Expand Up @@ -148,7 +147,7 @@ public void testAuthenticate() throws Exception {
int port = (Integer)invoke(sshd, "getPort", null, null);
connection = new Connection("localhost", port);
connection.connect((hostname, port1, serverHostKeyAlgorithm, serverHostKey) -> true);
com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator instance =
TrileadSSHPublicKeyAuthenticator instance =
new TrileadSSHPublicKeyAuthenticator(connection, user);
assertThat(instance.getAuthenticationMode(), is(SSHAuthenticator.Mode.AFTER_CONNECT));
assertThat(instance.canAuthenticate(), is(true));
Expand Down

0 comments on commit 6e48666

Please sign in to comment.