Skip to content

gateway registration fix#9

Merged
crivetimihai merged 1 commit intomainfrom
fix_register_gateway
May 29, 2025
Merged

gateway registration fix#9
crivetimihai merged 1 commit intomainfrom
fix_register_gateway

Conversation

@kevalmahajan
Copy link
Copy Markdown
Member

When registering a gateway without authentication, a bug prevented the bypass of authentication decoding, leading to a "Connection failed!" error.
Now, if the gateway does not require authentication, both encryption and decryption are bypassed, allowing for successful gateway registration.
Gateways that have authentication continue to function as expected.

In the earlier implementation, the condition 'if encoded_value is None' didn't properly bypass decryption because the default value of encoded_value was {}, not None. This issue has now been resolved.

@kevalmahajan kevalmahajan requested a review from crivetimihai May 29, 2025 14:54
Copy link
Copy Markdown
Member

@crivetimihai crivetimihai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, tested and merged!

@crivetimihai crivetimihai merged commit 74c707f into main May 29, 2025
0 of 3 checks passed
vk-playground pushed a commit to vk-playground/mcp-context-forge that referenced this pull request Sep 14, 2025
gateway registration fix

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
vk-playground pushed a commit to vk-playground/mcp-context-forge that referenced this pull request Sep 14, 2025
vk-playground pushed a commit to vk-playground/mcp-context-forge that referenced this pull request Sep 16, 2025
gateway registration fix
Signed-off-by: Vicky Kuo <vicky.kuo@ibm.com>
yiannis2804 added a commit to yiannis2804/mcp-context-forge that referenced this pull request Feb 19, 2026
Address code review suggestions from @jonpspri (minor items):

1. ✅ Lazy logging format:
   - Changed logger.debug(f'msg: {var}') to logger.debug('msg: %s', var)
   - Avoids f-string evaluation when debug logging is disabled
   - Applied to _log_decision and check_access methods

2. ✅ Documented per-request instantiation:
   - Added NOTE about PolicyEngine(db) created on every request
   - Acceptable for Phase 1 (stateless, simple)
   - Can be optimized in Phase 2+ with caching/pooling

3. ✅ Improved test DB mocking:
   - Changed db_session fixture from next(get_db()) to MagicMock
   - More portable unit tests without real DB dependency
   - Cleaner test isolation

Additional fixes:
- Updated all test Resource() calls to use type= and id= parameters
- Updated all test AccessDecision() calls to use resource_type= and resource_id=
- Maintains consistency after dataclass conversion in Issue IBM#6

All 21 PolicyEngine tests passing.

Related: PR IBM#2682 Phase 1 Code Review Item IBM#9
Signed-off-by: yiannis2804 <yiannis2804@gmail.com>
crivetimihai pushed a commit that referenced this pull request Feb 24, 2026
Address code review suggestions from @jonpspri (minor items):

1. ✅ Lazy logging format:
   - Changed logger.debug(f'msg: {var}') to logger.debug('msg: %s', var)
   - Avoids f-string evaluation when debug logging is disabled
   - Applied to _log_decision and check_access methods

2. ✅ Documented per-request instantiation:
   - Added NOTE about PolicyEngine(db) created on every request
   - Acceptable for Phase 1 (stateless, simple)
   - Can be optimized in Phase 2+ with caching/pooling

3. ✅ Improved test DB mocking:
   - Changed db_session fixture from next(get_db()) to MagicMock
   - More portable unit tests without real DB dependency
   - Cleaner test isolation

Additional fixes:
- Updated all test Resource() calls to use type= and id= parameters
- Updated all test AccessDecision() calls to use resource_type= and resource_id=
- Maintains consistency after dataclass conversion in Issue #6

All 21 PolicyEngine tests passing.

Related: PR #2682 Phase 1 Code Review Item #9
Signed-off-by: yiannis2804 <yiannis2804@gmail.com>
aidbutlr pushed a commit to aidbutlr/mcp-context-forge that referenced this pull request Mar 3, 2026
…ual_server

CYFR-40327 allow all public virtual servers from any team to be queried
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants