Commit 5817e4e
committed
Improve error message for encrypted SSH keys without password
When a password-protected SSH private key is provided without the
'password' field in the Secret, the error message was misleading:
"SSH agent requested but SSH_AUTH_SOCK not-specified"
This change detects encrypted SSH keys early by attempting to parse
the identity with ssh.ParseRawPrivateKey and checking for
PassphraseMissingError. When detected, a clear error is returned
pointing the user to add the 'password' field to their Secret.
Fixes #802
Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>1 parent 5376a7e commit 5817e4e
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
651 | 652 | | |
652 | 653 | | |
653 | 654 | | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
654 | 671 | | |
655 | 672 | | |
656 | 673 | | |
| |||
0 commit comments