(text: string)
| 52 | |
| 53 | /** Parse host/keyType/fingerprint from OpenSSH output. */ |
| 54 | export function parseHostKeyPrompt(text: string): { |
| 55 | host: string; |
| 56 | keyType: string; |
| 57 | fingerprint: string; |
| 58 | prompt: string; |
| 59 | } { |
| 60 | const hostMatch = /authenticity of host '([^']+)'/.exec(text); |
| 61 | const keyMatch = /(\w+) key fingerprint is (SHA256:\S+)/.exec(text); |
| 62 | return { |
| 63 | host: hostMatch?.[1] ?? "unknown", |
| 64 | keyType: keyMatch?.[1] ?? "unknown", |
| 65 | fingerprint: keyMatch?.[2] ?? "unknown", |
| 66 | prompt: text.trim(), |
| 67 | }; |
| 68 | } |
| 69 | |
| 70 | export interface AskpassSession { |
| 71 | /** Merge into the spawn env: { ...process.env, ...env } */ |
no test coverage detected