You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by necouchman <gi...@git.apache.org> on 2017/10/13 16:56:38 UTC

[GitHub] incubator-guacamole-client pull request #198: GUACAMOLE-415: Add support for...

GitHub user necouchman opened a pull request:

    https://github.com/apache/incubator-guacamole-client/pull/198

    GUACAMOLE-415: Add support for SQLite Authentication Module

    This pull request adds support for the SQLite JDBC driver to the JDBC authentication module.  There are a couple of things worth noting:
    - Support for SQLite in JdbcHelper did not show up until MyBatis Guice 3.9.  I've gone ahead and bumped that version up, and tested it with both SQLite and PostgreSQL, without an adverse behavior, but that's worth discussing.  I think I can probably get the driver going without the JdbcHelper by manually setting JDBC.driver and JDBC.url properties, if we don't want to rev the MyBatis Guice version - just let me know.
    - There's a bug [1] in the SQLite JDBC driver that impacts parameters being inserted into prepared statements, and, as a result, I had to break the select statements for this driver into individual blocks, which resulted in some badly duplicated XML code.  It works, it's just not ideal, from a maintainability or performance perspective.
    
    [1] [https://github.com/xerial/sqlite-jdbc/issues/277](url)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/necouchman/incubator-guacamole-client working/sqlite

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-guacamole-client/pull/198.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #198
    
----
commit 862be949a2843c30da5943725bdd9a982374a5df
Author: Nick Couchman <vn...@apache.org>
Date:   2017-10-13T16:47:32Z

    GUACAMOLE-415: Implementation of SQLite module for JDBC Authentication Provider

----


---

[GitHub] incubator-guacamole-client pull request #198: GUACAMOLE-415: Add support for...

Posted by necouchman <gi...@git.apache.org>.
Github user necouchman commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/198#discussion_r144606666
  
    --- Diff: extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlite/schema/002-create-admin-user.sql ---
    @@ -0,0 +1,49 @@
    +--
    +-- 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.
    +--
    +
    +-- Create default user "guacadmin" with password "guacadmin"
    +INSERT INTO guacamole_user (username, password_hash, password_salt, password_date)
    +VALUES ('guacadmin',
    +    x'CA458A7D494E3BE824F5E1E175A1556C0F8EEF2C2D7DF3633BEC4A29C4411960',  -- 'guacadmin'
    +    x'FE24ADC5E11E2B25288D1704ABE67A79E342ECC26064CE69C5B3177795A82264',
    +    datetime('now','localtime'));
    --- End diff --
    
    This actually doesn't work, needs to be replaced with strftime().


---

[GitHub] incubator-guacamole-client pull request #198: GUACAMOLE-415: Add support for...

Posted by necouchman <gi...@git.apache.org>.
Github user necouchman commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/198#discussion_r144607594
  
    --- Diff: extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlite/src/main/resources/org/apache/guacamole/auth/jdbc/connectiongroup/ConnectionGroupMapper.xml ---
    @@ -0,0 +1,250 @@
    +<?xml version="1.0" encoding="UTF-8" ?>
    +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
    +    "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    +
    +<!--
    +    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.
    +-->
    +
    +<mapper namespace="org.apache.guacamole.auth.jdbc.connectiongroup.ConnectionGroupMapper" >
    +
    +    <!-- Result mapper for connection objects -->
    +    <resultMap id="ConnectionGroupResultMap" type="org.apache.guacamole.auth.jdbc.connectiongroup.ConnectionGroupModel" >
    +
    +        <!-- Connection group properties -->
    +        <id     column="connection_group_id"      property="objectID"               jdbcType="INTEGER"/>
    +        <result column="connection_group_name"    property="name"                   jdbcType="VARCHAR"/>
    +        <result column="parent_id"                property="parentIdentifier"       jdbcType="INTEGER"/>
    +        <result column="type"                     property="type"                   jdbcType="VARCHAR"
    +                javaType="org.apache.guacamole.net.auth.ConnectionGroup$Type"/>
    +        <result column="max_connections"          property="maxConnections"         jdbcType="INTEGER"/>
    +        <result column="max_connections_per_user" property="maxConnectionsPerUser"  jdbcType="INTEGER"/>
    +        <result column="enable_session_affinity"  property="sessionAffinityEnabled" jdbcType="BOOLEAN"/>
    +
    +        <!-- Child connection groups -->
    +        <collection property="connectionGroupIdentifiers" resultSet="childConnectionGroups" ofType="java.lang.String"
    +                    column="connection_group_id" foreignColumn="parent_id" select="selectChildGroups"/>
    +
    +        <!-- Child connections -->
    +        <collection property="connectionIdentifiers" resultSet="childConnections" ofType="java.lang.String"
    +                    column="connection_group_id" foreignColumn="parent_id" select="selectChildConnections"/>
    +
    +    </resultMap>
    +
    +    <!-- Result mapper for connection objects with read permission check -->
    --- End diff --
    
    Ick.


---

[GitHub] incubator-guacamole-client pull request #198: GUACAMOLE-415: Add support for...

Posted by necouchman <gi...@git.apache.org>.
Github user necouchman commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/198#discussion_r144698859
  
    --- Diff: extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/pom.xml ---
    @@ -116,7 +116,7 @@
             <dependency>
                 <groupId>org.mybatis</groupId>
                 <artifactId>mybatis-guice</artifactId>
    -            <version>3.6</version>
    +            <version>3.9</version>
    --- End diff --
    
    I can probably do this without updating mybatis-guice, without the JdbcHelper support for SQLite, if this change needs to be a separate issue.  I was able to bump up both mybatis and mybatis-guice versions to the latest without seeing any adverse effects, but it probably warrants further discussion and testing.


---

[GitHub] incubator-guacamole-client pull request #198: GUACAMOLE-415: Add support for...

Posted by necouchman <gi...@git.apache.org>.
Github user necouchman commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/198#discussion_r144635428
  
    --- Diff: extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlite/src/main/java/org/apache/guacamole/auth/sqlite/SQLiteGuacamoleProperties.java ---
    @@ -0,0 +1,127 @@
    +/*
    + * 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.
    + */
    +
    +package org.apache.guacamole.auth.sqlite;
    +
    +import org.apache.guacamole.properties.BooleanGuacamoleProperty;
    +import org.apache.guacamole.properties.IntegerGuacamoleProperty;
    +import org.apache.guacamole.properties.StringGuacamoleProperty;
    +
    +/**
    + * Properties used by the SQLite Authentication plugin.
    + */
    +public class SQLiteGuacamoleProperties {
    +
    +    /**
    +     * This class should not be instantiated.
    +     */
    +    private SQLiteGuacamoleProperties() {}
    +
    +    /**
    +     * The absolute path of the SQLite database containing the Guacamole
    +     * authentication tables.
    +     */
    +    public static final StringGuacamoleProperty SQLITE_DATABASE =
    +            new StringGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-database"; }
    +
    +    };
    +
    +    /**
    +     * 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
    +            SQLITE_USER_REQUIRED = new BooleanGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-user-required"; }
    +
    +    };
    +
    +    /**
    +     * The maximum number of concurrent connections to allow overall. Zero
    +     * denotes unlimited.
    +     */
    +    public static final IntegerGuacamoleProperty
    +            SQLITE_ABSOLUTE_MAX_CONNECTIONS =
    +            new IntegerGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-absolute-max-connections"; }
    +
    --- End diff --
    
    All of the connection-limiting properties.  Just not sure those actually apply to something file-based like SQLite?


---

[GitHub] incubator-guacamole-client pull request #198: GUACAMOLE-415: Add support for...

Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/198#discussion_r144685966
  
    --- Diff: extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlite/src/main/java/org/apache/guacamole/auth/sqlite/SQLiteGuacamoleProperties.java ---
    @@ -0,0 +1,127 @@
    +/*
    + * 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.
    + */
    +
    +package org.apache.guacamole.auth.sqlite;
    +
    +import org.apache.guacamole.properties.BooleanGuacamoleProperty;
    +import org.apache.guacamole.properties.IntegerGuacamoleProperty;
    +import org.apache.guacamole.properties.StringGuacamoleProperty;
    +
    +/**
    + * Properties used by the SQLite Authentication plugin.
    + */
    +public class SQLiteGuacamoleProperties {
    +
    +    /**
    +     * This class should not be instantiated.
    +     */
    +    private SQLiteGuacamoleProperties() {}
    +
    +    /**
    +     * The absolute path of the SQLite database containing the Guacamole
    +     * authentication tables.
    +     */
    +    public static final StringGuacamoleProperty SQLITE_DATABASE =
    +            new StringGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-database"; }
    +
    +    };
    +
    +    /**
    +     * 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
    +            SQLITE_USER_REQUIRED = new BooleanGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-user-required"; }
    +
    +    };
    +
    +    /**
    +     * The maximum number of concurrent connections to allow overall. Zero
    +     * denotes unlimited.
    +     */
    +    public static final IntegerGuacamoleProperty
    +            SQLITE_ABSOLUTE_MAX_CONNECTIONS =
    +            new IntegerGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-absolute-max-connections"; }
    +
    --- End diff --
    
    They're applicable. The connection-limiting properties deal with the default behavior of Guacamole connections, not database connections.
    
    The hostname and port properties definitely wouldn't apply, though.


---

[GitHub] incubator-guacamole-client pull request #198: GUACAMOLE-415: Add support for...

Posted by necouchman <gi...@git.apache.org>.
Github user necouchman commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/198#discussion_r144607268
  
    --- Diff: extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlite/src/main/java/org/apache/guacamole/auth/sqlite/SQLiteGuacamoleProperties.java ---
    @@ -0,0 +1,127 @@
    +/*
    + * 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.
    + */
    +
    +package org.apache.guacamole.auth.sqlite;
    +
    +import org.apache.guacamole.properties.BooleanGuacamoleProperty;
    +import org.apache.guacamole.properties.IntegerGuacamoleProperty;
    +import org.apache.guacamole.properties.StringGuacamoleProperty;
    +
    +/**
    + * Properties used by the SQLite Authentication plugin.
    + */
    +public class SQLiteGuacamoleProperties {
    +
    +    /**
    +     * This class should not be instantiated.
    +     */
    +    private SQLiteGuacamoleProperties() {}
    +
    +    /**
    +     * The absolute path of the SQLite database containing the Guacamole
    +     * authentication tables.
    +     */
    +    public static final StringGuacamoleProperty SQLITE_DATABASE =
    +            new StringGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-database"; }
    +
    +    };
    +
    +    /**
    +     * 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
    +            SQLITE_USER_REQUIRED = new BooleanGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-user-required"; }
    +
    +    };
    +
    +    /**
    +     * The maximum number of concurrent connections to allow overall. Zero
    +     * denotes unlimited.
    +     */
    +    public static final IntegerGuacamoleProperty
    +            SQLITE_ABSOLUTE_MAX_CONNECTIONS =
    +            new IntegerGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-absolute-max-connections"; }
    +
    --- End diff --
    
    Does these actually apply to SQLite??


---

[GitHub] incubator-guacamole-client pull request #198: GUACAMOLE-415: Add support for...

Posted by necouchman <gi...@git.apache.org>.
Github user necouchman commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/198#discussion_r144698791
  
    --- Diff: extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlite/src/main/java/org/apache/guacamole/auth/sqlite/SQLiteGuacamoleProperties.java ---
    @@ -0,0 +1,127 @@
    +/*
    + * 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.
    + */
    +
    +package org.apache.guacamole.auth.sqlite;
    +
    +import org.apache.guacamole.properties.BooleanGuacamoleProperty;
    +import org.apache.guacamole.properties.IntegerGuacamoleProperty;
    +import org.apache.guacamole.properties.StringGuacamoleProperty;
    +
    +/**
    + * Properties used by the SQLite Authentication plugin.
    + */
    +public class SQLiteGuacamoleProperties {
    +
    +    /**
    +     * This class should not be instantiated.
    +     */
    +    private SQLiteGuacamoleProperties() {}
    +
    +    /**
    +     * The absolute path of the SQLite database containing the Guacamole
    +     * authentication tables.
    +     */
    +    public static final StringGuacamoleProperty SQLITE_DATABASE =
    +            new StringGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-database"; }
    +
    +    };
    +
    +    /**
    +     * 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
    +            SQLITE_USER_REQUIRED = new BooleanGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-user-required"; }
    +
    +    };
    +
    +    /**
    +     * The maximum number of concurrent connections to allow overall. Zero
    +     * denotes unlimited.
    +     */
    +    public static final IntegerGuacamoleProperty
    +            SQLITE_ABSOLUTE_MAX_CONNECTIONS =
    +            new IntegerGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-absolute-max-connections"; }
    +
    --- End diff --
    
    Sounds good.  I think I got the rest of them removed, just wasn't sure about those.


---

[GitHub] incubator-guacamole-client pull request #198: GUACAMOLE-415: Add support for...

Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/198#discussion_r144631879
  
    --- Diff: extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlite/src/main/java/org/apache/guacamole/auth/sqlite/SQLiteGuacamoleProperties.java ---
    @@ -0,0 +1,127 @@
    +/*
    + * 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.
    + */
    +
    +package org.apache.guacamole.auth.sqlite;
    +
    +import org.apache.guacamole.properties.BooleanGuacamoleProperty;
    +import org.apache.guacamole.properties.IntegerGuacamoleProperty;
    +import org.apache.guacamole.properties.StringGuacamoleProperty;
    +
    +/**
    + * Properties used by the SQLite Authentication plugin.
    + */
    +public class SQLiteGuacamoleProperties {
    +
    +    /**
    +     * This class should not be instantiated.
    +     */
    +    private SQLiteGuacamoleProperties() {}
    +
    +    /**
    +     * The absolute path of the SQLite database containing the Guacamole
    +     * authentication tables.
    +     */
    +    public static final StringGuacamoleProperty SQLITE_DATABASE =
    +            new StringGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-database"; }
    +
    +    };
    +
    +    /**
    +     * 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
    +            SQLITE_USER_REQUIRED = new BooleanGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-user-required"; }
    +
    +    };
    +
    +    /**
    +     * The maximum number of concurrent connections to allow overall. Zero
    +     * denotes unlimited.
    +     */
    +    public static final IntegerGuacamoleProperty
    +            SQLITE_ABSOLUTE_MAX_CONNECTIONS =
    +            new IntegerGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "sqlite-absolute-max-connections"; }
    +
    --- End diff --
    
    Which?


---

[GitHub] incubator-guacamole-client pull request #198: GUACAMOLE-415: Add support for...

Posted by necouchman <gi...@git.apache.org>.
Github user necouchman commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/198#discussion_r144606001
  
    --- Diff: extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/pom.xml ---
    @@ -116,7 +116,7 @@
             <dependency>
                 <groupId>org.mybatis</groupId>
                 <artifactId>mybatis-guice</artifactId>
    -            <version>3.6</version>
    +            <version>3.9</version>
    --- End diff --
    
    Needs discussion...


---

[GitHub] incubator-guacamole-client pull request #198: GUACAMOLE-415: Add support for...

Posted by necouchman <gi...@git.apache.org>.
Github user necouchman commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/198#discussion_r144607525
  
    --- Diff: extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlite/src/main/resources/org/apache/guacamole/auth/jdbc/connection/ConnectionMapper.xml ---
    @@ -0,0 +1,253 @@
    +<?xml version="1.0" encoding="UTF-8" ?>
    +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
    +    "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    +
    +<!--
    +    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.
    +-->
    +
    +<mapper namespace="org.apache.guacamole.auth.jdbc.connection.ConnectionMapper" >
    +
    +    <!-- Result mapper for connection objects -->
    +    <resultMap id="ConnectionResultMap" type="org.apache.guacamole.auth.jdbc.connection.ConnectionModel" >
    +
    +        <!-- Connection properties -->
    +        <id     column="connection_id"            property="objectID"              jdbcType="INTEGER"/>
    +        <result column="connection_name"          property="name"                  jdbcType="VARCHAR"/>
    +        <result column="parent_id"                property="parentIdentifier"      jdbcType="INTEGER"/>
    +        <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.net.auth.GuacamoleProxyConfiguration$EncryptionMethod"/>
    +        <result column="connection_weight"        property="connectionWeight"      jdbcType="INTEGER"/>
    +        <result column="failover_only"            property="failoverOnly"          jdbcType="BOOLEAN"/>
    +
    +        <!-- Associated sharing profiles -->
    +        <collection property="sharingProfileIdentifiers" resultSet="sharingProfiles" ofType="java.lang.String"
    +                    column="connection_id" foreignColumn="primary_connection_id" select="selectSharingProfiles"/>
    +
    +    </resultMap>
    +
    +    <!-- Result mapper for connection objects with read permission check -->
    --- End diff --
    
    This is the result of the SQLite JDBC bug.  Yeah, it's bad.


---