mike-jumper commented on a change in pull request #345: GUACAMOLE-234: Migrate 
to Apache Directory API for LDAP Extension
URL: https://github.com/apache/guacamole-client/pull/345#discussion_r312720292
 
 

 ##########
 File path: 
extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/group/UserGroupService.java
 ##########
 @@ -196,24 +207,29 @@ private String getGroupSearchFilter() throws 
GuacamoleException {
      * @throws GuacamoleException
      *     If an error occurs preventing retrieval of user groups.
      */
-    public Set<String> getParentUserGroupIdentifiers(LDAPConnection 
ldapConnection,
-            String userDN) throws GuacamoleException {
+    public Set<String> getParentUserGroupIdentifiers(LdapNetworkConnection 
ldapConnection,
+            Dn userDN) throws GuacamoleException {
 
         Collection<String> attributes = confService.getGroupNameAttributes();
-        List<LDAPEntry> userGroups = getParentUserGroupEntries(ldapConnection, 
userDN);
+        List<Entry> userGroups = getParentUserGroupEntries(ldapConnection, 
userDN);
 
         Set<String> identifiers = new HashSet<>(userGroups.size());
         userGroups.forEach(entry -> {
 
             // Determine unique identifier for user group
-            String name = queryService.getIdentifier(entry, attributes);
-            if (name != null)
-                identifiers.add(name);
-
-            // Ignore user groups which lack a name attribute
-            else
-                logger.debug("User group \"{}\" is missing a name attribute "
-                        + "and will be ignored.", entry.getDN());
+            try {
+                String name = queryService.getIdentifier(entry, attributes);
+                if (name != null)
+                    identifiers.add(name);
+
+                // Ignore user groups which lack a name attribute
+                else
+                    logger.debug("User group \"{}\" is missing a name 
attribute "
+                            + "and will be ignored.", 
entry.getDn().toString());
+            }
+            catch (LdapInvalidAttributeValueException e) {
+                logger.debug("User group missing identifier.", e.getMessage());
 
 Review comment:
   For reference - here, too: `e.getMessage()` might not be logged due to lack 
of `{}` (unless `{}` is not actually needed).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to