GUACAMOLE-470: Merge remove translations for color-scheme enum values.
diff --git a/doc/guacamole-example/pom.xml b/doc/guacamole-example/pom.xml
index 26bddf3..55b9339 100644
--- a/doc/guacamole-example/pom.xml
+++ b/doc/guacamole-example/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-example</artifactId>
<packaging>war</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-example</name>
<url>http://guacamole.apache.org/</url>
@@ -106,7 +106,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-common</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<scope>compile</scope>
</dependency>
@@ -114,7 +114,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-common-js</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>
diff --git a/doc/guacamole-playback-example/pom.xml b/doc/guacamole-playback-example/pom.xml
index d925d92..1b31374 100644
--- a/doc/guacamole-playback-example/pom.xml
+++ b/doc/guacamole-playback-example/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-playback-example</artifactId>
<packaging>war</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-playback-example</name>
<url>http://guacamole.apache.org/</url>
@@ -88,7 +88,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-common-js</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>
diff --git a/extensions/guacamole-auth-cas/pom.xml b/extensions/guacamole-auth-cas/pom.xml
index f87ae3f..cfdae86 100644
--- a/extensions/guacamole-auth-cas/pom.xml
+++ b/extensions/guacamole-auth-cas/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-cas</artifactId>
<packaging>jar</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-auth-cas</name>
<url>http://guacamole.apache.org/</url>
@@ -210,7 +210,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-common</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<scope>provided</scope>
</dependency>
@@ -218,7 +218,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-ext</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<scope>provided</scope>
</dependency>
diff --git a/extensions/guacamole-auth-cas/src/main/resources/guac-manifest.json b/extensions/guacamole-auth-cas/src/main/resources/guac-manifest.json
index 6c2865f..fbf8c09 100644
--- a/extensions/guacamole-auth-cas/src/main/resources/guac-manifest.json
+++ b/extensions/guacamole-auth-cas/src/main/resources/guac-manifest.json
@@ -1,6 +1,6 @@
{
- "guacamoleVersion" : "0.9.14",
+ "guacamoleVersion" : "1.0.0",
"name" : "CAS Authentication Extension",
"namespace" : "guac-cas",
diff --git a/extensions/guacamole-auth-duo/pom.xml b/extensions/guacamole-auth-duo/pom.xml
index dba5413..6f8f5ac 100644
--- a/extensions/guacamole-auth-duo/pom.xml
+++ b/extensions/guacamole-auth-duo/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-duo</artifactId>
<packaging>jar</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-auth-duo</name>
<url>http://guacamole.apache.org/</url>
@@ -213,7 +213,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-ext</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<scope>provided</scope>
</dependency>
diff --git a/extensions/guacamole-auth-duo/src/main/resources/guac-manifest.json b/extensions/guacamole-auth-duo/src/main/resources/guac-manifest.json
index 455aa5e..4c87382 100644
--- a/extensions/guacamole-auth-duo/src/main/resources/guac-manifest.json
+++ b/extensions/guacamole-auth-duo/src/main/resources/guac-manifest.json
@@ -1,6 +1,6 @@
{
- "guacamoleVersion" : "0.9.14",
+ "guacamoleVersion" : "1.0.0",
"name" : "Duo TFA Authentication Backend",
"namespace" : "duo",
diff --git a/extensions/guacamole-auth-header/pom.xml b/extensions/guacamole-auth-header/pom.xml
index db944ce..8a23f9d 100644
--- a/extensions/guacamole-auth-header/pom.xml
+++ b/extensions/guacamole-auth-header/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-header</artifactId>
<packaging>jar</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-auth-header</name>
<url>http://guacamole.apache.org/</url>
@@ -130,7 +130,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-ext</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<scope>provided</scope>
</dependency>
diff --git a/extensions/guacamole-auth-header/src/main/resources/guac-manifest.json b/extensions/guacamole-auth-header/src/main/resources/guac-manifest.json
index 434e08e..c976eef 100644
--- a/extensions/guacamole-auth-header/src/main/resources/guac-manifest.json
+++ b/extensions/guacamole-auth-header/src/main/resources/guac-manifest.json
@@ -1,6 +1,6 @@
{
- "guacamoleVersion" : "0.9.14",
+ "guacamoleVersion" : "1.0.0",
"name" : "HTTP Header Authentication Extension",
"namespace" : "guac-header",
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/pom.xml b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/pom.xml
index 55bfa42..d99534c 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/pom.xml
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/pom.xml
@@ -36,7 +36,7 @@
<parent>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-jdbc</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<relativePath>../../</relativePath>
</parent>
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-dist/pom.xml b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-dist/pom.xml
index a2ed0c3..a204c8e 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-dist/pom.xml
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-dist/pom.xml
@@ -36,7 +36,7 @@
<parent>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-jdbc</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<relativePath>../../</relativePath>
</parent>
@@ -99,21 +99,21 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-jdbc-mysql</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
</dependency>
<!-- PostgreSQL Authentication Extension -->
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-jdbc-postgresql</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
</dependency>
<!-- SQL Server Authentication Extension -->
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-jdbc-sqlserver</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
</dependency>
</dependencies>
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/pom.xml b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/pom.xml
index 466e57b..8815d8a 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/pom.xml
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/pom.xml
@@ -36,7 +36,7 @@
<parent>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-jdbc</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<relativePath>../../</relativePath>
</parent>
@@ -120,7 +120,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-jdbc-base</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
</dependency>
</dependencies>
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/resources/guac-manifest.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/resources/guac-manifest.json
index 39bfac0..7fb613c 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/resources/guac-manifest.json
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/resources/guac-manifest.json
@@ -1,6 +1,6 @@
{
- "guacamoleVersion" : "0.9.14",
+ "guacamoleVersion" : "1.0.0",
"name" : "MySQL Authentication",
"namespace" : "guac-mysql",
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/pom.xml b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/pom.xml
index dbad026..db2019f 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/pom.xml
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/pom.xml
@@ -36,7 +36,7 @@
<parent>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-jdbc</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<relativePath>../../</relativePath>
</parent>
@@ -120,7 +120,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-jdbc-base</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
</dependency>
</dependencies>
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/guac-manifest.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/guac-manifest.json
index 19d1d5e..b4047bc 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/guac-manifest.json
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/guac-manifest.json
@@ -1,6 +1,6 @@
{
- "guacamoleVersion" : "0.9.14",
+ "guacamoleVersion" : "1.0.0",
"name" : "PostgreSQL Authentication",
"namespace" : "guac-postgresql",
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/pom.xml b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/pom.xml
index d10db14..d51d3c7 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/pom.xml
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/pom.xml
@@ -36,7 +36,7 @@
<parent>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-jdbc</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<relativePath>../../</relativePath>
</parent>
@@ -120,7 +120,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-jdbc-base</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
</dependency>
</dependencies>
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/src/main/resources/guac-manifest.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/src/main/resources/guac-manifest.json
index 6759c38..c7a0caa 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/src/main/resources/guac-manifest.json
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/src/main/resources/guac-manifest.json
@@ -1,6 +1,6 @@
{
- "guacamoleVersion" : "0.9.14",
+ "guacamoleVersion" : "1.0.0",
"name" : "SQLServer Authentication",
"namespace" : "guac-sqlserver",
diff --git a/extensions/guacamole-auth-jdbc/pom.xml b/extensions/guacamole-auth-jdbc/pom.xml
index e436ea2..9aee2df 100644
--- a/extensions/guacamole-auth-jdbc/pom.xml
+++ b/extensions/guacamole-auth-jdbc/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-jdbc</artifactId>
<packaging>pom</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-auth-jdbc</name>
<url>http://guacamole.apache.org/</url>
@@ -81,7 +81,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-ext</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<scope>provided</scope>
</dependency>
diff --git a/extensions/guacamole-auth-ldap/pom.xml b/extensions/guacamole-auth-ldap/pom.xml
index 8f3655f..a20a532 100644
--- a/extensions/guacamole-auth-ldap/pom.xml
+++ b/extensions/guacamole-auth-ldap/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-ldap</artifactId>
<packaging>jar</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-auth-ldap</name>
<url>http://guacamole.apache.org/</url>
@@ -130,7 +130,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-ext</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<scope>provided</scope>
</dependency>
diff --git a/extensions/guacamole-auth-ldap/src/main/resources/guac-manifest.json b/extensions/guacamole-auth-ldap/src/main/resources/guac-manifest.json
index 639c2e1..2d4d090 100644
--- a/extensions/guacamole-auth-ldap/src/main/resources/guac-manifest.json
+++ b/extensions/guacamole-auth-ldap/src/main/resources/guac-manifest.json
@@ -1,6 +1,6 @@
{
- "guacamoleVersion" : "0.9.14",
+ "guacamoleVersion" : "1.0.0",
"name" : "LDAP Authentication",
"namespace" : "guac-ldap",
diff --git a/extensions/guacamole-auth-openid/pom.xml b/extensions/guacamole-auth-openid/pom.xml
index ccac0a3..b3a16da 100644
--- a/extensions/guacamole-auth-openid/pom.xml
+++ b/extensions/guacamole-auth-openid/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-openid</artifactId>
<packaging>jar</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-auth-openid</name>
<url>http://guacamole.apache.org/</url>
@@ -210,7 +210,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-ext</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<scope>provided</scope>
</dependency>
diff --git a/extensions/guacamole-auth-openid/src/main/resources/guac-manifest.json b/extensions/guacamole-auth-openid/src/main/resources/guac-manifest.json
index aacca86..91d33f1 100644
--- a/extensions/guacamole-auth-openid/src/main/resources/guac-manifest.json
+++ b/extensions/guacamole-auth-openid/src/main/resources/guac-manifest.json
@@ -1,6 +1,6 @@
{
- "guacamoleVersion" : "0.9.14",
+ "guacamoleVersion" : "1.0.0",
"name" : "OpenID Authentication Extension",
"namespace" : "guac-openid",
diff --git a/extensions/guacamole-auth-quickconnect/pom.xml b/extensions/guacamole-auth-quickconnect/pom.xml
new file mode 100644
index 0000000..a845879
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/pom.xml
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.guacamole</groupId>
+ <artifactId>guacamole-auth-quickconnect</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0.0</version>
+ <name>guacamole-auth-quickconnect</name>
+ <url>http://guacamole.apache.org/</url>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <!-- Written for 1.6 -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.3</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <compilerArgs>
+ <arg>-Xlint:all</arg>
+ <arg>-Werror</arg>
+ </compilerArgs>
+ <fork>true</fork>
+ </configuration>
+ </plugin>
+
+ <!-- Copy dependencies prior to packaging -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.10</version>
+ <executions>
+ <execution>
+ <id>unpack-dependencies</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack-dependencies</goal>
+ </goals>
+ <configuration>
+ <includeScope>runtime</includeScope>
+ <outputDirectory>${project.build.directory}/classes</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Assembly plugin - for easy distribution -->
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.5.3</version>
+ <configuration>
+ <finalName>${project.artifactId}-${project.version}</finalName>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>src/main/assembly/dist.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-dist-archive</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- JS/CSS Minification Plugin -->
+ <plugin>
+ <groupId>com.samaxes.maven</groupId>
+ <artifactId>minify-maven-plugin</artifactId>
+ <version>1.7.5</version>
+ <executions>
+ <execution>
+ <id>default-cli</id>
+ <configuration>
+ <charset>UTF-8</charset>
+
+ <webappSourceDir>${basedir}/src/main/resources</webappSourceDir>
+ <webappTargetDir>${project.build.directory}/classes</webappTargetDir>
+
+ <cssSourceDir>/</cssSourceDir>
+ <cssTargetDir>/</cssTargetDir>
+ <cssFinalFile>quickconnect.css</cssFinalFile>
+
+ <cssSourceIncludes>
+ <cssSourceInclude>**/*.css</cssSourceInclude>
+ </cssSourceIncludes>
+
+ <jsSourceDir>/</jsSourceDir>
+ <jsTargetDir>/</jsTargetDir>
+ <jsFinalFile>quickconnect.js</jsFinalFile>
+
+ <jsSourceIncludes>
+ <jsSourceInclude>**/*.js</jsSourceInclude>
+ </jsSourceIncludes>
+
+ <!-- Do not minify and include tests -->
+ <jsSourceExcludes>
+ <jsSourceExclude>**/*.test.js</jsSourceExclude>
+ </jsSourceExcludes>
+ <jsEngine>CLOSURE</jsEngine>
+
+ <!-- Disable warnings for JSDoc annotations -->
+ <closureWarningLevels>
+ <misplacedTypeAnnotation>OFF</misplacedTypeAnnotation>
+ <nonStandardJsDocs>OFF</nonStandardJsDocs>
+ </closureWarningLevels>
+
+ </configuration>
+ <goals>
+ <goal>minify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Verify format using Apache RAT -->
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <version>0.12</version>
+
+ <configuration>
+ <excludes>
+ <exclude>**/*.json</exclude>
+ <exclude>src/licenses/**/*</exclude>
+ <exclude>src/main/resources/templates/*.html</exclude>
+ </excludes>
+ </configuration>
+
+ <!-- Bind RAT to validate phase -->
+ <executions>
+ <execution>
+ <id>validate</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <dependencies>
+
+ <!-- Guacamole Extension API -->
+ <dependency>
+ <groupId>org.apache.guacamole</groupId>
+ <artifactId>guacamole-ext</artifactId>
+ <version>1.0.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Jersey - JAX-RS Implementation -->
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ <version>1.1.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- JUnit -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.10</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/extensions/guacamole-auth-quickconnect/src/licenses/LICENSE b/extensions/guacamole-auth-quickconnect/src/licenses/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/licenses/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
diff --git a/extensions/guacamole-auth-quickconnect/src/licenses/NOTICE b/extensions/guacamole-auth-quickconnect/src/licenses/NOTICE
new file mode 100644
index 0000000..97e6130
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/licenses/NOTICE
@@ -0,0 +1,5 @@
+Apache Guacamole
+Copyright 2018 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff --git a/extensions/guacamole-auth-quickconnect/src/main/assembly/dist.xml b/extensions/guacamole-auth-quickconnect/src/main/assembly/dist.xml
new file mode 100644
index 0000000..b89fd53
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/assembly/dist.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+
+ <id>dist</id>
+ <baseDirectory>${project.artifactId}-${project.version}</baseDirectory>
+
+ <!-- Output tar.gz -->
+ <formats>
+ <format>tar.gz</format>
+ </formats>
+
+ <!-- Include licenses and extension .jar -->
+ <fileSets>
+
+ <!-- Include licenses -->
+ <fileSet>
+ <outputDirectory></outputDirectory>
+ <directory>src/licenses</directory>
+ </fileSet>
+
+ <!-- Include extension .jar -->
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ </fileSet>
+
+ </fileSets>
+
+</assembly>
diff --git a/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectAuthenticationProvider.java b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectAuthenticationProvider.java
new file mode 100644
index 0000000..090c5e7
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectAuthenticationProvider.java
@@ -0,0 +1,48 @@
+/*
+ * 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.quickconnect;
+
+import org.apache.guacamole.GuacamoleException;
+import org.apache.guacamole.net.auth.AuthenticatedUser;
+import org.apache.guacamole.net.auth.AbstractAuthenticationProvider;
+import org.apache.guacamole.net.auth.UserContext;
+
+/**
+ * This class provides the necessary hooks into the Guacamole Client authentication
+ * process so that the QuickConnect functionality can be initialized and used
+ * throughout the web client.
+ */
+public class QuickConnectAuthenticationProvider extends AbstractAuthenticationProvider {
+
+ @Override
+ public String getIdentifier() {
+ return "quickconnect";
+ }
+
+ @Override
+ public UserContext getUserContext(AuthenticatedUser authenticatedUser)
+ throws GuacamoleException {
+
+ return new QuickConnectUserContext(this,
+ authenticatedUser.getIdentifier());
+
+ }
+
+}
diff --git a/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectDirectory.java b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectDirectory.java
new file mode 100644
index 0000000..37b07ba
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectDirectory.java
@@ -0,0 +1,122 @@
+/*
+ * 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.quickconnect;
+
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.guacamole.GuacamoleException;
+import org.apache.guacamole.auth.quickconnect.utility.QCParser;
+import org.apache.guacamole.net.auth.ConnectionGroup;
+import org.apache.guacamole.net.auth.simple.SimpleConnection;
+import org.apache.guacamole.net.auth.simple.SimpleDirectory;
+import org.apache.guacamole.net.auth.Connection;
+import org.apache.guacamole.protocol.GuacamoleConfiguration;
+
+/**
+ * Implementation of a directory to store Connection objects
+ * completely in memory.
+ */
+public class QuickConnectDirectory extends SimpleDirectory<Connection> {
+
+ /**
+ * The connections to store.
+ */
+ private final Map<String, Connection> connections =
+ new ConcurrentHashMap<String, Connection>();
+
+ /**
+ * The root connection group for this directory.
+ */
+ private final QuickConnectionGroup rootGroup;
+
+ /**
+ * The internal counter for connection IDs.
+ */
+ private final AtomicInteger connectionId;
+
+ /**
+ * Creates a new QuickConnectDirectory with the default
+ * empty Map for Connection objects, and the specified
+ * ConnectionGroup at the root of the directory.
+ *
+ * @param rootGroup
+ * A group that should be at the root of this directory.
+ */
+ public QuickConnectDirectory(ConnectionGroup rootGroup) {
+ this.rootGroup = (QuickConnectionGroup)rootGroup;
+ this.connectionId = new AtomicInteger();
+ super.setObjects(this.connections);
+ }
+
+ /**
+ * Returns the current connection identifier counter and
+ * then increments it.
+ *
+ * @return
+ * An int representing the next available connection
+ * identifier to be used when adding connections.
+ */
+ private int getNextConnectionID() {
+ return connectionId.getAndIncrement();
+ }
+
+ @Override
+ public void add(Connection connection) throws GuacamoleException {
+ connections.put(connection.getIdentifier(), connection);
+ }
+
+ /**
+ * Create a SimpleConnection object from a GuacamoleConfiguration,
+ * obtain an identifier, and place it on the tree, returning the
+ * identifier value of the new connection.
+ *
+ * @param config
+ * The GuacamoleConfiguration object to use to create the
+ * SimpleConnection object.
+ *
+ * @return
+ * The identifier of the connection created in the directory.
+ *
+ * @throws GuacamoleException
+ * If an error occurs adding the object to the tree.
+ */
+ public String create(GuacamoleConfiguration config) throws GuacamoleException {
+
+ // Get the next available connection identifier.
+ String newConnectionId = Integer.toString(getNextConnectionID());
+
+ // Generate a name for the configuration.
+ String name = QCParser.getName(config);
+
+ // Create a new connection and set the parent identifier.
+ Connection connection = new SimpleConnection(name, newConnectionId, config);
+ connection.setParentIdentifier(QuickConnectUserContext.ROOT_IDENTIFIER);
+
+ // Place the object in this directory.
+ add(connection);
+
+ // Add connection to the tree.
+ rootGroup.addConnectionIdentifier(newConnectionId);
+
+ return newConnectionId;
+ }
+
+}
diff --git a/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectException.java b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectException.java
new file mode 100644
index 0000000..6e4d5b9
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectException.java
@@ -0,0 +1,86 @@
+/*
+ * 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.quickconnect;
+
+import org.apache.guacamole.GuacamoleClientException;
+import org.apache.guacamole.language.Translatable;
+import org.apache.guacamole.language.TranslatableMessage;
+
+/**
+ * An exception that is thrown by this extension when an error occurs
+ * attempting to create and establish a connection with a user-provided
+ * URI.
+ */
+public class QuickConnectException extends GuacamoleClientException
+ implements Translatable {
+
+ /**
+ * A message that can be passed through the translation service
+ * to provide information about the error that occurred.
+ */
+ private final TranslatableMessage translatableMessage;
+
+ /**
+ * Create a QuickConnectException with the given message and translationKey.
+ * The message will not be passed through the translation system; the
+ * translationKey will be passed through the translation system. Both should
+ * describe the error.
+ *
+ * @param message
+ * A string describing the error that occurred when trying to create
+ * or establish the connection. This will not be passed through the
+ * translation system.
+ *
+ * @param translationKey
+ * A key known to the translation system describing the error that
+ * occurred when trying to create or establish the connection.
+ * This will be passed through the translation system to provide
+ * a localized version of the message.
+ */
+ public QuickConnectException(String message, String translationKey) {
+ super(message);
+ this.translatableMessage = new TranslatableMessage(translationKey);
+ }
+
+ /**
+ * Create a new QuickConnectException given the human-readable message,
+ * which will not be passed through the translation system, and the
+ * translatableMessage, which will be passed through the translation system.
+ * Both parameters should describe the error preventing the connection
+ * from being created or established.
+ *
+ * @param message
+ * The human-readable message describing the error, which will not
+ * be passed through the translation system.
+ *
+ * @param translatableMessage
+ * The human-readable message describing the error, which will be
+ * passed through the translation system.
+ */
+ public QuickConnectException(String message, TranslatableMessage translatableMessage) {
+ super(message);
+ this.translatableMessage = translatableMessage;
+ }
+
+ @Override
+ public TranslatableMessage getTranslatableMessage() {
+ return translatableMessage;
+ }
+
+}
diff --git a/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectUserContext.java b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectUserContext.java
new file mode 100644
index 0000000..d7e23ed
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectUserContext.java
@@ -0,0 +1,131 @@
+/*
+ * 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.quickconnect;
+
+import java.util.Collections;
+import org.apache.guacamole.auth.quickconnect.rest.QuickConnectREST;
+import org.apache.guacamole.GuacamoleException;
+import org.apache.guacamole.net.auth.AbstractUserContext;
+import org.apache.guacamole.net.auth.AuthenticationProvider;
+import org.apache.guacamole.net.auth.ConnectionGroup;
+import org.apache.guacamole.net.auth.User;
+import org.apache.guacamole.net.auth.simple.SimpleUser;
+
+/**
+ * A simple implementation of UserContext to support this
+ * extension, used for storing connections the user has created
+ * with the QuickConnect bar in the webapp.
+ */
+public class QuickConnectUserContext extends AbstractUserContext {
+
+ /**
+ * The unique identifier of the root connection group.
+ */
+ public static final String ROOT_IDENTIFIER = DEFAULT_ROOT_CONNECTION_GROUP;
+
+ /**
+ * The AuthenticationProvider that created this UserContext.
+ */
+ private final AuthenticationProvider authProvider;
+
+ /**
+ * Reference to the user whose permissions dictate the configurations
+ * accessible within this UserContext.
+ */
+ private final User self;
+
+ /**
+ * The Directory with access to all connections within the root group
+ * associated with this UserContext.
+ */
+ private final QuickConnectDirectory connectionDirectory;
+
+ /**
+ * The root connection group.
+ */
+ private final ConnectionGroup rootGroup;
+
+ /**
+ * Construct a QuickConnectUserContext using the authProvider and
+ * the username.
+ *
+ * @param authProvider
+ * The authentication provider module instantiating this
+ * this class.
+ *
+ * @param username
+ * The name of the user logging in that will be associated
+ * with this UserContext.
+ *
+ * @throws GuacamoleException
+ * If errors occur initializing the ConnectionGroup,
+ * ConnectionDirectory, or User.
+ */
+ public QuickConnectUserContext(AuthenticationProvider authProvider,
+ String username) throws GuacamoleException {
+
+ // Initialize the rootGroup to a QuickConnectionGroup with a
+ // single root identifier.
+ this.rootGroup = new QuickConnectionGroup(
+ ROOT_IDENTIFIER,
+ ROOT_IDENTIFIER
+ );
+
+ // Initialize the connection directory
+ this.connectionDirectory = new QuickConnectDirectory(this.rootGroup);
+
+ // Initialize the user to a SimpleUser with the provided username,
+ // no connections, and the single root group.
+ this.self = new SimpleUser(username,
+ connectionDirectory.getIdentifiers(),
+ Collections.singleton(ROOT_IDENTIFIER)
+ );
+
+ // Set the authProvider to the calling authProvider object.
+ this.authProvider = authProvider;
+
+ }
+
+ @Override
+ public QuickConnectDirectory getConnectionDirectory() {
+ return connectionDirectory;
+ }
+
+ @Override
+ public User self() {
+ return self;
+ }
+
+ @Override
+ public Object getResource() throws GuacamoleException {
+ return new QuickConnectREST(connectionDirectory);
+ }
+
+ @Override
+ public AuthenticationProvider getAuthenticationProvider() {
+ return authProvider;
+ }
+
+ @Override
+ public ConnectionGroup getRootConnectionGroup() throws GuacamoleException {
+ return rootGroup;
+ }
+
+}
diff --git a/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectionGroup.java b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectionGroup.java
new file mode 100644
index 0000000..cbce379
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/QuickConnectionGroup.java
@@ -0,0 +1,117 @@
+/*
+ * 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.quickconnect;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.apache.guacamole.GuacamoleException;
+import org.apache.guacamole.GuacamoleSecurityException;
+import org.apache.guacamole.net.GuacamoleTunnel;
+import org.apache.guacamole.net.auth.AbstractConnectionGroup;
+import org.apache.guacamole.net.auth.ConnectionGroup;
+import org.apache.guacamole.protocol.GuacamoleClientInformation;
+
+/**
+ * Provides a simple, single-level connection group used for
+ * temporarily storing the Connection objects created by users.
+ */
+public class QuickConnectionGroup extends AbstractConnectionGroup {
+
+ /**
+ * A set that will store the Connection identifiers for this group.
+ */
+ private final Set<String> connectionIdentifiers =
+ new HashSet<String>(Collections.<String>emptyList());
+
+ /**
+ * Set up a QuickConnectionGroup with the provided name and
+ * identifier.
+ *
+ * @param name
+ * The name of the QuickConnectionGroup.
+ *
+ * @param identifier
+ * The identifier of the QuickConnectionGroup.
+ */
+ public QuickConnectionGroup(String name, String identifier) {
+
+ super();
+ super.setName(name);
+ super.setIdentifier(identifier);
+ super.setType(ConnectionGroup.Type.ORGANIZATIONAL);
+
+ }
+
+ /**
+ * Add a connection identifier to this connection group, and
+ * return the identifier if the add succeeds, otherwise
+ * return null.
+ *
+ * @param identifier
+ * The identifier of the connection to add to the group.
+ *
+ * @return
+ * The String identifier of the connection if the add
+ * operation was successful; otherwise null.
+ */
+ public String addConnectionIdentifier(String identifier) {
+ if (connectionIdentifiers.add(identifier))
+ return identifier;
+ return null;
+ }
+
+ @Override
+ public int getActiveConnections() {
+ // This group does not track active connections.
+ return 0;
+ }
+
+ @Override
+ public Set<String> getConnectionIdentifiers() {
+ return connectionIdentifiers;
+ }
+
+ @Override
+ public Set<String> getConnectionGroupIdentifiers() {
+ // This group contains only connections, not other groups.
+ return Collections.<String>emptySet();
+ }
+
+ @Override
+ public Map<String, String> getAttributes() {
+ // There are no attributes associated with this group.
+ return Collections.<String, String>emptyMap();
+ }
+
+ @Override
+ public void setAttributes(Map<String, String> attributes) {
+ // Do nothing - there are no attributes
+ }
+
+ @Override
+ public GuacamoleTunnel connect(GuacamoleClientInformation info)
+ throws GuacamoleException {
+ // This group does not support connections
+ throw new GuacamoleSecurityException("Permission denied.");
+ }
+
+}
diff --git a/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/rest/QuickConnectREST.java b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/rest/QuickConnectREST.java
new file mode 100644
index 0000000..4cced07
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/rest/QuickConnectREST.java
@@ -0,0 +1,82 @@
+/*
+ * 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.quickconnect.rest;
+
+import java.util.Collections;
+import java.util.Map;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.Path;
+import javax.ws.rs.POST;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import org.apache.guacamole.GuacamoleException;
+import org.apache.guacamole.auth.quickconnect.QuickConnectDirectory;
+import org.apache.guacamole.auth.quickconnect.utility.QCParser;
+
+/**
+ * A class that implements REST endpoints for the QuickConnect
+ * extension.
+ */
+@Produces(MediaType.APPLICATION_JSON)
+public class QuickConnectREST {
+
+ /**
+ * The connection directory for this REST endpoint.
+ */
+ private final QuickConnectDirectory directory;
+
+ /**
+ * Construct a new QuickConnectREST class, taking in a
+ * QuickConnectDirectory for use with this class.
+ *
+ * @param directory
+ * The QuickConnectDirectory object to associate with this
+ * REST endpoint class.
+ */
+ public QuickConnectREST(QuickConnectDirectory directory) {
+ this.directory = directory;
+ }
+
+ /**
+ * Parse the URI read from the POST input, add the connection
+ * to the directory, and return a Map containing a single key,
+ * identifier, and the identifier of the new connection.
+ *
+ * @param uri
+ * The URI to parse into a connection.
+ *
+ * @return
+ * A Map containing a single key, identifier, and the
+ * identifier of the new connection.
+ *
+ * @throws GuacamoleException
+ * If an error is encountered parsing the URI.
+ */
+ @POST
+ @Path("create")
+ public Map<String, String> create(@FormParam("uri") String uri)
+ throws GuacamoleException {
+
+ return Collections.singletonMap("identifier",
+ directory.create(QCParser.getConfiguration(uri)));
+
+ }
+
+}
diff --git a/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/utility/QCParser.java b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/utility/QCParser.java
new file mode 100644
index 0000000..3e2e5e5
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/utility/QCParser.java
@@ -0,0 +1,256 @@
+/*
+ * 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.quickconnect.utility;
+
+import java.io.UnsupportedEncodingException;
+import java.lang.StringBuilder;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.apache.guacamole.GuacamoleServerException;
+import org.apache.guacamole.GuacamoleException;
+import org.apache.guacamole.auth.quickconnect.QuickConnectException;
+import org.apache.guacamole.protocol.GuacamoleConfiguration;
+
+/**
+ * A utility class to parse out a URI into the settings necessary
+ * to generate a GuacamoleConfiguration object.
+ */
+public class QCParser {
+
+ /**
+ * The regex to use to split username and password.
+ */
+ private static final Pattern userinfoPattern = Pattern.compile("(^[^:]+):?(.*)");
+
+ /**
+ * The regex group of the username.
+ */
+ private static final int USERNAME_GROUP = 1;
+
+ /**
+ * THe regex group of the password.
+ */
+ private static final int PASSWORD_GROUP = 2;
+
+ /**
+ * Parse out a URI string and get a GuacamoleConfiguration
+ * from that string, or an exception if the parsing fails.
+ *
+ * @param uri
+ * The string form of the URI to be parsed.
+ *
+ * @return
+ * A GuacamoleConfiguration generated using the information
+ * provided by the user in the URI.
+ *
+ * @throws GuacamoleException
+ * If an error occurs parsing the URI.
+ */
+ public static GuacamoleConfiguration getConfiguration(String uri)
+ throws GuacamoleException {
+
+ // Parse the provided String into a URI object.
+ URI qcUri;
+ try {
+ qcUri = new URI(uri);
+ if (!qcUri.isAbsolute())
+ throw new QuickConnectException("URI must be absolute.",
+ "QUICKCONNECT.ERROR_NOT_ABSOLUTE_URI");
+ }
+ catch (URISyntaxException e) {
+ throw new QuickConnectException("Invalid URI Syntax",
+ "QUICKCONNECT.ERROR_INVALID_URI");
+ }
+
+ // Break out individual components of the URI.
+ String protocol = qcUri.getScheme();
+ String host = qcUri.getHost();
+ int port = qcUri.getPort();
+ String userInfo = qcUri.getUserInfo();
+ String query = qcUri.getQuery();
+
+ // Generate a new GuacamoleConfiguration
+ GuacamoleConfiguration qcConfig = new GuacamoleConfiguration();
+
+ // Check for protocol and set it, or throw an error if not present
+ if (protocol != null && !protocol.isEmpty())
+ qcConfig.setProtocol(protocol);
+ else
+ throw new QuickConnectException("No protocol specified.",
+ "QUICKCONNECT.ERROR_NO_PROTOCOL");
+
+ // Check for provided port number
+ if (port > 0)
+ qcConfig.setParameter("port", Integer.toString(port));
+
+ // Check for provided host, or throw an error if not present
+ if (host != null && !host.isEmpty())
+ qcConfig.setParameter("hostname", host);
+ else
+ throw new QuickConnectException("No host specified.",
+ "QUICKCONNECT.ERROR_NO_HOST");
+
+ // Look for extra query parameters and parse them out.
+ if (query != null && !query.isEmpty()) {
+ try {
+ Map<String, String> queryParams = parseQueryString(query);
+ if (queryParams != null)
+ for (Map.Entry<String, String> entry: queryParams.entrySet())
+ qcConfig.setParameter(entry.getKey(), entry.getValue());
+ }
+ catch (UnsupportedEncodingException e) {
+ throw new GuacamoleServerException("Unexpected lack of UTF-8 encoding support.", e);
+ }
+ }
+
+ // Look for the username and password and parse them out.
+ if (userInfo != null && !userInfo.isEmpty()) {
+
+ try {
+ parseUserInfo(userInfo, qcConfig);
+ }
+ catch (UnsupportedEncodingException e) {
+ throw new GuacamoleServerException("Unexpected lack of UTF-8 encoding support.", e);
+ }
+ }
+
+ return qcConfig;
+
+ }
+
+ /**
+ * Parse the given string for parameter key/value pairs and return
+ * a map with the parameters.
+ *
+ * @param queryStr
+ * The query string to parse for key/value pairs.
+ *
+ * @return
+ * A map with the key/value pairs.
+ *
+ * @throws UnsupportedEncodingException
+ * If Java lacks UTF-8 support.
+ */
+ public static Map<String, String> parseQueryString(String queryStr)
+ throws UnsupportedEncodingException {
+
+ // Split the query string into the pairs
+ List<String> paramList = Arrays.asList(queryStr.split("&"));
+ Map<String, String> parameters = new HashMap<String,String>();
+
+ // Loop through key/value pairs and put them in the Map.
+ for (String param : paramList) {
+ String[] paramArray = param.split("=", 2);
+ parameters.put(URLDecoder.decode(paramArray[0], "UTF-8"),
+ URLDecoder.decode(paramArray[1], "UTF-8"));
+ }
+
+ return parameters;
+ }
+
+ /**
+ * Parse the given string for username and password values,
+ * and, if values are present, decode them and set them in
+ * the provided GuacamoleConfiguration object.
+ *
+ * @param userInfo
+ * The string to parse for username/password values.
+ *
+ * @param config
+ * The GuacamoleConfiguration object to store the username
+ * and password in.
+ *
+ * @throws UnsupportedEncodingException
+ * If Java lacks UTF-8 support.
+ */
+ public static void parseUserInfo(String userInfo,
+ GuacamoleConfiguration config)
+ throws UnsupportedEncodingException {
+
+ Matcher userinfoMatcher = userinfoPattern.matcher(userInfo);
+
+ if (userinfoMatcher.matches()) {
+ String username = userinfoMatcher.group(USERNAME_GROUP);
+ String password = userinfoMatcher.group(PASSWORD_GROUP);
+
+ if (username != null && !username.isEmpty())
+ config.setParameter("username",
+ URLDecoder.decode(username, "UTF-8"));
+
+ if (password != null && !password.isEmpty())
+ config.setParameter("password",
+ URLDecoder.decode(password, "UTF-8"));
+ }
+
+ }
+
+ /**
+ * Given a GuacamoleConfiguration object, generate a name
+ * for the configuration based on the protocol, host, user
+ * and port in the configuration, and return the string value.
+ *
+ * @param config
+ * The GuacamoleConfiguration object to use to generate
+ * the name.
+ *
+ * @return
+ * The String value of the name that is generated.
+ *
+ * @throws GuacamoleException
+ * If an error occurs getting items in the configuration.
+ */
+ public static String getName(GuacamoleConfiguration config)
+ throws GuacamoleException {
+
+ if (config == null)
+ return null;
+
+ String protocol = config.getProtocol();
+ String host = config.getParameter("hostname");
+ String port = config.getParameter("port");
+ String user = config.getParameter("username");
+
+ StringBuilder name = new StringBuilder();
+
+ if (protocol != null && !protocol.isEmpty())
+ name.append(protocol).append("://");
+
+ if (user != null && !user.isEmpty())
+ name.append(user).append("@");
+
+ if (host != null && !host.isEmpty())
+ name.append(host);
+
+ if (port != null && !port.isEmpty())
+ name.append(":").append(port);
+
+ name.append("/");
+
+ return name.toString();
+ }
+
+}
diff --git a/extensions/guacamole-auth-quickconnect/src/main/resources/controllers/quickconnectController.js b/extensions/guacamole-auth-quickconnect/src/main/resources/controllers/quickconnectController.js
new file mode 100644
index 0000000..34c6780
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/resources/controllers/quickconnectController.js
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+
+/**
+ * The controller for making ad-hoc (quick) connections
+ */
+angular.module('guacQuickConnect').controller('quickconnectController', ['$scope', '$injector',
+ function manageConnectionController($scope, $injector) {
+
+ // Required types
+ var ClientIdentifier = $injector.get('ClientIdentifier');
+
+ // Required services
+ var $location = $injector.get('$location');
+ var guacNotification = $injector.get('guacNotification');
+ var quickConnectService = $injector.get('quickConnectService');
+
+ /**
+ * The URI that will be passed in to the extension to create
+ * the connection.
+ */
+ $scope.uri = null;
+
+ /**
+ * Saves the connection, creating a new connection or updating the existing
+ * connection.
+ */
+ $scope.quickConnect = function quickConnect() {
+
+ quickConnectService.createConnection($scope.uri)
+ .then(function createdConnection(connectionId) {
+ $location.url('/client/' + ClientIdentifier.toString({
+ dataSource : 'quickconnect',
+ type : ClientIdentifier.Types.CONNECTION,
+ id : connectionId
+ }));
+ }, guacNotification.SHOW_REQUEST_ERROR);
+
+ return;
+
+ };
+
+}]);
diff --git a/extensions/guacamole-auth-quickconnect/src/main/resources/guac-manifest.json b/extensions/guacamole-auth-quickconnect/src/main/resources/guac-manifest.json
new file mode 100644
index 0000000..7f1e4da
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/resources/guac-manifest.json
@@ -0,0 +1,31 @@
+{
+ "guacamoleVersion" : "1.0.0",
+
+ "name" : "Adhoc Guacamole Connections",
+ "namespace" : "quickconnect",
+
+ "authProviders" : [
+ "org.apache.guacamole.auth.quickconnect.QuickConnectAuthenticationProvider"
+ ],
+
+ "js" : [
+ "quickconnect.min.js"
+ ],
+
+ "css" : [
+ "quickconnect.min.css"
+ ],
+
+ "html" : [
+ "templates/quickconnectField.html"
+ ],
+
+ "translations" : [
+ "translations/en.json"
+ ],
+
+ "resources" : {
+ "templates/quickconnectField.html" : "text/html"
+ }
+
+}
diff --git a/extensions/guacamole-auth-quickconnect/src/main/resources/quickconnectModule.js b/extensions/guacamole-auth-quickconnect/src/main/resources/quickconnectModule.js
new file mode 100644
index 0000000..ed397a6
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/resources/quickconnectModule.js
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+/**
+ * Module which provides QuickConnect capability
+ */
+angular.module('guacQuickConnect', [
+ 'form'
+]);
+
+// Ensure the guacQuickConnect module is loaded along with the rest of the app
+angular.module('index').requires.push('guacQuickConnect');
diff --git a/extensions/guacamole-auth-quickconnect/src/main/resources/services/quickConnectService.js b/extensions/guacamole-auth-quickconnect/src/main/resources/services/quickConnectService.js
new file mode 100644
index 0000000..0da2980
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/resources/services/quickConnectService.js
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+
+/**
+ * Service for managing quickConnect extension.
+ */
+angular.module('guacQuickConnect').factory('quickConnectService', ['$injector',
+ function quickConnectService($injector) {
+
+ // Required services
+ var authenticationService = $injector.get('authenticationService');
+ var cacheService = $injector.get('cacheService');
+ var requestService = $injector.get('requestService');
+
+ var service = {};
+
+ /**
+ * Makes a request to the REST API to create a connection, returning a
+ * promise that can be used for processing the results of the call.
+ *
+ * @param {uri} The URI of the connection to create.
+ *
+ * @returns {Promise}
+ * A promise for the HTTP call which will succeed if and only if the
+ * save operation is successful.
+ */
+ service.createConnection = function createConnection(uri) {
+
+ // Build HTTP parameters set
+ var httpParameters = {
+ token : authenticationService.getCurrentToken()
+ };
+
+ return requestService({
+ method : 'POST',
+ url : 'api/session/ext/quickconnect/create',
+ params : httpParameters,
+ data : $.param({uri: uri}),
+ headers : {'Content-Type': 'application/x-www-form-urlencoded'}
+ })
+ .then(function connectionCreated(connectionId) {
+ // Clear connections and users from cache.
+ cacheService.connections.removeAll();
+ cacheService.users.removeAll();
+
+ // Pass on the connection identifier
+ return connectionId.identifier;
+ });
+
+ };
+
+ return service;
+}]);
diff --git a/extensions/guacamole-auth-quickconnect/src/main/resources/styles/quickconnect.css b/extensions/guacamole-auth-quickconnect/src/main/resources/styles/quickconnect.css
new file mode 100644
index 0000000..2f11262
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/resources/styles/quickconnect.css
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+
+.quickconnect-container {
+ margin: 0.25em 0;
+ width: 100%;
+ margin-left: 0.50em;
+}
+
+.quickconnect-container .quickconnect-field {
+ background-image: url('images/protocol-icons/guac-text.png');
+ background-repeat: no-repeat;
+ background-size: 1.50em;
+ background-position: 0.25em center;
+ background-color: transparent;
+ padding: 0.25em;
+ padding-left: 2.50em;
+ width: 100%;
+ max-width: none;
+ border: 0;
+ box-sizing: border-box;
+}
+
+.quickconnect-button {
+ clear: both;
+ float: right;
+ margin-right: 0.75em;
+ font-size: 0.75em;
+ padding: 0.25em;
+}
+
+.quickconnect-list-item {
+ vertical-align: middle;
+ align-content: center;
+ display: flex
+}
diff --git a/extensions/guacamole-auth-quickconnect/src/main/resources/templates/quickconnectField.html b/extensions/guacamole-auth-quickconnect/src/main/resources/templates/quickconnectField.html
new file mode 100644
index 0000000..6089965
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/resources/templates/quickconnectField.html
@@ -0,0 +1,11 @@
+<meta name="before" content=".all-connections" />
+<div class="quickconnect-list-item list-item" ng-controller="quickconnectController">
+ <div class="quickconnect-container">
+ <form ng-submit="quickConnect()">
+ <input type=text class="quickconnect-field" placeholder="{{'QUICKCONNECT.FIELD_PLACEHOLDER_URI' |translate}}" ng-model="uri" />
+ </form>
+ </div>
+ <div class="action-buttons">
+ <button class="quickconnect-button" ng-click="quickConnect()">{{'QUICKCONNECT.ACTION_CONNECT' | translate}}</button>
+ </div>
+</div>
diff --git a/extensions/guacamole-auth-quickconnect/src/main/resources/translations/en.json b/extensions/guacamole-auth-quickconnect/src/main/resources/translations/en.json
new file mode 100644
index 0000000..50ffb2d
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/main/resources/translations/en.json
@@ -0,0 +1,18 @@
+{
+
+ "DATA_SOURCE_QUICKCONNECT" : {
+ "NAME" : "QuickConnect"
+ },
+
+ "QUICKCONNECT" : {
+ "ACTION_CONNECT" : "Connect",
+
+ "ERROR_INVALID_URI" : "Invalid URI Specified",
+ "ERROR_NO_HOST" : "No host specified",
+ "ERROR_NO_PROTOCOL" : "No protocol specified",
+ "ERROR_NOT_ABSOLUTE_URI" : "URI is not absolute",
+
+ "FIELD_PLACEHOLDER_URI" : "Enter Connection URI"
+ }
+
+}
diff --git a/extensions/guacamole-auth-quickconnect/src/test/java/org/apache/guacamole/auth/quickconnect/utility/QCParserTest.java b/extensions/guacamole-auth-quickconnect/src/test/java/org/apache/guacamole/auth/quickconnect/utility/QCParserTest.java
new file mode 100644
index 0000000..50ad7d6
--- /dev/null
+++ b/extensions/guacamole-auth-quickconnect/src/test/java/org/apache/guacamole/auth/quickconnect/utility/QCParserTest.java
@@ -0,0 +1,122 @@
+/*
+ * 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.quickconnect.utility;
+
+import java.io.UnsupportedEncodingException;
+import java.util.Map;
+import org.apache.guacamole.GuacamoleException;
+import org.apache.guacamole.protocol.GuacamoleConfiguration;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+/**
+ * Class to test methods in the QCParser utility class.
+ */
+public class QCParserTest {
+
+ /**
+ * Verify that the parseQueryString() method functions as designed.
+ *
+ * @throws UnsupportedEncodingException
+ * If Java lacks UTF-8 support.
+ */
+ @Test
+ public void testParseQueryString() throws UnsupportedEncodingException {
+
+ final String queryString = "param1=value1¶m2=value2=3¶m3=value%3D3¶m4=value%264";
+ Map<String, String> queryMap = QCParser.parseQueryString(queryString);
+
+ assertEquals("value1", queryMap.get("param1"));
+ assertEquals("value2=3", queryMap.get("param2"));
+ assertEquals("value=3", queryMap.get("param3"));
+ assertEquals("value&4", queryMap.get("param4"));
+
+ }
+
+ /**
+ * Verify that the parseUserInfo() method functions as designed.
+ *
+ * @throws UnsupportedEncodingException
+ * If Java lacks UTF-8 support.
+ */
+ @Test
+ public void testParseUserInfo() throws UnsupportedEncodingException {
+
+ Map<String, String> userInfoMap;
+
+ GuacamoleConfiguration config1 = new GuacamoleConfiguration();
+ QCParser.parseUserInfo("guacuser:secretpw", config1);
+ assertEquals("guacuser", config1.getParameter("username"));
+ assertEquals("secretpw", config1.getParameter("password"));
+
+ GuacamoleConfiguration config2 = new GuacamoleConfiguration();
+ QCParser.parseUserInfo("guacuser", config2);
+ assertEquals("guacuser", config2.getParameter("username"));
+ assertNull(config2.getParameter("password"));
+
+ GuacamoleConfiguration config3 = new GuacamoleConfiguration();
+ QCParser.parseUserInfo("guacuser:P%40ssw0rd%21", config3);
+ assertEquals("guacuser", config3.getParameter("username"));
+ assertEquals("P@ssw0rd!", config3.getParameter("password"));
+
+ GuacamoleConfiguration config4 = new GuacamoleConfiguration();
+ QCParser.parseUserInfo("domain%5cguacuser:domain%2fpassword", config4);
+ assertEquals("domain\\guacuser", config4.getParameter("username"));
+ assertEquals("domain/password", config4.getParameter("password"));
+
+ }
+
+ /**
+ * Verify that the getConfiguration() method returns the expected
+ * GuacamoleConfiguration object.
+ *
+ * @throws GuacamoleException
+ * If the configuration cannot be parsed from the given URI.
+ */
+ @Test
+ public void testGetConfiguration() throws GuacamoleException {
+
+ String uri1 = "ssh://guacuser:guacpassword@hostname1.domain.local/?param1=value1¶m2=value2";
+ GuacamoleConfiguration config1 = QCParser.getConfiguration(uri1);
+ assertEquals("ssh", config1.getProtocol());
+ assertEquals("hostname1.domain.local", config1.getParameter("hostname"));
+ assertEquals("guacuser", config1.getParameter("username"));
+ assertEquals("guacpassword", config1.getParameter("password"));
+ assertEquals("value1", config1.getParameter("param1"));
+ assertEquals("value2", config1.getParameter("param2"));
+
+ String uri2 = "rdp://domain%5cguacuser:adPassword123@windows1.domain.tld/?enable-sftp=true";
+ GuacamoleConfiguration config2 = QCParser.getConfiguration(uri2);
+ assertEquals("rdp", config2.getProtocol());
+ assertEquals("windows1.domain.tld", config2.getParameter("hostname"));
+ assertEquals("domain\\guacuser", config2.getParameter("username"));
+ assertEquals("adPassword123", config2.getParameter("password"));
+ assertEquals("true", config2.getParameter("enable-sftp"));
+
+ String uri3 = "vnc://mirror1.example.com:5910/";
+ GuacamoleConfiguration config3 = QCParser.getConfiguration(uri3);
+ assertEquals("vnc", config3.getProtocol());
+ assertEquals("mirror1.example.com", config3.getParameter("hostname"));
+ assertEquals("5910", config3.getParameter("port"));
+
+ }
+
+}
diff --git a/extensions/guacamole-auth-radius/pom.xml b/extensions/guacamole-auth-radius/pom.xml
index d46e0b1..d259158 100644
--- a/extensions/guacamole-auth-radius/pom.xml
+++ b/extensions/guacamole-auth-radius/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-radius</artifactId>
<packaging>jar</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-auth-radius</name>
<url>http://guacamole.apache.org/</url>
@@ -178,7 +178,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-common</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<scope>provided</scope>
</dependency>
@@ -186,7 +186,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-ext</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<scope>provided</scope>
</dependency>
diff --git a/extensions/guacamole-auth-radius/src/main/resources/guac-manifest.json b/extensions/guacamole-auth-radius/src/main/resources/guac-manifest.json
index f85ab1f..55a3a0c 100644
--- a/extensions/guacamole-auth-radius/src/main/resources/guac-manifest.json
+++ b/extensions/guacamole-auth-radius/src/main/resources/guac-manifest.json
@@ -1,6 +1,6 @@
{
- "guacamoleVersion" : "0.9.14",
+ "guacamoleVersion" : "1.0.0",
"name" : "RADIUS Authentication Backend",
"namespace" : "radius",
diff --git a/extensions/guacamole-auth-totp/pom.xml b/extensions/guacamole-auth-totp/pom.xml
index af44455..5f1a069 100644
--- a/extensions/guacamole-auth-totp/pom.xml
+++ b/extensions/guacamole-auth-totp/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-auth-totp</artifactId>
<packaging>jar</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-auth-totp</name>
<url>http://guacamole.incubator.apache.org/</url>
@@ -210,7 +210,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-ext</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<scope>provided</scope>
</dependency>
diff --git a/extensions/guacamole-auth-totp/src/main/resources/guac-manifest.json b/extensions/guacamole-auth-totp/src/main/resources/guac-manifest.json
index dee8291..fd62e14 100644
--- a/extensions/guacamole-auth-totp/src/main/resources/guac-manifest.json
+++ b/extensions/guacamole-auth-totp/src/main/resources/guac-manifest.json
@@ -1,6 +1,6 @@
{
- "guacamoleVersion" : "0.9.14",
+ "guacamoleVersion" : "1.0.0",
"name" : "TOTP TFA Authentication Backend",
"namespace" : "totp",
diff --git a/guacamole-common-js/pom.xml b/guacamole-common-js/pom.xml
index 0eeb588..cf9c45d 100644
--- a/guacamole-common-js/pom.xml
+++ b/guacamole-common-js/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-common-js</artifactId>
<packaging>pom</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-common-js</name>
<url>http://guacamole.apache.org/</url>
diff --git a/guacamole-common-js/src/main/webapp/modules/Status.js b/guacamole-common-js/src/main/webapp/modules/Status.js
index ceadaa6..3acfd63 100644
--- a/guacamole-common-js/src/main/webapp/modules/Status.js
+++ b/guacamole-common-js/src/main/webapp/modules/Status.js
@@ -232,3 +232,87 @@
"CLIENT_TOO_MANY": 0x031D
};
+
+/**
+ * Returns the Guacamole protocol status code which most closely
+ * represents the given HTTP status code.
+ *
+ * @param {Number} status
+ * The HTTP status code to translate into a Guacamole protocol status
+ * code.
+ *
+ * @returns {Number}
+ * The Guacamole protocol status code which most closely represents the
+ * given HTTP status code.
+ */
+Guacamole.Status.Code.fromHTTPCode = function fromHTTPCode(status) {
+
+ // Translate status codes with known equivalents
+ switch (status) {
+
+ // HTTP 400 - Bad request
+ case 400:
+ return Guacamole.Status.Code.CLIENT_BAD_REQUEST;
+
+ // HTTP 403 - Forbidden
+ case 403:
+ return Guacamole.Status.Code.CLIENT_FORBIDDEN;
+
+ // HTTP 404 - Resource not found
+ case 404:
+ return Guacamole.Status.Code.RESOURCE_NOT_FOUND;
+
+ // HTTP 429 - Too many requests
+ case 429:
+ return Guacamole.Status.Code.CLIENT_TOO_MANY;
+
+ // HTTP 503 - Server unavailable
+ case 503:
+ return Guacamole.Status.Code.SERVER_BUSY;
+
+ }
+
+ // Default all other codes to generic internal error
+ return Guacamole.Status.Code.SERVER_ERROR;
+
+};
+
+/**
+ * Returns the Guacamole protocol status code which most closely
+ * represents the given WebSocket status code.
+ *
+ * @param {Number} code
+ * The WebSocket status code to translate into a Guacamole protocol
+ * status code.
+ *
+ * @returns {Number}
+ * The Guacamole protocol status code which most closely represents the
+ * given WebSocket status code.
+ */
+Guacamole.Status.Code.fromWebSocketCode = function fromWebSocketCode(code) {
+
+ // Translate status codes with known equivalents
+ switch (code) {
+
+ // Successful disconnect (no error)
+ case 1000: // Normal Closure
+ return Guacamole.Status.Code.SUCCESS;
+
+ // Codes which indicate the server is not reachable
+ case 1006: // Abnormal Closure (also signalled by JavaScript when the connection cannot be opened in the first place)
+ case 1015: // TLS Handshake
+ return Guacamole.Status.Code.UPSTREAM_NOT_FOUND;
+
+ // Codes which indicate the server is reachable but busy/unavailable
+ case 1001: // Going Away
+ case 1012: // Service Restart
+ case 1013: // Try Again Later
+ case 1014: // Bad Gateway
+ return Guacamole.Status.Code.UPSTREAM_UNAVAILABLE;
+
+ }
+
+ // Default all other codes to generic internal error
+ return Guacamole.Status.Code.SERVER_ERROR;
+
+};
diff --git a/guacamole-common-js/src/main/webapp/modules/Tunnel.js b/guacamole-common-js/src/main/webapp/modules/Tunnel.js
index c8f8502..52bd20a 100644
--- a/guacamole-common-js/src/main/webapp/modules/Tunnel.js
+++ b/guacamole-common-js/src/main/webapp/modules/Tunnel.js
@@ -84,12 +84,23 @@
* The maximum amount of time to wait for data to be received, in
* milliseconds. If data is not received within this amount of time,
* the tunnel is closed with an error. The default value is 15000.
- *
+ *
* @type {Number}
*/
this.receiveTimeout = 15000;
/**
+ * The amount of time to wait for data to be received before considering
+ * the connection to be unstable, in milliseconds. If data is not received
+ * within this amount of time, the tunnel status is updated to warn that
+ * the connection appears unresponsive and may close. The default value is
+ * 1500.
+ *
+ * @type {Number}
+ */
+ this.unstableThreshold = 1500;
+
+ /**
* The UUID uniquely identifying this tunnel. If not yet known, this will
* be null.
*
@@ -165,7 +176,15 @@
*
* @type {Number}
*/
- "CLOSED": 2
+ "CLOSED": 2,
+
+ /**
+ * The connection is open, but communication through the tunnel appears to
+ * be disrupted, and the connection may close as a result.
+ *
+ * @type {Number}
+ */
+ "UNSTABLE" : 3
};
@@ -220,6 +239,14 @@
var receive_timeout = null;
/**
+ * The current connection stability timeout ID, if any.
+ *
+ * @private
+ * @type {Number}
+ */
+ var unstableTimeout = null;
+
+ /**
* Additional headers to be sent in tunnel requests. This dictionary can be
* populated with key/value header pairs to pass information such as authentication
* tokens, etc.
@@ -253,14 +280,24 @@
*/
function reset_timeout() {
- // Get rid of old timeout (if any)
+ // Get rid of old timeouts (if any)
window.clearTimeout(receive_timeout);
+ window.clearTimeout(unstableTimeout);
- // Set new timeout
+ // Clear unstable status
+ if (tunnel.state === Guacamole.Tunnel.State.UNSTABLE)
+ tunnel.setState(Guacamole.Tunnel.State.OPEN);
+
+ // Set new timeout for tracking overall connection timeout
receive_timeout = window.setTimeout(function () {
close_tunnel(new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_TIMEOUT, "Server timeout."));
}, tunnel.receiveTimeout);
+ // Set new timeout for tracking suspected connection instability
+ unstableTimeout = window.setTimeout(function() {
+ tunnel.setState(Guacamole.Tunnel.State.UNSTABLE);
+ }, tunnel.unstableThreshold);
+
}
/**
@@ -274,6 +311,10 @@
*/
function close_tunnel(status) {
+ // Get rid of old timeouts (if any)
+ window.clearTimeout(receive_timeout);
+ window.clearTimeout(unstableTimeout);
+
// Ignore if already closed
if (tunnel.state === Guacamole.Tunnel.State.CLOSED)
return;
@@ -382,10 +423,23 @@
function handleHTTPTunnelError(xmlhttprequest) {
+ // Pull status code directly from headers provided by Guacamole
var code = parseInt(xmlhttprequest.getResponseHeader("Guacamole-Status-Code"));
- var message = xmlhttprequest.getResponseHeader("Guacamole-Error-Message");
+ if (code) {
+ var message = xmlhttprequest.getResponseHeader("Guacamole-Error-Message");
+ close_tunnel(new Guacamole.Status(code, message));
+ }
- close_tunnel(new Guacamole.Status(code, message));
+ // Failing that, derive a Guacamole status code from the HTTP status
+ // code provided by the browser
+ else if (xmlhttprequest.status)
+ close_tunnel(new Guacamole.Status(
+ Guacamole.Status.Code.fromHTTPCode(xmlhttprequest.status),
+ xmlhttprequest.statusText));
+
+ // Otherwise, assume server is unreachable
+ else
+ close_tunnel(new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_NOT_FOUND));
}
@@ -670,6 +724,14 @@
var receive_timeout = null;
/**
+ * The current connection stability timeout ID, if any.
+ *
+ * @private
+ * @type {Number}
+ */
+ var unstableTimeout = null;
+
+ /**
* The WebSocket protocol corresponding to the protocol used for the current
* location.
* @private
@@ -720,14 +782,24 @@
*/
function reset_timeout() {
- // Get rid of old timeout (if any)
+ // Get rid of old timeouts (if any)
window.clearTimeout(receive_timeout);
+ window.clearTimeout(unstableTimeout);
- // Set new timeout
+ // Clear unstable status
+ if (tunnel.state === Guacamole.Tunnel.State.UNSTABLE)
+ tunnel.setState(Guacamole.Tunnel.State.OPEN);
+
+ // Set new timeout for tracking overall connection timeout
receive_timeout = window.setTimeout(function () {
close_tunnel(new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_TIMEOUT, "Server timeout."));
}, tunnel.receiveTimeout);
+ // Set new timeout for tracking suspected connection instability
+ unstableTimeout = window.setTimeout(function() {
+ tunnel.setState(Guacamole.Tunnel.State.UNSTABLE);
+ }, tunnel.unstableThreshold);
+
}
/**
@@ -741,6 +813,10 @@
*/
function close_tunnel(status) {
+ // Get rid of old timeouts (if any)
+ window.clearTimeout(receive_timeout);
+ window.clearTimeout(unstableTimeout);
+
// Ignore if already closed
if (tunnel.state === Guacamole.Tunnel.State.CLOSED)
return;
@@ -808,13 +884,22 @@
};
socket.onclose = function(event) {
- close_tunnel(new Guacamole.Status(parseInt(event.reason), event.reason));
+
+ // Pull status code directly from closure reason provided by Guacamole
+ if (event.reason)
+ close_tunnel(new Guacamole.Status(parseInt(event.reason), event.reason));
+
+ // Failing that, derive a Guacamole status code from the WebSocket
+ // status code provided by the browser
+ else if (event.code)
+ close_tunnel(new Guacamole.Status(Guacamole.Status.Code.fromWebSocketCode(event.code)));
+
+ // Otherwise, assume server is unreachable
+ else
+ close_tunnel(new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_NOT_FOUND));
+
};
- socket.onerror = function(event) {
- close_tunnel(new Guacamole.Status(Guacamole.Status.Code.SERVER_ERROR, event.data));
- };
-
socket.onmessage = function(event) {
reset_timeout();
@@ -1141,51 +1226,6 @@
}
}
- /**
- * Returns the Guacamole protocol status code which most closely
- * represents the given HTTP status code.
- *
- * @private
- * @param {Number} httpStatus
- * The HTTP status code to translate into a Guacamole protocol status
- * code.
- *
- * @returns {Number}
- * The Guacamole protocol status code which most closely represents the
- * given HTTP status code.
- */
- var getGuacamoleStatusCode = function getGuacamoleStatusCode(httpStatus) {
-
- // Translate status codes with known equivalents
- switch (httpStatus) {
-
- // HTTP 400 - Bad request
- case 400:
- return Guacamole.Status.Code.CLIENT_BAD_REQUEST;
-
- // HTTP 403 - Forbidden
- case 403:
- return Guacamole.Status.Code.CLIENT_FORBIDDEN;
-
- // HTTP 404 - Resource not found
- case 404:
- return Guacamole.Status.Code.RESOURCE_NOT_FOUND;
-
- // HTTP 429 - Too many requests
- case 429:
- return Guacamole.Status.Code.CLIENT_TOO_MANY;
-
- // HTTP 503 - Server unavailable
- case 503:
- return Guacamole.Status.Code.SERVER_BUSY;
-
- }
-
- // Default all other codes to generic internal error
- return Guacamole.Status.Code.SERVER_ERROR;
-
- };
-
this.sendMessage = function sendMessage(elements) {
// Do nothing
};
@@ -1248,7 +1288,8 @@
// Fail if file could not be downloaded via HTTP
if (tunnel.onerror)
- tunnel.onerror(new Guacamole.Status(getGuacamoleStatusCode(xhr.status), xhr.statusText));
+ tunnel.onerror(new Guacamole.Status(
+ Guacamole.Status.Code.fromHTTPCode(xhr.status), xhr.statusText));
tunnel.disconnect();
};
diff --git a/guacamole-common-js/src/main/webapp/modules/Version.js b/guacamole-common-js/src/main/webapp/modules/Version.js
index 2ec8c20..737d8d2 100644
--- a/guacamole-common-js/src/main/webapp/modules/Version.js
+++ b/guacamole-common-js/src/main/webapp/modules/Version.js
@@ -27,4 +27,4 @@
*
* @type {String}
*/
-Guacamole.API_VERSION = "0.9.14";
+Guacamole.API_VERSION = "1.0.0";
diff --git a/guacamole-common/pom.xml b/guacamole-common/pom.xml
index beb5c9e..1296f28 100644
--- a/guacamole-common/pom.xml
+++ b/guacamole-common/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-common</artifactId>
<packaging>jar</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-common</name>
<url>http://guacamole.apache.org/</url>
diff --git a/guacamole-ext/pom.xml b/guacamole-ext/pom.xml
index 339abf8..dc561f5 100644
--- a/guacamole-ext/pom.xml
+++ b/guacamole-ext/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-ext</artifactId>
<packaging>jar</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-ext</name>
<url>http://guacamole.apache.org/</url>
@@ -148,7 +148,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-common</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<scope>compile</scope>
</dependency>
diff --git a/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/ssh.json b/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/ssh.json
index ed728cf..45486c8 100644
--- a/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/ssh.json
+++ b/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/ssh.json
@@ -82,6 +82,11 @@
"name" : "backspace",
"type" : "ENUM",
"options" : [ "", "127", "8" ]
+ },
+ {
+ "name" : "terminal-type",
+ "type" : "ENUM",
+ "options" : [ "", "xterm", "xterm-256color", "vt220", "vt100", "ansi", "linux" ]
}
]
},
diff --git a/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/telnet.json b/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/telnet.json
index 67a3a1f..d893991 100644
--- a/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/telnet.json
+++ b/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/telnet.json
@@ -65,6 +65,11 @@
"name" : "backspace",
"type" : "ENUM",
"options" : [ "", "127", "8" ]
+ },
+ {
+ "name" : "terminal-type",
+ "type" : "ENUM",
+ "options" : [ "", "xterm", "xterm-256color", "vt220", "vt100", "ansi", "linux" ]
}
]
},
diff --git a/guacamole/pom.xml b/guacamole/pom.xml
index 3f880bd..0573c4c 100644
--- a/guacamole/pom.xml
+++ b/guacamole/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole</artifactId>
<packaging>war</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole</name>
<url>http://guacamole.apache.org/</url>
@@ -264,21 +264,21 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-common</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
</dependency>
<!-- Guacamole Extension API -->
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-ext</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
</dependency>
<!-- Guacamole JavaScript API -->
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-common-js</artifactId>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>
diff --git a/guacamole/src/main/java/org/apache/guacamole/extension/ExtensionModule.java b/guacamole/src/main/java/org/apache/guacamole/extension/ExtensionModule.java
index 524ff57..cc39036 100644
--- a/guacamole/src/main/java/org/apache/guacamole/extension/ExtensionModule.java
+++ b/guacamole/src/main/java/org/apache/guacamole/extension/ExtensionModule.java
@@ -60,7 +60,7 @@
private static final List<String> ALLOWED_GUACAMOLE_VERSIONS =
Collections.unmodifiableList(Arrays.asList(
"*",
- "0.9.14"
+ "1.0.0"
));
/**
diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionMapper.java b/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionMapper.java
new file mode 100644
index 0000000..9117947
--- /dev/null
+++ b/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionMapper.java
@@ -0,0 +1,121 @@
+/*
+ * 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.rest;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+import org.apache.guacamole.GuacamoleException;
+import org.apache.guacamole.GuacamoleUnauthorizedException;
+import org.apache.guacamole.rest.auth.AuthenticationService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A class that maps GuacamoleExceptions in a way that returns a
+ * custom response to the user via JSON rather than allowing the default
+ * web application error handling to take place.
+ */
+@Provider
+@Singleton
+public class RESTExceptionMapper implements ExceptionMapper<Throwable> {
+
+ /**
+ * The logger for this class.
+ */
+ private final Logger logger = LoggerFactory.getLogger(RESTExceptionMapper.class);
+
+ /**
+ * The HttpServletRequest for the Throwable being intercepted. Despite this
+ * class being a Singleton, this object will always be scoped with the
+ * current request for the Throwable that is being processed by this class.
+ */
+ @Context
+ private HttpServletRequest request;
+
+ /**
+ * The authentication service associated with the currently active session.
+ */
+ @Inject
+ private AuthenticationService authenticationService;
+
+ /**
+ * Returns the authentication token that is in use in the current session,
+ * if present, or null if otherwise.
+ *
+ * @return
+ * The authentication token for the current session, or null if no
+ * token is present.
+ */
+ private String getAuthenticationToken() {
+
+ String token = request.getParameter("token");
+ if (token != null && !token.isEmpty())
+ return token;
+
+ return null;
+
+ }
+
+ @Override
+ public Response toResponse(Throwable t) {
+
+ // Ensure any associated session is invalidated if unauthorized
+ if (t instanceof GuacamoleUnauthorizedException) {
+ String token = getAuthenticationToken();
+
+ if (authenticationService.destroyGuacamoleSession(token))
+ logger.debug("Implicitly invalidated session for token \"{}\"", token);
+ }
+
+ // Translate GuacamoleException subclasses to HTTP error codes
+ if (t instanceof GuacamoleException)
+ return Response
+ .status(((GuacamoleException) t).getHttpStatusCode())
+ .entity(new APIError((GuacamoleException) t))
+ .type(MediaType.APPLICATION_JSON)
+ .build();
+
+ // Rethrow unchecked exceptions such that they are properly wrapped
+ String message = t.getMessage();
+ if (message != null)
+ logger.error("Unexpected internal error: {}", message);
+ else
+ logger.error("An internal error occurred, but did not contain "
+ + "an error message. Enable debug-level logging for "
+ + "details.");
+
+ logger.debug("Unexpected error in REST endpoint.", t);
+
+ return Response
+ .status(Response.Status.INTERNAL_SERVER_ERROR)
+ .entity(new APIError(
+ new GuacamoleException("Unexpected internal error", t)))
+ .type(MediaType.APPLICATION_JSON)
+ .build();
+
+ }
+
+}
\ No newline at end of file
diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionWrapper.java b/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionWrapper.java
deleted file mode 100644
index a0c756e..0000000
--- a/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionWrapper.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * 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.rest;
-
-import com.google.inject.Inject;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import org.aopalliance.intercept.MethodInterceptor;
-import org.aopalliance.intercept.MethodInvocation;
-import org.apache.guacamole.GuacamoleClientException;
-import org.apache.guacamole.GuacamoleException;
-import org.apache.guacamole.GuacamoleResourceNotFoundException;
-import org.apache.guacamole.GuacamoleSecurityException;
-import org.apache.guacamole.GuacamoleUnauthorizedException;
-import org.apache.guacamole.rest.auth.AuthenticationService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A method interceptor which wraps custom exception handling around methods
- * which can throw GuacamoleExceptions and which are exposed through the REST
- * interface. The various types of GuacamoleExceptions are automatically
- * translated into appropriate HTTP responses, including JSON describing the
- * error that occurred.
- */
-public class RESTExceptionWrapper implements MethodInterceptor {
-
- /**
- * Logger for this class.
- */
- private final Logger logger = LoggerFactory.getLogger(RESTExceptionWrapper.class);
-
- /**
- * Service for authenticating users and managing their Guacamole sessions.
- */
- @Inject
- private AuthenticationService authenticationService;
-
- /**
- * Determines whether the given set of annotations describes an HTTP
- * request parameter of the given name. For a parameter to be associated
- * with an HTTP request parameter, it must be annotated with either the
- * <code>@QueryParam</code> or <code>@FormParam</code> annotations.
- *
- * @param annotations
- * The annotations associated with the Java parameter being checked.
- *
- * @param name
- * The name of the HTTP request parameter.
- *
- * @return
- * true if the given set of annotations describes an HTTP request
- * parameter having the given name, false otherwise.
- */
- private boolean isRequestParameter(Annotation[] annotations, String name) {
-
- // Search annotations for associated HTTP parameters
- for (Annotation annotation : annotations) {
-
- // Check if parameter is associated with the HTTP query string
- if (annotation instanceof QueryParam && name.equals(((QueryParam) annotation).value()))
- return true;
-
- // Failing that, check whether the parameter is associated with the
- // HTTP request body
- if (annotation instanceof FormParam && name.equals(((FormParam) annotation).value()))
- return true;
-
- }
-
- // No parameter annotations are present
- return false;
-
- }
-
- /**
- * Returns the authentication token that was passed in the given method
- * invocation. If the given method invocation is not associated with an
- * HTTP request (it lacks the appropriate JAX-RS annotations) or there is
- * no authentication token, null is returned.
- *
- * @param invocation
- * The method invocation whose corresponding authentication token
- * should be determined.
- *
- * @return
- * The authentication token passed in the given method invocation, or
- * null if there is no such token.
- */
- private String getAuthenticationToken(MethodInvocation invocation) {
-
- Method method = invocation.getMethod();
-
- // Get the types and annotations associated with each parameter
- Annotation[][] parameterAnnotations = method.getParameterAnnotations();
- Class<?>[] parameterTypes = method.getParameterTypes();
-
- // The Java standards require these to be parallel arrays
- assert(parameterAnnotations.length == parameterTypes.length);
-
- // Iterate through all parameters, looking for the authentication token
- for (int i = 0; i < parameterTypes.length; i++) {
-
- // Only inspect String parameters
- Class<?> parameterType = parameterTypes[i];
- if (parameterType != String.class)
- continue;
-
- // Parameter must be declared as a REST service parameter
- Annotation[] annotations = parameterAnnotations[i];
- if (!isRequestParameter(annotations, "token"))
- continue;
-
- // The token parameter has been found - return its value
- Object[] args = invocation.getArguments();
- return (String) args[i];
-
- }
-
- // No token parameter is defined
- return null;
-
- }
-
- @Override
- public Object invoke(MethodInvocation invocation) throws WebApplicationException {
-
- try {
-
- // Invoke wrapped method
- try {
- return invocation.proceed();
- }
-
- // Ensure any associated session is invalidated if unauthorized
- catch (GuacamoleUnauthorizedException e) {
-
- // Pull authentication token from request
- String token = getAuthenticationToken(invocation);
-
- // If there is an associated auth token, invalidate it
- if (authenticationService.destroyGuacamoleSession(token))
- logger.debug("Implicitly invalidated session for token \"{}\".", token);
-
- // Continue with exception processing
- throw e;
-
- }
-
- }
-
- // Translate GuacamoleException subclasses to HTTP error codes
- catch (GuacamoleException e) {
- throw new APIException(
- Response.Status.fromStatusCode(e.getHttpStatusCode()),
- e
- );
- }
-
- // Rethrow unchecked exceptions such that they are properly wrapped
- catch (Throwable t) {
-
- // Log all reasonable details of error
- String message = t.getMessage();
- if (message != null)
- logger.error("Unexpected internal error: {}", message);
- else
- logger.error("An internal error occurred, but did not contain "
- + "an error message. Enable debug-level logging for "
- + "details.");
-
- // Ensure internal errors are fully logged at the debug level
- logger.debug("Unexpected error in REST endpoint.", t);
-
- throw new APIException(Response.Status.INTERNAL_SERVER_ERROR,
- new GuacamoleException("Unexpected internal error.", t));
-
- }
-
- }
-
-}
diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/RESTServiceModule.java b/guacamole/src/main/java/org/apache/guacamole/rest/RESTServiceModule.java
index b326fa5..4efab0f 100644
--- a/guacamole/src/main/java/org/apache/guacamole/rest/RESTServiceModule.java
+++ b/guacamole/src/main/java/org/apache/guacamole/rest/RESTServiceModule.java
@@ -85,9 +85,7 @@
bind(DecorationService.class);
// Automatically translate GuacamoleExceptions for REST methods
- MethodInterceptor interceptor = new RESTExceptionWrapper();
- requestInjection(interceptor);
- bindInterceptor(Matchers.any(), new RESTMethodMatcher(), interceptor);
+ bind(RESTExceptionMapper.class);
// Set up the API endpoints
bind(ExtensionRESTService.class);
diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js
index cf4ba5b..ffbe3c5 100644
--- a/guacamole/src/main/webapp/app/client/controllers/clientController.js
+++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js
@@ -626,6 +626,18 @@
};
+ /**
+ * Returns whether the current connection has been flagged as unstable due
+ * to an apparent network disruption.
+ *
+ * @returns {Boolean}
+ * true if the current connection has been flagged as unstable, false
+ * otherwise.
+ */
+ $scope.isConnectionUnstable = function isConnectionUnstable() {
+ return $scope.client && $scope.client.clientState.connectionState === ManagedClientState.ConnectionState.UNSTABLE;
+ };
+
// Show status dialog when connection status changes
$scope.$watch('client.clientState.connectionState', function clientStateChanged(connectionState) {
@@ -731,10 +743,6 @@
});
- $scope.formattedScale = function formattedScale() {
- return Math.round($scope.client.clientProperties.scale * 100);
- };
-
$scope.zoomIn = function zoomIn() {
$scope.menu.autoFit = false;
$scope.client.clientProperties.autoFit = false;
@@ -745,6 +753,16 @@
$scope.client.clientProperties.autoFit = false;
$scope.client.clientProperties.scale -= 0.1;
};
+
+ /**
+ * When zoom is manually set by entering a value
+ * into the controller, this method turns off autoFit,
+ * both in the menu and the clientProperties.
+ */
+ $scope.zoomSet = function zoomSet() {
+ $scope.menu.autoFit = false;
+ $scope.client.clientProperties.autoFit = false;
+ };
$scope.changeAutoFit = function changeAutoFit() {
if ($scope.menu.autoFit && $scope.client.clientProperties.minScale) {
diff --git a/guacamole/src/main/webapp/app/client/directives/guacZoomCtrl.js b/guacamole/src/main/webapp/app/client/directives/guacZoomCtrl.js
new file mode 100644
index 0000000..3e5b468
--- /dev/null
+++ b/guacamole/src/main/webapp/app/client/directives/guacZoomCtrl.js
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+/**
+ * A directive which converts between human-readable zoom
+ * percentage and display scale.
+ */
+angular.module('client').directive('guacZoomCtrl', function guacZoomCtrl() {
+ return {
+ restrict: 'A',
+ require: 'ngModel',
+ priority: 101,
+ link: function(scope, element, attrs, ngModel) {
+
+ // Evaluate the ngChange attribute when the model
+ // changes.
+ ngModel.$viewChangeListeners.push(function() {
+ scope.$eval(attrs.ngChange);
+ });
+
+ // When pushing to the menu, mutiply by 100.
+ ngModel.$formatters.push(function(value) {
+ return Math.round(value * 100);
+ });
+
+ // When parsing value from menu, divide by 100.
+ ngModel.$parsers.push(function(value) {
+ return Math.round(value) / 100;
+ });
+ }
+ }
+});
diff --git a/guacamole/src/main/webapp/app/client/styles/connection-warning.css b/guacamole/src/main/webapp/app/client/styles/connection-warning.css
new file mode 100644
index 0000000..87af0a8
--- /dev/null
+++ b/guacamole/src/main/webapp/app/client/styles/connection-warning.css
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+#connection-warning {
+
+ position: absolute;
+ right: 0.25em;
+ bottom: 0.25em;
+ z-index: 20;
+
+ width: 3in;
+ max-width: 100%;
+ min-height: 1em;
+
+ border-left: 2em solid #FA0;
+ box-shadow: 1px 1px 2px rgba(0,0,0,0.25);
+ background: #FFE;
+ padding: 0.5em 0.75em;
+ font-size: .8em;
+
+}
+
+#connection-warning::before {
+
+ content: ' ';
+ display: block;
+ position: absolute;
+ left: -2em;
+ top: 0;
+
+ width: 1.25em;
+ height: 100%;
+ margin: 0 0.375em;
+
+ background: url('images/warning.png');
+ background-size: contain;
+ background-position: center;
+ background-repeat: no-repeat;
+
+}
diff --git a/guacamole/src/main/webapp/app/client/styles/menu.css b/guacamole/src/main/webapp/app/client/styles/menu.css
index a7980bf..4021d3c 100644
--- a/guacamole/src/main/webapp/app/client/styles/menu.css
+++ b/guacamole/src/main/webapp/app/client/styles/menu.css
@@ -134,6 +134,27 @@
padding-top: 1em;
}
+.menu-section input.zoom-ctrl {
+ width: 2em;
+ font-size: 1em;
+ padding: 0;
+ background: transparent;
+ border-color: rgba(0, 0, 0, 0.125);
+}
+
+.menu-section div.zoom-ctrl {
+ font-size: 1.5em;
+ display: inline;
+ align-content: center;
+ vertical-align: middle;
+}
+
+.menu-section .zoom-ctrl::-webkit-inner-spin-button,
+.menu-section .zoom-ctrl::-webkit-outer-spin-button {
+ -webkit-appearance: none;
+ margin: 0;
+}
+
.menu,
.menu.closed {
left: -480px;
diff --git a/guacamole/src/main/webapp/app/client/templates/client.html b/guacamole/src/main/webapp/app/client/templates/client.html
index 8468218..ad85f23 100644
--- a/guacamole/src/main/webapp/app/client/templates/client.html
+++ b/guacamole/src/main/webapp/app/client/templates/client.html
@@ -36,6 +36,11 @@
<guac-file-transfer-manager client="client"></guac-file-transfer-manager>
</div>
+ <!-- Connection stability warning -->
+ <div id="connection-warning" ng-show="isConnectionUnstable()">
+ {{'CLIENT.TEXT_CLIENT_STATUS_UNSTABLE' | translate}}
+ </div>
+
<!-- Menu -->
<div class="menu" ng-class="{open: menu.shown}" id="guac-menu">
<div class="menu-content" ng-if="menu.shown">
@@ -151,7 +156,12 @@
<div class="content">
<div id="zoom-settings">
<div ng-click="zoomOut()" id="zoom-out"><img src="images/settings/zoom-out.png" alt="-"/></div>
- <div id="zoom-state">{{formattedScale()}}%</div>
+ <div class="zoom-ctrl">
+ <input type="number" class="zoom-ctrl" guac-zoom-ctrl
+ ng-model="client.clientProperties.scale"
+ ng-model-options="{ updateOn: 'blur submit' }"
+ ng-change="zoomSet()" />%
+ </div>
<div ng-click="zoomIn()" id="zoom-in"><img src="images/settings/zoom-in.png" alt="+"/></div>
</div>
<div><label><input ng-model="menu.autoFit" ng-change="changeAutoFit()" ng-disabled="autoFitDisabled()" type="checkbox" id="auto-fit"/> {{'CLIENT.TEXT_ZOOM_AUTO_FIT' | translate}}</label></div>
diff --git a/guacamole/src/main/webapp/app/client/types/ManagedClient.js b/guacamole/src/main/webapp/app/client/types/ManagedClient.js
index e998445..09c96a9 100644
--- a/guacamole/src/main/webapp/app/client/types/ManagedClient.js
+++ b/guacamole/src/main/webapp/app/client/types/ManagedClient.js
@@ -346,6 +346,18 @@
ManagedClientState.ConnectionState.CONNECTING);
break;
+ // Connection is established
+ case Guacamole.Tunnel.State.OPEN:
+ ManagedClientState.setConnectionState(managedClient.clientState,
+ ManagedClientState.ConnectionState.CONNECTED);
+ break;
+
+ // Connection is established but misbehaving
+ case Guacamole.Tunnel.State.UNSTABLE:
+ ManagedClientState.setConnectionState(managedClient.clientState,
+ ManagedClientState.ConnectionState.UNSTABLE);
+ break;
+
// Connection has closed
case Guacamole.Tunnel.State.CLOSED:
ManagedClientState.setConnectionState(managedClient.clientState,
diff --git a/guacamole/src/main/webapp/app/client/types/ManagedClientState.js b/guacamole/src/main/webapp/app/client/types/ManagedClientState.js
index d77013f..1a26b0d 100644
--- a/guacamole/src/main/webapp/app/client/types/ManagedClientState.js
+++ b/guacamole/src/main/webapp/app/client/types/ManagedClientState.js
@@ -88,12 +88,21 @@
/**
* The Guacamole connection has been successfully established, and
* initial graphical data has been received.
- *
+ *
* @type String
*/
CONNECTED : "CONNECTED",
/**
+ * The Guacamole connection has been successfully established, but the
+ * network connection seems unstable. The connection may perform poorly
+ * or disconnect.
+ *
+ * @type String
+ */
+ UNSTABLE : "UNSTABLE",
+
+ /**
* The Guacamole connection has terminated successfully. No errors are
* indicated.
*
diff --git a/guacamole/src/main/webapp/images/warning.png b/guacamole/src/main/webapp/images/warning.png
new file mode 100644
index 0000000..1933417
--- /dev/null
+++ b/guacamole/src/main/webapp/images/warning.png
Binary files differ
diff --git a/guacamole/src/main/webapp/translations/en.json b/guacamole/src/main/webapp/translations/en.json
index 19c363e..1b0377b 100644
--- a/guacamole/src/main/webapp/translations/en.json
+++ b/guacamole/src/main/webapp/translations/en.json
@@ -137,6 +137,7 @@
"TEXT_CLIENT_STATUS_IDLE" : "Idle.",
"TEXT_CLIENT_STATUS_CONNECTING" : "Connecting to Guacamole...",
"TEXT_CLIENT_STATUS_DISCONNECTED" : "You have been disconnected.",
+ "TEXT_CLIENT_STATUS_UNSTABLE" : "The network connection to the Guacamole server appears unstable.",
"TEXT_CLIENT_STATUS_WAITING" : "Connected to Guacamole. Waiting for response...",
"TEXT_RECONNECT_COUNTDOWN" : "Reconnecting in {REMAINING} {REMAINING, plural, one{second} other{seconds}}...",
"TEXT_FILE_TRANSFER_PROGRESS" : "{PROGRESS} {UNIT, select, b{B} kb{KB} mb{MB} gb{GB} other{}}",
@@ -446,6 +447,7 @@
"FIELD_HEADER_RECORDING_PATH" : "Recording path:",
"FIELD_HEADER_SERVER_ALIVE_INTERVAL" : "Server keepalive interval:",
"FIELD_HEADER_SFTP_ROOT_DIRECTORY" : "File browser root directory:",
+ "FIELD_HEADER_TERMINAL_TYPE" : "Terminal type:",
"FIELD_HEADER_TYPESCRIPT_NAME" : "Typescript name:",
"FIELD_HEADER_TYPESCRIPT_PATH" : "Typescript path:",
@@ -469,6 +471,14 @@
"FIELD_OPTION_FONT_SIZE_96" : "96",
"FIELD_OPTION_FONT_SIZE_EMPTY" : "",
+ "FIELD_OPTION_TERMINAL_TYPE_ANSI" : "ansi",
+ "FIELD_OPTION_TERMINAL_TYPE_EMPTY" : "",
+ "FIELD_OPTION_TERMINAL_TYPE_LINUX" : "linux",
+ "FIELD_OPTION_TERMINAL_TYPE_VT100" : "vt100",
+ "FIELD_OPTION_TERMINAL_TYPE_VT220" : "vt220",
+ "FIELD_OPTION_TERMINAL_TYPE_XTERM" : "xterm",
+ "FIELD_OPTION_TERMINAL_TYPE_XTERM_256COLOR" : "xterm-256color",
+
"NAME" : "SSH",
"SECTION_HEADER_AUTHENTICATION" : "Authentication",
@@ -501,6 +511,7 @@
"FIELD_HEADER_RECORDING_INCLUDE_KEYS" : "Include key events:",
"FIELD_HEADER_RECORDING_NAME" : "Recording name:",
"FIELD_HEADER_RECORDING_PATH" : "Recording path:",
+ "FIELD_HEADER_TERMINAL_TYPE" : "Terminal type:",
"FIELD_HEADER_TYPESCRIPT_NAME" : "Typescript name:",
"FIELD_HEADER_TYPESCRIPT_PATH" : "Typescript path:",
@@ -524,6 +535,14 @@
"FIELD_OPTION_FONT_SIZE_96" : "96",
"FIELD_OPTION_FONT_SIZE_EMPTY" : "",
+ "FIELD_OPTION_TERMINAL_TYPE_ANSI" : "ansi",
+ "FIELD_OPTION_TERMINAL_TYPE_EMPTY" : "",
+ "FIELD_OPTION_TERMINAL_TYPE_LINUX" : "linux",
+ "FIELD_OPTION_TERMINAL_TYPE_VT100" : "vt100",
+ "FIELD_OPTION_TERMINAL_TYPE_VT220" : "vt220",
+ "FIELD_OPTION_TERMINAL_TYPE_XTERM" : "xterm",
+ "FIELD_OPTION_TERMINAL_TYPE_XTERM_256COLOR" : "xterm-256color",
+
"NAME" : "Telnet",
"SECTION_HEADER_AUTHENTICATION" : "Authentication",
diff --git a/pom.xml b/pom.xml
index 4f7c8ed..480eb23 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-client</artifactId>
<packaging>pom</packaging>
- <version>0.9.14</version>
+ <version>1.0.0</version>
<name>guacamole-client</name>
<url>http://guacamole.apache.org/</url>
@@ -55,6 +55,7 @@
<module>extensions/guacamole-auth-jdbc</module>
<module>extensions/guacamole-auth-ldap</module>
<module>extensions/guacamole-auth-openid</module>
+ <module>extensions/guacamole-auth-quickconnect</module>
<module>extensions/guacamole-auth-totp</module>
<!-- Example web applications using the Guacamole APIs -->