(request: http.IncomingMessage)
| 45 | } |
| 46 | |
| 47 | function 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 | |
| 54 | function isLoopbackHost(host: string): boolean { |
| 55 | if (host === "localhost") return true |
no test coverage detected