MCPcopy Create free account
hub / github.com/ding113/claude-code-hub / buildKey

Function buildKey

tests/unit/security/auth-validateKey-cache.test.ts:46–71  ·  view source on GitHub ↗
(overrides?: Partial<Key>)

Source from the content-addressed store, hash-verified

44}));
45
46function buildKey(overrides?: Partial<Key>): Key {
47 const now = new Date("2026-02-08T00:00:00.000Z");
48 return {
49 id: 1,
50 userId: 10,
51 name: "k1",
52 key: "sk-user-login",
53 isEnabled: true,
54 expiresAt: undefined,
55 canLoginWebUi: true,
56 limit5hUsd: null,
57 limitDailyUsd: null,
58 dailyResetMode: "fixed",
59 dailyResetTime: "00:00",
60 limitWeeklyUsd: null,
61 limitMonthlyUsd: null,
62 limitTotalUsd: null,
63 limitConcurrentSessions: 0,
64 providerGroup: null,
65 cacheTtlPreference: null,
66 createdAt: now,
67 updatedAt: now,
68 deletedAt: undefined,
69 ...overrides,
70 };
71}
72
73function buildUser(overrides?: Partial<User>): User {
74 const now = new Date("2026-02-08T00:00:00.000Z");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected