Skip creds gateway duplication check for one time auth#1449
Merged
kevalmahajan merged 3 commits intomainfrom Nov 17, 2025
Merged
Skip creds gateway duplication check for one time auth#1449kevalmahajan merged 3 commits intomainfrom
kevalmahajan merged 3 commits intomainfrom
Conversation
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
rakdutta
approved these changes
Nov 17, 2025
Collaborator
rakdutta
left a comment
There was a problem hiding this comment.
I tested the following scenarios:
- Same URL, different authentication, one-time auth enabled → Allowed
- Same URL, same authentication, one-time auth enabled → Allowed
- Same URL, same authentication, first attempt with one-time auth enabled, second attempt without one-time auth → Allowed
- Same URL, same authentication, one-time auth disabled for both attempts → Not allowed
All scenarios behaved as expected.
kcostell06
pushed a commit
to kcostell06/mcp-context-forge
that referenced
this pull request
Feb 24, 2026
Skip creds gateway duplication check for one time auth
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.
🐛 Bug-fix PR
📌 Summary
Closes #1448
Duplicate gateway checks used URL and credentials, but with one-time auth the credentials are always None, causing false duplicate errors. When one-time auth is enabled, the logic is updated to skip the duplicate check and enforce only name uniqueness, otherwise the original full duplicate logic was used.
🔁 Reproduction Steps
🐞 Root Cause
The duplicate-gateway validation logic considered a gateway a duplicate when both its URL and stored credentials matched an existing gateway.
However, when one-time authentication is enabled, credentials are not persisted and always evaluate to None.
As a result:
This creates a false-positive duplicate error.
💡 Fix Description
The fix updates the gateway duplicate detection logic to be conditional based on the authentication mode:
When one-time auth is enabled
When one-time auth is NOT enabled:
This ensures:
🧪 Verification
make lintmake testmake coverage📐 MCP Compliance (if relevant)
✅ Checklist
make black isort pre-commit)