yves-renier commented on code in PR #45984:
URL: https://github.com/apache/superset/pull/45984#discussion_r4479831740
##########
superset/mcp_service/auth.py:
##########
@@ -185,11 +185,16 @@ def _get_token_scopes() -> set[str] | None:
if access_token is None:
return None
- scopes = getattr(access_token, "scopes", None)
- if not scopes:
+ scopes_from_token = getattr(access_token, "scopes", None)
+ if not scopes_from_token:
# Token present but no scopes advertised: do NOT enforce scope checks.
return None
- return {str(s) for s in scopes}
+ ignored_scopes = current_app.config.get("MCP_IGNORED_SCOPES", {})
+ scopes = {str(s) for s in scopes_from_token if str(s) not in
ignored_scopes}
+ if not scopes:
+ # Token where all scopes advertised are ignored: do NOT enforce scope
checks.
+ return None
Review Comment:
You are totally right, I just removed the line mentioned
--
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]