MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / clientRequestPrincipalFromRequest

Function clientRequestPrincipalFromRequest

projects/runtime-node/src/server.ts:47–52  ·  view source on GitHub ↗
(request: http.IncomingMessage)

Source from the content-addressed store, hash-verified

45}
46
47function clientRequestPrincipalFromRequest(request: http.IncomingMessage): string | undefined {
48 const token = tokenFromRequest(request)
49 if (!token) return undefined
50 const tokenHash = createHash("sha256").update(token).digest("hex")
51 return `runtime-token:${tokenHash}`
52}
53
54function isLoopbackHost(host: string): boolean {
55 if (host === "localhost") return true

Callers 1

attachSocketFunction · 0.85

Calls 2

tokenFromRequestFunction · 0.85
updateMethod · 0.65

Tested by

no test coverage detected