guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Landry <da...@dmwl.net>
Subject Creating a new JDBC auth extension
Date Mon, 23 Jan 2017 21:13:45 GMT
I created an SQLite JDBC auth extension by using Guacamole's JDBC base
source. I copied the MySQL extension, changed references from MySQL to
SQLite, and translated some of the MySQL-specific queries to work with
SQLite.

My extension only partially works.

Two queries for Connections and ConnectionGroups throw an
ArrayIndexOutOfBoundsException ('select' and 'selectReadable'). I've
validated that the query itself is valid by manually filling in the
parameters and querying the database. I think MyBatis is mixing up how many
parameters the query should have. The 'selectReadable' call expects two
parameters: the user ID and a collection of identifiers. Those two params
are used three places in the query. When I stepped through the code, I saw
the PreparedStatement expected 6 parameters. The exception is thrown when
the code attempts to fill in a third nonexistent parameter.

Can anyone point me in the right direction?

You can see the code here
<https://bitbucket.org/apporto/incubator-guacamole-client/src/f197907dc2e26f4e9393f78f3fb06014f01ddfbd/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlite/?at=sqlite>.
I also uploaded artifacts to make it easier for someone to give it a test
run:

   - SQLite JDBC connector -
   https://bitbucket.org/apporto/incubator-guacamole-client/downloads/sqlite-jdbc-3.16.1.jar
   - SQLite auth extension -
   https://bitbucket.org/apporto/incubator-guacamole-client/downloads/guacamole-auth-jdbc-sqlite-0.9.10-incubating.jar
   - A test DB with a single ConnectionGroup (move it to
   /tmp/guac_test.sqlite) -
   https://bitbucket.org/apporto/incubator-guacamole-client/downloads/guac_test.sqlite
   - guacamole.properties file (there are some bogus settings required
   right now) -
   https://bitbucket.org/apporto/incubator-guacamole-client/downloads/guacamole.properties


-- 

---

David Landry

Mime
View raw message