Create a view for dumping the DB
This commit is contained in:
parent
1540ff1e2b
commit
4324d14f02
1 changed files with 11 additions and 0 deletions
|
@ -277,6 +277,17 @@ def get_config(request: Request):
|
|||
return Response.new(request.app.config, status=200, ctype="json")
|
||||
|
||||
|
||||
@register_route("GET", "/admin/db")
|
||||
def get_db(request: Request):
|
||||
if not (auth := request.headers.get("Authorization")):
|
||||
return Response.new_error(403, "access denied", "json")
|
||||
|
||||
if not auth == f"Bearer {request.app.config.admin_token}":
|
||||
return Response.new_error(403, "access denied", "json")
|
||||
|
||||
return Response.new(request.app.database, status=200, ctype="json")
|
||||
|
||||
|
||||
@register_route("GET", "/admin/pending")
|
||||
def get_pending(request):
|
||||
if not (auth := request.headers.get("Authorization")):
|
||||
|
|
Loading…
Reference in a new issue