Comparing version 5.0.0 to 5.1.0
{ | ||
"extends": "steelbrain" | ||
"extends": ["steelbrain", "prettier"] | ||
} |
@@ -0,45 +1,49 @@ | ||
#### 5.1.0 | ||
* Add keyboard authentication support (Thanks @dominiklessel) | ||
#### 5.0.0 | ||
- Add `onStdout`, `onStderr` to `exec{,Command}` | ||
- Change signature of `put{Files,Directory}` methods | ||
- Create empty directories remotely in `putDirectory` | ||
* Add `onStdout`, `onStderr` to `exec{,Command}` | ||
* Change signature of `put{Files,Directory}` methods | ||
* Create empty directories remotely in `putDirectory` | ||
#### 4.3.3 | ||
- Fix passing options in `execCommand` | ||
* Fix passing options in `execCommand` | ||
#### 4.2.2 | ||
- Fix put directory for long paths | ||
- Add tests for long paths in test suite | ||
* Fix put directory for long paths | ||
* Add tests for long paths in test suite | ||
#### 4.2.1 | ||
- Remove `mkdirp` in favor of homegrown solution to fix compatibility with SSH servers running on Windows | ||
* Remove `mkdirp` in favor of homegrown solution to fix compatibility with SSH servers running on Windows | ||
#### 4.2.0 | ||
- Fix a typo in README | ||
- Add support for passing direct options to `ssh2.exec` | ||
* Fix a typo in README | ||
* Add support for passing direct options to `ssh2.exec` | ||
#### 4.1.0 | ||
- Add sftp `opts` support in `getFile`, `putFile`, `putFiles` and `putDirectory` | ||
* Add sftp `opts` support in `getFile`, `putFile`, `putFiles` and `putDirectory` | ||
#### 4.0.1 | ||
- Fix support for `config.sock` | ||
* Fix support for `config.sock` | ||
#### 4.0.0 | ||
- Fix a bug where `.getFile` parameters were reversed. Published as a major change because it is API breaking | ||
* Fix a bug where `.getFile` parameters were reversed. Published as a major change because it is API breaking | ||
#### 3.1.0 | ||
- Implement sftp-backed `mkdir` | ||
- Implement `maxAtOnce` in `putFiles()` | ||
* Implement sftp-backed `mkdir` | ||
* Implement `maxAtOnce` in `putFiles()` | ||
#### 3.0.1 | ||
- Fix a bug for windows users where `.putDirectory()` wouldn't convert paths properly ( Thanks @lanxenet ) | ||
* Fix a bug for windows users where `.putDirectory()` wouldn't convert paths properly ( Thanks @lanxenet ) | ||
@@ -50,56 +54,56 @@ #### 3.0.0 | ||
- Rename `.end` to `.dispose` | ||
- Rename `.get` to `.getFile` | ||
- Rename `.put` to `.putFile` | ||
- Rename `.putMulti` to `.putFiles` | ||
- Add `.putDirectory` function to copy entire directories | ||
- Change order of `.getFile` parameters | ||
- Extended parameter validation in `.putFiles` | ||
- Close SFTP connections after they are used | ||
- Hide errors from `cd` when `cwd` is supplied but it does not exist | ||
- Do not throw sync errors in async functions, return a rejected promise instead | ||
- Propagate the private key read error if it's not ENOENT (ie. permissions issue) | ||
- Changed the signature of input in `.putFiles` (ie. lowercase the props, from Local to local and from Remote to remote) | ||
* Rename `.end` to `.dispose` | ||
* Rename `.get` to `.getFile` | ||
* Rename `.put` to `.putFile` | ||
* Rename `.putMulti` to `.putFiles` | ||
* Add `.putDirectory` function to copy entire directories | ||
* Change order of `.getFile` parameters | ||
* Extended parameter validation in `.putFiles` | ||
* Close SFTP connections after they are used | ||
* Hide errors from `cd` when `cwd` is supplied but it does not exist | ||
* Do not throw sync errors in async functions, return a rejected promise instead | ||
* Propagate the private key read error if it's not ENOENT (ie. permissions issue) | ||
* Changed the signature of input in `.putFiles` (ie. lowercase the props, from Local to local and from Remote to remote) | ||
#### 2.0.7 | ||
- Escape `cwd` parameter | ||
- Escape shell parameters | ||
* Escape `cwd` parameter | ||
* Escape shell parameters | ||
#### 2.0.6 | ||
- Fix more typos | ||
- Fix `.get`'s promise never resolving | ||
* Fix more typos | ||
* Fix `.get`'s promise never resolving | ||
#### 2.0.5 | ||
- Fix some typos | ||
* Fix some typos | ||
#### 2.0.4 | ||
- Fix `stdin` support in `.exec` and `.execCommand` | ||
* Fix `stdin` support in `.exec` and `.execCommand` | ||
#### 2.0.3 | ||
- Return `code` and `signal` in `.execCommand` if `stream` is set to `both` and in `.exec` | ||
* Return `code` and `signal` in `.execCommand` if `stream` is set to `both` and in `.exec` | ||
#### 2.0.2 | ||
- Fix a publishing issue | ||
* Fix a publishing issue | ||
#### 2.0.1 | ||
- Fix method name in README | ||
- Stricter validation of config | ||
* Fix method name in README | ||
* Stricter validation of config | ||
#### 2.0.0 | ||
- Rewrite from CoffeeScript to JS | ||
- Rename `.exec` to `.execCommand` | ||
- Accept config in `.connect` instead of constructor | ||
- Add new `.exec` method that formats given parameters automatically | ||
- Do not return file contents in `.get` because we already write it to a file | ||
* Rewrite from CoffeeScript to JS | ||
* Rename `.exec` to `.execCommand` | ||
* Accept config in `.connect` instead of constructor | ||
* Add new `.exec` method that formats given parameters automatically | ||
* Do not return file contents in `.get` because we already write it to a file | ||
#### 1.0.0 | ||
- Initial release | ||
* Initial release |
@@ -15,3 +15,5 @@ 'use strict'; | ||
stats = yield (0, _sbPromisify2.default)(sftp.stat).call(sftp, path); | ||
} catch (_) {/* No Op */} | ||
} catch (_) { | ||
/* No Op */ | ||
} | ||
if (stats) { | ||
@@ -74,2 +76,15 @@ if (stats.isDirectory()) { | ||
} | ||
config.tryKeyboard = !!config.tryKeyboard; | ||
if (config.tryKeyboard === true && typeof config.onKeyboardInteractive !== 'function') { | ||
config.onKeyboardInteractive = function (name, instructions, instructionsLang, prompts, finish) { | ||
if (prompts.length > 0 && prompts[0].prompt.toLowerCase().includes('password')) { | ||
finish([config.password]); | ||
} | ||
}; | ||
} else { | ||
config.onKeyboardInteractive = null; | ||
} | ||
return config; | ||
@@ -76,0 +91,0 @@ }); |
@@ -62,2 +62,5 @@ 'use strict'; | ||
connection.on('error', reject); | ||
if (config.onKeyboardInteractive) { | ||
connection.on('keyboard-interactive', config.onKeyboardInteractive); | ||
} | ||
connection.on('ready', function () { | ||
@@ -64,0 +67,0 @@ connection.removeListener('error', reject); |
{ | ||
"name": "node-ssh", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "SS2 with Promises", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "(apm test) && (flow check) && (eslint . )", | ||
"clean": "rm -rf lib", | ||
"build": "npm run clean; babel src --out-dir lib", | ||
"watch": "npm run clean; babel src --out-dir lib --watch" | ||
"test": "(apm test) && (flow check) && (eslint . ) && (prettier -l '{src,spec}/**/*.js')", | ||
"build": "sb-babel-cli -o lib src", | ||
"watch": "npm run build -- -w" | ||
}, | ||
@@ -34,10 +33,13 @@ "repository": { | ||
"devDependencies": { | ||
"babel-cli": "^6.11.4", | ||
"babel-preset-steelbrain": "^5.0.0", | ||
"eslint-config-steelbrain": "^3.0.1", | ||
"flow-bin": "^0.46.0", | ||
"jasmine-fix": "^1.0.1", | ||
"babel-core": "^6.26.0", | ||
"babel-preset-steelbrain": "^5.0.3", | ||
"eslint-config-prettier": "^2.9.0", | ||
"eslint-config-steelbrain": "^4.0.1", | ||
"flow-bin": "^0.63.1", | ||
"jasmine-fix": "^1.3.1", | ||
"prettier": "^1.10.2", | ||
"pty.js": "^0.3.1", | ||
"ssh2-streams": "^0.1.6" | ||
"sb-babel-cli": "0.1.1", | ||
"ssh2-streams": "^0.1.20" | ||
} | ||
} |
@@ -134,3 +134,3 @@ Node-SSH - SSH2 with Promises | ||
putFiles(files: Array<{ local: string, remote: string }>, options: PutFilesOptions = {}): Promise<void> | ||
putDirectory(localDirectory: string, remoteDirectory: string, options: PutDirectoryOptions: {}): Promise<boolean> | ||
putDirectory(localDirectory: string, remoteDirectory: string, options: PutDirectoryOptions = {}): Promise<boolean> | ||
dispose(): void | ||
@@ -140,2 +140,28 @@ } | ||
### Keyboard-interactive user authentication | ||
In some cases you have to enable keyboard-interactive user authentication. Otherwise you will get an `All configured authentication methods failed` error. | ||
#### Example: | ||
```js | ||
const password = 'test' | ||
ssh.connect({ | ||
host: 'localhost', | ||
username: 'steel', | ||
password, | ||
tryKeyboard: true | ||
onKeyboardInteractive: (name, instructions, instructionsLang, prompts, finish) => { | ||
if (prompts.length > 0 && prompts[0].prompt.toLowerCase().includes('password')) { | ||
finish([password]) | ||
} | ||
} | ||
}) | ||
``` | ||
For further information see: https://github.com/mscdex/ssh2/issues/604 | ||
### License | ||
@@ -142,0 +168,0 @@ This project is licensed under the terms of MIT license. See the LICENSE file for more info. |
Sorry, the diff of this file is not supported yet
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
35961
12
560
169
10