1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Moved all native API endpoints to new auth handling

This commit is contained in:
krateng 2022-04-14 19:36:50 +02:00
parent 62a654bfbf
commit 1a977d9c0c

View File

@ -328,7 +328,7 @@ def post_scrobble(
@api.post("importrules")
@authenticated_api
@authenticated_function(api=True)
def import_rulemodule(**keys):
"""Internal Use Only"""
filename = keys.get("filename")
@ -346,7 +346,7 @@ def import_rulemodule(**keys):
@api.post("rebuild")
@authenticated_api
@authenticated_function(api=True)
def rebuild(**keys):
"""Internal Use Only"""
log("Database rebuild initiated!")
@ -401,7 +401,7 @@ def search(**keys):
@api.post("addpicture")
@authenticated_api
@authenticated_function(api=True)
def add_picture(b64,artist:Multi=[],title=None):
"""Internal Use Only"""
keys = FormsDict()
@ -414,7 +414,7 @@ def add_picture(b64,artist:Multi=[],title=None):
@api.post("newrule")
@authenticated_api
@authenticated_function(api=True)
def newrule(**keys):
"""Internal Use Only"""
pass
@ -424,26 +424,26 @@ def newrule(**keys):
@api.post("settings")
@authenticated_api
@authenticated_function(api=True)
def set_settings(**keys):
"""Internal Use Only"""
malojaconfig.update(keys)
@api.post("apikeys")
@authenticated_api
@authenticated_function(api=True)
def set_apikeys(**keys):
"""Internal Use Only"""
apikeystore.update(keys)
@api.post("import")
@authenticated_api
@authenticated_function(api=True)
def import_scrobbles(identifier):
"""Internal Use Only"""
from ..thirdparty import import_scrobbles
import_scrobbles(identifier)
@api.get("backup")
@authenticated_api
@authenticated_function(api=True)
def get_backup(**keys):
"""Internal Use Only"""
from ..proccontrol.tasks.backup import backup
@ -455,7 +455,7 @@ def get_backup(**keys):
return static_file(os.path.basename(archivefile),root=tmpfolder)
@api.get("export")
@authenticated_api
@authenticated_function(api=True)
def get_export(**keys):
"""Internal Use Only"""
from ..proccontrol.tasks.export import export
@ -468,7 +468,7 @@ def get_export(**keys):
@api.post("delete_scrobble")
@authenticated_api
@authenticated_function(api=True)
def delete_scrobble(timestamp):
"""Internal Use Only"""
database.remove_scrobble(timestamp)