[BUG][UI]: Remove non-functional "Show" button for auth tokens after security hardening
🐞 Bug Summary
The Admin can no longer see the token
🧩 Affected Component
Select the area of the project impacted:
- [ ]
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
- Go to https://ocp2.cloud.boomerangplatform.net/qa/mcp-gateway/service/gateway/admin/#gateways
- Click Edit on mcp-grid-qa
- Click Shown on Token field
🤔 Results
The token is not decrypted and no longer shown
🤔 Expected Behavior
The UI should decrypt and show the token for the Admin role.
📓 Logs / Error Output
Paste any relevant stack traces or logs here. ⚠️ Do not paste secrets, credentials, or tokens.
🧠 Environment Info
You can retrieve most of this from the /version endpoint.
| Key | Value |
|---|---|
| Version or commit | 1.0.0-BETA-2 0.128.5 |
| Runtime | Python 3.12.12 |
| Platform / OS | Linux 4.18.0-372.64.1.el8_6.x86_64 (x86_64) |
| Container | none |
🧩 Additional Context (optional)
Add any configuration details, flags, or related issues.
Fix submitted in #2980. Root cause was masked() unconditionally nulling the _unmasked fields, the admin endpoint now opts in to preserving them.
Thanks @IuliaGaitan. This is expected behaviour — PR #2664 intentionally set all _unmasked credential fields to None in GatewayRead.masked() (schemas.py:3395-3398) with the comment # SECURITY: Never expose unmasked credentials in API responses.
The bug here is that the UI still has a "Show" toggle button (admin.html:5435-5443 and the edit form at line 9923) that calls toggleInputMask() but the unmasked value is always null now. The fix is to remove or hide the "Show/Hide" toggle buttons for credential fields since the server no longer returns decrypted values.