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

Function buildUser

tests/unit/security/api-key-auth-cache.test.ts:97–123  ·  view source on GitHub ↗
(overrides?: Partial<User>)

Source from the content-addressed store, hash-verified

95}
96
97function buildUser(overrides?: Partial<User>): User {
98 return {
99 id: 10,
100 name: "u1",
101 description: "",
102 role: "user",
103 rpm: null,
104 dailyQuota: null,
105 providerGroup: null,
106 tags: [],
107 createdAt: new Date("2026-01-01T00:00:00.000Z"),
108 updatedAt: new Date("2026-01-02T00:00:00.000Z"),
109 deletedAt: undefined,
110 limit5hUsd: undefined,
111 limitWeeklyUsd: undefined,
112 limitMonthlyUsd: undefined,
113 limitTotalUsd: null,
114 limitConcurrentSessions: undefined,
115 dailyResetMode: "fixed",
116 dailyResetTime: "00:00",
117 isEnabled: true,
118 expiresAt: null,
119 allowedClients: [],
120 allowedModels: [],
121 ...overrides,
122 };
123}
124
125describe("API Key 鉴权缓存:VacuumFilter -> Redis -> DB", () => {
126 test("findActiveKeyByKeyString:Vacuum Filter 误判缺失时,Redis 命中应纠正(避免误拒绝)", async () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected