You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by GitBox <gi...@apache.org> on 2020/12/29 02:49:47 UTC

[GitHub] [guacamole-client] mike-jumper commented on a change in pull request #584: GUACAMOLE-1199: Get a copy of existing user attributes before adding TOTP attributes

mike-jumper commented on a change in pull request #584:
URL: https://github.com/apache/guacamole-client/pull/584#discussion_r549548935



##########
File path: extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java
##########
@@ -166,7 +166,7 @@ private boolean setKey(UserContext context, UserTOTPKey key)
 
         // Get mutable set of attributes
         User self = context.self();
-        Map<String, String> attributes = new HashMap<String, String>();
+        Map<String, String> attributes = new HashMap<>(self.getAttributes());

Review comment:
       The [documentation for `setAttributes()`](https://guacamole.apache.org/doc/guacamole-ext/org/apache/guacamole/net/auth/Attributes.html#setAttributes-java.util.Map-) states:
   
   > ... Any attributes not within the given map will be left untouched. ...
   
   If the backend handling storage of these attributes is working correctly, this _shouldn't_ be necessary. Perhaps the database support is not correctly implementing `setAttributes()`?




----------------------------------------------------------------
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:
users@infra.apache.org