Skip to content

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

TypeScript

fix(gateway): allow prompt bridge credential tickets

Alfredo Lopezccf579faf62d
diff --git a/control-api/test/network.gateway.intent.test.ts b/control-api/test/network.gateway.intent.test.ts
index e05d84e03..cec6ca3ac 100644
--- a/control-api/test/network.gateway.intent.test.ts
+++ b/control-api/test/network.gateway.intent.test.ts
@@ -72,6 +72,13 @@ function docContaining(docs: string[], substring: string): string {
return hit
}
+function locationBlock(config: string, marker: string): string {
+ const start = config.indexOf(marker)
+ if (start < 0) throw new Error(`No gateway location containing: ${marker}`)
+ const next = config.indexOf('\n location ', start + marker.length)
+ return next < 0 ? config.slice(start) : config.slice(start, next)
+}
+
function escapeRegExp(value: string): string {
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
}
@@ -336,6 +343,19 @@ describe('network/gateway intent (manifest-level)', () => {
)
})
+ it('routes promptBridge JIT credential tickets through the mcp-host gateway', () => {
+ const configmaps = read(`${BASE}/control-plane/configmaps.yaml`)
+ const gatewayConf = docContaining(yamlDocs(configmaps), 'name: nginx-workflow-approval-gateway')
+ const route = locationBlock(
+ gatewayConf,
+ 'location = /api/v1/mcp-host/plugin-workload-sdk/prompt-bridge/credential-ticket'
+ )
+
+ expect(route).toContain('limit_except POST')
+ expect(route).toContain('proxy_pass http://control_api_upstream;')
+ expect(route).toContain('proxy_set_header Authorization $http_authorization;')
+ })
+
it('keeps governed agent-run ingest POST-only through the mcp-host gateway', () => {
const configmaps = read(`${BASE}/control-plane/configmaps.yaml`)
const gatewayConf = docContaining(yamlDocs(configmaps), 'name: nginx-workflow-approval-gateway')
diff --git a/deploy/base/control-plane/configmaps.yaml b/deploy/base/control-plane/configmaps.yaml
index c7bb00f7a..f36344ec1 100644
--- a/deploy/base/control-plane/configmaps.yaml
+++ b/deploy/base/control-plane/configmaps.yaml
@@ -510,6 +510,23 @@ data:
proxy_set_header Authorization $http_authorization;
}
+ # JIT credential tickets are issued immediately before each
+ # provider attempt (including an ordered fallback target). Keep this
+ # route on the same mcp-host JWT gateway as the initial authorization;
+ # otherwise promptBridge authorizes successfully and then fails at
+ # the gateway before the provider or credential broker is reached.
+ location = /api/v1/mcp-host/plugin-workload-sdk/prompt-bridge/credential-ticket {
+ limit_except POST {
+ 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;
+ proxy_set_header Authorization $http_authorization;
+ }
+
location = /api/v1/mcp-host/plugin-workload-sdk/client-notification {
limit_except POST {
deny all;