From 506c6e9c9a24c3a6771268c4760108e12dec72cd Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 24 Jun 2019 14:33:11 -0700 Subject: [PATCH] Fix api auth --- photoapp/cli.py | 1 + photoapp/daemon.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/photoapp/cli.py b/photoapp/cli.py index d841102..ab4ccfa 100644 --- a/photoapp/cli.py +++ b/photoapp/cli.py @@ -53,6 +53,7 @@ def get_args(): p_ingest.add_argument("files", nargs="+", help="files to import") p_ingest.add_argument("-c", "--copy-of", help="existing uuid the imported images will be placed under") + # User section p_adduser = sp_action.add_parser("user", help="user manipulation functions") p_useraction = p_adduser.add_subparsers(dest="action_user", help="action to take") diff --git a/photoapp/daemon.py b/photoapp/daemon.py index a1d4453..3401177 100644 --- a/photoapp/daemon.py +++ b/photoapp/daemon.py @@ -473,6 +473,8 @@ def main(): SAEnginePlugin(cherrypy.engine, library.engine).subscribe() api = PhotosApi() cherrypy.tree.mount(api, '/api', {'/': {'tools.trailing_slash.on': False, + 'tools.auth_basic.on': True, + 'tools.auth_basic.realm': 'photolib', 'tools.auth_basic.checkpassword': validate_password, 'tools.db.on': True}})