Fix api auth

This commit is contained in:
dave 2019-06-24 14:33:11 -07:00
parent bcb60111b2
commit 506c6e9c9a
2 changed files with 3 additions and 0 deletions

View File

@ -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")

View File

@ -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}})