Skip to content

feat(ssh): suppress PasswordCallback in BatchMode - #368

Merged
kke merged 6 commits into
mainfrom
ssh-config-batch-mode
Jun 4, 2026
Merged

kke merged 6 commits into
mainfrom
ssh-config-batch-mode

Conversation

@kke

@kke kke commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Kimmo Lehto <klehto@mirantis.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the internal SSH key loading behavior to respect BatchMode by preventing passphrase prompting when an encrypted private key is encountered, and adds unit tests to validate the new behavior.

Changes:

  • Short-circuit encrypted key handling in pkeySigner when BatchMode=yes, avoiding PasswordCallback prompts.
  • Add tests that generate an encrypted ed25519 key and assert BatchMode vs non-BatchMode behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
protocol/ssh/connection.go Skip passphrase prompting for encrypted identity files when BatchMode is enabled.
protocol/ssh/connection_test.go Adds unit tests covering encrypted-key handling with and without BatchMode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread protocol/ssh/connection.go Resolved
Comment thread protocol/ssh/connection_test.go Resolved
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread protocol/ssh/connection_test.go Resolved
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread protocol/ssh/connection.go Resolved
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread protocol/ssh/connection.go Resolved
Comment thread protocol/ssh/connection_test.go Resolved
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread protocol/ssh/connection_test.go Resolved
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@kke
kke marked this pull request as ready for review June 4, 2026 06:20
@kke
kke merged commit 64b21ce into main Jun 4, 2026
13 checks passed
@kke
kke deleted the ssh-config-batch-mode branch June 4, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants