Antonio-RiveroMartnez commented on code in PR #37972:
URL: https://github.com/apache/superset/pull/37972#discussion_r2854392142
##########
superset/mcp_service/mcp_config.py:
##########
@@ -182,33 +190,36 @@ def create_default_mcp_auth_factory(app: Flask) ->
Optional[Any]:
return None
try:
- from fastmcp.server.auth.providers.jwt import JWTVerifier
+ debug_errors = app.config.get("MCP_JWT_DEBUG_ERRORS", False)
+
+ common_kwargs: dict[str, Any] = {
+ "issuer": app.config.get("MCP_JWT_ISSUER"),
+ "audience": app.config.get("MCP_JWT_AUDIENCE"),
+ "required_scopes": app.config.get("MCP_REQUIRED_SCOPES", []),
+ }
# For HS256 (symmetric), use the secret as the public_key parameter
if app.config.get("MCP_JWT_ALGORITHM") == "HS256" and secret:
- auth_provider = JWTVerifier(
- public_key=secret, # HS256 uses secret as key
- issuer=app.config.get("MCP_JWT_ISSUER"),
- audience=app.config.get("MCP_JWT_AUDIENCE"),
- algorithm="HS256",
- required_scopes=app.config.get("MCP_REQUIRED_SCOPES", []),
- )
- logger.info("Created JWTVerifier with HS256 secret")
+ common_kwargs["public_key"] = secret
Review Comment:
Wait, we should not log nor bubble up the secrets, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]