(apiKey: string)
| 1161 | ) |
| 1162 | |
| 1163 | function isValidApiKey(apiKey: string): boolean { |
| 1164 | // Only allow alphanumeric characters, dashes, and underscores |
| 1165 | return /^[a-zA-Z0-9-_]+$/.test(apiKey) |
| 1166 | } |
| 1167 | |
| 1168 | export async function saveApiKey(apiKey: string): Promise<void> { |
| 1169 | if (!isValidApiKey(apiKey)) { |