This is an automated email from the ASF dual-hosted git repository.

aminghadersohi pushed a commit to branch work-pr-39604
in repository https://gitbox.apache.org/repos/asf/superset.git

commit ea477720cbe32c4471a28213151456d750905d3a
Author: Amin Ghadersohi <[email protected]>
AuthorDate: Fri May 8 14:57:06 2026 -0400

    refactor(mcp): hoist JWT verifier imports to module top
    
    DetailedJWTVerifier and JWTVerifier have no circular-import or optional-
    dependency reason to be imported inline — fastmcp is already pulled in
    at module top via composite_token_verifier, and authlib is already a
    hard dependency. Moving them up for consistency with the rest of the
    module's imports.
---
 superset/mcp_service/mcp_config.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/superset/mcp_service/mcp_config.py 
b/superset/mcp_service/mcp_config.py
index e70cd2b1ae7..562d329223d 100644
--- a/superset/mcp_service/mcp_config.py
+++ b/superset/mcp_service/mcp_config.py
@@ -20,6 +20,7 @@ import logging
 import secrets
 from typing import Any, Dict, Optional
 
+from fastmcp.server.auth.providers.jwt import JWTVerifier
 from flask import Flask
 
 from superset.mcp_service.composite_token_verifier import 
CompositeTokenVerifier
@@ -27,6 +28,7 @@ from superset.mcp_service.constants import (
     DEFAULT_TOKEN_LIMIT,
     DEFAULT_WARN_THRESHOLD_PCT,
 )
+from superset.mcp_service.jwt_verifier import DetailedJWTVerifier
 
 logger = logging.getLogger(__name__)
 
@@ -383,13 +385,9 @@ def _build_jwt_verifier(
         # DetailedJWTVerifier: detailed server-side logging of JWT
         # validation failures. HTTP responses are always generic per
         # RFC 6750 Section 3.1.
-        from superset.mcp_service.jwt_verifier import DetailedJWTVerifier
-
         return DetailedJWTVerifier(**common_kwargs)
 
     # Default JWTVerifier: minimal logging, generic error responses.
-    from fastmcp.server.auth.providers.jwt import JWTVerifier
-
     return JWTVerifier(**common_kwargs)
 
 

Reply via email to