GUACAMOLE-577: Support for configuring the Guacamole Proxy in LDAP Connections
This pull request implements the changes necessary to support the GuacamoleProxyConfiguration in LDAP connections (and any future extensions that make use of the SimpleConnection class. Not entirely sure this is the right/best way to go, but took a stab at it.
Okay, fixed a few things up and made some of the requested changes. Let me know how it looks, now.
I may end up closing this PR and just redoing it - I tried to resolve the conflicts between current master and this PR, and it was feeling a little like the kitty-in-a-bathtub gif...
Ah, yes. That gif captures the feeling of refactoring so perfectly.
Okay, @mike-jumper, I've reworked this on top of the existing master, so I think it's good, now...
I reworked the proxy attributes from LDAP as you suggested, but came across a couple of things:
- I used the
INTEGERsyntax for theguacProxyPortattribute, but it's unclear to me if there are any implications to this - that is, will the Apache Directory API'sAttributegetString()method actually return aStringfor this, or is it going to throw an exception? I think it'll return aString, because this isn't a binary value, but I've no easy way to verify that. - It ended up being easier to go ahead and grab the default proxy configuration in the LDAP
ConnectionServicecode and use that as a base for then trying to pull values from LDAP. I know this is a bit redundant, but it seemed like the cleanest way to me to handle 1) initialization of those variables inConnectionService(vs. assigningnulland then checking to see if anything had been pulled from LDAP), and 2) cleanly handling situations where one value has been specified in LDAP but the others haven't (e.g. user assigns guacProxyHostname in LDAP, but leaves out guacProxyPort and guacProxyEncryption, and then GuacamolepProxyConfiguration is initialized with one real value and two unknown/other values). If there's a better way, don't hesitate to send that along.