()
| 332 | // --------------------------------------------------------------------------- |
| 333 | |
| 334 | function getAccessTokens(): string[] { |
| 335 | const single = process.env.ACCESS_TOKEN; |
| 336 | const multi = process.env.ACCESS_TOKENS; |
| 337 | const tokens: string[] = []; |
| 338 | if (single) tokens.push(single); |
| 339 | if (multi) { |
| 340 | for (const t of multi.split(",")) { |
| 341 | const trimmed = t.trim(); |
| 342 | if (trimmed && !tokens.includes(trimmed)) tokens.push(trimmed); |
| 343 | } |
| 344 | } |
| 345 | return tokens; |
| 346 | } |
| 347 | |
| 348 | function safeTokenMatch(input: string, tokens: string[]): boolean { |
| 349 | const inputBuf = Buffer.from(input); |
no outgoing calls
no test coverage detected