diff --git a/halfapi/lib/routes.py b/halfapi/lib/routes.py index 9660949..c65c788 100644 --- a/halfapi/lib/routes.py +++ b/halfapi/lib/routes.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 from functools import wraps +import logging from typing import Callable, List, Dict, Generator from types import ModuleType, FunctionType @@ -9,6 +10,9 @@ from starlette.requests import Request from halfapi.lib.domain import gen_domain_routes, VERBS + +logger = logging.getLogger('uvicorn.asgi') + class DomainNotFoundError(Exception): pass @@ -38,8 +42,12 @@ def route_acl_decorator(fct: Callable, params: List[Dict]): passed = param['acl']()(req, *args, **kwargs) if not passed: + logger.debug( + f'ACL FAIL for current route ({fct} - {param.get("acl")})') continue + logger.debug(f'ACL OK for current route ({fct} - {param.get("acl")})') + return await fct( req, *args, **{