no string response
This commit is contained in:
parent
05025d209a
commit
0c8a27a7fe
4 changed files with 10 additions and 10 deletions
|
@ -32,7 +32,7 @@ export const createSignature = {
|
||||||
const server = selfTag;
|
const server = selfTag;
|
||||||
const tag = `${client.name}@${server.host}:${server.port}-${data.publicKey}`;
|
const tag = `${client.name}@${server.host}:${server.port}-${data.publicKey}`;
|
||||||
var signature = await sign(tag, await getSettings(SETTINGS.privateKey));
|
var signature = await sign(tag, await getSettings(SETTINGS.privateKey));
|
||||||
aws("ok", signature);
|
aws("ok", { sign: signature });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,7 @@ export const remote1 = {
|
||||||
client.challenge = get64(64);
|
client.challenge = get64(64);
|
||||||
client.state = STATE.remoteP;
|
client.state = STATE.remoteP;
|
||||||
client.remoteKey = data.publicKey;
|
client.remoteKey = data.publicKey;
|
||||||
aws("ok", client.challenge);
|
aws("ok", { challenge: client.challenge });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
client.suspect();
|
client.suspect();
|
||||||
aws("error", "signature");
|
aws("error", "signature");
|
||||||
|
|
|
@ -33,10 +33,10 @@ const list = [
|
||||||
accountKey
|
accountKey
|
||||||
}, "error", "config");
|
}, "error", "config");
|
||||||
}], ["remote", async (req) => {
|
}], ["remote", async (req) => {
|
||||||
let signature = await req({ "authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}` },
|
let signature = (await req({ "authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}` },
|
||||||
"createSignature", {
|
"createSignature", {
|
||||||
publicKey
|
publicKey
|
||||||
}, "ok", null);
|
}, "ok", null)).sign;
|
||||||
let falseSignature = await sign("lol", privateKey);
|
let falseSignature = await sign("lol", privateKey);
|
||||||
let token = (await req({}, "requestTempToken", {}, "ok", { token: null })).token;
|
let token = (await req({}, "requestTempToken", {}, "ok", { token: null })).token;
|
||||||
|
|
||||||
|
@ -58,14 +58,14 @@ const list = [
|
||||||
sign: falseSignature
|
sign: falseSignature
|
||||||
}, "error", "signature");
|
}, "error", "signature");
|
||||||
|
|
||||||
let challenge = await req({
|
let challenge = (await req({
|
||||||
"authorization": `Bearer ${token}`
|
"authorization": `Bearer ${token}`
|
||||||
}, "remote1", {
|
}, "remote1", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "localhost:7224",
|
||||||
publicKey,
|
publicKey,
|
||||||
sign: signature
|
sign: signature
|
||||||
}, "ok", null);
|
}, "ok", null)).challenge;
|
||||||
|
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Bearer ${token}`
|
"authorization": `Bearer ${token}`
|
||||||
|
|
|
@ -40,9 +40,9 @@ const list = [
|
||||||
server: "localhost:7224",
|
server: "localhost:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
let signature = await req(handler, "createSignature", {
|
let signature = (await req(handler, "createSignature", {
|
||||||
publicKey
|
publicKey
|
||||||
}, "ok", null);
|
}, "ok", null)).sign;
|
||||||
let falseSignature = await sign("lol", privateKey);
|
let falseSignature = await sign("lol", privateKey);
|
||||||
let h2 = await newHandler();
|
let h2 = await newHandler();
|
||||||
await req(h2, "remote1", {
|
await req(h2, "remote1", {
|
||||||
|
@ -57,12 +57,12 @@ const list = [
|
||||||
publicKey,
|
publicKey,
|
||||||
sign: falseSignature
|
sign: falseSignature
|
||||||
}, "error", "signature");
|
}, "error", "signature");
|
||||||
let challenge = await req(h2, "remote1", {
|
let challenge = (await req(h2, "remote1", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "localhost:7224",
|
||||||
publicKey,
|
publicKey,
|
||||||
sign: signature
|
sign: signature
|
||||||
}, "ok", null);
|
}, "ok", null)).challenge;
|
||||||
await req(h2, "remote1", {
|
await req(h2, "remote1", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "localhost:7224",
|
||||||
|
|
Loading…
Reference in a new issue