From 3edd8b1e690514ee0b0f1a48f64a98d546ad2cab Mon Sep 17 00:00:00 2001 From: olf Date: Fri, 22 Jan 2016 21:58:03 +0100 Subject: added digest auth --- run_server.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/run_server.py b/run_server.py index a215320..f62c398 100644 --- a/run_server.py +++ b/run_server.py @@ -13,6 +13,7 @@ import json import time import cherrypy +from cherrypy.lib import auth_digest class SynchronizedJSON(object): def __init__(self, filename): @@ -103,6 +104,9 @@ def test_log(msg, level): print "%s, %s" % (msg, level) if __name__ == '__main__': + + USERS = {'username' : 'password'} + current_dir = os.path.dirname(os.path.abspath(__file__)) cherrypy.engine.subscribe('log', test_log) cherrypy.config.update({ @@ -118,6 +122,10 @@ if __name__ == '__main__': 'tools.staticdir.on': True, 'tools.staticdir.dir': os.path.join(current_dir, 'web'), 'tools.staticdir.index': 'index.html', + 'tools.auth_digest.on': True, + 'tools.auth_digest.realm': 'eventmap', + 'tools.auth_digest.get_ha1': auth_digest.get_ha1_dict_plain(USERS), + 'tools.auth_digest.key': '640f0d950828cc65' } }) -- cgit v1.2.1