From 0fc7c03d7033fd99b799c82288801a77acc43263 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 21 Oct 2021 00:56:37 -0700 Subject: [PATCH] GUACAMOLE-957: Allow single-element array values for YAML LDAP configuration to be specified as simple strings. --- .../guacamole/auth/ldap/conf/JacksonLDAPConfiguration.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/JacksonLDAPConfiguration.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/JacksonLDAPConfiguration.java index 467ce6987..15ba9ff5a 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/JacksonLDAPConfiguration.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/JacksonLDAPConfiguration.java @@ -19,6 +19,8 @@ package org.apache.guacamole.auth.ldap.conf; +import com.fasterxml.jackson.annotation.JsonFormat; +import static com.fasterxml.jackson.annotation.JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Collections; import java.util.List; @@ -42,6 +44,7 @@ public class JacksonLDAPConfiguration implements LDAPConfiguration { * the LDAP server represented by this configuration. */ @JsonProperty("match-usernames") + @JsonFormat(with = ACCEPT_SINGLE_VALUE_AS_ARRAY) private List matchUsernames; /** @@ -63,6 +66,7 @@ public class JacksonLDAPConfiguration implements LDAPConfiguration { * If not set within the YAML, this will be null. */ @JsonProperty("username-attribute") + @JsonFormat(with = ACCEPT_SINGLE_VALUE_AS_ARRAY) private List usernameAttributes; /** @@ -91,6 +95,7 @@ public class JacksonLDAPConfiguration implements LDAPConfiguration { * If not set within the YAML, this will be null. */ @JsonProperty("group-name-attribute") + @JsonFormat(with = ACCEPT_SINGLE_VALUE_AS_ARRAY) private List groupNameAttributes; /** @@ -168,6 +173,7 @@ public class JacksonLDAPConfiguration implements LDAPConfiguration { * If not set within the YAML, this will be null. */ @JsonProperty("user-attributes") + @JsonFormat(with = ACCEPT_SINGLE_VALUE_AS_ARRAY) private List userAttributes; /**