MCPcopy Index your code
hub / github.com/codeaashu/claude-code / readToken

Function readToken

src/upstreamproxy/upstreamproxy.ts:206–218  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

204}
205
206async function readToken(path: string): Promise<string | null> {
207 try {
208 const raw = await readFile(path, 'utf8')
209 return raw.trim() || null
210 } catch (err) {
211 if (isENOENT(err)) return null
212 logForDebugging(
213 `[upstreamproxy] token read failed: ${err instanceof Error ? err.message : String(err)}`,
214 { level: 'warn' },
215 )
216 return null
217 }
218}
219
220/**
221 * prctl(PR_SET_DUMPABLE, 0) via libc FFI. Blocks same-UID ptrace of this

Callers 1

initUpstreamProxyFunction · 0.85

Calls 3

readFileFunction · 0.85
isENOENTFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected