GitHub user necouchman opened a pull request:
https://github.com/apache/incubator-guacamole-client/pull/194
Working/prompt rest
First, this is a looooooooooong shot. I make no claims about the quality
of this code, other than to say it works. This will likely require significant
cleanup to get it in shape enough to actually merge - if it's worth merging.
If it needs to be thrown out and started from scratch, just let me know...
There was talk on the JIRA issue about how to accomplish this, and one of
the ideas tossed around was throwing an exception at connection time if prompts
were required. There were several reasons I ended up not going this direction,
but at least one of them was because the tunnel connection, when it throws
exceptions, does not throw them in JSON format, it actually generates the
standard Tomcat HTML pages, which would have to be changed. Another reason was
the complexity of dealing with starting the tunnel, dealing with the exception,
and then restarting the tunnel.
I also considered going the route of using a REST endpoint to create the
connection, getting the UUID and prompts, and then passing through the UUID and
prompt values to the tunnel connection. I was able to get this to work;
however, it seemed overly-complex.
So, after a few months of working on this off-and-on, this really seems
like the simplest solution - grab the list of prompts ahead of time, evaluate
whether anything is required, present the prompts, then pass everything through
to the tunnel connection.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/necouchman/incubator-guacamole-client
working/prompt-rest
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-guacamole-client/pull/194.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #194
----
commit 45f1200bbf6017964cc220ecd29c44fc23f2cf73
Author: Nick Couchman <[email protected]>
Date: 2017-08-29T20:03:32Z
GUACAMOLE-221: Start on code to filter out prompts.
commit 4f7569e45f5546137f3e809b2206fe9098137cf2
Author: Nick Couchman <[email protected]>
Date: 2017-08-29T20:06:29Z
GUACAMOLE-221: Add AngularJS method for retrieving connection prompts.
commit 39e8359b2610227bff94fbaaf1b890872b8efbe3
Author: Nick Couchman <[email protected]>
Date: 2017-08-29T21:20:51Z
GUACAMOLE-221: Initial commit of prompt objects.
commit 4acee1d0c1b917bc9c7df0e7f879d66d70ec97f6
Author: Nick Couchman <[email protected]>
Date: 2017-08-30T20:25:39Z
GUACAMOLE-221: Add JS prompt code to Index, keep working on prompt type.
commit a9f5ce08f9c8a4ceec1d2f7972019cb82aea7764
Author: Nick Couchman <[email protected]>
Date: 2017-09-01T01:35:56Z
GUACAMOLE-221: Add parameters object to GuacamoleClientInformation.
commit dc47011728be7053b37983de0da5e0fc604762df
Author: Nick Couchman <[email protected]>
Date: 2017-09-01T18:26:53Z
GUACAMOLE-221: Retrieve parameters from the tunnel connection and filter
the connection parameters with the received data.
commit 37a38f79e2a80ca62390c1d43be88dbdfcaabcae
Author: Nick Couchman <[email protected]>
Date: 2017-09-04T13:32:33Z
GUACAMOLE-221: Several changes to pass through parameters and get the
prompts working.
commit 9d955178945cbb54f00c4c21a66196db4f6f4668
Author: Nick Couchman <[email protected]>
Date: 2017-09-06T02:14:13Z
GUACAMOLE-221: New data structure for sending prompts over REST.
commit b4bfebd7499a6289a465f29b11c75055573dd89b
Author: Nick Couchman <[email protected]>
Date: 2017-09-15T15:10:47Z
GUACAMOLE-221: Final tweaks to get prompting working.
commit f62038c0da5711911d9176abe6f855e32e5d707a
Author: Nick Couchman <[email protected]>
Date: 2017-10-05T01:53:44Z
GUACAMOLE-221: Style and code efficiency cleanup.
----
---