1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-15 01:34:26 +02:00

Add credential prompts for PKCS11-based SSH keys (#4646)

- **PR Description**
Similar to #2239, add credential prompts for PKCS11-based SSH keys.
OpenSSH code reference is
[here](2827b6ac30/ssh-pkcs11.c (L263)).
This commit is contained in:
Stefan Haller
2025-06-20 08:26:01 +02:00
committed by GitHub
2 changed files with 8 additions and 1 deletions

View File

@ -391,6 +391,7 @@ func (self *cmdObjRunner) getCheckForCredentialRequestFunc() func([]byte) (Crede
`Username\s*for\s*'.+':`: Username,
`Enter\s*passphrase\s*for\s*key\s*'.+':`: Passphrase,
`Enter\s*PIN\s*for\s*.+\s*key\s*.+:`: PIN,
`Enter\s*PIN\s*for\s*'.+':`: PIN,
`.*2FA Token.*`: Token,
}

View File

@ -89,11 +89,17 @@ func TestProcessOutput(t *testing.T) {
expectedToWrite: "passphrase",
},
{
name: "pin prompt",
name: "security key pin prompt",
promptUserForCredential: defaultPromptUserForCredential,
output: "Enter PIN for key '123':",
expectedToWrite: "pin",
},
{
name: "pkcs11 key pin prompt",
promptUserForCredential: defaultPromptUserForCredential,
output: "Enter PIN for '123':",
expectedToWrite: "pin",
},
{
name: "2FA token prompt",
promptUserForCredential: defaultPromptUserForCredential,