Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
test(channel-reader): guard the reason whitelist against a passthrough regression
Jose Ramirez6fb7b91fb8e4
diff --git a/channel-reader/package-lock.json b/channel-reader/package-lock.jsonindex 53aba63ff..7f2c5050f 100644--- a/channel-reader/package-lock.json+++ b/channel-reader/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-channel-reader",- "version": "0.1.85",+ "version": "0.1.86","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-channel-reader",- "version": "0.1.85",+ "version": "0.1.86","license": "SEE LICENSE IN LICENSE","dependencies": {"@kubernetes/client-node": "^1.0.0",diff --git a/channel-reader/package.json b/channel-reader/package.jsonindex 58adb366f..3338e88fd 100644--- a/channel-reader/package.json+++ b/channel-reader/package.json@@ -1,6 +1,6 @@{"name": "clerum-channel-reader",- "version": "0.1.85",+ "version": "0.1.86","description": "Watches CommunicationChannel CRDs and fetches messages from Telegram, Email, and Slack","main": "dist/main.js","engines": {diff --git a/channel-reader/test/unresolvedSenderNotice.test.ts b/channel-reader/test/unresolvedSenderNotice.test.tsindex a7d11bbb6..b6260e037 100644--- a/channel-reader/test/unresolvedSenderNotice.test.ts+++ b/channel-reader/test/unresolvedSenderNotice.test.ts@@ -59,4 +59,18 @@ describe('authorizeProviderMessage response shape', () => {const client = new RPCClient('http://mcp-host.test')expect(await client.authorizeProviderMessage(identity as never)).toEqual({ authorized: false })})++ it('drops an unrecognized reason value instead of passing it through', async () => {+ vi.stubGlobal(+ 'fetch',+ vi.fn(async () => new Response(JSON.stringify({ authorized: false, reason: 'banana' })))+ )+ const client = new RPCClient('http://mcp-host.test')+ const result = await client.authorizeProviderMessage(identity as never)+ expect(result).toEqual({ authorized: false })+ // toEqual alone would not catch a `reason: undefined` key surviving the+ // whitelist check, since it treats an undefined-valued key as absent.+ // Assert the key itself is gone.+ expect('reason' in result).toBe(false)+ })})