MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / getAuthorizationHeader

Function getAuthorizationHeader

lib/auth.ts:5–13  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3}
4
5export 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
15export function configureClientAuth(client: any): any {
16 const authHeader = getAuthorizationHeader()

Callers 1

configureClientAuthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected