Github user necouchman commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/194#discussion_r178052016
--- Diff:
guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleConnection.java
---
@@ -98,6 +99,10 @@ public void setAttributes(Map<String, String>
attributes) {
public GuacamoleTunnel connect(GuacamoleClientInformation info)
throws GuacamoleException {
+ // Filter in connection-time information
+ TokenFilter tokenFilter = new TokenFilter();
+
tokenFilter.filterPrompts(config.getParameters(),info.getParameters());
--- End diff --
I thought about that, and one of my earlier implementation attempts
actually did function this way. The reason I opted for this sort of inline
processing method was to be consistent with the way other tokens are processed,
which is done at connection time rather than being done ahead of time. I think
this is probably mostly due to the fact that the GUAC_DATE and GUAC_TIME tokens
are expected to be processed in real-time so that their values are current.
That said, the prompts don't necessarily have to work the same as the other
tokens if there's a compelling reason to do something else. I went back and
forth on this a lot, and eventually ended up at this point.
I think for this particular issue you raise I'll just make a copy of the
config object and filter that one for prompts, and it can get discarded after
the connection is finished.
---