Commit ae0f7f5b authored by Marcus's avatar Marcus
Browse files

added functions for short_url and shortened encrypted assertion filename (hash)

parent f1bf014e
......@@ -60,11 +60,14 @@ def handler(req):
<tr> <td> Upload encrypted assertion </td><td id="stat_post"> Wait </td> </tr>
</table>
<br/><p> You can now use this URL as a temporary password:<br/>
<b id="short_url"> Wait </b></p>
<br/><p> You can now use this URL as a temporary password:<br/>
<b id="url"> Wait </b></p>
<p> You can also download the <a id="url2" href="" > Wait for link </a> and save it to /tmp/samlup_uXXXX.encr</p>
<p> You can also download the <a href="/sd/assertion.py">unencrypted assertion</a> and save it to /tmp/samlup_uXXXX</p>
<p> Replace XXXX with the UID on your client system</p>
<p> You can also download the <a href="/sd/assertion.py">unencrypted assertion</a> and save it to /tmp/samlup_uXXXX</p>
<p> Replace XXXX with the UID on your client system</p>
<script src="js-new.js"></script>
<head> </head>
<body> </body>
......@@ -106,8 +109,8 @@ def handler(req):
# decode assertion
encrypted_assertion = unhexlify(b64)
# create hash
assertion_hash = str(hashlib.md5(encrypted_assertion).hexdigest())
# create hash
assertion_hash = str(hashlib.md5(encrypted_assertion).hexdigest())[0:8]
assertion_url ='https://' + req.hostname + '/assertions/' + assertion_hash
# Publish encrypted assertion on the web
......@@ -115,6 +118,7 @@ def handler(req):
# return the url as key=value FIXME
req.write("url=%s" % assertion_url)
req.write("short_url=%s" % 'https://'+assertion_hash)
#req.write("%s" % assertion_url)
#########
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment