Fix MCP gateway ACL check for multi-replica deployments - #8243
Merged
Conversation
The EMQX authz callback is load-balanced across forge replicas, but checkMcpTopic compared the topic's platformId against the answering replica's own randomly-minted id. With more than one replica this denied ff/v1/mcp/... request publishes and response subscriptions whenever the callback landed on a different replica, surfacing as intermittent 504s from /mcp. The platformId is a routing address, not an identity claim - the client is already authenticated as forge_platform - so validate its shape (UUID) instead of its identity.
Steve-Mcl
enabled auto-merge (squash)
August 24, 2026 10:59
cstns
approved these changes
Aug 24, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8243 +/- ##
==========================================
+ Coverage 75.94% 76.09% +0.14%
==========================================
Files 445 445
Lines 23990 23991 +1
Branches 6404 6404
==========================================
+ Hits 18220 18255 +35
+ Misses 5770 5736 -34
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
The EMQX authz callback is load-balanced across forge replicas, but checkMcpTopic compared the topic's platformId against the answering replica's own randomly-minted id. With more than one replica this denied ff/v1/mcp/... request publishes and response subscriptions whenever the callback landed on a different replica, surfacing as intermittent 504s from /mcp.
The platformId is a routing address, not an identity claim - the client is already authenticated as forge_platform - so validate its shape (UUID) instead of its identity.
Related Issue(s)
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionLabels
area:migrationlabel