vortexpy 4.0.24__tar.gz → 4.0.25__tar.gz
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.
- {vortexpy-4.0.24/vortexpy.egg-info → vortexpy-4.0.25}/PKG-INFO +1 -1
- {vortexpy-4.0.24 → vortexpy-4.0.25}/pyproject.toml +1 -1
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexServerWebsocket.py +45 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/__init__.py +1 -1
- {vortexpy-4.0.24 → vortexpy-4.0.25/vortexpy.egg-info}/PKG-INFO +1 -1
- {vortexpy-4.0.24 → vortexpy-4.0.25}/LICENSE +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/README.md +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/setup.cfg +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/DataWrapTuple.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/DeferUtil.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/Jsonable.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/Payload.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/PayloadEndpoint.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/PayloadEndpointTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/PayloadEnvelope.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/PayloadFilterKeys.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/PayloadIO.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/PayloadPriority.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/PayloadResponse.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/PayloadResponseTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/PayloadTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/PerformTestActionTuple.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/SerialiseUtil.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/TestTuple.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/Tuple.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/TupleAction.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/TupleActionVortex.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/TupleDataForTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/TuplePerfTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/TuplePolymorphicTupleTypeFieldArgTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/TupleRestfulTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/TupleSelector.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/TupleTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexABC.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexClientHttp.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexClientHttpTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexClientTcp.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexClientWebsocketFactory.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexConnectionABC.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexFactory.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexPayloadProtocol.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexServer.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexServerConnection.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexServerHttpResource.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexServerTcp.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexTcpMemoryLeakPayloadTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexTcpMemoryLeakRawTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexUtil.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/VortexWritePushProducer.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/data_loader/TupleDataLiveLockManager.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/data_loader/TupleDataLoader.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/data_loader/TupleDataLoaderDelegate.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/data_loader/TupleDataLoaderTupleABC.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/data_loader/TupleDataLoaderTuples.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/data_loader/__init__.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/event_bus/TupleChangeEventABC.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/event_bus/TupleChangeEventBus.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/event_bus/TupleChangeEventBusObserverABC.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/event_bus/__init__.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/handler/TupleActionProcessor.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/handler/TupleActionProcessorProxy.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/handler/TupleActionProcessorTestHandler.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/handler/TupleDataActionClient.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/handler/TupleDataObservableCache.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/handler/TupleDataObservableHandler.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/handler/TupleDataObservableProxyHandler.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/handler/TupleDataObservableTestHandler.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/handler/TupleDataObserverClient.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/handler/VortexJSTupleLoaderTestHandler.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/handler/__init__.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/restful/GzippedDataHttpClient.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/restful/GzippedDataHttpClientTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/restful/GzippedPayloadHttpClient.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/restful/RestfulHttpClient.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/restful/RestfulHttpClientTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/restful/RestfulResource.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/restful/RestfulResourceTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/restful/__init__.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/rpc/RPC.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/rpc/RPCTest.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/rpc/__init__.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/sqla_orm/OrmCrudHandler.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/sqla_orm/TupleProviderForDb.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/sqla_orm/VortexTupleJson.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/sqla_orm/__init__.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/storage/TupleStorageSqlite.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortex/storage/__init__.py +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortexpy.egg-info/SOURCES.txt +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortexpy.egg-info/dependency_links.txt +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortexpy.egg-info/requires.txt +0 -0
- {vortexpy-4.0.24 → vortexpy-4.0.25}/vortexpy.egg-info/top_level.txt +0 -0
|
@@ -7,7 +7,7 @@ license-file = "LICENSE"
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "vortexpy"
|
|
10
|
-
version = "4.0.
|
|
10
|
+
version = "4.0.25"
|
|
11
11
|
license = {file = "LICENSE"}
|
|
12
12
|
authors = [{name = "Synerty", email = "contact@synerty.com"}]
|
|
13
13
|
description = "Synertys observable, routable, data serialisation and transport code."
|
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
* Support : support@synerty.com
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
+
import json
|
|
10
11
|
import logging
|
|
11
12
|
from collections import deque
|
|
13
|
+
from datetime import datetime, timezone
|
|
12
14
|
from random import random
|
|
13
15
|
from urllib.parse import parse_qs
|
|
14
16
|
from urllib.parse import urlparse
|
|
@@ -226,6 +228,11 @@ class VortexWebSocketUpgradeResource(resource.Resource):
|
|
|
226
228
|
|
|
227
229
|
If this resource is hit, it will attempt to upgrade the connection to a websocket.
|
|
228
230
|
|
|
231
|
+
Plain HTTP GETs without WebSocket upgrade headers are answered with 200 and a
|
|
232
|
+
small JSON body so browser-side reachability probes (vortexjs NetworkStateBrowser
|
|
233
|
+
on /vortexws) can confirm the resource is present. txWS rejects non-upgrade
|
|
234
|
+
requests during an upgrade handshake, which App Proxy surfaces as 502 Bad Gateway.
|
|
235
|
+
|
|
229
236
|
"""
|
|
230
237
|
|
|
231
238
|
isLeaf = 1
|
|
@@ -238,9 +245,47 @@ class VortexWebSocketUpgradeResource(resource.Resource):
|
|
|
238
245
|
resource.Resource.__init__(self)
|
|
239
246
|
self._websocketFactory = websocketFactory
|
|
240
247
|
|
|
248
|
+
@staticmethod
|
|
249
|
+
def _isWebsocketUpgrade(request) -> bool:
|
|
250
|
+
connection = b"".join(
|
|
251
|
+
request.requestHeaders.getRawHeaders(b"connection", [])
|
|
252
|
+
).lower()
|
|
253
|
+
upgrade = b"".join(
|
|
254
|
+
request.requestHeaders.getRawHeaders(b"upgrade", [])
|
|
255
|
+
).lower()
|
|
256
|
+
return b"upgrade" in connection and upgrade == b"websocket"
|
|
257
|
+
|
|
258
|
+
def _renderGet(self, request):
|
|
259
|
+
from vortex.VortexFactory import VortexFactory
|
|
260
|
+
|
|
261
|
+
if not VortexFactory.canConnect(str(request.client.host)):
|
|
262
|
+
request.setResponseCode(503)
|
|
263
|
+
request.setHeader("Retry-After", str(max(10, int(random() * 100))))
|
|
264
|
+
return b"Rejected due to new connections throttling."
|
|
265
|
+
|
|
266
|
+
request.setResponseCode(200)
|
|
267
|
+
request.setHeader(b"Content-Type", b"application/json")
|
|
268
|
+
request.setHeader(b"Cache-Control", b"no-store")
|
|
269
|
+
return json.dumps(
|
|
270
|
+
{
|
|
271
|
+
"success": True,
|
|
272
|
+
"websocket": True,
|
|
273
|
+
"upgradeable": True,
|
|
274
|
+
"date": datetime.now(timezone.utc).isoformat(),
|
|
275
|
+
}
|
|
276
|
+
).encode("utf-8")
|
|
277
|
+
|
|
241
278
|
def render(self, request):
|
|
242
279
|
from vortex.VortexFactory import VortexFactory
|
|
243
280
|
|
|
281
|
+
if request.method in (b"GET", b"HEAD") and not self._isWebsocketUpgrade(
|
|
282
|
+
request
|
|
283
|
+
):
|
|
284
|
+
body = self._renderGet(request)
|
|
285
|
+
if request.method == b"HEAD":
|
|
286
|
+
return b""
|
|
287
|
+
return body
|
|
288
|
+
|
|
244
289
|
if not VortexFactory.canConnect(str(request.client.host)):
|
|
245
290
|
request.setResponseCode(503)
|
|
246
291
|
request.setHeader("Retry-After", str(max(10, int(random() * 100))))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|