@replit/river 0.26.2 → 0.26.3
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/{chunk-MREEJE3X.js → chunk-3JCZNGF7.js} +2 -2
- package/dist/{chunk-IV27BICV.js → chunk-BB2E5L4U.js} +12 -13
- package/dist/chunk-BB2E5L4U.js.map +1 -0
- package/dist/{chunk-M5X4JTU3.js → chunk-JI6FFDY5.js} +5 -4
- package/dist/{chunk-M5X4JTU3.js.map → chunk-JI6FFDY5.js.map} +1 -1
- package/dist/{chunk-M75K5TJS.js → chunk-MZELCWJK.js} +2 -2
- package/dist/{chunk-M75K5TJS.js.map → chunk-MZELCWJK.js.map} +1 -1
- package/dist/{chunk-NC54BC47.js → chunk-OCL2FUTQ.js} +40 -14
- package/dist/chunk-OCL2FUTQ.js.map +1 -0
- package/dist/{chunk-YQABPD3C.js → chunk-X35QRIA5.js} +51 -56
- package/dist/chunk-X35QRIA5.js.map +1 -0
- package/dist/{chunk-AWCUCZY4.js → chunk-ZY2HYJ5Y.js} +2 -2
- package/dist/{client-654098be.d.ts → client-1894a9c9.d.ts} +2 -2
- package/dist/{connection-bc2454dc.d.ts → connection-03ffb583.d.ts} +1 -1
- package/dist/{handshake-1a86f06d.d.ts → handshake-154a0bb2.d.ts} +30 -1
- package/dist/logging/index.d.cts +1 -1
- package/dist/logging/index.d.ts +1 -1
- package/dist/{message-57296605.d.ts → message-ff78a233.d.ts} +1 -1
- package/dist/router/index.cjs +1 -1
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +9 -8
- package/dist/router/index.d.ts +9 -8
- package/dist/router/index.js +2 -2
- package/dist/{server-9a6b5a8e.d.ts → server-1f5eb427.d.ts} +17 -4
- package/dist/{services-7daa60a0.d.ts → services-491d8c32.d.ts} +3 -3
- package/dist/transport/impls/ws/client.cjs +52 -25
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +5 -4
- package/dist/transport/impls/ws/client.d.ts +5 -4
- package/dist/transport/impls/ws/client.js +8 -7
- package/dist/transport/impls/ws/client.js.map +1 -1
- package/dist/transport/impls/ws/server.cjs +88 -66
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +5 -4
- package/dist/transport/impls/ws/server.d.ts +5 -4
- package/dist/transport/impls/ws/server.js +5 -5
- package/dist/transport/index.cjs +96 -75
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +5 -4
- package/dist/transport/index.d.ts +5 -4
- package/dist/transport/index.js +5 -5
- package/dist/util/testHelpers.cjs +39 -13
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +5 -4
- package/dist/util/testHelpers.d.ts +5 -4
- package/dist/util/testHelpers.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-IV27BICV.js.map +0 -1
- package/dist/chunk-NC54BC47.js.map +0 -1
- package/dist/chunk-YQABPD3C.js.map +0 -1
- /package/dist/{chunk-MREEJE3X.js.map → chunk-3JCZNGF7.js.map} +0 -0
- /package/dist/{chunk-AWCUCZY4.js.map → chunk-ZY2HYJ5Y.js.map} +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { C as ClientTransport } from '../../../client-
|
|
2
|
-
import { c as TransportClientId } from '../../../message-
|
|
3
|
-
import { b as ProvidedClientTransportOptions } from '../../../handshake-
|
|
4
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
1
|
+
import { C as ClientTransport } from '../../../client-1894a9c9.js';
|
|
2
|
+
import { c as TransportClientId } from '../../../message-ff78a233.js';
|
|
3
|
+
import { b as ProvidedClientTransportOptions } from '../../../handshake-154a0bb2.js';
|
|
4
|
+
import { W as WebSocketConnection } from '../../../connection-03ffb583.js';
|
|
5
5
|
import { W as WsLike } from '../../../wslike-e0b32dd5.js';
|
|
6
6
|
import '@sinclair/typebox/value';
|
|
7
7
|
import '@sinclair/typebox';
|
|
8
8
|
import '@opentelemetry/api';
|
|
9
|
+
import '@sinclair/typebox/errors';
|
|
9
10
|
import '../../../types-3e5768ec.js';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { C as ClientTransport } from '../../../client-
|
|
2
|
-
import { c as TransportClientId } from '../../../message-
|
|
3
|
-
import { b as ProvidedClientTransportOptions } from '../../../handshake-
|
|
4
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
1
|
+
import { C as ClientTransport } from '../../../client-1894a9c9.js';
|
|
2
|
+
import { c as TransportClientId } from '../../../message-ff78a233.js';
|
|
3
|
+
import { b as ProvidedClientTransportOptions } from '../../../handshake-154a0bb2.js';
|
|
4
|
+
import { W as WebSocketConnection } from '../../../connection-03ffb583.js';
|
|
5
5
|
import { W as WsLike } from '../../../wslike-e0b32dd5.js';
|
|
6
6
|
import '@sinclair/typebox/value';
|
|
7
7
|
import '@sinclair/typebox';
|
|
8
8
|
import '@opentelemetry/api';
|
|
9
|
+
import '@sinclair/typebox/errors';
|
|
9
10
|
import '../../../types-3e5768ec.js';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientTransport
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-BB2E5L4U.js";
|
|
4
4
|
import {
|
|
5
5
|
WebSocketConnection
|
|
6
|
-
} from "../../../chunk-
|
|
7
|
-
import "../../../chunk-
|
|
6
|
+
} from "../../../chunk-ZY2HYJ5Y.js";
|
|
7
|
+
import "../../../chunk-JI6FFDY5.js";
|
|
8
8
|
import "../../../chunk-TAH2GVTJ.js";
|
|
9
|
-
import "../../../chunk-
|
|
10
|
-
import "../../../chunk-
|
|
9
|
+
import "../../../chunk-OCL2FUTQ.js";
|
|
10
|
+
import "../../../chunk-MZELCWJK.js";
|
|
11
11
|
import "../../../chunk-4PVU7J25.js";
|
|
12
12
|
|
|
13
13
|
// transport/impls/ws/client.ts
|
|
@@ -53,9 +53,10 @@ var WebSocketClientTransport = class extends ClientTransport {
|
|
|
53
53
|
};
|
|
54
54
|
});
|
|
55
55
|
const conn = new WebSocketConnection(ws);
|
|
56
|
-
this.log?.info(`raw websocket to ${to} ok
|
|
56
|
+
this.log?.info(`raw websocket to ${to} ok`, {
|
|
57
57
|
clientId: this.clientId,
|
|
58
|
-
connectedTo: to
|
|
58
|
+
connectedTo: to,
|
|
59
|
+
...conn.loggingMetadata
|
|
59
60
|
});
|
|
60
61
|
return conn;
|
|
61
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../transport/impls/ws/client.ts"],"sourcesContent":["import { ClientTransport } from '../../client';\nimport { TransportClientId } from '../../message';\nimport { ProvidedClientTransportOptions } from '../../options';\nimport { WebSocketConnection } from './connection';\nimport { WsLike } from './wslike';\n\n/**\n * A transport implementation that uses a WebSocket connection with automatic reconnection.\n * @class\n * @extends Transport\n */\nexport class WebSocketClientTransport extends ClientTransport<WebSocketConnection> {\n /**\n * A function that returns a Promise that resolves to a websocket URL.\n */\n wsGetter: (to: TransportClientId) => Promise<WsLike> | WsLike;\n\n /**\n * Creates a new WebSocketClientTransport instance.\n * @param wsGetter A function that returns a Promise that resolves to a WebSocket instance.\n * @param clientId The ID of the client using the transport. This should be unique per session.\n * @param serverId The ID of the server this transport is connecting to.\n * @param providedOptions An optional object containing configuration options for the transport.\n */\n constructor(\n wsGetter: (to: TransportClientId) => Promise<WsLike> | WsLike,\n clientId: TransportClientId,\n providedOptions?: ProvidedClientTransportOptions,\n ) {\n super(clientId, providedOptions);\n this.wsGetter = wsGetter;\n }\n\n async createNewOutgoingConnection(to: string) {\n this.log?.info(`establishing a new websocket to ${to}`, {\n clientId: this.clientId,\n connectedTo: to,\n });\n\n const ws = await this.wsGetter(to);\n\n await new Promise<void>((resolve, reject) => {\n if (ws.readyState === ws.OPEN) {\n resolve();\n return;\n }\n\n if (ws.readyState === ws.CLOSING || ws.readyState === ws.CLOSED) {\n reject(new Error('ws is closing or closed'));\n return;\n }\n\n ws.onopen = () => {\n resolve();\n };\n\n ws.onclose = (evt) => {\n reject(new Error(evt.reason));\n };\n\n ws.onerror = (err) => {\n reject(new Error(err.message));\n };\n });\n\n const conn = new WebSocketConnection(ws);\n this.log?.info(`raw websocket to ${to} ok
|
|
1
|
+
{"version":3,"sources":["../../../../transport/impls/ws/client.ts"],"sourcesContent":["import { ClientTransport } from '../../client';\nimport { TransportClientId } from '../../message';\nimport { ProvidedClientTransportOptions } from '../../options';\nimport { WebSocketConnection } from './connection';\nimport { WsLike } from './wslike';\n\n/**\n * A transport implementation that uses a WebSocket connection with automatic reconnection.\n * @class\n * @extends Transport\n */\nexport class WebSocketClientTransport extends ClientTransport<WebSocketConnection> {\n /**\n * A function that returns a Promise that resolves to a websocket URL.\n */\n wsGetter: (to: TransportClientId) => Promise<WsLike> | WsLike;\n\n /**\n * Creates a new WebSocketClientTransport instance.\n * @param wsGetter A function that returns a Promise that resolves to a WebSocket instance.\n * @param clientId The ID of the client using the transport. This should be unique per session.\n * @param serverId The ID of the server this transport is connecting to.\n * @param providedOptions An optional object containing configuration options for the transport.\n */\n constructor(\n wsGetter: (to: TransportClientId) => Promise<WsLike> | WsLike,\n clientId: TransportClientId,\n providedOptions?: ProvidedClientTransportOptions,\n ) {\n super(clientId, providedOptions);\n this.wsGetter = wsGetter;\n }\n\n async createNewOutgoingConnection(to: string) {\n this.log?.info(`establishing a new websocket to ${to}`, {\n clientId: this.clientId,\n connectedTo: to,\n });\n\n const ws = await this.wsGetter(to);\n\n await new Promise<void>((resolve, reject) => {\n if (ws.readyState === ws.OPEN) {\n resolve();\n return;\n }\n\n if (ws.readyState === ws.CLOSING || ws.readyState === ws.CLOSED) {\n reject(new Error('ws is closing or closed'));\n return;\n }\n\n ws.onopen = () => {\n resolve();\n };\n\n ws.onclose = (evt) => {\n reject(new Error(evt.reason));\n };\n\n ws.onerror = (err) => {\n reject(new Error(err.message));\n };\n });\n\n const conn = new WebSocketConnection(ws);\n this.log?.info(`raw websocket to ${to} ok`, {\n clientId: this.clientId,\n connectedTo: to,\n ...conn.loggingMetadata,\n });\n\n return conn;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAWO,IAAM,2BAAN,cAAuC,gBAAqC;AAAA;AAAA;AAAA;AAAA,EAIjF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,YACE,UACA,UACA,iBACA;AACA,UAAM,UAAU,eAAe;AAC/B,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,MAAM,4BAA4B,IAAY;AAC5C,SAAK,KAAK,KAAK,mCAAmC,EAAE,IAAI;AAAA,MACtD,UAAU,KAAK;AAAA,MACf,aAAa;AAAA,IACf,CAAC;AAED,UAAM,KAAK,MAAM,KAAK,SAAS,EAAE;AAEjC,UAAM,IAAI,QAAc,CAAC,SAAS,WAAW;AAC3C,UAAI,GAAG,eAAe,GAAG,MAAM;AAC7B,gBAAQ;AACR;AAAA,MACF;AAEA,UAAI,GAAG,eAAe,GAAG,WAAW,GAAG,eAAe,GAAG,QAAQ;AAC/D,eAAO,IAAI,MAAM,yBAAyB,CAAC;AAC3C;AAAA,MACF;AAEA,SAAG,SAAS,MAAM;AAChB,gBAAQ;AAAA,MACV;AAEA,SAAG,UAAU,CAAC,QAAQ;AACpB,eAAO,IAAI,MAAM,IAAI,MAAM,CAAC;AAAA,MAC9B;AAEA,SAAG,UAAU,CAAC,QAAQ;AACpB,eAAO,IAAI,MAAM,IAAI,OAAO,CAAC;AAAA,MAC/B;AAAA,IACF,CAAC;AAED,UAAM,OAAO,IAAI,oBAAoB,EAAE;AACvC,SAAK,KAAK,KAAK,oBAAoB,EAAE,OAAO;AAAA,MAC1C,UAAU,KAAK;AAAA,MACf,aAAa;AAAA,MACb,GAAG,KAAK;AAAA,IACV,CAAC;AAED,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -457,6 +457,7 @@ var StateMachineState = class {
|
|
|
457
457
|
}
|
|
458
458
|
if (prop === "_handleClose") {
|
|
459
459
|
return () => {
|
|
460
|
+
target._isConsumed = true;
|
|
460
461
|
target._handleStateExit();
|
|
461
462
|
target._handleClose();
|
|
462
463
|
};
|
|
@@ -537,15 +538,18 @@ var IdentifiedSession = class extends CommonSession {
|
|
|
537
538
|
}
|
|
538
539
|
get loggingMetadata() {
|
|
539
540
|
const spanContext = this.telemetry.span.spanContext();
|
|
540
|
-
|
|
541
|
+
const metadata = {
|
|
541
542
|
clientId: this.from,
|
|
542
543
|
connectedTo: this.to,
|
|
543
|
-
sessionId: this.id
|
|
544
|
-
|
|
544
|
+
sessionId: this.id
|
|
545
|
+
};
|
|
546
|
+
if (this.telemetry.span.isRecording()) {
|
|
547
|
+
metadata.telemetry = {
|
|
545
548
|
traceId: spanContext.traceId,
|
|
546
549
|
spanId: spanContext.spanId
|
|
547
|
-
}
|
|
548
|
-
}
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
return metadata;
|
|
549
553
|
}
|
|
550
554
|
constructMsg(partialMsg) {
|
|
551
555
|
const msg = {
|
|
@@ -627,7 +631,16 @@ var SessionConnecting = class extends IdentifiedSessionWithGracePeriod {
|
|
|
627
631
|
// close a pending connection if it resolves, ignore errors if the promise
|
|
628
632
|
// ends up rejected anyways
|
|
629
633
|
bestEffortClose() {
|
|
630
|
-
void this.connPromise.then((conn) =>
|
|
634
|
+
void this.connPromise.then((conn) => {
|
|
635
|
+
conn.close();
|
|
636
|
+
this.log?.info(
|
|
637
|
+
"connection eventually resolved but session has transitioned, closed connection",
|
|
638
|
+
{
|
|
639
|
+
...this.loggingMetadata,
|
|
640
|
+
...conn.loggingMetadata
|
|
641
|
+
}
|
|
642
|
+
);
|
|
643
|
+
}).catch(() => {
|
|
631
644
|
});
|
|
632
645
|
}
|
|
633
646
|
_handleStateExit() {
|
|
@@ -658,7 +671,7 @@ var SessionNoConnection = class extends IdentifiedSessionWithGracePeriod {
|
|
|
658
671
|
var import_api = require("@opentelemetry/api");
|
|
659
672
|
|
|
660
673
|
// package.json
|
|
661
|
-
var version = "0.26.
|
|
674
|
+
var version = "0.26.3";
|
|
662
675
|
|
|
663
676
|
// tracing/index.ts
|
|
664
677
|
function createSessionTelemetryInfo(sessionId, to, from, propagationCtx) {
|
|
@@ -697,6 +710,13 @@ var SessionWaitingForHandshake = class extends CommonSession {
|
|
|
697
710
|
this.conn.addErrorListener(this.listeners.onConnectionErrored);
|
|
698
711
|
this.conn.addCloseListener(this.listeners.onConnectionClosed);
|
|
699
712
|
}
|
|
713
|
+
get loggingMetadata() {
|
|
714
|
+
return {
|
|
715
|
+
clientId: this.from,
|
|
716
|
+
connId: this.conn.id,
|
|
717
|
+
...this.conn.loggingMetadata
|
|
718
|
+
};
|
|
719
|
+
}
|
|
700
720
|
onHandshakeData = (msg) => {
|
|
701
721
|
const parsedMsg = this.parseMsg(msg);
|
|
702
722
|
if (parsedMsg === null) {
|
|
@@ -708,12 +728,6 @@ var SessionWaitingForHandshake = class extends CommonSession {
|
|
|
708
728
|
}
|
|
709
729
|
this.listeners.onHandshake(parsedMsg);
|
|
710
730
|
};
|
|
711
|
-
get loggingMetadata() {
|
|
712
|
-
return {
|
|
713
|
-
clientId: this.from,
|
|
714
|
-
connId: this.conn.id
|
|
715
|
-
};
|
|
716
|
-
}
|
|
717
731
|
sendHandshake(msg) {
|
|
718
732
|
return this.conn.send(this.options.codec.toBuffer(msg));
|
|
719
733
|
}
|
|
@@ -746,6 +760,12 @@ var SessionHandshaking = class extends IdentifiedSessionWithGracePeriod {
|
|
|
746
760
|
this.conn.addErrorListener(this.listeners.onConnectionErrored);
|
|
747
761
|
this.conn.addCloseListener(this.listeners.onConnectionClosed);
|
|
748
762
|
}
|
|
763
|
+
get loggingMetadata() {
|
|
764
|
+
return {
|
|
765
|
+
...super.loggingMetadata,
|
|
766
|
+
...this.conn.loggingMetadata
|
|
767
|
+
};
|
|
768
|
+
}
|
|
749
769
|
onHandshakeData = (msg) => {
|
|
750
770
|
const parsedMsg = this.parseMsg(msg);
|
|
751
771
|
if (parsedMsg === null) {
|
|
@@ -833,6 +853,12 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
833
853
|
this.heartbeatMisses++;
|
|
834
854
|
}, this.options.heartbeatIntervalMs);
|
|
835
855
|
}
|
|
856
|
+
get loggingMetadata() {
|
|
857
|
+
return {
|
|
858
|
+
...super.loggingMetadata,
|
|
859
|
+
...this.conn.loggingMetadata
|
|
860
|
+
};
|
|
861
|
+
}
|
|
836
862
|
startActiveHeartbeat() {
|
|
837
863
|
this.isActivelyHeartbeating = true;
|
|
838
864
|
}
|
|
@@ -1334,8 +1360,9 @@ var Transport = class {
|
|
|
1334
1360
|
status: "disconnect",
|
|
1335
1361
|
session
|
|
1336
1362
|
});
|
|
1363
|
+
const to = session.to;
|
|
1337
1364
|
session.close();
|
|
1338
|
-
this.sessions.delete(
|
|
1365
|
+
this.sessions.delete(to);
|
|
1339
1366
|
}
|
|
1340
1367
|
// common listeners
|
|
1341
1368
|
onSessionGracePeriodElapsed(session) {
|
|
@@ -1568,14 +1595,53 @@ var ServerTransport = class extends Transport {
|
|
|
1568
1595
|
return;
|
|
1569
1596
|
}
|
|
1570
1597
|
let oldSession = this.sessions.get(msg.from);
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1598
|
+
let parsedMetadata = {};
|
|
1599
|
+
if (this.handshakeExtensions) {
|
|
1600
|
+
if (!import_value2.Value.Check(this.handshakeExtensions.schema, msg.payload.metadata)) {
|
|
1601
|
+
this.rejectHandshakeRequest(
|
|
1602
|
+
session,
|
|
1603
|
+
msg.from,
|
|
1604
|
+
"received malformed handshake metadata",
|
|
1605
|
+
"MALFORMED_HANDSHAKE_META",
|
|
1606
|
+
{
|
|
1607
|
+
...session.loggingMetadata,
|
|
1608
|
+
connectedTo: msg.from,
|
|
1609
|
+
validationErrors: [
|
|
1610
|
+
...import_value2.Value.Errors(
|
|
1611
|
+
this.handshakeExtensions.schema,
|
|
1612
|
+
msg.payload.metadata
|
|
1613
|
+
)
|
|
1614
|
+
]
|
|
1615
|
+
}
|
|
1616
|
+
);
|
|
1617
|
+
return;
|
|
1618
|
+
}
|
|
1619
|
+
const previousParsedMetadata = oldSession ? this.sessionHandshakeMetadata.get(oldSession.to) : void 0;
|
|
1620
|
+
const parsedMetadataOrFailureCode = await this.handshakeExtensions.validate(
|
|
1621
|
+
msg.payload.metadata,
|
|
1622
|
+
previousParsedMetadata
|
|
1623
|
+
);
|
|
1624
|
+
if (session._isConsumed) {
|
|
1625
|
+
return;
|
|
1626
|
+
}
|
|
1627
|
+
if (import_value2.Value.Check(
|
|
1628
|
+
HandshakeErrorCustomHandlerFatalResponseCodes,
|
|
1629
|
+
parsedMetadataOrFailureCode
|
|
1630
|
+
)) {
|
|
1631
|
+
this.rejectHandshakeRequest(
|
|
1632
|
+
session,
|
|
1633
|
+
msg.from,
|
|
1634
|
+
"rejected by handshake handler",
|
|
1635
|
+
parsedMetadataOrFailureCode,
|
|
1636
|
+
{
|
|
1637
|
+
...session.loggingMetadata,
|
|
1638
|
+
connectedTo: msg.from,
|
|
1639
|
+
clientId: this.clientId
|
|
1640
|
+
}
|
|
1641
|
+
);
|
|
1642
|
+
return;
|
|
1643
|
+
}
|
|
1644
|
+
parsedMetadata = parsedMetadataOrFailureCode;
|
|
1579
1645
|
}
|
|
1580
1646
|
let connectCase = "new session";
|
|
1581
1647
|
const clientNextExpectedSeq = msg.payload.expectedSessionState.nextExpectedSeq;
|
|
@@ -1707,50 +1773,6 @@ var ServerTransport = class extends Transport {
|
|
|
1707
1773
|
this.pendingSessions.delete(session);
|
|
1708
1774
|
connectedSession.startActiveHeartbeat();
|
|
1709
1775
|
}
|
|
1710
|
-
async validateHandshakeMetadata(handshakingSession, existingSession, rawMetadata, from) {
|
|
1711
|
-
if (!this.handshakeExtensions) {
|
|
1712
|
-
return {};
|
|
1713
|
-
}
|
|
1714
|
-
if (!import_value2.Value.Check(this.handshakeExtensions.schema, rawMetadata)) {
|
|
1715
|
-
this.rejectHandshakeRequest(
|
|
1716
|
-
handshakingSession,
|
|
1717
|
-
from,
|
|
1718
|
-
"received malformed handshake metadata",
|
|
1719
|
-
"MALFORMED_HANDSHAKE_META",
|
|
1720
|
-
{
|
|
1721
|
-
...handshakingSession.loggingMetadata,
|
|
1722
|
-
connectedTo: from,
|
|
1723
|
-
validationErrors: [
|
|
1724
|
-
...import_value2.Value.Errors(this.handshakeExtensions.schema, rawMetadata)
|
|
1725
|
-
]
|
|
1726
|
-
}
|
|
1727
|
-
);
|
|
1728
|
-
return false;
|
|
1729
|
-
}
|
|
1730
|
-
const previousParsedMetadata = existingSession ? this.sessionHandshakeMetadata.get(existingSession.to) : void 0;
|
|
1731
|
-
const parsedMetadataOrFailureCode = await this.handshakeExtensions.validate(
|
|
1732
|
-
rawMetadata,
|
|
1733
|
-
previousParsedMetadata
|
|
1734
|
-
);
|
|
1735
|
-
if (import_value2.Value.Check(
|
|
1736
|
-
HandshakeErrorCustomHandlerFatalResponseCodes,
|
|
1737
|
-
parsedMetadataOrFailureCode
|
|
1738
|
-
)) {
|
|
1739
|
-
this.rejectHandshakeRequest(
|
|
1740
|
-
handshakingSession,
|
|
1741
|
-
from,
|
|
1742
|
-
"rejected by handshake handler",
|
|
1743
|
-
parsedMetadataOrFailureCode,
|
|
1744
|
-
{
|
|
1745
|
-
...handshakingSession.loggingMetadata,
|
|
1746
|
-
connectedTo: from,
|
|
1747
|
-
clientId: this.clientId
|
|
1748
|
-
}
|
|
1749
|
-
);
|
|
1750
|
-
return false;
|
|
1751
|
-
}
|
|
1752
|
-
return parsedMetadataOrFailureCode;
|
|
1753
|
-
}
|
|
1754
1776
|
};
|
|
1755
1777
|
|
|
1756
1778
|
// transport/impls/ws/server.ts
|