aminghadersohi opened a new pull request, #37379: URL: https://github.com/apache/superset/pull/37379
## Summary When `workspace_context_middleware` loads user context for resources and prompts, it may fail to set `g.user` (e.g., user not yet synced to Superset DB). Previously, `_setup_user_context` only caught `RuntimeError` for missing Flask context, letting `ValueError` propagate and crash the resource handler with: ``` ValueError: No authenticated user found. Either pass a valid JWT bearer token or configure MCP_DEV_USERNAME for development. ``` This fix catches `ValueError` and returns `None`, allowing metadata resources (chart configs, schema discovery, instance metadata) to proceed without RBAC filtering. The OAuth token is already verified at the HTTP level by the workspace middleware. ## Test plan - [x] Existing MCP tests pass (127 tests) - [ ] Verify resources/prompts work in Claude Desktop with OAuth auth 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
