def entry(path: str, request: Request, current_user: str=Depends(get_current_user), root_tree: pydantic.BaseSettings=Depends(get_root_tree)):
    path_parts = [segment for segment in path.split('/') if segment]
    entry = root_tree.authenticated_as(current_user)
    try:
        for segment in path_parts:
            try:
                with record_timing(request.state.metrics, 'acl'):
                    unauthenticated_entry = entry[segment]
            except (KeyError, TypeError):
                raise NoEntry(path_parts)
            if (not hasattr(unauthenticated_entry, 'structure_family')):
                with record_timing(request.state.metrics, 'acl'):
                    entry = unauthenticated_entry.authenticated_as(current_user)
            else:
                entry = unauthenticated_entry
        return entry
    except NoEntry:
        raise HTTPException(status_code=404, detail=f'No such entry: {path_parts}')
def entry(path: str, request: Request, current_user: str=Depends(get_current_user), root_tree: pydantic.BaseSettings=Depends(get_root_tree)):
    path_parts = [segment for segment in path.split('/') if segment]
    entry = root_tree.authenticated_as(current_user)
    try:
        for segment in path_parts:
            try:
                with record_timing(request.state.metrics, 'acl'):
                    unauthenticated_entry = entry[segment]
            except (KeyError, TypeError):
                raise NoEntry(path_parts)
            if (not hasattr(unauthenticated_entry, 'structure_family')):
                with record_timing(request.state.metrics, 'acl'):
                    entry = unauthenticated_entry.authenticated_as(current_user)
            else:
                entry = unauthenticated_entry
        return entry
    except NoEntry:
        raise HTTPException(status_code=404, detail=f'No such entry: {path_parts}')