mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUACAMOLE-641: Standardize database username/password retrieval via JDBCEnvironment.
This commit is contained in:
@@ -64,8 +64,8 @@ public class PostgreSQLAuthenticationProviderModule implements Module {
|
||||
myBatisProperties.setProperty("JDBC.host", environment.getPostgreSQLHostname());
|
||||
myBatisProperties.setProperty("JDBC.port", String.valueOf(environment.getPostgreSQLPort()));
|
||||
myBatisProperties.setProperty("JDBC.schema", environment.getPostgreSQLDatabase());
|
||||
myBatisProperties.setProperty("JDBC.username", environment.getPostgreSQLUsername());
|
||||
myBatisProperties.setProperty("JDBC.password", environment.getPostgreSQLPassword());
|
||||
myBatisProperties.setProperty("JDBC.username", environment.getUsername());
|
||||
myBatisProperties.setProperty("JDBC.password", environment.getPassword());
|
||||
myBatisProperties.setProperty("JDBC.autoCommit", "false");
|
||||
myBatisProperties.setProperty("mybatis.pooled.pingEnabled", "true");
|
||||
myBatisProperties.setProperty("mybatis.pooled.pingQuery", "SELECT 1");
|
||||
|
@@ -232,34 +232,14 @@ public class PostgreSQLEnvironment extends JDBCEnvironment {
|
||||
public String getPostgreSQLDatabase() throws GuacamoleException {
|
||||
return getRequiredProperty(PostgreSQLGuacamoleProperties.POSTGRESQL_DATABASE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the username that should be used when authenticating with the
|
||||
* PostgreSQL database containing the Guacamole authentication tables.
|
||||
*
|
||||
* @return
|
||||
* The username for the PostgreSQL database.
|
||||
*
|
||||
* @throws GuacamoleException
|
||||
* If an error occurs while retrieving the property value, or if the
|
||||
* value was not set, as this property is required.
|
||||
*/
|
||||
public String getPostgreSQLUsername() throws GuacamoleException {
|
||||
|
||||
@Override
|
||||
public String getUsername() throws GuacamoleException {
|
||||
return getRequiredProperty(PostgreSQLGuacamoleProperties.POSTGRESQL_USERNAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the password that should be used when authenticating with the
|
||||
* PostgreSQL database containing the Guacamole authentication tables.
|
||||
*
|
||||
* @return
|
||||
* The password for the PostgreSQL database.
|
||||
*
|
||||
* @throws GuacamoleException
|
||||
* If an error occurs while retrieving the property value, or if the
|
||||
* value was not set, as this property is required.
|
||||
*/
|
||||
public String getPostgreSQLPassword() throws GuacamoleException {
|
||||
|
||||
@Override
|
||||
public String getPassword() throws GuacamoleException {
|
||||
return getRequiredProperty(PostgreSQLGuacamoleProperties.POSTGRESQL_PASSWORD);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user