lunel-cli 0.1.93 → 0.1.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -4
- package/dist/transport/v2.d.ts +1 -1
- package/dist/transport/v2.js +4 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2836,15 +2836,12 @@ async function connectWebSocketV2() {
|
|
|
2836
2836
|
if (!currentSessionPassword) {
|
|
2837
2837
|
throw new Error("missing password for websocket connect");
|
|
2838
2838
|
}
|
|
2839
|
-
if (!currentSessionCode) {
|
|
2840
|
-
throw new Error("missing session code for secure transport");
|
|
2841
|
-
}
|
|
2842
2839
|
console.log(`Connecting to gateway ${gatewayUrl}...`);
|
|
2843
2840
|
activeGatewayUrl = gatewayUrl;
|
|
2844
2841
|
const transport = new V2SessionTransport({
|
|
2845
2842
|
gatewayUrl,
|
|
2846
2843
|
password: currentSessionPassword,
|
|
2847
|
-
|
|
2844
|
+
sessionSecret: currentSessionPassword,
|
|
2848
2845
|
role: "cli",
|
|
2849
2846
|
debugLog: DEBUG_MODE ? debugLog : undefined,
|
|
2850
2847
|
handlers: {
|
package/dist/transport/v2.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface V2TransportHandlers {
|
|
|
9
9
|
export interface V2TransportOptions {
|
|
10
10
|
gatewayUrl: string;
|
|
11
11
|
password: string;
|
|
12
|
-
|
|
12
|
+
sessionSecret: string;
|
|
13
13
|
role: "cli" | "app";
|
|
14
14
|
handlers: V2TransportHandlers;
|
|
15
15
|
debugLog?: (message: string, ...args: unknown[]) => void;
|
package/dist/transport/v2.js
CHANGED
|
@@ -127,6 +127,9 @@ export class V2SessionTransport {
|
|
|
127
127
|
this.resetPeerSession();
|
|
128
128
|
await this.maybeStartHandshake();
|
|
129
129
|
}
|
|
130
|
+
else if (raw.type === "peer_disconnected" || raw.type === "app_disconnected") {
|
|
131
|
+
this.resetPeerSession();
|
|
132
|
+
}
|
|
130
133
|
return;
|
|
131
134
|
}
|
|
132
135
|
if (isV2HandshakeFrame(raw)) {
|
|
@@ -302,7 +305,7 @@ export class V2SessionTransport {
|
|
|
302
305
|
}
|
|
303
306
|
}
|
|
304
307
|
computeHandshakeAuth(phase, senderRole, peerPubkeyB64, nonce, boxed) {
|
|
305
|
-
const authKey = sodium.crypto_generichash(sodium.crypto_auth_KEYBYTES, encodeUtf8(this.options.
|
|
308
|
+
const authKey = sodium.crypto_generichash(sodium.crypto_auth_KEYBYTES, encodeUtf8(this.options.sessionSecret), undefined);
|
|
306
309
|
const parts = [
|
|
307
310
|
phase,
|
|
308
311
|
senderRole,
|