@@ -62,7 +62,7 @@ const (
|
||||
// Auth methods
|
||||
const (
|
||||
SSHAuthMethodNone byte = 0x00
|
||||
SSHAuthMethodPasspharse byte = 0x01
|
||||
SSHAuthMethodPassphrase byte = 0x01
|
||||
SSHAuthMethodPrivateKey byte = 0x02
|
||||
)
|
||||
|
||||
@@ -205,7 +205,7 @@ func (d *sshClient) buildAuthMethod(
|
||||
return nil
|
||||
}, nil
|
||||
|
||||
case SSHAuthMethodPasspharse:
|
||||
case SSHAuthMethodPassphrase:
|
||||
return func(b []byte) []ssh.AuthMethod {
|
||||
return []ssh.AuthMethod{
|
||||
ssh.PasswordCallback(func() (string, error) {
|
||||
@@ -218,13 +218,13 @@ func (d *sshClient) buildAuthMethod(
|
||||
return "", wErr
|
||||
}
|
||||
|
||||
passpharseBytes, passpharseReceived := <-d.credentialReceive
|
||||
passphraseBytes, passphraseReceived := <-d.credentialReceive
|
||||
|
||||
if !passpharseReceived {
|
||||
if !passphraseReceived {
|
||||
return "", ErrSSHAuthCancelled
|
||||
}
|
||||
|
||||
return string(passpharseBytes), nil
|
||||
return string(passphraseBytes), nil
|
||||
}),
|
||||
}
|
||||
}, nil
|
||||
|
||||
@@ -240,17 +240,17 @@ function startApp(rootEl) {
|
||||
date: serverDate ? new Date(serverDate) : null
|
||||
};
|
||||
},
|
||||
async submitAuth(passpharse) {
|
||||
async submitAuth(passphrase) {
|
||||
this.authErr = "";
|
||||
|
||||
try {
|
||||
let result = await this.doAuth(passpharse);
|
||||
let result = await this.doAuth(passphrase);
|
||||
|
||||
switch (result.result) {
|
||||
case 200:
|
||||
this.socket = this.buildSocket(
|
||||
{
|
||||
data: passpharse,
|
||||
data: passphrase,
|
||||
fetch() {
|
||||
return this.data;
|
||||
}
|
||||
@@ -262,7 +262,7 @@ function startApp(rootEl) {
|
||||
break;
|
||||
|
||||
case 403:
|
||||
this.authErr = "Authentication has failed. Wrong passpharse?";
|
||||
this.authErr = "Authentication has failed. Wrong passphrase?";
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
22
ui/auth.vue
22
ui/auth.vue
@@ -28,13 +28,13 @@
|
||||
<div
|
||||
class="field"
|
||||
:class="{
|
||||
error: passpharseErr.length > 0 || error.length > 0
|
||||
error: passphraseErr.length > 0 || error.length > 0
|
||||
}"
|
||||
>
|
||||
Passpharse
|
||||
Passphrase
|
||||
|
||||
<input
|
||||
v-model="passpharse"
|
||||
v-model="passphrase"
|
||||
v-focus="true"
|
||||
:disabled="submitting"
|
||||
type="password"
|
||||
@@ -45,7 +45,7 @@
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if="passpharseErr.length <= 0 && error.length <= 0"
|
||||
v-if="passphraseErr.length <= 0 && error.length <= 0"
|
||||
class="message"
|
||||
>
|
||||
A valid password is required in order to use this
|
||||
@@ -53,7 +53,7 @@
|
||||
instance
|
||||
</div>
|
||||
<div v-else class="error">
|
||||
{{ passpharseErr || error }}
|
||||
{{ passphraseErr || error }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -91,8 +91,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
submitting: false,
|
||||
passpharse: "",
|
||||
passpharseErr: ""
|
||||
passphrase: "",
|
||||
passphraseErr: ""
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -105,8 +105,8 @@ export default {
|
||||
mounted() {},
|
||||
methods: {
|
||||
auth() {
|
||||
if (this.passpharse.length <= 0) {
|
||||
this.passpharseErr = "Passpharse cannot be empty";
|
||||
if (this.passphrase.length <= 0) {
|
||||
this.passphraseErr = "Passphrase cannot be empty";
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -117,9 +117,9 @@ export default {
|
||||
|
||||
this.submitting = true;
|
||||
|
||||
this.passpharseErr = "";
|
||||
this.passphraseErr = "";
|
||||
|
||||
this.$emit("auth", this.passpharse);
|
||||
this.$emit("auth", this.passphrase);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ import * as strings from "./string.js";
|
||||
import Exception from "./exception.js";
|
||||
|
||||
const AUTHMETHOD_NONE = 0x01;
|
||||
const AUTHMETHOD_PASSPHARSE = 0x01;
|
||||
const AUTHMETHOD_PASSPHRASE = 0x01;
|
||||
const AUTHMETHOD_PRIVATE_KEY = 0x02;
|
||||
|
||||
const COMMAND_ID = 0x01;
|
||||
@@ -301,15 +301,15 @@ const initialFieldDef = {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
Passpharse: {
|
||||
name: "Passpharse",
|
||||
Passphrase: {
|
||||
name: "Passphrase",
|
||||
description: "",
|
||||
type: "password",
|
||||
value: "",
|
||||
example: "----------",
|
||||
verify(d) {
|
||||
if (d.length <= 0) {
|
||||
throw new Error("Passpharse must be specified");
|
||||
throw new Error("Passphrase must be specified");
|
||||
}
|
||||
|
||||
if (d.length > MAX_PASSWORD_LEN) {
|
||||
@@ -318,7 +318,7 @@ const initialFieldDef = {
|
||||
);
|
||||
}
|
||||
|
||||
return "We'll login with this passpharse";
|
||||
return "We'll login with this passphrase";
|
||||
}
|
||||
},
|
||||
"Private Key": {
|
||||
@@ -396,7 +396,7 @@ function getAuthMethodFromStr(d) {
|
||||
return AUTHMETHOD_NONE;
|
||||
|
||||
case "Password":
|
||||
return AUTHMETHOD_PASSPHARSE;
|
||||
return AUTHMETHOD_PASSPHRASE;
|
||||
|
||||
case "Private Key":
|
||||
return AUTHMETHOD_PRIVATE_KEY;
|
||||
@@ -694,8 +694,8 @@ class Wizard {
|
||||
fieldName = "";
|
||||
|
||||
switch (config.auth) {
|
||||
case AUTHMETHOD_PASSPHARSE:
|
||||
fieldName = "Passpharse";
|
||||
case AUTHMETHOD_PASSPHRASE:
|
||||
fieldName = "Passphrase";
|
||||
break;
|
||||
|
||||
case AUTHMETHOD_PRIVATE_KEY:
|
||||
|
||||
Reference in New Issue
Block a user