Skip to content

Commit

Permalink
Added a new feature that saves the full connection URL as a server-si…
Browse files Browse the repository at this point in the history
…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 6ae1d01
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gateone/__init__.py
Expand Up @@ -3,7 +3,7 @@
__version_info__ = (1, 2, 0) __version_info__ = (1, 2, 0)
__license__ = "AGPLv3" # ...or proprietary (see LICENSE.txt) __license__ = "AGPLv3" # ...or proprietary (see LICENSE.txt)
__author__ = 'Dan McDougall <daniel.mcdougall@liftoffsoftware.com>' __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 import os
GATEONE_DIR = os.path.dirname(os.path.abspath(__file__)) GATEONE_DIR = os.path.dirname(os.path.abspath(__file__))
Expand Down
8 changes: 6 additions & 2 deletions gateone/core/server.py
Expand Up @@ -19,7 +19,7 @@
} }
} }
__author__ = 'Dan McDougall <daniel.mcdougall@liftoffsoftware.com>' __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. # NOTE: Docstring includes reStructuredText markup for use with Sphinx.
__doc__ = '''\ __doc__ = '''\
Expand Down Expand Up @@ -2083,8 +2083,12 @@ def authenticate(self, settings):
port=port, port=port,
url_prefix=parsed.path) url_prefix=parsed.path)
if orig_base_url != self.base_url: if orig_base_url != self.base_url:
self.logger.info(_( self.auth_log.info(_(
"Proxy in use: Client URL differs from server.")) "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) auth_method = self.settings.get('auth', None)
if auth_method and auth_method != 'api': if auth_method and auth_method != 'api':
# Regular, non-API authentication # Regular, non-API authentication
Expand Down
5 changes: 3 additions & 2 deletions gateone/static/gateone.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6ae1d01

Please sign in to comment.