You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "aminghadersohi (via GitHub)" <gi...@apache.org> on 2026/05/22 03:38:09 UTC
[PR] feat(mcp): add create_user tool for admin user provisioning [superset]
aminghadersohi opened a new pull request, #40353:
URL: https://github.com/apache/superset/pull/40353
### SUMMARY
Adds a new MCP mutate tool `create_user` that allows admins to provision Superset user accounts through the Model Context Protocol.
**What this adds:**
- New `superset/mcp_service/user/` module with Pydantic schemas and tool implementation
- `CreateUserRequest` schema with fields: `username`, `first_name`, `last_name`, `email`, `password`, `role_ids` (at least one role required)
- `CreateUserResponse` returns only non-sensitive fields: `id`, `username`, `first_name`, `last_name`
- Tool is gated behind `User` write permissions (admin-only)
- Roles are resolved from IDs via FAB's `security_manager.role_model`
- User creation delegated to `security_manager.add_user()`
**Privacy considerations:**
- Response intentionally omits `email`, `password`, and role assignments to avoid exposing user directory data
- Admin-only via `class_permission_name="User"` + `method_permission_name="write"` on the `@tool` decorator
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — backend-only change.
### TESTING INSTRUCTIONS
1. Start the MCP service
2. Authenticate as an admin user
3. Call `create_user` with a unique username, email, name, password, and a valid role ID (discoverable via `get_instance_info`)
4. Verify the user appears in Superset's user management UI
5. Verify the created user can log in with the supplied credentials
To test invalid role IDs:
- Supply a non-existent role ID; tool should return an error describing which IDs were not found
### 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))
- [x] 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] feat(mcp): add create_user and update_user tools [superset]
Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on PR #40353:
URL: https://github.com/apache/superset/pull/40353#issuecomment-4606839115
Closing: this tool group does not meet the agent-native value policy. Low-level admin/infrastructure CRUD belongs in the REST API, not MCP. See SC-107899 for the policy rationale.
--
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] feat(mcp): add create_user tool for admin user provisioning [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #40353:
URL: https://github.com/apache/superset/pull/40353#issuecomment-4514857759
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/40353?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 `51.42857%` with `34 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 55.34%. Comparing base ([`5966bb1`](https://app.codecov.io/gh/apache/superset/commit/5966bb1c1efdbc63888325116304f449548e0f5f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`fbe6418`](https://app.codecov.io/gh/apache/superset/commit/fbe641834ba359f69dce10b8d20d09ca81f3cc51?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/40353?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/user/tool/create\_user.py](https://app.codecov.io/gh/apache/superset/pull/40353?src=pr&el=tree&filepath=superset%2Fmcp_service%2Fuser%2Ftool%2Fcreate_user.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvbWNwX3NlcnZpY2UvdXNlci90b29sL2NyZWF0ZV91c2VyLnB5) | 24.24% | [25 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/40353?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [superset/mcp\_service/user/schemas.py](https://app.codecov.io/gh/apache/superset/pull/40353?src=pr&el=tree&filepath=superset%2Fmcp_service%2Fuser%2Fschemas.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvbWNwX3NlcnZpY2UvdXNlci9zY2hlbWFzLnB5) | 73.52% | [9 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/40353?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
> :exclamation: There is a different number of reports uploaded between BASE (5966bb1) and HEAD (fbe6418). Click for more details.
>
> <details><summary>HEAD has 75 uploads less than BASE</summary>
>
>| Flag | BASE (5966bb1) | HEAD (fbe6418) |
>|------|------|------|
>|python|70|1|
>|presto|7|1|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #40353 +/- ##
==========================================
- Coverage 64.20% 55.34% -8.86%
==========================================
Files 2592 2595 +3
Lines 139004 139074 +70
Branches 32273 32280 +7
==========================================
- Hits 89241 76977 -12264
- Misses 48231 61432 +13201
+ Partials 1532 665 -867
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/40353/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/40353/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [mysql](https://app.codecov.io/gh/apache/superset/pull/40353/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/40353/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/40353/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.98% <51.42%> (+0.01%)` | :arrow_up: |
| [python](https://app.codecov.io/gh/apache/superset/pull/40353/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.98% <51.42%> (-19.48%)` | :arrow_down: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/40353/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit](https://app.codecov.io/gh/apache/superset/pull/40353/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
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 Sentry](https://app.codecov.io/gh/apache/superset/pull/40353?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] feat(mcp): add create_user and update_user tools [superset]
Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on code in PR #40353:
URL: https://github.com/apache/superset/pull/40353#discussion_r3328085586
##########
superset/mcp_service/user/schemas.py:
##########
@@ -0,0 +1,102 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Pydantic schemas for user-related MCP tools."""
+
+from __future__ import annotations
+
+from pydantic import BaseModel, ConfigDict, EmailStr, Field, field_validator
+
+
+class CreateUserRequest(BaseModel):
+ """Request schema for create_user."""
+
+ model_config = ConfigDict(populate_by_name=True)
+
+ username: str = Field(
+ ...,
+ min_length=1,
+ max_length=64,
+ description="Unique username for the new account.",
+ )
+ first_name: str = Field(
+ ...,
+ min_length=1,
+ max_length=64,
+ description="First name of the user.",
+ )
+ last_name: str = Field(
+ ...,
+ min_length=1,
+ max_length=64,
+ description="Last name of the user.",
+ )
+ email: EmailStr = Field(
+ ...,
+ description="Email address for the user account.",
+ )
+ password: str = Field(
+ ...,
+ min_length=1,
+ description="Plain-text password; will be hashed before storage.",
+ )
Review Comment:
The `_sanitize_params` function in `middleware.py` already recurses into nested dicts (`else _sanitize_params(v) if isinstance(v, dict) else v`), so `request.password` is redacted even when the `request` object is a nested dict in the logged params. The `password` key is in `_SENSITIVE_PARAM_KEYS` and will be replaced with `[REDACTED]` at all nesting levels.
--
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] feat(mcp): add create_user and update_user tools [superset]
Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on code in PR #40353:
URL: https://github.com/apache/superset/pull/40353#discussion_r3328085353
##########
superset/mcp_service/user/tool/create_user.py:
##########
@@ -0,0 +1,114 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import logging
+
+from fastmcp import Context
+from superset_core.mcp.decorators import tool, ToolAnnotations
+
+from superset.extensions import event_logger
+from superset.mcp_service.user.schemas import CreateUserRequest, CreateUserResponse
+
+logger = logging.getLogger(__name__)
+
+
+@tool(
+ tags=["mutate"],
+ class_permission_name="User",
+ method_permission_name="write",
+ annotations=ToolAnnotations(
+ title="Create a new user account",
+ readOnlyHint=False,
+ destructiveHint=False,
+ ),
+)
+async def create_user(request: CreateUserRequest, ctx: Context) -> CreateUserResponse:
+ """Create a new Superset user account. Admin access is required.
+
+ Use this tool to provision a new user with a username, name, email,
+ password, and one or more roles. After creation, the user can log in
Review Comment:
Tests have been added in `tests/unit_tests/mcp_service/user/tool/test_user_tools.py` covering all the branches mentioned: missing roles, `add_user` failure, successful creation with sensitive field omission checks, and equivalent tests for `update_user`.
##########
superset/mcp_service/user/schemas.py:
##########
@@ -0,0 +1,102 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Pydantic schemas for user-related MCP tools."""
+
+from __future__ import annotations
+
+from pydantic import BaseModel, ConfigDict, EmailStr, Field, field_validator
+
+
+class CreateUserRequest(BaseModel):
+ """Request schema for create_user."""
+
+ model_config = ConfigDict(populate_by_name=True)
+
+ username: str = Field(
+ ...,
+ min_length=1,
+ max_length=64,
+ description="Unique username for the new account.",
+ )
+ first_name: str = Field(
+ ...,
+ min_length=1,
+ max_length=64,
+ description="First name of the user.",
+ )
+ last_name: str = Field(
+ ...,
+ min_length=1,
+ max_length=64,
+ description="Last name of the user.",
+ )
+ email: EmailStr = Field(
+ ...,
+ description="Email address for the user account.",
+ )
+ password: str = Field(
+ ...,
+ min_length=1,
+ description="Plain-text password; will be hashed before storage.",
+ )
Review Comment:
The `_sanitize_params` function in `middleware.py` already recurses into nested dicts (`else _sanitize_params(v) if isinstance(v, dict) else v`), so `request.password` is redacted even when the `request` object is a nested dict in the logged params. The `password` key is in `_SENSITIVE_PARAM_KEYS` and will be replaced with `[REDACTED]` at all nesting levels.
--
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] feat(mcp): add create_user and update_user tools [superset]
Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi closed pull request #40353: feat(mcp): add create_user and update_user tools
URL: https://github.com/apache/superset/pull/40353
--
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] feat(mcp): add create_user tool for admin user provisioning [superset]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #40353:
URL: https://github.com/apache/superset/pull/40353#discussion_r3285761464
##########
superset/mcp_service/user/tool/create_user.py:
##########
@@ -0,0 +1,114 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import logging
+
+from fastmcp import Context
+from superset_core.mcp.decorators import tool, ToolAnnotations
+
+from superset.extensions import event_logger
+from superset.mcp_service.user.schemas import CreateUserRequest, CreateUserResponse
+
+logger = logging.getLogger(__name__)
+
+
+@tool(
+ tags=["mutate"],
+ class_permission_name="User",
+ method_permission_name="write",
+ annotations=ToolAnnotations(
+ title="Create a new user account",
+ readOnlyHint=False,
+ destructiveHint=False,
+ ),
+)
+async def create_user(request: CreateUserRequest, ctx: Context) -> CreateUserResponse:
+ """Create a new Superset user account. Admin access is required.
+
+ Use this tool to provision a new user with a username, name, email,
+ password, and one or more roles. After creation, the user can log in
+ with the supplied credentials.
+
+ Workflow:
+ 1. Call get_instance_info to discover available role names and IDs
+ 2. Call this tool with the desired credentials and role IDs
+ 3. The returned ``id`` uniquely identifies the new user
+ """
+ await ctx.info(
+ "Creating user: username=%r, email=%r, role_ids=%s"
+ % (request.username, request.email, request.role_ids)
Review Comment:
`ctx.info()` includes the user's email address. MCP context logs are surfaced back to the client/LLM, so this leaks PII even though the response intentionally omits user-directory fields. Consider omitting the email entirely from these messages, or logging only a redacted/hashed form.
##########
superset/mcp_service/user/tool/create_user.py:
##########
@@ -0,0 +1,114 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import logging
+
+from fastmcp import Context
+from superset_core.mcp.decorators import tool, ToolAnnotations
+
+from superset.extensions import event_logger
+from superset.mcp_service.user.schemas import CreateUserRequest, CreateUserResponse
+
+logger = logging.getLogger(__name__)
+
+
+@tool(
+ tags=["mutate"],
+ class_permission_name="User",
+ method_permission_name="write",
+ annotations=ToolAnnotations(
+ title="Create a new user account",
+ readOnlyHint=False,
+ destructiveHint=False,
+ ),
+)
+async def create_user(request: CreateUserRequest, ctx: Context) -> CreateUserResponse:
+ """Create a new Superset user account. Admin access is required.
+
+ Use this tool to provision a new user with a username, name, email,
+ password, and one or more roles. After creation, the user can log in
Review Comment:
This new mutate tool adds multiple important branches (missing roles, `add_user` failure, and the success response omitting sensitive fields) but no unit tests were added alongside the existing MCP tool test suite. Please add tests to cover these behaviors to prevent regressions and accidental exposure of user-directory data.
##########
superset/mcp_service/user/schemas.py:
##########
@@ -0,0 +1,102 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Pydantic schemas for user-related MCP tools."""
+
+from __future__ import annotations
+
+from pydantic import BaseModel, ConfigDict, EmailStr, Field, field_validator
+
+
+class CreateUserRequest(BaseModel):
+ """Request schema for create_user."""
+
+ model_config = ConfigDict(populate_by_name=True)
+
+ username: str = Field(
+ ...,
+ min_length=1,
+ max_length=64,
+ description="Unique username for the new account.",
+ )
+ first_name: str = Field(
+ ...,
+ min_length=1,
+ max_length=64,
+ description="First name of the user.",
+ )
+ last_name: str = Field(
+ ...,
+ min_length=1,
+ max_length=64,
+ description="Last name of the user.",
+ )
+ email: EmailStr = Field(
+ ...,
+ description="Email address for the user account.",
+ )
+ password: str = Field(
+ ...,
+ min_length=1,
+ description="Plain-text password; will be hashed before storage.",
+ )
Review Comment:
This request schema introduces a plaintext `password` field. MCP `LoggingMiddleware` only redacts sensitive keys at the top level of `params`, but tool calls are passed as `{"request": {...}}`, so `request.password` will still be logged in the audit/event payload unless sanitization is made recursive (or explicitly redacts nested `request` fields). Please ensure passwords are never written to logs/action logs.
##########
superset/mcp_service/user/tool/create_user.py:
##########
@@ -0,0 +1,114 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import logging
+
+from fastmcp import Context
+from superset_core.mcp.decorators import tool, ToolAnnotations
+
+from superset.extensions import event_logger
+from superset.mcp_service.user.schemas import CreateUserRequest, CreateUserResponse
+
+logger = logging.getLogger(__name__)
+
+
Review Comment:
`logger = logging.getLogger(__name__)` is defined but never used in this module, which will fail linting (unused variable). Either remove it (and the `logging` import) or use it for server-side logging alongside the `ctx.*()` messages.
--
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] feat(mcp): add create_user tool for admin user provisioning [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #40353:
URL: https://github.com/apache/superset/pull/40353#issuecomment-4514776899
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
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] feat(mcp): add create_user tool for admin user provisioning [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #40353:
URL: https://github.com/apache/superset/pull/40353#issuecomment-4547426812
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 15325fe7b8f009bf72509c04460f655f5e0f7c36 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a15e6e1ed158400083a507e |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-40353--superset-docs-preview.netlify.app](https://deploy-preview-40353--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
|<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#q1YqKMrPLShRslJS0lFKKkrMS84AshNzM_P0c5MLdJOLUhNLUnVLi1OLgPIpqQU5-ZWeKUAVZomGpqlmqYapKYamFiYGBgYWxommBuapSrUA) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-40353--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
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