Comparing version 1.5.0 to 1.6.0
@@ -26,2 +26,4 @@ 'use strict'; | ||
* @param {number} [opts.connectTimeout=10000] ssh connect timeout | ||
* @param {boolean} [opts.strictHostKeyChecking=true] verify host authenticity | ||
* @param {string} [opts.identity] private key for public key authentication | ||
*/ | ||
@@ -42,2 +44,4 @@ __constructor: function (opts) { | ||
this._closeDeferred = q.defer(); | ||
this._strictHostKeyChecking = opts.strictHostKeyChecking === undefined ? true : opts.strictHostKeyChecking; | ||
this._identity = opts.identity; | ||
}, | ||
@@ -129,5 +133,7 @@ | ||
'-v', | ||
this._strictHostKeyChecking === false ? '-o StrictHostKeyChecking=no' : '', | ||
this._identity ? util.format('-i %s', this._identity) : '', | ||
util.format('-p %d', this._sshPort), | ||
(this.user ? this.user + '@' : '') + this.host | ||
]; | ||
].filter(Boolean); | ||
}, | ||
@@ -134,0 +140,0 @@ |
{ | ||
"name": "ssh-tun", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "Module for establishing ssh tunnel", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -121,2 +121,26 @@ var Tunnel = require('../'), | ||
it('should spawn tunnel with StrictHostKeyChecking=no if host verification is disabled', function () { | ||
tunnel = createTunnel({ | ||
strictHostKeyChecking: false | ||
}); | ||
tunnel.open(); | ||
var sshArgs = childProcess.spawn.lastCall.args[1]; | ||
expect(sshArgs).to.contain('-o StrictHostKeyChecking=no'); | ||
}); | ||
it('should spawn tunnel with provided identity file disabled', function () { | ||
tunnel = createTunnel({ | ||
identity: '~/.ssh/id_rsa_alt' | ||
}); | ||
tunnel.open(); | ||
var sshArgs = childProcess.spawn.lastCall.args[1]; | ||
expect(sshArgs).to.contain('-i ~/.ssh/id_rsa_alt'); | ||
}); | ||
it('should resolve promise if tunnel successfully created', function () { | ||
@@ -123,0 +147,0 @@ tunnel = createTunnel(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
20478
403
2