(headers: Headers)
| 23 | * as programmatic API traffic vs interactive session traffic. |
| 24 | */ |
| 25 | export function hasExternalApiCredentials(headers: Headers): boolean { |
| 26 | if (headers.has(API_KEY_HEADER)) return true |
| 27 | const auth = headers.get('authorization') |
| 28 | return auth?.startsWith(BEARER_PREFIX) ?? false |
| 29 | } |
| 30 | |
| 31 | export interface AuthResult { |
| 32 | success: boolean |