refactor: Update allowReauth option naming consistency
This commit is contained in:
parent
4360f546ee
commit
c887a64f83
4 changed files with 10 additions and 10 deletions
|
@ -80,7 +80,7 @@ docker run --name webssh2 -d -p 2222:2222 webssh2
|
||||||
|
|
||||||
## Headers
|
## Headers
|
||||||
|
|
||||||
- **allowreplay** - _boolean_ - Allow use of password replay feature, example `allowreplay: true`
|
- **allowReplay** - _boolean_ - Allow use of password replay feature, example `allowReplay: true`
|
||||||
|
|
||||||
- **mrhsession** - _string_ - Can be used to pass APM session for event correlation `mrhsession: abc123`
|
- **mrhsession** - _string_ - Can be used to pass APM session for event correlation `mrhsession: abc123`
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ docker run --name webssh2 -d -p 2222:2222 webssh2
|
||||||
|
|
||||||
- **options.challengeButton** - _boolean_ - Challenge button. This option, which is still under development, allows the user to resend the password to the server (in cases of step-up authentication for things like `sudo` or a router `enable` command.
|
- **options.challengeButton** - _boolean_ - Challenge button. This option, which is still under development, allows the user to resend the password to the server (in cases of step-up authentication for things like `sudo` or a router `enable` command.
|
||||||
|
|
||||||
- **options.allowreauth** - _boolean_ - Reauth button. This option creates an option to provide a button to create a new session with new credentials. See [issue 51](../../issues/51) and [pull 85](../../pull/85) for more detail.
|
- **options.allowReauth** - _boolean_ - Reauth button. This option creates an option to provide a button to create a new session with new credentials. See [issue 51](../../issues/51) and [pull 85](../../pull/85) for more detail.
|
||||||
|
|
||||||
- **algorithms** - _object_ - This option allows you to explicitly override the default transport layer algorithms used for the connection. Each value must be an array of valid algorithms for that category. The order of the algorithms in the arrays are important, with the most favorable being first. Valid keys:
|
- **algorithms** - _object_ - This option allows you to explicitly override the default transport layer algorithms used for the connection. Each value must be an array of valid algorithms for that category. The order of the algorithms in the arrays are important, with the most favorable being first. Valid keys:
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ const Ajv = require('ajv')
|
||||||
* @property {string} header.background - Header background color
|
* @property {string} header.background - Header background color
|
||||||
* @property {Object} options - Options configuration
|
* @property {Object} options - Options configuration
|
||||||
* @property {boolean} options.challengeButton - Challenge button enabled
|
* @property {boolean} options.challengeButton - Challenge button enabled
|
||||||
* @property {boolean} options.allowreauth - Allow reauthentication
|
* @property {boolean} options.allowReauth - Allow reauthentication
|
||||||
* @property {Object} algorithms - Encryption algorithms
|
* @property {Object} algorithms - Encryption algorithms
|
||||||
* @property {string[]} algorithms.kex - Key exchange algorithms
|
* @property {string[]} algorithms.kex - Key exchange algorithms
|
||||||
* @property {string[]} algorithms.cipher - Cipher algorithms
|
* @property {string[]} algorithms.cipher - Cipher algorithms
|
||||||
|
@ -81,7 +81,7 @@ const defaultConfig = {
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
challengeButton: true,
|
challengeButton: true,
|
||||||
allowreauth: false,
|
allowReauth: false,
|
||||||
allowReplay: false
|
allowReplay: false
|
||||||
},
|
},
|
||||||
algorithms: {
|
algorithms: {
|
||||||
|
@ -179,10 +179,10 @@ const configSchema = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
challengeButton: { type: 'boolean' },
|
challengeButton: { type: 'boolean' },
|
||||||
allowreauth: { type: 'boolean' },
|
allowReauth: { type: 'boolean' },
|
||||||
allowReplay: { type: 'boolean' }
|
allowReplay: { type: 'boolean' }
|
||||||
},
|
},
|
||||||
required: ['challengeButton', 'allowreauth', 'allowReplay']
|
required: ['challengeButton', 'allowReauth', 'allowReplay']
|
||||||
},
|
},
|
||||||
algorithms: {
|
algorithms: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
|
|
@ -83,8 +83,8 @@ function handleConnection(socket, config) {
|
||||||
conn.on('ready', () => {
|
conn.on('ready', () => {
|
||||||
console.log(`SSH CONNECTION READY: ${socket.id}`)
|
console.log(`SSH CONNECTION READY: ${socket.id}`)
|
||||||
socket.emit('auth_result', { success: true })
|
socket.emit('auth_result', { success: true })
|
||||||
socket.emit('allowreplay', config.options.allowReplay || false)
|
socket.emit('allowReplay', config.options.allowReplay || false)
|
||||||
socket.emit('allowreauth', config.options.allowreauth || false)
|
socket.emit('allowReauth', config.options.allowReauth || false)
|
||||||
setupSSHListeners(socket, creds)
|
setupSSHListeners(socket, creds)
|
||||||
initializeShell(socket, creds)
|
initializeShell(socket, creds)
|
||||||
})
|
})
|
||||||
|
@ -245,7 +245,7 @@ function handleConnection(socket, config) {
|
||||||
|
|
||||||
if (controlData === 'replayCredentials' && stream && credentials) {
|
if (controlData === 'replayCredentials' && stream && credentials) {
|
||||||
replayCredentials(socket, stream, credentials, config);
|
replayCredentials(socket, stream, credentials, config);
|
||||||
} else if (controlData === 'reauth' && config.options.allowreauth) {
|
} else if (controlData === 'reauth' && config.options.allowReauth) {
|
||||||
handleReauth(socket);
|
handleReauth(socket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"challengeButton": true,
|
"challengeButton": true,
|
||||||
"allowreauth": false
|
"allowReauth": false
|
||||||
},
|
},
|
||||||
"algorithms": {
|
"algorithms": {
|
||||||
"kex": [
|
"kex": [
|
||||||
|
|
Loading…
Reference in a new issue