Hash a key for safe use as a rate-limit bucket identifier.
(key: string)
| 41 | |
| 42 | /** Hash a key for safe use as a rate-limit bucket identifier. */ |
| 43 | function hashKey(key: string): string { |
| 44 | return createHash('sha256').update(key).digest('hex').slice(0, 16) |
| 45 | } |
| 46 | |
| 47 | // H-1: Warn at startup if auth is disabled |
| 48 | if (!getValidKeys()) { |