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