Fix PEM formatting bug when loading private SSH keys in _get_pkey_object
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
Summary
When providing RSA private keys (especially in single-line format or missing proper PEM line breaks), the _get_pkey_object method fails with paramiko.SSHException, even for valid keys.
Environment
- StackStorm version: 3.8.1
- Affected component: st2common/st2common/runners/paramiko_ssh.py key parsing
- Python version: 3.8
- OS: Ubuntu 24.04.1
Steps to Reproduce
- Use an inline RSA private key with no line breaks, such as from an environment variable or API POST.
- Execute an SSH action.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in st2common/st2common/runners/paramiko_ssh.py at _get_pkey_object and reproduce the failure with the inline RSA private key format described in the issue. Trace the key parsing path and verify that valid keys without PEM line breaks load successfully when an SSH action is executed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100