(platform: Platform, userId: string, allow: AllowConfig)
| 16 | whatsapp?: { allowedUsers?: string[] }; |
| 17 | signal?: { allowedUsers?: string[] }; |
| 18 | } |
| 19 | |
| 20 | export 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 | } |
no outgoing calls
no test coverage detected