Support encrypted SSH private key passphrases - #50
Merged
Conversation
Co-authored-by: gensyn <36128035+gensyn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add optional passphrase parameter for private key
Support encrypted SSH private key passphrases
Sep 1, 2026
Co-authored-by: gensyn <36128035+gensyn@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The functional changes are small, validated end-to-end via updated schema/validation, and covered by new unit tests for both forwarding and error handling.
Pull request overview
Adds support for encrypted SSH private keys by introducing an optional passphrase service parameter, validating its usage, and forwarding it into the AsyncSSH connection flow so passphrase-protected keys can be decrypted during authentication.
Changes:
- Added
passphraseto thessh_command.executeservice schema, validation rules, and connection kwargs. - Added user-facing strings/translations and updated README/service metadata to expose the new field.
- Extended unit tests to cover validation and AsyncSSH error handling/forwarding for passphrases.
File summaries
| File | Description |
|---|---|
| translations/en.json | Adds service-field label/description and new validation/error translation keys for passphrase support. |
| translations/de.json | Adds German translations for the new passphrase field and related validation/error messages. |
| strings.json | Updates base integration strings with the new passphrase field and error/validation messages. |
| services.yaml | Exposes passphrase in service UI schema (and marks secrets as password-type text fields). |
| README.md | Documents the new passphrase parameter and its validation rule. |
| const.py | Introduces CONF_PASSPHRASE constant. |
| init.py | Extends service validation and voluptuous schema to accept/validate passphrase. |
| coordinator.py | Forwards passphrase into asyncssh.connect(...) and maps KeyEncryptionError to a translated validation error. |
| tests/unit_tests/test_validate_service_data.py | Adds validation tests for passphrase/key_file combinations. |
| tests/unit_tests/test_async_execute.py | Adds tests for invalid passphrase handling and forwarding passphrase to connect. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The SSH service accepted either a password or a key file, but it did not support encrypted private keys. That blocked valid SSH auth flows when a key was protected by a passphrase.
passphrasefield to thessh_command.executeservice and documented it alongsidekey_file.passphraseis only accepted whenkey_fileis provided, preventing invalid combinations.asyncssh.connect(...)so encrypted private keys can be decrypted during authentication.