mcp-context-forge icon indicating copy to clipboard operation
mcp-context-forge copied to clipboard

[BUG]: UI/ API - Edit user is not working

Open IuliaGaitan opened this issue 10 months ago • 5 comments

🐞 Bug Summary

Tested on local and OCP2 QA environment. The Update Password option from Ui or API call is not working. An Admin can not update any field on user as name, password or others.


🧩 Affected Component

Select the area of the project impacted:

  • [X] mcpgateway - API
  • [X] mcpgateway - UI (admin panel)
  • [ ] mcpgateway.wrapper - stdio wrapper
  • [ ] Federation or Transports
  • [ ] CLI, Makefiles, or shell scripts
  • [ ] Container setup (Docker/Podman/Compose)
  • [ ] Other (explain below)

🔁 Steps to Reproduce

  1. Go to https://ocp2.cloud.boomerangplatform.net/qa/mcp-gateway/service/gateway/admin/#users or local or use PUT on /auth/email/admin/users/{user_email}
  2. Try to use the Change Password option or on API add a new password
  3. ..Click Update or Execute

🤔 Results

The password is not updated.

Image --- ### 🤔 Expected Behavior

Update user option should update the user password, user full name, if is admin or not. PUT endpoint should also update the password if the token is an Admin one


📓 Logs / Error Output

Paste any relevant stack traces or logs here. ⚠️ Do not paste secrets, credentials, or tokens.


🧠 Environment Info

Key Value
Version or commit v0.128.0
Runtime Python 3.12.3
Platform / OS Linux 6.6.87.2-microsoft-standard-WSL2 (x86_64)
Container none

You can retrieve most of this from the /version endpoint.

🧩 Additional Context (optional)

Related to #2390

IuliaGaitan avatar Jan 28 '26 14:01 IuliaGaitan

Thank you for the report.

Confirmed: The PUT /auth/email/admin/users/{user_email} endpoint uses EmailRegistrationRequest which requires a password field (min 8 chars). This prevents partial updates where you only want to change full_name or is_admin.

Fix: Create a separate EmailUserUpdateRequest schema with all fields optional:

class EmailUserUpdateRequest(BaseModel):
    password: Optional[str] = Field(None, min_length=8)
    full_name: Optional[str] = Field(None, max_length=255)
    is_admin: Optional[bool] = Field(None)

Then update the endpoint to use this schema and only update fields that are provided.

crivetimihai avatar Jan 30 '26 11:01 crivetimihai

Tested on local environment on UI. Validation missing on UI on password update. (TC010 and TC012).

Test Case Number Edit Field Expected Result Actual Result Pass/Fail
TC001 Email Email edit The email cand not be edited ✅ Pass
TC002 Full Name Full name updated successfully Full name updated ✅ Pass
TC003 Full Name Empty full name Error: Full name required ✅ Pass
TC004 Administrator (On Administrator status updated Status updated ✅ Pass
TC005 Administrator (Off) Administrator status updated Error: Invalid input ✅ Pass
TC006 Change Password Password changed successfully Password changed ✅ Pass
TC007 Change Password New password doesn't match confirm password Error: Passwords do not match ✅ Pass
TC008 Full Name, Administrator (On/Off) Full Name and admin status updated Both updated ✅ Pass
TC009 Full Name, Change Password Full name updated, password changed Both updated ✅ Pass
TC010 Change Password Weak password Error: Password too weak ❌ Fail
TC011 Administrator (On/Off) Toggle admin status multiple times Status updated correctly each time ✅ Pass
TC012 Change Password - only 3 character Minim 8 character Error: Password too short ❌ Fail
Summary
Total: 12 Passed: 10 ✅ Failed: 2 ❌

@MohanLaksh could you please check? thank you!

IuliaGaitan avatar Feb 03 '26 14:02 IuliaGaitan

Password Requirements are now shown, but Password Requirements is not validating the New Password and Confirm New Password and Update User is active even though the admin added for example only 3 characters. The validation should work as it does for Create a New User TC012 - ❌ Fail

  1. Edit User
  2. Add 123 tot New Password and Confirm New Password
  3. Check Update User Results - Update User button should be active only if Password Requirements are passed - example on Create New User functionality.
Image

TC010 - Passed ✅ - now Password Requirements is shown.

IuliaGaitan avatar Feb 05 '26 12:02 IuliaGaitan

Tested on local testing environment. The Update user is no longer working. All TC's are failed.

Image

IuliaGaitan avatar Feb 10 '26 08:02 IuliaGaitan

Tested on OCP2 QA environment. The problem is no longer present.

Image Image

IuliaGaitan avatar Feb 11 '26 11:02 IuliaGaitan