Skip to content

Commit

Permalink
GUACAMOLE-1868: Add support for new PAM Hostname field.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuehlner committed Oct 19, 2023
1 parent 3514a21 commit a8fea18
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.keepersecurity.secretsManager.core.KeyPair;
import com.keepersecurity.secretsManager.core.KeyPairs;
import com.keepersecurity.secretsManager.core.Login;
import com.keepersecurity.secretsManager.core.PamHostnames;
import com.keepersecurity.secretsManager.core.Password;
import com.keepersecurity.secretsManager.core.SecretsManager;
import com.keepersecurity.secretsManager.core.Text;
Expand Down Expand Up @@ -60,7 +61,7 @@ public class KsmRecordService {
* hostnames/addresses.
*/
private static final Pattern HOSTNAME_LABEL_PATTERN =
Pattern.compile("hostname|(ip\\s*)?address", Pattern.CASE_INSENSITIVE);
Pattern.compile("(pam)?hostname|(ip\\s*)?address", Pattern.CASE_INSENSITIVE);

/**
* Regular expression which matches the labels of custom fields containing
Expand Down Expand Up @@ -411,6 +412,11 @@ public String getHostname(KeeperRecord record) {
if (hostsField != null)
return getSingleStringValue(hostsField.getValue(), Host::getHostName);

// Next, try a PAM hostname
PamHostnames pamHostsField = getField(record, PamHostnames.class, null);
if (pamHostsField != null)
return getSingleStringValue(pamHostsField.getValue(), Host::getHostName);

KeeperRecordData data = record.getData();
List<KeeperRecordField> custom = data.getCustom();

Expand Down

0 comments on commit a8fea18

Please sign in to comment.