mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUACAMOLE-70: Allow access to be restricted to strictly the users in the database.
This commit is contained in:
		| @@ -48,6 +48,12 @@ public class MySQLEnvironment extends JDBCEnvironment { | ||||
|      */ | ||||
|     private static final int DEFAULT_PORT = 3306; | ||||
|  | ||||
|     /** | ||||
|      * Whether a database user account is required by default for authentication | ||||
|      * to succeed. | ||||
|      */ | ||||
|     private static final boolean DEFAULT_USER_REQUIRED = false; | ||||
|  | ||||
|     /** | ||||
|      * The default value for the maximum number of connections to be | ||||
|      * allowed to the Guacamole server overall. | ||||
| @@ -167,6 +173,14 @@ public class MySQLEnvironment extends JDBCEnvironment { | ||||
|  | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean isUserRequired() throws GuacamoleException { | ||||
|         return getProperty( | ||||
|             MySQLGuacamoleProperties.MYSQL_USER_REQUIRED, | ||||
|             DEFAULT_USER_REQUIRED | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public int getAbsoluteMaxConnections() throws GuacamoleException { | ||||
|         return getProperty(MySQLGuacamoleProperties.MYSQL_ABSOLUTE_MAX_CONNECTIONS, | ||||
|   | ||||
| @@ -90,6 +90,18 @@ public class MySQLGuacamoleProperties { | ||||
|  | ||||
|     }; | ||||
|  | ||||
|     /** | ||||
|      * Whether a user account within the database is required for authentication | ||||
|      * to succeed, even if the user has been authenticated via another | ||||
|      * authentication provider. | ||||
|      */ | ||||
|     public static final BooleanGuacamoleProperty MYSQL_USER_REQUIRED = new BooleanGuacamoleProperty() { | ||||
|  | ||||
|         @Override | ||||
|         public String getName() { return "mysql-user-required"; } | ||||
|  | ||||
|     }; | ||||
|  | ||||
|     /** | ||||
|      * Whether or not multiple users accessing the same connection at the same  | ||||
|      * time should be disallowed. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user