MCPcopy Create free account
hub / github.com/Hello-Application-XH/HelloGML / getTokenPool

Function getTokenPool

src/index.ts:58–66  ·  view source on GitHub ↗
(kv: KVNamespace)

Source from the content-addressed store, hash-verified

56}
57
58async function getTokenPool(kv: KVNamespace): Promise<{ id: string; token: string }[]> {
59 const list = await kv.list({ prefix: "rt:" });
60 const tokens: { id: string; token: string }[] = [];
61 for (const key of list.keys) {
62 const token = await kv.get(key.name);
63 if (token) tokens.push({ id: key.name.replace("rt:", ""), token });
64 }
65 return tokens;
66}
67
68let tokenRoundRobinIndex = 0;
69

Callers 2

authenticateFunction · 0.85
handleAdminTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected