GUACAMOLE-189: Allow per-connection guacd parameters for the JDBC auth.

This commit is contained in:
Michael Jumper
2016-10-22 20:19:18 -07:00
parent 1c0ee41d0e
commit 152de87dc2
10 changed files with 571 additions and 50 deletions

View File

@@ -0,0 +1,30 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
--
-- Add guacd per-connection override columns
--
ALTER TABLE guacamole_connection ADD COLUMN proxy_port INT(11);
ALTER TABLE guacamole_connection ADD COLUMN proxy_hostname VARCHAR(512);
ALTER TABLE guacamole_connection ADD COLUMN proxy_encryption_method ENUM(
'NONE',
'SSL'
);

View File

@@ -33,6 +33,10 @@
<result column="protocol" property="protocol" jdbcType="VARCHAR"/>
<result column="max_connections" property="maxConnections" jdbcType="INTEGER"/>
<result column="max_connections_per_user" property="maxConnectionsPerUser" jdbcType="INTEGER"/>
<result column="proxy_hostname" property="proxyHostname" jdbcType="VARCHAR"/>
<result column="proxy_port" property="proxyPort" jdbcType="INTEGER"/>
<result column="proxy_encryption_method" property="proxyEncryptionMethod" jdbcType="VARCHAR"
javaType="org.apache.guacamole.auth.jdbc.connection.GuacamoleProxyConfiguration$EncryptionMethod"/>
<!-- Associated sharing profiles -->
<collection property="sharingProfileIdentifiers" resultSet="sharingProfiles" ofType="java.lang.String"
@@ -88,7 +92,10 @@
parent_id,
protocol,
max_connections,
max_connections_per_user
max_connections_per_user,
proxy_hostname,
proxy_port,
proxy_encryption_method
FROM guacamole_connection
WHERE connection_id IN
<foreach collection="identifiers" item="identifier"
@@ -116,7 +123,10 @@
parent_id,
protocol,
max_connections,
max_connections_per_user
max_connections_per_user,
proxy_hostname,
proxy_port,
proxy_encryption_method
FROM guacamole_connection
JOIN guacamole_connection_permission ON guacamole_connection_permission.connection_id = guacamole_connection.connection_id
WHERE guacamole_connection.connection_id IN
@@ -149,7 +159,10 @@
parent_id,
protocol,
max_connections,
max_connections_per_user
max_connections_per_user,
proxy_hostname,
proxy_port,
proxy_encryption_method
FROM guacamole_connection
WHERE
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=VARCHAR}</if>
@@ -173,14 +186,20 @@
parent_id,
protocol,
max_connections,
max_connections_per_user
max_connections_per_user,
proxy_hostname,
proxy_port,
proxy_encryption_method
)
VALUES (
#{object.name,jdbcType=VARCHAR},
#{object.parentIdentifier,jdbcType=VARCHAR},
#{object.protocol,jdbcType=VARCHAR},
#{object.maxConnections,jdbcType=INTEGER},
#{object.maxConnectionsPerUser,jdbcType=INTEGER}
#{object.maxConnectionsPerUser,jdbcType=INTEGER},
#{object.proxyHostname,jdbcType=VARCHAR},
#{object.proxyPort,jdbcType=INTEGER},
#{object.proxyEncryptionMethod,jdbcType=VARCHAR}
)
</insert>
@@ -192,7 +211,10 @@
parent_id = #{object.parentIdentifier,jdbcType=VARCHAR},
protocol = #{object.protocol,jdbcType=VARCHAR},
max_connections = #{object.maxConnections,jdbcType=INTEGER},
max_connections_per_user = #{object.maxConnectionsPerUser,jdbcType=INTEGER}
max_connections_per_user = #{object.maxConnectionsPerUser,jdbcType=INTEGER},
proxy_hostname = #{object.proxyHostname,jdbcType=VARCHAR},
proxy_port = #{object.proxyPort,jdbcType=INTEGER},
proxy_encryption_method = #{object.proxyEncryptionMethod,jdbcType=VARCHAR}
WHERE connection_id = #{object.objectID,jdbcType=INTEGER}
</update>