mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-1239: Remove per-extension configuration for case-sensitivity, retaining only global configuration.
This commit is contained in:
@@ -53,26 +53,5 @@ public class ConfigurationService {
|
||||
"REMOTE_USER"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the usernames provided to the header authentication
|
||||
* module should be treated as case-sensitive, or false if usernames
|
||||
* should be treated as case-insensitive. This will default to the global
|
||||
* Guacamole configuration for case-sensitivity, which defaults to true, but
|
||||
* can be overridden for this extension, if desired.
|
||||
*
|
||||
* @return
|
||||
* true if usernames should be treated as case-sensitive, otherwise
|
||||
* false.
|
||||
*
|
||||
* @throws GuacamoleException
|
||||
* If guacamole.properties cannot be parsed.
|
||||
*/
|
||||
public boolean getCaseSensitiveUsernames() throws GuacamoleException {
|
||||
return environment.getProperty(
|
||||
HTTPHeaderGuacamoleProperties.HTTP_AUTH_CASE_SENSITIVE_USERNAMES,
|
||||
environment.getCaseSensitiveUsernames()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -19,7 +19,6 @@
|
||||
|
||||
package org.apache.guacamole.auth.header;
|
||||
|
||||
import org.apache.guacamole.properties.BooleanGuacamoleProperty;
|
||||
import org.apache.guacamole.properties.StringGuacamoleProperty;
|
||||
|
||||
|
||||
@@ -44,17 +43,5 @@ public class HTTPHeaderGuacamoleProperties {
|
||||
public String getName() { return "http-auth-header"; }
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* A property used to configure whether or not usernames within the header
|
||||
* module should be treated as case-sensitive.
|
||||
*/
|
||||
public static final BooleanGuacamoleProperty HTTP_AUTH_CASE_SENSITIVE_USERNAMES =
|
||||
new BooleanGuacamoleProperty() {
|
||||
|
||||
@Override
|
||||
public String getName() { return "http-auth-case-sensitive-usernames"; }
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -20,13 +20,9 @@
|
||||
package org.apache.guacamole.auth.header.user;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import org.apache.guacamole.GuacamoleException;
|
||||
import org.apache.guacamole.auth.header.ConfigurationService;
|
||||
import org.apache.guacamole.net.auth.AbstractAuthenticatedUser;
|
||||
import org.apache.guacamole.net.auth.AuthenticationProvider;
|
||||
import org.apache.guacamole.net.auth.Credentials;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* An HTTP header implementation of AuthenticatedUser, associating a
|
||||
@@ -34,11 +30,6 @@ import org.slf4j.LoggerFactory;
|
||||
* provider.
|
||||
*/
|
||||
public class AuthenticatedUser extends AbstractAuthenticatedUser {
|
||||
|
||||
/**
|
||||
* Logger for this class.
|
||||
*/
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AuthenticatedUser.class);
|
||||
|
||||
/**
|
||||
* Reference to the authentication provider associated with this
|
||||
@@ -46,12 +37,6 @@ public class AuthenticatedUser extends AbstractAuthenticatedUser {
|
||||
*/
|
||||
@Inject
|
||||
private AuthenticationProvider authProvider;
|
||||
|
||||
/**
|
||||
* Service for retrieving header configuration information.
|
||||
*/
|
||||
@Inject
|
||||
private ConfigurationService confService;
|
||||
|
||||
/**
|
||||
* The credentials provided when this user was authenticated.
|
||||
@@ -72,19 +57,6 @@ public class AuthenticatedUser extends AbstractAuthenticatedUser {
|
||||
this.credentials = credentials;
|
||||
setIdentifier(username.toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCaseSensitive() {
|
||||
try {
|
||||
return confService.getCaseSensitiveUsernames();
|
||||
}
|
||||
catch (GuacamoleException e) {
|
||||
LOGGER.error("Error when trying to retrieve header configuration: {}."
|
||||
+ " Usernames comparison will be case-sensitive.", e);
|
||||
LOGGER.debug("Exception caught when retrieving header configuration.", e);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuthenticationProvider getAuthenticationProvider() {
|
||||
|
Reference in New Issue
Block a user