Permalink
Browse files

Added a new feature that saves the full connection URL as a server-si…

…de variable so applications/plugins can access that info without having to send a request to the client (which means they can have that info earlier on in the process of initializing things and opening terminals). It can be accessed from any application or plugin via self.ws.full_url
  • Loading branch information...
liftoff committed Nov 25, 2017
1 parent 6efc0d4 commit 6ae1d01f7fe21e2703bdf982df7353e7bb81a500
Showing with 10 additions and 5 deletions.
  1. +1 −1 gateone/__init__.py
  2. +6 −2 gateone/core/server.py
  3. +3 −2 gateone/static/gateone.js
View
@@ -3,7 +3,7 @@
__version_info__ = (1, 2, 0)
__license__ = "AGPLv3" # ...or proprietary (see LICENSE.txt)
__author__ = 'Dan McDougall <daniel.mcdougall@liftoffsoftware.com>'
-__commit__ = "20171125153159" # Gets replaced by git (holds the date/time)
+__commit__ = "20171125154235" # Gets replaced by git (holds the date/time)
import os
GATEONE_DIR = os.path.dirname(os.path.abspath(__file__))
View
@@ -19,7 +19,7 @@
}
}
__author__ = 'Dan McDougall <daniel.mcdougall@liftoffsoftware.com>'
-__commit__ = "20171125153159" # Gets replaced by git (holds the date/time)
+__commit__ = "20171125154235" # Gets replaced by git (holds the date/time)
# NOTE: Docstring includes reStructuredText markup for use with Sphinx.
__doc__ = '''\
@@ -2083,8 +2083,12 @@ def authenticate(self, settings):
port=port,
url_prefix=parsed.path)
if orig_base_url != self.base_url:
- self.logger.info(_(
+ self.auth_log.info(_(
"Proxy in use: Client URL differs from server."))
+ self.full_url = settings.get('href', None) # In case we need all of it
+ # NOTE: The full URL is only logged via debug() because it could contain
+ # sensitive info.
+ self.auth_log.debug(_("Client URL: {}".format(self.full_url)))
auth_method = self.settings.get('auth', None)
if auth_method and auth_method != 'api':
# Regular, non-API authentication
@@ -82,7 +82,7 @@ The base object for all Gate One modules/plugins.
*/
GateOne.__name__ = "GateOne";
GateOne.__version__ = "1.2";
-GateOne.__commit__ = "20171125153159";
+GateOne.__commit__ = "20171125154235";
GateOne.__repr__ = function () {
return "[" + this.__name__ + " " + this.__version__ + "]";
};
@@ -2697,7 +2697,8 @@ GateOne.Base.update(GateOne.Net, {
'container': go.prefs.goDiv.split('#')[1],
'prefix': prefix,
'location': go.location,
- 'url': go.prefs.url
+ 'url': go.prefs.url, // This is the base URL (e.g. https://somehost/)
+ 'href': window.location.href
};
// Cancel our SSL error timeout since everything is working fine.
clearTimeout(go.Net.sslErrorTimeout);

0 comments on commit 6ae1d01

Please sign in to comment.