mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-708: Add properties for automatic account creation.
This commit is contained in:
@@ -151,5 +151,21 @@ public abstract class JDBCEnvironment extends LocalEnvironment {
|
||||
* true if the database supports recursive queries, false otherwise.
|
||||
*/
|
||||
public abstract boolean isRecursiveQuerySupported(SqlSession session);
|
||||
|
||||
/**
|
||||
* Returns a boolean value representing whether or not the JDBC module
|
||||
* should automatically create accounts within the database for users that
|
||||
* are successfully authenticated via other extensions. Returns true if
|
||||
* accounts should be auto-created, otherwise returns false.
|
||||
*
|
||||
* @return
|
||||
* true if user accounts should be automatically created within the
|
||||
* database when authentication succeeds from another extension;
|
||||
* otherwise false.
|
||||
*
|
||||
* @throws GuacamoleException
|
||||
* If guacamole.properties cannot be parsed.
|
||||
*/
|
||||
public abstract boolean autoCreateAbsentAccounts() throws GuacamoleException;
|
||||
|
||||
}
|
||||
|
@@ -386,5 +386,11 @@ public class MySQLEnvironment extends JDBCEnvironment {
|
||||
public String getMYSQLSSLClientPassword() throws GuacamoleException {
|
||||
return getProperty(MySQLGuacamoleProperties.MYSQL_SSL_TRUST_PASSWORD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean autoCreateAbsentAccounts() throws GuacamoleException {
|
||||
return getProperty(MySQLGuacamoleProperties.MYSQL_AUTO_CREATE_ACCOUNTS,
|
||||
false);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -240,5 +240,13 @@ public class MySQLGuacamoleProperties {
|
||||
public String getName() { return "mysql-ssl-client-password"; }
|
||||
|
||||
};
|
||||
|
||||
public static final BooleanGuacamoleProperty MYSQL_AUTO_CREATE_ACCOUNTS =
|
||||
new BooleanGuacamoleProperty() {
|
||||
|
||||
@Override
|
||||
public String getName() { return "mysql-auto-create-accounts"; }
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -328,4 +328,10 @@ public class PostgreSQLEnvironment extends JDBCEnvironment {
|
||||
return getProperty(PostgreSQLGuacamoleProperties.POSTGRESQL_SSL_KEY_PASSWORD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean autoCreateAbsentAccounts() throws GuacamoleException {
|
||||
return getProperty(PostgreSQLGuacamoleProperties.POSTGRESQL_AUTO_CREATE_ACCOUNTS,
|
||||
false);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -233,4 +233,16 @@ public class PostgreSQLGuacamoleProperties {
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Whether or not the PostgreSQL extension should automatically add database
|
||||
* entries for users who are granted access through other extensions.
|
||||
*/
|
||||
public static final BooleanGuacamoleProperty POSTGRESQL_AUTO_CREATE_ACCOUNTS =
|
||||
new BooleanGuacamoleProperty() {
|
||||
|
||||
@Override
|
||||
public String getName() { return "postgresql-auto-create-accounts"; }
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -25,6 +25,8 @@ import com.google.inject.name.Names;
|
||||
import java.lang.UnsupportedOperationException;
|
||||
import java.util.Properties;
|
||||
import org.apache.guacamole.GuacamoleException;
|
||||
import org.apache.guacamole.auth.sqlserver.conf.SQLServerDriver;
|
||||
import org.apache.guacamole.auth.sqlserver.conf.SQLServerEnvironment;
|
||||
import org.mybatis.guice.datasource.helper.JdbcHelper;
|
||||
|
||||
/**
|
||||
@@ -45,7 +47,7 @@ public class SQLServerAuthenticationProviderModule implements Module {
|
||||
/**
|
||||
* Which SQL Server driver should be used.
|
||||
*/
|
||||
private SQLServerDriver sqlServerDriver;
|
||||
private final SQLServerDriver sqlServerDriver;
|
||||
|
||||
/**
|
||||
* Creates a new SQLServer authentication provider module that configures
|
||||
|
@@ -24,6 +24,7 @@ import com.google.inject.Injector;
|
||||
import org.apache.guacamole.GuacamoleException;
|
||||
import org.apache.guacamole.auth.jdbc.JDBCAuthenticationProviderModule;
|
||||
import org.apache.guacamole.auth.jdbc.JDBCInjectorProvider;
|
||||
import org.apache.guacamole.auth.sqlserver.conf.SQLServerEnvironment;
|
||||
|
||||
/**
|
||||
* JDBCInjectorProvider implementation which configures Guice injections for
|
||||
|
@@ -17,7 +17,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.auth.sqlserver;
|
||||
package org.apache.guacamole.auth.sqlserver.conf;
|
||||
|
||||
import org.apache.guacamole.properties.EnumGuacamoleProperty.PropertyValue;
|
||||
|
@@ -17,7 +17,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.auth.sqlserver;
|
||||
package org.apache.guacamole.auth.sqlserver.conf;
|
||||
|
||||
import org.apache.guacamole.GuacamoleException;
|
||||
import org.apache.guacamole.auth.jdbc.JDBCEnvironment;
|
||||
@@ -273,5 +273,11 @@ public class SQLServerEnvironment extends JDBCEnvironment {
|
||||
public boolean isRecursiveQuerySupported(SqlSession session) {
|
||||
return true; // All versions of SQL Server support recursive queries through CTEs
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean autoCreateAbsentAccounts() throws GuacamoleException {
|
||||
return getProperty(SQLServerGuacamoleProperties.SQLSERVER_AUTO_CREATE_ACCOUNTS,
|
||||
false);
|
||||
}
|
||||
|
||||
}
|
@@ -17,7 +17,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.auth.sqlserver;
|
||||
package org.apache.guacamole.auth.sqlserver.conf;
|
||||
|
||||
import org.apache.guacamole.properties.BooleanGuacamoleProperty;
|
||||
import org.apache.guacamole.properties.EnumGuacamoleProperty;
|
||||
@@ -193,5 +193,13 @@ public class SQLServerGuacamoleProperties {
|
||||
public String getName() { return "sqlserver-driver"; }
|
||||
|
||||
};
|
||||
|
||||
public static final BooleanGuacamoleProperty SQLSERVER_AUTO_CREATE_ACCOUNTS =
|
||||
new BooleanGuacamoleProperty() {
|
||||
|
||||
@Override
|
||||
public String getName() { return "sqlserver-auto-create-accounts"; }
|
||||
|
||||
};
|
||||
|
||||
}
|
@@ -17,7 +17,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.auth.sqlserver;
|
||||
package org.apache.guacamole.auth.sqlserver.conf;
|
||||
|
||||
import org.apache.guacamole.GuacamoleException;
|
||||
import org.apache.guacamole.auth.jdbc.JDBCEnvironment;
|
Reference in New Issue
Block a user