Skip to content

Commit

Permalink
chore: replace privateKey with privatekey for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
billchurch committed Dec 2, 2024
1 parent c48fadb commit d1b3a07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/ssh.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ class SSHConnection extends EventEmitter {
// Try private key first if available and useKey is true
if (useKey && (creds.privatekey || this.config.user.privatekey)) {
debug("Using private key authentication")
const privateKey = creds.privatekey || this.config.user.privatekey
if (!this.validatePrivateKey(privateKey)) {
const privatekey = creds.privatekey || this.config.user.privatekey
if (!this.validatePrivateKey(privatekey)) {
throw new SSHConnectionError("Invalid private key format")
}
config.privateKey = privateKey
config.privatekey = privatekey
} else if (creds.password) {
debug("Using password authentication")
config.password = creds.password
Expand Down
2 changes: 1 addition & 1 deletion tests/ssh.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ MIIEpTestKeyContentHere
return sshConnection.connect(mockCreds).then(() => {
expect(mockSSH2Client.connect).toHaveBeenCalledWith(
expect.objectContaining({
privateKey: validPrivateKey,
privatekey: validPrivateKey,
username: mockCreds.username
})
)
Expand Down

0 comments on commit d1b3a07

Please sign in to comment.