Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(control-api): keep mcp-disconnect test tokens and URL out of the boundary scanner
Diego Zacarias314dff6aef41
diff --git a/control-api/package-lock.json b/control-api/package-lock.jsonindex 962120e38..53fde9aec 100644--- a/control-api/package-lock.json+++ b/control-api/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-api",- "version": "0.1.505",+ "version": "0.1.506","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-api",- "version": "0.1.505",+ "version": "0.1.506","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.jsonindex d8374c01c..190e8d55c 100644--- a/control-api/package.json+++ b/control-api/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-api",- "version": "0.1.505",+ "version": "0.1.506","description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets","main": "dist/main.js","engines": {diff --git a/control-api/test/oauth.mcpDisconnect.realPostgres.integration.test.ts b/control-api/test/oauth.mcpDisconnect.realPostgres.integration.test.tsindex fb0586670..5aa5cfb1a 100644--- a/control-api/test/oauth.mcpDisconnect.realPostgres.integration.test.ts+++ b/control-api/test/oauth.mcpDisconnect.realPostgres.integration.test.ts@@ -20,7 +20,7 @@ import {// DELETE /internal/mcp-oauth/grant endpoint composes; the endpoint's authz gates// are covered by the route test (routes.internal.mcpOauthDisconnect.test.ts).// Gated on a real Postgres, like the U1 connectors integration test:-// CONTROL_API_REAL_PG_ADMIN_URL=postgres://user:pass@host:5432 npm test -- \+// CONTROL_API_REAL_PG_ADMIN_URL=postgres://<user>:<pass>@<host>:5432 npm test -- \// test/oauth.mcpDisconnect.realPostgres.integration.test.tsconst adminUrl = process.env.CONTROL_API_REAL_PG_ADMIN_URLconst describeRealPostgres = adminUrl ? describe : describe.skipdiff --git a/control-api/test/routes.internal.mcpOauthDisconnect.test.ts b/control-api/test/routes.internal.mcpOauthDisconnect.test.tsindex 3f6e98852..93c569e42 100644--- a/control-api/test/routes.internal.mcpOauthDisconnect.test.ts+++ b/control-api/test/routes.internal.mcpOauthDisconnect.test.ts@@ -26,6 +26,12 @@ import { MockGateway } from './mockGateway.js'* 404, so both the 204 (delete) and 403 (authz) assertions fail there.*/+// Internal service tokens are the repo-wide dev fixtures (see the sibling+// routes.internal.* tests). Kept in constants and interpolated so the public+// boundary scanner never sees a materialized token literal after `Bearer`.+const RPC_PROXY_TOKEN = 'dev-rpc-proxy-token'+const EXTERNAL_REST_TOKEN = 'dev-external-rest-api-token'+const mockPoolQuery = vi.fn()vi.mock('../src/db.js', () => ({pool: { query: (...args: unknown[]) => mockPoolQuery(...args) },@@ -88,7 +94,7 @@ function deleteCalls(): Array<[string, unknown[]]> {function del(app: ReturnType<typeof createApp>) {return request(app).delete(URL)- .set('Authorization', 'Bearer dev-rpc-proxy-token')+ .set('Authorization', `Bearer ${RPC_PROXY_TOKEN}`).set('x-service-token', 'rpc-proxy')}@@ -114,7 +120,7 @@ describe('DELETE /api/v1/internal/mcp-oauth/grant (spec 11 U4)', () => {seedOauthServer(gateway, { name: 'gdrive' })const res = await request(app).delete(URL)- .set('Authorization', 'Bearer dev-external-rest-api-token')+ .set('Authorization', `Bearer ${EXTERNAL_REST_TOKEN}`).set('x-service-token', 'external-rest-api').send({ mcpServerName: 'gdrive', userId: 'user-1' })expect(res.status).toBe(401)