Repository navigation
fix(ui): use delegated event handlers for search and password inputs to comply with CSP (#7283) - #7336
Open
chiragjangiir wants to merge 1 commit into
Open
fix(ui): use delegated event handlers for search and password inputs to comply with CSP (#7283)#7336chiragjangiir wants to merge 1 commit into
chiragjangiir wants to merge 1 commit into
Conversation
…to comply with CSP (IBM#7283) Signed-off-by: Chirag Jangir <184008125+chiragjangiir@users.noreply.github.com>
chiragjangiir
requested review from
Lang-Akshay,
brian-hussey,
ja8zyjits and
msureshkumar88
as code owners
October 24, 2026 13:26
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #7283. Supersedes #7292 (which was inadvertently branched from a release tag rather than
main, causing base divergence).In
mcpgateway/admin.py, the search inputs in the Manage Members modal and the password validation fields in the user edit modal previously used inlineoninput="..."handlers. Under the default Content Security Policy (script-src-attr 'none'), modern browsers block inline event handlers, rendering these inputs inert.Solution
oninputhandlers inmcpgateway/admin.pyto use data-driven event delegation (data-action-input="debouncedMemberSearch",data-action-input="debouncedNonMemberSearch", anddata-action-input="validatePassword").mcpgateway/admin_ui/search.jsto accept the delegated input event and retrieveevent.target.valuewhile defaulting delay cleanly.validatePasswordinmcpgateway/admin_ui/teams.jsand exposed it viaAdmininmcpgateway/admin_ui/admin.js.tests/unit/js/search.test.jsandtests/unit/js/teams.test.jsverifying event delegation handling.tests/integration/test_admin_teams_ui.pyverifying no inlineoninput=is emitted and delegated attributes are present.Verification
tests/unit/js/search.test.jsandtests/unit/js/teams.test.jspassed (192 tests passing).main.