yves-renier commented on code in PR #45984:
URL: https://github.com/apache/superset/pull/45984#discussion_r4458613620


##########
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}

Review Comment:
   the ignored scopes are set up by the administrator, so I don't think this is 
a real risk.



-- 
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]

  • [PR] feat(c... yves-renier (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... yves-renier (via GitHub) via notifications
    • Re: [P... codecov[bot] (via GitHub) via notifications
    • Re: [P... gabotorresruiz (via GitHub) via notifications
    • Re: [P... netlify[bot] (via GitHub) via notifications
    • Re: [P... yves-renier (via GitHub) via notifications
    • Re: [P... yves-renier (via GitHub) via notifications

Reply via email to