You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "villebro (via GitHub)" <gi...@apache.org> on 2026/10/17 02:56:47 UTC
[PR] fix(mcp): default MCP_API_KEY_CREATE_URL to /user_info/ [superset]
villebro opened a new pull request, #45403:
URL: https://github.com/apache/superset/pull/45403
### SUMMARY
The MCP server tells clients to create an API key at `MCP_API_KEY_CREATE_URL`, which defaulted to `/profile/`. That path is a 404 in 7.0; API keys are managed on the user info page, `/user_info/` (`superset/views/user_info.py`). This changes the default in both `superset/mcp_service/mcp_config.py` and the fallback in `superset/mcp_service/auth.py`, so the link in the MCP server's 401 "Invalid or expired API key" response opens the page where keys are created. The existing invalid-API-key test now also asserts the message points at `/user_info/`.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
### TESTING INSTRUCTIONS
Run `pytest tests/unit_tests/mcp_service/test_auth_api_key.py tests/unit_tests/mcp_service/test_mcp_config.py`. To verify manually, call the MCP server with an invalid `sst_` API key and confirm the error links to `/user_info/`, which loads the API key management page.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(mcp): default MCP_API_KEY_CREATE_URL to /user_info/ [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #45403:
URL: https://github.com/apache/superset/pull/45403#issuecomment-6228823810
## CodeAnt PR Risk: Low Risk
- The PR appears safe to merge; it changes the default link shown when an API key is rejected.
- The updated test checks that the error message points to /user_info/.
**Assessed commit:** `b409a0e4c25a`
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(mcp): default MCP_API_KEY_CREATE_URL to /user_info/ [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro merged PR #45403:
URL: https://github.com/apache/superset/pull/45403
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(mcp): default MCP_API_KEY_CREATE_URL to /user_info/ [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #45403:
URL: https://github.com/apache/superset/pull/45403#issuecomment-6228983433
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/45403?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `50.00000%` with `1 line` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 64.92%. Comparing base ([`a5d29a9`](https://app.codecov.io/gh/apache/superset/commit/a5d29a9d27d2951e203ce65174d1af7cb5443d2f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`b409a0e`](https://app.codecov.io/gh/apache/superset/commit/b409a0e4c25ad84d5bc27e745aca4b5b5765bd53?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/45403?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [superset/mcp\_service/auth.py](https://app.codecov.io/gh/apache/superset/pull/45403?src=pr&el=tree&filepath=superset%2Fmcp_service%2Fauth.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvbWNwX3NlcnZpY2UvYXV0aC5weQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/45403?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #45403 +/- ##
==========================================
- Coverage 65.15% 64.92% -0.24%
==========================================
Files 3048 3048
Lines 199619 199619
Branches 46578 46578
==========================================
- Hits 130063 129602 -461
- Misses 66629 67086 +457
- Partials 2927 2931 +4
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/45403/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hive](https://app.codecov.io/gh/apache/superset/pull/45403/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `34.98% <50.00%> (ø)` | |
| [mysql](https://app.codecov.io/gh/apache/superset/pull/45403/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [postgres](https://app.codecov.io/gh/apache/superset/pull/45403/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [presto](https://app.codecov.io/gh/apache/superset/pull/45403/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `36.73% <50.00%> (ø)` | |
| [python](https://app.codecov.io/gh/apache/superset/pull/45403/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `52.82% <50.00%> (-0.41%)` | :arrow_down: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/45403/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `52.70% <50.00%> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/45403?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(mcp): default MCP_API_KEY_CREATE_URL to /user_info/ [superset]
Posted by "gabotorresruiz (via GitHub)" <gi...@apache.org>.
gabotorresruiz commented on code in PR #45403:
URL: https://github.com/apache/superset/pull/45403#discussion_r4318503037
##########
superset/mcp_service/mcp_config.py:
##########
@@ -251,10 +251,10 @@ class MCPAuthConfigError(ValueError):
MCP_API_KEY_ENABLED: bool | None = None
# URL surfaced to users when an API key is rejected, pointing them at the
-# place to create or rotate a key. Defaults to the FAB user profile page;
-# deployments that manage keys elsewhere can override this to point at their
-# own key-management UI without forking the auth code.
-MCP_API_KEY_CREATE_URL = "/profile/"
+# place to create or rotate a key. Defaults to the user info page, where API
+# keys are managed; deployments that manage keys elsewhere can override this to
+# point at their own key-management UI without forking the auth code.
+MCP_API_KEY_CREATE_URL = "/user_info/"
Review Comment:
Not a blocker: I think this constant is inert today. `get_mcp_config()` further down doesn't list `MCP_API_KEY_CREATE_URL` in its `defaults` dict, and that call (`flask_singleton.py:91`) is the only thing that copies this module's values into `app.config`, so the `auth.py` fallback is the only live default. Could `auth.py` import it instead, so the two can't drift?
```python
from superset.mcp_service.mcp_config import (
MCP_API_KEY_CREATE_URL,
...
)
create_url = app.config.get("MCP_API_KEY_CREATE_URL", MCP_API_KEY_CREATE_URL)
```
##########
superset/mcp_service/auth.py:
##########
@@ -766,7 +766,7 @@ def _validate_api_key_fallback(app: Any, api_key_string: str | None) -> User:
user = sm.validate_api_key(api_key_string)
if not user:
- create_url = app.config.get("MCP_API_KEY_CREATE_URL", "/profile/")
+ create_url = app.config.get("MCP_API_KEY_CREATE_URL", "/user_info/")
raise PermissionError(
f"Invalid or expired API key. Create a new key at {create_url}."
Review Comment:
Not a blocker, and possibly out of scope for a default change, but does this string ever reach a client? `GlobalErrorHandlerMiddleware._handle_error` takes the generic `PermissionError` branch and rewrites it to `Permission denied for <tool>: You don't have access to this resource.`, and `_sanitize_error_for_logging` flattens it to `Access denied`, so the URL survives in neither the response nor the log. I drove that path on this branch and the caller only sees the generic text.
This fallback also only runs when `CompositeTokenVerifier` was built without a Flask app; with one, an invalid key is already rejected at the transport layer with a generic 401. Worth a follow-up to raise something the middleware passes through, so the link actually lands?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org