()
| 3 | } |
| 4 | |
| 5 | export function getAuthorizationHeader(): string | undefined { |
| 6 | const password = process.env.OPENCODE_SERVER_PASSWORD |
| 7 | if (!password) return undefined |
| 8 | |
| 9 | const username = process.env.OPENCODE_SERVER_USERNAME ?? "opencode" |
| 10 | // Use Buffer for Node.js base64 encoding (btoa may not be available in all Node versions) |
| 11 | const credentials = Buffer.from(`${username}:${password}`).toString("base64") |
| 12 | return `Basic ${credentials}` |
| 13 | } |
| 14 | |
| 15 | export function configureClientAuth(client: any): any { |
| 16 | const authHeader = getAuthorizationHeader() |
no outgoing calls
no test coverage detected