GUACAMOLE-1643: Ensure connection groups with an empty KSM config attribute fall back to the global config.

This commit is contained in:
James Muehlner
2022-07-21 23:25:25 +00:00
parent a11b9a9ae4
commit 492dbf48d6

View File

@@ -276,9 +276,10 @@ public class KsmSecretService implements VaultSecretService {
if (group == null) if (group == null)
break; break;
// If the current connection group has the KSM configuration attribute, return immediately // If the current connection group has the KSM configuration attribute
// set to a non-empty value, return immediately
String ksmConfig = group.getAttributes().get(KsmAttributeService.KSM_CONFIGURATION_ATTRIBUTE); String ksmConfig = group.getAttributes().get(KsmAttributeService.KSM_CONFIGURATION_ATTRIBUTE);
if (ksmConfig != null) if (ksmConfig != null && !ksmConfig.trim().isEmpty())
return ksmConfig; return ksmConfig;
// Otherwise, keep searching up the tree until an appropriate configuration is found // Otherwise, keep searching up the tree until an appropriate configuration is found
@@ -287,6 +288,7 @@ public class KsmSecretService implements VaultSecretService {
// If no KSM configuration was ever found, use the default value // If no KSM configuration was ever found, use the default value
return confService.getKsmConfig(); return confService.getKsmConfig();
} }
@Override @Override