(challenge: string)
| 60 | const challenges: string[] = []; |
| 61 | const sockets = new Set<net.Socket>(); |
| 62 | const proofFor = (challenge: string): string | null => { |
| 63 | const mode = opts.proof ?? 'valid'; |
| 64 | if (mode === 'none') return null; |
| 65 | if (mode === 'other-key') return daemonProof(randomBytes(32), challenge, socketPath); |
| 66 | // A key this process can't read (a test faking another uid) proves nothing, as in the daemon. |
| 67 | const key = daemonKey(); |
| 68 | return key ? daemonProof(key, challenge, mode === 'other-path' ? `${socketPath}-elsewhere` : socketPath) : null; |
| 69 | }; |
| 70 | const server = net.createServer((socket) => { |
| 71 | sockets.add(socket); |
| 72 | socket.on('close', () => sockets.delete(socket)); |
no test coverage detected