mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-524: Remove Attributes interface from AuthenticatedUser. Rely instead on tokens injected via decoration of connections.
This commit is contained in:
@@ -22,7 +22,6 @@ package org.apache.guacamole.tunnel;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.apache.guacamole.net.auth.AuthenticatedUser;
|
||||
import org.apache.guacamole.net.auth.Credentials;
|
||||
|
||||
@@ -76,11 +75,6 @@ public class StandardTokenMap extends HashMap<String, String> {
|
||||
*/
|
||||
private static final String TIME_FORMAT = "HHmmss";
|
||||
|
||||
/**
|
||||
* The prefix of the arbitrary attribute tokens.
|
||||
*/
|
||||
public static final String ATTR_TOKEN_PREFIX = "GUAC_ATTR_";
|
||||
|
||||
/**
|
||||
* Creates a new StandardTokenMap which is pre-populated with the
|
||||
* name/value pairs of all standardized tokens available for the given
|
||||
@@ -97,7 +91,6 @@ public class StandardTokenMap extends HashMap<String, String> {
|
||||
put(TIME_TOKEN, new SimpleDateFormat(TIME_FORMAT).format(currentTime));
|
||||
|
||||
Credentials credentials = authenticatedUser.getCredentials();
|
||||
Map<String, String> attributes = authenticatedUser.getAttributes();
|
||||
|
||||
// Add username token
|
||||
String username = credentials.getUsername();
|
||||
@@ -124,16 +117,6 @@ public class StandardTokenMap extends HashMap<String, String> {
|
||||
if (address != null)
|
||||
put(CLIENT_ADDRESS_TOKEN, address);
|
||||
|
||||
// Add tokens for all attributes on the AuthenticatedUser
|
||||
if (attributes != null) {
|
||||
for (Map.Entry entry : attributes.entrySet()) {
|
||||
String key = entry.getKey().toString();
|
||||
String tokenName = ATTR_TOKEN_PREFIX + key.toUpperCase();
|
||||
String tokenValue = entry.getValue().toString();
|
||||
put(tokenName, tokenValue);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user