GUACAMOLE-1239: Remove per-extension configuration for case-sensitivity, retaining only global configuration.

This commit is contained in:
Virtually Nick
2024-10-31 13:30:46 -04:00
parent 240dcd9a52
commit ddd09969d8
31 changed files with 37 additions and 469 deletions

View File

@@ -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()
);
}
}

View File

@@ -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"; }
};
}

View File

@@ -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() {