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

Function selectTokenFromPool

src/index.ts:70–75  ·  view source on GitHub ↗
(tokens: { id: string; token: string }[])

Source from the content-addressed store, hash-verified

68let tokenRoundRobinIndex = 0;
69
70function selectTokenFromPool(tokens: { id: string; token: string }[]): string | null {
71 if (tokens.length === 0) return null;
72 const idx = tokenRoundRobinIndex % tokens.length;
73 tokenRoundRobinIndex++;
74 return tokens[idx].token;
75}
76
77async function authenticate(request: Request, env: Env): Promise<string> {
78 const apiKeys = extractAPIKeys(request);

Callers 1

authenticateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected