GUACAMOLE-1629: Always include any pre-existing connection group attributes when exposing new ones.

This commit is contained in:
James Muehlner
2022-07-06 17:55:28 +00:00
parent 5b69bf405d
commit 374f1b5e49
2 changed files with 14 additions and 3 deletions

View File

@@ -31,10 +31,13 @@ import org.apache.guacamole.form.Form;
public interface VaultAttributeService {
/**
* Return all connection group attributes to be exposed through the admin UI.
* Return all custom connection group attributes to be exposed through the
* admin UI for the current vault implementation.
*
* @return
* All connection group attributes to be exposed through the admin UI.
* All custom connection group attributes to be exposed through the
* admin UI for the current vault implementation.
*
*/
public Collection<Form> getConnectionGroupAttributes();
}

View File

@@ -28,6 +28,9 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.GuacamoleServerException;
import org.apache.guacamole.form.Form;
@@ -425,7 +428,12 @@ public class VaultUserContext extends TokenInjectingUserContext {
@Override
public Collection<Form> getConnectionGroupAttributes() {
return attributeService.getConnectionGroupAttributes();
// Add any custom attributes to any previously defined attributes
return Stream.concat(
super.getConnectionGroupAttributes().stream(),
attributeService.getConnectionGroupAttributes().stream()
).collect(Collectors.toUnmodifiableList());
}
}