Skip to content

Fix MCP gateway ACL check for multi-replica deployments - #8243

Merged
Steve-Mcl merged 1 commit into
mainfrom
fix-platform-id-fails
Aug 24, 2026
Merged

Fix MCP gateway ACL check for multi-replica deployments#8243
Steve-Mcl merged 1 commit into
mainfrom
fix-platform-id-fails

Conversation

@Steve-Mcl

Copy link
Copy Markdown
Contributor

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

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

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
Steve-Mcl requested a review from cstns August 24, 2026 10:58
@Steve-Mcl
Steve-Mcl enabled auto-merge (squash) August 24, 2026 10:59
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.09%. Comparing base (d3419bb) to head (6f48495).

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     
Flag Coverage Δ
backend 76.09% <100.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Steve-Mcl
Steve-Mcl merged commit 4651521 into main Aug 24, 2026
29 checks passed
@Steve-Mcl
Steve-Mcl deleted the fix-platform-id-fails branch August 24, 2026 11:20
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