mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-641: Merge use "KeyPair" typed field for private key only if non-empty.
This commit is contained in:
@@ -434,8 +434,11 @@ public class KsmRecordService {
|
||||
|
||||
// Attempt to find single matching keypair field
|
||||
KeyPairs keyPairsField = getField(record, KeyPairs.class, PRIVATE_KEY_LABEL_PATTERN);
|
||||
if (keyPairsField != null)
|
||||
return CompletableFuture.completedFuture(getSingleValue(keyPairsField.getValue(), KeyPair::getPrivateKey));
|
||||
if (keyPairsField != null) {
|
||||
String privateKey = getSingleValue(keyPairsField.getValue(), KeyPair::getPrivateKey);
|
||||
if (privateKey != null && !privateKey.isEmpty())
|
||||
return CompletableFuture.completedFuture(privateKey);
|
||||
}
|
||||
|
||||
// Lacking a typed keypair field, prefer a PEM-type attachment
|
||||
KeeperFile keyFile = getFile(record, PRIVATE_KEY_FILENAME_PATTERN);
|
||||
|
Reference in New Issue
Block a user