From e0b06f51d512e37696f1e53374871d4c298bce57 Mon Sep 17 00:00:00 2001 From: Maxime Alves LIRMM Date: Fri, 28 May 2021 22:23:20 +0200 Subject: [PATCH] [acl decorator] when check flag is activated, returns a 200 status code with empty body if no acl has passed check function should always return 200. If we don't do this, we can't see the difference between a "refused" call and a "refused" check --- halfapi/lib/routes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/halfapi/lib/routes.py b/halfapi/lib/routes.py index de3294f..f77919b 100644 --- a/halfapi/lib/routes.py +++ b/halfapi/lib/routes.py @@ -84,6 +84,9 @@ def route_acl_decorator(fct: Callable = None, params: List[Dict] = []): **param }) + if 'check' in req.query_params: + return PlainTextResponse('') + raise HTTPException(401) return caller