necouchman commented on a change in pull request #584:
URL: https://github.com/apache/guacamole-client/pull/584#discussion_r549561792
##########
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:
I'm still trying to track this down, but I think that the issue is here:
https://github.com/apache/guacamole-client/blob/e5deb9b6a44ca809ae23921a09fb2f79a2af10f0/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/base/ModeledDirectoryObjectService.java#L496-L512
and then in the concrete implementations of this:
https://github.com/apache/guacamole-client/blob/e5deb9b6a44ca809ae23921a09fb2f79a2af10f0/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/base/ModeledDirectoryObjectMapper.java#L144
Since the attributes that are being overwritten are not stored in the
`guacamole_user_attributes` table (for arbitrary attributes), and the update
query updates the record in the `guacamle_user` table, the query assumes that
_all_ of the attribute values will be available and present in that query. For
whatever reason the restricted ones are still there, but the unrestricted ones
get pulled off somewhere along the way.
----------------------------------------------------------------
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]