Skip to content

Commit 7aa74be

Browse files
HMarzbancursoragent
andcommitted
fix(ci): pin deepmerge-ts and stub hypermultimedia auth
Prisma still ships deepmerge-ts 7.1.5 (GHSA-ggr8-5vv4-36mx). The override lifts it to 8.0.1 so the high audit gate stays closed. The invalid-token upload test called live Auth. No-infra CI has none, so requireUser returned 503. The same supabase stub as documents.test.ts keeps that path at 401. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d9548ae commit 7aa74be

3 files changed

Lines changed: 32 additions & 3 deletions

File tree

apps/hocuspocus.server/tests/integration/hypermultimedia.test.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
1-
import { describe, test, expect, beforeAll, beforeEach } from 'bun:test'
1+
import { describe, test, expect, beforeAll, beforeEach, mock } from 'bun:test'
2+
3+
// Drive requireUser through the real auth module + a stubbed anon client.
4+
// Do NOT mock `lib/auth` itself — that sticky mock.module poisons later suites.
5+
mock.module('../../src/lib/supabase', () => ({
6+
getAnonClient: () => ({
7+
auth: {
8+
getUser: async (token: string) => {
9+
if (token === 'valid-test-token') {
10+
return {
11+
data: {
12+
user: {
13+
id: 'user-123',
14+
email: 'owner@example.com',
15+
is_anonymous: false,
16+
user_metadata: {}
17+
}
18+
},
19+
error: null
20+
}
21+
}
22+
return { data: { user: null }, error: { status: 401, message: 'invalid' } }
23+
}
24+
}
25+
}),
26+
getServiceRoleClient: () => null
27+
}))
28+
229
import { Hono } from 'hono'
330
import hypermultimediaRouter from '../../src/api/routers/hypermultimedia.router'
431
import { TestServer, createMockPrisma, createMockRedis } from '../helpers/test-server'

bun.lock

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"@babel/plugin-transform-modules-systemjs": "^7.29.7",
4040
"undici": "^7.29.0",
4141
"uuid": "^11.1.1",
42-
"nanoid": "^3.3.17"
42+
"nanoid": "^3.3.17",
43+
"deepmerge-ts": "8.0.1"
4344
},
4445
"prettier": "./.prettierrc.json",
4546
"scripts": {

0 commit comments

Comments
 (0)