mirror of https://github.com/apache/jclouds.git
Log information according to the auth precedence
This commit is contained in:
parent
bc97afc0c1
commit
edbb2c0e6f
|
@ -131,15 +131,15 @@ public class JschSshClient implements SshClient {
|
|||
checkArgument(loginCredentials.getOptionalPassword().isPresent() || loginCredentials.hasUnencryptedPrivateKey() || agentConnector.isPresent(),
|
||||
"you must specify a password, a key or an SSH agent needs to be available");
|
||||
this.backoffLimitedRetryHandler = checkNotNull(backoffLimitedRetryHandler, "backoffLimitedRetryHandler");
|
||||
if (loginCredentials.getOptionalPassword().isPresent()) {
|
||||
this.toString = String.format("%s:pw[%s]@%s:%d", loginCredentials.getUser(),
|
||||
base16().lowerCase().encode(md5().hashString(loginCredentials.getOptionalPassword().get(), UTF_8).asBytes()), host,
|
||||
socket.getPort());
|
||||
} else if (loginCredentials.hasUnencryptedPrivateKey()) {
|
||||
if (loginCredentials.hasUnencryptedPrivateKey()) {
|
||||
String fingerPrint = fingerprintPrivateKey(loginCredentials.getOptionalPrivateKey().get());
|
||||
String sha1 = sha1PrivateKey(loginCredentials.getOptionalPrivateKey().get());
|
||||
this.toString = String.format("%s:rsa[fingerprint(%s),sha1(%s)]@%s:%d", loginCredentials.getUser(),
|
||||
fingerPrint, sha1, host, socket.getPort());
|
||||
} else if (loginCredentials.getOptionalPassword().isPresent()) {
|
||||
this.toString = String.format("%s:pw[%s]@%s:%d", loginCredentials.getUser(),
|
||||
base16().lowerCase().encode(md5().hashString(loginCredentials.getOptionalPassword().get(), UTF_8).asBytes()), host,
|
||||
socket.getPort());
|
||||
} else {
|
||||
this.toString = String.format("%s:rsa[ssh-agent]@%s:%d", loginCredentials.getUser(), host, socket.getPort());
|
||||
}
|
||||
|
|
|
@ -149,15 +149,15 @@ public class SshjSshClient implements SshClient {
|
|||
checkArgument(loginCredentials.getOptionalPassword().isPresent() || loginCredentials.hasUnencryptedPrivateKey() || agentConnector.isPresent(),
|
||||
"you must specify a password, a key or an SSH agent needs to be available");
|
||||
this.backoffLimitedRetryHandler = checkNotNull(backoffLimitedRetryHandler, "backoffLimitedRetryHandler");
|
||||
if (loginCredentials.getOptionalPassword().isPresent()) {
|
||||
this.toString = String.format("%s:pw[%s]@%s:%d", loginCredentials.getUser(),
|
||||
base16().lowerCase().encode(md5().hashString(loginCredentials.getOptionalPassword().get(), UTF_8).asBytes()), host,
|
||||
socket.getPort());
|
||||
} else if (loginCredentials.hasUnencryptedPrivateKey()) {
|
||||
if (loginCredentials.hasUnencryptedPrivateKey()) {
|
||||
String fingerPrint = fingerprintPrivateKey(loginCredentials.getOptionalPrivateKey().get());
|
||||
String sha1 = sha1PrivateKey(loginCredentials.getOptionalPrivateKey().get());
|
||||
this.toString = String.format("%s:rsa[fingerprint(%s),sha1(%s)]@%s:%d", loginCredentials.getUser(),
|
||||
fingerPrint, sha1, host, socket.getPort());
|
||||
} else if (loginCredentials.getOptionalPassword().isPresent()) {
|
||||
this.toString = String.format("%s:pw[%s]@%s:%d", loginCredentials.getUser(),
|
||||
base16().lowerCase().encode(md5().hashString(loginCredentials.getOptionalPassword().get(), UTF_8).asBytes()), host,
|
||||
socket.getPort());
|
||||
} else {
|
||||
this.toString = String.format("%s:rsa[ssh-agent]@%s:%d", loginCredentials.getUser(),
|
||||
host, socket.getPort());
|
||||
|
|
Loading…
Reference in New Issue