feat(15-03): update E2E seed and auth tests for OIDC architecture
- E2E seed creates API key instead of user for authentication - Auth service tests cover only API key CRUD (removed user/session tests) - Auth middleware tests validate three-way auth: API key, Bearer token, OIDC session - Auth route tests mock getAuth for OIDC session, test /me and /keys endpoints - Remove all references to createUser, verifyPassword, createSession in auth tests
This commit is contained in:
10
e2e/seed.ts
10
e2e/seed.ts
@@ -202,9 +202,13 @@ export async function seedTestDatabase() {
|
||||
])
|
||||
.run();
|
||||
|
||||
// ── User ──
|
||||
const passwordHash = await Bun.password.hash("password123");
|
||||
db.insert(schema.users).values({ username: "admin", passwordHash }).run();
|
||||
// ── API Key for E2E Authentication ──
|
||||
const rawKey = "e2e-test-api-key-for-gearbox-testing";
|
||||
const keyHash = await Bun.password.hash(rawKey);
|
||||
const keyPrefix = rawKey.slice(0, 8);
|
||||
db.insert(schema.apiKeys)
|
||||
.values({ name: "E2E Test Key", keyHash, keyPrefix })
|
||||
.run();
|
||||
|
||||
// ── Settings ──
|
||||
db.insert(schema.settings)
|
||||
|
||||
Reference in New Issue
Block a user