MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / isAuthorized

Function isAuthorized

src/bot/auth.ts:18–23  ·  view source on GitHub ↗
(platform: Platform, userId: string, allow: AllowConfig)

Source from the content-addressed store, hash-verified

16 whatsapp?: { allowedUsers?: string[] };
17 signal?: { allowedUsers?: string[] };
18}
19
20export function isAuthorized(platform: Platform, userId: string, allow: AllowConfig): boolean {
21 const list = allow[platform]?.allowedUsers;
22 if (!list || list.length === 0) return false; // no allowlist ⇒ nobody
23 const id = String(userId);
24 return list.includes('*') || list.includes(id);
25}

Callers 3

bot-slack.test.tsFile · 0.90
bot-auth.test.tsFile · 0.90
onMessageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected