fix(mcp): fix CI pre-commit failures for RBAC tool visibility

- auth.py: collapse check_tool_permission signature to one line (ruff-format)
- auth.py: extract _log_user_resolution_failure() helper to reduce
  _setup_user_context cyclomatic complexity from 11 to 10 (ruff C901)
- test_middleware.py: shorten docstring to stay within 88-char limit (ruff E501)
This commit is contained in:
Amin Ghadersohi
2026-05-15 00:39:07 +00:00
parent c358463fd1
commit 33dbd233df
2 changed files with 18 additions and 15 deletions

View File

@@ -1215,7 +1215,7 @@ class TestRBACToolVisibilityMiddleware:
@pytest.mark.asyncio
async def test_fails_closed_on_bad_credentials_value_error(self, app) -> None:
"""Returns empty list when auth was attempted but user not found (ValueError)."""
"""Returns empty list when auth was attempted but user not found."""
from superset.mcp_service.middleware import RBACToolVisibilityMiddleware
tools = [self._make_tool("list_charts"), self._make_tool("generate_chart")]