From a45c019c7c7e9bf2736e43d83131ddedfcec4709 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Fri, 23 Jan 2026 19:57:28 -0800 Subject: [PATCH] test(security): update function execute tests for checkInternalAuth --- apps/sim/app/api/function/execute/route.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/sim/app/api/function/execute/route.test.ts b/apps/sim/app/api/function/execute/route.test.ts index 59d700154..084197e59 100644 --- a/apps/sim/app/api/function/execute/route.test.ts +++ b/apps/sim/app/api/function/execute/route.test.ts @@ -85,10 +85,10 @@ vi.mock('@/lib/execution/isolated-vm', () => ({ vi.mock('@sim/logger', () => loggerMock) vi.mock('@/lib/auth/hybrid', () => ({ - checkHybridAuth: vi.fn().mockResolvedValue({ + checkInternalAuth: vi.fn().mockResolvedValue({ success: true, userId: 'user-123', - authType: 'session', + authType: 'internal_jwt', }), })) @@ -119,8 +119,8 @@ describe('Function Execute API Route', () => { describe('Security Tests', () => { it('should reject unauthorized requests', async () => { - const { checkHybridAuth } = await import('@/lib/auth/hybrid') - vi.mocked(checkHybridAuth).mockResolvedValueOnce({ + const { checkInternalAuth } = await import('@/lib/auth/hybrid') + vi.mocked(checkInternalAuth).mockResolvedValueOnce({ success: false, error: 'Unauthorized', })