mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-524: Implemented getAttributes and setAttributes to satisfy
Attributes interface addition
This commit is contained in:
@@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
package org.apache.guacamole.auth.jdbc.user;
|
package org.apache.guacamole.auth.jdbc.user;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -67,6 +69,21 @@ public abstract class RemoteAuthenticatedUser implements AuthenticatedUser {
|
|||||||
*/
|
*/
|
||||||
private static final Pattern X_FORWARDED_FOR = Pattern.compile("^" + IP_ADDRESS_REGEX + "(, " + IP_ADDRESS_REGEX + ")*$");
|
private static final Pattern X_FORWARDED_FOR = Pattern.compile("^" + IP_ADDRESS_REGEX + "(, " + IP_ADDRESS_REGEX + ")*$");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Arbitrary attributes associated with this RemoteAuthenticatedUser object.
|
||||||
|
*/
|
||||||
|
private Map<String, String> attributes = new HashMap<String, String>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> getAttributes() {
|
||||||
|
return attributes;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setAttributes(Map<String, String> attributes) {
|
||||||
|
this.attributes = attributes;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Derives the remote host of the authenticating user from the given
|
* Derives the remote host of the authenticating user from the given
|
||||||
* credentials object. The remote host is derived from X-Forwarded-For
|
* credentials object. The remote host is derived from X-Forwarded-For
|
||||||
@@ -98,7 +115,7 @@ public abstract class RemoteAuthenticatedUser implements AuthenticatedUser {
|
|||||||
return request.getRemoteAddr();
|
return request.getRemoteAddr();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new RemoteAuthenticatedUser, deriving the associated remote
|
* Creates a new RemoteAuthenticatedUser, deriving the associated remote
|
||||||
* host from the given credentials.
|
* host from the given credentials.
|
||||||
@@ -106,7 +123,7 @@ public abstract class RemoteAuthenticatedUser implements AuthenticatedUser {
|
|||||||
* @param authenticationProvider
|
* @param authenticationProvider
|
||||||
* The AuthenticationProvider that has authenticated the given user.
|
* The AuthenticationProvider that has authenticated the given user.
|
||||||
*
|
*
|
||||||
* @param credentials
|
* @param credentials
|
||||||
* The credentials given by the user when they authenticated.
|
* The credentials given by the user when they authenticated.
|
||||||
*/
|
*/
|
||||||
public RemoteAuthenticatedUser(AuthenticationProvider authenticationProvider,
|
public RemoteAuthenticatedUser(AuthenticationProvider authenticationProvider,
|
||||||
|
Reference in New Issue
Block a user