Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(deploy): allowlist the mcp-connectors read endpoint on the rpc gateway

Diego Zacarias44f516586088
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index b2ce7fe8d..b73f8aa11 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.503",
+ "version": "0.1.504",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.503",
+ "version": "0.1.504",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/image-policy": "file:../packages/image-policy",
diff --git a/control-api/package.json b/control-api/package.json
index c60946ab6..9adeb7ea7 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.503",
+ "version": "0.1.504",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/test/network.gateway.intent.test.ts b/control-api/test/network.gateway.intent.test.ts
index 4538e2369..a7e7abdb8 100644
--- a/control-api/test/network.gateway.intent.test.ts
+++ b/control-api/test/network.gateway.intent.test.ts
@@ -335,6 +335,14 @@ describe('network/gateway intent (manifest-level)', () => {
const configmaps = read(`${BASE}/control-plane/configmaps.yaml`)
const gatewayConf = docContaining(yamlDocs(configmaps), 'name: control-api-rpc-gateway')
expect(gatewayConf).toContain('location ~ ^/api/v1/rpc/access/users/[^/]+/mcp-servers$')
+ // spec 11 U1: the proactive connectors read-model is gated by an rpc access
+ // token (requireRpcTokenUserMatch), not requireInternalService('rpc-proxy'),
+ // so the derived guard below does not cover it — assert its location here or
+ // rpc-proxy's GET /rpc/connectors 403s at the edge (the shipped regression).
+ expect(gatewayConf).toContain('location ~ ^/api/v1/rpc/access/users/[^/]+/mcp-connectors$')
+ expect(gatewayConf).toMatch(
+ /location ~ \^\/api\/v1\/rpc\/access\/users\/\[\^\/\]\+\/mcp-connectors\$ \{[\s\S]*?limit_except GET \{/
+ )
expect(gatewayConf).toContain('location ~ ^/api/v1/rpc/access/users/[^/]+/mcp-hosts/[^/]+$')
expect(gatewayConf).toMatch(
/location ~ \^\/api\/v1\/rpc\/access\/users\/\[\^\/\]\+\/mcp-hosts\/\[\^\/\]\+\$ \{[\s\S]*?limit_except GET POST/
diff --git a/deploy/base/control-plane/configmaps.yaml b/deploy/base/control-plane/configmaps.yaml
index fac2e94df..d1d4e1e46 100644
--- a/deploy/base/control-plane/configmaps.yaml
+++ b/deploy/base/control-plane/configmaps.yaml
@@ -142,6 +142,21 @@ data:
proxy_set_header X-Forwarded-Proto $scheme;
}
+ # spec 11 U1: proactive connectors panel — tri-state read model.
+ # rpc-proxy forwards the caller's rpc access token; control-api
+ # authorizes via requireRpcTokenUserMatch. Must be allowlisted here or
+ # rpc-proxy is 403'd at the edge (sibling of mcp-servers above).
+ location ~ ^/api/v1/rpc/access/users/[^/]+/mcp-connectors$ {
+ limit_except GET {
+ deny all;
+ }
+ proxy_pass http://control_api_upstream;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ }
+
location ~ ^/api/v1/rpc/access/users/[^/]+/mcp-hosts/[^/]+$ {
limit_except GET POST {
deny all;