Describe the bug
Dependencies are duplicated which would cause auth checks to run twice within the API
e.g get_current_tre_user_or_tre_admin in api_app/api/routes/shared_services.py
shared_services_router = APIRouter(dependencies=[Depends(**get_current_tre_user_or_tre_admin**)])
@shared_services_router.get("/shared-services", response_model=SharedServicesInList, name=strings.API_GET_ALL_SHARED_SERVICES, dependencies=[Depends(**get_current_tre_user_or_tre_admin**)])
If you attach the same auth dependency both at the router level (via APIRouter(dependencies=[Depends(auth)])) >and again on the endpoint (either in dependencies=[Depends(auth)] or as a parameter user = Depends(auth)), >FastAPI will execute it twice because each Depends(...) occurrence is evaluated independently; router-level >dependencies are simply added to the route’s dependency list. [fastapi.tiangolo.com]
Azure TRE release version (e.g. v0.14.0 or main):
main