mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-1239: Remove per-extension configuration for case-sensitivity, retaining only global configuration.
This commit is contained in:
@@ -24,7 +24,6 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import org.apache.guacamole.GuacamoleException;
|
||||
import org.apache.guacamole.environment.Environment;
|
||||
import org.apache.guacamole.properties.BooleanGuacamoleProperty;
|
||||
import org.apache.guacamole.properties.ByteArrayProperty;
|
||||
import org.apache.guacamole.properties.StringGuacamoleProperty;
|
||||
|
||||
@@ -39,20 +38,6 @@ public class ConfigurationService {
|
||||
*/
|
||||
@Inject
|
||||
private Environment environment;
|
||||
|
||||
/**
|
||||
* A property used to configure whether or not usernames within the JSON
|
||||
* module should be treated as case-sensitive.
|
||||
*/
|
||||
private static final BooleanGuacamoleProperty JSON_CASE_SENSITIVE_USERNAMES =
|
||||
new BooleanGuacamoleProperty() {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "json-case-sensitive-usernames";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* The encryption key to use for all decryption and signature verification.
|
||||
@@ -79,25 +64,6 @@ public class ConfigurationService {
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if the usernames provided to the JSON authentication
|
||||
* module should be treated as case-sensitive, or false if usernames
|
||||
* should be treated as case-insensitive. The default will be taken from
|
||||
* the global Guacamole configuration, which defaults to true, but
|
||||
* can be overridden for this extension.
|
||||
*
|
||||
* @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(JSON_CASE_SENSITIVE_USERNAMES,
|
||||
environment.getCaseSensitiveUsernames());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the symmetric key which will be used to encrypt and sign all
|
||||
|
@@ -20,8 +20,6 @@
|
||||
package org.apache.guacamole.auth.json.user;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import org.apache.guacamole.GuacamoleException;
|
||||
import org.apache.guacamole.auth.json.ConfigurationService;
|
||||
import org.apache.guacamole.net.auth.AbstractAuthenticatedUser;
|
||||
import org.apache.guacamole.net.auth.AuthenticationProvider;
|
||||
import org.apache.guacamole.net.auth.Credentials;
|
||||
@@ -46,13 +44,6 @@ public class AuthenticatedUser extends AbstractAuthenticatedUser {
|
||||
*/
|
||||
@Inject
|
||||
private AuthenticationProvider authProvider;
|
||||
|
||||
/**
|
||||
* Reference to the configuration service associated with this
|
||||
* authentication provider.
|
||||
*/
|
||||
@Inject
|
||||
private ConfigurationService confService;
|
||||
|
||||
/**
|
||||
* The credentials provided when this user was authenticated.
|
||||
@@ -82,19 +73,6 @@ public class AuthenticatedUser extends AbstractAuthenticatedUser {
|
||||
this.userData = userData;
|
||||
setIdentifier(userData.getUsername());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCaseSensitive() {
|
||||
try {
|
||||
return confService.getCaseSensitiveUsernames();
|
||||
}
|
||||
catch (GuacamoleException e) {
|
||||
LOGGER.error("Error when attempting to get the JSON configuration: {}. "
|
||||
+ "Username comparisons will be case-sensitive.", e.getMessage());
|
||||
LOGGER.debug("Exception caught while retrieving JSON configuration.", e);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuthenticationProvider getAuthenticationProvider() {
|
||||
|
Reference in New Issue
Block a user