diff options
author | olf <olf@subsignal.org> | 2016-01-22 21:58:03 +0100 |
---|---|---|
committer | olf <olf@subsignal.org> | 2016-01-22 21:58:03 +0100 |
commit | 3edd8b1e690514ee0b0f1a48f64a98d546ad2cab (patch) | |
tree | 293880fa25b6d8e7bb2d954473e788d23d1e7b0a | |
parent | ebe5e141a4fd0094e546bd869b45ee538c8b51f0 (diff) |
added digest auth
-rw-r--r-- | run_server.py | 8 |
1 files changed, 8 insertions, 0 deletions
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' } }) |