IE: Move IPython-specific password hashing out of framework into plugin.

See dicussion here - https://github.com/erasche/galaxy/commit/23459f318507255a2bb1d1fb647e1581bd2090e1.
This commit is contained in:
John Chilton
2015-05-14 10:15:49 -04:00
parent 624d540c04
commit 998d0e8a8c
2 changed files with 13 additions and 12 deletions
@@ -3,6 +3,7 @@
<%
import os
import shutil
import hashlib
# Sets ID and sets up a lot of other variables
ie_request.load_deploy_config()
@@ -10,6 +11,13 @@ ie_request.attr.docker_port = 6789
# Create tempdir in galaxy
temp_dir = ie_request.temp_dir
if ie_request.attr.PASSWORD_AUTH:
m = hashlib.sha1()
m.update( ie_request.notebook_pw + ie_request.notebook_pw_salt )
PASSWORD = 'sha1:%s:%s' % (ie_request.notebook_pw_salt, m.hexdigest())
else:
PASSWORD = "none"
## IPython Specific
# Prepare an empty notebook
notebook_id = ie_request.generate_hex(64)
@@ -32,7 +40,9 @@ notebook_login_url = ie_request.url_template('${PROXY_URL}/ipython/${PORT}/login
# Add all environment variables collected from Galaxy's IE infrastructure
ie_request.launch()
ie_request.launch(env_override={
'notebook_password': PASSWORD,
})
%>
<html>