From 45575804b73d0c37a46f9cd96e2b7c9452a3a514 Mon Sep 17 00:00:00 2001 From: Aakash Date: Sat, 25 Oct 2025 09:06:47 +0530 Subject: [PATCH] (Feature) #1336 Added toggles on password input textboxes to mask/unmask the entered value. Signed-off-by: Aakash --- CHANGELOG.md | 5 + mcpgateway/static/admin.js | 55 +++++++++-- mcpgateway/templates/admin.html | 94 ++++++++++++++----- ...test_security_performance_compatibility.py | 8 +- 4 files changed, 131 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b17e80b6..d63b38e9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ This release delivers **REST API Passthrough Capabilities**, **API & UI Paginati - **๐Ÿงช Quality & Testing** - Complete build pipeline verification, enhanced linting, mutation testing, and fuzzing - **โšก Performance Optimizations** - Response compression middleware (Brotli, Zstd, GZip) reducing bandwidth by 30-70% + orjson JSON serialization providing 5-6x faster JSON encoding - **๐Ÿฆ€ Rust Plugin Framework** - Optional Rust-accelerated plugins with 5-100x performance improvements +- **๐Ÿ’ป Admin UI** - Quality of life improvements for admins when managing MCP servers ### Added @@ -167,6 +168,10 @@ This release delivers **REST API Passthrough Capabilities**, **API & UI Paginati - **Implementation**: `mcpgateway/utils/orjson_response.py` configured as default FastAPI response class - **Test Coverage**: 29 comprehensive unit tests with 100% code coverage +#### **๐Ÿ’ป Admin UI enhancements** (#1336) +* **Inspectable auth passwords, tokens and headers** (#1336) - Admins can now view and verify passwords, tokens and custom headers they set when creating or editing MCP servers. + + ### Fixed #### **๐Ÿ› Critical Multi-Tenancy & RBAC Bugs** diff --git a/mcpgateway/static/admin.js b/mcpgateway/static/admin.js index 22371c44d..56032b175 100644 --- a/mcpgateway/static/admin.js +++ b/mcpgateway/static/admin.js @@ -10359,6 +10359,35 @@ window.updateAvailableTags = updateAvailableTags; // MULTI-HEADER AUTHENTICATION MANAGEMENT // =================================================================== +/** + * Toggle masking for sensitive text inputs (passwords, tokens, headers) + * @param {HTMLElement|string} inputOrId - Target input element or its ID + * @param {HTMLElement} button - Button triggering the toggle + */ +function toggleInputMask(inputOrId, button) { + const input = + typeof inputOrId === "string" + ? document.getElementById(inputOrId) + : inputOrId; + + if (!input || !button) { + return; + } + + const revealing = input.type === "password"; + input.type = revealing ? "text" : "password"; + + const label = input.getAttribute("data-sensitive-label") || "value"; + button.textContent = revealing ? "Hide" : "Show"; + button.setAttribute("aria-pressed", revealing ? "true" : "false"); + button.setAttribute( + "aria-label", + `${revealing ? "Hide" : "Show"} ${label}`.trim(), + ); +} + +window.toggleInputMask = toggleInputMask; + /** * Global counter for unique header IDs */ @@ -10376,6 +10405,7 @@ function addAuthHeader(containerId) { } const headerId = `auth-header-${++headerCounter}`; + const valueInputId = `${headerId}-value`; const headerRow = document.createElement("div"); headerRow.className = "flex items-center space-x-2"; @@ -10391,12 +10421,25 @@ function addAuthHeader(containerId) { />
- +
+ + +
+ -
- +
+ +
+
-