Skip to content

Commit a45c019

Browse files
committed
test(security): update function execute tests for checkInternalAuth
1 parent f78659e commit a45c019

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/sim/app/api/function/execute/route.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ vi.mock('@/lib/execution/isolated-vm', () => ({
8585
vi.mock('@sim/logger', () => loggerMock)
8686

8787
vi.mock('@/lib/auth/hybrid', () => ({
88-
checkHybridAuth: vi.fn().mockResolvedValue({
88+
checkInternalAuth: vi.fn().mockResolvedValue({
8989
success: true,
9090
userId: 'user-123',
91-
authType: 'session',
91+
authType: 'internal_jwt',
9292
}),
9393
}))
9494

@@ -119,8 +119,8 @@ describe('Function Execute API Route', () => {
119119

120120
describe('Security Tests', () => {
121121
it('should reject unauthorized requests', async () => {
122-
const { checkHybridAuth } = await import('@/lib/auth/hybrid')
123-
vi.mocked(checkHybridAuth).mockResolvedValueOnce({
122+
const { checkInternalAuth } = await import('@/lib/auth/hybrid')
123+
vi.mocked(checkInternalAuth).mockResolvedValueOnce({
124124
success: false,
125125
error: 'Unauthorized',
126126
})

0 commit comments

Comments
 (0)