(overrides: Partial<Record<string, unknown>> = {})
| 55 | import { authenticateApiKeyFromHeader, updateApiKeyLastUsed } from '@/lib/api-key/service' |
| 56 | |
| 57 | function personalKeyRecord(overrides: Partial<Record<string, unknown>> = {}) { |
| 58 | return { |
| 59 | id: 'key-1', |
| 60 | userId: 'user-1', |
| 61 | workspaceId: null as string | null, |
| 62 | type: 'personal', |
| 63 | expiresAt: null as Date | null, |
| 64 | ...overrides, |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | describe('authenticateApiKeyFromHeader', () => { |
| 69 | beforeEach(() => { |