mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-524: Fixed up code style and comments
Also added Override tag in AbstractAuthenticatedUser on getAttributes and setAttributes.
This commit is contained in:
@@ -197,7 +197,8 @@ public class AuthenticationProviderService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an AuthenticatedUser representing the user authenticated by the
|
* Returns an AuthenticatedUser representing the user authenticated by the
|
||||||
* given credentials. Also adds custom LDAP attributes to credentials object.
|
* given credentials. Also adds custom LDAP attributes to the
|
||||||
|
* AuthenticatedUser.
|
||||||
*
|
*
|
||||||
* @param credentials
|
* @param credentials
|
||||||
* The credentials to use for authentication.
|
* The credentials to use for authentication.
|
||||||
@@ -233,7 +234,7 @@ public class AuthenticationProviderService {
|
|||||||
AuthenticatedUser authenticatedUser = authenticatedUserProvider.get();
|
AuthenticatedUser authenticatedUser = authenticatedUserProvider.get();
|
||||||
authenticatedUser.init(credentials);
|
authenticatedUser.init(credentials);
|
||||||
|
|
||||||
//set attributes
|
// Set attributes
|
||||||
String username = credentials.getUsername();
|
String username = credentials.getUsername();
|
||||||
Map<String, String> attrs = getLDAPAttributes(ldapConnection, username);
|
Map<String, String> attrs = getLDAPAttributes(ldapConnection, username);
|
||||||
authenticatedUser.setAttributes(attrs);
|
authenticatedUser.setAttributes(attrs);
|
||||||
@@ -293,9 +294,7 @@ public class AuthenticationProviderService {
|
|||||||
// Add each attribute into Map
|
// Add each attribute into Map
|
||||||
for (Object attrObj : attrSet) {
|
for (Object attrObj : attrSet) {
|
||||||
LDAPAttribute attr = (LDAPAttribute)attrObj;
|
LDAPAttribute attr = (LDAPAttribute)attrObj;
|
||||||
String attrName = attr.getName();
|
attrMap.put(attr.getName(), attr.getStringValue());
|
||||||
String attrValue = attr.getStringValue();
|
|
||||||
attrMap.put(attrName, attrValue);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (LDAPException e) {
|
catch (LDAPException e) {
|
||||||
|
@@ -348,8 +348,7 @@ public class ConfigurationService {
|
|||||||
* Returns names for custom LDAP user attributes.
|
* Returns names for custom LDAP user attributes.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* LDAP user attributes as defined in the guacamole.properties file
|
* Custom LDAP user attributes as configured in guacamole.properties.
|
||||||
* as ldap-user-attributes: ''
|
|
||||||
*
|
*
|
||||||
* @throws GuacamoleException
|
* @throws GuacamoleException
|
||||||
* If guacamole.properties cannot be parsed.
|
* If guacamole.properties cannot be parsed.
|
||||||
|
@@ -61,24 +61,11 @@ public class AuthenticatedUser extends AbstractAuthenticatedUser {
|
|||||||
setIdentifier(credentials.getUsername());
|
setIdentifier(credentials.getUsername());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a map of attributes associated with this AuthenticatedUser.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* The Map of arbitrary attributes associated with this
|
|
||||||
* AuthenticatedUser object.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, String> getAttributes() {
|
public Map<String, String> getAttributes() {
|
||||||
return attributes;
|
return attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets a map of attributes associated with this AuthenticatedUser.
|
|
||||||
*
|
|
||||||
* @param attributes
|
|
||||||
* A map of attribute key/value pairs to add to this AuthenticatedUser.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void setAttributes(Map<String, String> attributes) {
|
public void setAttributes(Map<String, String> attributes) {
|
||||||
this.attributes = attributes;
|
this.attributes = attributes;
|
||||||
|
@@ -42,10 +42,12 @@ public abstract class AbstractAuthenticatedUser extends AbstractIdentifiable
|
|||||||
// Nothing to invalidate
|
// Nothing to invalidate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Map<String, String> getAttributes() {
|
public Map<String, String> getAttributes() {
|
||||||
return Collections.<String, String>emptyMap();
|
return Collections.<String, String>emptyMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setAttributes(Map<String, String> attributes) {
|
public void setAttributes(Map<String, String> attributes) {
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
}
|
||||||
|
@@ -25,6 +25,7 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.apache.guacamole.net.auth.AuthenticatedUser;
|
import org.apache.guacamole.net.auth.AuthenticatedUser;
|
||||||
import org.apache.guacamole.net.auth.Credentials;
|
import org.apache.guacamole.net.auth.Credentials;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility class which provides access to standardized token names, as well as
|
* Utility class which provides access to standardized token names, as well as
|
||||||
* facilities for generating those tokens from common objects.
|
* facilities for generating those tokens from common objects.
|
||||||
|
Reference in New Issue
Block a user