GUAC-1101: Begin separating out the common JDBC base of everything.

This commit is contained in:
Michael Jumper
2015-02-27 16:29:34 -08:00
parent c19b43ce95
commit 883cc051da
66 changed files with 383 additions and 306 deletions

View File

@@ -23,49 +23,8 @@
package net.sourceforge.guacamole.net.auth.mysql; package net.sourceforge.guacamole.net.auth.mysql;
import org.glyptodon.guacamole.auth.mysql.user.MySQLUserContext;
import org.glyptodon.guacamole.auth.mysql.connectiongroup.MySQLRootConnectionGroup;
import org.glyptodon.guacamole.auth.mysql.connectiongroup.MySQLConnectionGroup;
import org.glyptodon.guacamole.auth.mysql.connectiongroup.ConnectionGroupDirectory;
import org.glyptodon.guacamole.auth.mysql.connection.ConnectionDirectory;
import org.glyptodon.guacamole.auth.mysql.connection.MySQLGuacamoleConfiguration;
import org.glyptodon.guacamole.auth.mysql.connection.MySQLConnection;
import org.glyptodon.guacamole.auth.mysql.permission.MySQLSystemPermissionSet;
import org.glyptodon.guacamole.auth.mysql.user.MySQLUser;
import org.glyptodon.guacamole.auth.mysql.user.UserDirectory;
import com.google.inject.Binder;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.google.inject.name.Names;
import java.util.Properties;
import org.glyptodon.guacamole.auth.mysql.connectiongroup.ConnectionGroupMapper;
import org.glyptodon.guacamole.auth.mysql.connection.ConnectionMapper;
import org.glyptodon.guacamole.auth.mysql.connection.ConnectionRecordMapper;
import org.glyptodon.guacamole.auth.mysql.connection.ParameterMapper;
import org.glyptodon.guacamole.auth.mysql.permission.SystemPermissionMapper;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.net.auth.AuthenticationProvider; import org.glyptodon.guacamole.auth.jdbc.JDBCAuthenticationProvider;
import org.glyptodon.guacamole.net.auth.Credentials;
import org.glyptodon.guacamole.net.auth.UserContext;
import org.glyptodon.guacamole.auth.mysql.user.UserMapper;
import org.glyptodon.guacamole.auth.mysql.conf.MySQLGuacamoleProperties;
import org.glyptodon.guacamole.auth.mysql.connectiongroup.ConnectionGroupService;
import org.glyptodon.guacamole.auth.mysql.connection.ConnectionService;
import org.glyptodon.guacamole.auth.mysql.socket.GuacamoleSocketService;
import org.glyptodon.guacamole.auth.mysql.security.PasswordEncryptionService;
import org.glyptodon.guacamole.auth.mysql.security.SHA256PasswordEncryptionService;
import org.glyptodon.guacamole.auth.mysql.security.SaltService;
import org.glyptodon.guacamole.auth.mysql.security.SecureRandomSaltService;
import org.glyptodon.guacamole.auth.mysql.permission.SystemPermissionService;
import org.glyptodon.guacamole.auth.mysql.socket.UnrestrictedGuacamoleSocketService;
import org.glyptodon.guacamole.auth.mysql.user.UserService;
import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory;
import org.glyptodon.guacamole.environment.Environment;
import org.glyptodon.guacamole.environment.LocalEnvironment;
import org.mybatis.guice.MyBatisModule;
import org.mybatis.guice.datasource.builtin.PooledDataSourceProvider;
import org.mybatis.guice.datasource.helper.JdbcHelper;
/** /**
* Provides a MySQL based implementation of the AuthenticationProvider * Provides a MySQL based implementation of the AuthenticationProvider
@@ -73,133 +32,18 @@ import org.mybatis.guice.datasource.helper.JdbcHelper;
* *
* @author James Muehlner * @author James Muehlner
*/ */
public class MySQLAuthenticationProvider implements AuthenticationProvider { public class MySQLAuthenticationProvider extends JDBCAuthenticationProvider {
/**
* Injector which will manage the object graph of this authentication
* provider.
*/
private final Injector injector;
@Override
public UserContext getUserContext(Credentials credentials) throws GuacamoleException {
// Get user service
UserService userService = injector.getInstance(UserService.class);
// Authenticate user
MySQLUser user = userService.retrieveUser(credentials);
if (user != null) {
// Upon successful authentication, return new user context
MySQLUserContext context = injector.getInstance(MySQLUserContext.class);
context.init(user.getCurrentUser());
return context;
}
// Otherwise, unauthorized
return null;
}
/** /**
* Creates a new MySQLAuthenticationProvider that reads and writes * Creates a new MySQLAuthenticationProvider that reads and writes
* authentication data to a MySQL database defined by properties in * authentication data to a MySQL database defined by properties in
* guacamole.properties. * guacamole.properties.
* *
* @throws GuacamoleException If a required property is missing, or * @throws GuacamoleException
* an error occurs while parsing a property. * If a required property is missing, or an error occurs while parsing
* a property.
*/ */
public MySQLAuthenticationProvider() throws GuacamoleException { public MySQLAuthenticationProvider() throws GuacamoleException {
// Get local environment
final Environment environment = new LocalEnvironment();
final Properties myBatisProperties = new Properties();
final Properties driverProperties = new Properties();
// Set the mysql properties for MyBatis.
myBatisProperties.setProperty("mybatis.environment.id", "guacamole");
myBatisProperties.setProperty("JDBC.host", environment.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_HOSTNAME));
myBatisProperties.setProperty("JDBC.port", String.valueOf(environment.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_PORT)));
myBatisProperties.setProperty("JDBC.schema", environment.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_DATABASE));
myBatisProperties.setProperty("JDBC.username", environment.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_USERNAME));
myBatisProperties.setProperty("JDBC.password", environment.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_PASSWORD));
myBatisProperties.setProperty("JDBC.autoCommit", "false");
myBatisProperties.setProperty("mybatis.pooled.pingEnabled", "true");
myBatisProperties.setProperty("mybatis.pooled.pingQuery", "SELECT 1");
driverProperties.setProperty("characterEncoding","UTF-8");
// Set up Guice injector.
injector = Guice.createInjector(
JdbcHelper.MySQL,
new Module() {
@Override
public void configure(Binder binder) {
Names.bindProperties(binder, myBatisProperties);
binder.bind(Properties.class)
.annotatedWith(Names.named("JDBC.driverProperties"))
.toInstance(driverProperties);
}
},
new MyBatisModule() {
@Override
protected void initialize() {
// Datasource
bindDataSourceProviderType(PooledDataSourceProvider.class);
// Transaction factory
bindTransactionFactoryType(JdbcTransactionFactory.class);
// Add MyBatis mappers
addMapperClass(ConnectionMapper.class);
addMapperClass(ConnectionGroupMapper.class);
addMapperClass(ConnectionRecordMapper.class);
addMapperClass(ParameterMapper.class);
addMapperClass(SystemPermissionMapper.class);
addMapperClass(UserMapper.class);
// Bind core implementations of guacamole-ext classes
bind(Environment.class).toInstance(environment);
bind(ConnectionDirectory.class);
bind(ConnectionGroupDirectory.class);
bind(MySQLConnection.class);
bind(MySQLConnectionGroup.class);
bind(MySQLGuacamoleConfiguration.class);
bind(MySQLUser.class);
bind(MySQLUserContext.class);
bind(MySQLRootConnectionGroup.class);
bind(MySQLSystemPermissionSet.class);
bind(UserDirectory.class);
// Bind services
bind(ConnectionService.class);
bind(ConnectionGroupService.class);
bind(PasswordEncryptionService.class).to(SHA256PasswordEncryptionService.class);
bind(SaltService.class).to(SecureRandomSaltService.class);
bind(SystemPermissionService.class);
bind(UserService.class);
// Bind appropriate socket service based on policy
bind(GuacamoleSocketService.class).to(UnrestrictedGuacamoleSocketService.class);
}
} // end of mybatis module
);
} // end of constructor
@Override
public UserContext updateUserContext(UserContext context,
Credentials credentials) throws GuacamoleException {
// No need to update the context
return context;
} }
} }

View File

@@ -22,7 +22,6 @@
/** /**
* The MySQL authentication provider. This package exists purely for backwards- * The MySQL authentication provider. This package exists purely for backwards-
* compatibility. All other classes have been moved to packages within * compatibility.
* org.glyptodon.guacamole.auth.mysql.
*/ */
package net.sourceforge.guacamole.net.auth.mysql; package net.sourceforge.guacamole.net.auth.mysql;

View File

@@ -0,0 +1,205 @@
/*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.glyptodon.guacamole.auth.jdbc;
import org.glyptodon.guacamole.auth.jdbc.user.MySQLUserContext;
import org.glyptodon.guacamole.auth.jdbc.connectiongroup.MySQLRootConnectionGroup;
import org.glyptodon.guacamole.auth.jdbc.connectiongroup.MySQLConnectionGroup;
import org.glyptodon.guacamole.auth.jdbc.connectiongroup.ConnectionGroupDirectory;
import org.glyptodon.guacamole.auth.jdbc.connection.ConnectionDirectory;
import org.glyptodon.guacamole.auth.jdbc.connection.MySQLGuacamoleConfiguration;
import org.glyptodon.guacamole.auth.jdbc.connection.MySQLConnection;
import org.glyptodon.guacamole.auth.jdbc.permission.MySQLSystemPermissionSet;
import org.glyptodon.guacamole.auth.jdbc.user.MySQLUser;
import org.glyptodon.guacamole.auth.jdbc.user.UserDirectory;
import com.google.inject.Binder;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.google.inject.name.Names;
import java.util.Properties;
import org.glyptodon.guacamole.auth.jdbc.connectiongroup.ConnectionGroupMapper;
import org.glyptodon.guacamole.auth.jdbc.connection.ConnectionMapper;
import org.glyptodon.guacamole.auth.jdbc.connection.ConnectionRecordMapper;
import org.glyptodon.guacamole.auth.jdbc.connection.ParameterMapper;
import org.glyptodon.guacamole.auth.jdbc.permission.SystemPermissionMapper;
import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.net.auth.AuthenticationProvider;
import org.glyptodon.guacamole.net.auth.Credentials;
import org.glyptodon.guacamole.net.auth.UserContext;
import org.glyptodon.guacamole.auth.jdbc.user.UserMapper;
import org.glyptodon.guacamole.auth.jdbc.conf.MySQLGuacamoleProperties;
import org.glyptodon.guacamole.auth.jdbc.connectiongroup.ConnectionGroupService;
import org.glyptodon.guacamole.auth.jdbc.connection.ConnectionService;
import org.glyptodon.guacamole.auth.jdbc.socket.GuacamoleSocketService;
import org.glyptodon.guacamole.auth.jdbc.security.PasswordEncryptionService;
import org.glyptodon.guacamole.auth.jdbc.security.SHA256PasswordEncryptionService;
import org.glyptodon.guacamole.auth.jdbc.security.SaltService;
import org.glyptodon.guacamole.auth.jdbc.security.SecureRandomSaltService;
import org.glyptodon.guacamole.auth.jdbc.permission.SystemPermissionService;
import org.glyptodon.guacamole.auth.jdbc.socket.UnrestrictedGuacamoleSocketService;
import org.glyptodon.guacamole.auth.jdbc.user.UserService;
import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory;
import org.glyptodon.guacamole.environment.Environment;
import org.glyptodon.guacamole.environment.LocalEnvironment;
import org.mybatis.guice.MyBatisModule;
import org.mybatis.guice.datasource.builtin.PooledDataSourceProvider;
import org.mybatis.guice.datasource.helper.JdbcHelper;
/**
* Provides a MySQL based implementation of the AuthenticationProvider
* functionality.
*
* @author James Muehlner
*/
public class JDBCAuthenticationProvider implements AuthenticationProvider {
/**
* Injector which will manage the object graph of this authentication
* provider.
*/
private final Injector injector;
@Override
public UserContext getUserContext(Credentials credentials) throws GuacamoleException {
// Get user service
UserService userService = injector.getInstance(UserService.class);
// Authenticate user
MySQLUser user = userService.retrieveUser(credentials);
if (user != null) {
// Upon successful authentication, return new user context
MySQLUserContext context = injector.getInstance(MySQLUserContext.class);
context.init(user.getCurrentUser());
return context;
}
// Otherwise, unauthorized
return null;
}
/**
* Creates a new JDBCAuthenticationProvider that reads and writes
* authentication data to an arbitrary database defined by properties in
* guacamole.properties.
*
* @throws GuacamoleException
* If a required property is missing, or an error occurs while parsing
* a property.
*/
public JDBCAuthenticationProvider() throws GuacamoleException {
// Get local environment
final Environment environment = new LocalEnvironment();
final Properties myBatisProperties = new Properties();
final Properties driverProperties = new Properties();
// Set the mysql properties for MyBatis.
myBatisProperties.setProperty("mybatis.environment.id", "guacamole");
myBatisProperties.setProperty("JDBC.host", environment.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_HOSTNAME));
myBatisProperties.setProperty("JDBC.port", String.valueOf(environment.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_PORT)));
myBatisProperties.setProperty("JDBC.schema", environment.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_DATABASE));
myBatisProperties.setProperty("JDBC.username", environment.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_USERNAME));
myBatisProperties.setProperty("JDBC.password", environment.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_PASSWORD));
myBatisProperties.setProperty("JDBC.autoCommit", "false");
myBatisProperties.setProperty("mybatis.pooled.pingEnabled", "true");
myBatisProperties.setProperty("mybatis.pooled.pingQuery", "SELECT 1");
driverProperties.setProperty("characterEncoding","UTF-8");
// Set up Guice injector.
injector = Guice.createInjector(
JdbcHelper.MySQL,
new Module() {
@Override
public void configure(Binder binder) {
Names.bindProperties(binder, myBatisProperties);
binder.bind(Properties.class)
.annotatedWith(Names.named("JDBC.driverProperties"))
.toInstance(driverProperties);
}
},
new MyBatisModule() {
@Override
protected void initialize() {
// Datasource
bindDataSourceProviderType(PooledDataSourceProvider.class);
// Transaction factory
bindTransactionFactoryType(JdbcTransactionFactory.class);
// Add MyBatis mappers
addMapperClass(ConnectionMapper.class);
addMapperClass(ConnectionGroupMapper.class);
addMapperClass(ConnectionRecordMapper.class);
addMapperClass(ParameterMapper.class);
addMapperClass(SystemPermissionMapper.class);
addMapperClass(UserMapper.class);
// Bind core implementations of guacamole-ext classes
bind(Environment.class).toInstance(environment);
bind(ConnectionDirectory.class);
bind(ConnectionGroupDirectory.class);
bind(MySQLConnection.class);
bind(MySQLConnectionGroup.class);
bind(MySQLGuacamoleConfiguration.class);
bind(MySQLUser.class);
bind(MySQLUserContext.class);
bind(MySQLRootConnectionGroup.class);
bind(MySQLSystemPermissionSet.class);
bind(UserDirectory.class);
// Bind services
bind(ConnectionService.class);
bind(ConnectionGroupService.class);
bind(PasswordEncryptionService.class).to(SHA256PasswordEncryptionService.class);
bind(SaltService.class).to(SecureRandomSaltService.class);
bind(SystemPermissionService.class);
bind(UserService.class);
// Bind appropriate socket service based on policy
bind(GuacamoleSocketService.class).to(UnrestrictedGuacamoleSocketService.class);
}
} // end of mybatis module
);
} // end of constructor
@Override
public UserContext updateUserContext(UserContext context,
Credentials credentials) throws GuacamoleException {
// No need to update the context
return context;
}
}

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.base; package org.glyptodon.guacamole.auth.jdbc.base;
import org.glyptodon.guacamole.net.auth.Identifiable; import org.glyptodon.guacamole.net.auth.Identifiable;

View File

@@ -20,11 +20,11 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.base; package org.glyptodon.guacamole.auth.jdbc.base;
import java.util.Collection; import java.util.Collection;
import java.util.Set; import java.util.Set;
import org.glyptodon.guacamole.auth.mysql.user.UserModel; import org.glyptodon.guacamole.auth.jdbc.user.UserModel;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**

View File

@@ -20,13 +20,13 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.base; package org.glyptodon.guacamole.auth.jdbc.base;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.GuacamoleSecurityException; import org.glyptodon.guacamole.GuacamoleSecurityException;
import org.glyptodon.guacamole.net.auth.permission.ObjectPermission; import org.glyptodon.guacamole.net.auth.permission.ObjectPermission;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.base; package org.glyptodon.guacamole.auth.jdbc.base;
/** /**
* Object representation of a Guacamole object, such as a user or connection, * Object representation of a Guacamole object, such as a user or connection,

View File

@@ -20,9 +20,9 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.base; package org.glyptodon.guacamole.auth.jdbc.base;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
/** /**
* Common base class for objects that are associated with the users that * Common base class for objects that are associated with the users that

View File

@@ -25,4 +25,4 @@
* relationships between the model and the implementations of guacamole-ext * relationships between the model and the implementations of guacamole-ext
* classes. * classes.
*/ */
package org.glyptodon.guacamole.auth.mysql.base; package org.glyptodon.guacamole.auth.jdbc.base;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.conf; package org.glyptodon.guacamole.auth.jdbc.conf;
import org.glyptodon.guacamole.properties.BooleanGuacamoleProperty; import org.glyptodon.guacamole.properties.BooleanGuacamoleProperty;
import org.glyptodon.guacamole.properties.IntegerGuacamoleProperty; import org.glyptodon.guacamole.properties.IntegerGuacamoleProperty;

View File

@@ -23,4 +23,4 @@
/** /**
* Classes related to the configuration of the MySQL authentication provider. * Classes related to the configuration of the MySQL authentication provider.
*/ */
package org.glyptodon.guacamole.auth.mysql.conf; package org.glyptodon.guacamole.auth.jdbc.conf;

View File

@@ -20,14 +20,14 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connection; package org.glyptodon.guacamole.auth.jdbc.connection;
import com.google.inject.Inject; import com.google.inject.Inject;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.net.auth.Connection; import org.glyptodon.guacamole.net.auth.Connection;
import org.glyptodon.guacamole.net.auth.Directory; import org.glyptodon.guacamole.net.auth.Directory;

View File

@@ -20,11 +20,11 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connection; package org.glyptodon.guacamole.auth.jdbc.connection;
import java.util.Set; import java.util.Set;
import org.glyptodon.guacamole.auth.mysql.base.DirectoryObjectMapper; import org.glyptodon.guacamole.auth.jdbc.base.DirectoryObjectMapper;
import org.glyptodon.guacamole.auth.mysql.user.UserModel; import org.glyptodon.guacamole.auth.jdbc.user.UserModel;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**

View File

@@ -20,9 +20,9 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connection; package org.glyptodon.guacamole.auth.jdbc.connection;
import org.glyptodon.guacamole.auth.mysql.base.ObjectModel; import org.glyptodon.guacamole.auth.jdbc.base.ObjectModel;
/** /**
* Object representation of a Guacamole connection, as represented in the * Object representation of a Guacamole connection, as represented in the

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connection; package org.glyptodon.guacamole.auth.jdbc.connection;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connection; package org.glyptodon.guacamole.auth.jdbc.connection;
import java.util.Date; import java.util.Date;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connection; package org.glyptodon.guacamole.auth.jdbc.connection;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.Provider; import com.google.inject.Provider;
@@ -30,10 +30,10 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.auth.mysql.base.DirectoryObjectMapper; import org.glyptodon.guacamole.auth.jdbc.base.DirectoryObjectMapper;
import org.glyptodon.guacamole.auth.mysql.base.DirectoryObjectService; import org.glyptodon.guacamole.auth.jdbc.base.DirectoryObjectService;
import org.glyptodon.guacamole.auth.mysql.socket.GuacamoleSocketService; import org.glyptodon.guacamole.auth.jdbc.socket.GuacamoleSocketService;
import org.glyptodon.guacamole.GuacamoleClientException; import org.glyptodon.guacamole.GuacamoleClientException;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.GuacamoleSecurityException; import org.glyptodon.guacamole.GuacamoleSecurityException;

View File

@@ -20,14 +20,14 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connection; package org.glyptodon.guacamole.auth.jdbc.connection;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.Provider; import com.google.inject.Provider;
import java.util.List; import java.util.List;
import org.glyptodon.guacamole.auth.mysql.base.DirectoryObject; import org.glyptodon.guacamole.auth.jdbc.base.DirectoryObject;
import org.glyptodon.guacamole.auth.mysql.connectiongroup.MySQLRootConnectionGroup; import org.glyptodon.guacamole.auth.jdbc.connectiongroup.MySQLRootConnectionGroup;
import org.glyptodon.guacamole.auth.mysql.socket.GuacamoleSocketService; import org.glyptodon.guacamole.auth.jdbc.socket.GuacamoleSocketService;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.net.GuacamoleSocket; import org.glyptodon.guacamole.net.GuacamoleSocket;
import org.glyptodon.guacamole.net.auth.Connection; import org.glyptodon.guacamole.net.auth.Connection;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connection; package org.glyptodon.guacamole.auth.jdbc.connection;
import java.util.Date; import java.util.Date;

View File

@@ -20,11 +20,11 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connection; package org.glyptodon.guacamole.auth.jdbc.connection;
import com.google.inject.Inject; import com.google.inject.Inject;
import java.util.Map; import java.util.Map;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.protocol.GuacamoleConfiguration; import org.glyptodon.guacamole.protocol.GuacamoleConfiguration;
/** /**

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connection; package org.glyptodon.guacamole.auth.jdbc.connection;
import java.util.Collection; import java.util.Collection;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connection; package org.glyptodon.guacamole.auth.jdbc.connection;
/** /**
* A single parameter name/value pair belonging to a connection. * A single parameter name/value pair belonging to a connection.

View File

@@ -23,4 +23,4 @@
/** /**
* Classes related to connections and their parameters and history. * Classes related to connections and their parameters and history.
*/ */
package org.glyptodon.guacamole.auth.mysql.connection; package org.glyptodon.guacamole.auth.jdbc.connection;

View File

@@ -20,14 +20,14 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connectiongroup; package org.glyptodon.guacamole.auth.jdbc.connectiongroup;
import com.google.inject.Inject; import com.google.inject.Inject;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.net.auth.ConnectionGroup; import org.glyptodon.guacamole.net.auth.ConnectionGroup;
import org.glyptodon.guacamole.net.auth.Directory; import org.glyptodon.guacamole.net.auth.Directory;

View File

@@ -20,11 +20,11 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connectiongroup; package org.glyptodon.guacamole.auth.jdbc.connectiongroup;
import java.util.Set; import java.util.Set;
import org.glyptodon.guacamole.auth.mysql.base.DirectoryObjectMapper; import org.glyptodon.guacamole.auth.jdbc.base.DirectoryObjectMapper;
import org.glyptodon.guacamole.auth.mysql.user.UserModel; import org.glyptodon.guacamole.auth.jdbc.user.UserModel;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**

View File

@@ -20,9 +20,9 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connectiongroup; package org.glyptodon.guacamole.auth.jdbc.connectiongroup;
import org.glyptodon.guacamole.auth.mysql.base.ObjectModel; import org.glyptodon.guacamole.auth.jdbc.base.ObjectModel;
import org.glyptodon.guacamole.net.auth.ConnectionGroup; import org.glyptodon.guacamole.net.auth.ConnectionGroup;
/** /**

View File

@@ -20,15 +20,15 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connectiongroup; package org.glyptodon.guacamole.auth.jdbc.connectiongroup;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.Provider; import com.google.inject.Provider;
import java.util.Set; import java.util.Set;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.auth.mysql.base.DirectoryObjectMapper; import org.glyptodon.guacamole.auth.jdbc.base.DirectoryObjectMapper;
import org.glyptodon.guacamole.auth.mysql.base.DirectoryObjectService; import org.glyptodon.guacamole.auth.jdbc.base.DirectoryObjectService;
import org.glyptodon.guacamole.auth.mysql.socket.GuacamoleSocketService; import org.glyptodon.guacamole.auth.jdbc.socket.GuacamoleSocketService;
import org.glyptodon.guacamole.GuacamoleClientException; import org.glyptodon.guacamole.GuacamoleClientException;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.GuacamoleSecurityException; import org.glyptodon.guacamole.GuacamoleSecurityException;

View File

@@ -20,13 +20,13 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connectiongroup; package org.glyptodon.guacamole.auth.jdbc.connectiongroup;
import com.google.inject.Inject; import com.google.inject.Inject;
import java.util.Set; import java.util.Set;
import org.glyptodon.guacamole.auth.mysql.base.DirectoryObject; import org.glyptodon.guacamole.auth.jdbc.base.DirectoryObject;
import org.glyptodon.guacamole.auth.mysql.connection.ConnectionService; import org.glyptodon.guacamole.auth.jdbc.connection.ConnectionService;
import org.glyptodon.guacamole.auth.mysql.socket.GuacamoleSocketService; import org.glyptodon.guacamole.auth.jdbc.socket.GuacamoleSocketService;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.net.GuacamoleSocket; import org.glyptodon.guacamole.net.GuacamoleSocket;
import org.glyptodon.guacamole.net.auth.ConnectionGroup; import org.glyptodon.guacamole.net.auth.ConnectionGroup;

View File

@@ -20,12 +20,12 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.connectiongroup; package org.glyptodon.guacamole.auth.jdbc.connectiongroup;
import com.google.inject.Inject; import com.google.inject.Inject;
import java.util.Set; import java.util.Set;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.auth.mysql.connection.ConnectionService; import org.glyptodon.guacamole.auth.jdbc.connection.ConnectionService;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.GuacamoleSecurityException; import org.glyptodon.guacamole.GuacamoleSecurityException;
import org.glyptodon.guacamole.net.GuacamoleSocket; import org.glyptodon.guacamole.net.GuacamoleSocket;

View File

@@ -23,4 +23,4 @@
/** /**
* Classes related to connection groups. * Classes related to connection groups.
*/ */
package org.glyptodon.guacamole.auth.mysql.connectiongroup; package org.glyptodon.guacamole.auth.jdbc.connectiongroup;

View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* The base JDBC authentication provider. This authentication provider serves
* as a basis for other JDBC authentication provider implementations which are
* driven by relatively-common schemas. The only difference between such
* implementations are maintained within database-specific MyBatis mappings.
*/
package org.glyptodon.guacamole.auth.jdbc;

View File

@@ -20,13 +20,13 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.permission; package org.glyptodon.guacamole.auth.jdbc.permission;
import org.glyptodon.guacamole.auth.mysql.user.MySQLUser; import org.glyptodon.guacamole.auth.jdbc.user.MySQLUser;
import com.google.inject.Inject; import com.google.inject.Inject;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.net.auth.permission.SystemPermission; import org.glyptodon.guacamole.net.auth.permission.SystemPermission;
import org.glyptodon.guacamole.net.auth.permission.SystemPermissionSet; import org.glyptodon.guacamole.net.auth.permission.SystemPermissionSet;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.permission; package org.glyptodon.guacamole.auth.jdbc.permission;
/** /**
* Mapper for object-related permissions. * Mapper for object-related permissions.

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.permission; package org.glyptodon.guacamole.auth.jdbc.permission;
import org.glyptodon.guacamole.net.auth.permission.ObjectPermission; import org.glyptodon.guacamole.net.auth.permission.ObjectPermission;

View File

@@ -20,13 +20,13 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.permission; package org.glyptodon.guacamole.auth.jdbc.permission;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.auth.mysql.user.MySQLUser; import org.glyptodon.guacamole.auth.jdbc.user.MySQLUser;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.GuacamoleSecurityException; import org.glyptodon.guacamole.GuacamoleSecurityException;
import org.glyptodon.guacamole.net.auth.permission.ObjectPermission; import org.glyptodon.guacamole.net.auth.permission.ObjectPermission;

View File

@@ -20,10 +20,10 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.permission; package org.glyptodon.guacamole.auth.jdbc.permission;
import java.util.Collection; import java.util.Collection;
import org.glyptodon.guacamole.auth.mysql.user.UserModel; import org.glyptodon.guacamole.auth.jdbc.user.UserModel;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.permission; package org.glyptodon.guacamole.auth.jdbc.permission;
/** /**
* Generic base permission model which grants a permission of a particular type * Generic base permission model which grants a permission of a particular type

View File

@@ -20,14 +20,14 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.permission; package org.glyptodon.guacamole.auth.jdbc.permission;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.auth.mysql.user.MySQLUser; import org.glyptodon.guacamole.auth.jdbc.user.MySQLUser;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.GuacamoleSecurityException; import org.glyptodon.guacamole.GuacamoleSecurityException;
import org.glyptodon.guacamole.net.auth.permission.Permission; import org.glyptodon.guacamole.net.auth.permission.Permission;

View File

@@ -20,9 +20,9 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.permission; package org.glyptodon.guacamole.auth.jdbc.permission;
import org.glyptodon.guacamole.auth.mysql.user.UserModel; import org.glyptodon.guacamole.auth.jdbc.user.UserModel;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.glyptodon.guacamole.net.auth.permission.SystemPermission; import org.glyptodon.guacamole.net.auth.permission.SystemPermission;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.permission; package org.glyptodon.guacamole.auth.jdbc.permission;
import org.glyptodon.guacamole.net.auth.permission.SystemPermission; import org.glyptodon.guacamole.net.auth.permission.SystemPermission;

View File

@@ -20,13 +20,13 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.permission; package org.glyptodon.guacamole.auth.jdbc.permission;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.Provider; import com.google.inject.Provider;
import java.util.Collection; import java.util.Collection;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.auth.mysql.user.MySQLUser; import org.glyptodon.guacamole.auth.jdbc.user.MySQLUser;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.GuacamoleSecurityException; import org.glyptodon.guacamole.GuacamoleSecurityException;
import org.glyptodon.guacamole.net.auth.permission.SystemPermission; import org.glyptodon.guacamole.net.auth.permission.SystemPermission;

View File

@@ -23,4 +23,4 @@
/** /**
* Classes related to object- and system-level permissions. * Classes related to object- and system-level permissions.
*/ */
package org.glyptodon.guacamole.auth.mysql.permission; package org.glyptodon.guacamole.auth.jdbc.permission;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.security; package org.glyptodon.guacamole.auth.jdbc.security;
/** /**
* A service to perform password encryption and checking. * A service to perform password encryption and checking.

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.security; package org.glyptodon.guacamole.auth.jdbc.security;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.security.MessageDigest; import java.security.MessageDigest;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.security; package org.glyptodon.guacamole.auth.jdbc.security;
/** /**
* A service to generate password salts. * A service to generate password salts.

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.security; package org.glyptodon.guacamole.auth.jdbc.security;
import java.security.SecureRandom; import java.security.SecureRandom;

View File

@@ -23,4 +23,4 @@
/** /**
* Classes related to hashing or encryption. * Classes related to hashing or encryption.
*/ */
package org.glyptodon.guacamole.auth.mysql.security; package org.glyptodon.guacamole.auth.jdbc.security;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.socket; package org.glyptodon.guacamole.auth.jdbc.socket;
import com.google.inject.Inject; import com.google.inject.Inject;
import java.util.Collection; import java.util.Collection;
@@ -30,15 +30,15 @@ import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.auth.mysql.connection.MySQLConnection; import org.glyptodon.guacamole.auth.jdbc.connection.MySQLConnection;
import org.glyptodon.guacamole.auth.mysql.connectiongroup.MySQLConnectionGroup; import org.glyptodon.guacamole.auth.jdbc.connectiongroup.MySQLConnectionGroup;
import org.glyptodon.guacamole.auth.mysql.connection.ConnectionRecordMapper; import org.glyptodon.guacamole.auth.jdbc.connection.ConnectionRecordMapper;
import org.glyptodon.guacamole.auth.mysql.connection.ParameterMapper; import org.glyptodon.guacamole.auth.jdbc.connection.ParameterMapper;
import org.glyptodon.guacamole.auth.mysql.connection.ConnectionModel; import org.glyptodon.guacamole.auth.jdbc.connection.ConnectionModel;
import org.glyptodon.guacamole.auth.mysql.connection.ConnectionRecordModel; import org.glyptodon.guacamole.auth.jdbc.connection.ConnectionRecordModel;
import org.glyptodon.guacamole.auth.mysql.connection.ParameterModel; import org.glyptodon.guacamole.auth.jdbc.connection.ParameterModel;
import org.glyptodon.guacamole.auth.mysql.user.UserModel; import org.glyptodon.guacamole.auth.jdbc.user.UserModel;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.environment.Environment; import org.glyptodon.guacamole.environment.Environment;
import org.glyptodon.guacamole.net.GuacamoleSocket; import org.glyptodon.guacamole.net.GuacamoleSocket;

View File

@@ -20,10 +20,10 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.socket; package org.glyptodon.guacamole.auth.jdbc.socket;
import java.util.Date; import java.util.Date;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.net.auth.ConnectionRecord; import org.glyptodon.guacamole.net.auth.ConnectionRecord;

View File

@@ -20,12 +20,12 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.socket; package org.glyptodon.guacamole.auth.jdbc.socket;
import java.util.List; import java.util.List;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.auth.mysql.connection.MySQLConnection; import org.glyptodon.guacamole.auth.jdbc.connection.MySQLConnection;
import org.glyptodon.guacamole.auth.mysql.connectiongroup.MySQLConnectionGroup; import org.glyptodon.guacamole.auth.jdbc.connectiongroup.MySQLConnectionGroup;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.net.GuacamoleSocket; import org.glyptodon.guacamole.net.GuacamoleSocket;
import org.glyptodon.guacamole.net.auth.Connection; import org.glyptodon.guacamole.net.auth.Connection;

View File

@@ -20,11 +20,11 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.socket; package org.glyptodon.guacamole.auth.jdbc.socket;
import com.google.inject.Singleton; import com.google.inject.Singleton;
import org.glyptodon.guacamole.auth.mysql.user.AuthenticatedUser; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
import org.glyptodon.guacamole.auth.mysql.connection.MySQLConnection; import org.glyptodon.guacamole.auth.jdbc.connection.MySQLConnection;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;

View File

@@ -24,4 +24,4 @@
* Classes related to obtaining/configuring Guacamole sockets, and restricting * Classes related to obtaining/configuring Guacamole sockets, and restricting
* access to those sockets. * access to those sockets.
*/ */
package org.glyptodon.guacamole.auth.mysql.socket; package org.glyptodon.guacamole.auth.jdbc.socket;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.user; package org.glyptodon.guacamole.auth.jdbc.user;
import org.glyptodon.guacamole.net.auth.Credentials; import org.glyptodon.guacamole.net.auth.Credentials;

View File

@@ -20,13 +20,13 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.user; package org.glyptodon.guacamole.auth.jdbc.user;
import com.google.inject.Inject; import com.google.inject.Inject;
import org.glyptodon.guacamole.auth.mysql.base.DirectoryObject; import org.glyptodon.guacamole.auth.jdbc.base.DirectoryObject;
import org.glyptodon.guacamole.auth.mysql.security.PasswordEncryptionService; import org.glyptodon.guacamole.auth.jdbc.security.PasswordEncryptionService;
import org.glyptodon.guacamole.auth.mysql.security.SaltService; import org.glyptodon.guacamole.auth.jdbc.security.SaltService;
import org.glyptodon.guacamole.auth.mysql.permission.SystemPermissionService; import org.glyptodon.guacamole.auth.jdbc.permission.SystemPermissionService;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.net.auth.User; import org.glyptodon.guacamole.net.auth.User;
import org.glyptodon.guacamole.net.auth.permission.ObjectPermissionSet; import org.glyptodon.guacamole.net.auth.permission.ObjectPermissionSet;

View File

@@ -20,12 +20,12 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.user; package org.glyptodon.guacamole.auth.jdbc.user;
import org.glyptodon.guacamole.auth.mysql.connectiongroup.MySQLRootConnectionGroup; import org.glyptodon.guacamole.auth.jdbc.connectiongroup.MySQLRootConnectionGroup;
import org.glyptodon.guacamole.auth.mysql.connectiongroup.ConnectionGroupDirectory; import org.glyptodon.guacamole.auth.jdbc.connectiongroup.ConnectionGroupDirectory;
import org.glyptodon.guacamole.auth.mysql.connection.ConnectionDirectory; import org.glyptodon.guacamole.auth.jdbc.connection.ConnectionDirectory;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.Provider; import com.google.inject.Provider;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.user; package org.glyptodon.guacamole.auth.jdbc.user;
import com.google.inject.Inject; import com.google.inject.Inject;

View File

@@ -20,9 +20,9 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.user; package org.glyptodon.guacamole.auth.jdbc.user;
import org.glyptodon.guacamole.auth.mysql.base.DirectoryObjectMapper; import org.glyptodon.guacamole.auth.jdbc.base.DirectoryObjectMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**

View File

@@ -20,9 +20,9 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.user; package org.glyptodon.guacamole.auth.jdbc.user;
import org.glyptodon.guacamole.auth.mysql.base.ObjectModel; import org.glyptodon.guacamole.auth.jdbc.base.ObjectModel;
/** /**
* Object representation of a Guacamole user, as represented in the database. * Object representation of a Guacamole user, as represented in the database.

View File

@@ -20,15 +20,15 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.auth.mysql.user; package org.glyptodon.guacamole.auth.jdbc.user;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.Provider; import com.google.inject.Provider;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import org.glyptodon.guacamole.net.auth.Credentials; import org.glyptodon.guacamole.net.auth.Credentials;
import org.glyptodon.guacamole.auth.mysql.base.DirectoryObjectMapper; import org.glyptodon.guacamole.auth.jdbc.base.DirectoryObjectMapper;
import org.glyptodon.guacamole.auth.mysql.base.DirectoryObjectService; import org.glyptodon.guacamole.auth.jdbc.base.DirectoryObjectService;
import org.glyptodon.guacamole.GuacamoleClientException; import org.glyptodon.guacamole.GuacamoleClientException;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.net.auth.User; import org.glyptodon.guacamole.net.auth.User;

View File

@@ -23,4 +23,4 @@
/** /**
* Classes related to Guacamole users. * Classes related to Guacamole users.
*/ */
package org.glyptodon.guacamole.auth.mysql.user; package org.glyptodon.guacamole.auth.jdbc.user;

View File

@@ -24,10 +24,10 @@
THE SOFTWARE. THE SOFTWARE.
--> -->
<mapper namespace="org.glyptodon.guacamole.auth.mysql.connection.ConnectionMapper" > <mapper namespace="org.glyptodon.guacamole.auth.jdbc.connection.ConnectionMapper" >
<!-- Result mapper for connection objects --> <!-- Result mapper for connection objects -->
<resultMap id="ConnectionResultMap" type="org.glyptodon.guacamole.auth.mysql.connection.ConnectionModel" > <resultMap id="ConnectionResultMap" type="org.glyptodon.guacamole.auth.jdbc.connection.ConnectionModel" >
<id column="connection_id" property="objectID" jdbcType="INTEGER"/> <id column="connection_id" property="objectID" jdbcType="INTEGER"/>
<result column="connection_name" property="name" jdbcType="VARCHAR"/> <result column="connection_name" property="name" jdbcType="VARCHAR"/>
<result column="parent_id" property="parentIdentifier" jdbcType="INTEGER"/> <result column="parent_id" property="parentIdentifier" jdbcType="INTEGER"/>
@@ -115,7 +115,7 @@
<!-- Insert single connection --> <!-- Insert single connection -->
<insert id="insert" useGeneratedKeys="true" keyProperty="object.objectID" <insert id="insert" useGeneratedKeys="true" keyProperty="object.objectID"
parameterType="org.glyptodon.guacamole.auth.mysql.connection.ConnectionModel"> parameterType="org.glyptodon.guacamole.auth.jdbc.connection.ConnectionModel">
INSERT INTO guacamole_connection ( INSERT INTO guacamole_connection (
connection_name, connection_name,
@@ -131,7 +131,7 @@
</insert> </insert>
<!-- Update single connection --> <!-- Update single connection -->
<update id="update" parameterType="org.glyptodon.guacamole.auth.mysql.connection.ConnectionModel"> <update id="update" parameterType="org.glyptodon.guacamole.auth.jdbc.connection.ConnectionModel">
UPDATE guacamole_connection UPDATE guacamole_connection
SET connection_name = #{object.name,jdbcType=VARCHAR}, SET connection_name = #{object.name,jdbcType=VARCHAR},
parent_id = #{object.parentIdentifier,jdbcType=VARCHAR}, parent_id = #{object.parentIdentifier,jdbcType=VARCHAR},

View File

@@ -24,10 +24,10 @@
THE SOFTWARE. THE SOFTWARE.
--> -->
<mapper namespace="org.glyptodon.guacamole.auth.mysql.connection.ConnectionRecordMapper" > <mapper namespace="org.glyptodon.guacamole.auth.jdbc.connection.ConnectionRecordMapper" >
<!-- Result mapper for system permissions --> <!-- Result mapper for system permissions -->
<resultMap id="ConnectionRecordResultMap" type="org.glyptodon.guacamole.auth.mysql.connection.ConnectionRecordModel"> <resultMap id="ConnectionRecordResultMap" type="org.glyptodon.guacamole.auth.jdbc.connection.ConnectionRecordModel">
<result column="connection_id" property="connectionIdentifier" jdbcType="INTEGER"/> <result column="connection_id" property="connectionIdentifier" jdbcType="INTEGER"/>
<result column="user_id" property="userID" jdbcType="INTEGER"/> <result column="user_id" property="userID" jdbcType="INTEGER"/>
<result column="username" property="username" jdbcType="VARCHAR"/> <result column="username" property="username" jdbcType="VARCHAR"/>
@@ -55,7 +55,7 @@
</select> </select>
<!-- Insert the given connection record --> <!-- Insert the given connection record -->
<insert id="insert" parameterType="org.glyptodon.guacamole.auth.mysql.connection.ConnectionRecordModel"> <insert id="insert" parameterType="org.glyptodon.guacamole.auth.jdbc.connection.ConnectionRecordModel">
INSERT INTO guacamole_connection_history ( INSERT INTO guacamole_connection_history (
connection_id, connection_id,

View File

@@ -24,10 +24,10 @@
THE SOFTWARE. THE SOFTWARE.
--> -->
<mapper namespace="org.glyptodon.guacamole.auth.mysql.connection.ParameterMapper"> <mapper namespace="org.glyptodon.guacamole.auth.jdbc.connection.ParameterMapper">
<!-- Result mapper for connection parameters --> <!-- Result mapper for connection parameters -->
<resultMap id="ParameterResultMap" type="org.glyptodon.guacamole.auth.mysql.connection.ParameterModel"> <resultMap id="ParameterResultMap" type="org.glyptodon.guacamole.auth.jdbc.connection.ParameterModel">
<result column="connection_id" property="connectionIdentifier" jdbcType="INTEGER"/> <result column="connection_id" property="connectionIdentifier" jdbcType="INTEGER"/>
<result column="parameter_name" property="name" jdbcType="VARCHAR"/> <result column="parameter_name" property="name" jdbcType="VARCHAR"/>
<result column="parameter_value" property="value" jdbcType="VARCHAR"/> <result column="parameter_value" property="value" jdbcType="VARCHAR"/>
@@ -51,7 +51,7 @@
</delete> </delete>
<!-- Insert all given parameters --> <!-- Insert all given parameters -->
<insert id="insert" parameterType="org.glyptodon.guacamole.auth.mysql.connection.ParameterModel"> <insert id="insert" parameterType="org.glyptodon.guacamole.auth.jdbc.connection.ParameterModel">
INSERT INTO guacamole_connection_parameter ( INSERT INTO guacamole_connection_parameter (
connection_id, connection_id,

View File

@@ -24,10 +24,10 @@
THE SOFTWARE. THE SOFTWARE.
--> -->
<mapper namespace="org.glyptodon.guacamole.auth.mysql.connectiongroup.ConnectionGroupMapper" > <mapper namespace="org.glyptodon.guacamole.auth.jdbc.connectiongroup.ConnectionGroupMapper" >
<!-- Result mapper for connection objects --> <!-- Result mapper for connection objects -->
<resultMap id="ConnectionGroupResultMap" type="org.glyptodon.guacamole.auth.mysql.connectiongroup.ConnectionGroupModel" > <resultMap id="ConnectionGroupResultMap" type="org.glyptodon.guacamole.auth.jdbc.connectiongroup.ConnectionGroupModel" >
<id column="connection_group_id" property="objectID" jdbcType="INTEGER"/> <id column="connection_group_id" property="objectID" jdbcType="INTEGER"/>
<result column="connection_group_name" property="name" jdbcType="VARCHAR"/> <result column="connection_group_name" property="name" jdbcType="VARCHAR"/>
<result column="parent_id" property="parentIdentifier" jdbcType="INTEGER"/> <result column="parent_id" property="parentIdentifier" jdbcType="INTEGER"/>
@@ -116,7 +116,7 @@
<!-- Insert single connection --> <!-- Insert single connection -->
<insert id="insert" useGeneratedKeys="true" keyProperty="object.objectID" <insert id="insert" useGeneratedKeys="true" keyProperty="object.objectID"
parameterType="org.glyptodon.guacamole.auth.mysql.connectiongroup.ConnectionGroupModel"> parameterType="org.glyptodon.guacamole.auth.jdbc.connectiongroup.ConnectionGroupModel">
INSERT INTO guacamole_connection_group ( INSERT INTO guacamole_connection_group (
connection_group_name, connection_group_name,
@@ -132,7 +132,7 @@
</insert> </insert>
<!-- Update single connection group --> <!-- Update single connection group -->
<update id="update" parameterType="org.glyptodon.guacamole.auth.mysql.connectiongroup.ConnectionGroupModel"> <update id="update" parameterType="org.glyptodon.guacamole.auth.jdbc.connectiongroup.ConnectionGroupModel">
UPDATE guacamole_connection_group UPDATE guacamole_connection_group
SET connection_group_name = #{object.name,jdbcType=VARCHAR}, SET connection_group_name = #{object.name,jdbcType=VARCHAR},
parent_id = #{object.parentIdentifier,jdbcType=VARCHAR}, parent_id = #{object.parentIdentifier,jdbcType=VARCHAR},

View File

@@ -24,10 +24,10 @@
THE SOFTWARE. THE SOFTWARE.
--> -->
<mapper namespace="org.glyptodon.guacamole.auth.mysql.permission.SystemPermissionMapper" > <mapper namespace="org.glyptodon.guacamole.auth.jdbc.permission.SystemPermissionMapper" >
<!-- Result mapper for system permissions --> <!-- Result mapper for system permissions -->
<resultMap id="SystemPermissionResultMap" type="org.glyptodon.guacamole.auth.mysql.permission.SystemPermissionModel"> <resultMap id="SystemPermissionResultMap" type="org.glyptodon.guacamole.auth.jdbc.permission.SystemPermissionModel">
<result column="user_id" property="userID" jdbcType="INTEGER"/> <result column="user_id" property="userID" jdbcType="INTEGER"/>
<result column="username" property="username" jdbcType="VARCHAR"/> <result column="username" property="username" jdbcType="VARCHAR"/>
<result column="permission" property="type" jdbcType="VARCHAR" <result column="permission" property="type" jdbcType="VARCHAR"
@@ -63,7 +63,7 @@
</select> </select>
<!-- Delete all given permissions --> <!-- Delete all given permissions -->
<delete id="delete" parameterType="org.glyptodon.guacamole.auth.mysql.permission.SystemPermissionModel"> <delete id="delete" parameterType="org.glyptodon.guacamole.auth.jdbc.permission.SystemPermissionModel">
DELETE FROM guacamole_system_permission DELETE FROM guacamole_system_permission
WHERE (user_id, permission) IN WHERE (user_id, permission) IN
@@ -76,7 +76,7 @@
</delete> </delete>
<!-- Insert all given permissions --> <!-- Insert all given permissions -->
<insert id="insert" parameterType="org.glyptodon.guacamole.auth.mysql.permission.SystemPermissionModel"> <insert id="insert" parameterType="org.glyptodon.guacamole.auth.jdbc.permission.SystemPermissionModel">
INSERT IGNORE INTO guacamole_system_permission ( INSERT IGNORE INTO guacamole_system_permission (
user_id, user_id,

View File

@@ -24,10 +24,10 @@
THE SOFTWARE. THE SOFTWARE.
--> -->
<mapper namespace="org.glyptodon.guacamole.auth.mysql.user.UserMapper" > <mapper namespace="org.glyptodon.guacamole.auth.jdbc.user.UserMapper" >
<!-- Result mapper for user objects --> <!-- Result mapper for user objects -->
<resultMap id="UserResultMap" type="org.glyptodon.guacamole.auth.mysql.user.UserModel" > <resultMap id="UserResultMap" type="org.glyptodon.guacamole.auth.jdbc.user.UserModel" >
<id column="user_id" property="objectID" jdbcType="INTEGER"/> <id column="user_id" property="objectID" jdbcType="INTEGER"/>
<result column="username" property="identifier" jdbcType="VARCHAR"/> <result column="username" property="identifier" jdbcType="VARCHAR"/>
<result column="password_hash" property="passwordHash" jdbcType="BINARY"/> <result column="password_hash" property="passwordHash" jdbcType="BINARY"/>
@@ -108,7 +108,7 @@
<!-- Insert single user --> <!-- Insert single user -->
<insert id="insert" useGeneratedKeys="true" keyProperty="object.objectID" <insert id="insert" useGeneratedKeys="true" keyProperty="object.objectID"
parameterType="org.glyptodon.guacamole.auth.mysql.user.UserModel"> parameterType="org.glyptodon.guacamole.auth.jdbc.user.UserModel">
INSERT INTO guacamole_user ( INSERT INTO guacamole_user (
username, username,
@@ -124,7 +124,7 @@
</insert> </insert>
<!-- Update single user --> <!-- Update single user -->
<update id="update" parameterType="org.glyptodon.guacamole.auth.mysql.user.UserModel"> <update id="update" parameterType="org.glyptodon.guacamole.auth.jdbc.user.UserModel">
UPDATE guacamole_user UPDATE guacamole_user
SET password_hash = #{object.passwordHash,jdbcType=BINARY}, SET password_hash = #{object.passwordHash,jdbcType=BINARY},
password_salt = #{object.passwordSalt,jdbcType=BINARY} password_salt = #{object.passwordSalt,jdbcType=BINARY}