140
* `kbiHandler`. Isolating that here keeps it out of the iteration loop below.
141
*/
143
>
attempt: SSHAuthAttempt,
144
>
kbiHandler: SSHKeyboardInteractivePromptHandler | undefined,
145
>
keyPassphraseHandler: SSHKeyPassphrasePromptHandler | undefined,
146
>
callback: (next: AnyAuthMethod | false) => void,
147
>
): AnyAuthMethod | undefined {
148
>
switch (attempt.type) {
149
>
case 'publickey': {
150
// Strip our internal `keyPath` metadata before handing to ssh2.
151
const { keyPath: _kp, encrypted: _encrypted, ...payload } = attempt;