[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
This commit is contained in:
Maxime Alves LIRMM 2021-05-28 22:23:20 +02:00
parent 8ca94ab7ed
commit e0b06f51d5
1 changed files with 3 additions and 0 deletions

View File

@ -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