From f0d5eb7d92ce9b56bc90f0b708abd28e3a6c2880 Mon Sep 17 00:00:00 2001 From: "Maxime Alves LIRMM@home" Date: Wed, 8 Jul 2020 17:40:40 +0200 Subject: [PATCH] post-rebase fixes --- halfapi/app.py | 7 ++++--- halfapi/lib/acl_caller_middleware.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/halfapi/app.py b/halfapi/app.py index 54097dc..3b22528 100644 --- a/halfapi/app.py +++ b/halfapi/app.py @@ -9,6 +9,7 @@ from starlette.applications import Starlette from starlette.middleware import Middleware from starlette.requests import Request from starlette.responses import Response, JSONResponse +from starlette.routing import Route from starlette.types import ASGIApp from starlette.middleware.authentication import AuthenticationMiddleware @@ -102,9 +103,9 @@ def check_conf(): DEBUG = True debug_routes = [ - AppRoute('/', lambda request: PlainTextResponse('It Works!')), - AppRoute('/user', lambda request: JSONResponse({'user':request.user})), - AppRoute('/payload', lambda request: JSONResponse({'payload':request.payload})) + Route('/', lambda request: PlainTextResponse('It Works!')), + Route('/user', lambda request: JSONResponse({'user':request.user})), + Route('/payload', lambda request: JSONResponse({'payload':request.payload})) ] if DEBUG is True else [] app = Starlette( diff --git a/halfapi/lib/acl_caller_middleware.py b/halfapi/lib/acl_caller_middleware.py index 3515642..f9c14e5 100644 --- a/halfapi/lib/acl_caller_middleware.py +++ b/halfapi/lib/acl_caller_middleware.py @@ -4,7 +4,7 @@ from starlette.middleware.base import BaseHTTPMiddleware from starlette.routing import Match, Mount from starlette.types import ASGIApp, Receive, Scope, Send -from .models.api.view.acl import Acl as AclView +from halfapi.models.api.view.acl import Acl as AclView def match_route(scope: Scope): """ Checks all routes from "app" and checks if it matches with the one from