Repository: guacamole-client
Updated Branches:
  refs/heads/master 33679a08d -> a9637494a


GUACAMOLE-524: Added reading of LDAP attributes in guacamole.properties named 
'ldap-user-attributes'.
Added method getAttributes() in ConfigurationService to read environment 
property
LDAPGuacamoleProperties.LDAP_USER_ATTRIBUTES. These
attributes are arbitrary LDAP attributes that will
be mapped to the user in credentials and
tokens.


Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/38eb97b4
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/38eb97b4
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/38eb97b4

Branch: refs/heads/master
Commit: 38eb97b42245699988cfa1fefe7bf80eeea3c56c
Parents: 0e856d7
Author: Jared Frees <frees...@osu.edu>
Authored: Fri Jun 8 12:30:15 2018 -0400
Committer: Jared Frees <frees...@osu.edu>
Committed: Fri Jun 8 15:04:11 2018 -0400

----------------------------------------------------------------------
 .../guacamole/auth/ldap/ConfigurationService.java | 18 +++++++++++++++++-
 .../auth/ldap/LDAPGuacamoleProperties.java        | 10 ++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/38eb97b4/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
----------------------------------------------------------------------
diff --git 
a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
 
b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
index 2ab7aad..4b82e3d 100644
--- 
a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
+++ 
b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
@@ -227,7 +227,7 @@ public class ConfigurationService {
     private int getMaxResults() throws GuacamoleException {
         return environment.getProperty(
             LDAPGuacamoleProperties.LDAP_MAX_SEARCH_RESULTS,
-            1000 
+            1000
         );
     }
 
@@ -344,4 +344,20 @@ public class ConfigurationService {
         );
     }
 
+    /**
+     * Returns names for custom LDAP user attributes.
+     *
+     * @return
+     *     LDAP user attributes as defined in the guacamole.properties file
+     *     as ldap-user-attributes: ''
+     *
+     * @throws GuacamoleException
+     *     If guacamole.properties cannot be parsed.
+     */
+    public List<String> getAttributes() throws GuacamoleException {
+        return environment.getProperty(
+            LDAPGuacamoleProperties.LDAP_USER_ATTRIBUTES
+        );
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/38eb97b4/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPGuacamoleProperties.java
----------------------------------------------------------------------
diff --git 
a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPGuacamoleProperties.java
 
b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPGuacamoleProperties.java
index 0d3823f..55ed37b 100644
--- 
a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPGuacamoleProperties.java
+++ 
b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPGuacamoleProperties.java
@@ -205,4 +205,14 @@ public class LDAPGuacamoleProperties {
 
     };
 
+    /**
+     * Custom attribute or attributes in Guacamole user's record in the
+     * LDAP directory.
+     */
+    public static final StringListProperty LDAP_USER_ATTRIBUTES = new 
StringListProperty() {
+
+        @Override
+        public String getName() { return "ldap-user-attributes"; }
+
+    };
 }

Reply via email to